|
@@ -996,148 +996,91 @@ 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 (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId()) || baseProcess.getDestId() >= 13) {
|
|
|
|
- //目的地就是当前隔离地点
|
|
|
|
- baseProcess.setProcessType(1);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
- } else {
|
|
|
|
- baseProcess.setProcessType(0);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
|
- }
|
|
|
|
- if (billIsolate.getIsolateLocationId() == 3 && baseProcess.getDestId() >= 4) {
|
|
|
|
- //通过生成洗消记录
|
|
|
|
- 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(LocalDateTime.now());
|
|
|
|
- billClean.setFarmId(billIsolate.getFarmId());
|
|
|
|
- billClean.setPassUserName(billIsolate.getPassUserName());
|
|
|
|
- billClean.setPassDate(billIsolate.getPassDate());
|
|
|
|
- billClean.setPassUserId(billIsolate.getPassUserId());
|
|
|
|
- billClean.setProcessId(billIsolate.getProcessId());
|
|
|
|
- billClean.setTestLocation("场内");
|
|
|
|
- billClean.setTestLocationId(4);
|
|
|
|
- billClean.setPhone(billIsolate.getPhone());
|
|
|
|
- cleanMapper.insert(billClean);
|
|
|
|
|
|
|
|
- String status = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "2";
|
|
|
|
- split[2] = "2";
|
|
|
|
- split[3] = "2";
|
|
|
|
- split[4] = "1";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + "," + split[4] + status.substring(9));
|
|
|
|
- }
|
|
|
|
|
|
+ //提前结束隔离
|
|
|
|
+ if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId())) {
|
|
|
|
+ //目的地就是当前隔离地点
|
|
|
|
+ baseProcess.setProcessType(1);
|
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
+ } else {
|
|
|
|
+ baseProcess.setProcessType(0);
|
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
|
+ }
|
|
|
|
|
|
- billIsolate.setIsolateRealEndDate(new Date());
|
|
|
|
- SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- Calendar cal1 = Calendar.getInstance();
|
|
|
|
- Calendar cal2 = Calendar.getInstance();
|
|
|
|
- Date startDate = sdf1.parse(start);
|
|
|
|
- Date endDate = sdf1.parse(now);
|
|
|
|
- cal1.setTime(startDate);
|
|
|
|
- cal2.setTime(endDate);
|
|
|
|
- long days = (startDate.getTime() - endDate.getTime()) / (1000 * 3600);
|
|
|
|
- Integer l1 = (Integer.parseInt(String.valueOf(days / 24)));
|
|
|
|
- long l = l1 % 24;
|
|
|
|
- String num = l1.toString() + "天" + l + "分钟";
|
|
|
|
|
|
+ if (billIsolate.getIsolateLocationId() == 3 && baseProcess.getDestId() >= 4) {
|
|
|
|
+ //通过生成洗消记录
|
|
|
|
+ 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(LocalDateTime.now());
|
|
|
|
+ billClean.setFarmId(billIsolate.getFarmId());
|
|
|
|
+ billClean.setPassUserName(billIsolate.getPassUserName());
|
|
|
|
+ billClean.setPassDate(billIsolate.getPassDate());
|
|
|
|
+ billClean.setPassUserId(billIsolate.getPassUserId());
|
|
|
|
+ billClean.setProcessId(billIsolate.getProcessId());
|
|
|
|
+ billClean.setTestLocation("场内");
|
|
|
|
+ billClean.setTestLocationId(4);
|
|
|
|
+ billClean.setPhone(billIsolate.getPhone());
|
|
|
|
+ cleanMapper.insert(billClean);
|
|
|
|
+
|
|
|
|
+ String status = baseProcess.getAllLocationStatus();
|
|
|
|
+ String[] split = status.split(",");
|
|
|
|
+ split[0] = "2";
|
|
|
|
+ split[1] = "2";
|
|
|
|
+ split[2] = "2";
|
|
|
|
+ split[3] = "2";
|
|
|
|
+ split[4] = "1";
|
|
|
|
+ baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + "," + split[4] + status.substring(9));
|
|
|
|
+ }
|
|
|
|
+ billIsolate.setIsolateRealEndDate(new Date());
|
|
|
|
+ SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ Calendar cal1 = Calendar.getInstance();
|
|
|
|
+ Calendar cal2 = Calendar.getInstance();
|
|
|
|
+ Date startDate = sdf1.parse(start);
|
|
|
|
+ Date endDate = sdf1.parse(now);
|
|
|
|
+ cal1.setTime(startDate);
|
|
|
|
+ cal2.setTime(endDate);
|
|
|
|
+ long days = (startDate.getTime() - endDate.getTime()) / (1000 * 3600);
|
|
|
|
+ Integer l1 = (Integer.parseInt(String.valueOf(days / 24)));
|
|
|
|
+ long l = l1 % 24;
|
|
|
|
+ String num = l1.toString() + "天" + l + "小时";
|
|
// long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
|
|
// long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
|
|
- billIsolate.setIsolateRealDayNum(num);
|
|
|
|
- billIsolate.setBillStatus(2);
|
|
|
|
- billIsolate.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
- billIsolate.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
|
|
+ billIsolate.setIsolateRealDayNum(num);
|
|
|
|
+ billIsolate.setBillStatus(3);
|
|
|
|
+ billIsolate.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
+ billIsolate.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
|
|
- baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
|
|
|
|
|
|
+ baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
|
|
|
|
|
|
- String status = baseProcess.getCurrentStatus();
|
|
|
|
- String substring = status.substring(0, status.length() - 1);
|
|
|
|
- baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
|
|
|
|
+ String status = baseProcess.getCurrentStatus();
|
|
|
|
+ String substring = status.substring(0, status.length() - 1);
|
|
|
|
+ baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
|
|
|
|
- if (billIsolate.getIsolateLocationId() == 5) {
|
|
|
|
- baseProcess.setAllLocationStatus("2,2,2,2,2,2");
|
|
|
|
- }
|
|
|
|
|
|
+ if (billIsolate.getIsolateLocationId() == 5) {
|
|
|
|
+ baseProcess.setAllLocationStatus("2,2,2,2,2,2");
|
|
|
|
+ }
|
|
|
|
|
|
- isolateMapper.updateById(billIsolate);
|
|
|
|
- processMapper.updateById(baseProcess);
|
|
|
|
- return new Result(10000, "正常解除隔离成功!", true);
|
|
|
|
- } else {
|
|
|
|
- //提前结束隔离
|
|
|
|
- if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId())) {
|
|
|
|
- //目的地就是当前隔离地点
|
|
|
|
- baseProcess.setProcessType(1);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
- } else {
|
|
|
|
- baseProcess.setProcessType(0);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
|
- }
|
|
|
|
|
|
+ if (billIsolate.getIsolateLocationId() == 3) {
|
|
|
|
+ String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
+ String[] split = status1.split(",");
|
|
|
|
+ split[0] = "2";
|
|
|
|
+ split[1] = "2";
|
|
|
|
+ split[2] = "2";
|
|
|
|
+ split[3] = "2";
|
|
|
|
+ baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + status1.substring(7));
|
|
|
|
+ }
|
|
|
|
|
|
- if (billIsolate.getIsolateLocationId() == 3 && baseProcess.getDestId() >= 4) {
|
|
|
|
- //通过生成洗消记录
|
|
|
|
- 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(LocalDateTime.now());
|
|
|
|
- billClean.setFarmId(billIsolate.getFarmId());
|
|
|
|
- billClean.setPassUserName(billIsolate.getPassUserName());
|
|
|
|
- billClean.setPassDate(billIsolate.getPassDate());
|
|
|
|
- billClean.setPassUserId(billIsolate.getPassUserId());
|
|
|
|
- billClean.setProcessId(billIsolate.getProcessId());
|
|
|
|
- billClean.setTestLocation("场内");
|
|
|
|
- billClean.setTestLocationId(4);
|
|
|
|
- billClean.setPhone(billIsolate.getPhone());
|
|
|
|
- cleanMapper.insert(billClean);
|
|
|
|
|
|
|
|
- String status = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "2";
|
|
|
|
- split[2] = "2";
|
|
|
|
- split[3] = "2";
|
|
|
|
- split[4] = "1";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + "," + split[4] + status.substring(9));
|
|
|
|
- }
|
|
|
|
- billIsolate.setIsolateRealEndDate(new Date());
|
|
|
|
- SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- Calendar cal1 = Calendar.getInstance();
|
|
|
|
- Calendar cal2 = Calendar.getInstance();
|
|
|
|
- Date startDate = sdf1.parse(start);
|
|
|
|
- Date endDate = sdf1.parse(now);
|
|
|
|
- cal1.setTime(startDate);
|
|
|
|
- cal2.setTime(endDate);
|
|
|
|
- long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
|
|
|
|
- billIsolate.setIsolateRealDayNum(Long.toString(days));
|
|
|
|
- billIsolate.setBillStatus(3);
|
|
|
|
- billIsolate.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
- billIsolate.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
-
|
|
|
|
- baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
|
|
|
|
-
|
|
|
|
- String status = baseProcess.getCurrentStatus();
|
|
|
|
- String substring = status.substring(0, status.length() - 1);
|
|
|
|
- baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
|
|
-
|
|
|
|
- if (billIsolate.getIsolateLocationId() == 5) {
|
|
|
|
- baseProcess.setAllLocationStatus("2,2,2,2,2,2");
|
|
|
|
- }
|
|
|
|
|
|
+ isolateMapper.updateById(billIsolate);
|
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
|
+ return new Result(10000, "提前解除隔离成功!", true);
|
|
|
|
|
|
- isolateMapper.updateById(billIsolate);
|
|
|
|
- processMapper.updateById(baseProcess);
|
|
|
|
- return new Result(10000, "提前解除隔离成功!", true);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1527,6 +1470,9 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (billClean.getTestLocationId() == 12 && baseProcess.getDestId() == 12) {
|
|
|
|
+ baseProcess.setAllLocationStatus("2,2");
|
|
|
|
+ }
|
|
|
|
|
|
//拉猪车烘干合格生成洗消申请
|
|
//拉猪车烘干合格生成洗消申请
|
|
if (billClean.getTestLocationId() == 15) {
|
|
if (billClean.getTestLocationId() == 15) {
|