|
@@ -10,10 +10,7 @@ import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
|
|
|
import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
|
import com.github.zuihou.business.externalApi.service.AgvHikOrderInfoService;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.dao.OrderMapper;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.dao.PlanMapper;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.dao.TTaskMapper;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.dao.TaskNodeMapper;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.dao.*;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TTask;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
|
|
@@ -97,6 +94,9 @@ public class TaskWorkNode {
|
|
|
@Autowired
|
|
|
private WorkpieceService workpieceService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private WorkpieceMapper workpieceMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ProductionresourcePositionService productionresourcePositionService;
|
|
|
|
|
@@ -565,6 +565,13 @@ public class TaskWorkNode {
|
|
|
//业务序列节点
|
|
|
//ResourceAutoCode parentAutoCode = resourceAutoCodeService.getById(resourceAutoCode.getParentId());
|
|
|
logger.info("=============进入自动化节点条件检测==============" + resourceAutoCode.getName());
|
|
|
+
|
|
|
+ //判断是不是在切换模式,重新排产等特殊情况下
|
|
|
+ map = checkPreCondition(taskNode, task, map);
|
|
|
+ Object o = map.get("result");
|
|
|
+ if(o!=null&&o.toString().equals("false")){
|
|
|
+ return map;
|
|
|
+ }
|
|
|
map = nodeOperationService.checkCondition(taskNode, task, map);
|
|
|
} else {
|
|
|
logger.info("=============进入线边库条件检测==============" + resourceAutoCode.getName());
|
|
@@ -843,5 +850,26 @@ public class TaskWorkNode {
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 前置条件验证,目前主要验证是不是在重新排产
|
|
|
+ * @param taskNode
|
|
|
+ * @param task
|
|
|
+ * @param dataMap
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map checkPreCondition(TaskNode taskNode, TTask task, Map<String, Object> dataMap){
|
|
|
+ TWorkpiece workpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,taskNode.getCompleteBatchNo()));
|
|
|
+ String exchangeZoneFlag = workpiece.getExchangeZoneFlag();
|
|
|
+ Long exchangeProcedureId = workpiece.getExchangeProcedureId();
|
|
|
+ if(StringUtil.isNotEmpty(exchangeZoneFlag)&&exchangeProcedureId!=null){//正在切换产线
|
|
|
+ if(exchangeProcedureId.longValue()!=taskNode.getProcedureId().longValue()){
|
|
|
+ dataMap.put("result", false);
|
|
|
+ dataMap.put("msg", DictionaryKey.NodeException.RE_SCHEDURE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return dataMap;
|
|
|
+ }
|
|
|
}
|
|
|
|