From f56457b75944ef2def631ad5ed07f302123d3f75 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期五, 28 十一月 2025 21:05:41 +0800
Subject: [PATCH] 小数精确到6位
---
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java | 49 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 36 insertions(+), 13 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 9398609..d1cfe78 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
@@ -251,7 +254,7 @@
throw new CoolException("鏁版嵁閿欒锛氫富鍗曚笉瀛樺湪锛侊紒");
}
//TODO /**鏀惰揣鏁伴噺绱姞锛�1. 浼氬嚭瓒呮敹鎯呭喌 2. 浼氭湁鏀惰揣涓嶈冻鎯呭喌*/
- Double rcptedQty = Math.round((wkOrder.getQty() + receiptQty) * 100) / 100.0;
+ Double rcptedQty = Math.round((wkOrder.getQty() + receiptQty) * 1000000) / 1000000.0;
wkOrder.setQty(rcptedQty).setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_EXCE_ING.val);
if (!asnOrderMapper.updateById(wkOrder)) {
throw new CoolException("宸叉敹璐ф暟閲忎慨鏀瑰け璐ワ紒锛�");
@@ -299,7 +302,7 @@
throw new CoolException("璇疯緭鍏ユ纭殑鏃堕棿鏍煎紡锛侊紒");
}
- Double itemRcptQty = Math.round((dto.getReceiptQty() + orderItem.getQty()) * 100) / 100.0;
+ Double itemRcptQty = Math.round((dto.getReceiptQty() + orderItem.getQty()) * 1000000) / 1000000.0;
Boolean allowOver = false;
if (!Objects.isNull(config)) {
if (Boolean.parseBoolean(config.getVal())) {
@@ -412,7 +415,7 @@
if (!Objects.isNull(serviceOne)) {
item.setId(serviceOne.getId());
- Double anfme = Math.round((item.getAnfme() + serviceOne.getAnfme()) * 100) / 100.0;
+ Double anfme = Math.round((item.getAnfme() + serviceOne.getAnfme()) * 1000000) / 1000000.0;
item.setAnfme(anfme);
}
@@ -533,16 +536,34 @@
* @time 2025/4/7 16:58
*/
@Override
- public R getDeltByCode(Map<String, Object> params) {
- Object code = params.get("code");
- Object matnrCode = params.get("matnrCode");
- Object asnCode = params.get("asnCode");
- Object crushNo = params.get("fieldsIndex");
- Object batch = params.get("batch");
+ public R getDeltByCode(Map<String, String> params) {
+ String code = params.get("code");
+ String matnrCode = params.get("matnrCode");
+ String asnCode = params.get("asnCode");
+ String crushNo = params.get("fieldsIndex");
+ String batch = params.get("batch");
+// String barcode = params.get("barcode");
+
+ if (Objects.isNull(crushNo)) {
+ throw new CoolException("绁ㄥ彿涓嶈兘涓虹┖锛侊紒");
+ }
+// if (Objects.isNull(code)) {
+// throw new CoolException("瀹瑰櫒鍙蜂笉鑳戒负绌猴紒锛�");
+// }
+// BasContainer container = basContainerService.getOne(new LambdaQueryWrapper<BasContainer>().eq(BasContainer::getCode, barcode));
+// 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 +572,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);
@@ -1126,7 +1149,7 @@
if (Objects.isNull(stockItem)) {
detlsDto.setStockQty(0.0);
} else {
- Double anfme = Math.round((stockItem.getAnfme() + stockItem.getWorkQty()) * 100) / 100.0;
+ Double anfme = Math.round((stockItem.getAnfme() + stockItem.getWorkQty()) * 1000000) / 1000000.0;
detlsDto.setStockQty(anfme);
}
--
Gitblit v1.9.1