Browse Source

修改 bug

xiaochan 3 years ago
parent
commit
84464d3668

+ 1 - 1
pom.xml

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

+ 5 - 5
src/main/java/thyyxxk/webserver/dao/his/querydata/KeShiShouRuDao.java

@@ -181,13 +181,13 @@ public interface KeShiShouRuDao {
      * @return 返回信息
      */
     @Select("<script>" +
-            "select top ${pageSize} * from (select ROW_NUMBER() over (ORDER BY charge_date ) as RowNumber, rtrim(patient_id) patient," +
+            "select top ${pageSize} * from (select ROW_NUMBER() over (ORDER BY confirm_time ) as RowNumber, rtrim(patient_id) patient," +
             "times,rtrim(name) patient_name,\n" +
-            "rtrim(charge_item_code) charge_code_mx,charge_date,confirm_id op_id_code,rtrim(exec_dept) exec_unit,rtrim(warn_dept) ward_code,\n" +
+            "rtrim(charge_item_code) charge_code_mx,confirm_time as charge_date,confirm_id op_id_code,rtrim(exec_dept) exec_unit,rtrim(warn_dept) ward_code,\n" +
             "cast ((quantity*drug_win) as decimal(14,2)) charge_amount,\n" +
             "cast ((quantity*drug_win*unit_price) as decimal(14,2)) charge_fee,source = '门诊'\n" +
             "from mz_charge_detail where  bill_item_code NOT IN ('TC','020') and\n" +
-            "charge_date &gt;= #{startTime,jdbcType = TIMESTAMP} and charge_date &lt;= #{endTime,jdbcType = TIMESTAMP}" +
+            "confirm_time &gt;= #{startTime,jdbcType = TIMESTAMP} and confirm_time &lt;= #{endTime,jdbcType = TIMESTAMP}" +
             "<if test=\"list != null and list.size > 0 \">" +
             " and exec_dept in " +
             "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
@@ -231,7 +231,7 @@ public interface KeShiShouRuDao {
     @Select("<script>" +
             "select count(*) total, sum (cast ((quantity*drug_win*unit_price) as decimal(14,2))) charge_fee  " +
             "from mz_charge_detail where  bill_item_code NOT IN ('TC','020') and\n" +
-            "charge_date &gt;= #{startTime,jdbcType = TIMESTAMP} and charge_date &lt;= #{endTime,jdbcType = TIMESTAMP}" +
+            "confirm_time &gt;= #{startTime,jdbcType = TIMESTAMP} and confirm_time &lt;= #{endTime,jdbcType = TIMESTAMP}" +
             "<if test=\"execUnitList != null and execUnitList.size > 0 \">" +
             " and exec_dept in " +
             "<foreach collection='execUnitList' item='item' index='index' open='(' close=')' separator=','>" +
@@ -286,7 +286,7 @@ public interface KeShiShouRuDao {
             "sum(cast ((quantity*drug_win*unit_price) as decimal(14,2))) charge_fee,\n" +
             "sum(cast ((quantity*drug_win) as decimal(14,2))) charge_amount,source= '门诊' " +
             "from mz_charge_detail where  bill_item_code NOT IN ('TC','020') and\n" +
-            "charge_date &gt;= #{startTime,jdbcType = TIMESTAMP} and charge_date &lt;= #{endTime,jdbcType = TIMESTAMP}" +
+            "confirm_time &gt;= #{startTime,jdbcType = TIMESTAMP} and confirm_time &lt;= #{endTime,jdbcType = TIMESTAMP}" +
             "<if test=\"execUnitList != null and execUnitList.size > 0 \">" +
             " and exec_dept in " +
             "<foreach collection='execUnitList' item='item' index='index' open='(' close=')' separator=','>" +

+ 38 - 10
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyiji/MenZhengXiangMuDao.java

@@ -75,7 +75,7 @@ public interface MenZhengXiangMuDao {
                                             @Param("endTime") String endTime,
                                             @Param("dept") String dept);
 
-    @Select("SELECT patient_id=a.patient_id,  " +
+    @Select("SELECT patient_id=rtrim(a.patient_id),  " +
             "       times=a.times,  " +
             "       receipt_no=a.receipt_no,  " +
             "       order_no=a.order_no,  " +
@@ -99,7 +99,7 @@ public interface MenZhengXiangMuDao {
             "  " +
             "union  " +
             "  " +
-            "SELECT patient_id=a.patient_id,  " +
+            "SELECT patient_id=rtrim(a.patient_id),  " +
             "       times     =a.times,  " +
             "       receipt_no=a.receipt_no,  " +
             "       order_no=a.order_no,  " +
@@ -123,7 +123,7 @@ public interface MenZhengXiangMuDao {
             "        isnull(a.req_no,0) > 0  " +
             "union  " +
             "  " +
-            "SELECT patient_id=a.patient_id,  " +
+            "SELECT patient_id=rtrim(a.patient_id),  " +
             "       times     =a.times,  " +
             "       receipt_no=a.receipt_no,  " +
             "       order_no=a.order_no,  " +
@@ -152,7 +152,7 @@ public interface MenZhengXiangMuDao {
 
     @Select("SELECT req_no     =a.req_no,   " +
             "       je         =sum(round(quantity * unit_price,2)),   " +
-            "       charge_date=max(a.charge_date)   " +
+            "       charge_date=max(a.charge_date) " +
             "FROM mz_charge_detail a ,zd_charge_item b   " +
             "where    a.serial_no       =#{serialNo} and   " +
             "        a.pay_mark='0'    and   " +
@@ -192,7 +192,8 @@ public interface MenZhengXiangMuDao {
                                    @Param("reqNo") Integer reqNo);
 
     @Select("<script>" +
-            "select req_no,confirm_flag,charge_item_code,bill_item_code,patient_id,times,charge_date from mz_charge_detail where req_no in" +
+            "select req_no,confirm_flag,charge_item_code,bill_item_code,rtrim(patient_id) patient_id,times,charge_date,item_no,receipt_no,order_no from mz_charge_detail " +
+            "where req_no in" +
             "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
             "#{item}" +
             "</foreach>" +
@@ -210,7 +211,7 @@ public interface MenZhengXiangMuDao {
 
     @Update("<script>" +
             "<foreach collection='list' item='item' separator=';'> " +
-            "update ${tableName} " +
+            "update mz_charge_detail " +
             "<set>" +
             " confirm_flag = #{item.confirmFlag} , receive_flag = #{item.confirmFlag}  " +
             "<choose>" +
@@ -218,18 +219,45 @@ public interface MenZhengXiangMuDao {
             ",confirm_time =getdate() , exec_dept =#{execDept},confirm_id =#{confirmId}" +
             "</when>" +
             "<otherwise>" +
-            ",confirm_time = null , exec_dept = null,confirm_id = null" +
+            ",confirm_time = null,confirm_id = null" + //  , exec_dept = null
             "</otherwise>" +
             "</choose>" +
             "</set>" +
             "where " +
-            "patient_id = #{item.patientId} and times =#{item.times} and req_no =#{item.reqNo}" +
+            "patient_id = #{item.patientId} and times =#{item.times} " +
+            "and item_no = #{item.itemNo} and charge_item_code = #{item.chargeItemCode} " +
+            "and receipt_no = #{item.receiptNo} and order_no = #{item.orderNo} " +
+            "and req_no =#{item.reqNo} " +
             "</foreach>" +
             "</script>")
     void xiangMuQueRenHuoQuXiao(@Param("list") List<MzChargeDetail> list,
                                 @Param("confirmId") String confirmId,
-                                @Param("execDept") String execDept,
-                                @Param("tableName") String tableName);
+                                @Param("execDept") String execDept);
+
 
+    @Update("<script>" +
+            "<foreach collection='list' item='item' separator=';'> " +
+            "update mz_yj_req " +
+            "<set>" +
+            " confirm_flag = #{item.confirmFlag} , receive_flag = #{item.confirmFlag}  " +
+            "<choose>" +
+            "<when test=\"item.confirmFlag == 1\">" +
+            ",confirm_time =getdate() , exec_dept =#{execDept},confirm_id =#{confirmId}" +
+            "</when>" +
+            "<otherwise>" +
+            ",confirm_time = null ,confirm_id = null" + // , exec_dept = null
+            "</otherwise>" +
+            "</choose>" +
+            "</set>" +
+            "where " +
+            "patient_id = #{item.patientId} and times =#{item.times} " +
+            "and item_no = #{item.itemNo} " +
+            "and receipt_no = #{item.receiptNo} and order_no = #{item.orderNo} " +
+            "and req_no =#{item.reqNo} " +
+            "</foreach>" +
+            "</script>")
+    void xiangMuQueRenYjReq(@Param("list") List<MzChargeDetail> list,
+                            @Param("confirmId") String confirmId,
+                            @Param("execDept") String execDept);
 
 }

+ 1 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiManageService.java

@@ -422,7 +422,7 @@ public class SiManageService {
         jsonObject.replace("input", input);
         JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
 
-        log.info("医保结算信息上传:\n参数:{} \n结果:{}", jsonObject, result);
+        log.info("医保结算信息上传 \n操作人{}\n参数:{} \n结果:{}", TokenUtil.getTokenUserId(), jsonObject, result);
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }

+ 0 - 1
src/main/java/thyyxxk/webserver/service/querydata/KeShiShouRuServer.java

@@ -118,7 +118,6 @@ public class KeShiShouRuServer {
                             param.getChargeCodeMx(), renHuanCodeHeCodeRs.getCode(), renHuanCodeHeCodeRs.getCodeRs(), param.getReqDeptCode()));
                     break;
             }
-
         }
         pingJieZiDuanMingChen(qp, huanZheBiao);
         return ResultVoUtil.success(qp);

+ 12 - 7
src/main/java/thyyxxk/webserver/service/zhuyuanyiji/MenZhengXiangMuServer.java

@@ -111,15 +111,20 @@ public class MenZhengXiangMuServer {
         if (ListUtil.isBlank(mzcd.getReqNos())) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择需要操作的数据。");
         }
-        Map<Integer, List<MzChargeDetail>> buYaoChongFuChaoZuo = dao.genJuShenQingHuoQuMingXi(mzcd.getPatientId(), mzcd.getTimes(), mzcd.getReqNos()).stream()
-                .collect(Collectors.groupingBy(MzChargeDetail::getReqNo));
+        Map<String, List<MzChargeDetail>> buYaoChongFuChaoZuo = dao.genJuShenQingHuoQuMingXi(mzcd.getPatientId(), mzcd.getTimes(), mzcd.getReqNos()).stream()
+                .collect(Collectors.groupingBy(item -> item.getPatientId() + "_" + item.getTimes() + "_" + item.getReceiptNo() + "_" + item.getOrderNo() + "_"
+                        + item.getItemNo() + "_" + item.getChargeItemCode() + "_" + item.getReqNo()));
+
+        log.info("huoqu :{}", JSON.toJSONString(buYaoChongFuChaoZuo));
 
         if (buYaoChongFuChaoZuo.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有查询到对应的申请号信息");
         }
         // 这个是 判断操作的是 已确认的 还是未确认的
         mzChargeDetail.getList().forEach(item -> {
-            Integer key = item.getReqNo();
+            String key = item.getPatientId().trim() + "_" + item.getTimes() + "_" + item.getReceiptNo() + "_" + item.getOrderNo() + "_"
+                    + item.getItemNo() + "_" + item.getChargeCode() + "_" + item.getReqNo();
+            log.info("key:{}", key);
             // 不能改成为确认
             if (buYaoChongFuChaoZuo.containsKey(key)) {
                 for (MzChargeDetail chargeDetail : buYaoChongFuChaoZuo.get(key)) {
@@ -130,19 +135,19 @@ public class MenZhengXiangMuServer {
                             mz.add(chargeDetail);
                         }
                     } else if (item.getConfirmFlag() != 0 && mzChargeDetail.getSource().equals("接口")) {
-                        cuoWuXinXi.put(key, String.format("申请号为:【%s】,请勿重复操作。", key));
+                        cuoWuXinXi.put(item.getReqNo(), String.format("申请号为:【%s】,请勿重复操作。", key));
                     }
                 }
             } else if (item.getConfirmFlag() != 0) {
-                cuoWuXinXi.put(key, String.format("申请号为:【%s】,在数据库中没有查询到对应信息。", key));
+                cuoWuXinXi.put(item.getReqNo(), String.format("申请号为:【%s】,在数据库中没有查询到对应信息。", key));
             }
         });
         if (mz.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请勿重复操作。");
         } else {
             log.info("门诊项目确认或取消 操作人:{},数据:{}", confirmId, JSON.toJSONString(mz));
-            dao.xiangMuQueRenHuoQuXiao(mz, confirmId, mzChargeDetail.getExecDept(), "mz_charge_detail");
-            dao.xiangMuQueRenHuoQuXiao(mz, confirmId, mzChargeDetail.getExecDept(), "mz_yj_req");
+            dao.xiangMuQueRenHuoQuXiao(mz, confirmId, mzChargeDetail.getExecDept());
+            dao.xiangMuQueRenYjReq(mz, confirmId, mzChargeDetail.getExecDept());
         }
         if (!cuoWuXinXi.isEmpty()) {
             return ResultVoUtil.success(ExceptionEnum.LOGICAL_ERROR, cuoWuXinXi.toString());