Selaa lähdekoodia

商城处方操作逻辑

cgp 18 tuntia sitten
vanhempi
commit
2923a3cc3a

+ 23 - 0
fs-service/src/main/java/com/fs/his/dto/FsPrescribeDataDoctorUpdateDto.java

@@ -0,0 +1,23 @@
+package com.fs.his.dto;
+
+import lombok.Data;
+
+@Data
+public class FsPrescribeDataDoctorUpdateDto {
+    /** 处方id */
+    private Long prescribeId;
+
+    //处方状态 0待医生开方 1确认开方 -1医生拒方 */
+    private Integer doctorConfirm;
+
+    /** 处方类型 1西药 2中药 */
+    private Integer prescribeType;
+
+    /** 诊断 */
+    private String diagnose;
+
+    private String remark;
+
+    /** 医生id*/
+    private Long doctorId;
+}

+ 18 - 0
fs-service/src/main/java/com/fs/his/dto/FsPrescribeDataDrugDoctorUpdateDto.java

@@ -0,0 +1,18 @@
+package com.fs.his.dto;
+
+import lombok.Data;
+
+@Data
+public class FsPrescribeDataDrugDoctorUpdateDto {
+    /** 处方id */
+    private Long prescribeId;
+
+    //处方状态 0待药师审核 1审核通过 2药师审核不通过 */
+    private Integer status;
+
+    /** 药师id*/
+    private Long drugDoctorId;
+
+    /** 审核不通过原因 */
+    private String auditReason;
+}

+ 13 - 0
fs-service/src/main/java/com/fs/his/service/IFsPrescribeDataScrmService.java

@@ -2,7 +2,9 @@ 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.qw.vo.FsPrescribeDataScrmVO;
 
 import java.util.List;
@@ -70,10 +72,21 @@ public interface IFsPrescribeDataScrmService
      */
     List<FsPrescribeDataScrmVO> waitOpenPrescribeList(FsPrescribeDataDoctorQueryDto queryDto);
 
+
+    /**
+     * 医生---操作商城处方
+     * */
+    int doctorExecuteScrmPrescribe(FsPrescribeDataDoctorUpdateDto updateDto);
+
     /**
      * 药师---查询待审核处方列表
      * @param queryDto
      * @return
      */
     List<FsPrescribeDataScrmVO> pendingStorePrescribeList(FsPrescribeDataDrugDoctorQueryDto queryDto);
+
+    /**
+     * 药师---操作商城处方
+     * */
+    int drugDoctorExecuteScrmPrescribe(FsPrescribeDataDrugDoctorUpdateDto updateDto);
 }

+ 26 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeDataScrmServiceImpl.java

@@ -1,15 +1,19 @@
 package com.fs.his.service.impl;
 
+import com.fs.common.BeanCopyUtils;
 import com.fs.common.utils.DateUtils;
 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.mapper.FsPrescribeDataScrmMapper;
 import com.fs.his.service.IFsPrescribeDataScrmService;
 import com.fs.qw.vo.FsPrescribeDataScrmVO;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Collections;
 import java.util.List;
@@ -108,6 +112,15 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
         return list;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int doctorExecuteScrmPrescribe(FsPrescribeDataDoctorUpdateDto updateDto) {
+        FsPrescribeDataScrm updatePrescribe=new FsPrescribeDataScrm();
+        BeanCopyUtils.copy(updateDto,updatePrescribe);
+        //TODO 删除只有医生签名的处方图片
+        return fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(updatePrescribe);
+    }
+
     @Override
     public List<FsPrescribeDataScrmVO> pendingStorePrescribeList(FsPrescribeDataDrugDoctorQueryDto queryDto) {
         List<FsPrescribeDataScrmVO> list=fsPrescribeDataScrmMapper.pendingStorePrescribeList(queryDto);
@@ -116,4 +129,17 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
         }
         return list;
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int drugDoctorExecuteScrmPrescribe(FsPrescribeDataDrugDoctorUpdateDto updateDto) {
+        FsPrescribeDataScrm updatePrescribe=new FsPrescribeDataScrm();
+        BeanCopyUtils.copy(updateDto,updatePrescribe);
+        if (updateDto.getStatus()==1){
+            //TODO 生成具有医生、药师签名的处方图片
+        }else if (updateDto.getStatus()==2){
+            //TODO 删除只有医生签名的处方图片
+        }
+        return fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(updatePrescribe);
+    }
 }

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

@@ -135,7 +135,7 @@
         select pds.* from fs_prescribe_data_scrm pds
         left join fs_company_customer fcc on pds.prescribe_id = fcc.prescribe_id
         <where>
-            pds.drug_doctor_id = #{drugDoctorId}
+            pds.drug_doctor_id = #{drugDoctorId} and doctor_confirm = 1 <!--必须是医生开方通过的才能进入待药师审核 -->
             <if test="orderCode != null"> and order_code = #{orderCode}</if>
             <if test="prescribeCode != null and prescribeCode != ''"> and prescribe_code = #{prescribeCode}</if>
             <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>