|
@@ -1361,10 +1361,16 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
//获取当前自动化节点的顺序
|
|
|
int n = taskNode.getCompleteBatchSort() - 1;
|
|
|
|
|
|
+ TWorkpiece currWorkpiece = null;
|
|
|
+ List<TWorkpiece>list = workpieceService.list(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,taskNode.getCompleteBatchNo()));
|
|
|
+ if(CollectionUtil.isNotEmpty(list)){
|
|
|
+ currWorkpiece = list.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
//处理出库入库
|
|
|
- R<String> r = demoLineStock(taskNode, task, callBackJson);
|
|
|
+ R<String> r = demoLineStock(taskNode, task, callBackJson,currWorkpiece);
|
|
|
|
|
|
- updateBizStatus(taskNode, task, taskNodeList, lg, callBackJson, r);
|
|
|
+ updateBizStatus(taskNode, task, taskNodeList, lg, callBackJson, r,currWorkpiece);
|
|
|
|
|
|
//websocket推送TODO临时注释
|
|
|
// msgUtil.pushTask(task);
|
|
@@ -1384,7 +1390,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
* @param r
|
|
|
*/
|
|
|
|
|
|
- public void updateBizStatus(TaskNode taskNode, TTask task, List<TaskNode> taskNodeList, AAutoNodeLog lg, JSONObject callBackJson, R<String> r) {
|
|
|
+ public void updateBizStatus(TaskNode taskNode, TTask task, List<TaskNode> taskNodeList, AAutoNodeLog lg, JSONObject callBackJson, R<String> r,TWorkpiece currWorkpiece) {
|
|
|
//如果是推送当前节点到mq(一个节点执行多次。就不需要更新数据状态)
|
|
|
if (this.checkPushNextNode(taskNode, callBackJson)){
|
|
|
//获取当前自动化节点的顺序
|
|
@@ -1484,12 +1490,8 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
orderMapper.updateAllById(order);
|
|
|
|
|
|
//设置结束标志
|
|
|
- List<TWorkpiece>list = workpieceService.list(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,taskNode.getCompleteBatchNo()));
|
|
|
- if(CollectionUtil.isNotEmpty(list)) {
|
|
|
- TWorkpiece tWorkpiece = list.get(0);
|
|
|
- tWorkpiece.setIsEnd("1");
|
|
|
- workpieceService.updateById(tWorkpiece);
|
|
|
- }
|
|
|
+ currWorkpiece.setIsEnd("1");
|
|
|
+ workpieceService.updateById(currWorkpiece);
|
|
|
|
|
|
//设置计划结束
|
|
|
// planMapper.updateproduceStatusFinish();
|
|
@@ -1572,7 +1574,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
* @param task
|
|
|
* @param callBackJson
|
|
|
*/
|
|
|
- public R<String> demoLineStock(TaskNode taskNode, TTask task, JSONObject callBackJson) {
|
|
|
+ public R<String> demoLineStock(TaskNode taskNode, TTask task, JSONObject callBackJson,TWorkpiece currWorkpiece) {
|
|
|
//没有回传参数,直接不需要出入库操作
|
|
|
String stockType = callBackJson.getString(DemoLineConstant.DEMOLINE_STOCK_TYPE);
|
|
|
//如果没有起始、终点,则不需要出入库处理
|
|
@@ -1587,7 +1589,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
String uniqueCode = callBackJson.containsKey("uniqueCode")?callBackJson.getString("uniqueCode"):"";
|
|
|
|
|
|
//更新目标位置
|
|
|
- workpieceService.setWorkPieceStock(taskNode.getCompleteBatchNo(),targetStorgeId,"",taskNode,uniqueCode);
|
|
|
+ workpieceService.setWorkPieceStock(currWorkpiece,targetStorgeId,"",taskNode,uniqueCode);
|
|
|
|
|
|
if (DemoLineConstant.DEMOLINE_STOCK_TYPE_METERIAL_RK.equals(stockType)) {
|
|
|
List<BomProcedureMeterial> meterialList = bomProcedureMeterialService.list(Wraps.<BomProcedureMeterial>lbQ().eq(BomProcedureMeterial::getId, task.getProcedureMeterialId()));
|