|
@@ -2,7 +2,12 @@ package com.fs.app.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fs.app.annotation.Login;
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
@@ -13,7 +18,15 @@ import com.fs.his.param.*;
|
|
|
import com.fs.his.service.*;
|
|
import com.fs.his.service.*;
|
|
|
import com.fs.his.vo.FsDoctorPrescribeListDVO;
|
|
import com.fs.his.vo.FsDoctorPrescribeListDVO;
|
|
|
import com.fs.his.vo.FsPrescribeListDVO;
|
|
import com.fs.his.vo.FsPrescribeListDVO;
|
|
|
|
|
+import com.fs.hisStore.config.MedicalMallConfig;
|
|
|
|
|
+import com.fs.hospital580.entity.Hospital580PrescriptionMedicineScrmEntity;
|
|
|
|
|
+import com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity;
|
|
|
|
|
+import com.fs.hospital580.service.Hospital580PrescriptionMedicineScrmService;
|
|
|
|
|
+import com.fs.hospital580.service.Hospital580PrescriptionScrmService;
|
|
|
|
|
+import com.fs.hospital580.vo.res.PrescriptionListRes;
|
|
|
import com.fs.im.service.IImService;
|
|
import com.fs.im.service.IImService;
|
|
|
|
|
+import com.fs.system.domain.SysConfig;
|
|
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -26,10 +39,9 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.HashMap;
|
|
|
|
|
-import java.util.HashSet;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
+import java.time.ZoneId;
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Api("处方接口")
|
|
@Api("处方接口")
|
|
@@ -56,6 +68,13 @@ public class PrescribeController extends AppBaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IImService imService;
|
|
private IImService imService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private Hospital580PrescriptionScrmService orderScrmService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private Hospital580PrescriptionMedicineScrmService medicineScrmService;
|
|
|
@Login
|
|
@Login
|
|
|
@GetMapping("/getDoctorPrescribeList")
|
|
@GetMapping("/getDoctorPrescribeList")
|
|
|
public R getDoctorPrescribeList(FsDoctorPrescribeListDParam param)
|
|
public R getDoctorPrescribeList(FsDoctorPrescribeListDParam param)
|
|
@@ -72,6 +91,50 @@ public class PrescribeController extends AppBaseController {
|
|
|
@GetMapping("/getPrescribeList")
|
|
@GetMapping("/getPrescribeList")
|
|
|
public R getPrescribeList(FsPrescribeListDParam param)
|
|
public R getPrescribeList(FsPrescribeListDParam param)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (getPrescribeType()){
|
|
|
|
|
+ // 问诊列表
|
|
|
|
|
+ IPage<Hospital580PrescriptionScrmEntity> page = orderScrmService.page(
|
|
|
|
|
+ new Page<Hospital580PrescriptionScrmEntity>(param.getPageNum(), param.getPageSize())
|
|
|
|
|
+ , new LambdaQueryWrapper<Hospital580PrescriptionScrmEntity>()
|
|
|
|
|
+ .eq(Hospital580PrescriptionScrmEntity::getDoctorId,param.getDoctorId())
|
|
|
|
|
+ .orderByDesc(Hospital580PrescriptionScrmEntity::getCreateTime)
|
|
|
|
|
+ );
|
|
|
|
|
+ List<FsPrescribeListDVO> list = page.getRecords().stream()
|
|
|
|
|
+ .map(order -> {
|
|
|
|
|
+ FsPrescribeListDVO vo = new FsPrescribeListDVO();
|
|
|
|
|
+ vo.setPrescribeId(order.getPreId());
|
|
|
|
|
+ vo.setPrescribeType(Integer.valueOf(order.getServiceType()));
|
|
|
|
|
+ vo.setPrescribeCode(order.getSerialNo());
|
|
|
|
|
+ vo.setPatientAge(order.getUserFamilyAge().toString());
|
|
|
|
|
+ vo.setPatientName(order.getUserFamilyName());
|
|
|
|
|
+ vo.setPatientGender(order.getUserFamilyGender().toString());
|
|
|
|
|
+ vo.setPrescribeImgUrl(order.getDstFilePath());
|
|
|
|
|
+ vo.setAuditReason(order.getReason());
|
|
|
|
|
+ vo.setDiagnose(order.getTags());
|
|
|
|
|
+ vo.setAuditTime(Date.from(order.getAuditTime().atZone(ZoneId.of("Asia/Shanghai")).toInstant()));
|
|
|
|
|
+ vo.setCreateTime(Date.from(order.getCreateTime().atZone(ZoneId.of("Asia/Shanghai")).toInstant()));
|
|
|
|
|
+
|
|
|
|
|
+ List<Hospital580PrescriptionMedicineScrmEntity> list1 = medicineScrmService.list(new LambdaQueryWrapper<Hospital580PrescriptionMedicineScrmEntity>()
|
|
|
|
|
+ .eq(Hospital580PrescriptionMedicineScrmEntity::getPreId, order.getPreId()));
|
|
|
|
|
+ vo.setDrugs(list1.stream()
|
|
|
|
|
+ .map(medicine -> {
|
|
|
|
|
+ FsPrescribeDrug drug = new FsPrescribeDrug();
|
|
|
|
|
+ drug.setDrugName(medicine.getDrugName());
|
|
|
|
|
+ drug.setDrugNum(Long.valueOf(medicine.getAmount()));
|
|
|
|
|
+ drug.setUsageMethod(medicine.getInstructions());
|
|
|
|
|
+ drug.setDrugSpec(medicine.getSpec());
|
|
|
|
|
+ return drug;
|
|
|
|
|
+ })
|
|
|
|
|
+ .collect(Collectors.toList()));
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ })
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ PageInfo<FsPrescribeListDVO> listPageInfo=new PageInfo<>(list);
|
|
|
|
|
+ return R.ok().put("data",listPageInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
param.setDoctorId(Long.parseLong(getDoctorId()));
|
|
param.setDoctorId(Long.parseLong(getDoctorId()));
|
|
|
param.setDoctorDrugId(Long.parseLong(getDoctorId()));
|
|
param.setDoctorDrugId(Long.parseLong(getDoctorId()));
|
|
@@ -80,6 +143,16 @@ public class PrescribeController extends AppBaseController {
|
|
|
return R.ok().put("data",listPageInfo);
|
|
return R.ok().put("data",listPageInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private Boolean getPrescribeType() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch");
|
|
|
|
|
+ MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class);
|
|
|
|
|
+ return medicalMallConfig.getPrescribeType().equals(1);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Login
|
|
@Login
|
|
|
@GetMapping("/getPrescribeById")
|
|
@GetMapping("/getPrescribeById")
|