From 3817dc568be5e59f9c32401945e5a6dc139acc83 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 16 六月 2020 16:35:30 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java | 89 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
index fba29fb..a31f3f8 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -8,6 +8,7 @@
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.EmptyPlateOutParam;
import com.zy.asrs.entity.param.FullStoreParam;
+import com.zy.asrs.entity.param.StockOutParam;
import com.zy.asrs.service.*;
import com.zy.common.model.StartupDto;
import com.zy.common.service.CommonService;
@@ -37,6 +38,8 @@
private LocMastService locMastService;
@Autowired
private StaDescService staDescService;
+ @Autowired
+ private LocDetlService locDetlService;
@Override
@Transactional
@@ -103,6 +106,13 @@
throw new CoolException(dto.getLocNo()+"鐩爣搴撲綅宸茶鍗犵敤");
}
return dto.getLocNo();
+ }
+
+ @Override
+ public String startupFullTakeStore(StockOutParam param, Long userId) {
+ // todo
+
+ return null;
}
@Override
@@ -225,6 +235,85 @@
@Override
@Transactional
+ public void locMove(String sourceLocNo, String locNo, Long userId) {
+ LocMast sourceLoc = locMastService.selectById(sourceLocNo);
+ if (Cools.isEmpty(sourceLoc)){
+ throw new CoolException("鏈壘鍒板簱浣�");
+ }
+ LocMast loc = locMastService.selectById(locNo);
+ if (Cools.isEmpty(loc)){
+ throw new CoolException("鏈壘鍒板簱浣�");
+ }
+ if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) {
+ throw new CoolException("绉昏浆搴撲綅灞炰簬涓嶅悓鍫嗗灈鏈�");
+ }
+ // 鑾峰彇宸ヤ綔鍙�
+ int workNo = commonService.getWorkNo(0);
+ // 淇濆瓨宸ヤ綔妗�
+ WrkMast wrkMast = new WrkMast();
+ wrkMast.setWrkNo(workNo);
+ wrkMast.setIoTime(new Date());
+ wrkMast.setWrkSts(11L); // 宸ヤ綔鐘舵�侊細11.鐢熸垚鍑哄簱ID
+ wrkMast.setIoType(110); // 鍏ュ嚭搴撶姸鎬侊細 110.绌烘澘鍑哄簱
+ wrkMast.setIoPri(10D);
+ wrkMast.setCrnNo(sourceLoc.getCrnNo());
+ wrkMast.setSourceLocNo(sourceLocNo); // 婧愬簱浣�
+ wrkMast.setLocNo(locNo); // 鐩爣搴撲綅
+ wrkMast.setFullPlt("N"); // 婊℃澘锛歒
+ wrkMast.setPicking("N"); // 鎷f枡
+ wrkMast.setExitMk("N"); // 閫�鍑�
+ wrkMast.setEmptyMk(sourceLoc.getLocType().equals("D")?"Y":"N"); // 绌烘澘
+ wrkMast.setLinkMis("N");
+ wrkMast.setAppeUser(userId);
+ wrkMast.setAppeTime(new Date());
+ wrkMast.setModiUser(userId);
+ wrkMast.setModiTime(new Date());
+ boolean res = wrkMastService.insert(wrkMast);
+ if (!res) {
+ throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
+ }
+ // 宸ヤ綔妗f槑缁嗕繚瀛�
+ List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo));
+ for (LocDetl locDetl : locDetls) {
+ WrkDetl wrkDetl = new WrkDetl();
+ wrkDetl.setWrkNo(workNo);
+ wrkDetl.setIoTime(new Date());
+ wrkDetl.setMatnr(locDetl.getMatnr());
+ wrkDetl.setAnfme(locDetl.getAnfme());
+ wrkDetl.setAppeTime(new Date());
+ wrkDetl.setAppeUser(userId);
+ wrkDetl.setModiTime(new Date());
+ wrkDetl.setModiUser(userId);
+ if (!wrkDetlService.insert(wrkDetl)) {
+ throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
+ }
+ }
+ // 淇敼婧愬簱浣嶇姸鎬�
+ if (sourceLoc.getLocType().equals("D") || sourceLoc.getLocType().equals("F")) {
+ sourceLoc.setLocType("R"); // R.鍑哄簱棰勭害
+ sourceLoc.setModiUser(userId);
+ sourceLoc.setModiTime(new Date());
+ if (!locMastService.updateById(sourceLoc)){
+ throw new CoolException("鏇存柊婧愬簱浣嶇姸鎬佸け璐�");
+ }
+ } else {
+ throw new CoolException("棰勭害婧愬簱浣嶅嚭搴撳け璐ワ紝鐘舵�侊細"+sourceLoc.getLocType$());
+ }
+ // 淇敼鐩爣搴撲綅鐘舵��
+ if (loc.getLocType().equals("O")) {
+ loc.setLocType("S"); // S.鍏ュ簱棰勭害
+ loc.setModiTime(new Date());
+ loc.setModiUser(userId);
+ if (!locMastService.updateById(loc)) {
+ throw new CoolException("鏇存柊鐩爣搴撲綅鐘舵�佸け璐�");
+ }
+ } else {
+ throw new CoolException("棰勭害鐩爣搴撲綅鍏ュ簱澶辫触锛岀姸鎬侊細"+loc.getLocType$());
+ }
+ }
+
+ @Override
+ @Transactional
public void completeWrkMast(String workNo, Long userId) {
WrkMast wrkMast = wrkMastService.selectById(workNo);
if (Cools.isEmpty(wrkMast)){
--
Gitblit v1.9.1