|
@@ -7,10 +7,9 @@ import com.huimv.admin.common.token.TokenSign;
|
|
import com.huimv.admin.common.utils.*;
|
|
import com.huimv.admin.common.utils.*;
|
|
import com.huimv.admin.entity.*;
|
|
import com.huimv.admin.entity.*;
|
|
import com.huimv.admin.entity.vo.CleanAndDryVo;
|
|
import com.huimv.admin.entity.vo.CleanAndDryVo;
|
|
|
|
+import com.huimv.admin.entity.vo.CleanAndDryVo2;
|
|
import com.huimv.admin.mapper.*;
|
|
import com.huimv.admin.mapper.*;
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
-import com.huimv.admin.common.token.TokenSign;
|
|
|
|
import com.huimv.admin.common.utils.Result;
|
|
import com.huimv.admin.common.utils.Result;
|
|
import com.huimv.admin.common.utils.ResultCode;
|
|
import com.huimv.admin.common.utils.ResultCode;
|
|
import com.huimv.admin.entity.BillClean;
|
|
import com.huimv.admin.entity.BillClean;
|
|
@@ -30,8 +29,6 @@ import java.util.Date;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -56,6 +53,8 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
private BaseLocationMapper locationMapper;
|
|
private BaseLocationMapper locationMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private UploadImage uploadImage;
|
|
private UploadImage uploadImage;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BillDryMapper dryMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
@@ -76,20 +75,39 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
if ("".equals(data) || null == data) {
|
|
if ("".equals(data) || null == data) {
|
|
data = "0";
|
|
data = "0";
|
|
}
|
|
}
|
|
- 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));
|
|
|
|
- if ("0".equals(data)) {
|
|
|
|
- queryWrapper.in("bill_status", 0, 1, 2);
|
|
|
|
- }
|
|
|
|
- if ("1".equals(data)) {
|
|
|
|
- queryWrapper.eq("bill_status", 0);
|
|
|
|
- }
|
|
|
|
- if ("2".equals(data)) {
|
|
|
|
- queryWrapper.eq("bill_status", 1);
|
|
|
|
|
|
+ if (type.equals("0")) {
|
|
|
|
+ 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));
|
|
|
|
+
|
|
|
|
+ if ("0".equals(data)) {
|
|
|
|
+ queryWrapper.in("bill_status", 0, 1, 2);
|
|
|
|
+ }
|
|
|
|
+ if ("1".equals(data)) {
|
|
|
|
+ queryWrapper.eq("bill_status", 0);
|
|
|
|
+ }
|
|
|
|
+ if ("2".equals(data)) {
|
|
|
|
+ queryWrapper.eq("bill_status", 1);
|
|
|
|
+ }
|
|
|
|
+ return new Result(ResultCode.SUCCESS, cleanMapper.selectPage(page, queryWrapper));
|
|
|
|
+ } else {
|
|
|
|
+ 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");
|
|
|
|
+ }
|
|
|
|
+ if ("1".equals(data)) {
|
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "0");
|
|
|
|
+ }
|
|
|
|
+ if ("2".equals(data)) {
|
|
|
|
+ cleanAndDryVo2Page = cleanMapper.CleanAndDry(page, farmId, type, "1");
|
|
|
|
+ }
|
|
|
|
+ return new Result(ResultCode.SUCCESS, cleanAndDryVo2Page);
|
|
}
|
|
}
|
|
- return new Result(ResultCode.SUCCESS, cleanMapper.selectPage(page,queryWrapper));
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -100,6 +118,12 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public Result listByIdDry(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
|
+ String id = paramsMap.get("id");
|
|
|
|
+ return new Result(ResultCode.SUCCESS, dryMapper.selectById(id));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public Result commitClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
public Result commitClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) throws ParseException {
|
|
String result = paramsMap.get("result");// 结果
|
|
String result = paramsMap.get("result");// 结果
|
|
String farmId = paramsMap.get("farmId");
|
|
String farmId = paramsMap.get("farmId");
|
|
@@ -213,7 +237,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
|
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() );
|
|
|
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
|
|
baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
|
|
String status = baseProcess.getCurrentStatus();
|
|
String status = baseProcess.getCurrentStatus();
|
|
String substring = status.substring(0, status.length() - 1);
|
|
String substring = status.substring(0, status.length() - 1);
|
|
@@ -224,6 +248,7 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
private BillCleanMapper billCleanMapper;
|
|
private BillCleanMapper billCleanMapper;
|
|
|
|
|
|
@@ -231,19 +256,21 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
public Result listPersonalClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result listPersonalClean(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
String pageNo = paramsMap.get("pageNum");
|
|
String pageNo = paramsMap.get("pageNum");
|
|
String pageSize = paramsMap.get("pageSize");
|
|
String pageSize = paramsMap.get("pageSize");
|
|
- Page<BillClean> page = new Page<>(Integer.parseInt(pageNo),Integer.parseInt(pageSize));
|
|
|
|
- return new Result(ResultCode.SUCCESS,billCleanMapper.selectPage(page,new QueryWrapper<BillClean>().eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).eq("img_status",1).orderByDesc("sub_date")));
|
|
|
|
|
|
+ Page<BillClean> page = new Page<>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
|
|
|
|
+ return new Result(ResultCode.SUCCESS, billCleanMapper.selectPage(page, new QueryWrapper<BillClean>().eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).eq("img_status", 1).orderByDesc("sub_date")));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result carClean(HttpServletRequest httpServletRequest, String farmId, String id, String data, MultipartFile img) throws ParseException, IOException {
|
|
|
|
|
|
+ public Result carClean(HttpServletRequest httpServletRequest, String farmId, String id, String data, MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile img4, MultipartFile img5) throws ParseException, IOException {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
if (StringUtils.isBlank(data)) {
|
|
if (StringUtils.isBlank(data)) {
|
|
data = sdf.format(new Date());
|
|
data = sdf.format(new Date());
|
|
}
|
|
}
|
|
BillClean billClean = cleanMapper.selectById(id);//某条洗消记录
|
|
BillClean billClean = cleanMapper.selectById(id);//某条洗消记录
|
|
|
|
+ System.out.println("洗消记录的id:" + billClean.getTestLocationId());
|
|
|
|
+ Integer testId = billClean.getTestLocationId();
|
|
QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
|
|
- locationQueryWrapper.eq("farm_id", farmId).eq("id", billClean.getTestLocationId());
|
|
|
|
|
|
+ locationQueryWrapper.eq("farm_id", farmId).eq("id", testId);
|
|
BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前所在的位置
|
|
BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前所在的位置
|
|
|
|
|
|
QueryWrapper<BaseProcess> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<BaseProcess> queryWrapper = new QueryWrapper<>();
|
|
@@ -258,15 +285,48 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
billClean.setTestLocationId(baseLocation.getId());
|
|
billClean.setTestLocationId(baseLocation.getId());
|
|
billClean.setCheckDate(sdf.parse(data));
|
|
billClean.setCheckDate(sdf.parse(data));
|
|
billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
billClean.setPassDate(sdf.parse(sdf.format(new Date())));
|
|
- if (ObjectUtil.isNotEmpty(img)) {
|
|
|
|
- if (uploadImage.getImageCom(img).equals("上传失败")) {
|
|
|
|
|
|
+ String s1 = "";
|
|
|
|
+ String s2 = "";
|
|
|
|
+ String s3 = "";
|
|
|
|
+ String s4 = "";
|
|
|
|
+ String s5 = "";
|
|
|
|
+ if (ObjectUtil.isNotEmpty(img1)) {
|
|
|
|
+ if (uploadImage.getImageCom(img1).equals("上传失败")) {
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
- return new Result(10001, "图片上传失败", false);
|
|
|
|
|
|
+ return new Result(10001, "图片1上传失败", false);
|
|
}
|
|
}
|
|
- billClean.setImgUrl(uploadImage.getImageCom(img));
|
|
|
|
- } else {
|
|
|
|
- return new Result(10001, "图片不能为空", 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);
|
|
|
|
+ }
|
|
|
|
+ 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);
|
|
cleanMapper.updateById(billClean);
|
|
cleanMapper.updateById(billClean);
|
|
return new Result(10000, "提交成功!", true);
|
|
return new Result(10000, "提交成功!", true);
|
|
}
|
|
}
|
|
@@ -276,33 +336,34 @@ public class BillCleanServiceImpl extends ServiceImpl<BillCleanMapper, BillClean
|
|
String type = paramsMap.get("type");
|
|
String type = paramsMap.get("type");
|
|
String pageNo = paramsMap.get("pageNum");
|
|
String pageNo = paramsMap.get("pageNum");
|
|
String pageSize = paramsMap.get("pageSize");
|
|
String pageSize = paramsMap.get("pageSize");
|
|
- Page<CleanAndDryVo> page = new Page<>(Integer.parseInt(pageNo),Integer.parseInt(pageSize));
|
|
|
|
|
|
+ Page<CleanAndDryVo> page = new Page<>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
|
|
Page<CleanAndDryVo> cleanAndDryVoPage;
|
|
Page<CleanAndDryVo> cleanAndDryVoPage;
|
|
- switch (type){
|
|
|
|
|
|
+ switch (type) {
|
|
case "1":
|
|
case "1":
|
|
- cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page,Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)),0);
|
|
|
|
|
|
+ cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page, Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)), 0);
|
|
break;
|
|
break;
|
|
case "2":
|
|
case "2":
|
|
- cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page,Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)),1);
|
|
|
|
|
|
+ cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page, Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)), 1);
|
|
break;
|
|
break;
|
|
case "3":
|
|
case "3":
|
|
- cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page,Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)),2);
|
|
|
|
|
|
+ cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page, Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)), 2);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page,Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)));
|
|
|
|
|
|
+ cleanAndDryVoPage = billCleanMapper.listCleanAndDry(page, Integer.parseInt(TokenSign.getFarmIds(httpServletRequest)));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- return new Result(ResultCode.SUCCESS,cleanAndDryVoPage);
|
|
|
|
|
|
+ return new Result(ResultCode.SUCCESS, cleanAndDryVoPage);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result listPersonalCleanAndDry(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result listPersonalCleanAndDry(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
String pageNo = paramsMap.get("pageNum");
|
|
String pageNo = paramsMap.get("pageNum");
|
|
String pageSize = paramsMap.get("pageSize");
|
|
String pageSize = paramsMap.get("pageSize");
|
|
- Page<CleanAndDryVo> page = new Page<>(Integer.parseInt(pageNo),Integer.parseInt(pageSize));
|
|
|
|
|
|
+ Page<CleanAndDryVo> page = new Page<>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
|
|
Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
|
|
Integer userId = TokenSign.getMemberIdByJwtToken(httpServletRequest);
|
|
- Page<CleanAndDryVo> cleanAndDryVoPage = cleanMapper.listPersonalCleanAndDry(page,userId);
|
|
|
|
- return new Result(ResultCode.SUCCESS,cleanAndDryVoPage);
|
|
|
|
|
|
+ Page<CleanAndDryVo> cleanAndDryVoPage = cleanMapper.listPersonalCleanAndDry(page, userId);
|
|
|
|
+ return new Result(ResultCode.SUCCESS, cleanAndDryVoPage);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|