From 7be83adcdc6ee45fce42d14d7da2be33b1bcc216 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 18 五月 2023 09:23:48 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/web/WcsController.java | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index 19ab581..3a6f58f 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -3,10 +3,13 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.common.Cools;
+import com.core.common.DateUtils;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
+import com.zy.asrs.entity.param.CombParam;
import com.zy.asrs.service.*;
+import com.zy.asrs.utils.PostMesDataUtils;
import com.zy.common.CodeRes;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.StartupDto;
@@ -14,6 +17,7 @@
import com.zy.common.web.param.SearchLocParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@@ -43,6 +47,14 @@
private WaitPakinService waitPakinService;
@Autowired
private LocDetlService locDetlService;
+ @Autowired
+ private TestMastService testMastService;
+
+ @Value("mes.url")
+ private String mesUrl;
+
+ @Value("mes.inPath")
+ private String inpath;
@PostMapping("/pakin/loc/v1")
@ResponseBody
@@ -72,16 +84,19 @@
int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
if (countLoc > 0 || countWrk > 0 || countWait > 0) {
- return R.error(CodeRes.EXIST_500);
+ if (!Cools.isEmpty(waitPakins.get(0).getDeadWarn()) && waitPakins.get(0).getDeadWarn()!=0){
+ return R.error(CodeRes.EXIST_500);
+ }
}
}
if (Cools.isEmpty(param.getLocType1())){
- return R.error("楂樹綆妫�娴嬩俊鍙蜂笉鑳戒负绌�");
+ param.setLocType1((short)1);
}
// 婧愮珯鐐圭姸鎬佹娴�
- BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), true);
- sourceStaNo.setLocType1(param.getLocType1());
+ BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), false);
+// sourceStaNo.setLocType1(param.getLocType1());
+ sourceStaNo.setLocType1((short)1);
LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
StartupDto dto = null;
@@ -96,7 +111,7 @@
default:
break;
}
- log.info("WCS鍏ュ簱鎺ュ彛杩斿弬:{},鎵樼洏鐮�:{}", dto, param.getBarcode());
+ log.info("WCS鍏ュ簱鎺ュ彛杩斿弬:{},pack鐮�:{}", dto, param.getBarcode());
return R.ok().add(dto);
}
@@ -173,10 +188,37 @@
locMast.setModiTime(now);
if (!locMastService.updateById(locMast)){
throw new CoolException("鏀瑰彉搴撲綅鐘舵�佸け璐�");
+ }else{
+ //1.鎵爜涓婃姤
+ CombParam combParam = new CombParam();
+ combParam.setPackNo(locMast.getBarcode());
+ combParam.setLocNo(locMast.getLocNo());
+ combParam.setPackSts(1);
+ combParam.setRequestTime(DateUtils.convert(new Date()));
+ new PostMesDataUtils().postMesData("MES绯荤粺",mesUrl,inpath,combParam);
}
} else {
throw new CoolException(dto.getLocNo()+"鐩爣搴撲綅宸茶鍗犵敤");
}
+ TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>().eq("barcode", wrkMast.getBarcode()));
+
+ if (Cools.isEmpty(testMast)){
+ //鐢熸垚娴嬭瘯妗�
+ testMast=new TestMast();
+ testMast.setChannel(locMast.getChannel());
+ testMast.setUserId(locMast.getLocNo());
+ testMast.setStatus(1);
+ testMast.setBarcode(wrkMast.getBarcode());
+ testMast.setLocNo(locMast.getLocNo());
+ testMast.setModiTime(now);
+ testMast.setAppeTime(now);
+ if (!testMastService.insert(testMast)){
+ throw new CoolException(wrkMast.getBarcode()+"鐢熸垚娴嬭瘯妗eけ璐�");
+ }
+ }else {
+ throw new CoolException(wrkMast.getBarcode()+"宸插瓨鍦ㄦ祴璇曟。");
+ }
+
return dto;
}
--
Gitblit v1.9.1