|
|
@@ -17,6 +17,8 @@ import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
import com.github.zuihou.business.DemoLine.YunjianConstant;
|
|
|
import com.github.zuihou.business.controller.productionResourceCenter.StationUserController;
|
|
|
+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.edgeLibrary.service.StockInfoService;
|
|
|
@@ -35,6 +37,7 @@ 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.BomProcedureProductionresource;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.Tray;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.AAutoNodeLogService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.BomProcedureProductionresourceService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
|
@@ -43,6 +46,7 @@ import com.github.zuihou.business.productionResourceCenter.entity.Productionreso
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
|
|
|
+import com.github.zuihou.business.util.CommonUtil;
|
|
|
import com.github.zuihou.business.util.DynamicRabbitMq;
|
|
|
import com.github.zuihou.business.util.MsgUtil;
|
|
|
import com.github.zuihou.common.constant.BizConstant;
|
|
|
@@ -96,6 +100,10 @@ public class ToolbarController {
|
|
|
@Autowired
|
|
|
private StorgeService storgeService;
|
|
|
@Autowired
|
|
|
+ private StorgeMapper storgeMapper;
|
|
|
+ @Autowired
|
|
|
+ private StockInfoMapper stockInfoMapper;
|
|
|
+ @Autowired
|
|
|
private MsgUtil msgUtil;
|
|
|
@Autowired
|
|
|
private TaskNodeService taskNodeService;
|
|
|
@@ -153,10 +161,21 @@ public class ToolbarController {
|
|
|
String goal = data.containsKey("goal")? data.get("goal").toString() : null;
|
|
|
if(StringUtils.isEmpty(start) || StringUtils.isEmpty(goal)) return R.fail("数据传参为空");
|
|
|
|
|
|
- if(start.length()!=10 || goal.length()!=10)return R.fail("参数长度不为10");
|
|
|
|
|
|
String instructionUrl = "/api/RobotAction";
|
|
|
|
|
|
+ Storge startStorge = storgeMapper.getStorgeByPointId(start);
|
|
|
+ Storge endStorge = storgeMapper.getStorgeByPointId(goal);
|
|
|
+ if(startStorge==null || endStorge==null){
|
|
|
+ return R.fail("库位不存在");
|
|
|
+ }
|
|
|
+ String trayLatheTypeCode = stockInfoMapper.getTrayLatheTypeCode(startStorge.getId());
|
|
|
+ Tray trayNoByStorgeId = stockInfoMapper.getTrayNoByStorgeId(startStorge.getId());
|
|
|
+ if(trayLatheTypeCode==null){
|
|
|
+ return R.fail("托盘类型未知");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
JSONObject jsonParam = new JSONObject();
|
|
|
jsonParam.put("taskId", "1");
|
|
|
jsonParam.put("taskNodeId", "1");
|
|
|
@@ -164,17 +183,22 @@ public class ToolbarController {
|
|
|
jsonParam.put("code", "1");
|
|
|
|
|
|
JSONObject sub = new JSONObject();
|
|
|
- sub.put("location", start);
|
|
|
- sub.put("destLocation", goal);
|
|
|
+ sub.put("location", CommonUtil.getLocationValue(startStorge.getPointId(),trayLatheTypeCode));
|
|
|
+ sub.put("destLocation", CommonUtil.getLocationValue(endStorge.getPointId(),trayLatheTypeCode));
|
|
|
sub.put("taskType", "1");
|
|
|
sub.put("carryType", "1");
|
|
|
-
|
|
|
+ sub.put("trayLatheType", trayLatheTypeCode);
|
|
|
+ sub.put("trayLatheCode", trayNoByStorgeId.getNo());
|
|
|
jsonParam.put("data", sub);
|
|
|
|
|
|
TaskNode taskNode = new TaskNode();
|
|
|
- taskNode.setResourceId(1496354880934117376L);
|
|
|
+ taskNode.setResourceId(1943971692378902529L);
|
|
|
|
|
|
String returnData = msgUtil.getCcsData(instructionUrl, jsonParam, taskNode);
|
|
|
+
|
|
|
+ UpdateWrapper<StockInfo> updateWrapper = new UpdateWrapper<StockInfo>();
|
|
|
+ updateWrapper.lambda().eq(StockInfo::getStorgeId, startStorge.getId()).le(StockInfo::getGoodsType, 4).set(StockInfo::getStorgeId, endStorge.getId());
|
|
|
+ stockInfoService.update(null, updateWrapper);
|
|
|
return R.success(returnData);
|
|
|
}
|
|
|
|