|
@@ -311,7 +311,7 @@ public class SiManageService {
|
|
|
}
|
|
|
|
|
|
public ResultVo<JSONObject> upldSetlList(String patNo, Integer times, Integer ledgerSn) throws Exception {
|
|
|
- SetlinfoUpld setlinfoUpld = upIdCollectionDao.setlinfo1(patNo, times);
|
|
|
+ SetlinfoUpld setlinfoUpld = upIdCollectionDao.setlinfo1(patNo, times, ledgerSn);
|
|
|
if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
|
|
|
}
|
|
@@ -421,6 +421,7 @@ public class SiManageService {
|
|
|
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);
|
|
|
+
|
|
|
log.info("医保结算信息上传:\n参数:{} \n结果:{}", jsonObject, result);
|
|
|
if (null == result) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
@@ -445,17 +446,25 @@ public class SiManageService {
|
|
|
if (ListUtil.isBlank(param)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择需要上传的患者。");
|
|
|
}
|
|
|
+ List<PureCodeName> keys = new ArrayList<>();
|
|
|
+ keys.add(new PureCodeName("patNo", "住院号"));
|
|
|
+ keys.add(new PureCodeName("times", "住院次数"));
|
|
|
+ keys.add(new PureCodeName("ledgerSn", "账页号"));
|
|
|
+ keys.add(new PureCodeName("message", "上传结果"));
|
|
|
+ keys.add(new PureCodeName("type", "错误类型"));
|
|
|
+
|
|
|
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());
|
|
|
upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(),
|
|
|
- resultVo.getMessage(), resultVo.getCode(), percentage);
|
|
|
+ resultVo.getMessage(), resultVo.getCode() == 200 ? 1 : 2, percentage, keys);
|
|
|
} catch (Exception e) {
|
|
|
log.info("批量上传结算单错误:{}", JSON.toJSONString(e));
|
|
|
+ e.printStackTrace();
|
|
|
upldSetlErrorMessage(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(),
|
|
|
- e.getMessage(), ExceptionEnum.INTERNAL_SERVER_ERROR.getCode(), percentage);
|
|
|
+ e.getMessage(), 3, percentage, keys);
|
|
|
}
|
|
|
}
|
|
|
return ResultVoUtil.success();
|
|
@@ -482,15 +491,17 @@ public class SiManageService {
|
|
|
*
|
|
|
* @param meg 错误消息
|
|
|
*/
|
|
|
- public void upldSetlErrorMessage(String patNo, Integer times, Integer ledgerSn, String meg, int code, int percentage) {
|
|
|
+ public void upldSetlErrorMessage(String patNo, Integer times, Integer ledgerSn, String meg, int type, int percentage, List<PureCodeName> keys) {
|
|
|
JSONObject obj = new JSONObject();
|
|
|
obj.put("name", "upldSetlListMessage");
|
|
|
obj.put("message", meg);
|
|
|
obj.put("patNo", patNo);
|
|
|
+ obj.put("keys", JSONArray.parseArray(JSONArray.toJSONString(keys)));
|
|
|
obj.put("times", times);
|
|
|
obj.put("ledgerSn", ledgerSn);
|
|
|
- obj.put("code", code);
|
|
|
+ obj.put("type", type);
|
|
|
obj.put("percentage", percentage);
|
|
|
+ obj.put("title", String.format("住院号:【%s】,住院次数:【%d】,账页号:【%d】。", patNo, times, ledgerSn));
|
|
|
String message = obj.toJSONString();
|
|
|
WebSocketServer.sendMessageByUserCode(TokenUtil.getTokenUserId(), message);
|
|
|
log.info("发送错误通知:{}", message);
|