Browse Source

完善结算单上传。

lighter 3 years ago
parent
commit
ed8235302d

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>10.6.0</version>
+    <version>10.6.2</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 0 - 2
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SiManageController.java

@@ -60,13 +60,11 @@ public class SiManageController {
     }
 
     @PostMapping("/upldSetlList")
-    @PassToken
     public ResultVo<String> upldSetlList(@RequestBody List<SiPatInfo> siPatInfos) {
         return service.upldSetlListBatch(siPatInfos);
     }
 
     @GetMapping("/upldSetlListTimes")
-    @PassToken
     public ResultVo<String> upldSetlListTimes(@RequestParam("startTime") String startTime,
                                               @RequestParam("endTime") String endTime,
                                               @RequestParam("insutype") String insutype) {

+ 8 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/query/SiPatInfo.java

@@ -1,7 +1,11 @@
 package thyyxxk.webserver.entity.medicalinsurance.query;
 
 import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.util.Date;
 
 @Data
@@ -57,6 +61,8 @@ public class SiPatInfo implements Serializable {
 	/**
 	 * 出生日期
 	 */
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd")
 	private Date brdy;
 
 	/**
@@ -92,6 +98,8 @@ public class SiPatInfo implements Serializable {
 	/**
 	 * 个人参保日期
 	 */
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd")
 	private Date psnInsuDate;
 
 	/**

+ 14 - 8
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiManageService.java

@@ -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);
+    }
 }