|
@@ -96,24 +96,23 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
Page<CleanAndDryVo2> cleanAndDryVo2Page = null;
|
|
|
Page<CleanAndDryVo2> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
if ("0".equals(data)) {
|
|
|
- cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "0,1".split(","));
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "0,1".split(","));
|
|
|
}
|
|
|
ArrayList<String> arrayList = new ArrayList<>();
|
|
|
if ("1".equals(data)) {
|
|
|
arrayList.add("0");
|
|
|
String[] s = arrayList.toArray(new String[arrayList.size()]);
|
|
|
- cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s);
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s);
|
|
|
}
|
|
|
if ("2".equals(data)) {
|
|
|
arrayList.add("1");
|
|
|
String[] s = arrayList.toArray(new String[arrayList.size()]);
|
|
|
- cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s);
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, s);
|
|
|
}
|
|
|
return new Result(ResultCode.SUCCESS, cleanAndDryVo2Page);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -267,73 +266,141 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result carClean(HttpServletRequest httpServletRequest, String farmId, String id, String data, MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile img4, MultipartFile img5) throws ParseException, IOException {
|
|
|
+ public Result carClean(HttpServletRequest httpServletRequest, String farmId, String id, String data, MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile img4, MultipartFile img5, String type) throws ParseException, IOException {
|
|
|
+
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
if (StringUtils.isBlank(data)) {
|
|
|
data = sdf.format(new Date());
|
|
|
}
|
|
|
- BillClean billClean = cleanMapper.selectById(id);//某条洗消记录
|
|
|
- System.out.println("洗消记录的id:" + billClean.getTestLocationId());
|
|
|
- Integer testId = billClean.getTestLocationId();
|
|
|
- QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
|
- locationQueryWrapper.eq("farm_id", farmId).eq("id", testId);
|
|
|
- BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前所在的位置
|
|
|
+ if ("1".equals(type)) {
|
|
|
+ //洗消上传
|
|
|
+ BillClean billClean = cleanMapper.selectById(id);//某条洗消记录
|
|
|
+ System.out.println("洗消记录的id:" + billClean.getTestLocationId());
|
|
|
+ Integer testId = billClean.getTestLocationId();
|
|
|
+ QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
|
+ locationQueryWrapper.eq("farm_id", farmId).eq("id", testId);
|
|
|
+ BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前所在的位置
|
|
|
|
|
|
- QueryWrapper<BaseProcess> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("farm_id", farmId).eq("id", billClean.getProcessId());
|
|
|
- BaseProcess baseProcess = processMapper.selectOne(queryWrapper);//某条进程
|
|
|
+ QueryWrapper<BaseProcess> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("id", billClean.getProcessId());
|
|
|
+ BaseProcess baseProcess = processMapper.selectOne(queryWrapper);//某条进程
|
|
|
|
|
|
- billClean.setBillStatus(0);
|
|
|
- billClean.setImgStatus(1);
|
|
|
- billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
- billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
- billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
- billClean.setTestLocationId(baseLocation.getId());
|
|
|
- billClean.setCheckDate(sdf.parse(data));
|
|
|
- billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
- String s1 = "";
|
|
|
- String s2 = "";
|
|
|
- String s3 = "";
|
|
|
- String s4 = "";
|
|
|
- String s5 = "";
|
|
|
- if (ObjectUtil.isNotEmpty(img1)) {
|
|
|
- if (uploadImage.getImageCom(img1).equals("上传失败")) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return new Result(10001, "图片1上传失败", false);
|
|
|
+ billClean.setBillStatus(0);
|
|
|
+ billClean.setImgStatus(1);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setCheckDate(sdf.parse(data));
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ String s1 = "";
|
|
|
+ String s2 = "";
|
|
|
+ String s3 = "";
|
|
|
+ String s4 = "";
|
|
|
+ String s5 = "";
|
|
|
+ if (ObjectUtil.isNotEmpty(img1)) {
|
|
|
+ if (uploadImage.getImageCom(img1).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片1上传失败", false);
|
|
|
+ }
|
|
|
+ s1 = uploadImage.uploadImg(img1);
|
|
|
}
|
|
|
- s1 = uploadImage.uploadImg(img1);
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotEmpty(img2)) {
|
|
|
- if (uploadImage.getImageCom(img2).equals("上传失败")) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return new Result(10001, "图片2上传失败", false);
|
|
|
+ if (ObjectUtil.isNotEmpty(img2)) {
|
|
|
+ if (uploadImage.getImageCom(img2).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片2上传失败", false);
|
|
|
+ }
|
|
|
+ s2 = "," + uploadImage.uploadImg(img2);
|
|
|
}
|
|
|
- s2 = uploadImage.uploadImg(img2);
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotEmpty(img3)) {
|
|
|
- if (uploadImage.getImageCom(img3).equals("上传失败")) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return new Result(10001, "图片3上传失败", false);
|
|
|
+ if (ObjectUtil.isNotEmpty(img3)) {
|
|
|
+ if (uploadImage.getImageCom(img3).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片3上传失败", false);
|
|
|
+ }
|
|
|
+ s3 = "," + uploadImage.uploadImg(img3);
|
|
|
}
|
|
|
- s3 = uploadImage.uploadImg(img3);
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotEmpty(img4)) {
|
|
|
- if (uploadImage.getImageCom(img4).equals("上传失败")) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return new Result(10001, "图片4上传失败", false);
|
|
|
+ if (ObjectUtil.isNotEmpty(img4)) {
|
|
|
+ if (uploadImage.getImageCom(img4).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片4上传失败", false);
|
|
|
+ }
|
|
|
+ s4 = "," + uploadImage.uploadImg(img4);
|
|
|
}
|
|
|
- s4 = uploadImage.uploadImg(img4);
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotEmpty(img5)) {
|
|
|
- if (uploadImage.getImageCom(img5).equals("上传失败")) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return new Result(10001, "图片5上传失败", false);
|
|
|
+ if (ObjectUtil.isNotEmpty(img5)) {
|
|
|
+ if (uploadImage.getImageCom(img5).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片5上传失败", false);
|
|
|
+ }
|
|
|
+ s5 = "," + uploadImage.uploadImg(img5);
|
|
|
+ }
|
|
|
+ String s = s1 + s2 + s3 + s4 + s5;
|
|
|
+ billClean.setImgUrl(s);
|
|
|
+ cleanMapper.updateById(billClean);
|
|
|
+ } else {
|
|
|
+ BillDry billClean = dryMapper.selectById(id);//某条烘干记录
|
|
|
+ System.out.println("洗消记录的id:" + billClean.getTestLocationId());
|
|
|
+ Integer testId = billClean.getTestLocationId();
|
|
|
+ QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
|
+ locationQueryWrapper.eq("farm_id", farmId).eq("id", testId);
|
|
|
+ BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前所在的位置
|
|
|
+
|
|
|
+ QueryWrapper<BaseProcess> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("id", billClean.getProcessId());
|
|
|
+ BaseProcess baseProcess = processMapper.selectOne(queryWrapper);//某条进程
|
|
|
+
|
|
|
+ billClean.setBillStatus(0);
|
|
|
+ billClean.setImgStatus(1);
|
|
|
+ billClean.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
|
|
|
+ billClean.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
|
|
|
+ billClean.setTestLocation(baseLocation.getLocationName());
|
|
|
+ billClean.setTestLocationId(baseLocation.getId());
|
|
|
+ billClean.setCheckDate(sdf.parse(data));
|
|
|
+ billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
+ String s1 = "";
|
|
|
+ String s2 = "";
|
|
|
+ String s3 = "";
|
|
|
+ String s4 = "";
|
|
|
+ String s5 = "";
|
|
|
+ if (ObjectUtil.isNotEmpty(img1)) {
|
|
|
+ if (uploadImage.getImageCom(img1).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片1上传失败", false);
|
|
|
+ }
|
|
|
+ s1 = uploadImage.uploadImg(img1);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(img2)) {
|
|
|
+ if (uploadImage.getImageCom(img2).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片2上传失败", false);
|
|
|
+ }
|
|
|
+ s2 = "," + uploadImage.uploadImg(img2);
|
|
|
}
|
|
|
- s5 = uploadImage.uploadImg(img5);
|
|
|
+ if (ObjectUtil.isNotEmpty(img3)) {
|
|
|
+ if (uploadImage.getImageCom(img3).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片3上传失败", false);
|
|
|
+ }
|
|
|
+ s3 = "," + uploadImage.uploadImg(img3);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(img4)) {
|
|
|
+ if (uploadImage.getImageCom(img4).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片4上传失败", false);
|
|
|
+ }
|
|
|
+ s4 = "," + uploadImage.uploadImg(img4);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(img5)) {
|
|
|
+ if (uploadImage.getImageCom(img5).equals("上传失败")) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return new Result(10001, "图片5上传失败", false);
|
|
|
+ }
|
|
|
+ s5 = "," + uploadImage.uploadImg(img5);
|
|
|
+ }
|
|
|
+ String s = s1 + s2 + s3 + s4 + s5;
|
|
|
+ billClean.setImgUrl(s);
|
|
|
+ dryMapper.updateById(billClean);
|
|
|
}
|
|
|
- String s = s1 + "," + s2 + "," + s3 + "," + s4 + "," + s5;
|
|
|
- billClean.setImgUrl(s);
|
|
|
- cleanMapper.updateById(billClean);
|
|
|
+
|
|
|
return new Result(10000, "提交成功!", true);
|
|
|
}
|
|
|
|