|
@@ -118,7 +118,8 @@ public class SiZyFeeService {
|
|
|
|
|
|
public ResultVo<String> uploadSinglePatientFees(Overview overview) {
|
|
|
if (uploadingMap.containsKey(overview.getInpatientNo())) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者正在其他机器上传,操作人是" +
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
|
|
|
+ "该患者正在其他机器上传,操作人是" +
|
|
|
uploadingMap.get(overview.getInpatientNo()).getStaff());
|
|
|
}
|
|
|
if (!staffMap.containsKey(overview.getStaffId())) {
|
|
@@ -357,30 +358,30 @@ public class SiZyFeeService {
|
|
|
String ref = JSONArray.toJSONString(fees);
|
|
|
input.getJSONObject("input").put("feedetail", JSONArray.parse(ref));
|
|
|
JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_HOSPITALIZATION_FEE_DETAILS);
|
|
|
- log.info("【操作员:{}】,医保费用上传:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
|
|
|
- if (null != result) {
|
|
|
- if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
- JSONArray array = result.getJSONObject(OUTPUT).getJSONArray("result");
|
|
|
- List<SiChargeTemp> tempList = new ArrayList<>();
|
|
|
- for (int i = 0; i < array.size(); i++) {
|
|
|
- JSONObject upldretrn = array.getJSONObject(i);
|
|
|
- SiChargeTemp chrgtemp = JSONObject.parseObject(upldretrn.toJSONString(), SiChargeTemp.class);
|
|
|
- chrgtemp.setPatNo(p.getInpatientNo());
|
|
|
- chrgtemp.setTimes(p.getAdmissTimes());
|
|
|
- chrgtemp.setLedgerSn(p.getLedgerSn());
|
|
|
- tempList.add(chrgtemp);
|
|
|
- }
|
|
|
- zyDao.updateTransFlag(p.getInpatientNo(), p.getAdmissTimes(), tempList);
|
|
|
- zyDao.insertSiChargeTempFeeBatch(tempList);
|
|
|
- return new int[] {tempList.size(), fees.size() - tempList.size()};
|
|
|
- } else {
|
|
|
- RestTemplate template = new RestTemplate();
|
|
|
- String message = result.getString(ERROR_MESSAGE);
|
|
|
- sendUploadResponse(p, template, message);
|
|
|
- return new int[] {fees.size(), 0};
|
|
|
+ int infcode = result.getIntValue(RESULT_CODE);
|
|
|
+ String logMsg = infcode + "," + result.getString("inf_refmsgid");
|
|
|
+ log.info("【操作员:{}】,医保费用上传:\n患者:{},\n结果:{}", p.getStaffId(),
|
|
|
+ p.getPsnInfo(), logMsg);
|
|
|
+ if (infcode == 0) {
|
|
|
+ JSONArray array = result.getJSONObject(OUTPUT).getJSONArray("result");
|
|
|
+ List<SiChargeTemp> tempList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
+ JSONObject upldretrn = array.getJSONObject(i);
|
|
|
+ SiChargeTemp chrgtemp = JSONObject.parseObject(upldretrn.toJSONString(), SiChargeTemp.class);
|
|
|
+ chrgtemp.setPatNo(p.getInpatientNo());
|
|
|
+ chrgtemp.setTimes(p.getAdmissTimes());
|
|
|
+ chrgtemp.setLedgerSn(p.getLedgerSn());
|
|
|
+ tempList.add(chrgtemp);
|
|
|
}
|
|
|
+ zyDao.updateTransFlag(p.getInpatientNo(), p.getAdmissTimes(), tempList);
|
|
|
+ zyDao.insertSiChargeTempFeeBatch(tempList);
|
|
|
+ return new int[]{tempList.size(), fees.size() - tempList.size()};
|
|
|
+ } else {
|
|
|
+ RestTemplate template = new RestTemplate();
|
|
|
+ String message = result.getString(ERROR_MESSAGE);
|
|
|
+ sendUploadResponse(p, template, message);
|
|
|
+ return new int[]{fees.size(), 0};
|
|
|
}
|
|
|
- return new int[]{0, 0};
|
|
|
}
|
|
|
|
|
|
public ResultVo<String> hospitalizationPreSettlement(ZyPatientInfo p, Overview o) {
|