From 8002faa7b7102b7b5f13b9844dce527a5eb27327 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期四, 22 五月 2025 16:53:44 +0800
Subject: [PATCH] 接口编写
---
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 173 +++++++++++++++++++++++++++++++--------------------------
1 files changed, 93 insertions(+), 80 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index 2e85903..1e5f49d 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1,24 +1,24 @@
package com.zy.asrs.service.impl;
-import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
-import com.core.common.*;
+import com.core.common.BaseRes;
+import com.core.common.Cools;
+import com.core.common.R;
+import com.core.common.SnowflakeIdWorker;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.*;
import com.zy.asrs.mapper.LocMastMapper;
import com.zy.asrs.mapper.ManLocDetlMapper;
import com.zy.asrs.service.*;
-import com.zy.asrs.utils.MatUtils;
import com.zy.asrs.utils.OrderInAndOutUtil;
-import com.zy.common.entity.Parameter;
import com.zy.common.model.DetlDto;
-import com.zy.common.model.MesCombParam;
import com.zy.common.model.enums.WorkNoType;
import com.zy.common.service.CommonService;
-import com.zy.common.utils.HttpHandler;
+import com.zy.nc.entity.NccJcQilibcBarcodeflowWms;
+import com.zy.nc.service.NccJcQilibcBarcodeflowWmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -95,16 +95,19 @@
@Resource
private OrderDetlPakoutService orderDetlPakoutService;
+ @Autowired
+ private NccJcQilibcBarcodeflowWmsService barcodeflowWmsService;
+
@Override
@Transactional
public R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId, Long userId) {
//鍒ゆ柇搴撲綅鐘舵��
LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getLocNo()));
- if (Cools.isEmpty(locMast)){
+ if (Cools.isEmpty(locMast)) {
return R.error("璇ュ簱浣嶄笉瀛樺湪");
}
- if (!locMast.getLocSts().equals("P")){
- return R.error("璇ュ簱浣嶇姸鎬佷负锛�"+locMast.getLocSts()+",涓嶆弧瓒虫嫞鏂欓�斾腑骞舵澘鏉′欢锛侊紒锛�");
+ if (!locMast.getLocSts().equals("P")) {
+ return R.error("璇ュ簱浣嶇姸鎬佷负锛�" + locMast.getLocSts() + ",涓嶆弧瓒虫嫞鏂欓�斾腑骞舵澘鏉′欢锛侊紒锛�");
}
Date now = new Date();
@@ -134,7 +137,7 @@
wrkMastService.insert(wrkMast);
for (OrderDetl orderDetl : param.getCombMats()) {
- Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr",orderDetl.getMatnr()));
+ Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", orderDetl.getMatnr()));
if (mat == null) {
throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐ワ紝鐗╂枡淇℃伅涓嶅瓨鍦細" + orderDetl.getMatnr());
}
@@ -150,7 +153,7 @@
wrkDetl.setModiUser(userId);
wrkDetl.setZpallet(wrkMast.getBarcode());
wrkDetl.setBatch(orderDetl.getBatch());
- if(Cools.isEmpty(orderDetl.getBatch())){
+ if (Cools.isEmpty(orderDetl.getBatch())) {
wrkDetl.setBatch("");
}
wrkDetl.setBoxType1(orderDetl.getBoxType1());
@@ -164,11 +167,11 @@
if (!Cools.isEmpty(orderDetl.getOrderNo())) {
OrderPakin order = orderPakinService.selectByNo(orderDetl.getOrderNo());
- if (Cools.isEmpty(order)){
+ if (Cools.isEmpty(order)) {
continue;
}
- OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3());
- if (Cools.isEmpty(orderDetlPakin)){
+ OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(), orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3());
+ if (Cools.isEmpty(orderDetlPakin)) {
continue;
}
if (orderDetlPakin.getAnfme() < (orderDetlPakin.getWorkQty() + orderDetl.getAnfme())) {
@@ -176,11 +179,11 @@
}
// 淇敼璁㈠崟鏄庣粏浣滀笟鏁伴噺
if (!orderDetlPakinService.increaseWorkQty(orderDetlPakin.getOrderId(), orderDetlPakin.getMatnr(), orderDetlPakin.getBatch(), orderDetlPakin.getBrand(),
- orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(),orderDetl.getAnfme())) {
+ orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(), orderDetl.getAnfme())) {
throw new CoolException("淇敼鍗曟嵁鏄庣粏宸ヤ綔鏁伴噺澶辫触");
}
- if (order.getSettle() == 1){
+ if (order.getSettle() == 1) {
orderPakinService.updateSettle(order.getId(), 2L, userId);
}
}
@@ -191,7 +194,7 @@
@Override
@Transactional
- public R pickConfirm(PickConfirmParam param,Long userId) {
+ public R pickConfirm(PickConfirmParam param, Long userId) {
LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
.eq("loc_no", param.getLocNo()));
@@ -215,9 +218,9 @@
//妫�楠屼紶鍙傛槸鍚﹀拰璁㈠崟鏄庣粏鍖归厤
for (PickMatParam matParam : param.getList()) {
orderDetlPakin = orderDetlPakinService.selectItem
- (matParam.getOrderNo(), matParam.getMatnr(),matParam.getBatch(),matParam.getBrand(),
- matParam.getStandby1(),matParam.getStandby2(),matParam.getStandby3(),
- matParam.getBoxType1(),matParam.getBoxType2(),matParam.getBoxType3());
+ (matParam.getOrderNo(), matParam.getMatnr(), matParam.getBatch(), matParam.getBrand(),
+ matParam.getStandby1(), matParam.getStandby2(), matParam.getStandby3(),
+ matParam.getBoxType1(), matParam.getBoxType2(), matParam.getBoxType3());
if (orderDetlPakin == null) {
return R.error("鐗╂枡鏁版嵁涓嶅瓨鍦�");
}
@@ -281,7 +284,7 @@
wrkDetl.setModiTime(now);
wrkDetl.setModiUser(userId);
wrkDetl.setZpallet(wrkMast.getBarcode());
- if(Cools.isEmpty(matParam.getBatch())){
+ if (Cools.isEmpty(matParam.getBatch())) {
wrkDetl.setBatch("");
}
if (!wrkDetlService.insert(wrkDetl)) {
@@ -290,10 +293,10 @@
//鏇存柊璁㈠崟宸ヤ綔鏁伴噺
orderDetlPakinService.increaseWorkQty(orderDetlPakin.getOrderId(), matParam.getMatnr(),
- matParam.getBatch(),matParam.getBrand(),matParam.getStandby1(),matParam.getStandby2(),matParam.getStandby3(),
- matParam.getBoxType1(),matParam.getBoxType2(),matParam.getBoxType3(),matParam.getUseCount());
+ matParam.getBatch(), matParam.getBrand(), matParam.getStandby1(), matParam.getStandby2(), matParam.getStandby3(),
+ matParam.getBoxType1(), matParam.getBoxType2(), matParam.getBoxType3(), matParam.getUseCount());
// 鏇存柊宸ヤ綔妗g姸鎬�
- orderPakinService.updateSettle(orderDetlPakin.getOrderId(),2L,userId);
+ orderPakinService.updateSettle(orderDetlPakin.getOrderId(), 2L, userId);
}
// 淇敼搴撲綅鐘舵��: F.鍦ㄥ簱 ====>>> R.鍑哄簱棰勭害/P.鎷f枡/鐩樼偣/骞舵澘鍑哄簱涓�
locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getLocNo()));
@@ -316,47 +319,47 @@
public R WarehouseOutV1(CombParam combParam, Long hostId, Long userId) {
//鍒ゆ柇搴撲綅鐘舵��
LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", combParam.getLocNo()));
- if (Cools.isEmpty(locMast)){
+ if (Cools.isEmpty(locMast)) {
return R.error("璇ュ簱浣嶄笉瀛樺湪");
}
- if (!locMast.getLocSts().equals("P")){
- return R.error("璇ュ簱浣嶇姸鎬佷负锛�"+locMast.getLocSts()+",涓嶆弧瓒冲苟鏉块�斾腑鎷i�夋潯浠讹紒锛侊紒");
+ if (!locMast.getLocSts().equals("P")) {
+ return R.error("璇ュ簱浣嶇姸鎬佷负锛�" + locMast.getLocSts() + ",涓嶆弧瓒冲苟鏉块�斾腑鎷i�夋潯浠讹紒锛侊紒");
}
//鏌ヨ搴撳瓨鏁版嵁
- for (CombParam.CombMat combMat :combParam.getCombMats()){
+ for (CombParam.CombMat combMat : combParam.getCombMats()) {
List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>()
- .eq("loc_no", combParam.getLocNo())
- .eq("matnr", combMat.getMatnr())
+ .eq("loc_no", combParam.getLocNo())
+ .eq("matnr", combMat.getMatnr())
);
- if (locDetlList.isEmpty()){
+ if (locDetlList.isEmpty()) {
return R.error("鏈煡璇㈠埌搴撳瓨鏁版嵁");
}
- if (locDetlList.size()>1){
+ if (locDetlList.size() > 1) {
return R.error("搴撳瓨鏁版嵁澶т簬1鏉★紝涓轰繚璇佹暟鎹噯纭�э紝璇风敤姝e父娴佺▼鍑哄簱锛侊紒锛�");
}
LocDetl locDetl = locDetlList.get(0);
- if (combMat.getAnfme() > locDetl.getAnfme()){
+ if (combMat.getAnfme() > locDetl.getAnfme()) {
return R.error("鎷i�夋暟閲忛敊璇紝瓒呭嚭搴撳瓨鏁伴噺");
}
- if (!Cools.isEmpty(combMat.getOrderNo())){
+ if (!Cools.isEmpty(combMat.getOrderNo())) {
OrderPakout orderPakout = orderPakoutService.selectByNo(combMat.getOrderNo());
- if (Cools.isEmpty(orderPakout)){
+ if (Cools.isEmpty(orderPakout)) {
continue;
}
- if (orderPakout.getSettle() == 1){
- OrderInAndOutUtil.updateOrder(false,orderPakout.getId(), 2L, 9527L);
+ if (orderPakout.getSettle() == 1) {
+ OrderInAndOutUtil.updateOrder(false, orderPakout.getId(), 2L, 9527L);
}
OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderPakout.getId(), combMat.getMatnr(), combMat.getBatch(),
combMat.getBrand(), combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3());
- if (Cools.isEmpty(orderDetlPakout)){
+ if (Cools.isEmpty(orderDetlPakout)) {
continue;
}
- if (orderDetlPakout.getAnfme() < (orderDetlPakout.getWorkQty()+combMat.getAnfme())){
+ if (orderDetlPakout.getAnfme() < (orderDetlPakout.getWorkQty() + combMat.getAnfme())) {
throw new CoolException("鎷i�夋暟閲忓嚭閿�,璁㈠崟鍓╀綑鍑哄簱鏁伴噺灏忎簬宸插嚭搴撴暟閲忎笌灏嗘嫞閫夋暟閲忎箣鍜岋紒锛侊紒");
}
// 淇敼璁㈠崟鏄庣粏浣滀笟鏁伴噺
if (!orderDetlPakoutService.increaseWorkQty(orderDetlPakout.getOrderId(), combMat.getMatnr(), combMat.getBatch(), combMat.getBrand(),
- combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3(),combMat.getAnfme())) {
+ combMat.getStandby1(), combMat.getStandby2(), combMat.getStandby3(), combMat.getBoxType1(), combMat.getBoxType2(), combMat.getBoxType3(), combMat.getAnfme())) {
throw new CoolException("淇敼鍗曟嵁鏄庣粏宸ヤ綔鏁伴噺澶辫触");
}
// // 淇敼璁㈠崟鏄庣粏瀹屾垚鏁伴噺
@@ -394,7 +397,7 @@
wrkMast.setModiUser(userId);
wrkMastService.insert(wrkMast);
- Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr",combMat.getMatnr()));
+ Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", combMat.getMatnr()));
if (mat == null) {
throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐ワ紝鐗╂枡淇℃伅涓嶅瓨鍦細" + combMat.getMatnr());
}
@@ -411,7 +414,7 @@
wrkDetl.setModiUser(userId);
wrkDetl.setZpallet(wrkMast.getBarcode());
wrkDetl.setBatch(combMat.getBatch());
- if(Cools.isEmpty(combMat.getBatch())){
+ if (Cools.isEmpty(combMat.getBatch())) {
wrkDetl.setBatch("");
}
wrkDetl.setBoxType1(combMat.getBoxType1());
@@ -424,8 +427,8 @@
wrkDetlService.insert(wrkDetl);
System.out.println("姝e父");
- }catch (Exception e) {
- throw new CoolException("鎿嶄綔鏁版嵁寮傚父锛�"+e.getMessage());
+ } catch (Exception e) {
+ throw new CoolException("鎿嶄綔鏁版嵁寮傚父锛�" + e.getMessage());
}
}
return R.ok("鎿嶄綔鎴愬姛锛�");
@@ -508,7 +511,7 @@
Wrapper<OrderDetl> wrapper1 = new EntityWrapper<>();
wrapper1.eq("status", 1);
wrapper1.in("order_id", orderIds);
- wrapper1.orderBy("create_time",false);
+ wrapper1.orderBy("create_time", false);
if (!Cools.isEmpty(matnr)) {
wrapper1.like("matnr", matnr);
}
@@ -543,7 +546,7 @@
if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
throw new CoolException(BaseRes.PARAM);
}
- if(param.getCombMats().size()>1){
+ if (param.getCombMats().size() > 1) {
throw new CoolException("璇锋彁鍙栦竴涓晢鍝侊紝鎴栬�呭埛鏂伴噸鏂扮粍鎵橈紒");
}
// 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁
@@ -552,16 +555,16 @@
throw new CoolException(param.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱");
}
- if(param.getBarcode().length()!=8){
+ if (param.getBarcode().length() != 8) {
throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode());
}
- if (param.getCombMats().size()>1){
+ if (param.getCombMats().size() > 1) {
throw new CoolException("涓嶅厑璁告贩鏂�===>>" + param.getBarcode());
}
- int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
- int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
- int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode()));
+ int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode()));
+ int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode()));
+ int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
if (countLoc > 0 || countWrk > 0 || countwait > 0) {
throw new CoolException("缁勬墭妗�/宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode());
}
@@ -574,8 +577,8 @@
// 鐢熸垚鍏ュ簱閫氱煡妗�
List<DetlDto> detlDtos = new ArrayList<>();
param.getCombMats().forEach(elem -> {
- DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(),
- elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme());
+ DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
+ elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
if (DetlDto.has(detlDtos, detlDto)) {
DetlDto one = DetlDto.findDto(detlDtos, detlDto);
assert one != null;
@@ -606,7 +609,7 @@
throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�");
}
}
- // 鍏宠仈缁勬墭
+ // 鍏宠仈缁勬墭
} else {
// Order order = orderService.selectByNo(param.getOrderNo());
Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, param.getOrderNo());
@@ -615,12 +618,20 @@
}
// 鐢熸垚鍏ュ簱閫氱煡妗�
List<DetlDto> detlDtos = new ArrayList<>();
+
param.getCombMats().forEach(elem -> {
+ // TODO 涓嶈�冭檻浠g爜鏁堢巼锛屽洜涓烘棫浠g爜bug灏�
+ if (!Cools.isEmpty(elem.getVbarcode())) {
+ NccJcQilibcBarcodeflowWms vbarcode1 = barcodeflowWmsService.selectOne(new EntityWrapper<NccJcQilibcBarcodeflowWms>().eq("vbarcode", elem.getVbarcode()));
+ elem.setBatch(vbarcode1.getVbatchcode());
+ elem.setMatnr(vbarcode1.getWlbm());
+ elem.setAnfme(vbarcode1.getNastnum().doubleValue());
+ }
// 璁㈠崟鏄庣粏鏁伴噺鏍¢獙
// OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch());
- OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(),
- elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3());
+ OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
+ elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3());
if (elem.getAnfme() > orderDetl.getEnableQty()) {
throw new CoolException(orderDetl.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�");
}
@@ -628,10 +639,10 @@
// if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme())) {
// throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
// }
- OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE,order.getId(), elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(),
- elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme());
- DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),elem.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(),
- elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(), elem.getAnfme());
+ OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
+ elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
+ DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
+ elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
if (DetlDto.has(detlDtos, detlDto)) {
DetlDto one = DetlDto.findDto(detlDtos, detlDto);
assert one != null;
@@ -662,7 +673,7 @@
}
}
// orderService.updateSettle(order.getId(), 2L, userId);
- OrderInAndOutUtil.updateOrder(Boolean.TRUE,order.getId(), 2L, userId);
+ OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId);
}
}
@@ -679,15 +690,15 @@
}
// 鑾峰彇鍟嗗搧鍒楄〃
- for(CombParam.CombMat combMat : param.getCombMats()){
+ for (CombParam.CombMat combMat : param.getCombMats()) {
Mat mat = matService.selectByMatnr(combMat.getMatnr());
- if (Cools.isEmpty(mat)){
+ if (Cools.isEmpty(mat)) {
throw new CoolException(combMat.getMatnr() + ":鍟嗗搧妗f涓嶅瓨鍦紒");
}
- if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme()==0){
+ if (Cools.isEmpty(combMat.getAnfme()) || combMat.getAnfme() == 0) {
throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鏁伴噺鏈夎锛�");
}
- if (Cools.isEmpty(combMat.getBatch())){
+ if (Cools.isEmpty(combMat.getBatch())) {
// throw new CoolException(combMat.getMatnr() + ":鍟嗗搧鎵瑰彿鏈夎锛�");
}
ManLocDetl manLocDetl = new ManLocDetl();
@@ -708,16 +719,16 @@
@Override
public void offSale(OffSaleParam offSaleParam) {
ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr());
- if (Cools.isEmpty(manLocDetl)){
+ if (Cools.isEmpty(manLocDetl)) {
throw new CoolException("鏃犳鍟嗗搧锛�");
}
double anfme = manLocDetl.getAnfme() - offSaleParam.getAnfme();
if (anfme < 0) {
throw new CoolException("鍟嗗搧搴撳瓨涓嶈冻锛�");
- } else if (anfme == 0){
+ } else if (anfme == 0) {
manLocDetlMapper.deleteLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr());
}
- manLocDetlMapper.updateAnfme0(anfme,manLocDetl.getNodeId());
+ manLocDetlMapper.updateAnfme0(anfme, manLocDetl.getNodeId());
}
// 鏌ユ壘鍟嗗搧
@@ -776,7 +787,9 @@
// 娣诲姞鏄庣粏
for (WrkDetl wrkDetl : list) {
- if (wrkDetl.getAnfme() == 0.0D) { continue; }
+ if (wrkDetl.getAnfme() == 0.0D) {
+ continue;
+ }
// todo 鐩樼偣璁板綍銆佷繚瀛樿皟鏁磋褰�
String orderNo = wrkDetl.getOrderNo();
Mat mat = matService.selectByMatnr(wrkDetl.getMatnr());
@@ -792,7 +805,7 @@
}
// 淇敼鐩樼偣浠诲姟涓绘。鐘舵��
- wrkMast.setFullPlt(wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()).size() != 0?"Y":"N");
+ wrkMast.setFullPlt(wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()).size() != 0 ? "Y" : "N");
wrkMast.setModiTime(now);
wrkMast.setModiUser(userId);
if (!wrkMastService.updateById(wrkMast)) {
@@ -977,7 +990,7 @@
//鏍规嵁璁㈠崟鍙风敓鎴愬嚭搴撲换鍔″伐浣滄。
Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, orderNo);
// Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", orderNo));
- if (order.getSettle() != 1 && order.getSettle() != 2){
+ if (order.getSettle() != 1 && order.getSettle() != 2) {
throw new CoolException("璇ヨ鍗曞凡澶勭悊");
}
@@ -985,13 +998,13 @@
List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId());
Date now = new Date();
- for(OrderDetl orderDetl : orderDetls){
+ for (OrderDetl orderDetl : orderDetls) {
//鏌ヨ鎵�鏈夊簱浣嶇姸鎬佷负F鐨勫簱浣嶄俊鎭�
- List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(),orderDetl.getBatch(),null,null);
+ List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null, null);
if (locDetls.size() == 0) {
throw new CoolException("搴撳瓨涓病鏈夎鐗╂枡");
}
- for(LocDetl locDetl : locDetls){
+ for (LocDetl locDetl : locDetls) {
//濡傛灉璇ュ簱浣嶅嚭搴撹矾绾挎墍鐢ㄧ殑鍫嗗灈鏈簅ut_enable涓嶄负Y,璺宠繃璇ュ惊鐜�
LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
.eq("loc_no", locDetl.getLocNo()));
@@ -1000,13 +1013,13 @@
}
BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>()
.eq("crn_no", locMast.getCrnNo()));
- if (Cools.isEmpty(crn_no) || !crn_no.getOutEnable().equals("Y")){
+ if (Cools.isEmpty(crn_no) || !crn_no.getOutEnable().equals("Y")) {
continue;
}
//鍙嚭搴撴暟閲� = 璁㈠崟鏁伴噺 - 浣滀笟涓暟閲�
Double outQty = orderDetl.getAnfme() - orderDetl.getWorkQty();
- if(outQty <= 0){
+ if (outQty <= 0) {
break;
}
// 鍒ゆ柇鍏ュ嚭搴撶被鍨嬶細101.鍏ㄦ澘鍑哄簱 or 103.鎷f枡鍑哄簱
@@ -1021,19 +1034,19 @@
// if(!orderService.update(order, new EntityWrapper<Order>().eq("order_no", orderNo))){
// throw new CoolException("鏇存柊璁㈠崟鐘舵�佸け璐�");
// }
- OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),2L,userId);
+ OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 2L, userId);
orderDetl.setWorkQty(orderDetl.getWorkQty() + curOutQty);
orderDetl.setUpdateBy(userId);
orderDetl.setUpdateTime(now);
Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo)
- .eq("matnr",orderDetl.getMatnr());
- if(!Cools.isEmpty(orderDetl.getBatch())){
+ .eq("matnr", orderDetl.getMatnr());
+ if (!Cools.isEmpty(orderDetl.getBatch())) {
wrapper.eq("batch", orderDetl.getBatch());
}
// if(!orderDetlService.update(orderDetl, wrapper)){
// throw new CoolException("鏇存柊璁㈠崟鏄庣粏澶辫触");
// }
- OrderInAndOutUtil.updateOrderDetl(order.getPakinPakoutStatus$(),order,orderDetl);
+ OrderInAndOutUtil.updateOrderDetl(order.getPakinPakoutStatus$(), order, orderDetl);
}
--
Gitblit v1.9.1