|
@@ -73,6 +73,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
private SysAccountMultilevelMapper sysAccountMultilevelMapper;
|
|
|
@Autowired
|
|
|
private UploadImage uploadImage;
|
|
|
+ @Autowired
|
|
|
+ private BillDryMapper dryMapper;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -399,6 +401,8 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
billClean.setProcessId(billPcr.getProcessId());
|
|
|
billClean.setTestLocation(baseLocation.getNextLocation());
|
|
|
billClean.setTestLocationId(baseLocation.getNextId());
|
|
|
+ billClean.setImgStatus(0);
|
|
|
+ billClean.setCarNum(billPcr.getCarNum());
|
|
|
cleanMapper.insert(billClean);
|
|
|
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
@@ -760,4 +764,325 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
return new Result(ResultCode.SUCCESS, cleanMapper.selectPage(page, queryWrapper));
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result listByIdClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
+ String id = paramsMap.get("id");
|
|
|
+ return new Result(ResultCode.SUCCESS, cleanMapper.selectById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ //清洗和洗消的检测
|
|
|
+ @Override
|
|
|
+ public Result editClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
|
+ String result = paramsMap.get("result");
|
|
|
+ String id = paramsMap.get("id");
|
|
|
+ String farmId = paramsMap.get("farmId");
|
|
|
+ BillClean billClean = cleanMapper.selectById(id);
|
|
|
+ QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
|
|
|
+ processQueryWrapper.eq("farm_id", farmId).eq("id", billClean.getProcessId());
|
|
|
+ BaseProcess baseProcess = processMapper.selectOne(processQueryWrapper);//进程
|
|
|
+
|
|
|
+ QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
|
+ locationQueryWrapper.eq("farm_id", farmId).eq("id", billClean.getTestLocationId());
|
|
|
+ BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前洗消检测所在的位置
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
+ if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
|
|
|
+ return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
|
|
|
+ } else {
|
|
|
+ if (billClean.getDestId() > billClean.getTestLocationId()) { //说明当前不是目的地
|
|
|
+ if ("1".equals(result)) {
|
|
|
+ billClean.setBillStatus(1);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(sdf.parse(sdf.format(new Date())));
|
|
|
+
|
|
|
+ baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
+ String status = baseProcess.getCurrentStatus();
|
|
|
+ String substring = status.substring(0, status.length() - 1);
|
|
|
+ baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
|
+
|
|
|
+ //环保车洗消合格生成烘干申请
|
|
|
+ if (billClean.getDestId() == 18 || billClean.getDestId() == 21) {
|
|
|
+ BillDry billDry = new BillDry();
|
|
|
+ billDry.setVistitType(billClean.getVistitType());
|
|
|
+ billDry.setDestName(billClean.getDestName());
|
|
|
+ billDry.setDestId(billClean.getDestId());
|
|
|
+ billDry.setAdmissionUserName(billClean.getAdmissionUserName());
|
|
|
+ billDry.setAdmissionUserId(billClean.getAdmissionUserId());
|
|
|
+ billDry.setVistitDate(billClean.getVistitDate());
|
|
|
+ billDry.setSubDate(billClean.getSubDate());
|
|
|
+ billDry.setFarmId(billClean.getFarmId());
|
|
|
+ billDry.setBillStatus(0);
|
|
|
+ billDry.setProcessId(billClean.getProcessId());
|
|
|
+ billDry.setTestLocation(baseLocation.getNextLocation());
|
|
|
+ billDry.setTestLocationId(baseLocation.getNextId());
|
|
|
+ billDry.setPhone(billClean.getPhone());
|
|
|
+ billDry.setCarNum(billClean.getCarNum());
|
|
|
+ billDry.setImgStatus(0);
|
|
|
+ dryMapper.insert(billDry);
|
|
|
+ }
|
|
|
+ //拉猪车洗消合格生成烘干申请
|
|
|
+ if (billClean.getDestId() == 27 ) {
|
|
|
+ BillDry billDry = new BillDry();
|
|
|
+ billDry.setVistitType(billClean.getVistitType());
|
|
|
+ billDry.setDestName(billClean.getDestName());
|
|
|
+ billDry.setDestId(billClean.getDestId());
|
|
|
+ billDry.setAdmissionUserName(billClean.getAdmissionUserName());
|
|
|
+ billDry.setAdmissionUserId(billClean.getAdmissionUserId());
|
|
|
+ billDry.setVistitDate(billClean.getVistitDate());
|
|
|
+ billDry.setSubDate(billClean.getSubDate());
|
|
|
+ billDry.setFarmId(billClean.getFarmId());
|
|
|
+ billDry.setBillStatus(0);
|
|
|
+ billDry.setProcessId(billClean.getProcessId());
|
|
|
+ billDry.setTestLocation(baseLocation.getNextLocation());
|
|
|
+ billDry.setTestLocationId(baseLocation.getNextId());
|
|
|
+ billDry.setPhone(billClean.getPhone());
|
|
|
+ billDry.setCarNum(billClean.getCarNum());
|
|
|
+ billDry.setImgStatus(0);
|
|
|
+ dryMapper.insert(billDry);
|
|
|
+ }
|
|
|
+ //送猪车洗消合格生成烘干申请
|
|
|
+ if (billClean.getDestId() == 42 ) {
|
|
|
+ BillDry billDry = new BillDry();
|
|
|
+ billDry.setVistitType(billClean.getVistitType());
|
|
|
+ billDry.setDestName(billClean.getDestName());
|
|
|
+ billDry.setDestId(billClean.getDestId());
|
|
|
+ billDry.setAdmissionUserName(billClean.getAdmissionUserName());
|
|
|
+ billDry.setAdmissionUserId(billClean.getAdmissionUserId());
|
|
|
+ billDry.setVistitDate(billClean.getVistitDate());
|
|
|
+ billDry.setSubDate(billClean.getSubDate());
|
|
|
+ billDry.setFarmId(billClean.getFarmId());
|
|
|
+ billDry.setBillStatus(0);
|
|
|
+ billDry.setProcessId(billClean.getProcessId());
|
|
|
+ billDry.setTestLocation(baseLocation.getNextLocation());
|
|
|
+ billDry.setTestLocationId(baseLocation.getNextId());
|
|
|
+ billDry.setPhone(billClean.getPhone());
|
|
|
+ billDry.setCarNum(billClean.getCarNum());
|
|
|
+ billDry.setImgStatus(0);
|
|
|
+ dryMapper.insert(billDry);
|
|
|
+ }
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ cleanMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ } else {
|
|
|
+ billClean.setBillStatus(2);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setImgStatus(0);
|
|
|
+
|
|
|
+ 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");
|
|
|
+ baseProcess.setProcessType(2);
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ cleanMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ("1".equals(result)) {
|
|
|
+ billClean.setBillStatus(1);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(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);
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ cleanMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ } else {
|
|
|
+ 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");
|
|
|
+ baseProcess.setProcessType(2);
|
|
|
+ billClean.setBillStatus(2);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setImgStatus(0);
|
|
|
+
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ cleanMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //烘干检测
|
|
|
+ @Override
|
|
|
+ public Result editDry(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
|
+ String result = paramsMap.get("result");
|
|
|
+ String id = paramsMap.get("id");
|
|
|
+ String farmId = paramsMap.get("farmId");
|
|
|
+ BillDry billClean = dryMapper.selectById(id);
|
|
|
+ QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
|
|
|
+ processQueryWrapper.eq("farm_id", farmId).eq("id", billClean.getProcessId());
|
|
|
+ BaseProcess baseProcess = processMapper.selectOne(processQueryWrapper);//进程
|
|
|
+
|
|
|
+ QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
|
+ locationQueryWrapper.eq("farm_id", farmId).eq("id", billClean.getTestLocationId());
|
|
|
+ BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前洗消检测所在的位置
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
+ if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
|
|
|
+ return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
|
|
|
+ } else {
|
|
|
+ if (billClean.getDestId() > billClean.getTestLocationId()) { //说明当前不是目的地
|
|
|
+ if ("1".equals(result)) {
|
|
|
+ billClean.setBillStatus(1);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(sdf.parse(sdf.format(new Date())));
|
|
|
+
|
|
|
+ baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
+ String status = baseProcess.getCurrentStatus();
|
|
|
+ String substring = status.substring(0, status.length() - 1);
|
|
|
+ baseProcess.setCurrentStatus(substring + "1," + 0);
|
|
|
+
|
|
|
+ //环保车烘干合格生成洗消申请
|
|
|
+ if (billClean.getDestId() == 19) {
|
|
|
+ BillClean clean = new BillClean();
|
|
|
+ clean.setVistitType(billClean.getVistitType());
|
|
|
+ clean.setDestName(billClean.getDestName());
|
|
|
+ clean.setDestId(billClean.getDestId());
|
|
|
+ clean.setAdmissionUserName(billClean.getAdmissionUserName());
|
|
|
+ clean.setAdmissionUserId(billClean.getAdmissionUserId());
|
|
|
+ clean.setVistitDate(billClean.getVistitDate());
|
|
|
+ clean.setSubDate(billClean.getSubDate());
|
|
|
+ clean.setFarmId(billClean.getFarmId());
|
|
|
+ clean.setBillStatus(0);
|
|
|
+ clean.setProcessId(billClean.getProcessId());
|
|
|
+ clean.setTestLocationId(baseLocation.getNextId());
|
|
|
+ clean.setTestLocation(baseLocation.getNextLocation());
|
|
|
+ clean.setPhone(billClean.getPhone());
|
|
|
+ clean.setCarNum(billClean.getCarNum());
|
|
|
+ clean.setImgStatus(0);
|
|
|
+ cleanMapper.insert(clean);
|
|
|
+ }
|
|
|
+
|
|
|
+ //拉猪车烘干合格生成洗消申请
|
|
|
+ if (billClean.getDestId() == 28) {
|
|
|
+ BillClean clean = new BillClean();
|
|
|
+ clean.setVistitType(billClean.getVistitType());
|
|
|
+ clean.setDestName(billClean.getDestName());
|
|
|
+ clean.setDestId(billClean.getDestId());
|
|
|
+ clean.setAdmissionUserName(billClean.getAdmissionUserName());
|
|
|
+ clean.setAdmissionUserId(billClean.getAdmissionUserId());
|
|
|
+ clean.setVistitDate(billClean.getVistitDate());
|
|
|
+ clean.setSubDate(billClean.getSubDate());
|
|
|
+ clean.setFarmId(billClean.getFarmId());
|
|
|
+ clean.setBillStatus(0);
|
|
|
+ clean.setProcessId(billClean.getProcessId());
|
|
|
+ clean.setTestLocationId(baseLocation.getNextId());
|
|
|
+ clean.setTestLocation(baseLocation.getNextLocation());
|
|
|
+ clean.setPhone(billClean.getPhone());
|
|
|
+ clean.setCarNum(billClean.getCarNum());
|
|
|
+ clean.setImgStatus(0);
|
|
|
+ cleanMapper.insert(clean);
|
|
|
+ }
|
|
|
+
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ dryMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ } else {
|
|
|
+ billClean.setBillStatus(2);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setImgStatus(0);
|
|
|
+
|
|
|
+ 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");
|
|
|
+ baseProcess.setProcessType(2);
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ dryMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ("1".equals(result)) {
|
|
|
+ billClean.setBillStatus(1);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(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);
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ dryMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ } else {
|
|
|
+ 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");
|
|
|
+ baseProcess.setProcessType(2);
|
|
|
+ billClean.setBillStatus(2);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setCheckDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ billClean.setImgStatus(0);
|
|
|
+
|
|
|
+ processMapper.updateById(baseProcess);
|
|
|
+ dryMapper.updateById(billClean);
|
|
|
+ return new Result(10000, "修改成功!", true);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|