From 67da83c698e77ccf178669a31e4bd3a4e8fc1ca7 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期二, 03 八月 2021 16:10:05 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java | 56 +++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java index d2c6b8a..4d56e19 100644 --- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java +++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java @@ -1,6 +1,7 @@ package com.zy.asrs.task.handler; import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.core.common.Cools; import com.zy.asrs.entity.*; import com.zy.asrs.service.*; import com.zy.asrs.task.AbstractHandler; @@ -31,6 +32,8 @@ private LocDetlService locDetlService; @Autowired private WaitPakinService waitPakinService; + @Autowired + private BasDevpService basDevpService; public ReturnT<String> start(WrkMast wrkMast) { // 4.鍏ュ簱瀹屾垚 @@ -215,17 +218,21 @@ } } // todo:luxiaotao 3)淇敼鐩樼偣閫氱煡妗� status ==> Y - // 淇敼婧愬簱浣嶇姸鎬� ==> O - LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); - if (null != sourceLoc) { - sourceLoc.setBarcode(""); - sourceLoc.setLocSts("O"); - sourceLoc.setModiTime(now); - sourceLoc.setIoTime(now); - if (!locMastService.updateById(sourceLoc)) { - exceptionHandle("搴撲綅绉昏浆 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐ワ紱[workNo={0}],[sourceLoc={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); + // 鍏ュ簱闃诲搴撲綅绉昏浆鏍囪 + if (Cools.isEmpty(wrkMast.getCtnNo()) || !wrkMast.getCtnNo().equals("Y")) { + // 淇敼婧愬簱浣嶇姸鎬� ==> O + LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); + if (null != sourceLoc) { + sourceLoc.setBarcode(""); + sourceLoc.setLocSts("O"); + sourceLoc.setModiTime(now); + sourceLoc.setIoTime(now); + if (!locMastService.updateById(sourceLoc)) { + exceptionHandle("搴撲綅绉昏浆 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐ワ紱[workNo={0}],[sourceLoc={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); + } } } + // 淇敼鐩爣搴撲綅鐘舵�� ==> .locSts locMast.setLocSts(locSts); locMast.setBarcode(wrkMast.getBarcode()); @@ -284,6 +291,12 @@ exceptionHandle("鍏ㄦ澘鍑哄簱 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐ワ紱[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); } } + // 淇敼宸ヤ綔涓绘。鐘舵�� + wrkMast.setWrkSts(15L); + wrkMast.setModiTime(now); + if (!wrkMastService.updateById(wrkMast)) { + exceptionHandle("鏇存柊鍑哄簱瀹屾垚鐘舵�佸け璐�;[workNo={0}]", wrkMast.getWrkNo()); + } break; // 绌烘澘鍑哄簱 case 110: @@ -297,16 +310,29 @@ exceptionHandle("绌烘澘鍑哄簱 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐ワ紱[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); } } + // 淇敼宸ヤ綔涓绘。鐘舵�� + wrkMast.setWrkSts(15L); + wrkMast.setModiTime(now); + if (!wrkMastService.updateById(wrkMast)) { + exceptionHandle("鏇存柊鍑哄簱瀹屾垚鐘舵�佸け璐�;[workNo={0}]", wrkMast.getWrkNo()); + } + break; + // 鐩樼偣鍑哄簱 + case 107: + BasDevp basDevp = basDevpService.selectById(wrkMast.getStaNo()); + if (basDevp.getWrkNo().equals(wrkMast.getWrkNo())) { + // 淇敼宸ヤ綔涓绘。鐘舵�� + wrkMast.setWrkSts(15L); + wrkMast.setModiTime(now); + if (!wrkMastService.updateById(wrkMast)) { + exceptionHandle("鏇存柊鍑哄簱瀹屾垚鐘舵�佸け璐�;[workNo={0}]", wrkMast.getWrkNo()); + } + } break; default: break; } - // 淇敼宸ヤ綔涓绘。鐘舵�� - wrkMast.setWrkSts(15L); - wrkMast.setModiTime(now); - if (!wrkMastService.updateById(wrkMast)) { - exceptionHandle("鏇存柊鍑哄簱瀹屾垚鐘舵�佸け璐�;[workNo={0}]", wrkMast.getWrkNo()); - } + } catch (Exception e) { e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); -- Gitblit v1.9.1