Browse Source

获取今日领料手持机

home 2 years ago
parent
commit
000c931698

+ 32 - 33
hx-service/storage-restructure/src/main/java/com/fjhx/service/flow/InitiateApplyFlowService.java

@@ -26,37 +26,36 @@ public class InitiateApplyFlowService {
     @Autowired
     @Autowired
     private ApplyPurchaseDetailsService applyPurchaseDetailsService;
     private ApplyPurchaseDetailsService applyPurchaseDetailsService;
 
 
-    private FlowConstructor getFlowConstructor() {
-        return FlowConstructor.init(new ExampleAbstract() {
-
-            @Override
-            public String getCode() {
-                return "js_initiateApply";
-            }
-
-            @Override
-            public void end() {
-                ApplyPurchaseVo applyVo = getCacheData(ApplyPurchaseVo.class);
-                applyVo.setFlowStatus(FlowStatusEnum.ADOPT.getType());
-                applyPurchaseService.updateById(applyVo);
-            }
-
-            @Override
-            public void adopt() {
-                ApplyPurchaseVo applyVo = getCacheData(ApplyPurchaseVo.class);
-                applyVo.setFlowStatus(FlowStatusEnum.UNDER_WAY.getType());
-                applyPurchaseService.updateById(applyVo);
-            }
-
-            @Override
-            public void reject() {
-                ApplyPurchaseVo applyVo = getCacheData(ApplyPurchaseVo.class);
-                applyVo.setFlowStatus(FlowStatusEnum.REJECT.getType());
-                applyPurchaseService.updateById(applyVo);
-            }
-
-        });
-    }
+    private final FlowConstructor flowConstructor = FlowConstructor.init(new ExampleAbstract() {
+
+        @Override
+        public String getCode() {
+            return "js_initiateApply";
+        }
+
+        @Override
+        public void end() {
+            ApplyPurchaseVo applyVo = getCacheData(ApplyPurchaseVo.class);
+            applyVo.setFlowStatus(FlowStatusEnum.ADOPT.getType());
+            applyPurchaseService.updateById(applyVo);
+        }
+
+        @Override
+        public void adopt() {
+            ApplyPurchaseVo applyVo = getCacheData(ApplyPurchaseVo.class);
+            applyVo.setFlowStatus(FlowStatusEnum.UNDER_WAY.getType());
+            applyPurchaseService.updateById(applyVo);
+        }
+
+        @Override
+        public void reject() {
+            ApplyPurchaseVo applyVo = getCacheData(ApplyPurchaseVo.class);
+            applyVo.setFlowStatus(FlowStatusEnum.REJECT.getType());
+            applyPurchaseService.updateById(applyVo);
+        }
+
+    });
+
 
 
     public void create(ApplyPurchaseVo applyPurchaseVo) {
     public void create(ApplyPurchaseVo applyPurchaseVo) {
 
 
@@ -73,11 +72,11 @@ public class InitiateApplyFlowService {
         applyDetailsList.forEach(item -> item.setApplyPurchaseId(id));
         applyDetailsList.forEach(item -> item.setApplyPurchaseId(id));
         applyPurchaseDetailsService.saveBatch(applyDetailsList);
         applyPurchaseDetailsService.saveBatch(applyDetailsList);
 
 
-        getFlowConstructor().create(id, "发起申购", applyPurchaseVo.getRemark(), applyPurchaseVo);
+        flowConstructor.create(id, "发起申购", applyPurchaseVo.getRemark(), applyPurchaseVo);
     }
     }
 
 
     public void jump(JumpVo jumpVo) {
     public void jump(JumpVo jumpVo) {
-        getFlowConstructor().jump(jumpVo);
+        flowConstructor.jump(jumpVo);
     }
     }
 
 
 }
 }

+ 13 - 15
hx-service/storage-restructure/src/main/java/com/fjhx/service/flow/MaterialUpdateFlowService.java

@@ -17,29 +17,27 @@ public class MaterialUpdateFlowService {
     @Autowired
     @Autowired
     private MaterialService materialService;
     private MaterialService materialService;
 
 
-    private FlowConstructor getFlowConstructor() {
-        return FlowConstructor.init(new ExampleAbstract() {
+    private final FlowConstructor flowConstructor = FlowConstructor.init(new ExampleAbstract() {
 
 
-            @Override
-            public String getCode() {
-                return "js_materialCode";
-            }
+        @Override
+        public String getCode() {
+            return "js_materialCode";
+        }
 
 
-            @Override
-            public void end() {
-                Material material = getCacheData(Material.class);
-                materialService.updateById(material);
-            }
+        @Override
+        public void end() {
+            Material material = getCacheData(Material.class);
+            materialService.updateById(material);
+        }
 
 
-        });
-    }
+    });
 
 
     public void create(Material material) {
     public void create(Material material) {
-        getFlowConstructor().create(material.getId(), "物料修改", "", material);
+        flowConstructor.create(material.getId(), "物料修改", "", material);
     }
     }
 
 
     public void jump(JumpVo jumpVo) {
     public void jump(JumpVo jumpVo) {
-        getFlowConstructor().jump(jumpVo);
+        flowConstructor.jump(jumpVo);
     }
     }
 
 
 }
 }

+ 29 - 32
hx-service/storage-restructure/src/main/java/com/fjhx/service/flow/SupplierPriceUpdateFlow.java

@@ -23,43 +23,40 @@ public class SupplierPriceUpdateFlow {
     @Autowired
     @Autowired
     private SupplierPriceChangeService supplierPriceChangeService;
     private SupplierPriceChangeService supplierPriceChangeService;
 
 
-    private FlowConstructor getFlowConstructor() {
-        return FlowConstructor.init(new ExampleAbstract() {
-
-            @Override
-            public String getCode() {
-                return "js_supplierPriceUpdate";
-            }
-
-            @Override
-            public void end() {
-
-                SupplierPriceVo supplierPriceVo = getCacheData(SupplierPriceVo.class);
-
-                // 添加价格变更记录
-                SupplierPrice supplierPrice = supplierPriceService.getById(supplierPriceVo.getId());
-                SupplierPriceChange supplierPriceChange = new SupplierPriceChange();
-                supplierPriceChange.setSupplierPriceId(supplierPrice.getId());
-                supplierPriceChange.setSupplierId(supplierPrice.getSupplierId());
-                supplierPriceChange.setMaterialId(supplierPrice.getMaterialId());
-                supplierPriceChange.setOldPrice(supplierPrice.getPrice());
-                supplierPriceChange.setNewPrice(supplierPriceVo.getPrice());
-                supplierPriceChange.setRemark(supplierPriceVo.getRemarks());
-                supplierPriceChangeService.save(supplierPriceChange);
-
-                // 变更价格
-                supplierPriceService.updateById(supplierPriceVo);
-            }
-
-        });
-    }
+    private final FlowConstructor flowConstructor = FlowConstructor.init(new ExampleAbstract() {
+
+        @Override
+        public String getCode() {
+            return "js_supplierPriceUpdate";
+        }
+
+        @Override
+        public void end() {
+            SupplierPriceVo supplierPriceVo = getCacheData(SupplierPriceVo.class);
+
+            // 添加价格变更记录
+            SupplierPrice supplierPrice = supplierPriceService.getById(supplierPriceVo.getId());
+            SupplierPriceChange supplierPriceChange = new SupplierPriceChange();
+            supplierPriceChange.setSupplierPriceId(supplierPrice.getId());
+            supplierPriceChange.setSupplierId(supplierPrice.getSupplierId());
+            supplierPriceChange.setMaterialId(supplierPrice.getMaterialId());
+            supplierPriceChange.setOldPrice(supplierPrice.getPrice());
+            supplierPriceChange.setNewPrice(supplierPriceVo.getPrice());
+            supplierPriceChange.setRemark(supplierPriceVo.getRemarks());
+            supplierPriceChangeService.save(supplierPriceChange);
+
+            // 变更价格
+            supplierPriceService.updateById(supplierPriceVo);
+        }
+
+    });
 
 
     public void create(SupplierPriceVo supplierPriceVo) {
     public void create(SupplierPriceVo supplierPriceVo) {
-        getFlowConstructor().create(supplierPriceVo.getId(), "价格维护", supplierPriceVo.getRemarks(), supplierPriceVo);
+        flowConstructor.create(supplierPriceVo.getId(), "价格维护", supplierPriceVo.getRemarks(), supplierPriceVo);
     }
     }
 
 
     public void jump(JumpVo jumpVo) {
     public void jump(JumpVo jumpVo) {
-        getFlowConstructor().jump(jumpVo);
+        flowConstructor.jump(jumpVo);
     }
     }
 
 
 }
 }

+ 9 - 0
hx-service/storage/src/main/java/com/fjhx/stock/controller/StockBackController.java

@@ -47,6 +47,15 @@ public class StockBackController {
     }
     }
 
 
     /**
     /**
+     * 获取今日领料
+     */
+    @PostMapping("/getPickingTodayByUserId")
+    public R getPickingTodayByUserId(@RequestBody Map<String, String> condition) {
+        List<Map<String, Object>> result = stockBackService.getPickingTodayByUserId(condition);
+        return R.success(result);
+    }
+
+    /**
      * 提交退料
      * 提交退料
      */
      */
     @PostMapping("/submitBack")
     @PostMapping("/submitBack")

+ 5 - 0
hx-service/storage/src/main/java/com/fjhx/stock/mapper/StockBackMapper.java

@@ -27,6 +27,9 @@ public interface StockBackMapper extends BaseMapper<StockBack> {
     List<Map<String, Object>> getPickingToday(@Param("ew") QueryWrapper<Object> wrapper);
     List<Map<String, Object>> getPickingToday(@Param("ew") QueryWrapper<Object> wrapper);
 
 
     @TenantIgnore
     @TenantIgnore
+    List<Map<String, Object>> getPickingTodayByUserId(@Param("ew") QueryWrapper<Object> wrapper);
+
+    @TenantIgnore
     List<Map<String, Object>> checkList();
     List<Map<String, Object>> checkList();
 
 
     @InterceptorIgnore(tenantLine = "1")
     @InterceptorIgnore(tenantLine = "1")
@@ -76,4 +79,6 @@ public interface StockBackMapper extends BaseMapper<StockBack> {
 
 
     @TenantIgnore
     @TenantIgnore
     Page<Map<String, Object>> getBackPage(@Param("page") Page<StockBack> page, @Param("ew") QueryWrapper<Object> backWrapper);
     Page<Map<String, Object>> getBackPage(@Param("page") Page<StockBack> page, @Param("ew") QueryWrapper<Object> backWrapper);
+
+
 }
 }

+ 10 - 0
hx-service/storage/src/main/java/com/fjhx/stock/mapper/StockBackMapper.xml

@@ -12,6 +12,16 @@
             ${ew.customSqlSegment}
             ${ew.customSqlSegment}
     </select>
     </select>
 
 
+
+    <select id="getPickingTodayByUserId" resultType="java.util.Map">
+        select m.ID   materialId,
+               m.code materialCode,
+               m.name materialName
+        from stock_waterdetial swd
+                 left join material m on m.Code = swd.MaterialCode
+            ${ew.customSqlSegment}
+    </select>
+
     <select id="checkList" resultType="java.util.Map">
     <select id="checkList" resultType="java.util.Map">
         select sb.id               stockBackId,
         select sb.id               stockBackId,
                sb.operation_num    operationNum,
                sb.operation_num    operationNum,

+ 4 - 0
hx-service/storage/src/main/java/com/fjhx/stock/service/StockBackService.java

@@ -32,6 +32,8 @@ public interface StockBackService extends BaseService<StockBack> {
 
 
     List<Map<String, Object>> getPickingToday(Map<String, String> condition);
     List<Map<String, Object>> getPickingToday(Map<String, String> condition);
 
 
+    List<Map<String, Object>> getPickingTodayByUserId(Map<String, String> condition);
+
     void submitBack(SubmitBackVo submitBackVo);
     void submitBack(SubmitBackVo submitBackVo);
 
 
     List<Map<String, Object>> checkList();
     List<Map<String, Object>> checkList();
@@ -52,4 +54,6 @@ public interface StockBackService extends BaseService<StockBack> {
 
 
     Page<Map<String, Object>> getBackPage(Map<String, String> condition);
     Page<Map<String, Object>> getBackPage(Map<String, String> condition);
 
 
+
+
 }
 }

+ 16 - 1
hx-service/storage/src/main/java/com/fjhx/stock/service/impl/StockBackServiceImpl.java

@@ -95,6 +95,22 @@ public class StockBackServiceImpl extends ServiceImpl<StockBackMapper, StockBack
         return baseMapper.getPickingToday(wrapper);
         return baseMapper.getPickingToday(wrapper);
     }
     }
 
 
+    @Override
+    public List<Map<String, Object>> getPickingTodayByUserId(Map<String, String> condition) {
+        String userId = condition.get("userId");
+        Assert.notEmpty(userId, "用户id不能为空");
+
+        Date date = new Date();
+
+        QueryWrapper<Object> wrapper = Wrappers.query()
+                .eq("swd.OperUserId", userId)
+                .in("swd.StockChangeType", 20, 23)
+                .between("swd.CreatedTime", DateUtil.beginOfDay(date), DateUtil.endOfDay(date))
+                .groupBy("m.id");
+
+        return baseMapper.getPickingTodayByUserId(wrapper);
+    }
+
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @Override
     @Override
     public void submitBack(SubmitBackVo submitBackVo) {
     public void submitBack(SubmitBackVo submitBackVo) {
@@ -307,7 +323,6 @@ public class StockBackServiceImpl extends ServiceImpl<StockBackMapper, StockBack
             result.setBackArea(result.getBackArea().add(item.getBackArea()));
             result.setBackArea(result.getBackArea().add(item.getBackArea()));
         }
         }
 
 
-
         return result;
         return result;
     }
     }