shiqian 3 жил өмнө
parent
commit
62a93ec6bf

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

@@ -90,8 +90,8 @@ public interface StandardlyMapper {
     @Select({"select * from vaccination_statistic where is_del = 'N' and xz = #{deptName}"})
     List<JSONObject> list1(@Param("deptName") String deptName);
 
-    @Update({"update vaccination_statistic set is_del = 'Y'"})
-    int updateAll();
+    @Update({"update vaccination_statistic set is_del = 'Y' where create_by = #{username}"})
+    int updateAll(@Param("username") String username);
 
     @Select("select * from ymjz20210923")
     List<JSONObject> selectAll();

+ 7 - 5
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -896,8 +896,8 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     @Override
     @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
     public AjaxResult statistic() {
-        List<JSONObject> result = new ArrayList<>(17);
         List<SysDept> allTowns = remoteDeptService.getByParentId(1L);
+        List<JSONObject> result = new ArrayList<>(allTowns.size());
         List<String> townNameList = ObjectUtils.map(allTowns, SysDept::getDeptName);
 
         LOGGER.info("开始查询");
@@ -905,7 +905,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
         List<VaccineInfoOperation> infoList = vaccineInfoMapper.listByTotalTaskCnt();
         LOGGER.info("查询用时: {} s", (System.currentTimeMillis() - l) / 1000);
         // 暂且如此
-        standardlyMapper.updateAll();
+        standardlyMapper.updateAll(SecurityUtils.getUsername());
         Date todayStart = DateUtils.getTodayStart(), todayEnd = DateUtils.getTodayEnd();
         for (String townName : townNameList) {
             int zrws = 0, zjzs = 0, drrws = 0, drjzs = 0, dez = 0, dsz = 0;
@@ -941,7 +941,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 // 接种时间和接种疫苗种类判断 当日任务数
                 if (null != vaccinationTime) {
                     String vaccineName = info.getVaccineName();
-                    judgeTodayTask(vaccineName, vaccinationTime, drrws, todayStart, todayEnd);
+                    drrws = judgeTodayTask(vaccineName, vaccinationTime, drrws, todayStart, todayEnd);
                 }
             }
 
@@ -969,15 +969,17 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
         return AjaxResult.success("成功", result);
     }
 
-    private void judgeTodayTask(String vaccineName, Date vaccinationTime, int drrws, Date todayStart, Date todayEnd) {
+    private int judgeTodayTask(String vaccineName, Date vaccinationTime, int drrws, Date todayStart, Date todayEnd) {
         Date nextTime = VaccineUtils.getNextTime(vaccineName, vaccinationTime);
         if (nextTime == null) {
-            return;
+            return drrws;
         }
 
         if (nextTime.before(todayEnd) && nextTime.after(todayStart)) {
             drrws++;
         }
+
+        return drrws;
     }
 
     @Override