瀏覽代碼

Merge branch 'master' of https://gitlab.taihe.com/lighter/web-server

xiaochan 3 年之前
父節點
當前提交
bac2d715fe

+ 1 - 1
pom.xml

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

+ 23 - 19
src/main/java/thyyxxk/webserver/controller/wxapi/SendWxInfoController.java

@@ -15,18 +15,17 @@ import thyyxxk.webserver.utils.TokenUtil;
 public class SendWxInfoController {
     private static final String SEND_MSG_URL = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN";
     private static volatile boolean OVER_LIMIT = false;
+    private static final int AGENT_ID = 1000041;
+    private static final int OVER_LIMIT_CODE = 45009;
+    private static final int SAFE_MODE = 0;
+    private static final String OVER_LIMIT_MESSAGE = "企业微信消息推送接口调用超过限制,今日无法再做推送!";
 
-    private static final JSONObject overLimitJson;
+    private static final JSONObject OVER_LIMIT_ALERT;
 
     static {
-        overLimitJson = new JSONObject();
-        overLimitJson.put("errcode", 45009);
-        overLimitJson.put("errmsg", "企业微信消息推送接口调用超过限制,今日无法再做推送!");
-    }
-
-    @Scheduled(cron = "0 0 0 * * ?")
-    public void resetOverLimitFlag() {
-        OVER_LIMIT = false;
+        OVER_LIMIT_ALERT = new JSONObject();
+        OVER_LIMIT_ALERT.put("errcode", OVER_LIMIT_CODE);
+        OVER_LIMIT_ALERT.put("errmsg", OVER_LIMIT_MESSAGE);
     }
 
     @PassToken
@@ -34,30 +33,30 @@ public class SendWxInfoController {
     public JSONObject sendCorpWxMsg(@RequestParam("touser") String touser,
                                     @RequestParam("content") String content) {
         if (OVER_LIMIT) {
-            log.info("企业微信消息推送接口调用超过限制,今日无法再做推送!");
-            return overLimitJson;
+            log.info(OVER_LIMIT_MESSAGE);
+            return OVER_LIMIT_ALERT;
         }
         String requestUrl= SEND_MSG_URL.replace("ACCESS_TOKEN", TokenUtil.getWeComSendMsgToken());
         JSONObject msgObj = new JSONObject();
         msgObj.put("content", content);
         JSONObject param = new JSONObject();
-        param.put("agentid", 1000041);
+        param.put("agentid", AGENT_ID);
         param.put("touser", touser.replaceAll(",", "|"));
         param.put("toparty", "");
         param.put("totag", "");
         param.put("msgtype", "text");
         param.put("text", msgObj);
-        param.put("safe", 0);
+        param.put("safe", SAFE_MODE);
         log.info("推送企业信息消息 >>> {}", param);
         RestTemplate restTemplate = new RestTemplate();
-        String resStr = restTemplate.postForObject(requestUrl, param, String.class);
-        JSONObject retObj = JSONObject.parseObject(resStr);
-        log.info("推送企业信息消息结果 >>> {}", retObj);
-        Integer errcode = retObj.getInteger("errcode");
-        if (null != errcode && errcode == 45009) {
+        String response = restTemplate.postForObject(requestUrl, param, String.class);
+        JSONObject result = JSONObject.parseObject(response);
+        log.info("推送企业信息消息结果 >>> {}", result);
+        Integer errcode = result.getInteger("errcode");
+        if (null != errcode && errcode == OVER_LIMIT_CODE) {
             OVER_LIMIT = true;
         }
-        return retObj;
+        return result;
     }
 
     @PassToken
@@ -68,4 +67,9 @@ public class SendWxInfoController {
         TokenUtil.setWeComSendMsgToken(tokens.getWeComSendMsgToken());
         return "success";
     }
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetOverLimitFlag() {
+        OVER_LIMIT = false;
+    }
 }

+ 3 - 0
src/main/java/thyyxxk/webserver/dao/his/yibao/DismissDao.java

@@ -392,4 +392,7 @@ public interface DismissDao {
 
     @Select("select count(1) from zy_dis_diag_yb where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
     int selectYbDisDiagCount(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
+
+    @Select("select operation from zy_actpatient where inpatient_no=#{zyh}")
+    String selectOperation(@Param("zyh") String zyh);
 }

+ 6 - 0
src/main/java/thyyxxk/webserver/service/yibao/DismissService.java

@@ -201,6 +201,12 @@ public class DismissService {
                 exception.setMessage("医保出院诊断不能为空,请联系医生在病案首页填写。");
                 throw new BizException(exception);
             }
+            String operation = dao.selectOperation(inpatientNo);
+            if (StringUtil.isBlank(operation)) {
+                ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
+                exception.setMessage("治疗方式(是否手术)不能为空,请联系医生在病案首页填写。");
+                throw new BizException(exception);
+            }
             String hisTotalCharge;
             if (param.getDismissFlag() == 2) {
                 lastZjdzDatetime = ledgerSn == 1 ? param.getAdmissDate() :