|
@@ -43,6 +43,9 @@ import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
+import java.util.concurrent.ScheduledExecutorService;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -511,6 +514,19 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
isolate.setIsolateEndDate(endDate);
|
|
isolate.setIsolateEndDate(endDate);
|
|
isolate.setIsolateDayNum(dayNum);
|
|
isolate.setIsolateDayNum(dayNum);
|
|
isolate.setBillStatus(1);
|
|
isolate.setBillStatus(1);
|
|
|
|
+ ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
|
|
|
|
+ Runnable task = new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ //这里写业务
|
|
|
|
+ isolate.setBillStatus(2);
|
|
|
|
+ isolateMapper.updateById(isolate);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ // 设定延迟时间(两小时后执行,单位为秒)
|
|
|
|
+ long delay = 60 * 60 * dayNum;
|
|
|
|
+ // 执行定时任务
|
|
|
|
+ scheduler.schedule(task, delay, TimeUnit.SECONDS);
|
|
isolateMapper.updateById(isolate);
|
|
isolateMapper.updateById(isolate);
|
|
return new Result(10000, "提交成功!", true);
|
|
return new Result(10000, "提交成功!", true);
|
|
}
|
|
}
|
|
@@ -518,9 +534,13 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
@Override
|
|
@Override
|
|
public Result editIsolate(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
public Result editIsolate(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
String id = paramsMap.get("id");
|
|
String id = paramsMap.get("id");
|
|
|
|
+ String farmId = paramsMap.get("farmId");
|
|
String remark = paramsMap.get("remark");//是否提前结束隔离的标识
|
|
String remark = paramsMap.get("remark");//是否提前结束隔离的标识
|
|
BillIsolate billIsolate = isolateMapper.selectById(id);
|
|
BillIsolate billIsolate = isolateMapper.selectById(id);
|
|
BaseProcess baseProcess = processMapper.selectById(billIsolate.getProcessId());
|
|
BaseProcess baseProcess = processMapper.selectById(billIsolate.getProcessId());
|
|
|
|
+ QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ locationQueryWrapper.eq(StringUtils.isNotBlank(farmId),"farm_id", farmId).eq("id", billIsolate.getIsolateLocationId());
|
|
|
|
+ BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前隔离所在的位置
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
String end = sdf.format(billIsolate.getIsolateEndDate());
|
|
String end = sdf.format(billIsolate.getIsolateEndDate());
|
|
@@ -528,12 +548,37 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
String now = sdf.format(new Date());
|
|
String now = sdf.format(new Date());
|
|
int res = now.compareTo(end);
|
|
int res = now.compareTo(end);
|
|
if (res > 0) {//当前时间晚于隔离结束时间
|
|
if (res > 0) {//当前时间晚于隔离结束时间
|
|
- if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId())) {
|
|
|
|
|
|
+ if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId())|| baseProcess.getDestId() >= 13) {
|
|
//目的地就是当前隔离地点
|
|
//目的地就是当前隔离地点
|
|
baseProcess.setProcessType(1);
|
|
baseProcess.setProcessType(1);
|
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
} else {
|
|
} else {
|
|
baseProcess.setProcessType(0);
|
|
baseProcess.setProcessType(0);
|
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
|
+ }
|
|
|
|
+ if (billIsolate.getIsolateLocationId() == 8) {
|
|
|
|
+ //通过生成洗消记录
|
|
|
|
+ BillClean billClean = new BillClean();
|
|
|
|
+ billClean.setVistitType(billIsolate.getVistitType());
|
|
|
|
+ billClean.setDestName(billIsolate.getDestName());
|
|
|
|
+ billClean.setDestId(billIsolate.getDestId());
|
|
|
|
+ billClean.setAdmissionUserName(billIsolate.getAdmissionUserName());
|
|
|
|
+ billClean.setAdmissionUserId(billIsolate.getAdmissionUserId());
|
|
|
|
+ billClean.setVistitDate(billIsolate.getVistitDate());
|
|
|
|
+ billClean.setSubDate(billIsolate.getSubDate());
|
|
|
|
+ billClean.setFarmId(billIsolate.getFarmId());
|
|
|
|
+ billClean.setPassUserName(billIsolate.getPassUserName());
|
|
|
|
+ billClean.setPassDate(billIsolate.getPassDate());
|
|
|
|
+ billClean.setPassUserId(billIsolate.getPassUserId());
|
|
|
|
+ billClean.setProcessId(billIsolate.getProcessId());
|
|
|
|
+ billClean.setTestLocation("场内洗澡间1");
|
|
|
|
+ billClean.setTestLocationId(10);
|
|
|
|
+ billClean.setPhone(billIsolate.getPhone());
|
|
|
|
+ cleanMapper.insert(billClean);
|
|
}
|
|
}
|
|
|
|
+
|
|
billIsolate.setIsolateRealEndDate(new Date());
|
|
billIsolate.setIsolateRealEndDate(new Date());
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
Calendar cal1 = Calendar.getInstance();
|
|
Calendar cal1 = Calendar.getInstance();
|
|
@@ -549,8 +594,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
billIsolate.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
billIsolate.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + billIsolate.getIsolateLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + billIsolate.getIsolateLocationId());
|
|
|
|
|
|
+
|
|
String status = baseProcess.getCurrentStatus();
|
|
String status = baseProcess.getCurrentStatus();
|
|
String substring = status.substring(0, status.length() - 1);
|
|
String substring = status.substring(0, status.length() - 1);
|
|
baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
@@ -563,8 +607,33 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId())) {
|
|
if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId())) {
|
|
//目的地就是当前隔离地点
|
|
//目的地就是当前隔离地点
|
|
baseProcess.setProcessType(1);
|
|
baseProcess.setProcessType(1);
|
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
} else {
|
|
} else {
|
|
baseProcess.setProcessType(0);
|
|
baseProcess.setProcessType(0);
|
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (billIsolate.getIsolateLocationId() == 8) {
|
|
|
|
+ //通过生成洗消记录
|
|
|
|
+ BillClean billClean = new BillClean();
|
|
|
|
+ billClean.setVistitType(billIsolate.getVistitType());
|
|
|
|
+ billClean.setDestName(billIsolate.getDestName());
|
|
|
|
+ billClean.setDestId(billIsolate.getDestId());
|
|
|
|
+ billClean.setAdmissionUserName(billIsolate.getAdmissionUserName());
|
|
|
|
+ billClean.setAdmissionUserId(billIsolate.getAdmissionUserId());
|
|
|
|
+ billClean.setVistitDate(billIsolate.getVistitDate());
|
|
|
|
+ billClean.setSubDate(billIsolate.getSubDate());
|
|
|
|
+ billClean.setFarmId(billIsolate.getFarmId());
|
|
|
|
+ billClean.setPassUserName(billIsolate.getPassUserName());
|
|
|
|
+ billClean.setPassDate(billIsolate.getPassDate());
|
|
|
|
+ billClean.setPassUserId(billIsolate.getPassUserId());
|
|
|
|
+ billClean.setProcessId(billIsolate.getProcessId());
|
|
|
|
+ billClean.setTestLocation("场内洗澡间1");
|
|
|
|
+ billClean.setTestLocationId(10);
|
|
|
|
+ billClean.setPhone(billIsolate.getPhone());
|
|
|
|
+ cleanMapper.insert(billClean);
|
|
}
|
|
}
|
|
billIsolate.setIsolateRealEndDate(new Date());
|
|
billIsolate.setIsolateRealEndDate(new Date());
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
@@ -581,8 +650,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
billIsolate.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
billIsolate.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + billIsolate.getIsolateLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + billIsolate.getIsolateLocationId());
|
|
|
|
|
|
+
|
|
String status = baseProcess.getCurrentStatus();
|
|
String status = baseProcess.getCurrentStatus();
|
|
String substring = status.substring(0, status.length() - 1);
|
|
String substring = status.substring(0, status.length() - 1);
|
|
baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
baseProcess.setCurrentStatus(substring + "1," + 0);
|