|
@@ -28,6 +28,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -80,10 +81,19 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
data = "0";
|
|
|
}
|
|
|
if (type.equals("0")) {
|
|
|
+
|
|
|
+ QueryWrapper<BaseLocation> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("farm_id", farmId).eq("location_type", TokenSign.getWorkIdByJwtToken(httpServletRequest));
|
|
|
+ List<BaseLocation> baseLocations = locationMapper.selectList(queryWrapper1);
|
|
|
+ List<Integer> ids = new ArrayList<>();
|
|
|
+ for (BaseLocation baseLocation : baseLocations) {
|
|
|
+ ids.add(baseLocation.getId());
|
|
|
+ }
|
|
|
+
|
|
|
Page<BillClean> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
QueryWrapper<BillClean> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("farm_id", farmId).eq("vistit_type", type).orderByDesc("sub_date")
|
|
|
- .eq("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest));
|
|
|
+ .in("test_location_id", ids);
|
|
|
|
|
|
if ("0".equals(data)) {
|
|
|
queryWrapper.in("bill_status", 0, 1, 2);
|
|
@@ -114,19 +124,39 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
}*/ else {
|
|
|
Page<CleanAndDryVo2> cleanAndDryVo2Page = null;
|
|
|
Page<CleanAndDryVo2> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ QueryWrapper<BaseLocation> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("farm_id", farmId).eq("location_type", TokenSign.getWorkIdByJwtToken(httpServletRequest));
|
|
|
+ List<BaseLocation> baseLocations = locationMapper.selectList(queryWrapper1);
|
|
|
if ("0".equals(data)) {
|
|
|
- cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "0,1".split(","), TokenSign.getWorkIdByJwtToken(httpServletRequest));
|
|
|
+ ArrayList<String> arrayList = new ArrayList<>();
|
|
|
+ for (BaseLocation baseLocation : baseLocations) {
|
|
|
+ arrayList.add(baseLocation.getId().toString());
|
|
|
+ }
|
|
|
+ String[] s = arrayList.toArray(new String[arrayList.size()]);
|
|
|
+ System.out.println("传入自定义sql的位置参数形式:"+s);
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "0,1".split(","), s);
|
|
|
}
|
|
|
- ArrayList<String> arrayList = new ArrayList<>();
|
|
|
if ("1".equals(data)) {
|
|
|
+ ArrayList<String> integerArrayList = new ArrayList<>();
|
|
|
+ for (BaseLocation baseLocation : baseLocations) {
|
|
|
+ integerArrayList.add(baseLocation.getId().toString());
|
|
|
+ }
|
|
|
+ String[] ids = integerArrayList.toArray(new String[integerArrayList.size()]);
|
|
|
+ ArrayList<String> arrayList = new ArrayList<>();
|
|
|
arrayList.add("0");
|
|
|
String[] s = arrayList.toArray(new String[arrayList.size()]);
|
|
|
- cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, TokenSign.getWorkIdByJwtToken(httpServletRequest));
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, ids);
|
|
|
}
|
|
|
if ("2".equals(data)) {
|
|
|
+ ArrayList<String> integerArrayList = new ArrayList<>();
|
|
|
+ for (BaseLocation baseLocation : baseLocations) {
|
|
|
+ integerArrayList.add(baseLocation.getId().toString());
|
|
|
+ }
|
|
|
+ String[] ids = integerArrayList.toArray(new String[integerArrayList.size()]);
|
|
|
+ ArrayList<String> arrayList = new ArrayList<>();
|
|
|
arrayList.add("1");
|
|
|
String[] s = arrayList.toArray(new String[arrayList.size()]);
|
|
|
- cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, TokenSign.getWorkIdByJwtToken(httpServletRequest));
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s, ids);
|
|
|
}
|
|
|
return new Result(ResultCode.SUCCESS, cleanAndDryVo2Page);
|
|
|
}
|
|
@@ -180,7 +210,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
billClean.setCheckDate(sdf.parse(date));
|
|
|
billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
|
|
- if (baseLocation.getId() == 4 || baseLocation.getId() == 10) {
|
|
|
+ if (baseLocation.getId() == 1 && baseProcess.getDestId() > 2) {
|
|
|
//生成pcr检测申请
|
|
|
BillPcr billPcr = new BillPcr();
|
|
|
billPcr.setPcrType(0);
|
|
@@ -195,11 +225,49 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
billPcr.setBillStatus(0);
|
|
|
billPcr.setProcessId(billClean.getProcessId());
|
|
|
billPcr.setFarmId(billClean.getFarmId());
|
|
|
- billPcr.setTestLocation(baseLocation.getNextLocation());
|
|
|
- billPcr.setTestLocationId(baseLocation.getNextId());
|
|
|
+ billPcr.setTestLocation("人员二级洗消站");
|
|
|
+ billPcr.setTestLocationId(3);
|
|
|
pcrMapper.insert(billPcr);
|
|
|
}
|
|
|
- if (baseLocation.getId() == 7 || baseLocation.getId() == 12) {
|
|
|
+ /* if (baseLocation.getId() == 3 ) {
|
|
|
+ //生成隔离申请
|
|
|
+ BillIsolate isolate = new BillIsolate();
|
|
|
+ isolate.setPhone(billClean.getPhone());
|
|
|
+ isolate.setVistitType(billClean.getVistitType());
|
|
|
+ isolate.setDestName(billClean.getDestName());
|
|
|
+ isolate.setDestId(billClean.getDestId());
|
|
|
+ isolate.setAdmissionUserName(billClean.getAdmissionUserName());
|
|
|
+ isolate.setAdmissionUserId(billClean.getAdmissionUserId());
|
|
|
+ isolate.setVistitDate(billClean.getVistitDate());
|
|
|
+ isolate.setSubDate(billClean.getSubDate());
|
|
|
+ isolate.setFarmId(billClean.getFarmId());
|
|
|
+ isolate.setBillStatus(0);
|
|
|
+ isolate.setProcessId(billClean.getProcessId());
|
|
|
+ isolate.setIsolateLocation(baseLocation.getLocationName());
|
|
|
+ isolate.setIsolateLocationId(baseLocation.getId());
|
|
|
+ isolateMapper.insert(isolate);
|
|
|
+ }*/
|
|
|
+ QueryWrapper<BillPcr> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("farm_id", farmId).eq("process_id", baseProcess.getId()).eq("test_location_id", 4);
|
|
|
+ if (ObjectUtil.isEmpty(pcrMapper.selectOne(queryWrapper1))) {
|
|
|
+ //生成pcr检测申请
|
|
|
+ BillPcr billPcr = new BillPcr();
|
|
|
+ billPcr.setPcrType(0);
|
|
|
+ billPcr.setPhone(billClean.getPhone());
|
|
|
+ billPcr.setVistitType(billClean.getVistitType());
|
|
|
+ billPcr.setDestName(billClean.getDestName());
|
|
|
+ billPcr.setDestId(billClean.getDestId());
|
|
|
+ billPcr.setAdmissionUserName(billClean.getAdmissionUserName());
|
|
|
+ billPcr.setAdmissionUserId(billClean.getAdmissionUserId());
|
|
|
+ billPcr.setVistitDate(billClean.getVistitDate());
|
|
|
+ billPcr.setSubDate(billClean.getSubDate());
|
|
|
+ billPcr.setBillStatus(0);
|
|
|
+ billPcr.setProcessId(billClean.getProcessId());
|
|
|
+ billPcr.setFarmId(billClean.getFarmId());
|
|
|
+ billPcr.setTestLocation("场内");
|
|
|
+ billPcr.setTestLocationId(4);
|
|
|
+ pcrMapper.insert(billPcr);
|
|
|
+ } else {
|
|
|
//生成隔离申请
|
|
|
BillIsolate isolate = new BillIsolate();
|
|
|
isolate.setPhone(billClean.getPhone());
|
|
@@ -213,13 +281,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
isolate.setFarmId(billClean.getFarmId());
|
|
|
isolate.setBillStatus(0);
|
|
|
isolate.setProcessId(billClean.getProcessId());
|
|
|
- isolate.setIsolateLocation(baseLocation.getNextLocation());
|
|
|
- isolate.setIsolateLocationId(baseLocation.getNextId());
|
|
|
+ isolate.setIsolateLocation(baseLocation.getLocationName());
|
|
|
+ isolate.setIsolateLocationId(baseLocation.getId());
|
|
|
isolateMapper.insert(isolate);
|
|
|
}
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
|
|
|
String status = baseProcess.getCurrentStatus();
|
|
|
String substring = status.substring(0, status.length() - 1);
|
|
|
baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
@@ -536,8 +604,8 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
billClean.setImgStatus(1);
|
|
|
cleanMapper.updateById(billClean);
|
|
|
|
|
|
- if (billClean.getTestLocationId() == 47 || billClean.getTestLocationId() == 50) {
|
|
|
- if (billClean.getDestId() > 47 || billClean.getDestId() > 50) {
|
|
|
+ if (billClean.getTestLocationId() == 9 || billClean.getTestLocationId() == 10) {
|
|
|
+ if (billClean.getDestId() > 9 || billClean.getDestId() > 10) {
|
|
|
Integer processId = billClean.getProcessId();
|
|
|
QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
|
|
|
queryWrapper1.eq("farm_id", farmId).eq("process_id", processId);
|
|
@@ -552,7 +620,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
}
|
|
|
|
|
|
//第一次通过生成洗消
|
|
|
- if (billClean.getTestLocationId() == 33) {
|
|
|
+ if (billClean.getTestLocationId() == 6) {
|
|
|
BillClean clean = new BillClean();
|
|
|
clean.setVistitType(billClean.getVistitType());
|
|
|
clean.setVistitDate(billClean.getVistitDate());
|
|
@@ -571,7 +639,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
clean.setTestLocation(baseLocation.getNextLocation());
|
|
|
cleanMapper.insert(clean);
|
|
|
}
|
|
|
- if (billClean.getTestLocationId() == 35) {
|
|
|
+ if (billClean.getTestLocationId() == 7) {
|
|
|
//生成烘干申请
|
|
|
BillDry billPcr = new BillDry();
|
|
|
billPcr.setPhone(billClean.getPhone());
|
|
@@ -587,13 +655,13 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
billPcr.setCarNum(billClean.getCarNum());
|
|
|
billPcr.setProcessId(billClean.getProcessId());
|
|
|
billPcr.setFarmId(billClean.getFarmId());
|
|
|
- billPcr.setTestLocation(baseLocation.getNextLocation());
|
|
|
- billPcr.setTestLocationId(baseLocation.getNextId());
|
|
|
+ billPcr.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billPcr.setTestLocationId(baseLocation.getId());
|
|
|
dryMapper.insert(billPcr);
|
|
|
}
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
|
|
|
String status = baseProcess.getCurrentStatus();
|
|
|
String substring = status.substring(0, status.length() - 1);
|
|
|
baseProcess.setCurrentStatus(substring + "1," + 0);
|