Browse Source

增加半自动化取放记录

wudingsheng 3 months ago
parent
commit
eb536fff1d

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

@@ -25,7 +25,9 @@ import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
 import com.github.zuihou.business.operationManagementCenter.service.TaskService;
 import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
+import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
 import com.github.zuihou.business.productionReadyCenter.entity.Tray;
+import com.github.zuihou.business.productionReadyCenter.service.AAutoNodeLogService;
 import com.github.zuihou.business.productionReadyCenter.service.TrayService;
 import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
 import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
@@ -109,6 +111,9 @@ public class ToolbarController {
     @Autowired
     private TrayService trayService;
 
+    @Autowired
+    private AAutoNodeLogService autoNodeLogService;
+
     private static final String CCS_URL="http://localhost:8089/api/";
 
     @ApiOperation(value = "更新库位位置", notes = "更新库位位置")
@@ -220,6 +225,7 @@ public class ToolbarController {
 
         param.put("data",map);
         String result = msgUtil.httpForPost(CCS_URL + "RobotAction",param.toJSONString());
+        //String result ="{\"result\": \"true\"}";
         if(StringUtil.isNotEmpty(result)){
             cn.hutool.json.JSONObject returnJson = JSONUtil.parseObj(result);
             if (returnJson.get("result") !=null &&"true".equals(returnJson.get("result"))) {
@@ -232,6 +238,10 @@ public class ToolbarController {
         UpdateWrapper<StockInfo> updateWrapper = new UpdateWrapper<StockInfo>();
         updateWrapper.lambda().eq(StockInfo::getStorgeId, startStorge.getId()).le(StockInfo::getGoodsType, 4).set(StockInfo::getStorgeId, goalStorge.getId());
         stockInfoService.update(null, updateWrapper);
+        AAutoNodeLog autoNodeLog=new AAutoNodeLog();
+        autoNodeLog.setStartStorge(start);
+        autoNodeLog.setEndStorge(goal);
+        autoNodeLogService.save(autoNodeLog);
         return R.success();
     }