Browse Source

优化费用计算问题。

lighter 4 years ago
parent
commit
d5e057ebe9

+ 3 - 3
src/main/java/thyyxxk/webserver/dao_his/yibao/DismissDao.java

@@ -337,11 +337,11 @@ public interface DismissDao {
 
     @Insert("insert into zy_work_log (inpatient_no,admiss_times,ledger_sn,op_id,op_date,log_type," +
             "dept_code,ward_code,name) values (#{inpatientNo},#{admissTimes},#{ledgerSn},#{codeRs}," +
-            "getDate(),'6',#{deptCode},#{wardCode},#{userName})")
+            "getDate(),#{logType},#{deptCode},#{wardCode},#{userName})")
     int insertNewZyWorkLog(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes,
                            @Param("ledgerSn") int ledgerSn, @Param("wardCode") String wardCode,
-                           @Param("deptCode") String deptCode, @Param("codeRs") String codeRs,
-                           @Param("userName") String userName);
+                           @Param("logType") String logType, @Param("deptCode") String deptCode,
+                           @Param("codeRs") String codeRs, @Param("userName") String userName);
 
     @Update("update ${table} set times_billed=(times_billed+1) where " +
             "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")

+ 9 - 5
src/main/java/thyyxxk/webserver/service/yibao/DismissService.java

@@ -192,13 +192,16 @@ public class DismissService {
                 hisTotalCharge = dao.getTotalChargeForCyjs(inpatientNo, admissTimes, ledgerSn);
             }
             ResultVo<Object> resultVo = YibaoHttpUtil.httpPost("preCalculateCost", param, responce);
-            if (resultVo.getCode() != 200 && resultVo.getCode() != 2002) {
+            if (resultVo.getCode() != 200 && resultVo.getCode() != 2002 && !resultVo.getMessage().contains("没有找到费用明细")) {
                 ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
                 exception.setMessage(resultVo.getMessage());
                 throw new BizException(exception);
             } else {
-                HashMap<String, String> obj = FilterUtil.cast(resultVo.getData());
-                String ybTotalCharge = obj.get("totalCost");
+                String ybTotalCharge = "0.00";
+                if (!resultVo.getMessage().contains("没有找到费用明细")) {
+                    HashMap<String, String> obj = FilterUtil.cast(resultVo.getData());
+                    ybTotalCharge = obj.get("totalCost");
+                }
                 if (DecimalUtil.feeDiffsOverOneRmb(hisTotalCharge, ybTotalCharge)) {
                     if (param.getDismissFlag() == 1) {
                         int count = dao.hasFeeNotUpload(inpatientNo, admissTimes, ledgerSn);
@@ -241,7 +244,7 @@ public class DismissService {
                             exception.setMessage(resultVo.getMessage());
                             throw new BizException(exception);
                         } else {
-                            obj = FilterUtil.cast(resultVo.getData());
+                            HashMap<String, String> obj = FilterUtil.cast(resultVo.getData());
                             ybTotalCharge = obj.get("totalCost");
                             if (DecimalUtil.feeDiffsOverOneRmb(hisTotalCharge, ybTotalCharge)) {
                                 ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
@@ -430,8 +433,9 @@ public class DismissService {
 
     private int insertNewZyWorkLog(YbSettleFeePojo indata) {
         final String userName = dao.getOperateName(indata.getStaffId());
+        String logType = indata.getFlag() == 1 ? "cyjs" : "zjdz";
         return dao.insertNewZyWorkLog(indata.getInpatientNo(), indata.getAdmissTimes(), indata.getLedgerSn(),
-                indata.getWardCode(), indata.getDeptCode(), indata.getStaffId(), userName);
+                indata.getWardCode(), logType, indata.getDeptCode(), indata.getStaffId(), userName);
     }
 
     private int hisMiddleSettle(YbSettleFeePojo indata) {