laoyao преди 3 години
родител
ревизия
eb6668cb3b

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/TaskNodeService.java

@@ -123,5 +123,7 @@ public interface TaskNodeService extends SuperService<TaskNode> {
 
     R<String> handModeStockOut(Map conMap);
 
+    R<String> handModeStockIn(Map conMap);
+
 
 }

+ 3 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/WorkpieceService.java

@@ -45,4 +45,7 @@ public interface WorkpieceService extends SuperService<TWorkpiece> {
     public String lock(Map map);
 
 
+    public String add(Map map);
+
+
 }

+ 38 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -1551,6 +1551,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
     public R<String> handModeStockOut(Map conMap) {
         String pointId = conMap.get("pointId")==null?"":conMap.get("pointId").toString();
         String category = conMap.get("category")==null?"":conMap.get("category").toString();
+        String goodsId = conMap.get("goodsId")==null?"":conMap.get("goodsId").toString();
         Map queryMap = new HashMap();
         queryMap.put("pointId", pointId);
         List<ProductionresourcePosition> list = productionresourcePositionMapper.getPPList(queryMap);
@@ -1558,9 +1559,9 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         R<String> result = R.success("");
 
         for(ProductionresourcePosition p:list){
-            if(!category.equals(p.getCategory())){
+            String stockGoodsId = p.getGoodsId()==null?"":p.getGoodsId().toString();
+            if(!goodsId.equals(stockGoodsId))
                 continue;
-            }
 
             if("1".equals(p.getCategory())||"2".equals(p.getCategory())){//托盘夹具
                 BomProcedureTray tray = new BomProcedureTray();
@@ -1579,4 +1580,39 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         }
         return result;
     }
+
+
+    @Override
+    public R<String> handModeStockIn(Map conMap) {
+        String pointId = conMap.get("pointId")==null?"":conMap.get("pointId").toString();
+        String category = conMap.get("category")==null?"":conMap.get("category").toString();
+        String goodsId = conMap.get("goodsId")==null?"":conMap.get("goodsId").toString();
+        Map queryMap = new HashMap();
+        queryMap.put("pointId", pointId);
+        List<ProductionresourcePosition> list = productionresourcePositionMapper.getPPList(queryMap);
+
+        R<String> result = R.success("");
+
+        for(ProductionresourcePosition p:list){
+            String stockGoodsId = p.getGoodsId()==null?"":p.getGoodsId().toString();
+            if(!goodsId.equals(stockGoodsId))
+                continue;
+
+            if("1".equals(p.getCategory())||"2".equals(p.getCategory())){//托盘夹具
+                BomProcedureTray tray = new BomProcedureTray();
+                tray.setTrayId(p.getGoodsId());
+                result = stockInfoService.procedureTrayStockIn(tray, list.get(0).getStorgeId(), "", "");
+            }
+
+            if("4".equals(p.getCategory())){//原材料
+                BomProcedureMeterial meterial = new BomProcedureMeterial();
+                meterial.setMeterialId(p.getGoodsId());
+                result = stockInfoService.meterialStockIn(meterial, list.get(0).getStorgeId(), "","");
+            }
+            if (!result.getIsSuccess()) {
+                break;
+            }
+        }
+        return result;
+    }
 }

+ 7 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/WorkpieceServiceImpl.java

@@ -240,4 +240,11 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
         return "";
 
     }
+
+
+    @Override
+    public String add(Map map) {
+        BaseContextHandler.setTenant("0000");
+        return taskNodeService.handModeStockIn(map).getData();
+    }
 }

+ 6 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/WorkpieceController.java

@@ -161,6 +161,12 @@ public class WorkpieceController extends SuperController<WorkpieceService, Long,
     }
 
 
+    @ApiOperation(value = "添加", notes = "删除(非订单)")
+    @PostMapping("/handMode/add")
+    public R<String>  add(@RequestBody Map map) {
+        return success(baseService.add(map));
+    }
+
     @ApiOperation(value = "删除(非订单)", notes = "删除(非订单)")
     @PostMapping("/handMode/delete")
     public R<String>  delete(@RequestBody Map map) {