Parcourir la source

授权的医嘱会变成另外一个医生开的医嘱

xiaochan il y a 2 ans
Parent
commit
5952a90a1f

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>11.3.3</version>
+    <version>11.3.4</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 20 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -534,6 +534,24 @@ public interface YiZhuLuRuDao {
             " where act_order_no = #{decimal}")
     void confirmOrders(BigDecimal decimal, String userCode, Date confirmDate);
 
+
+    @Update("update yz_act_order " +
+            "set confirm_time = #{confirmDate}, " +
+            "    signer       = #{userCode}, " +
+            "    status_time  = #{confirmDate}, " +
+            "    status_flag  = '2'," +
+            "    supply_code  = case " +
+            "                      when parent_no is not null then (select isnull(nullif(supply_child, ''), '044') " +
+            "                                                       from yz_supply_type c " +
+            "                                                       where c.supply_code = (select supply_code " +
+            "                                                                              from yz_act_order b " +
+            "                                                                              where b.act_order_no = yz_act_order.parent_no)) " +
+            "                      else " +
+            "                          yz_act_order.supply_code end," +
+            " enter_oper = #{userCode},physician = #{userCode}  " +
+            " where act_order_no = #{decimal}")
+    void confirmOrdersSuperiorDoctor(BigDecimal decimal, String userCode, Date confirmDate);
+
     @Update("update yz_act_order set frequ_code = 'ONCE' WHERE act_order_no = #{decimal} ")
     void modifyTheFrequency(BigDecimal decimal);
 
@@ -953,7 +971,8 @@ public interface YiZhuLuRuDao {
             "                       CASE " +
             "                           WHEN isnull(b.open_virtual2, '') = '1' then isnull(b.stock_amount_virtual2, 0) " +
             "                           else isnull(stock_amount, 0) end                as stock_amount, " +
-            "                       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy, " +
+            "                       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy," +
+            "                       cast(isnull(NULLIF(kss_flag, ''), 0) as int)        as kss_flag, " +
             "    deptRestrictions = (select count(1) from yp_zd_dept where code = yp_zd_dept.charge_code and dept_code = '${dept}') " +
             "from yp_zd_dict a " +
             "         with (NOLOCK) " +

+ 12 - 5
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -237,7 +237,7 @@ public class YiZhuLuRuServer {
     }
 
     /**
-     * 确认 医嘱 , 这个是最新的正确的
+     * xc确认医嘱 , 这个是最新的正确的
      *
      * @param param 数据
      * @return 返回提示
@@ -267,10 +267,13 @@ public class YiZhuLuRuServer {
         // 是否可以确认
         List<BigDecimal> confirmOrderInformation = new ArrayList<>();
 
+        List<XinZhenYzActOrder> confirmYzList = new ArrayList<>();
+
         YiZhuCheckData checkData = new YiZhuCheckData(dao);
         checkData.init(yiZhuList, patInfo).judgeExclusion();
 
         Map<String, Object> checkMap = checkData.startCheck((item) -> {
+            confirmYzList.add(item);
             confirmOrderInformation.add(item.getActOrderNo());
         });
 
@@ -295,9 +298,13 @@ public class YiZhuLuRuServer {
 
         Date now = new Date();
         try {
-            ListUtil.partitionAndFunc(confirmOrderInformation, 50, (list) -> {
-                for (BigDecimal decimal : list) {
-                    mapper.confirmOrders(decimal, userCode, now);
+            ListUtil.partitionAndFunc(confirmYzList, 50, (list) -> {
+                for (XinZhenYzActOrder item : list) {
+                    if (StringUtil.notBlank(item.getSuperiorDoctor())) {
+                        mapper.confirmOrdersSuperiorDoctor(item.getActOrderNo(), item.getSuperiorDoctor(), now);
+                    } else {
+                        mapper.confirmOrders(item.getActOrderNo(), userCode, now);
+                    }
                 }
                 sqlSession.commit();
             });
@@ -446,6 +453,7 @@ public class YiZhuLuRuServer {
         if (StringUtil.notBlank(param.getData().getSuperiorDoctor())) {
             dao.updateAuthorizedDoctor(param.getData().getActOrderNo(), param.getData().getSuperiorDoctor());
         }
+
         // 项目不触发
         if (param.getData().getParentNo() == null && !param.getData().getSerial().equals("00")) {
             String selectSupplyCode = dao.selectSupplyCode(param.getData().getSupplyCode().trim());
@@ -781,7 +789,6 @@ public class YiZhuLuRuServer {
                 }
                 if (yp.getPsFlag() == 1) {
                     prompt.add("此药品为皮试药品");
-                    map.put("piShi", dao.piShiGeiYaoFangShi());
                 }
             }
             List<YaoPingJiLiang> yaoPingJiLiang = new ArrayList<>();