浏览代码

手动模式

yaoyq 3 年之前
父节点
当前提交
7f48758044

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

@@ -1,5 +1,6 @@
 package com.github.zuihou.business.operationManagementCenter.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperService;
@@ -114,4 +115,10 @@ public interface TaskNodeService extends SuperService<TaskNode> {
     void taskNodeCallbackBiz(TaskNode taskNode,TTask task,List<TaskNode>taskNodeList,AAutoNodeLog lg, String bizCallBackData);
 
 
+     R<String> handModeStock(JSONObject callBackJson);
+
+
+    R<String> handModeStockOut(Map conMap);
+
+
 }

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

@@ -37,4 +37,12 @@ public interface WorkpieceService extends SuperService<TWorkpiece> {
     public String execute(Map map);
 
 
+    public String handMove(Map map);
+
+
+    public String delete(Map map);
+
+    public String lock(Map map);
+
+
 }

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

@@ -1435,4 +1435,37 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         return result;
     }
 
+
+    @Override
+    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();
+        Map queryMap = new HashMap();
+        queryMap.put("pointId", pointId);
+        List<ProductionresourcePosition> list = productionresourcePositionMapper.getPPList(queryMap);
+
+        R<String> result = null;
+
+        for(ProductionresourcePosition p:list){
+            if(!category.equals(p.getCategory())){
+                continue;
+            }
+
+            if("1".equals(p.getCategory())||"2".equals(p.getCategory())){//托盘夹具
+                BomProcedureTray tray = new BomProcedureTray();
+                tray.setTrayId(p.getGoodsId());
+                result = stockInfoService.procedureTrayStockOut(tray, p.getStorgeId());
+            }
+
+            if("4".equals(p.getCategory())){//原材料
+                BomProcedureMeterial meterial = new BomProcedureMeterial();
+                meterial.setMeterialId(p.getGoodsId());
+                result = stockInfoService.meterialStockOut(meterial,  p.getStorgeId(), "");
+            }
+            if (!result.getIsSuccess()) {
+                break;
+            }
+        }
+        return result;
+    }
 }

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

@@ -7,6 +7,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
+import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
+import com.github.zuihou.business.edgeLibrary.dao.StorgeMapper;
+import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
+import com.github.zuihou.business.edgeLibrary.entity.Storge;
 import com.github.zuihou.business.mq.HandModeWorkNode;
 import com.github.zuihou.business.operationManagementCenter.dao.*;
 import com.github.zuihou.business.operationManagementCenter.dto.OrderProductUpdateDTO;
@@ -70,6 +74,9 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
     @Autowired
     private HandModeWorkNode handModeWorkNode;
 
+    @Autowired
+    private StorgeMapper storgeMapper;
+
     @Override
     public IPage<TWorkpiece> pageList(IPage page, LbqWrapper<TWorkpiece> wrapper) {
         return baseMapper.pageList(page, wrapper);
@@ -166,4 +173,56 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
         BaseContextHandler.setTenant("0000");
        return handModeWorkNode.getRequestParam(map);
     }
+
+    @Override
+    public String handMove(Map conMap) {
+        BaseContextHandler.setTenant("0000");
+        String startPointId = conMap.get("startPointId")==null?"":conMap.get("startPointId").toString();
+        String endPointId = conMap.get("endPointId")==null?"":conMap.get("endPointId").toString();
+        JSONObject callBackJson = new JSONObject();
+        callBackJson.put("srcPosition",startPointId);
+        callBackJson.put("targetPostion",endPointId);
+        return taskNodeService.handModeStock(callBackJson).getData();
+    }
+
+
+    @Override
+    public String delete(Map conMap) {
+        BaseContextHandler.setTenant("0000");
+        return taskNodeService.handModeStockOut(conMap).getData();
+    }
+
+
+    @Override
+    public String  lock(Map map) {
+        BaseContextHandler.setTenant("0000");
+        String pointId = map.get("pointId")==null?"":map.get("pointId").toString();
+        String lockType = map.get("lockType")==null?"":map.get("lockType").toString();
+
+        List<ProductionresourcePosition> pointList = productionresourcePositionMapper.selectList(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getPointId, pointId));
+        if(CollectionUtil.isEmpty(pointList)){
+            return "";
+        }
+        ProductionresourcePosition position = pointList.get(0);
+        //获取
+        List<Storge> list = storgeMapper.selectList(Wraps.<Storge>lbQ().eq(Storge::getId, position.getStorgeId()));
+
+
+        if(CollectionUtil.isEmpty(list)){
+            return "";
+        }
+
+        Storge storge = list.get(0);
+
+        if("1".equals(lockType)){//锁定
+            storge.setLockStatus("0");
+            storgeMapper.updateById(storge);
+        }else if("0".equals(lockType)){//解锁
+            storge.setLockStatus("1");
+            storgeMapper.updateById(storge);
+        }
+
+        return "";
+
+    }
 }

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

@@ -154,5 +154,26 @@ public class WorkpieceController extends SuperController<WorkpieceService, Long,
     }
 
 
+    @ApiOperation(value = "手工移位(非订单)", notes = "机器人取到(非订单)")
+    @PostMapping("/handMode/handMove")
+    public R<String>  handMove(@RequestBody Map map) {
+        return success(baseService.handMove(map));
+    }
+
+
+    @ApiOperation(value = "删除(非订单)", notes = "删除(非订单)")
+    @PostMapping("/handMode/delete")
+    public R<String>  delete(@RequestBody Map map) {
+        return success(baseService.delete(map));
+    }
+
+
+    @ApiOperation(value = "锁定(非订单)", notes = "锁定(非订单)")
+    @PostMapping("/handMode/lock")
+    public R<String>  lock(@RequestBody Map map) {
+        return success(baseService.lock(map));
+    }
+
+
 
 }