Browse Source

核酸数据

LIVE_YE 3 years ago
parent
commit
2b57fa4a7c

+ 6 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/TaskController.java

@@ -44,4 +44,10 @@ public class TaskController {
         //taskService.getNewborn();
     }
 
+    @GetMapping("/insertAccountingData")
+    private void insertAccountingData() {
+        taskService.insertAccountingData();
+    }
+
+
 }

+ 2 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/AccountingDataMapper.java

@@ -46,4 +46,6 @@ public interface AccountingDataMapper {
      * @return
      */
    int selectById(@Param("id") String id);
+
+    AccountingDataVo getAccountingDataOne();
 }

+ 9 - 1
boman-web-core/src/main/java/com/boman/web/core/service/TaskService.java

@@ -20,6 +20,7 @@ import com.boman.system.api.RemoteDeptService;
 import com.boman.system.api.RemoteUserService;
 import com.boman.web.core.domain.AccountingData;
 import com.boman.web.core.domain.BirthRecords;
+import com.boman.web.core.domain.vo.AccountingDataVo;
 import com.boman.web.core.mapper.CzrkMapper;
 import com.boman.web.core.mapper.GridInfoMapper;
 import com.boman.web.core.service.accounting.IAccountingDataService;
@@ -592,7 +593,14 @@ public class TaskService {
     public void insertAccountingData() {
         String token = getToken();
         if (StringUtils.isNotBlank(token)) {
-            String startTime = redisService.getCacheObject("startTime");
+            //String startTime = "2022-05-14%2010:00:59";
+            String startTime = "2022-05-14 00:00:00.0";
+            //去数据库取最新的一条数据
+            AccountingDataVo accountingData = accountingDataService.getAccountingDataOne();
+            if(accountingData != null){
+                startTime = accountingData.getCjsj();
+            }
+            //String startTime = redisService.getCacheObject("startTime");
             Map<String, String> paramMap = new HashMap<>();
             paramMap.put("client_id", "acdf50bd13be4901b64c62b1fee862c0");
             paramMap.put("access_token", token);

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/service/accounting/AccountingDataServiceImpl.java

@@ -302,4 +302,9 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
         System.out.println("---------------插入核酸数据耗时" + (end - start) + "---------------");
         return 0;
     }
+
+    @Override
+    public AccountingDataVo getAccountingDataOne() {
+        return accountingDataMapper.getAccountingDataOne();
+    }
 }

+ 2 - 0
boman-web-core/src/main/java/com/boman/web/core/service/accounting/IAccountingDataService.java

@@ -41,4 +41,6 @@ public interface IAccountingDataService {
      * @return
      */
     int insertAccountingData(List<AccountingData> accountingDataVoList);
+
+    AccountingDataVo getAccountingDataOne();
 }

+ 3 - 0
boman-web-core/src/main/resources/mapper/AccountingDateMapper.xml

@@ -156,4 +156,7 @@
     <select id="getExport" resultMap="AccountingDataResult">
 
     </select>
+    <select id="getAccountingDataOne" resultMap="AccountingDataResult">
+        select id,cjsj,lxdh,create_date,modify_date FROM accounting_data order by cjsj desc limit 1;
+    </select>
 </mapper>