|
@@ -10,13 +10,18 @@ import com.github.zuihou.business.operationManagementCenter.entity.TTask;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.TaskService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BBom;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.impl.ZZoneServiceImpl;
|
|
|
import com.github.zuihou.business.websocket.WebSocketServer;
|
|
|
import com.github.zuihou.common.constant.BizConstant;
|
|
|
+import com.qiniu.common.Zone;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeansException;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.context.ApplicationContextAware;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
@@ -44,6 +49,12 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
@Resource
|
|
|
private WebSocketServer webSocketServer;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BBomMapper bBomMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ZZoneService zoneService;
|
|
|
+
|
|
|
@Override
|
|
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
|
|
MsgUtil.applicationContext = applicationContext;
|
|
@@ -98,13 +109,16 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
if(n<taskNodeList.size()-1){//尚未执行到最后一个
|
|
|
TaskNode nextTaskNode = taskNodeList.get(n+1);
|
|
|
|
|
|
-// //如果切换了产线,则只把当前工序走完
|
|
|
-// if(currWorkpiece!=null&&"1".equals(currWorkpiece.getExchangeZoneFlag())){
|
|
|
-// Long exchangeProcedureId = currWorkpiece.getExchangeProcedureId();
|
|
|
-// if(exchangeProcedureId.longValue()!=nextTaskNode.getProcedureId().longValue()){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ //如果切换成了手动档,则只把当前工序走完
|
|
|
+ if(currWorkpiece!=null&&"1".equals(currWorkpiece.getExchangeZoneFlag())){
|
|
|
+ BBom bom = bBomMapper.selectById(task.getBomId());
|
|
|
+ ZZone bomzZone = zoneService.getById(bom.getZoneId());
|
|
|
+ Long exchangeProcedureId = currWorkpiece.getExchangeProcedureId();
|
|
|
+ //如果是手动模式,执行完当前工序就不往下走了
|
|
|
+ if("2".equals(bomzZone.getRunMode())&&exchangeProcedureId.longValue()!=nextTaskNode.getProcedureId().longValue()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
jsonObject.put("taskNodeId",nextTaskNode.getId().toString());
|
|
|
if(callBackJson.containsKey(DemoLineConstant.DEMOLINE_XBKFLAG)){//临时存放到了线边库,向虚拟线边库发一个MQ。
|