Prechádzať zdrojové kódy

Merge branch 'master' of http://47.103.65.67:3000/yeguodong/business_center

xiaochan 1 mesiac pred
rodič
commit
5e742d7bcf

+ 13 - 0
thyy-scheduled/src/main/java/org/thyy/scheduled/dao/AutoCountFeeDao.java

@@ -0,0 +1,13 @@
+package org.thyy.scheduled.dao;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+@Mapper
+public interface AutoCountFeeDao {
+
+    @Select("exec zy_bed_fee")
+    String execAutoCountFee();
+}

+ 23 - 0
thyy-scheduled/src/main/java/org/thyy/scheduled/service/AutoCountFee.java

@@ -0,0 +1,23 @@
+package org.thyy.scheduled.service;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.thyy.scheduled.dao.AutoCountFeeDao;
+
+import java.util.List;
+
+@Slf4j
+@Service
+public class AutoCountFee {
+
+    @Autowired
+    AutoCountFeeDao autoCountFeeDao;
+
+    public void autoCountFee() {
+        log.info("自动上账开始。");
+        final String result = autoCountFeeDao.execAutoCountFee();
+
+    }
+}

+ 13 - 3
thyy-scheduled/src/main/java/org/thyy/scheduled/task/MainBusinessTask.java

@@ -1,12 +1,15 @@
 package org.thyy.scheduled.task;
 
 import cn.hutool.core.util.StrUtil;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
 import org.thyy.scheduled.config.constant.Thyy;
 import org.thyy.scheduled.dao.MainBusinessDo;
+import org.thyy.scheduled.service.AutoCountFee;
 import org.thyy.scheduled.service.ReceiveCost;
 
 @Component
@@ -15,13 +18,15 @@ public class MainBusinessTask {
     private final MainBusinessDo dao;
     private final ReceiveCost receiveCost;
     private final RestTemplate template;
+    private final AutoCountFee autoCountFee;
 
     @Autowired
-    public MainBusinessTask(MainBusinessDo dao, Thyy thyy, ReceiveCost receiveCost, RestTemplate template) {
+    public MainBusinessTask(MainBusinessDo dao, Thyy thyy, ReceiveCost receiveCost, RestTemplate template, AutoCountFee autoCountFee) {
         this.dao = dao;
         this.thyy = thyy;
         this.receiveCost = receiveCost;
         this.template = template;
+        this.autoCountFee = autoCountFee;
     }
 
     @Scheduled(cron = "0 40 3 * * ?")
@@ -32,14 +37,19 @@ public class MainBusinessTask {
         }
     }
 
-    @Scheduled(cron = "0 0 3 * * ?")
-    public void analyzeSetlData() {
+    @Scheduled(cron = "0 50 17 * * ?")
+    public void test() {
         if (StrUtil.isNotBlank(thyy.getMainAddress())) {
             String url = thyy.getMainAddress() + "/analyzeSiPatientCharges/analyzeSetlData";
             template.getForObject(url, String.class);
         }
     }
 
+    @Scheduled(cron = "0 50 23 * * ?")
+    public void analyzeSetlData() {
+        autoCountFee.autoCountFee();
+    }
+
     @Scheduled(cron = "0 30 21 * * ?")
     public void uploadBillingList() {
         if (StrUtil.isNotBlank(thyy.getMainAddress())) {