Quellcode durchsuchen

金猪售猪记录

523096025 vor 3 Jahren
Ursprung
Commit
8b2fdaf686

+ 9 - 2
huimv-goldpig/huimv-goldpig-eartag/src/main/java/com/huimv/eartag/controller/BizInspectionPhotoController.java

@@ -29,7 +29,7 @@ public class BizInspectionPhotoController {
     private IBizInspectionPhotoService bizInspectionPhotoService;
 
     @PostMapping("/addInspection")
-    public Result addInspection( HttpServletRequest request, @RequestParam(name = "failes",required = false) MultipartFile[] files,
+    public Result addInspection( HttpServletRequest request, @RequestParam(name = "files",required = false) MultipartFile[] files,
                                  @RequestParam(name ="farmId") String farmId,
                                  @RequestParam(name ="batchNo") String batchNo,
                                  @RequestParam(name = "inspecStatus") Integer inspecStatus,
@@ -42,7 +42,7 @@ public class BizInspectionPhotoController {
     }
 
     @PostMapping("/addBatch")
-    public Result addBatch( HttpServletRequest request, @RequestParam(name = "failes",required = false) MultipartFile[] files,
+    public Result addBatch( HttpServletRequest request, @RequestParam(name = "files",required = false) MultipartFile[] files,
                             @RequestParam(name ="farmId") String farmId,
                             @RequestParam(name ="batchNo") String batchNo,
                             @RequestParam(name = "inspecStatus") Integer inspecStatus,
@@ -54,4 +54,11 @@ public class BizInspectionPhotoController {
 
     }
 
+    @PostMapping("/listPic")
+    public Result listPic(@RequestBody Map<String,String> map){
+
+        return bizInspectionPhotoService.listPic(map);
+
+    }
+
 }

+ 2 - 0
huimv-goldpig/huimv-goldpig-eartag/src/main/java/com/huimv/eartag/service/IBizInspectionPhotoService.java

@@ -22,4 +22,6 @@ public interface IBizInspectionPhotoService extends IService<BizInspectionPhoto>
     Result addInspection(HttpServletRequest request, MultipartFile[] files, String farmId,String batchNo,Integer inspecStatus,String inspecRremark,Integer inspecRealNum);
 
     Result addBatch(HttpServletRequest request, MultipartFile[] files, String farmId,String batchNo,Integer inspecStatus,String inspecRremark,Integer inspecRealNum);
+
+    Result listPic(Map<String,String> map);
 }

+ 9 - 1
huimv-goldpig/huimv-goldpig-eartag/src/main/java/com/huimv/eartag/service/impl/BizInspectionPhotoServiceImpl.java

@@ -94,7 +94,6 @@ public class BizInspectionPhotoServiceImpl extends ServiceImpl<BizInspectionPhot
         UpdateWrapper<EartagRegisterEntity> updateWrapper =new UpdateWrapper<>();
         updateWrapper.in("eartag_no", eartagNos);
         eartagRegisterMapper.update(eartagRegisterEntity,updateWrapper);
-
         if (ObjectUtil.isNotEmpty(files)) {
 
             //图片存储
@@ -174,4 +173,13 @@ public class BizInspectionPhotoServiceImpl extends ServiceImpl<BizInspectionPhot
 
         return new Result(ResultCode.SUCCESS,"上传成功");
     }
+
+    @Override
+    public Result listPic(Map<String,String> map) {
+        String batchNo = map.get("batchNo");
+        String types = map.get("types");
+        String[] split = types.split(",");
+        List<BizInspectionPhoto> list = this.list(new QueryWrapper<BizInspectionPhoto>().eq("batch_no", batchNo).in("photo_type", split));
+        return new Result(ResultCode.SUCCESS,list);
+    }
 }

+ 4 - 9
huimv-goldpig/huimv-goldpig-eartag/src/main/java/com/huimv/eartag/service/impl/BizSellPigApplyServiceImpl.java

@@ -216,13 +216,12 @@ public class BizSellPigApplyServiceImpl extends ServiceImpl<BizSellPigApplyMappe
         InspecVo inspecVo = new InspecVo();
         QueryWrapper<BizSellPigApply> wrapper = new QueryWrapper<>();
         wrapper.eq("inspec_org_id",farmId);
-        wrapper.in("inspec_flow_status",0,1);
         inspecVo.setInspecNum(this.count(wrapper));
 
 
         wrapper.clear();
         wrapper.eq("inspec_org_id",farmId);
-        wrapper.eq("inspec_flow_status",1);
+        wrapper.eq("inspec_flow_status",0);
         int count = this.count(wrapper);
         inspecVo.setAccomplishNum(count);
 
@@ -230,7 +229,7 @@ public class BizSellPigApplyServiceImpl extends ServiceImpl<BizSellPigApplyMappe
 
         wrapper.clear();
         wrapper.eq("inspec_org_id",farmId);
-        wrapper.eq("inspec_flow_status",1);
+        wrapper.in("inspec_flow_status",1,2);
         int count2 = this.count(wrapper);
 
 
@@ -269,20 +268,16 @@ public class BizSellPigApplyServiceImpl extends ServiceImpl<BizSellPigApplyMappe
         }
         //合格
        else if ("2".equals(type)){
-            wrapper.eq("inspec_flow_status",1);
+            wrapper.in("inspec_flow_status",1,2);
             wrapper.ne("record_status",4);
         }
 
         //不合格
        else if ("3".equals(type)){
-            wrapper.eq("inspec_flow_status",1);
+            wrapper.in("inspec_flow_status",1,2);
             wrapper.eq("record_status",4);
         }
        //全部
-       else {
-          wrapper.in("inspec_flow_status",0,1);
-        }
-
 
 
         Page<BizSellPigApply> page = this.page(bizSellPigApplyPage, wrapper);