Ver código fonte

Merge branch 'master' of https://172.16.32.165/lighter/web-server

lighter 1 mês atrás
pai
commit
3e8056d7b2

+ 11 - 13
src/main/java/thyyxxk/webserver/controller/outpatient/thmz/MzEmrController.java

@@ -26,28 +26,26 @@ import java.util.List;
 @RestController
 @RequestMapping("/mzEmr")
 public class MzEmrController {
-     @Autowired
-     private MzEmrService service;
+    @Autowired
+    private MzEmrService service;
 
-     @PassToken
-     @GetMapping("/getMzEmrModel")
-    public ResultVo<JSONArray> getMzEmrModel(){
-      return ResultVoUtil.success(service.getMzEmrModel());
+    @GetMapping("/getMzEmrModel")
+    public ResultVo<JSONArray> getMzEmrModel() {
+        return ResultVoUtil.success(service.getMzEmrModel());
     }
-    @PassToken
+
     @PostMapping("/queryMzEmrTree")
-    public ResultVo<List<MzEmrPatientData>>  queryMzEmrTree(@RequestBody MzEmrPatientVo param){
-          return ResultVoUtil.success(service.queryMzEmrTree(param));
+    public ResultVo<List<MzEmrPatientData>> queryMzEmrTree(@RequestBody MzEmrPatientVo param) {
+        return ResultVoUtil.success(service.queryMzEmrTree(param));
     }
 
-    @PassToken
     @PostMapping("/queryMzPatientInfo")
-    public ResultVo<MzEmrPatientVo>  queryMzPatientInfo(@RequestBody MzEmrPatientVo param){
+    public ResultVo<MzEmrPatientVo> queryMzPatientInfo(@RequestBody MzEmrPatientVo param) {
         return ResultVoUtil.success(service.queryMzPatientInfo(param));
     }
-    @PassToken
+
     @PostMapping("/saveMzEmrModel")
-    public ResultVo<String>  saveMzEmrModel(@RequestBody MzEmrPatientData param){
+    public ResultVo<String> saveMzEmrModel(@RequestBody MzEmrPatientData param) {
         return service.saveMzEmrModel(param);
     }
 

+ 13 - 1
src/main/java/thyyxxk/webserver/controller/settings/SchedulingClassController.java

@@ -3,13 +3,13 @@ package thyyxxk.webserver.controller.settings;
 import cn.hutool.json.JSONObject;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.schedulingClass.data.SchedulingClass;
 import thyyxxk.webserver.service.settings.SchedulingClass.SchedulingClassService;
 import thyyxxk.webserver.utils.R;
 
-import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 @RequestMapping("/schedulingClass")
@@ -49,4 +49,16 @@ public class SchedulingClassController {
     }
 
 
+    @GetMapping("/taskCreateClass")
+    @PassToken
+    public void taskCreateClass() {
+        service.create();
+    }
+
+    @GetMapping("/taskSendMsg")
+    @PassToken
+    public void taskSendMsg() {
+        service.sendMessageData();
+    }
+
 }

+ 6 - 0
src/main/java/thyyxxk/webserver/service/outpatient/thmz/MzEmrService.java

@@ -144,4 +144,10 @@ public class MzEmrService {
         }
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "保存成功");
     }
+
+    public ResultVo<List<Object>> getEmrModelByPatientId(String patientNo) {
+        return null;
+    }
+
+
 }

+ 4 - 6
src/main/java/thyyxxk/webserver/service/settings/SchedulingClass/SchedulingClassService.java

@@ -8,6 +8,7 @@ import cn.hutool.json.JSONUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.jetbrains.annotations.NotNull;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.envionment.JcptMobile;
@@ -22,7 +23,7 @@ import thyyxxk.webserver.service.hutoolcache.UserCache;
 import thyyxxk.webserver.service.jcptmobile.JcptMobileService;
 import thyyxxk.webserver.utils.R;
 
-import javax.annotation.PostConstruct;
+import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -35,7 +36,6 @@ public class SchedulingClassService {
     private final JcptMobile jcptMobile;
     private final JcptMobileService mobileService;
 
-    @Scheduled(cron = "0 0 1 20 * ?")
     public void create() {
         DateTime now = DateTime.now();
         // 获取下一个月的日期
@@ -44,7 +44,6 @@ public class SchedulingClassService {
         createByMonth(nextMonth);
     }
 
-    @Scheduled(cron = "0 20 17 * * ?")
     public void sendMessageData() {
         String now = DateUtil.format(DateTime.now(), "yyyy-MM-dd");
         SchedulingClass schedulingClass = dao.selectOne(SchedulingClass.lambdaQueryWrapper().eq(SchedulingClass::getSchedulingDate, now));
@@ -149,11 +148,10 @@ public class SchedulingClassService {
         if (schedulingClass == null) {
             return R.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到数据");
         }
-
-        if (now.compareTo(schedulingClass.getSchedulingDate()) > 0) {
+        DateTime dateTime = DateTime.of(data.getSchedulingDate());
+        if (DateUtil.isSameDay(now, dateTime) && DateTime.now().compareTo(now) > 0) {
             return R.fail(ExceptionEnum.LOGICAL_ERROR, "数据固话无法修改。");
         }
-
         dao.updateById(data);
         return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
     }

+ 1 - 1
src/main/resources/application-dev.yml

@@ -204,7 +204,7 @@ thyy:
   jcptmobile:
     address: "https://emr.hnthyy.cn:8081"
     agentid: 1000051
-    url: "https://open.weixin.qq.com/connect/oauth2/authorize"
+#    url: "https://open.weixin.qq.com/connect/oauth2/authorize"
   system:
     yz-config:
       exceeding-discharge-days: 4