Przeglądaj źródła

小程序修改

wwh 1 rok temu
rodzic
commit
9e34d0c50f

+ 4 - 2
huimv-receive/src/main/java/com/huimv/receive/controller/BillLuggageController.java

@@ -31,7 +31,9 @@ public class BillLuggageController {
     private IBillLuggageService billLuggageService;
 
     @PostMapping("/addLuggage")
-    public Result addLuggage(HttpServletRequest httpServletRequest, @RequestParam("userName") String userName,
+    public Result addLuggage(HttpServletRequest httpServletRequest,
+                             @RequestParam("farmId") String farmId,
+                             @RequestParam("userName") String userName,
                              @RequestParam("phone") String phone,
                              @RequestParam("luggageDate") String luggageDate,
                              @RequestParam("luggageLocation") String luggageLocation,
@@ -42,7 +44,7 @@ public class BillLuggageController {
                              @RequestParam(value = "img3",required = false) MultipartFile img3,
                              @RequestParam(value = "img4",required = false) MultipartFile img4,
                              @RequestParam(value = "img5",required = false) MultipartFile img5) throws IOException {
-        return billLuggageService.addLuggage(httpServletRequest,userName,phone,luggageDate,luggageLocation,luggageLocationId,luggageNum,img,img2,img3,img4,img5);
+        return billLuggageService.addLuggage(httpServletRequest,farmId,userName,phone,luggageDate,luggageLocation,luggageLocationId,luggageNum,img,img2,img3,img4,img5);
     }
 
     @PostMapping("/listPersonalLuggage")

+ 8 - 0
huimv-receive/src/main/java/com/huimv/receive/controller/ExistController.java

@@ -1,6 +1,7 @@
 package com.huimv.receive.controller;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.common.utils.ResultCode;
@@ -49,6 +50,13 @@ public class ExistController {
         QueryWrapper<Exist> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("farm_id", farmId);
         Exist one = existService.getOne(queryWrapper);
+        if (ObjectUtil.isEmpty(one)) {
+            Exist exist = new Exist();
+            exist.setExist(0);
+            exist.setFarmId(farmId);
+            existService.save(exist);
+            return new Result(ResultCode.SUCCESS, exist);
+        }
         return new Result(ResultCode.SUCCESS,one);
     }
 }

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillGoodsInventory.java

@@ -64,5 +64,7 @@ public class BillGoodsInventory implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private Date createDate;
 
+    private String farmId;
+
 
 }

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BillLuggage.java

@@ -59,5 +59,7 @@ public class BillLuggage implements Serializable {
      */
     private String articlePicUrl;
 
+    private String farmId;
+
 
 }

+ 1 - 1
huimv-receive/src/main/java/com/huimv/receive/service/IBillLuggageService.java

@@ -20,7 +20,7 @@ import java.util.Map;
  */
 public interface IBillLuggageService extends IService<BillLuggage> {
 
-    Result addLuggage(HttpServletRequest httpServletRequest, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId, Integer luggageNum, MultipartFile img, MultipartFile img2, MultipartFile img3, MultipartFile img4, MultipartFile img5) throws IOException;
+    Result addLuggage(HttpServletRequest httpServletRequest,String farmId, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId, Integer luggageNum, MultipartFile img, MultipartFile img2, MultipartFile img3, MultipartFile img4, MultipartFile img5) throws IOException;
 
     Result listPersonalLuggage(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 

+ 2 - 1
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillGoodsInventoryServiceImpl.java

@@ -32,10 +32,11 @@ public class BillGoodsInventoryServiceImpl extends ServiceImpl<BillGoodsInventor
 
     @Override
     public Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String farmId = paramsMap.get("farmId");
         QueryWrapper<BillGoodsInventory> queryWrapper = new QueryWrapper<>();
         Calendar calendar = Calendar.getInstance();
         calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
-        queryWrapper.ge("create_date", calendar.getTime());
+        queryWrapper.ge("create_date", calendar.getTime()).eq("farm_id", farmId);
 //        queryWrapper.groupBy("create_date");
 //        queryWrapper.orderByAsc("create_date");
         List<BillGoodsInventoryVo> billGoodsInventoryVos = inventoryMapper.listAll(queryWrapper);

+ 6 - 2
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillLuggageServiceImpl.java

@@ -41,9 +41,10 @@ public class BillLuggageServiceImpl extends ServiceImpl<BillLuggageMapper, BillL
     private BillLuggageMapper billLuggageMapper;
 
     @Override
-    public Result addLuggage(HttpServletRequest httpServletRequest, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId,Integer luggageNum, MultipartFile img,MultipartFile img2,MultipartFile img3,MultipartFile img4,MultipartFile img5) throws IOException {
+    public Result addLuggage(HttpServletRequest httpServletRequest,String farmId, String userName, String phone, String luggageDate, String luggageLocation, String luggageLocationId,Integer luggageNum, MultipartFile img,MultipartFile img2,MultipartFile img3,MultipartFile img4,MultipartFile img5) throws IOException {
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         BillLuggage billLuggage = new BillLuggage();
+        billLuggage.setFarmId(farmId);
         billLuggage.setUserName(userName);
         billLuggage.setUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
         billLuggage.setPhone(phone);
@@ -66,8 +67,9 @@ public class BillLuggageServiceImpl extends ServiceImpl<BillLuggageMapper, BillL
     public Result listPersonalLuggage(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         String pageNo = paramsMap.get("pageNum");
         String pageSize = paramsMap.get("pageSize");
+        String farmId = paramsMap.get("farmId");
         Page<BillLuggage> page = new Page<>(Integer.parseInt(pageNo),Integer.parseInt(pageSize));
-        Page<BillLuggage> billLuggagePage = billLuggageMapper.selectPage(page, new QueryWrapper<BillLuggage>().eq("user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("luggage_date"));
+        Page<BillLuggage> billLuggagePage = billLuggageMapper.selectPage(page, new QueryWrapper<BillLuggage>().eq("user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).eq("farm_id",farmId).orderByDesc("luggage_date"));
         return new Result(ResultCode.SUCCESS,billLuggagePage,billLuggagePage.getSize());
     }
 
@@ -80,6 +82,7 @@ public class BillLuggageServiceImpl extends ServiceImpl<BillLuggageMapper, BillL
         }
         List<LuggageVo> luggageVos = null;
         QueryWrapper<BillLuggage> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("farm_id", farmId);
         if ("3".equals(type)) {
             Date timesMonthmorning = DataUill.getTimesMonthmorning();
             queryWrapper.ge("luggage_date", timesMonthmorning);
@@ -114,6 +117,7 @@ public class BillLuggageServiceImpl extends ServiceImpl<BillLuggageMapper, BillL
             endTime = LocalDateTime.now() + " 23:59:59";
         }
         QueryWrapper<BillLuggage> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("farm_id", farmId);
         if (StringUtils.isNotBlank(word)) {
             queryWrapper.and(i -> i.like( "phone", word)
                     .or().like("user_name", word));

+ 6 - 1
huimv-receive/src/main/java/com/huimv/receive/service/impl/BillPersonnelAdmissionServiceImpl.java

@@ -234,6 +234,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
                 good.setCurrentLocation(baseLocation1.getLocationName());
                 good.setCurrentLocationId(baseLocation1.getId());
                 good.setCreateDate(new Date());
+                good.setFarmId(farmId);
                 billGoodsInventoryMapper.insert(good);
             }
         }
@@ -650,7 +651,7 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         QueryWrapper<BillPcr> pcrQueryWrapper = new QueryWrapper<>();
         pcrQueryWrapper.eq("farm_id", farmId).ge("sub_date", firstday);
         QueryWrapper<BillGoodsInventory> goodsInventoryQueryWrapper = new QueryWrapper<>();
-        goodsInventoryQueryWrapper.ge("create_date", firstday);
+        goodsInventoryQueryWrapper.ge("create_date", firstday).eq("farm_id", farmId);
         JSONObject jsonObject = new JSONObject();
         Integer integer = pcrMapper.selectCount(pcrQueryWrapper);
         Integer integer1 = cleanMapper.selectCount(cleanQueryWrapper);
@@ -798,6 +799,10 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
         }
         BillPcr billPcr = pcrMapper.selectById(id);
 
+        if (billPcr.getPcrType() != 1) {
+            return new Result(10001, "pcr已通过或拒绝,无需再次复审", false);
+        }
+
         QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
         processQueryWrapper.eq("farm_id", farmId).eq("id", billPcr.getProcessId());
         BaseProcess baseProcess = processMapper.selectOne(processQueryWrapper);//进程