guoyujia 9 months ago
parent
commit
483cfb4c91

+ 10 - 3
src/main/java/cn/ezhizao/project/business/taksStockLot/controller/BizTaksStockLotController.java

@@ -94,8 +94,11 @@ public class BizTaksStockLotController extends BaseController
             return error("该载具绑定的批次未在此次盘点内!");
         }
         List<BizTaksStockLot> list = taksStockLotsList.stream()
-                .filter(item -> needQueryDayworkIds.contains(item.getDayworkId()))
+                .filter(item -> needQueryDayworkIds.contains(item.getDayworkId()) && item.getIsWaste() == 0)
                 .collect(Collectors.toList());
+        if(list.isEmpty()) {
+            return error("该载具绑定的批次已批废");
+        }
         return success(list);
     }
 
@@ -142,11 +145,15 @@ public class BizTaksStockLotController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody List<BizTaksStockLot> bizTaksStockLot) throws NoSuchFieldException, IllegalAccessException
     {
-        bizTaksStockLot.forEach(item -> {
+        List<BizTaksStockLot> collect = bizTaksStockLot.stream().filter(item -> item.getFlag() != false).collect(Collectors.toList());
+        collect.forEach(item -> {
             item.setIsTaksStock(1);
             item.setFirstUpdateId(SecurityUtils.getLoginUser().getUserId());
         });
-        return toAjax(bizTaksStockLotService.updateBatchById(bizTaksStockLot));
+        if(!collect.isEmpty()) {
+            return toAjax(bizTaksStockLotService.updateBatchById(collect));
+        }
+        return success();
     }
 
     /**

+ 4 - 0
src/main/java/cn/ezhizao/project/business/taksStockLot/domain/BizTaksStockLot.java

@@ -118,5 +118,9 @@ public class BizTaksStockLot extends BaseEntity
     private String carrierCode;
     private String processAlias;
     private Long firstUpdateId;
+    @TableField(exist = false)
+    private Boolean flag;
+    private Integer isWaste;
+    private Long fromId;
 
 }

+ 1 - 0
src/main/resources/mybatis/business/taksStockLot/BizTaksStockLotMapper.xml

@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from biz_taks_stock_lot t1
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0 and t1.dept_id = #{deptId} and t1.take_stock_period_id = #{takeStockPeriodId} and t1.daywork_id != 0
+            and t1.is_waste = 0
             <if test="keywords != null  and keywords != ''"> AND t1.lot_code LIKE CONCAT('%',#{keywords},'%')
 <!--                OR-->
 <!--                t1.daywork_id in (select daywork_id from-->