lighter пре 3 година
родитељ
комит
b7f590a67c

+ 1 - 1
src/main/java/thyyxxk/webserver/constants/sidicts/PolItemCode.java

@@ -19,7 +19,7 @@ public enum PolItemCode {
 
     TCED("C002", "统筹二段"),
 
-    TCSD("C002", "统筹三段"),
+    TCSD("C003", "统筹三段"),
 
     BCYFQFBZ("S001", "本次应付起付标准"),
 

+ 4 - 2
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiLogDao.java

@@ -12,13 +12,15 @@ import thyyxxk.webserver.entity.medicalinsurance.log.SiLog;
 public interface SiLogDao extends BaseMapper<SiLog> {
 
     @Select("<script>" +
-            "select msgid,infno,insuplc_admdvs,opter,create_datetime,pat_no,times from t_si_log " +
+            "select msgid,infno,insuplc_admdvs,opter,create_datetime,pat_no,times, " +
+            "infcode, infcodeName=(case when infcode=0 then '成功' else '失败' end) " +
+            "from t_si_log " +
             "where log_type=#{ftclg.logType} " +
             "<if test=\"ftclg.infno!=null\">" +
             "and infno=#{ftclg.infno} " +
             "</if>" +
             "<if test=\"ftclg.begntime!=null and ftclg.endtime!=null\">" +
-            "and create_datetime&gt;=#{ftclg.begntime} and create_datetime&lt;#{ftclg.endtime} " +
+            "and create_datetime&gt;=#{ftclg.begntime} and create_datetime&lt;=#{ftclg.endtime} " +
             "</if>" +
             "<if test=\"ftclg.patNo!=null\">" +
             "and pat_no=#{ftclg.patNo} " +

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiZyDao.java

@@ -54,7 +54,7 @@ public interface SiZyDao {
      * @return 入院基本信息
      */
     @Select("select b.psn_no,b.insutype, " +
-            "a.yb_register_date as begntime, " +
+            "isnull(a.yb_register_date,a.admiss_date) as begntime, " +
             "mdtrtCertType='02', " +
             "b.certno as mdtrtCertNo, " +
             "certType='1', " +

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/inpatient/SpecialDiag.java

@@ -23,4 +23,5 @@ public class SpecialDiag {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date expirationDate;
+    private String insulevel;
 }

+ 10 - 1
src/main/java/thyyxxk/webserver/entity/medicalinsurance/log/SiLog.java

@@ -84,10 +84,18 @@ public class SiLog implements Serializable {
 	 * */
 	private Date createDatetime;
 
+	/**
+	 * 返回结果:0 成功,-1 失败
+	 * */
+	private Integer infcode;
+
+	@TableField(exist = false)
+	private String infcodeName;
+
 	public SiLog() {
 	}
 
-	public SiLog(JSONObject input, JSONObject result, String patNo, Integer times, Integer ledgerSn) {
+	public SiLog(JSONObject input, JSONObject result, String patNo, Integer times, Integer ledgerSn, Integer infcode) {
 		if (null != result) {
 			setResult(result.toJSONString());
 		}
@@ -100,5 +108,6 @@ public class SiLog implements Serializable {
 		setTimes(times);
 		setLedgerSn(ledgerSn);
 		setLogType(1);
+		setInfcode(infcode);
 	}
 }

+ 4 - 3
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -119,14 +119,15 @@ public class SetlListUpldService {
         // 这里是上传
         JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
         log.info("医保结算信息上传 \n操作人:{}\n参数:{} \n结果:{}", TokenUtil.getTokenUserId(), jsonObject, result);
-        logDao.insert(new SiLog(jsonObject, result, patNo, times, ledgerSn));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(jsonObject, result, patNo, times, ledgerSn, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("医保中心报错:【%s】 ", result.getString("message")));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             dao.fanHuiLiuShuiHao(result.getJSONObject(OUTPUT).getString("setl_list_id"), upldCollection.getData().getSetlinfo().getSetlId());
             return ResultVoUtil.success(ExceptionEnum.SUCCESS, "上传成功");
         }

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

@@ -75,14 +75,15 @@ public class SiManageService {
         input.getJSONObject("input").put("data", data);
         JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_CATALOGUE_CONTRAST);
         log.info("【操作员:{}】,上传目录对照:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             dao.updateUploadedFlag(prm.getTable(), YesOrNo.YES.getCode(), codes);
             return ResultVoUtil.success("上传目录对照成功。");
         }
@@ -100,14 +101,15 @@ public class SiManageService {
         input.getJSONObject("input").put("data", data);
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_CATALOGUE_CONTRAST);
         log.info("【操作员:{}】,撤销目录:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             dao.updateUploadedFlag2(prm.getTable(), prm.getChargeCode());
             return ResultVoUtil.success("撤销目录对照成功。");
         }
@@ -140,8 +142,9 @@ public class SiManageService {
         String ref = JSONObject.toJSONString(atoRcvTrd);
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.AUTO_RECOVERY_TRADE);
-        logDao.insert(new SiLog(input, result, null, null, null));
         log.info("【操作员:{}】,冲正交易:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
         return SiUtil.makeReturnWithoutOutput(result, "冲正成功。");
     }
 

+ 24 - 18
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiPsnRcdService.java

@@ -55,14 +55,15 @@ public class SiPsnRcdService {
         input.getJSONObject("input").put("refmedin", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.TRANSFER_HOSPITAL_RECORD);
         log.info("【操作员:{}】,转院备案:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             JSONObject output = result.getJSONObject(OUTPUT);
             String trtDclaDetlSn = output.getJSONObject("result").getString("trt_dcla_detl_sn");
             trsHspRcd.setTrtDclaDetlSn(trtDclaDetlSn);
@@ -88,14 +89,15 @@ public class SiPsnRcdService {
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_TRANSFER_HOSPITAL_RECORD);
         log.info("【操作员:{}】,转院备案撤销:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             trsHspRcdDao.deleteById(rvkPsnRcd.getId());
             return ResultVoUtil.success("转院备案撤销成功。");
         }
@@ -110,14 +112,15 @@ public class SiPsnRcdService {
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.SPECIAL_CHRONIC_DISEASES_RECORD);
         log.info("【操作员:{}】,人员慢特病备案:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             JSONObject output = result.getJSONObject(OUTPUT);
             String trtDclaDetlSn = output.getJSONObject("result").getString("trt_dcla_detl_sn");
             slwSpcDiseRcd.setTrtDclaDetlSn(trtDclaDetlSn);
@@ -143,14 +146,15 @@ public class SiPsnRcdService {
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_SPECIAL_CHRONIC_DISEASES_RECORD);
         log.info("【操作员:{}】,人员慢特病备案撤销:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             slwSpcChrRcdDao.deleteById(rvkPsnRcd.getId());
             return ResultVoUtil.success("人员慢特病备案撤销成功。");
         }
@@ -165,14 +169,15 @@ public class SiPsnRcdService {
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.PERSONNEL_ASSIGNMENT_RECORD);
         log.info("【操作员:{}】,人员定点备案:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             JSONObject output = result.getJSONObject(OUTPUT);
             String trtDclaDetlSn = output.getJSONObject("result").getString("trt_dcla_detl_sn");
             psnAgnRcd.setTrtDclaDetlSn(trtDclaDetlSn);
@@ -198,14 +203,15 @@ public class SiPsnRcdService {
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_PERSONNEL_ASSIGNMENT_RECORD);
         log.info("【操作员:{}】,人员定点备案撤销:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, null, null, null));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             psnAsgRcdDao.deleteById(rvkPsnRcd.getId());
             return ResultVoUtil.success("人员定点备案撤销成功。");
         }

+ 33 - 24
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -104,13 +104,14 @@ public class SiZyService {
         input.getJSONObject("input").put("diseinfo", JSONArray.parse(diseRef));
         JSONObject result = exec.executeTrade(input, SiFunction.ADMISSION_REGISTRATION);
         log.info("【操作员:{}】,医保入院登记:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
         if (result.getIntValue(RESULT_CODE) == 0) {
             JSONObject output = result.getJSONObject(OUTPUT);
             String mdtrtId = output.getJSONObject("result").getString("mdtrt_id");
@@ -155,7 +156,8 @@ public class SiZyService {
         input.getJSONObject("input").put("diseinfo", JSONArray.parse(diseRef));
         JSONObject result = exec.executeTrade(input, SiFunction.MODIFY_ADMISSION_INFO);
         log.info("【操作员:{}】,入院信息变更:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
         return SiUtil.makeReturnWithoutOutput(result, "变更住院信息成功。");
     }
 
@@ -172,14 +174,15 @@ public class SiZyService {
         input.getJSONObject("input").put("data", data);
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_ADMISSION);
         log.info("【操作员:{}】,取消入院登记:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             qrydao.clearMdtrtIdForZy(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(), null);
             dao.updateResponceType("01", null, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             return ResultVoUtil.success("取消入院登记成功。");
@@ -207,14 +210,15 @@ public class SiZyService {
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.HOSPITALIZATION_PRE_SETTLEMENT);
         log.info("预结算:\n参数:{},\n结果:{}", input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             JSONObject setlinfo = result.getJSONObject(OUTPUT).getJSONObject("setlinfo");
             String fundPay = setlinfo.getString("fund_pay_sumamt");
             if (DecimalUtil.compare(fundPay, p.getTotalCharge()) == 1) {
@@ -252,14 +256,15 @@ public class SiZyService {
         input.getJSONObject("input").put("data", data);
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_HOSPITALIZATION_FEE_DETAILS);
         log.info("【操作员:{}】撤销已上传的费用:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             QueryWrapper<SiChargeTemp> wrapper = new QueryWrapper<>();
             wrapper.eq("pat_no", p.getInpatientNo());
             wrapper.eq("times", p.getAdmissTimes());
@@ -309,14 +314,15 @@ public class SiZyService {
         input.getJSONObject("input").put("diseinfo", JSONArray.parse(diseRef));
         JSONObject result = exec.executeTrade(input, SiFunction.DISCHARGE_PROCESSING);
         log.info("【操作员:{}】,医保出院办理:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             return inpatientSettlement(p);
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
@@ -336,14 +342,15 @@ public class SiZyService {
         input.getJSONObject("input").put("data", data);
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_DISCHARGE);
         log.info("【操作员:{}】取消医保出院办理:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
+        if (null == infcode) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             dao.deleteSetlInfo(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             dao.deleteSetlDetail(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             transbackTables(p);
@@ -375,16 +382,17 @@ public class SiZyService {
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.HOSPITALIZATION_SETTLEMENT);
         log.info("【操作员:{}】,医保出院结算:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             revokeDischarge(p);
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
+        if (null == infcode) {
             revokeDischarge(p);
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             setlListUpldService.yiBaoZhiFuFangShi(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             JSONObject setlinfo = result.getJSONObject(OUTPUT).getJSONObject("setlinfo");
             SiSetlinfo setlEntity = JSONObject.parseObject(setlinfo.toJSONString(), SiSetlinfo.class);
@@ -450,14 +458,15 @@ public class SiZyService {
         input.getJSONObject("input").put("data", data);
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_HOSPITALIZATION_SETTLEMENT);
         log.info("【操作员:{}】取消医保结算:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
-        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         if (null == result) {
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
         }
-        if (null == result.getInteger(RESULT_CODE)) {
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), infcode));
+        if (null == infcode) {
             return revokeDischarge(p);
         }
-        if (result.getIntValue(RESULT_CODE) == 0) {
+        if (infcode == 0) {
             dao.updateRvkSetlMsgid(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), input.getString("msgid"));
             transbackTables(p);
         }