|
@@ -1,54 +1,54 @@
|
|
|
-package com.huimv.admin.timer;
|
|
|
-
|
|
|
-
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.huimv.admin.common.utils.NumberUtils;
|
|
|
-import com.huimv.admin.entity.BillIsolate;
|
|
|
-import com.huimv.admin.entity.GasData;
|
|
|
-import com.huimv.admin.entity.GasThreshold;
|
|
|
-import com.huimv.admin.entity.GasWarningInfo;
|
|
|
-import com.huimv.admin.mapper.GasDataMapper;
|
|
|
-import com.huimv.admin.mapper.GasThresholdMapper;
|
|
|
-import com.huimv.admin.mapper.GasWarningInfoMapper;
|
|
|
-import com.huimv.admin.service.IBillIsolateService;
|
|
|
-import com.huimv.admin.service.IBillPcrService;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
-import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
-import org.springframework.scheduling.annotation.Scheduled;
|
|
|
-
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-@Configuration
|
|
|
-@EnableScheduling
|
|
|
-public class SafeTimer {
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IBillPcrService pcrService;
|
|
|
- @Autowired
|
|
|
- private IBillIsolateService isolateService;
|
|
|
-
|
|
|
-
|
|
|
- @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
- private void getShenChan() throws Exception {
|
|
|
- QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("bill_status", 1);
|
|
|
- List<BillIsolate> isolates = isolateService.list(queryWrapper);
|
|
|
- Date date = new Date();
|
|
|
- for (BillIsolate isolate : isolates) {
|
|
|
- if (isolate.getIsolateEndDate().getTime() <= date.getTime()) {
|
|
|
- isolate.setIsolateRealEndDate(date);
|
|
|
- isolate.setIsolateRealDayNum(isolate.getIsolateDayNum());
|
|
|
- isolate.setBillStatus(2);
|
|
|
- isolate.setPassUserName("自然解除隔离");
|
|
|
- isolate.setPassDate(date);
|
|
|
- isolateService.updateById(isolate);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+//package com.huimv.admin.timer;
|
|
|
+//
|
|
|
+//
|
|
|
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+//import com.huimv.admin.common.utils.NumberUtils;
|
|
|
+//import com.huimv.admin.entity.BillIsolate;
|
|
|
+//import com.huimv.admin.entity.GasData;
|
|
|
+//import com.huimv.admin.entity.GasThreshold;
|
|
|
+//import com.huimv.admin.entity.GasWarningInfo;
|
|
|
+//import com.huimv.admin.mapper.GasDataMapper;
|
|
|
+//import com.huimv.admin.mapper.GasThresholdMapper;
|
|
|
+//import com.huimv.admin.mapper.GasWarningInfoMapper;
|
|
|
+//import com.huimv.admin.service.IBillIsolateService;
|
|
|
+//import com.huimv.admin.service.IBillPcrService;
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.context.annotation.Configuration;
|
|
|
+//import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
+//import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+//
|
|
|
+//import java.text.ParseException;
|
|
|
+//import java.text.SimpleDateFormat;
|
|
|
+//import java.util.Date;
|
|
|
+//import java.util.List;
|
|
|
+//
|
|
|
+//@Configuration
|
|
|
+//@EnableScheduling
|
|
|
+//public class SafeTimer {
|
|
|
+//
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private IBillPcrService pcrService;
|
|
|
+// @Autowired
|
|
|
+// private IBillIsolateService isolateService;
|
|
|
+//
|
|
|
+//
|
|
|
+// @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
+// private void getShenChan() throws Exception {
|
|
|
+// QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
|
|
|
+// queryWrapper.eq("bill_status", 1);
|
|
|
+// List<BillIsolate> isolates = isolateService.list(queryWrapper);
|
|
|
+// Date date = new Date();
|
|
|
+// for (BillIsolate isolate : isolates) {
|
|
|
+// if (isolate.getIsolateEndDate().getTime() <= date.getTime()) {
|
|
|
+// isolate.setIsolateRealEndDate(date);
|
|
|
+// isolate.setIsolateRealDayNum(isolate.getIsolateDayNum());
|
|
|
+// isolate.setBillStatus(2);
|
|
|
+// isolate.setPassUserName("自然解除隔离");
|
|
|
+// isolate.setPassDate(date);
|
|
|
+// isolateService.updateById(isolate);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//}
|