wwh 1 سال پیش
والد
کامیت
a93016c783

+ 9 - 0
huimv-receive/src/main/java/com/huimv/receive/controller/BillSamplingController.java

@@ -29,6 +29,15 @@ public class BillSamplingController {
     @Autowired
     private IBillSamplingService billSamplingService;
 
+    @RequestMapping("/listSampling")
+    public Result listSampling(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        return billSamplingService.list(httpServletRequest, paramsMap);
+    }
+    @RequestMapping("/listById")
+    public Result listById(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        return billSamplingService.listById(httpServletRequest, paramsMap);
+    }
+
     @PostMapping("/listPersonalSample")
     public Result listPersonalSample(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap){
         return billSamplingService.listPersonalSample(httpServletRequest,paramsMap);

+ 4 - 0
huimv-receive/src/main/java/com/huimv/receive/service/IBillSamplingService.java

@@ -20,6 +20,10 @@ import java.util.Map;
  */
 public interface IBillSamplingService extends IService<BillSampling> {
 
+    Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
+
+    Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
+
     Result listPersonalSample(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
     Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date,

+ 44 - 0
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillSamplingServiceImpl.java

@@ -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 = "";