wwh 2 年之前
父节点
当前提交
e9a36917e9

+ 4 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/controller/SysUserController.java

@@ -350,4 +350,8 @@ public class SysUserController {
        return iSysUserService.addImg(httpServletRequest, map);
 
     }
+    @GetMapping("/remove")
+    public Result remove(@RequestParam(value = "ids") List<Integer> ids) {
+        return iSysUserService.removeByIds(ids);
+    }
 }

+ 2 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/service/ISysUserService.java

@@ -56,4 +56,6 @@ public interface ISysUserService extends IService<SysUser> {
     Result updateUser(SysUser sysUser, Long userId);
 
     Result addImg(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
+
+    Result removeByIds(List<Integer> ids);
 }

+ 4 - 1
admin/src/main/java/com/huimv/farm/damsubsidy/service/impl/BillLandingInspectionServiceImpl.java

@@ -160,6 +160,9 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
         if (this.count(landingInspectionQueryWrapper) != 0) {
             return new Result(10001, "存在相同检疫证号!", false);
         }
+        if (billLandingInspection.getInspectionNum().length() != 10) {
+            return new Result(10001, "检疫证号应该为10位!", false);
+        }
         int total = Integer.parseInt(billLandingInspection.getAnimalNumberUp());
         int sum = 0;
         String eartags = billLandingInspection.getEartags();
@@ -277,7 +280,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
         String id = paramsMap.get("id");
         String rejectReason = paramsMap.get("rejectReason");
         BillLandingInspection billLandingInspection = this.getById(id);
-        billLandingInspection.setInspectionSch(5);
+        billLandingInspection.setInspectionSch(4);
         billLandingInspection.setRejectReason(rejectReason);
         billLandingInspection.setReviewed(TokenSign.getUserName(httpServletRequest));
         billLandingInspection.setReviewedTime(DateTime.now());

+ 10 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/service/impl/BillSubsidyServiceImpl.java

@@ -51,6 +51,8 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
     private BillSubsidyMapper subsidyMapper;
     @Autowired
     private SysUserMapper sysUserMapper;
+    @Autowired
+    private BaseAnimalMapper animalMapper;
 
     @Override
     public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
@@ -110,6 +112,14 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
             QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("id", id);
             BillSubsidy billSubsidy = subsidyMapper.selectOne(queryWrapper);
+            String inspectionNum = billSubsidy.getInspectionNum();
+            QueryWrapper<BaseAnimal> animalQueryWrapper = new QueryWrapper<>();
+            animalQueryWrapper.eq("inspection_num", inspectionNum);
+            List<BaseAnimal> baseAnimals = animalMapper.selectList(animalQueryWrapper);
+            for (BaseAnimal baseAnimal : baseAnimals) {
+                baseAnimal.setIsLoated(0);
+                animalMapper.updateById(baseAnimal);
+            }
             billSubsidy.setRefuseReason(refuseReason);
             billSubsidy.setSubsidySch(2);
             billSubsidy.setReviewedDepart("乡镇专干");

+ 6 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/service/impl/SysUserServiceImpl.java

@@ -150,6 +150,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         return new Result(ResultCode.SUCCESS, userMapper.selectById(id));
     }
 
+    @Override
+    public Result removeByIds(List<Integer> ids) {
+        this.removeByIds(ids);
+        return new Result(10000, "删除成功", true);
+    }
+
 
     @Transactional
     @Override