|
@@ -3,6 +3,7 @@ package com.github.zuihou.business.controller.productionResourceCenter;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.github.zuihou.authority.dao.auth.StationUserLoginInfoMapper;
|
|
|
import com.github.zuihou.authority.entity.auth.StationUserLoginInfo;
|
|
|
import com.github.zuihou.authority.entity.common.DictionaryItem;
|
|
@@ -13,13 +14,8 @@ import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StockInfoService;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dto.OrderUpdateDTO;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.Order;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.OrderTask;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.Plan;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.service.OrderService;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.service.OrderTaskService;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.service.PlanService;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.entity.*;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.service.*;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BBom;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureMeterial;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.CuttingTool;
|
|
@@ -49,6 +45,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -96,6 +93,12 @@ public class StationUserController extends SuperController<StationUserService, L
|
|
|
private ProductionresourcePositionService productionresourcePositionService;
|
|
|
@Autowired
|
|
|
private CodeRuleService codeRuleService;
|
|
|
+ @Autowired
|
|
|
+ private StorgeService storgeService;
|
|
|
+ @Autowired
|
|
|
+ private WorkpieceService workpieceService;
|
|
|
+ @Autowired
|
|
|
+ private TaskNodeService taskNodeService;
|
|
|
|
|
|
@Autowired
|
|
|
private BBomService bBomService;
|
|
@@ -324,7 +327,19 @@ public class StationUserController extends SuperController<StationUserService, L
|
|
|
String start = model.containsKey("start")? model.get("start").toString() : null;
|
|
|
String goal = model.containsKey("goal")? model.get("goal").toString() : null;
|
|
|
if(StringUtil.isEmpty(start) || StringUtil.isEmpty(goal)) return R.fail("传参有误");
|
|
|
- //目标位是刀具上下料站 则启用天轨线边库刀架支持
|
|
|
+
|
|
|
+ //原加工订单预处理(MQ消息和节点状态改完成)
|
|
|
+ String[] startNameCondition = start.split("_");
|
|
|
+ if(startNameCondition.length != 2 || StringUtils.isEmpty(startNameCondition[1])) return R.fail("传参有误");
|
|
|
+ Storge startStorge = storgeService.getOne(new LbqWrapper<Storge>().eq(Storge::getPointId, startNameCondition[1]));
|
|
|
+ if(null == startStorge) return R.fail("起始库位不存在");
|
|
|
+ List<TWorkpiece> tWorkpieceList = workpieceService.list(new LbqWrapper<TWorkpiece>().eq(TWorkpiece::getIsEnd, "0").eq(TWorkpiece::getPointId, startNameCondition[1]));
|
|
|
+ if(tWorkpieceList.size()>1) return R.fail("自定义任务已在执行中");
|
|
|
+ TWorkpiece tWorkpiece = tWorkpieceList.get(0);
|
|
|
+ UpdateWrapper<TaskNode> updateWrapper = new UpdateWrapper();
|
|
|
+ updateWrapper.lambda().set(TaskNode::getExeStatus, "3").eq(TaskNode::getExeStatus,"2").eq(TaskNode::getCompleteBatchNo, tWorkpiece.getCompleteBatchNo());
|
|
|
+ taskNodeService.update(null, updateWrapper);
|
|
|
+
|
|
|
OrderTask orderTask = OrderTask.builder().orderId(order.getId())
|
|
|
.hasMaterial("0").isMachine("0").isXbk("1").start(model.get("start").toString()).goal(model.get("goal").toString())
|
|
|
.build();
|