From c90f42702b056664dbb3502a14041ba902273665 Mon Sep 17 00:00:00 2001
From: 1 <1>
Date: 星期四, 27 十一月 2025 18:31:29 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java | 67 ++++++++++++++++++++-------------
1 files changed, 40 insertions(+), 27 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 a25fd6d..c9c1985 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -188,33 +188,37 @@
@Override
@Transactional
public void startupFullTakeStore(StockOutParam param, Long userId) {
- // 鐩爣绔欑偣鐘舵�佹娴�
- BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite());
- // 鑾峰彇搴撲綅鏄庣粏
- List<LocDetlDto> locDetlDtos = new ArrayList<>();
- for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
- if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
- LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch(),paramLocDetl.getBrand()
- ,paramLocDetl.getStandby1(),paramLocDetl.getStandby2(),paramLocDetl.getStandby3(),paramLocDetl.getBoxType1(),paramLocDetl.getBoxType2(),paramLocDetl.getBoxType3());
- if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
+ try{
+ // 鐩爣绔欑偣鐘舵�佹娴�
+ BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite());
+ // 鑾峰彇搴撲綅鏄庣粏
+ List<LocDetlDto> locDetlDtos = new ArrayList<>();
+ for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
+ if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
+ LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch(),paramLocDetl.getBrand()
+ ,paramLocDetl.getStandby1(),paramLocDetl.getStandby2(),paramLocDetl.getStandby3(),paramLocDetl.getBoxType1(),paramLocDetl.getBoxType2(),paramLocDetl.getBoxType3());
+ if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
+ }
}
- }
- if (!locDetlDtos.isEmpty()) {
- // 搴撲綅鍙烽泦鍚�
- List<String> locNoList = param.getLocDetls().stream().map(StockOutParam.LocDetl::getLocNo).distinct().collect(Collectors.toList());
- String firstFrozenLocNo = locMastMapper.findFirstFrozenLocNo(locNoList);
- if (firstFrozenLocNo != null) {
- throw new CoolException(firstFrozenLocNo + "搴撲綅宸茶鍐荤粨!");
+ if (!locDetlDtos.isEmpty()) {
+ // 搴撲綅鍙烽泦鍚�
+ List<String> locNoList = param.getLocDetls().stream().map(StockOutParam.LocDetl::getLocNo).distinct().collect(Collectors.toList());
+ String firstFrozenLocNo = locMastMapper.findFirstFrozenLocNo(locNoList);
+ if (firstFrozenLocNo != null) {
+ throw new CoolException(firstFrozenLocNo + "搴撲綅宸茶鍐荤粨!");
+ }
+ LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo()));
+ if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") ){
+ // 鍚姩鍑哄簱寮�濮� 101.鍑哄簱
+ stockOut(staNo, locDetlDtos, null, userId);
+ }else {
+ throw new CoolException("鎵�閫夊簱浣嶅瓨鍦ㄧ姸鎬佷笉涓篎銆丏鐨勫簱浣嶏紝搴撲綅鍙凤細"+locMast.getLocNo()+" 銆佸綋鍓嶇姸鎬侊細"+locMast.getLocSts()+"-"+locMast.getLocSts$());
+ }
+ } else {
+ throw new CoolException("搴撳瓨涓嶅瓨鍦�");
}
- LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo()));
- if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") ){
- // 鍚姩鍑哄簱寮�濮� 101.鍑哄簱
- stockOut(staNo, locDetlDtos, null, userId);
- }else {
- throw new CoolException("鎵�閫夊簱浣嶅瓨鍦ㄧ姸鎬佷笉涓篎銆丏鐨勫簱浣嶏紝搴撲綅鍙凤細"+locMast.getLocNo()+" 銆佸綋鍓嶇姸鎬侊細"+locMast.getLocSts()+"-"+locMast.getLocSts$());
- }
- } else {
- throw new CoolException("搴撳瓨涓嶅瓨鍦�");
+ } catch (Exception e){
+ throw new CoolException(e.getMessage());
}
}
@@ -454,6 +458,7 @@
throw new CoolException("棰勭害搴撲綅鐘舵�佸け璐ワ紝搴撲綅鍙凤細"+dto.getLocNo());
}
} else {
+ log.error(dto.getLocNo() + "搴撲綅涓嶆槸鍦ㄥ簱鐘舵��");
throw new CoolException(dto.getLocNo() + "搴撲綅涓嶆槸鍦ㄥ簱鐘舵��");
}
@@ -461,12 +466,20 @@
// 澧炲姞AGV搴撳瓨涓浆鏁伴噺
if (basAgvLocDetls != null){
for (BasAgvLocDetl basAgvLocDetl : basAgvLocDetls) {
- basAgvLocDetlService.insert(basAgvLocDetl);
+ try{
+ basAgvLocDetlService.insert(basAgvLocDetl);
+ } catch (Exception e){
+ log.error("澧炲姞AGV搴撳瓨涓浆鏁伴噺澶辫触");
+ }
}
}
if (basAgvWrkDetls != null){
for (BasAgvWrkDetl basAgvWrkDetl : basAgvWrkDetls) {
- basAgvWrkDetlService.insert(basAgvWrkDetl);
+ try{
+ basAgvWrkDetlService.insert(basAgvWrkDetl);
+ } catch (Exception e){
+ log.error("澧炲姞AGV搴撳瓨涓浆鏁伴噺澶辫触");
+ }
}
}
--
Gitblit v1.9.1