From e13518129e509aa19d76a029354535acd7570e1d Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 20 十一月 2025 15:33:53 +0800
Subject: [PATCH] 1
---
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java | 56 ++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java
index 8ee222c..d78954a 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java
@@ -20,6 +20,7 @@
import com.vincent.rsf.server.manager.entity.*;
import com.vincent.rsf.server.manager.mapper.*;
import com.vincent.rsf.server.manager.service.*;
+import com.vincent.rsf.server.manager.service.impl.BasContainerServiceImpl;
import com.vincent.rsf.server.system.constant.CodeRes;
import com.vincent.rsf.server.system.constant.GlobalConfigCode;
import com.vincent.rsf.server.system.constant.SerialRuleCode;
@@ -127,6 +128,8 @@
private CompanysService companysService;
@Autowired
private OutStockService outStockService;
+ @Autowired
+ private BasContainerService basContainerService;
/**
* @return
@@ -539,10 +542,27 @@
Object asnCode = params.get("asnCode");
Object crushNo = params.get("fieldsIndex");
Object batch = params.get("batch");
+
+ if (Objects.isNull(crushNo)) {
+ throw new CoolException("绁ㄥ彿涓嶈兘涓虹┖锛侊紒");
+ }
+ if (Objects.isNull(code)) {
+ throw new CoolException("瀹瑰櫒鍙蜂笉鑳戒负绌猴紒锛�");
+ }
+ BasContainer container = basContainerService.getOne(new LambdaQueryWrapper<BasContainer>().eq(BasContainer::getCode, code.toString()));
+ if (Objects.isNull(container)) {
+ throw new CoolException("瀹瑰櫒涓嶅瓨鍦紒锛�");
+ }
+ if (!Objects.isNull(params.get("isHalf")) && !params.get("isHalf").equals("0")) {
+ container.setIsHalf(1);
+ if (!basContainerService.updateById(container)) {
+ throw new CoolException("瀹瑰櫒鐘舵�佷慨鏀瑰け璐ワ紒锛�");
+ }
+ }
+
String fieldIndex = null;
if (!Objects.isNull(crushNo)) {
FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>().eq(FieldsItem::getValue, crushNo).last("Limit 1"));
-
if (!Objects.isNull(fieldsItem)) {
fieldIndex = fieldsItem.getUuid();
}
@@ -551,11 +571,13 @@
LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new LambdaQueryWrapper<WarehouseAreasItem>()
.or().eq(!Cools.isEmpty(code), WarehouseAreasItem::getTrackCode, code)
.or().eq(!Cools.isEmpty(batch), WarehouseAreasItem::getSplrBatch, batch)
- .or().eq(!Cools.isEmpty(fieldIndex), WarehouseAreasItem::getFieldsIndex, fieldIndex)
+ .or().eq(WarehouseAreasItem::getFieldsIndex, fieldIndex)
.or().eq(!Cools.isEmpty(matnrCode), WarehouseAreasItem::getMatnrCode, matnrCode)
.or().eq(!Cools.isEmpty(asnCode), WarehouseAreasItem::getAsnCode, asnCode);
List<WarehouseAreasItem> list = warehouseAreasItemService.list(queryWrapper);
- list.removeIf(e -> e.getAnfme() <= e.getWorkQty());
+ if (!list.isEmpty()) {
+ list.removeIf(e -> e.getAnfme() <= e.getWorkQty());
+ }
list.forEach(item -> {
Map<String, String> fields = FieldsUtils.getFields(item.getFieldsIndex());
item.setExtendFields(fields);
@@ -930,27 +952,36 @@
*/
@Override
public R getItemByContainer(Map<String, Object> params) {
-// if (Objects.isNull(params.get("code"))) {
-// throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
-// }
//鑾峰彇缁勬嫋鏈敓鎴愪换鍔$殑缁勬嫋妗�
List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val));
Short flagDefect = 0;
if (!Objects.isNull(params.get("type")) && params.get("type").equals("defective")) {
flagDefect = 1;
}
- List<WaitPakin> waitPakin = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>()
+ WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>()
.eq(WaitPakin::getBarcode, params.get("barcode").toString())
-// .eq(WaitPakin::getFlagDefect, flagDefect)
+ .eq(WaitPakin::getFlagDefect, flagDefect)
.in(WaitPakin::getIoStatus, asList));
- if (!Cools.isEmpty(waitPakin)) {
- throw new CoolException("鎵樼洏涓嶅彲鐢�,鍦ㄧ粍鎵樹腑宸插瓨鍦�");
+// if (!Cools.isEmpty(waitPakin)) {
+// throw new CoolException("鎵樼洏涓嶅彲鐢�,鍦ㄧ粍鎵樹腑宸插瓨鍦�");
+// }
+ List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, params.get("barcode").toString()));
+ if (!tasks.isEmpty()) {
+ throw new CoolException("鎵樼洏鐮佸凡鍦ㄤ换鍔℃。鎵ц锛侊紒");
}
List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, params.get("barcode").toString()));
if (!Cools.isEmpty(locs)) {
throw new CoolException("鎵樼洏涓嶅彲鐢紝鍦ㄥ簱浣嶄腑宸插瓨鍦�");
}
- return R.ok("鎵樼洏鍙敤");
+// List<WaitPakinItem> items = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, waitPakin.getId()));
+// items.forEach(item -> {
+// FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>().eq(FieldsItem::getUuid, item.getFieldsIndex()).last("limit 1"));
+// if (!Objects.isNull(fieldsItem) && !Objects.isNull(item.getFieldsIndex())) {
+// Map<String, String> fields = FieldsUtils.getFields(item.getFieldsIndex());
+// item.setExtendFields(fields);
+// }
+// });
+ return R.ok();
}
/**
@@ -965,9 +996,6 @@
if (Cools.isEmpty(params.get("barcode")) && Cools.isEmpty(params.get("code"))) {
throw new CoolException("瀹瑰櫒鍙蜂笌缁勬墭妗g紪鐮佷笉鑳藉叏涓虹┖");
}
- //鑾峰彇缁勬嫋鏈敓鎴愪换鍔$殑缁勬嫋妗�
-// List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val));
-
WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>()
.eq(!Cools.isEmpty(params.get("barcode")), WaitPakin::getBarcode, params.get("barcode"))
.eq(!Cools.isEmpty(params.get("code")), WaitPakin::getCode, params.get("code"))
--
Gitblit v1.9.1