|
@@ -23,7 +23,9 @@ import java.io.IOException;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -57,6 +59,46 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
|
|
|
private BillCleanBeforeMapper billCleanBeforeMapper;
|
|
|
|
|
|
@Override
|
|
|
+ public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
+ String farmId = paramsMap.get("farmId");
|
|
|
+ String type = paramsMap.get("type");//展示类型
|
|
|
+ String pageNum = paramsMap.get("pageNum");
|
|
|
+ String pageSize = paramsMap.get("pageSize");
|
|
|
+ if ("".equals(pageNum) || null == pageNum) {
|
|
|
+ pageNum = "1";
|
|
|
+ }
|
|
|
+ if ("".equals(pageSize) || null == pageSize) {
|
|
|
+ pageSize = "20";
|
|
|
+ }
|
|
|
+ Page<BillSampling> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ QueryWrapper<BillSampling> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("farm_id", farmId).in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest)).orderByDesc("sub_date");
|
|
|
+ if ("0".equals(type)) {
|
|
|
+ queryWrapper.in("bill_status", 0, 1, 2, 3);
|
|
|
+ }
|
|
|
+ if ("1".equals(type)) {
|
|
|
+ queryWrapper.eq("bill_status", 0);
|
|
|
+ }
|
|
|
+ if ("2".equals(type)) {
|
|
|
+ queryWrapper.eq("bill_status", 1);
|
|
|
+ }
|
|
|
+ if ("3".equals(type)) {
|
|
|
+ queryWrapper.in("bill_status", 2, 3);
|
|
|
+ }
|
|
|
+ QueryWrapper<BillSampling> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id", farmId).in("test_location_id", TokenSign.getWorkIdByJwtToken(httpServletRequest)).orderByDesc("sub_date");
|
|
|
+ queryWrapper2.eq("bill_status", 0);
|
|
|
+ return new Result(ResultCode.SUCCESS, billSamplingMapper.selectPage(page, queryWrapper), billSamplingMapper.selectCount(queryWrapper2));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
+ String id = paramsMap.get("id");
|
|
|
+ BillSampling billPcr = billSamplingMapper.selectById(id);
|
|
|
+ return new Result(ResultCode.SUCCESS, billPcr);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public Result listPersonalSample(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
String farmId = paramsMap.get("farmId");
|
|
|
String pageNo = paramsMap.get("pageNum");
|
|
@@ -74,6 +116,8 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
|
|
|
return new Result(ResultCode.SUCCESS,billSamplingPage,count);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, MultipartFile img) throws ParseException, IOException {
|
|
|
String s = "";
|