DESKTOP-0GD05B0\Administrator преди 2 години
родител
ревизия
628673204b

+ 0 - 7
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/YizhuLuRuController.java

@@ -210,19 +210,12 @@ public class YizhuLuRuController {
         return server.muBanCaoZuo(patternCode, patternName, deptCode, sortNo, flag);
     }
 
-
     @GetMapping("/expensesForGettingADoctorSOrder")
     public ResultVo<Map<String, Object>> expensesForGettingADoctorSOrder(@RequestParam("patNo") String patNo,
                                                                          @RequestParam("times") Integer times) {
         return server.expensesForGettingADoctorSOrder(patNo, times);
     }
 
-
-    @PostMapping("/drugWithdrawal")
-    public ResultVo<String> drugWithdrawal(@RequestBody List<String> param) {
-        return server.drugWithdrawal(param);
-    }
-
     @PostMapping("/saveTheThirdLevelDoctor")
     public ResultVo<String> saveTheThirdLevelDoctor(@RequestBody Overview param) {
         return server.saveTheThirdLevelDoctor(param);

+ 88 - 293
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -33,20 +33,18 @@ import java.util.Set;
  */
 @Mapper
 public interface PublicDao {
-
-
     /**
      * 查询医嘱
      *
      * @return 返回医嘱号
      */
-    @Select("select act_order_no from yz_sequence WITH (NOLOCK) ")
-    float getActOrderNo();
+    @Select("select cast(act_order_no as decimal(14)) as act_order_no from yz_sequence WITH (TABLOCKX)")
+    BigDecimal getActOrderNo();
 
     /**
      * @return 获取模板的自增id
      */
-    @Select("select pattern_code from yz_sequence")
+    @Select("select pattern_code from yz_sequence WITH (TABLOCKX) ")
     Integer getPatternCode();
 
     /**
@@ -55,14 +53,14 @@ public interface PublicDao {
     @Update("update yz_sequence set pattern_code = #{newId} where pattern_code = #{oldId} ")
     int updatePatternCode(Integer newId, Integer oldId);
 
-    @Select("select p_act_order_no from yz_sequence")
-    float getPatternOrderCode();
+    @Select("select cast(p_act_order_no as decimal(9)) from yz_sequence WITH (TABLOCKX)")
+    BigDecimal getPatternOrderCode();
 
     /**
      * @param pActOrderNo 返回新的模板编码
      */
     @Update("update yz_sequence set p_act_order_no = #{newId} where p_act_order_no = #{oldId} ")
-    int updatePatternOrderCode(float newId, float oldId);
+    int updatePatternOrderCode(BigDecimal newId, BigDecimal oldId);
 
     /**
      * 插入新的医嘱
@@ -70,16 +68,16 @@ public interface PublicDao {
      * @param actOrderNo 医嘱号
      */
     @Update("update yz_sequence set act_order_no = #{newOrderNo} where act_order_no = #{oldOrderNo} ")
-    int updateActOrderNo(float newOrderNo, float oldOrderNo);
+    int updateActOrderNo(BigDecimal newOrderNo, BigDecimal oldOrderNo);
 
 
-    @Select("select req_no from ysh_config ")
+    @Select("select req_no from ysh_config WITH (TABLOCKX) ")
     Integer getReqNo();
 
     @Update("update ysh_config set req_no =#{newId} where req_no = #{oldId} ")
     int updateReqNo(Integer newId, Integer oldId);
 
-    @Select("select yj_template_no from ysh_config")
+    @Select("select yj_template_no from ysh_config WITH (TABLOCKX) ")
     Integer tempNo();
 
     @Update("update ysh_config set yj_template_no = #{newId} where yj_template_no = #{oldId} ")
@@ -94,17 +92,7 @@ public interface PublicDao {
     @Select("select code,case when parent_code = code then null else parent_code end as parent_code from zd_unit_code where (parent_code = #{deptCode} or code = #{deptCode}) and isnull(del_flag,0) = 0")
     List<GetDropdownBox> getKeShiLieBiao(String deptCode);
 
-    @Select("<script>" +
-            "select code from zd_unit_code where (parent_code in " +
-            "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" +
-            " #{item,jdbcType = CHAR}" +
-            "</foreach> " +
-            "or code in " +
-            "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" +
-            "#{item,jdbcType = CHAR}" +
-            "</foreach>" +
-            ") and isnull(del_flag,0) = 0" +
-            "</script>")
+    @Select("<script>" + "select code from zd_unit_code where (parent_code in " + "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" + " #{item,jdbcType = CHAR}" + "</foreach> " + "or code in " + "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" + "#{item,jdbcType = CHAR}" + "</foreach>" + ") and isnull(del_flag,0) = 0" + "</script>")
     List<String> getKeShiLieBiaoList(@Param("deptCodeList") List<String> deptCodeList);
 
     /**
@@ -113,191 +101,84 @@ public interface PublicDao {
      * @param code 人员代码
      * @return 返回人员
      */
-    @Select("<script>" +
-            "select distinct rtrim(code) code,rtrim(name) name," +
-            " dept_name = (select rtrim(name) from zd_unit_code where zd_unit_code.code = dept_code)," +
-            " emp_tit_name  = (select rtrim(name) from zd_emp_title where zd_emp_title.code = emp_tit_code)," +
-            " rtrim(yb_code) as  yb_code " +
-            "from a_employee_mi where " +
-            "(code like #{code} or name like #{code} or code_rs like #{code} or py_code like #{code}) " +
-            "and isnull(del_flag,0) = 0 " +
-            "<if test=\"deptCode != null and deptCode != '' \">" +
-            "and dept_code = #{deptCode} " +
-            "</if>" +
-            "</script>")
+    @Select("<script>" + "select distinct rtrim(code) code,rtrim(name) name," + " dept_name = (select rtrim(name) from zd_unit_code where zd_unit_code.code = dept_code)," + " emp_tit_name  = (select rtrim(name) from zd_emp_title where zd_emp_title.code = emp_tit_code)," + " rtrim(yb_code) as  yb_code " + "from a_employee_mi where " + "(code like #{code} or name like #{code} or code_rs like #{code} or py_code like #{code}) " + "and isnull(del_flag,0) = 0 " + "<if test=\"deptCode != null and deptCode != '' \">" + "and dept_code = #{deptCode} " + "</if>" + "</script>")
     List<GetDropdownBox> getRenYuan(String code, String deptCode);
 
     /**
      * @param pyCode 拼音编码
      * @return 获取项目的名称和code
      */
-    @Select("select distinct code,name from  zd_charge_item where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})" +
-            "union all " +
-            "select distinct code,name from  yp_zd_dict where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})")
+    @Select("select distinct code,name from  zd_charge_item where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})" + "union all " + "select distinct code,name from  yp_zd_dict where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})")
     List<GetDropdownBox> getChargeCode(String pyCode);
 
-    @Select("select distinct rtrim(code) + '_' + rtrim(serial) as code, name " +
-            "from yp_zd_dict " +
-            "where (code like #{name} or name like #{name} or py_code like #{name} or d_code like #{name})")
+    @Select("select distinct rtrim(code) + '_' + rtrim(serial) as code, name " + "from yp_zd_dict " + "where (code like #{name} or name like #{name} or py_code like #{name} or d_code like #{name})")
     List<GetDropdownBox> getDrugInfo(String name);
 
     @Select("select rtrim(code) code,rtrim(name) name from zd_unit_code where isnull(del_flag,0) = 0")
     List<GetDropdownBox> getDept();
 
 
-    @Select("select rtrim(code) code,rtrim(name) name from zd_unit_code with(nolock)" +
-            "where isnull(del_flag,0) = 0 and code not like '8%' and " +
-            "(py_code like #{pyCode} or name like #{pyCode} or code like #{pyCode})")
+    @Select("select rtrim(code) code,rtrim(name) name from zd_unit_code with(nolock)" + "where isnull(del_flag,0) = 0 and code not like '8%' and " + "(py_code like #{pyCode} or name like #{pyCode} or code like #{pyCode})")
     List<GetDropdownBox> queryDept(String pyCode);
 
 
     @Select("select isnull(max(ledger_sn),1)  from zy_ledger_file where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes}")
-    Integer getLedgerSn(@Param("inpatientNo") String inpatient,
-                        @Param("admissTimes") Integer admissTimes);
-
-
-    @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,admiss_date,dis_date,name, " +
-            "responce_name = (select rtrim(name) name from zy_zd_responce_type where code = responce_type)," +
-            "responce_type,  " +
-            "ward,ward_name = (select rtrim(name) name from zd_unit_code where code = ward), " +
-            "ledger_sn = (select max(ledger_sn) from zy_ledger_file where a.inpatient_no = zy_ledger_file.inpatient_no and a.admiss_times = zy_ledger_file.admiss_times), " +
-            "chu_yuan_yi_zhu = (case when (select count(1) from yz_act_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
-            "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
-            "then 1 " +
-            "when (select count(1) from yz_inact_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
-            "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
-            "then 1 else 0 end  ), " +
-            "bed_no,total_charge,balance from zy_actpatient a where inpatient_no = #{inpatientNo} ")
+    Integer getLedgerSn(@Param("inpatientNo") String inpatient, @Param("admissTimes") Integer admissTimes);
+
+
+    @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,admiss_date,dis_date,name, " + "responce_name = (select rtrim(name) name from zy_zd_responce_type where code = responce_type)," + "responce_type,  " + "ward,ward_name = (select rtrim(name) name from zd_unit_code where code = ward), " + "ledger_sn = (select max(ledger_sn) from zy_ledger_file where a.inpatient_no = zy_ledger_file.inpatient_no and a.admiss_times = zy_ledger_file.admiss_times), " + "chu_yuan_yi_zhu = (case when (select count(1) from yz_act_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " + "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " + "then 1 " + "when (select count(1) from yz_inact_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " + "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " + "then 1 else 0 end  ), " + "bed_no,total_charge,balance from zy_actpatient a where inpatient_no = #{inpatientNo} ")
     ZyActpatient getHuanZheJiBenXinXi(@Param("inpatientNo") String inpatientNo);
 
-    @Update("update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} " +
-            "and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and ori_detail_sn = -1 and charge_amount > 0")
-    void chongZhiZhenLiuShui(@Param("inpatientNo") String inpatientNo,
-                             @Param("admissTimes") Integer admissTimes,
-                             @Param("ledgerSn") Integer ledgerSn);
-
-    @Select("select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
-            "and ori_detail_sn is not null " +
-            "and  charge_amount < 0")
-    List<Integer> huoQuTuiFeiYuanLiuShui(@Param("inpatientNo") String inpatientNo,
-                                         @Param("admissTimes") Integer admissTimes,
-                                         @Param("ledgerSn") Integer ledgerSn);
-
-    @Update("<script>" +
-            "update zy_detail_charge set ori_detail_sn = -1 where inpatient_no = '${inpatientNo}' and admiss_times = ${admissTimes} and ledger_sn = ${ledgerSn} " +
-            "and charge_amount &gt; 0 and detail_sn in " +
-            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
-            "${item}" +
-            "</foreach>" +
-            "</script>")
-    void genXingFuShuDuiYingZhenLiuShui(@Param("inpatientNo") String inpatientNo,
-                                        @Param("admissTimes") Integer admissTimes,
-                                        @Param("ledgerSn") Integer ledgerSn,
-                                        @Param("list") List<Integer> detailSnList);
-
-    @Select("select ori_detail_sn,sum(charge_fee) charge_fee,sum(charge_amount) charge_amount " +
-            "from zy_detail_charge a " +
-            "where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn}  and order_no <> 6 and trans_flag_yb <> 2 " +
-            "  and ori_detail_sn is not null and charge_amount<0 " +
-            "group by ori_detail_sn having count(1) > 1")
-    List<ZyDetailCharge> chongFuTuiFeiLiuShui(@Param("inpatientNo") String inpatientNo,
-                                              @Param("admissTimes") Integer admissTimes,
-                                              @Param("ledgerSn") Integer ledgerSn);
-
-
-    @Select("<script>" +
-            "select detail_sn,charge_fee,charge_amount from zy_detail_charge where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
-            "and detail_sn in " +
-            "<foreach collection='oriSn' item='sn' open='(' close=')' separator=','>" +
-            "#{sn}" +
-            "</foreach>" +
-            "</script>")
-    List<ZyDetailCharge> getZhenShuLiuShui(@Param("inpatientNo") String inpatientNo,
-                                           @Param("admissTimes") Integer admissTimes,
-                                           @Param("ledgerSn") Integer ledgerSn,
-                                           @Param("oriSn") Set<Integer> oriSn);
-
-    @Update("<script>" +
-            "<foreach collection='list' item='item' separator=';'>" +
-            "update zy_detail_charge set ori_detail_sn = null  where  inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn =  #{ledgerSn} " +
-            "and (detail_sn = #{item} or ori_detail_sn = #{item}) " +
-            "</foreach>" +
-            "</script>")
-    void chongFuTuiFeiChongZhi(@Param("inpatientNo") String inpatientNo,
-                               @Param("admissTimes") Integer admissTimes,
-                               @Param("ledgerSn") Integer ledgerSn,
-                               @Param("list") List<Integer> oriDetailSn);
-
-    @Select("select isnull(sum(charge_fee),0)  from zy_detail_charge  " +
-            "where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and trans_flag_yb=2")
-    BigDecimal zhenFuXingDiFeiYong(@Param("inpatientNo") String inpatientNo,
-                                   @Param("admissTimes") Integer admissTimes,
-                                   @Param("ledgerSn") Integer ledgerSn);
-
-    @Update("update zy_detail_charge set trans_flag_yb = 0 where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and " +
-            "trans_flag_yb = 2")
-    void chongXingZhengFuXiangDi(@Param("inpatientNo") String inpatientNo,
-                                 @Param("admissTimes") Integer admissTimes,
-                                 @Param("ledgerSn") Integer ledgerSn);
-
-    @Select("select detail_sn from zy_detail_charge where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
-            "and trans_flag_yb <> 2 and charge_amount > 0 and ori_detail_sn is not null")
-    List<Integer> zhenShuLiuShui(@Param("inpatientNo") String inpatientNo,
-                                 @Param("admissTimes") Integer admissTimes,
-                                 @Param("ledgerSn") Integer ledgerSn);
-
-    @Select("select ori_detail_sn from zy_detail_charge where  inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
-            "and trans_flag_yb <> 2 and charge_amount < 0 and ori_detail_sn is not null")
-    List<Integer> fuShuLiuShui(@Param("inpatientNo") String inpatientNo,
-                               @Param("admissTimes") Integer admissTimes,
-                               @Param("ledgerSn") Integer ledgerSn);
-
-    @Update("<script>" +
-            "<foreach collection='list' item='item' separator=';'>" +
-            "update zy_detail_charge set ori_detail_sn = null where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
-            "and charge_fee &lt; 0 and ori_detail_sn = #{item}" +
-            "</foreach>" +
-            "</script> ")
-    void chongZhiFuShuYuanLiuShui(@Param("inpatientNo") String inpatientNo,
-                                  @Param("admissTimes") Integer admissTimes,
-                                  @Param("ledgerSn") Integer ledgerSn,
-                                  @Param("list") List<Integer> oriDetailSn);
-
-    @Select("select top(1) code,dept_code,name,code_rs,rtrim(yb_code) yb_code" +
-            " from a_employee_mi where (code = #{code}  or code_rs = #{code}) and isnull(del_flag,0) = 0 ")
+    @Update("update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} " + "and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and ori_detail_sn = -1 and charge_amount > 0")
+    void chongZhiZhenLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
+
+    @Select("select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and ori_detail_sn is not null " + "and  charge_amount < 0")
+    List<Integer> huoQuTuiFeiYuanLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
+
+    @Update("<script>" + "update zy_detail_charge set ori_detail_sn = -1 where inpatient_no = '${inpatientNo}' and admiss_times = ${admissTimes} and ledger_sn = ${ledgerSn} " + "and charge_amount &gt; 0 and detail_sn in " + "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" + "${item}" + "</foreach>" + "</script>")
+    void genXingFuShuDuiYingZhenLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("list") List<Integer> detailSnList);
+
+    @Select("select ori_detail_sn,sum(charge_fee) charge_fee,sum(charge_amount) charge_amount " + "from zy_detail_charge a " + "where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn}  and order_no <> 6 and trans_flag_yb <> 2 " + "  and ori_detail_sn is not null and charge_amount<0 " + "group by ori_detail_sn having count(1) > 1")
+    List<ZyDetailCharge> chongFuTuiFeiLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
+
+
+    @Select("<script>" + "select detail_sn,charge_fee,charge_amount from zy_detail_charge where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and detail_sn in " + "<foreach collection='oriSn' item='sn' open='(' close=')' separator=','>" + "#{sn}" + "</foreach>" + "</script>")
+    List<ZyDetailCharge> getZhenShuLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("oriSn") Set<Integer> oriSn);
+
+    @Update("<script>" + "<foreach collection='list' item='item' separator=';'>" + "update zy_detail_charge set ori_detail_sn = null  where  inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn =  #{ledgerSn} " + "and (detail_sn = #{item} or ori_detail_sn = #{item}) " + "</foreach>" + "</script>")
+    void chongFuTuiFeiChongZhi(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("list") List<Integer> oriDetailSn);
+
+    @Select("select isnull(sum(charge_fee),0)  from zy_detail_charge  " + "where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and trans_flag_yb=2")
+    BigDecimal zhenFuXingDiFeiYong(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
+
+    @Update("update zy_detail_charge set trans_flag_yb = 0 where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and " + "trans_flag_yb = 2")
+    void chongXingZhengFuXiangDi(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
+
+    @Select("select detail_sn from zy_detail_charge where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and trans_flag_yb <> 2 and charge_amount > 0 and ori_detail_sn is not null")
+    List<Integer> zhenShuLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
+
+    @Select("select ori_detail_sn from zy_detail_charge where  inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and trans_flag_yb <> 2 and charge_amount < 0 and ori_detail_sn is not null")
+    List<Integer> fuShuLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn);
+
+    @Update("<script>" + "<foreach collection='list' item='item' separator=';'>" + "update zy_detail_charge set ori_detail_sn = null where inpatient_no= #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " + "and charge_fee &lt; 0 and ori_detail_sn = #{item}" + "</foreach>" + "</script> ")
+    void chongZhiFuShuYuanLiuShui(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes, @Param("ledgerSn") Integer ledgerSn, @Param("list") List<Integer> oriDetailSn);
+
+    @Select("select top(1) code,dept_code,name,code_rs,rtrim(yb_code) yb_code" + " from a_employee_mi where (code = #{code}  or code_rs = #{code}) and isnull(del_flag,0) = 0 ")
     UserInfo huoQuYuanGongBianMa(String code);
 
     @Select("SELECT small_dept FROM zd_dept_all where dept = #{deptCode}")
     List<String> bingFangSuoSuKeShi(String deptCode);
 
     // 重置 流水号
-    @Select("select row_number() over (order by charge_date ) row_index, " +
-            "       ledger_sn, " +
-            "       detail_sn " +
-            "from zy_detail_charge " +
-            "where inpatient_no = '${patNo}' " +
-            "  and admiss_times = ${times} ")
-    List<ZyDetailCharge> huoQuZhongYeFeiYong(@Param("patNo") String patNo,
-                                             @Param("times") Integer times);
-
-    @Select("select count(1) " +
-            "from zy_detail_charge " +
-            "where inpatient_no = '${patNo}' " +
-            "  and admiss_times = ${times}")
-    int maxDetailSn(@Param("patNo") String patNo,
-                    @Param("times") Integer times);
-
-
-    @Update("<script>" +
-            "<foreach collection='list' item='item' separator=';' index='index' >" +
-            "update zy_detail_charge set detail_sn = ${item.rowIndex} + ${maxDetailSn} " +
-            "where inpatient_no= '${patNo}' and admiss_times = ${times} and ledger_sn = ${item.ledgerSn}  and detail_sn = ${item.detailSn}" +
-            "</foreach>" +
-            "</script>")
-    void chongZhiLiuShui(@Param("patNo") String patNo,
-                         @Param("times") Integer times,
-                         @Param("list") List<ZyDetailCharge> list,
-                         @Param("maxDetailSn") int maxDetailSn);
+    @Select("select row_number() over (order by charge_date ) row_index, " + "       ledger_sn, " + "       detail_sn " + "from zy_detail_charge " + "where inpatient_no = '${patNo}' " + "  and admiss_times = ${times} ")
+    List<ZyDetailCharge> huoQuZhongYeFeiYong(@Param("patNo") String patNo, @Param("times") Integer times);
+
+    @Select("select count(1) " + "from zy_detail_charge " + "where inpatient_no = '${patNo}' " + "  and admiss_times = ${times}")
+    int maxDetailSn(@Param("patNo") String patNo, @Param("times") Integer times);
+
+
+    @Update("<script>" + "<foreach collection='list' item='item' separator=';' index='index' >" + "update zy_detail_charge set detail_sn = ${item.rowIndex} + ${maxDetailSn} " + "where inpatient_no= '${patNo}' and admiss_times = ${times} and ledger_sn = ${item.ledgerSn}  and detail_sn = ${item.detailSn}" + "</foreach>" + "</script>")
+    void chongZhiLiuShui(@Param("patNo") String patNo, @Param("times") Integer times, @Param("list") List<ZyDetailCharge> list, @Param("maxDetailSn") int maxDetailSn);
 
 
     @Select("select rtrim(code) code,rtrim(name) name from zd_anaesthesia")
@@ -321,66 +202,33 @@ public interface PublicDao {
     @Update("update op_config set op_record_id =#{code} ")
     void genXingShouShuXuHao(Integer code);
 
-    @Select("select page_no from yz_sequence")
+    @Select("select page_no from yz_sequence WITH (TABLOCKX) ")
     Integer caoYaoDanHao();
 
     @Update("update yz_sequence set page_no = #{index} where page_no = #{oldId} ")
     int genXingCaoYaoDanHao(Integer newId, Integer oldId);
 
-    @Select("select top (1) cast(settle_type as int) as settle_type " +
-            "from zy_ledger_file " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "order by ledger_sn desc")
-    Integer jieSuanXinXi(@Param("patNo") String patNo,
-                         @Param("times") Integer times);
-
-    @Select("select * " +
-            "from ysh_hz_record " +
-            "where act_order_no = #{actOrder}")
+    @Select("select top (1) cast(settle_type as int) as settle_type " + "from zy_ledger_file " + "where inpatient_no = #{patNo} " + "  and admiss_times = #{times} " + "order by ledger_sn desc")
+    Integer jieSuanXinXi(@Param("patNo") String patNo, @Param("times") Integer times);
+
+    @Select("select * " + "from ysh_hz_record " + "where act_order_no = #{actOrder}")
     YshHzRecord huiZhen(BigDecimal actOrder);
 
-    @Select("select * " +
-            "from ysh_yj_req " +
-            "where act_order_no = #{actOrder}")
+    @Select("select * " + "from ysh_yj_req " + "where act_order_no = #{actOrder}")
     YshYjReq yiJi(BigDecimal actOrder);
 
-    @Select("select * " +
-            "from op_record " +
-            "where act_order_no = #{actOrder}")
+    @Select("select * " + "from op_record " + "where act_order_no = #{actOrder}")
     OpRecord shouShu(BigDecimal actOrder);
 
-    @Select("select * " +
-            "from yz_act_order_cy " +
-            "where order_no = #{actOrder}")
+    @Select("select * " + "from yz_act_order_cy " + "where order_no = #{actOrder}")
     YzActOrderCy caoYao(BigDecimal actOrder);
 
 
-    @Select("select cast(rtrim(isnull(nullif(del_flag, ''), 0)) as int) del_flag," +
-            "national_code,rtrim(code) + '-' + rtrim(serial) code,rtrim(name) name, rtrim(name) as zd_name,rtrim(code) zd_code,rtrim(serial) serial " +
-            "from yp_zd_dict " +
-            "${ew.customSqlSegment}")
+    @Select("select cast(rtrim(isnull(nullif(del_flag, ''), 0)) as int) del_flag," + "national_code,rtrim(code) + '-' + rtrim(serial) code,rtrim(name) name, rtrim(name) as zd_name,rtrim(code) zd_code,rtrim(serial) serial " + "from yp_zd_dict " + "${ew.customSqlSegment}")
     List<YaoPinXiangMu> huoQuYaoPinPiPeiXinXi(@Param(Constants.WRAPPER) Wrapper<?> wp);
 
 
-    @Select("<script>" +
-            "select rtrim(a.order_code) code, " +
-            "       rtrim(a.order_name) name, " +
-            "       national_code, " +
-            "       rtrim(c.code) as zd_code," +
-            "       rtrim(c.name) as zd_name," +
-            "       cast(rtrim(isnull(nullif(c.del_flag, ''), 0)) as int) del_flag," +
-            "       serial = '00' " +
-            "from yz_order_item a with (NOLOCK) , " +
-            "     yz_order_occurence b with (NOLOCK) , " +
-            "     zd_charge_item c with (NOLOCK)" +
-            "where a.order_code in " +
-            "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +
-            "#{item}" +
-            "</foreach>" +
-            "  and a.order_code = b.order_code " +
-            "  and b.occ_code = c.code" +
-            "</script>")
+    @Select("<script>" + "select rtrim(a.order_code) code, " + "       rtrim(a.order_name) name, " + "       national_code, " + "       rtrim(c.code) as zd_code," + "       rtrim(c.name) as zd_name," + "       cast(rtrim(isnull(nullif(c.del_flag, ''), 0)) as int) del_flag," + "       serial = '00' " + "from yz_order_item a with (NOLOCK) , " + "     yz_order_occurence b with (NOLOCK) , " + "     zd_charge_item c with (NOLOCK)" + "where a.order_code in " + "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" + "#{item}" + "</foreach>" + "  and a.order_code = b.order_code " + "  and b.occ_code = c.code" + "</script>")
     List<YaoPinXiangMu> huoQuXiangMuXinXi(List<String> code);
 
 
@@ -390,11 +238,7 @@ public interface PublicDao {
      * @param wardCode 科室编码
      * @return 数据
      */
-    @Select("select code " +
-            "from a_employee_mi " +
-            "where dept_code = #{wardCode} " +
-            "  and isnull(del_flag, 0) <> 1 " +
-            " and emp_tit_code in ('010') ")
+    @Select("select code " + "from a_employee_mi " + "where dept_code = #{wardCode} " + "  and isnull(del_flag, 0) <> 1 " + " and emp_tit_code in ('010') ")
     List<String> huoQuHuanZheBingFangDeHuShi(String wardCode);
 
 
@@ -407,41 +251,19 @@ public interface PublicDao {
     void chaRuTongZhiXinXi(@Param("list") List<SocketMessage> list);
 
 
-    @Insert({"<script>" +
-            "insert into t_socket_message_consumer (msg_id, sender, receiver) values " +
-            "<foreach collection='list' item='item' separator=','>" +
-            " (#{item.msgId}, #{item.sender}, #{item.receiver})" +
-            "</foreach>" +
-            "</script>"})
+    @Insert({"<script>" + "insert into t_socket_message_consumer (msg_id, sender, receiver) values " + "<foreach collection='list' item='item' separator=','>" + " (#{item.msgId}, #{item.sender}, #{item.receiver})" + "</foreach>" + "</script>"})
     void chaRuJieShouShuJu(@Param("list") List<SocketMessage> list);
 
     @Select("select rtrim(${id}) as code, rtrim(${name}) as name from ${table} where isnull(${pyColumn}, '')='' ")
-    List<CodeName> originalList(@Param("table") String table,
-                                @Param("id") String id,
-                                @Param("name") String name,
-                                @Param("pyColumn") String pyColumn);
+    List<CodeName> originalList(@Param("table") String table, @Param("id") String id, @Param("name") String name, @Param("pyColumn") String pyColumn);
 
     @Update("update ${table} set ${pyColumn}='${pyCode}' where ${idColumn}='${id}' ")
-    void updatePycode(@Param("table") String table,
-                      @Param("idColumn") String idColumn,
-                      @Param("id") String id,
-                      @Param("pyColumn") String pyColumn,
-                      @Param("pyCode") String pyCode);
-
-    @Select("select code, name " +
-            "from zd_allergen " +
-            "where (wb_code like #{name} or py_code like #{name} or name like #{name})")
+    void updatePycode(@Param("table") String table, @Param("idColumn") String idColumn, @Param("id") String id, @Param("pyColumn") String pyColumn, @Param("pyCode") String pyCode);
+
+    @Select("select code, name " + "from zd_allergen " + "where (wb_code like #{name} or py_code like #{name} or name like #{name})")
     List<GetDropdownBox> getAllergens(@Param("name") String name);
 
-    @Select("select allergen_code, (select name from zd_allergen where zd_allergen.code = allergen_code) as allergenName, id,type " +
-            "from patient_allergen_info " +
-            "where pat_no = #{patNo} " +
-            "  and type = 0 " +
-            "union all " +
-            "select allergen_code, (select name from yp_zd_dict b where rtrim(b.code) + '_' + rtrim(b.serial) = allergen_code) as allergenName, id,type " +
-            "from patient_allergen_info " +
-            "where pat_no = #{patNo} " +
-            "  and type = 1")
+    @Select("select allergen_code, (select name from zd_allergen where zd_allergen.code = allergen_code) as allergenName, id,type " + "from patient_allergen_info " + "where pat_no = #{patNo} " + "  and type = 0 " + "union all " + "select allergen_code, (select name from yp_zd_dict b where rtrim(b.code) + '_' + rtrim(b.serial) = allergen_code) as allergenName, id,type " + "from patient_allergen_info " + "where pat_no = #{patNo} " + "  and type = 1")
     List<PatientAllergenInfo> getPatientAllergens(@Param("patNo") String patNo);
 
     @Select("select count(1) from patient_allergen_info where pat_no = #{patNo}")
@@ -458,61 +280,34 @@ public interface PublicDao {
     @Select("select * from bld_cat_code where (code = #{name} or name like #{name})")
     List<GetDropdownBox> getBldCat(String name);
 
-    @Select("SELECT distinct rtrim(a.dept_code) as dept_code, " +
-            "                rtrim(a.dept_name) as dept_name, " +
-            "                rtrim(a.ward_code) as ward_code, " +
-            "                rtrim(a.ward_name) as ward_name, " +
-            "                rtrim(b.small_dept) as small_code, " +
-            "                small_name = (select rtrim(name) name from zd_unit_code where code = small_dept) " +
-            "FROM zy_adtward a, " +
-            "     zd_dept_all b " +
-            "where a.ward_code = b.dept")
+    @Select("SELECT distinct rtrim(a.dept_code) as dept_code, " + "                rtrim(a.dept_name) as dept_name, " + "                rtrim(a.ward_code) as ward_code, " + "                rtrim(a.ward_name) as ward_name, " + "                rtrim(b.small_dept) as small_code, " + "                small_name = (select rtrim(name) name from zd_unit_code where code = small_dept) " + "FROM zy_adtward a, " + "     zd_dept_all b " + "where a.ward_code = b.dept")
     List<ZkList> getTheTransferList();
 
     @Select("select RTRIM(code) AS code,RTRIM(name) AS name from  zd_emp_position where isnull(del_flag,0) = 0")
     List<GetDropdownBox> getEmpPosition();
 
-    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
-            "from zd_emp_inmark")
+    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from zd_emp_inmark")
     List<GetDropdownBox> getEmpInmark();
 
-    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
-            "from zd_ifcadre")
+    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from zd_ifcadre")
     List<GetDropdownBox> getZdIfcadre();
 
-    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
-            "from zd_emp_title " +
-            "where isnull(del_flag, 0) = 0")
+    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from zd_emp_title " + "where isnull(del_flag, 0) = 0")
     List<GetDropdownBox> getZdEmpTitle();
 
-    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " +
-            "from mzy_zd_charge_type " +
-            "where isnull(del_flag, 0) = 0")
+    @Select("select RTRIM(code) AS code,RTRIM(name) AS name " + "from mzy_zd_charge_type " + "where isnull(del_flag, 0) = 0")
     List<GetDropdownBox> getMzyZdChargeType();
 
-    @Update("update rs_config " +
-            "set rs_code =rs_code")
+    @Update("update rs_config " + "set rs_code =rs_code")
     void lockThePersonnelCodeTable();
 
-    @Select("select rs_code + 1 " +
-            "from rs_config")
+    @Select("select rs_code + 1 " + "from rs_config")
     Integer getPersonnelCode();
 
-    @Update("update rs_config " +
-            "set rs_code = #{code}")
+    @Update("update rs_config " + "set rs_code = #{code}")
     void updateStaffCodeTable(Integer code);
 
-    @Select("SELECT             rtrim(code_rs) as uid,\n" +
-            "                   rtrim(name)    as displayName,\n" +
-            "    manager      = '', /*1 就是有审核权限*/\n" +
-            "    oldUid       = '',\n" +
-            "    userPassword = '123456',\n" +
-            "    ou=            '001',\n" +
-            "    _id          = 'Emr.model.EmrUsers-' + cast(row_number() over (order by code ) + 2 as varchar),\n" +
-            "                   phone_no       as mobile\n" +
-            "from a_employee_mi\n" +
-            "where isnull(del_flag, 0) = 0\n" +
-            "  and (select role_id from dj_user_role where dj_user_role.user_code = a_employee_mi.code and role_id = 11) = 11")
+    @Select("SELECT             rtrim(code_rs) as uid,\n" + "                   rtrim(name)    as displayName,\n" + "    manager      = '', /*1 就是有审核权限*/\n" + "    oldUid       = '',\n" + "    userPassword = '123456',\n" + "    ou=            '001',\n" + "    _id          = 'Emr.model.EmrUsers-' + cast(row_number() over (order by code ) + 2 as varchar),\n" + "                   phone_no       as mobile\n" + "from a_employee_mi\n" + "where isnull(del_flag, 0) = 0\n" + "  and (select role_id from dj_user_role where dj_user_role.user_code = a_employee_mi.code and role_id = 11) = 11")
     List<Map<String, String>> emrAdd();
 
     @Select("SELECT rtrim(dept_code)  code ,rtrim(dept_name) name  FROM zy_adtward WHERE PATINDEX('8%',ward_code)=0 ")

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/inpatient/DismissDao.java

@@ -56,7 +56,7 @@ public interface DismissDao {
 
     @Select("SELECT message = N'药单号:' + CAST(page_no as VARCHAR) + " +
             "                 N',药品名称:' + + (select top 1 name from yp_zd_dict where charge_code = code) + " +
-            "                 N',医嘱号:' + CAST(`CAST(act_order_no AS DECIMAL`) AS VARCHAR(20)) " +
+            "                 N',医嘱号:' + CAST(CAST(act_order_no AS DECIMAL) AS VARCHAR(20)) " +
             " FROM yp_zy_patient WHERE inpatient_no=#{patNo} AND " +
             "admiss_times=#{times} AND amount <> 0 and acct_sign <> '2' ")
     List<String> hasUnreceivedDrugList(@Param("patNo") String patNo, @Param("times") Integer times);

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

@@ -358,7 +358,7 @@ public interface JianYanJianChaDao {
                        @Param("reqType") String reqType);
 
     @Insert("<script>" +
-            "INSERT INTO yz_act_order2 (order_code, order_name, frequ_code, infant_flag/*婴儿标志*/, order_time, physician, start_time, " +
+            "INSERT INTO yz_act_order (order_code, order_name, frequ_code, infant_flag/*婴儿标志*/, order_time, physician, start_time, " +
             "                          act_order_no, inpatient_no, admiss_times, drug_flag/*o*/, enter_oper/*录入人*/, enter_time/*录时间*/, " +
             "                          status_flag/*2*/, confirm_time, signer,/*在我这里保存了医嘱就直接确定了*/ " +
             "                          self_buy/*0*/, pay_self/*0*/, serial/*00*/, group_no/*00*/, doctor_flag, exec_unit, dept_code, " +

+ 6 - 9
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -67,7 +67,6 @@ public class PublicServer {
     private final PublicDao dao;
     private final TransferInOfExpensesDao transferInOfExpensesDao;
     private final RedisLikeService redisLikeService;
-
     private final SettingsDao settingsDao;
 
 
@@ -156,16 +155,15 @@ public class PublicServer {
         return true;
     }
 
-
     /**
      * 获取新的医嘱号
      *
      * @return 返回医嘱号
      */
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
-    public float getActOrderNo() {
-        float oldId = dao.getActOrderNo();
-        float newId = oldId + 1;
+    public BigDecimal getActOrderNo() {
+        BigDecimal oldId = dao.getActOrderNo();
+        BigDecimal newId = oldId.add(BigDecimal.ONE);
         int num = dao.updateActOrderNo(newId, oldId);
         if (num == 0) {
             throw new BizException(ExceptionEnum.LOGICAL_ERROR, "生成医嘱号错误请重新,请重试!");
@@ -195,9 +193,9 @@ public class PublicServer {
      * @return 返回序号
      */
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
-    public float getPatternOrderCode() {
-        float oldId = dao.getPatternOrderCode();
-        float newId = oldId + 1;
+    public BigDecimal getPatternOrderCode() {
+        BigDecimal oldId = dao.getPatternOrderCode();
+        BigDecimal newId = oldId.add(BigDecimal.ONE);
         int num = dao.updatePatternOrderCode(newId, oldId);
         if (num == 0) {
             throw new BizException(ExceptionEnum.LOGICAL_ERROR, "生成子医嘱模板编码错误,请重试!");
@@ -615,7 +613,6 @@ public class PublicServer {
         obj.put("message", title);
         // 消息数量
         obj.put("count", content.size());
-
         // 发送通知类
         List<SocketMessage> socketMessage1 = new ArrayList<>();
         List<SocketMessage> socketMessage2 = new ArrayList<>();

+ 1 - 1
src/main/java/thyyxxk/webserver/service/casefrontsheet/HuiZhenShenQingService.java

@@ -82,7 +82,7 @@ public class HuiZhenShenQingService {
         //下面是给申请次数 加一
         param.setReqTimes(dao.getMaxReqTimes(param.getInpatientNo(), param.getAdmissTimes()) + 1);
         param.setInputDate(new Date());
-        param.setActOrderNo(BigDecimal.valueOf(publicServer.getActOrderNo()));
+        param.setActOrderNo(publicServer.getActOrderNo());
         param.setInputId(TokenUtil.getTokenUserId());
         param.setReqDate(param.getInputDate());
         param.setOrderCode(getOrderCode("00" + param.getHzType()));

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

@@ -195,7 +195,7 @@ public class CaoYaoYiZhuServer {
         param.setOrderJeDj(dao.huoQuDaiJianFei());
         param.setPageNo(publicServer.getTheDrugListNo());
         XinZhenYiZhu huanZheXinXi = yiZhuLuRuDao.huoQuHuanZheXinXi(param.getInpatientNo(), param.getAdmissTimes());
-        param.setOrderNo(BigDecimal.valueOf(publicServer.getActOrderNo()));
+        param.setOrderNo(publicServer.getActOrderNo());
 
         // 生成草药和医嘱
         getThis().generateHerbs(param, huanZheXinXi);

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

@@ -459,7 +459,7 @@ public class JianYanJianChaShenQingServer {
         }
         // 生成 医嘱号和申请号
         for (YshYjReq item : param.getList()) {
-            item.setActOrderNo(BigDecimal.valueOf(publicServer.getActOrderNo()));
+            item.setActOrderNo(publicServer.getActOrderNo());
             item.setReqNo(publicServer.getReqPageNo());
         }
 

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

@@ -158,7 +158,7 @@ public class ShouShuShenQingServer {
         List<String> content = new ArrayList<>();
         for (OpRecord item : param.getList()) {
             item.setRecordId(publicServer.huoQuShouShuHao());
-            item.setActOrderNo(BigDecimal.valueOf(publicServer.getActOrderNo()));
+            item.setActOrderNo(publicServer.getActOrderNo());
             item.setOpTimes(shenQingCiShu += 1);
             // 生成医嘱
             shenChengYiZhu.add(item);

+ 3 - 39
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -89,7 +89,7 @@ public class YiZhuLuRuServer {
 
 
     public ResultVo<String> getOrderNo() {
-        return ResultVoUtil.success(BigDecimal.valueOf(publicServer.getActOrderNo()).stripTrailingZeros().toPlainString());
+        return ResultVoUtil.success(publicServer.getActOrderNo().stripTrailingZeros().toPlainString());
     }
 
     public ResultVo<List<Patient>> getMyPatient() {
@@ -487,7 +487,7 @@ public class YiZhuLuRuServer {
         Map<String, XinZhenYzActOrder> fatherAndSonDoctorSAdvice = new HashMap<>(param.getList().size());
         param.getList().forEach(item -> {
             fatherAndSonDoctorSAdvice.put(item.getId(), item);
-            item.setActOrderNo(BigDecimal.valueOf(publicServer.getActOrderNo()));
+            item.setActOrderNo(publicServer.getActOrderNo());
         });
         XinZhenYiZhu huanZheXinXi = dao.huoQuHuanZheXinXi(param.getInpatientNo(), param.getAdmissTimes());
         // 把模板的数据插入到医嘱
@@ -869,12 +869,11 @@ public class YiZhuLuRuServer {
 
         for (XinZhenYzActOrder item : param.getList()) {
             // 设置模板号
-            item.setActOrderNo(BigDecimal.valueOf(publicServer.getPatternOrderCode()));
+            item.setActOrderNo(publicServer.getPatternOrderCode());
             if (item.getParentNo() != null && map.containsKey(item.getParentNo().stripTrailingZeros().toPlainString())) {
                 item.setParentNo(map.get(item.getParentNo().stripTrailingZeros().toPlainString()).getActOrderNo());
             }
         }
-
         dao.chaRuMuBanShuJu(param.getList(), param.getPatternCode());
         return ResultVoUtil.success();
     }
@@ -1401,41 +1400,6 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success(feeData);
     }
 
-
-    /**
-     * 退药医嘱
-     *
-     * @param param 医嘱数组
-     * @return 返回提示
-     */
-    @Deprecated
-    public ResultVo<String> drugWithdrawal(List<String> param) {
-        if (ListUtil.isBlank(param)) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有可以退的药品。");
-        }
-        List<List<String>> list = ListUtils.partition(param, 40);
-        List<YzActOrder> yzActOrders = new ArrayList<>();
-        for (List<String> strings : list) {
-            yzActOrders.addAll(dao.getOriginalOrderData(strings));
-        }
-        List<List<YzActOrder>> returnedDoctorSOrder = ListUtils.partition(yzActOrders, 20);
-        String userCode = TokenUtil.getTokenUserId();
-        Map<String, String> fatherAndSonDoctorSAdvice = new HashMap<>();
-        for (YzActOrder item : yzActOrders) {
-            BigDecimal orderNo = BigDecimal.valueOf(publicServer.getActOrderNo());
-            BigDecimal oldOrderNo = item.getActOrderNo();
-            fatherAndSonDoctorSAdvice.put(oldOrderNo.stripTrailingZeros().toPlainString(), orderNo.stripTrailingZeros().toPlainString());
-            if (item.getParentNo() != null && fatherAndSonDoctorSAdvice.containsKey(item.getParentNo().stripTrailingZeros().toPlainString())) {
-                item.setParentNo(new BigDecimal(fatherAndSonDoctorSAdvice.get(item.getParentNo().stripTrailingZeros().toPlainString())));
-            }
-            item.setActOrderNo(orderNo);
-        }
-        for (List<YzActOrder> orders : returnedDoctorSOrder) {
-            dao.insertAReturnOrder(userCode, orders);
-        }
-        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "退药成功。");
-    }
-
     /**
      * 设置患者三级医生
      *