Эх сурвалжийг харах

移动护理添加结束执行

lighter 3 долоо хоног өмнө
parent
commit
4d53d5f06f

+ 3 - 2
src/main/java/thyyxxk/webserver/controller/inpatient/nursemodule/PrintInfusionCardController.java

@@ -49,8 +49,9 @@ public class PrintInfusionCardController {
     }
 
     @GetMapping("/checkInfusionByScan")
-    public ResultVo<String> checkInfusionByScan(@RequestParam("scanContent") String scanContent) {
-        return service.checkInfusionByScan(scanContent);
+    public ResultVo<String> checkInfusionByScan(@RequestParam("scanContent") String scanContent,
+                                                @RequestParam("scanType") Integer scanType) {
+        return service.checkInfusionByScan(scanContent, scanType);
     }
 
     @PostMapping("/updatePreparer")

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/executeItem/YzZyPatientFeeDao.java

@@ -88,5 +88,9 @@ public interface YzZyPatientFeeDao extends BaseMapper<YzZyPatientFee> {
             "and act_order_no=#{actOrderNoStr} and occ_time=#{occTime}")
     int updateExecuteInfo(YzZyPatientFee yzZyPatientFee);
 
+    @Update("update yz_zy_patient_fee set end_executor=#{opId},end_execute_time=#{opDate} " +
+            "where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes} " +
+            "and act_order_no=#{actOrderNoStr} and occ_time=#{occTime}")
+    int updateEndExecuteInfo(YzZyPatientFee yzZyPatientFee);
 }
 

+ 5 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/nursemodule/PrintInfusionCardDao.java

@@ -220,6 +220,11 @@ public interface PrintInfusionCardDao {
             "(act_order_no=#{actOrderNo} or parent_no=#{actOrderNo})")
     int updateExecutor(String patNo, String actOrderNo, Date occTime, String staff, String caId);
 
+    @Update("update yz_act_occ set end_executor=#{staff},end_execute_time=getdate() " +
+            "where inpatient_no=#{patNo} and occ_time=#{occTime} and " +
+            "(act_order_no=#{actOrderNo} or parent_no=#{actOrderNo})")
+    int updateEndExecute(String patNo, String actOrderNo, Date occTime, String staff);
+
     @Update("update yz_act_occ set prepare_staff=#{staff},prepare_time=getdate() " +
             "where inpatient_no=#{patNo} and occ_time=#{occTime} and " +
             "(act_order_no=#{actOrderNo} or parent_no=#{actOrderNo})")

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/executeItem/YzActOcc.java

@@ -116,6 +116,8 @@ public class YzActOcc  {
     private String printCommentBq;
     private String executeStaff;
     private Date executeTime;
+    private String endExecutor;
+    private Date endExecuteTime;
 
     public String getActOrderNoStr() {
         if(actOrderNo != null){

+ 10 - 0
src/main/java/thyyxxk/webserver/entity/executeItem/YzZyPatientFee.java

@@ -71,6 +71,8 @@ public class YzZyPatientFee {
     private String opFlag;
     /** 手术医生编码*/
     private String opId;
+    private String endExecutor;
+    private Date endExecuteTime;
     private String ybSelfFlag;
     /** 手术时间*/
     private Date opDate;
@@ -82,6 +84,14 @@ public class YzZyPatientFee {
         }
         return actOrderNoStr;
     }
+
+    /** 扫码内容*/
+    @TableField(exist = false)
+    private String scanContent;
+    /** 扫码类别,1-开始执行,2-结束执行*/
+    @TableField(exist = false)
+    private Integer scanType;
+
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;

+ 32 - 10
src/main/java/thyyxxk/webserver/service/inpatient/nursemodule/PrintInfusionCardService.java

@@ -223,7 +223,7 @@ public class PrintInfusionCardService {
         return ResultVoUtil.success(response);
     }
 
-    public ResultVo<String> checkInfusionByScan(String scanContent) {
+    public ResultVo<String> checkInfusionByScan(String scanContent, Integer scanType) {
         String[] summary = scanContent.split("\\|");
         if (summary.length != 4) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请扫描正确的二维码!");
@@ -257,14 +257,28 @@ public class PrintInfusionCardService {
         caMsbBuilder
                 .append("为患者【")
                 .append(drugs.get(0).getInpatientName().trim())
-                .append("】执行输液:");
+                .append(scanType == 1 ? "】执行输液:" : "】结束输液:");
         for (int i = 0; i < drugs.size(); i++) {
             YzActOcc occ = drugs.get(i);
-            if (StringUtil.notBlank(occ.getExecuteStaff()) && null != occ.getExecuteTime()) {
-                String executeTime = DateUtil.formatDatetime(occ.getExecuteTime());
-                return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR,
-                        "本次输液已于 <br/>" + executeTime + " <br/> 核对执行过。");
+
+            if (scanType == 1) {
+                if (StringUtil.notBlank(occ.getExecuteStaff()) && null != occ.getExecuteTime()) {
+                    String executeTime = DateUtil.formatDatetime(occ.getExecuteTime());
+                    return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR,
+                            "本次输液已于 <br/>" + executeTime + " <br/> 核对执行过。");
+                }
+            } else {
+                if (StringUtil.isBlank(occ.getExecuteStaff()) || null == occ.getExecuteTime()) {
+                    return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR,
+                            "本次输液尚未开始执行,无法结束执行。");
+                }
+                if (StringUtil.notBlank(occ.getEndExecutor()) && null != occ.getEndExecuteTime()) {
+                    String time = DateUtil.formatDatetime(occ.getEndExecuteTime());
+                    return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR,
+                            "本次输液已于 <br/>" + time + " <br/> 结束执行。");
+                }
             }
+
             BigDecimal mapQuan = drugMap.get(occ.getChargeCode());
             if (null == mapQuan) {
                 return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR, "用药与医嘱不匹配,请检查!");
@@ -287,15 +301,23 @@ public class PrintInfusionCardService {
             CaSignClass.Send caParams = new CaSignClass.Send();
             caParams.setId(staff);
             caParams.setMsg(caMsbBuilder.toString());
-            caParams.setDesc("执行输液医嘱。");
+            caParams.setDesc(scanType == 1 ? "执行输液医嘱。" : "结束输液。");
             log.info("执行输液CA签名入参:{}", caParams);
             CaReturn.CaSignReturn caRes = caService.sendByCode(caParams);
             log.info("执行输液CA签名返回:{}", caRes);
 
-            int updatedRows = dao.updateExecutor(patNo, actOrderNo, occTime, staff, caRes.getId());
-            if (updatedRows > 0) {
-                return ResultVoUtil.success("核对执行成功。");
+            if (scanType == 1) {
+                int updatedRows = dao.updateExecutor(patNo, actOrderNo, occTime, staff, caRes.getId());
+                if (updatedRows > 0) {
+                    return ResultVoUtil.success("核对执行成功。");
+                }
+            } else {
+                int updatedRows = dao.updateEndExecute(patNo, actOrderNo, occTime, staff);
+                if (updatedRows > 0) {
+                    return ResultVoUtil.success("结束执行成功。");
+                }
             }
+
             return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR, "数据库出错,核对执行失败!");
         }
         return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR, "用药与医嘱不匹配,请检查!");

+ 10 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -1693,13 +1693,22 @@ public class YiZhuLuRuServer {
     }
 
     public ResultVo<String> executeZlYz(YzZyPatientFee order) {
+        if (!StringUtil.equalsIgnoreSpace(order.getInpatientNo(), order.getScanContent())) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医嘱患者(" + order.getInpatientNo()
+                    + ")与扫码患者(" + order.getScanContent() + ")不一致,执行失败!");
+        }
         String statusFlag = dao.getOrderStatus(order.getActOrderNoStr());
         if (Objects.equals(statusFlag, "1") || Objects.equals(statusFlag, "2")) {
             dao.updateOrderStatus(order.getActOrderNoStr());
         }
         order.setOpId(TokenUtil.getInstance().getTokenUserId());
         order.setOpDate(new Date());
-        int updateRows = patientFeeDao.updateExecuteInfo(order);
+        int updateRows;
+        if (order.getScanType() == 1) {
+            updateRows = patientFeeDao.updateExecuteInfo(order);
+        } else {
+            updateRows = patientFeeDao.updateEndExecuteInfo(order);
+        }
         if (updateRows > 0) {
             return ResultVoUtil.success(DateUtil.formatDatetime(order.getOpDate()));
         }

+ 4 - 0
src/main/java/thyyxxk/webserver/utils/StringUtil.java

@@ -340,5 +340,9 @@ public class StringUtil {
     public static String trim(String str) {
         return str == null ? null : str.trim();
     }
+
+    public static boolean equalsIgnoreSpace(String str1, String str2) {
+        return Objects.equals(trim(str1), trim(str2));
+    }
 }
 

+ 7 - 0
update/2025-11-12.md

@@ -0,0 +1,7 @@
+```sql
+alter table yz_act_occ add end_executor varchar(16),end_execute_time datetime,end_execute_ca_sign_id varchar(32)
+```
+
+```sql
+alter table yz_zy_patient_fee add end_executor varchar(16),end_execute_time datetime
+```