|
@@ -277,7 +277,16 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
private PeopleListMapper peopleListMapper;
|
|
private PeopleListMapper peopleListMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private BillPersonnelAdmissionMapper personnelAdmissionMapper;
|
|
private BillPersonnelAdmissionMapper personnelAdmissionMapper;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private BaseWashoutPointMapper washoutPointMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BillDryMapper dryMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BillIsolateMapper isolateMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BillSamplingMapper samplingMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BillCleanBeforeMapper beforeMapper;
|
|
@Override
|
|
@Override
|
|
public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
String farmId = paramsMap.get("farmId");
|
|
String farmId = paramsMap.get("farmId");
|
|
@@ -372,13 +381,13 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
locationQueryWrapper.eq("id", billPcr.getTestLocationId());
|
|
locationQueryWrapper.eq("id", billPcr.getTestLocationId());
|
|
BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前pcr检测所在的位置
|
|
BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前pcr检测所在的位置
|
|
|
|
|
|
- QueryWrapper<Configuration> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.eq("farm_id", farmId);
|
|
|
|
- Configuration configuration = configurationMapper.selectOne(queryWrapper);
|
|
|
|
|
|
+ String allLocationId = baseProcess.getAllLocationId();//所有的位置id
|
|
|
|
+ String allFlowId = baseProcess.getAllFlowId();//所有的流程id
|
|
|
|
+ String currentFlowId = baseProcess.getCurrentFlowId();//当前已经完成的流程id
|
|
|
|
+ String substring1 = allFlowId.substring(currentFlowId.length() + 1, allFlowId.length());
|
|
|
|
+ String[] split = substring1.split(",");
|
|
|
|
+ Integer nextId = Integer.parseInt(split[0]);
|
|
|
|
|
|
- QueryWrapper<Exist> existQueryWrapper = new QueryWrapper<>();
|
|
|
|
- existQueryWrapper.eq("farm_id", farmId);
|
|
|
|
- Exist exist = existMapper.selectOne(existQueryWrapper);//判断是否有二级洗消站
|
|
|
|
|
|
|
|
if (billPcr.getBillStatus() != 0) {
|
|
if (billPcr.getBillStatus() != 0) {
|
|
return new Result(10001, "该订单已通过,无需再次提交!", false);
|
|
return new Result(10001, "该订单已通过,无需再次提交!", false);
|
|
@@ -386,365 +395,169 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
|
|
if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
|
|
return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
|
|
return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
|
|
} else {
|
|
} else {
|
|
- if (billPcr.getDestId() >= billPcr.getTestLocationId() || billPcr.getTestLocationId() == 9 || billPcr.getTestLocationId() == 10 || billPcr.getTestLocationId() == 11 || billPcr.getTestLocationId() == 6) { //说明当前不是目的地
|
|
|
|
-
|
|
|
|
- if ("1".equals(result)) {
|
|
|
|
- billPcr.setBillStatus(1);
|
|
|
|
- billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
- billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
- billPcr.setTestLocation(baseLocation.getLocationName());
|
|
|
|
- billPcr.setTestLocationId(baseLocation.getId());
|
|
|
|
- billPcr.setCheckDate(sdf.parse(date));
|
|
|
|
- billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
- billPcr.setQualifiedDate(configuration.getPcr());
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //通过生成洗消记录
|
|
|
|
- BillClean billClean = new BillClean();
|
|
|
|
- billClean.setVistitType(billPcr.getVistitType());
|
|
|
|
- billClean.setDestName(billPcr.getDestName());
|
|
|
|
- billClean.setDestId(billPcr.getDestId());
|
|
|
|
- billClean.setAdmissionUserName(billPcr.getAdmissionUserName());
|
|
|
|
- billClean.setAdmissionUserId(billPcr.getAdmissionUserId());
|
|
|
|
- billClean.setVistitDate(billPcr.getVistitDate());
|
|
|
|
- billClean.setSubDate(LocalDateTime.now());
|
|
|
|
- billClean.setFarmId(billPcr.getFarmId());
|
|
|
|
- billClean.setPassUserName(billPcr.getPassUserName());
|
|
|
|
- billClean.setPassDate(billPcr.getPassDate());
|
|
|
|
- billClean.setPassUserId(billPcr.getPassUserId());
|
|
|
|
- billClean.setProcessId(billPcr.getProcessId());
|
|
|
|
- billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
|
- billClean.setTestLocationId(baseLocation.getId());
|
|
|
|
- billClean.setPhone(billPcr.getPhone());
|
|
|
|
- billClean.setImgStatus(0);
|
|
|
|
- billClean.setCarNum(billPcr.getCarNum());
|
|
|
|
|
|
+ if ("1".equals(result)) {
|
|
|
|
+ Integer pcrTime = washoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().eq("farm_ids", farmId)
|
|
|
|
+ .eq("visiting_type", billPcr.getVistitType()).eq("location_id", baseLocation.getId())).getPcrTime();
|
|
|
|
+
|
|
|
|
+ billPcr.setBillStatus(1);
|
|
|
|
+ billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
+ billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
+ billPcr.setTestLocation(baseLocation.getLocationName());
|
|
|
|
+ billPcr.setTestLocationId(baseLocation.getId());
|
|
|
|
+ billPcr.setCheckDate(sdf.parse(date));
|
|
|
|
+ billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
+ billPcr.setQualifiedDate(pcrTime);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Object newObject = getNewObject(nextId, billPcr.getDestName(), billPcr.getDestId(), billPcr.getAdmissionUserName(),
|
|
|
|
+ billPcr.getAdmissionUserId(), billPcr.getVistitDate(), billPcr.getSubDate(),
|
|
|
|
+ billPcr.getProcessId(), billPcr.getFarmId(), billPcr.getTestLocation(), billPcr.getTestLocationId(),
|
|
|
|
+ billPcr.getVistitType(),billPcr.getPhone());
|
|
|
|
+ if (nextId == 0) {
|
|
|
|
+ int index = allLocationId.indexOf(baseLocation.getId());
|
|
|
|
+ StringBuilder status = new StringBuilder(baseProcess.getAllLocationId());
|
|
|
|
+ status.setCharAt(index, '1');
|
|
|
|
+ status.setCharAt(index + 2, '1');
|
|
|
|
+ baseProcess.setAllLocationStatus(status.toString());
|
|
|
|
+ } else if (nextId == 1) {
|
|
|
|
+ //新增采样
|
|
|
|
+ BillSampling billSampling = (BillSampling) newObject;
|
|
|
|
+ samplingMapper.insert(billSampling);
|
|
|
|
+ }else if (nextId == 2) {
|
|
|
|
+ //新增pcr
|
|
|
|
+ BillPcr billClean = (BillPcr) newObject;
|
|
|
|
+ pcrMapper.insert(billClean);
|
|
|
|
+ }else if (nextId == 3) {
|
|
|
|
+ //新增洗澡
|
|
|
|
+ BillClean billClean = (BillClean) newObject;
|
|
cleanMapper.insert(billClean);
|
|
cleanMapper.insert(billClean);
|
|
- //通过生成门禁白名单
|
|
|
|
- QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
|
|
|
|
- deviceListQueryWrapper.eq("farm_id", billPcr.getFarmId()).eq("location_id", baseLocation.getId());
|
|
|
|
- List<DeviceList> deviceLists = deviceListMapper.selectList(deviceListQueryWrapper);
|
|
|
|
- //找到对应的入场申请表
|
|
|
|
- QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
- queryWrapper1.eq("farm_id", billPcr.getFarmId()).eq("process_id", baseProcess.getId());
|
|
|
|
- BillPersonnelAdmission billPersonnelAdmission = personnelAdmissionMapper.selectOne(queryWrapper1);
|
|
|
|
- if (deviceLists.size() > 0) {
|
|
|
|
- for (DeviceList deviceList : deviceLists) {
|
|
|
|
- //通过生成门禁白名单
|
|
|
|
- PeopleList peopleList = new PeopleList();
|
|
|
|
- peopleList.setFarmId(billPcr.getFarmId().toString());
|
|
|
|
- peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
|
- peopleList.setUserId(billPcr.getAdmissionUserId());
|
|
|
|
- peopleList.setUserName(billPcr.getAdmissionUserName());
|
|
|
|
- peopleList.setPassword("123456");
|
|
|
|
- peopleList.setType(0);
|
|
|
|
- peopleList.setCreateTime(new Date());
|
|
|
|
- Date date2 = new Date();
|
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
- calendar.setTime(date2);
|
|
|
|
- calendar.add(Calendar.HOUR_OF_DAY, 2);
|
|
|
|
- Date date1 = calendar.getTime();
|
|
|
|
- peopleList.setOutTime(date1);
|
|
|
|
- peopleListMapper.insert(peopleList);
|
|
|
|
-
|
|
|
|
- HashMap<String, Object> jsonObject = new HashMap<>();
|
|
|
|
- jsonObject.put("seq", deviceList.getDeviceCode());
|
|
|
|
-// String savePath = "D:\\works\\pig_projects\\甜妹.jpg";
|
|
|
|
- String savePath = "/opt/huatong/test.jpg";
|
|
|
|
- URL url = new URL(billPersonnelAdmission.getUserImgUrl());
|
|
|
|
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
|
|
- connection.setRequestMethod("GET");
|
|
|
|
- int resCode = connection.getResponseCode();
|
|
|
|
- if (resCode == HttpURLConnection.HTTP_OK) {
|
|
|
|
- InputStream inputStream = connection.getInputStream();
|
|
|
|
- byte[] buffer = new byte[4096];
|
|
|
|
- int length;
|
|
|
|
- //读取数据并写入到文件中
|
|
|
|
- try (FileOutputStream outStream = new FileOutputStream(savePath)) {
|
|
|
|
- while ((length = inputStream.read(buffer)) != -1) {
|
|
|
|
- outStream.write(buffer, 0, length);
|
|
|
|
- }
|
|
|
|
- outStream.flush();
|
|
|
|
- } finally {
|
|
|
|
- inputStream.close();
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- System.out.println("文件下载错误码为" + resCode);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-// jsonObject.put("face", FileUtil.file("D:\\works\\pig_projects\\甜妹.jpg"));
|
|
|
|
- jsonObject.put("face", FileUtil.file(savePath));
|
|
|
|
- jsonObject.put("name", billPersonnelAdmission.getAdmissionUserName());
|
|
|
|
- jsonObject.put("password", "123456");
|
|
|
|
- jsonObject.put("timestamp", date1.getTime());
|
|
|
|
- jsonObject.put("uid", billPersonnelAdmission.getAdmissionUserId());
|
|
|
|
- String post = HttpRequest.post("http://39.173.90.137:8040/addDeviceUser")
|
|
|
|
- .header(Header.CONTENT_TYPE, "multipart/form-data")
|
|
|
|
- .form(jsonObject)
|
|
|
|
- .timeout(30 * 1000).execute().body();
|
|
|
|
- System.out.println(post);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
|
- 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);
|
|
|
|
-
|
|
|
|
- if (billPcr.getDestId() == 11) {
|
|
|
|
- baseProcess.setAllLocationStatus("2,1");
|
|
|
|
- }
|
|
|
|
- if (billPcr.getDestId() == 10) {
|
|
|
|
- baseProcess.setAllLocationStatus("2,1");
|
|
|
|
- }
|
|
|
|
- if (billPcr.getDestId() == 9) {
|
|
|
|
- baseProcess.setAllLocationStatus("2,1");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- processMapper.updateById(baseProcess);
|
|
|
|
- pcrMapper.updateById(billPcr);
|
|
|
|
- return new Result(10000, "修改成功!", true);
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- billPcr.setBillStatus(2);
|
|
|
|
- billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
- billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
-
|
|
|
|
- billPcr.setTestLocation(baseLocation.getLocationName());
|
|
|
|
- billPcr.setTestLocationId(baseLocation.getId());
|
|
|
|
- billPcr.setCheckDate(sdf.parse(date));
|
|
|
|
- billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
- baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
|
-
|
|
|
|
- String status = baseProcess.getCurrentStatus();
|
|
|
|
- String substring = status.substring(0, status.length() - 1);
|
|
|
|
-
|
|
|
|
- baseProcess.setCurrentStatus(substring + "2," + 0);
|
|
|
|
- if (baseLocation.getId() == 1) {
|
|
|
|
- //第一次检测不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",初级洗消站污区");
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 12) {
|
|
|
|
- //环保车第一次不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",销售中转站");
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 15) {
|
|
|
|
- //拉猪车第一次不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",销售中转站");
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 6) {
|
|
|
|
- //饲料车第一次不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + ",车辆初级洗消站");
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + ",2");
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 3) {
|
|
|
|
- //第二次检测不合格
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "2";
|
|
|
|
- split[2] = "2";
|
|
|
|
- split[3] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + status1.substring(7));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 4 && exist.getExist() == 0) {
|
|
|
|
- //第三次不合格
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "2";
|
|
|
|
- split[2] = "2";
|
|
|
|
- split[3] = "2";
|
|
|
|
- split[4] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + "," + split[4] + status1.substring(9));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 4 && exist.getExist() == 1) {
|
|
|
|
- //第三次不合格
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "2";
|
|
|
|
- split[2] = "2";
|
|
|
|
- split[3] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3] + status1.substring(7));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (baseLocation.getId() == 17) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 15) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 9) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 10) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 11) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- processMapper.updateById(baseProcess);
|
|
|
|
- pcrMapper.updateById(billPcr);
|
|
|
|
- return new Result(10000, "修改成功!", true);
|
|
|
|
|
|
+ }else if (nextId == 4) {
|
|
|
|
+ //新增隔离
|
|
|
|
+ BillIsolate pcr = (BillIsolate) newObject;
|
|
|
|
+ isolateMapper.insert(pcr);
|
|
|
|
+ }else if (nextId == 5) {
|
|
|
|
+ BillDry billClean = (BillDry) newObject;
|
|
|
|
+ dryMapper.insert(billClean);
|
|
|
|
+ //新增烘干
|
|
|
|
+ }else if (nextId == 6) {
|
|
|
|
+ //新增洗澡前拍照
|
|
|
|
+ BillCleanBefore before = new BillCleanBefore();
|
|
|
|
+ beforeMapper.insert(before);
|
|
}
|
|
}
|
|
|
|
+// //通过生成门禁白名单
|
|
|
|
+// QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
|
|
|
|
+// deviceListQueryWrapper.eq("farm_id", billPcr.getFarmId()).eq("location_id", baseLocation.getId());
|
|
|
|
+// List<DeviceList> deviceLists = deviceListMapper.selectList(deviceListQueryWrapper);
|
|
|
|
+// //找到对应的入场申请表
|
|
|
|
+// QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
+// queryWrapper1.eq("farm_id", billPcr.getFarmId()).eq("process_id", baseProcess.getId());
|
|
|
|
+// BillPersonnelAdmission billPersonnelAdmission = personnelAdmissionMapper.selectOne(queryWrapper1);
|
|
|
|
+// if (deviceLists.size() > 0) {
|
|
|
|
+// for (DeviceList deviceList : deviceLists) {
|
|
|
|
+// //通过生成门禁白名单
|
|
|
|
+// PeopleList peopleList = new PeopleList();
|
|
|
|
+// peopleList.setFarmId(billPcr.getFarmId().toString());
|
|
|
|
+// peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
|
+// peopleList.setUserId(billPcr.getAdmissionUserId());
|
|
|
|
+// peopleList.setUserName(billPcr.getAdmissionUserName());
|
|
|
|
+// peopleList.setPassword("123456");
|
|
|
|
+// peopleList.setType(0);
|
|
|
|
+// peopleList.setCreateTime(new Date());
|
|
|
|
+// Date date2 = new Date();
|
|
|
|
+// Calendar calendar = Calendar.getInstance();
|
|
|
|
+// calendar.setTime(date2);
|
|
|
|
+// calendar.add(Calendar.HOUR_OF_DAY, 2);
|
|
|
|
+// Date date1 = calendar.getTime();
|
|
|
|
+// peopleList.setOutTime(date1);
|
|
|
|
+// peopleListMapper.insert(peopleList);
|
|
|
|
+//
|
|
|
|
+// HashMap<String, Object> jsonObject = new HashMap<>();
|
|
|
|
+// jsonObject.put("seq", deviceList.getDeviceCode());
|
|
|
|
+//// String savePath = "D:\\works\\pig_projects\\甜妹.jpg";
|
|
|
|
+// String savePath = "/opt/huatong/test.jpg";
|
|
|
|
+// URL url = new URL(billPersonnelAdmission.getUserImgUrl());
|
|
|
|
+// HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
|
|
+// connection.setRequestMethod("GET");
|
|
|
|
+// int resCode = connection.getResponseCode();
|
|
|
|
+// if (resCode == HttpURLConnection.HTTP_OK) {
|
|
|
|
+// InputStream inputStream = connection.getInputStream();
|
|
|
|
+// byte[] buffer = new byte[4096];
|
|
|
|
+// int length;
|
|
|
|
+// //读取数据并写入到文件中
|
|
|
|
+// try (FileOutputStream outStream = new FileOutputStream(savePath)) {
|
|
|
|
+// while ((length = inputStream.read(buffer)) != -1) {
|
|
|
|
+// outStream.write(buffer, 0, length);
|
|
|
|
+// }
|
|
|
|
+// outStream.flush();
|
|
|
|
+// } finally {
|
|
|
|
+// inputStream.close();
|
|
|
|
+// }
|
|
|
|
+// } else {
|
|
|
|
+// System.out.println("文件下载错误码为" + resCode);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//// jsonObject.put("face", FileUtil.file("D:\\works\\pig_projects\\甜妹.jpg"));
|
|
|
|
+// jsonObject.put("face", FileUtil.file(savePath));
|
|
|
|
+// jsonObject.put("name", billPersonnelAdmission.getAdmissionUserName());
|
|
|
|
+// jsonObject.put("password", "123456");
|
|
|
|
+// jsonObject.put("timestamp", date1.getTime());
|
|
|
|
+// jsonObject.put("uid", billPersonnelAdmission.getAdmissionUserId());
|
|
|
|
+// String post = HttpRequest.post("http://39.173.90.137:8040/addDeviceUser")
|
|
|
|
+// .header(Header.CONTENT_TYPE, "multipart/form-data")
|
|
|
|
+// .form(jsonObject)
|
|
|
|
+// .timeout(30 * 1000).execute().body();
|
|
|
|
+// System.out.println(post);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
|
+ 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);
|
|
|
|
+ baseProcess.setCurrentFlowId(baseProcess.getCurrentLocationId() + "," + nextId);
|
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
|
+ pcrMapper.updateById(billPcr);
|
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
} else {
|
|
} else {
|
|
-
|
|
|
|
- if ("1".equals(result)) {
|
|
|
|
- billPcr.setBillStatus(1);
|
|
|
|
- billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
- billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
- billPcr.setTestLocation(baseLocation.getLocationName());
|
|
|
|
- billPcr.setTestLocationId(baseLocation.getId());
|
|
|
|
- billPcr.setQualifiedDate(configuration.getPcr());
|
|
|
|
- billPcr.setCheckDate(sdf.parse(date));
|
|
|
|
- billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
-
|
|
|
|
- baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
- String status = baseProcess.getCurrentStatus();
|
|
|
|
- String substring = status.substring(0, status.length() - 1);
|
|
|
|
- baseProcess.setCurrentStatus(substring + "1");
|
|
|
|
- baseProcess.setProcessType(1);
|
|
|
|
-
|
|
|
|
- if (baseLocation.getId() == 9) {
|
|
|
|
- baseProcess.setAllLocationStatus("2,2");
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 10) {
|
|
|
|
-
|
|
|
|
- baseProcess.setAllLocationStatus("2,2");
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 11) {
|
|
|
|
- baseProcess.setAllLocationStatus("2,2");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- processMapper.updateById(baseProcess);
|
|
|
|
- pcrMapper.updateById(billPcr);
|
|
|
|
- return new Result(10000, "修改成功!", true);
|
|
|
|
- } else {
|
|
|
|
- if (baseLocation.getId() == 1) {
|
|
|
|
- //第一次检测不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- } else if (baseLocation.getId() == 12) {
|
|
|
|
- //环保车检测不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- } else if (baseLocation.getId() == 15) {
|
|
|
|
- //拉猪车检测不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- } else if (baseLocation.getId() == 6) {
|
|
|
|
- //饲料车检测不合格
|
|
|
|
- billPcr.setPcrType(1);
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- } else {
|
|
|
|
- baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
|
- baseProcess.setProcessType(2);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (baseLocation.getId() == 15) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
|
|
- String status = baseProcess.getCurrentStatus();
|
|
|
|
- String substring = status.substring(0, status.length() - 1);
|
|
|
|
- baseProcess.setCurrentStatus(substring + "2," + 0);
|
|
|
|
-
|
|
|
|
- if (baseLocation.getId() == 9) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 10) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 11) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
- if (baseLocation.getId() == 17) {
|
|
|
|
- String status1 = baseProcess.getAllLocationStatus();
|
|
|
|
- String[] split = status1.split(",");
|
|
|
|
- split[0] = "2";
|
|
|
|
- split[1] = "3";
|
|
|
|
- baseProcess.setAllLocationStatus(split[0] + "," + split[1] + status1.substring(3));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- billPcr.setBillStatus(2);
|
|
|
|
- billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
- billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
- billPcr.setTestLocation(baseLocation.getLocationName());
|
|
|
|
- billPcr.setTestLocationId(baseLocation.getId());
|
|
|
|
- billPcr.setCheckDate(sdf.parse(date));
|
|
|
|
- billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
- processMapper.updateById(baseProcess);
|
|
|
|
- pcrMapper.updateById(billPcr);
|
|
|
|
- return new Result(10000, "修改成功!", true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ billPcr.setBillStatus(2);
|
|
|
|
+ billPcr.setPcrType(1);
|
|
|
|
+ billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
|
+ billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
|
+ billPcr.setTestLocation(baseLocation.getLocationName());
|
|
|
|
+ billPcr.setTestLocationId(baseLocation.getId());
|
|
|
|
+ billPcr.setCheckDate(sdf.parse(date));
|
|
|
|
+ billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
+ baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
|
+ String status = baseProcess.getCurrentStatus();
|
|
|
|
+ String substring = status.substring(0, status.length() - 1);
|
|
|
|
+ baseProcess.setCurrentStatus(substring + "2," + 0);
|
|
|
|
+
|
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
|
+ pcrMapper.updateById(billPcr);
|
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ String s = "0,1,0,2,0,3,0";
|
|
|
|
+ StringBuilder sb = new StringBuilder(s);
|
|
|
|
+ Integer a = s.length() - 3;
|
|
|
|
+ sb.setCharAt(a,'0');
|
|
|
|
+ System.out.println(sb.toString());
|
|
|
|
+
|
|
|
|
+// String s1 = "1,1,1,0,0,0";
|
|
|
|
+// System.out.println(s.indexOf("2"));
|
|
|
|
+// StringBuilder sb = new StringBuilder(s1);
|
|
|
|
+// sb.setCharAt(6, '1');
|
|
|
|
+// sb.setCharAt(8, '1');
|
|
|
|
+// System.out.println(sb.toString());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
private void xiugaiPro(BaseProcess baseProcess, BillPcr billPcr) {
|
|
private void xiugaiPro(BaseProcess baseProcess, BillPcr billPcr) {
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + new Date());
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + new Date());
|
|
@@ -772,6 +585,110 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
System.out.println("完结");
|
|
System.out.println("完结");
|
|
return "成功";
|
|
return "成功";
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public static Object getNewObject(Integer id, String destName, Integer destId, String admissionUserName, Integer admissionUserId
|
|
|
|
+ , LocalDateTime vistitDate, LocalDateTime subDate, Integer processId, Integer farmId, String testLocation
|
|
|
|
+ , Integer testLocationId,Integer vistitType,String phone) {
|
|
|
|
+ if (id == 1) {
|
|
|
|
+ //采样
|
|
|
|
+ BillSampling billSampling = new BillSampling();
|
|
|
|
+ billSampling.setVistitType(vistitType);
|
|
|
|
+ billSampling.setDestName(destName);
|
|
|
|
+ billSampling.setDestId(destId);
|
|
|
|
+ billSampling.setAdmissionUserName(admissionUserName);
|
|
|
|
+ billSampling.setAdmissionUserId(admissionUserId);
|
|
|
|
+ billSampling.setVistitDate(vistitDate);
|
|
|
|
+ billSampling.setSubDate(LocalDateTime.now());
|
|
|
|
+ billSampling.setPhone(phone);
|
|
|
|
+ billSampling.setTestLocation(testLocation);
|
|
|
|
+ billSampling.setTestLocationId(testLocationId);
|
|
|
|
+ billSampling.setProcessId(processId);
|
|
|
|
+ billSampling.setFarmId(String.valueOf(farmId));
|
|
|
|
+ return billSampling;
|
|
|
|
+ }
|
|
|
|
+ if (id == 2) {
|
|
|
|
+ //pcr
|
|
|
|
+ BillPcr billPcr = new BillPcr();
|
|
|
|
+ billPcr.setDestName(destName);
|
|
|
|
+ billPcr.setDestId(destId);
|
|
|
|
+ billPcr.setAdmissionUserId(admissionUserId);
|
|
|
|
+ billPcr.setAdmissionUserName(admissionUserName);
|
|
|
|
+ billPcr.setVistitDate(vistitDate);
|
|
|
|
+ billPcr.setSubDate(subDate);
|
|
|
|
+ billPcr.setBillStatus(0);
|
|
|
|
+ billPcr.setProcessId(processId);
|
|
|
|
+ billPcr.setFarmId(farmId);
|
|
|
|
+ billPcr.setTestLocationId(testLocationId);
|
|
|
|
+ billPcr.setTestLocation(testLocation);
|
|
|
|
+ return billPcr;
|
|
|
|
+ }
|
|
|
|
+ if (id == 3) {
|
|
|
|
+ //洗消
|
|
|
|
+ BillClean billPcr = new BillClean();
|
|
|
|
+ billPcr.setDestName(destName);
|
|
|
|
+ billPcr.setDestId(destId);
|
|
|
|
+ billPcr.setAdmissionUserId(admissionUserId);
|
|
|
|
+ billPcr.setAdmissionUserName(admissionUserName);
|
|
|
|
+ billPcr.setVistitDate(vistitDate);
|
|
|
|
+ billPcr.setSubDate(subDate);
|
|
|
|
+ billPcr.setBillStatus(0);
|
|
|
|
+ billPcr.setProcessId(processId);
|
|
|
|
+ billPcr.setFarmId(farmId);
|
|
|
|
+ billPcr.setTestLocationId(testLocationId);
|
|
|
|
+ billPcr.setTestLocation(testLocation);
|
|
|
|
+ return billPcr;
|
|
|
|
+ }
|
|
|
|
+ if (id == 4) {
|
|
|
|
+ //隔离
|
|
|
|
+ BillIsolate billPcr = new BillIsolate();
|
|
|
|
+ billPcr.setDestName(destName);
|
|
|
|
+ billPcr.setDestId(destId);
|
|
|
|
+ billPcr.setAdmissionUserId(admissionUserId);
|
|
|
|
+ billPcr.setAdmissionUserName(admissionUserName);
|
|
|
|
+ billPcr.setVistitDate(vistitDate);
|
|
|
|
+ billPcr.setSubDate(subDate);
|
|
|
|
+ billPcr.setBillStatus(0);
|
|
|
|
+ billPcr.setProcessId(processId);
|
|
|
|
+ billPcr.setFarmId(farmId);
|
|
|
|
+ billPcr.setIsolateLocation(testLocation);
|
|
|
|
+ billPcr.setIsolateLocationId(testLocationId);
|
|
|
|
+ return billPcr;
|
|
|
|
+ }
|
|
|
|
+ if (id == 5) {
|
|
|
|
+ //烘干
|
|
|
|
+ BillDry billPcr = new BillDry();
|
|
|
|
+ billPcr.setDestName(destName);
|
|
|
|
+ billPcr.setDestId(destId);
|
|
|
|
+ billPcr.setAdmissionUserId(admissionUserId);
|
|
|
|
+ billPcr.setAdmissionUserName(admissionUserName);
|
|
|
|
+ billPcr.setVistitDate(vistitDate);
|
|
|
|
+ billPcr.setSubDate(subDate);
|
|
|
|
+ billPcr.setBillStatus(0);
|
|
|
|
+ billPcr.setProcessId(processId);
|
|
|
|
+ billPcr.setFarmId(farmId);
|
|
|
|
+ billPcr.setTestLocationId(testLocationId);
|
|
|
|
+ billPcr.setTestLocation(testLocation);
|
|
|
|
+ return billPcr;
|
|
|
|
+ }
|
|
|
|
+ if (id == 6) {
|
|
|
|
+ //洗澡前拍照
|
|
|
|
+ BillCleanBefore billCleanBefore = new BillCleanBefore();
|
|
|
|
+ billCleanBefore.setVistitType(vistitType);
|
|
|
|
+ billCleanBefore.setDestName(destName);
|
|
|
|
+ billCleanBefore.setDestId(destId);
|
|
|
|
+ billCleanBefore.setAdmissionUserName(admissionUserName);
|
|
|
|
+ billCleanBefore.setAdmissionUserId(admissionUserId);
|
|
|
|
+ billCleanBefore.setVistitDate(vistitDate);
|
|
|
|
+ billCleanBefore.setSubDate(LocalDateTime.now());
|
|
|
|
+ billCleanBefore.setPhone(phone);
|
|
|
|
+ billCleanBefore.setTestLocation(testLocation);
|
|
|
|
+ billCleanBefore.setTestLocationId(testLocationId);
|
|
|
|
+ billCleanBefore.setProcessId(processId);
|
|
|
|
+ billCleanBefore.setFarmId(String.valueOf(farmId));
|
|
|
|
+ return billCleanBefore;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|