Explorar el Código

订单管理增加”处方图片“+医生完善客户信息、修改医生开方图片的生成逻辑

cgp hace 2 días
padre
commit
63228fa4bc

+ 100 - 0
fs-company/src/main/java/com/fs/company/controller/his/FsPrescribeDataScrmController.java

@@ -0,0 +1,100 @@
+package com.fs.company.controller.his;
+
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.his.domain.FsPrescribeDataScrm;
+import com.fs.his.service.IFsPrescribeDataScrmService;
+import com.fs.his.vo.CustomerInfoVO;
+import com.fs.his.vo.DoctorSignVO;
+import com.fs.his.vo.PrescribeScrmDoctorAdviceVO;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.qw.service.IFsCompanyCustomerService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+/**
+ * 商城处方表(SCRM)Controller
+ *
+ * @author ruoyi
+ * @date 2026-06-11
+ */
+@RestController
+@RequestMapping("/his/prescribeDataScrm")
+public class FsPrescribeDataScrmController extends BaseController
+{
+    @Autowired
+    private IFsPrescribeDataScrmService fsPrescribeScrmService;
+
+    @Autowired
+    private IFsCompanyCustomerService fsCompanyCustomerService;
+
+    @Autowired
+    private IFsStoreOrderScrmService storeOrderScrmService;
+
+
+    /**
+     * 获取商城处方表(SCRM)详细信息
+     */
+    @GetMapping(value = "/{prescribeId}")
+    public AjaxResult getInfo(@PathVariable("prescribeId") Long prescribeId)
+    {
+        return AjaxResult.success(fsPrescribeScrmService.selectFsPrescribeDataScrmByPrescribeId(prescribeId));
+    }
+
+    /**
+     * 根据订单号获取处方信息
+     */
+    @GetMapping(value = "/getPrescribeInfoByOrderCode")
+    public AjaxResult getPrescribeInfoByOrderCode(@RequestParam("orderCode") String orderCode)
+    {
+        FsStoreOrderScrm fsStoreOrderScrm = storeOrderScrmService.selectFsStoreOrderByOrderCode(orderCode);
+        if (fsStoreOrderScrm != null){
+            FsPrescribeDataScrm fsPrescribeDataScrm=fsPrescribeScrmService.selectFsPrescribeDataScrmByPrescribeId(fsStoreOrderScrm.getPrescribeId());
+            return AjaxResult.success(fsPrescribeDataScrm);
+        }
+        return AjaxResult.error("未找到订单信息");
+    }
+
+
+    /**
+     * 获取客户信息+问答信息(根据客户信息表id)
+     */
+    @GetMapping("/getCustomerInfoAndQuestionAnswer/{companyCustomerId}")
+    public AjaxResult getCustomerQuestionAnswer(@PathVariable Long companyCustomerId) {
+        CustomerInfoVO customerInfoVO = fsCompanyCustomerService.getCustomerInfoAndQuestionAnswer(companyCustomerId);
+        return AjaxResult.success(customerInfoVO);
+    }
+
+    /**
+     * 获取医生、药师签名信息
+     * @param doctorIds 医生id和药师id
+     * @return 医生、药师签名信息
+     * */
+    @PostMapping("/getSignInfo")
+    public AjaxResult getDoctorSignInfo(@RequestBody List<Long> doctorIds){
+        DoctorSignVO signVO = fsPrescribeScrmService.getDoctorSignInfo(doctorIds);
+        return AjaxResult.success(signVO);
+    }
+
+    /**
+     * 获取医生建议信息(诊断、舌诊、饮食运动建议、治疗方面、禁忌)
+     */
+    @GetMapping("/getDoctorAdvice/{prescribeId}")
+    public AjaxResult getDoctorAdvice(@PathVariable Long prescribeId) {
+        FsPrescribeDataScrm prescribe = fsPrescribeScrmService.selectFsPrescribeDataScrmByPrescribeId(prescribeId);
+        if (prescribe == null) {
+            return AjaxResult.error("处方不存在");
+        }
+        PrescribeScrmDoctorAdviceVO vo = new PrescribeScrmDoctorAdviceVO();
+        vo.setDiagnose(prescribe.getDiagnose());
+        vo.setFacialDiagnosis(prescribe.getFacialDiagnosis());
+        vo.setFoodAndExerciseGuidance(prescribe.getFoodAndExerciseGuidance());
+        vo.setHealingAreaJson(prescribe.getHealingAreaJson());
+        vo.setNoteTaboos(prescribe.getNoteTaboos());
+        return AjaxResult.success(vo);
+    }
+
+}

+ 0 - 1
fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java

@@ -28,7 +28,6 @@ import com.fs.hisStore.vo.FsUserInformationCollectionOverviewVo;
 import com.fs.qw.domain.FsCompanyCustomer;
 import com.fs.qw.service.IFsCompanyCustomerService;
 import com.fs.qw.vo.CompanyUserAndDoctorVO;
-import com.fs.qw.vo.FsDoctorMemberSalesVO;
 import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;

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

@@ -12,7 +12,7 @@ import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.domain.FsPrescribeDataScrm;
 import com.fs.his.dto.*;
 import com.fs.his.service.IFsPrescribeDataScrmService;
-import com.fs.his.vo.CustomerQuestionAnswerVO;
+import com.fs.his.vo.CustomerInfoVO;
 import com.fs.his.vo.DoctorSignVO;
 import com.fs.his.vo.PrescribeScrmDoctorAdviceVO;
 import com.fs.qw.service.IFsCompanyCustomerService;
@@ -117,12 +117,12 @@ public class FsPrescribeDataScrmController extends BaseController
     }
 
     /**
-     * 获取客户问答信息(根据客户信息表id)
+     * 获取客户信息+问答信息(根据客户信息表id)
      */
-    @GetMapping("/getCustomerQuestionAnswer/{companyCustomerId}")
+    @GetMapping("/getCustomerInfoAndQuestionAnswer/{companyCustomerId}")
     public AjaxResult getCustomerQuestionAnswer(@PathVariable Long companyCustomerId) {
-        List<CustomerQuestionAnswerVO> list = fsCompanyCustomerService.getCustomerQuestionAnswer(companyCustomerId);
-        return AjaxResult.success(list);
+        CustomerInfoVO customerInfoVO = fsCompanyCustomerService.getCustomerInfoAndQuestionAnswer(companyCustomerId);
+        return AjaxResult.success(customerInfoVO);
     }
 
     /**

+ 8 - 6
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeDataScrmServiceImpl.java

@@ -10,6 +10,7 @@ import com.fs.his.enums.DoctorTypeEnum;
 import com.fs.his.mapper.*;
 import com.fs.his.service.IFsPrescribeDataScrmService;
 import com.fs.his.service.IPollingAssignDoctorService;
+import com.fs.his.service.PrescriptionTaskRecordService;
 import com.fs.his.vo.DoctorSignVO;
 import com.fs.qw.domain.FsCompanyCustomer;
 import com.fs.qw.mapper.FsCompanyCustomerMapper;
@@ -51,9 +52,6 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
     @Autowired
     private FsDoctorMapper fsDoctorMapper;
 
-    @Autowired
-    private ApplicationContext applicationContext;
-
     @Autowired
     private IFsCompanyCustomerService companyCustomerService;
 
@@ -63,6 +61,11 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
     @Autowired
     private FsPrescibeRecordDataScrmMapper fsPrescibeRecordDataScrmMapper;
 
+    @Autowired
+    private PrescriptionTaskRecordService prescriptionTaskRecordService;
+
+    @Autowired
+    private ApplicationContext applicationContext;
     private IFsPrescribeDataScrmService self() {
         return applicationContext.getBean(IFsPrescribeDataScrmService.class);
     }
@@ -304,9 +307,8 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
             syncDrugsFullCover(submitDto.getPrescribeId(), submitDto.getDrugs());
         }
 
-        // 4. 生成医生签名处方图片任务(根据处方类型和药品)
-        submitPrescribeImageTask(submitDto.getPrescribeId(), 1);
-
+        // 4. 生成医生签名处方图片(根据处方类型和药品)这里直接生成处方图片方便药师审核
+        prescriptionTaskRecordService.prescribeScrmImgYsyTask(submitDto.getPrescribeId(), 1);
         // 5. 更新用户状态为待审核(如果有需要)
         updateCustomerStatus(submitDto.getPrescribeId(), WAIT_AUDIT);
 

+ 47 - 0
fs-service/src/main/java/com/fs/his/vo/CustomerInfoVO.java

@@ -0,0 +1,47 @@
+package com.fs.his.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+/**
+ * 患者基础信息
+ * */
+@Data
+public class CustomerInfoVO {
+    /**
+     * 患者姓名
+     * */
+    private String customerName;
+
+    /** 性别(0女 1男 2未知) */
+    private String sex;
+
+    /** 年龄 */
+    private Integer age;
+
+    /** 电话 */
+    private String phone;
+
+    /** 会诊时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 现病史 */
+    private String presentIllness;
+
+    /** 现用药情况 */
+    private String currentMedication;
+
+    /** 过敏史 */
+    private String allergyHistory;
+
+    /** 患者病情主诉 */
+    private String patientMainComplaint;
+
+    /**
+     * 客户问答信息
+     * */
+    private List<CustomerQuestionAnswerVO> customerQuestionAnswerVOList;
+}

+ 3 - 0
fs-service/src/main/java/com/fs/qw/domain/FsCompanyCustomer.java

@@ -80,6 +80,9 @@ public class FsCompanyCustomer extends BaseEntity {
     //@Excel(name = "过敏史")
     private String allergyHistory;
 
+    /** 患者病情主诉 */
+    private String patientMainComplaint;
+
     /** 导入会员id*/
     private Long importMemberId;
 

+ 3 - 3
fs-service/src/main/java/com/fs/qw/service/IFsCompanyCustomerService.java

@@ -1,7 +1,7 @@
 package com.fs.qw.service;
 
 import com.fs.company.domain.CompanyUser;
-import com.fs.his.vo.CustomerQuestionAnswerVO;
+import com.fs.his.vo.CustomerInfoVO;
 import com.fs.hisStore.param.FsCompanyCustomerOrderParam;
 import com.fs.hisStore.vo.FsStoreOrderVO;
 import com.fs.qw.domain.FsCompanyCustomer;
@@ -45,6 +45,6 @@ public interface IFsCompanyCustomerService {
 
     int improve(FsCompanyCustomer fsCompanyCustomer);
 
-    //查询客户问答信息(根据客户信息表主键ID)
-    List<CustomerQuestionAnswerVO> getCustomerQuestionAnswer(Long companyCustomerId);
+    //查询客户信息+问答信息(根据客户信息表主键ID)
+    CustomerInfoVO getCustomerInfoAndQuestionAnswer(Long companyCustomerId);
 }

+ 9 - 4
fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyCustomerServiceImpl.java

@@ -15,6 +15,7 @@ import com.fs.his.domain.FsPrescribeDataScrm;
 import com.fs.his.mapper.FsImportMemberMapper;
 import com.fs.his.mapper.FsPrescribeDataScrmMapper;
 import com.fs.his.service.IFsUserAddressService;
+import com.fs.his.vo.CustomerInfoVO;
 import com.fs.his.vo.CustomerQuestionAnswerVO;
 import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import com.fs.hisStore.param.FsCompanyCustomerOrderParam;
@@ -29,6 +30,7 @@ import com.fs.qw.param.TransferCustomerParam;
 import com.fs.qw.service.IFsCompanyCustomerService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -302,14 +304,16 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
     }
 
     @Override
-    public List<CustomerQuestionAnswerVO> getCustomerQuestionAnswer(Long companyCustomerId) {
+    public CustomerInfoVO getCustomerInfoAndQuestionAnswer(Long companyCustomerId) {
+        CustomerInfoVO customerInfoVO = new CustomerInfoVO();
         FsCompanyCustomer fsCompanyCustomer = fsCompanyCustomerMapper.selectFsCompanyCustomerById(companyCustomerId);
         if (fsCompanyCustomer == null) {
-            return Collections.emptyList();
+            return customerInfoVO;
         }
+        BeanUtils.copyProperties(fsCompanyCustomer, customerInfoVO);
         String jsonStr = fsCompanyCustomer.getJsonInfo();
         if (StringUtils.isBlank(jsonStr)) {
-            return Collections.emptyList();
+            return customerInfoVO;
         }
         // 使用 TypeReference 安全解析
         List<Map<String, Object>> list = JSON.parseObject(jsonStr, new TypeReference<List<Map<String, Object>>>() {});
@@ -336,6 +340,7 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
             vo.setAnswerText(answerText);
             result.add(vo);
         }
-        return result;
+        customerInfoVO.setCustomerQuestionAnswerVOList(result);
+        return customerInfoVO;
     }
 }

+ 4 - 1
fs-service/src/main/resources/mapper/qw/FsCompanyCustomerMapper.xml

@@ -44,7 +44,7 @@
     <sql id="selectFsCompanyCustomerVo">
         select id, customer_name, sex, age, address, phone, filing_time,
                company_user_id, company_user_name, appointment_time, doctor_id, doctor_name,
-               present_illness, current_medication, allergy_history,
+               present_illness, current_medication, allergy_history,patient_main_complaint,
                create_by, create_time, update_by, update_time, remark, del_flag, import_member_id,
                buy_count, claim_status,
                complete_status, dept_id, dept_name,
@@ -223,6 +223,7 @@
             <if test="presentIllness != null">present_illness,</if>
             <if test="currentMedication != null">current_medication,</if>
             <if test="allergyHistory != null">allergy_history,</if>
+            <if test="patientMainComplaint != null">patient_main_complaint,</if>
             <if test="createBy != null">create_by,</if>
             <if test="remark != null">remark,</if>
             <if test="importMemberId != null">import_member_id,</if>
@@ -256,6 +257,7 @@
             <if test="presentIllness != null">#{presentIllness},</if>
             <if test="currentMedication != null">#{currentMedication},</if>
             <if test="allergyHistory != null">#{allergyHistory},</if>
+            <if test="patientMainComplaint != null">#{patientMainComplaint},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="remark != null">#{remark},</if>
             <if test="importMemberId != null">#{importMemberId},</if>
@@ -310,6 +312,7 @@
             <if test="presentIllness != null">present_illness = #{presentIllness},</if>
             <if test="currentMedication != null">current_medication = #{currentMedication},</if>
             <if test="allergyHistory != null">allergy_history = #{allergyHistory},</if>
+            <if test="patientMainComplaint != null">patient_main_complaint = #{patientMainComplaint},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="importMemberId != null">import_member_id = #{importMemberId},</if>
             <if test="buyCount != null">buy_count = #{buyCount},</if>