Bläddra i källkod

处方表增加制单状态字段

cgp 3 dagar sedan
förälder
incheckning
49174b0331

+ 27 - 1
fs-doctor-app/src/main/java/com/fs/app/controller/FsPrescribeDataScrmController.java

@@ -10,9 +10,12 @@ import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.dto.BeforePrescribeAddDoctorAdviceDTO;
 import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
+import com.fs.his.dto.FsPrescribeDataDoctorUpdateDto;
 import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
 import com.fs.his.service.IFsPrescribeDataScrmService;
+import com.fs.his.vo.DoctorSignVO;
 import com.fs.qw.vo.FsPrescribeDataScrmVO;
 import com.github.pagehelper.PageHelper;
 import io.jsonwebtoken.Claims;
@@ -24,7 +27,7 @@ import java.io.IOException;
 import java.util.List;
 
 /**
- * 处方表(SCRM)Controller
+ * 商城处方表(SCRM)Controller
  *
  * @author ruoyi
  * @date 2026-06-11
@@ -124,6 +127,29 @@ public class FsPrescribeDataScrmController extends BaseController
         List<FsPrescribeDataScrmVO> list=fsPrescribeScrmService.pendingStorePrescribeList(queryDto);
         return getDataTable(list);
     }
+
+    /**
+     * 获取医生、药师签名信息
+     * @param doctorIds 医生id和药师id
+     * @return 医生、药师签名信息
+     * */
+    @GetMapping("/getSignInfo")
+    public AjaxResult getDoctorSignInfo(List<Long> doctorIds){
+        DoctorSignVO signVO=fsPrescribeScrmService.getDoctorSignInfo(doctorIds);
+        return AjaxResult.success(signVO);
+    }
+
+    /**
+     * 商城处方-医生提交建议-开方前的操作
+     * */
+    @PostMapping("/addDoctorAdvice")
+    public AjaxResult addDoctorAdvice(@RequestBody BeforePrescribeAddDoctorAdviceDTO addDoctorAdviceDTO){
+        int count=fsPrescribeScrmService.addDoctorAdvice(addDoctorAdviceDTO);
+        if (count>0){
+            return AjaxResult.success();
+        }
+        return AjaxResult.error();
+    }
     /**
      * 获取当前登录医生id
      * */

+ 32 - 0
fs-service/src/main/java/com/fs/his/dto/BeforePrescribeAddDoctorAdviceDTO.java

@@ -0,0 +1,32 @@
+package com.fs.his.dto;
+
+import lombok.Data;
+/**
+ * 商城处方开方前的医生建议
+ * */
+@Data
+public class BeforePrescribeAddDoctorAdviceDTO {
+    /**
+     * 商城处方主键id
+     * */
+    private Long prescribeId;
+    /**
+     * 诊断
+     * */
+    private String diagnose;
+
+    /**
+     * 舌诊、面诊、手诊
+     * */
+    private String facialDiagnosis;
+
+    /**
+     * 治疗方面
+     * */
+    private String healingAreaJson;
+
+    /**
+     * 注意禁忌
+     * */
+    private String noteTaboos;
+}

+ 3 - 0
fs-service/src/main/java/com/fs/his/dto/FsPrescribeDataDoctorQueryDto.java

@@ -13,6 +13,9 @@ public class FsPrescribeDataDoctorQueryDto {
     /** 处方类型 1西药 2中药 3中药+西药处方*/
     private Integer prescribeType;
 
+    /** 是否制单(0:否,1:是)*/
+    private Integer isDocument;
+
     /** 订单编号 */
     private String orderCode;
 

+ 25 - 0
fs-service/src/main/java/com/fs/his/enums/DoctorTypeEnum.java

@@ -0,0 +1,25 @@
+package com.fs.his.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 医生/药师类型枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum DoctorTypeEnum {
+
+    DOCTOR(1, "医生"),
+    PHARMACIST(2, "药师");
+
+    /**
+     * 类型编码
+     */
+    private final Integer code;
+
+    /**
+     * 类型描述
+     */
+    private final String desc;
+}

+ 12 - 4
fs-service/src/main/java/com/fs/his/service/IFsPrescribeDataScrmService.java

@@ -1,10 +1,8 @@
 package com.fs.his.service;
 
 import com.fs.his.domain.FsPrescribeDataScrm;
-import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
-import com.fs.his.dto.FsPrescribeDataDoctorUpdateDto;
-import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
-import com.fs.his.dto.FsPrescribeDataDrugDoctorUpdateDto;
+import com.fs.his.dto.*;
+import com.fs.his.vo.DoctorSignVO;
 import com.fs.qw.vo.FsPrescribeDataScrmVO;
 
 import java.util.List;
@@ -106,4 +104,14 @@ public interface IFsPrescribeDataScrmService
      * 药师---操作商城处方
      * */
     int drugDoctorExecuteScrmPrescribe(FsPrescribeDataDrugDoctorUpdateDto updateDto);
+
+    /**
+     * 获取医生、药师签名信息
+     * */
+    DoctorSignVO getDoctorSignInfo(List<Long> doctorIds);
+
+    /**
+     * 添加医生建议
+     * */
+    int addDoctorAdvice(BeforePrescribeAddDoctorAdviceDTO addDoctorAdviceDTO);
 }

+ 61 - 4
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeDataScrmServiceImpl.java

@@ -4,16 +4,16 @@ import com.fs.common.BeanCopyUtils;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
 import com.fs.his.domain.*;
-import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
-import com.fs.his.dto.FsPrescribeDataDoctorUpdateDto;
-import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
-import com.fs.his.dto.FsPrescribeDataDrugDoctorUpdateDto;
+import com.fs.his.dto.*;
+import com.fs.his.enums.DoctorTypeEnum;
+import com.fs.his.mapper.FsDoctorMapper;
 import com.fs.his.mapper.FsPrescribeDataScrmDrugMapper;
 import com.fs.his.mapper.FsPrescribeDataScrmMapper;
 import com.fs.his.mapper.PrescribeScrmTaskRecordMapper;
 import com.fs.his.param.PrescribeXyImgParam;
 import com.fs.his.service.IFsPrescribeDataScrmService;
 import com.fs.his.service.PrescriptionImageService;
+import com.fs.his.vo.DoctorSignVO;
 import com.fs.his.vo.FsPrescribeDataScrmImgVO;
 import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.mapper.FsStoreProductScrmMapper;
@@ -54,6 +54,10 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
     private PrescriptionImageService prescriptionImageService;
     @Autowired
     private FsStoreProductScrmMapper fsStoreProductScrmMapper;
+
+    @Autowired
+    private FsDoctorMapper fsDoctorMapper;
+
     @Autowired
     private ApplicationContext applicationContext;
 
@@ -176,6 +180,59 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
         return fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(updatePrescribe);
     }
 
+    @Override
+    public DoctorSignVO getDoctorSignInfo(List<Long> doctorIds) {
+        // 1. 参数健壮性校验
+        if (CollectionUtils.isEmpty(doctorIds)) {
+            throw new CustomException("医生ID列表不能为空");
+        }
+
+        List<FsDoctor> doctorList = fsDoctorMapper.selectDoctorByIds(doctorIds);
+        if (CollectionUtils.isEmpty(doctorList)) {
+            log.error("未查询到有效医生信息, 医生id:{}", doctorIds);
+            throw new CustomException("医生已停用或不存在,请联系管理员");
+        }
+
+        DoctorSignVO doctorSignVO = new DoctorSignVO();
+
+        doctorList.stream()
+                .filter(doctor -> doctor.getDoctorType() != null)
+                .forEach(doctor -> {
+                    Integer type = doctor.getDoctorType();
+                    if (DoctorTypeEnum.DOCTOR.getCode().equals(type)) {
+                        // 医生信息赋值
+                        doctorSignVO.setDoctorId(doctor.getDoctorId());
+                        doctorSignVO.setDoctorName(doctor.getDoctorName());
+                        doctorSignVO.setDoctorSignUrl(doctor.getSignUrl());
+                    } else if (DoctorTypeEnum.PHARMACIST.getCode().equals(type)) {
+                        // 药师信息赋值
+                        doctorSignVO.setDrugDoctorId(doctor.getDoctorId());
+                        doctorSignVO.setDrugDoctorName(doctor.getDoctorName());
+                        doctorSignVO.setDrugDoctorSignUrl(doctor.getSignUrl());
+                    }
+                });
+
+        return doctorSignVO;
+    }
+
+    @Override
+    public int addDoctorAdvice(BeforePrescribeAddDoctorAdviceDTO addDoctorAdviceDTO) {
+        //获取处方信息
+        FsPrescribeDataScrm fsPrescribeDataScrm = fsPrescribeDataScrmMapper.selectFsPrescribeDataScrmByPrescribeId(addDoctorAdviceDTO.getPrescribeId());
+        if (fsPrescribeDataScrm == null) {
+            log.error("未查询到有效处方信息, 处方id:{}", addDoctorAdviceDTO.getPrescribeId());
+            throw new CustomException("未查询到有效处方信息");
+        }
+        //组装处方信息
+        fsPrescribeDataScrm.setDiagnose(addDoctorAdviceDTO.getDiagnose());
+        fsPrescribeDataScrm.setFacialDiagnosis(addDoctorAdviceDTO.getFacialDiagnosis());
+        fsPrescribeDataScrm.setNoteTaboos(addDoctorAdviceDTO.getNoteTaboos());
+        //TODO 处理“治疗方面”json格式
+        //fsPrescribeDataScrm.setHealingAreaJson(JSON.toJSONString(addDoctorAdviceDTO.getHealingArea()));
+        //fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(fsPrescribeDataScrm);
+        return 0;
+    }
+
     // ==================== 处方图片生成 ====================
     /**
      * 生成处方图片(异步任务调用)

+ 33 - 0
fs-service/src/main/java/com/fs/his/vo/DoctorSignVO.java

@@ -0,0 +1,33 @@
+package com.fs.his.vo;
+
+import lombok.Data;
+/**
+ * 医生签名信息
+ * */
+@Data
+public class DoctorSignVO {
+    /*
+    * 医生id
+    * */
+    private Long doctorId;
+    /*
+     * 药师id
+     * */
+    private Long drugDoctorId;
+    /*
+     * 医生姓名
+     * */
+    private String doctorName;
+    /*
+     * 药师姓名
+     * */
+    private String drugDoctorName;
+    /*
+     * 医生签名url
+     * */
+    private String doctorSignUrl;
+    /*
+     * 药师签名url
+     * */
+    private String drugDoctorSignUrl;
+}

+ 1 - 1
fs-service/src/main/resources/mapper/his/FsDoctorMapper.xml

@@ -128,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectDoctorByIds" resultMap="FsDoctorResult">
         <include refid="selectFsDoctorVo"/>
-        WHERE doctor_id IN
+        WHERE status = 1 AND doctor_id IN
         <foreach collection="ids" item="doctorId" open="(" close=")" separator=",">
             #{doctorId}
         </foreach>