|
@@ -418,7 +418,6 @@ public class SiManageService {
|
|
|
input.put("iteminfo", JSONArray.parseArray(JSONArray.toJSONString(amtAndOthAmt)));
|
|
|
input.put("oprninfo", JSONArray.parseArray(JSONArray.toJSONString(upIdCollectionDao.oprninfoUplds(patNo, times))));
|
|
|
input.put("icuinfo", JSONArray.parseArray(JSONArray.toJSONString(zhongZhenJianHu)));
|
|
|
-
|
|
|
JSONObject jsonObject = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_SI_SETTLE_INFO, setlinfoUpld.getInsuplc());
|
|
|
jsonObject.replace("input", input);
|
|
|
JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
|
|
@@ -446,15 +445,17 @@ public class SiManageService {
|
|
|
if (ListUtil.isBlank(param)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择需要上传的患者。");
|
|
|
}
|
|
|
- for (SiPatInfo siPatInfo : param) {
|
|
|
+ for (int i = 0; i < param.size(); i++) {
|
|
|
+ SiPatInfo siPatInfo = param.get(i);
|
|
|
+ int percentage = makePercentage(i + 1, param.size());
|
|
|
try {
|
|
|
ResultVo<JSONObject> resultVo = upldSetlList(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn());
|
|
|
- if (resultVo.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
- upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(), resultVo.getMessage());
|
|
|
- }
|
|
|
+ upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(),
|
|
|
+ resultVo.getMessage(), resultVo.getCode(), percentage);
|
|
|
} catch (Exception e) {
|
|
|
log.info("批量上传结算单错误:{}", JSON.toJSONString(e));
|
|
|
- upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(), e.getMessage());
|
|
|
+ upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(),
|
|
|
+ e.getMessage(), ExceptionEnum.INTERNAL_SERVER_ERROR.getCode(), percentage);
|
|
|
}
|
|
|
}
|
|
|
return ResultVoUtil.success();
|
|
@@ -481,17 +482,22 @@ public class SiManageService {
|
|
|
*
|
|
|
* @param meg 错误消息
|
|
|
*/
|
|
|
- public void upldSetlErrorMessage(String patNo, Integer times, Integer ledgerSn, String meg) {
|
|
|
+ public void upldSetlErrorMessage(String patNo, Integer times, Integer ledgerSn, String meg, int code, int percentage) {
|
|
|
JSONObject obj = new JSONObject();
|
|
|
obj.put("name", "upldSetlListMessage");
|
|
|
obj.put("message", meg);
|
|
|
obj.put("patNo", patNo);
|
|
|
obj.put("times", times);
|
|
|
obj.put("ledgerSn", ledgerSn);
|
|
|
+ obj.put("code", code);
|
|
|
+ obj.put("percentage", percentage);
|
|
|
String message = obj.toJSONString();
|
|
|
- // 先写死成我的 02896
|
|
|
WebSocketServer.sendMessageByUserCode(TokenUtil.getTokenUserId(), message);
|
|
|
log.info("发送错误通知:{}", message);
|
|
|
}
|
|
|
|
|
|
+ private int makePercentage(int index, int size) {
|
|
|
+ float per = (float) index / (float) size;
|
|
|
+ return (int) (per * 100);
|
|
|
+ }
|
|
|
}
|