Browse Source

君海:1.仓储费计算不允许计费截止日期重复
2.海运进口平均单价计算公式修改为金额/净重
3.海运进口出入库计算货值公式改为净重*平均单价

纪新园 9 months ago
parent
commit
f75127c896

+ 5 - 20
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/InOutStorageServiceImpl.java

@@ -230,11 +230,8 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 			} else {
 			} else {
 				inOutStorage.setWarehouseUnitPrice(inOutStorage.getPrice());
 				inOutStorage.setWarehouseUnitPrice(inOutStorage.getPrice());
 			}
 			}
-			if (billingRules) {
-				inOutStorage.setSurplusGoodsAmount(inOutStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
-			} else {
-				inOutStorage.setSurplusGoodsAmount(inOutStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
-			}
+			inOutStorage.setSurplusGoodsAmount(inOutStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
+
 		} else {
 		} else {
 			if (ObjectUtils.isNull(inOutStorage.getOutStorageDate())) {
 			if (ObjectUtils.isNull(inOutStorage.getOutStorageDate())) {
 				inOutStorage.setOutStorageDate(new Date());
 				inOutStorage.setOutStorageDate(new Date());
@@ -258,11 +255,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 			inStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
 			inStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
 			inStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
 			inStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
 			inStorage.setSurplusNetWeight(netWeight.subtract(inOutStorage.getOutNetWeight()));
 			inStorage.setSurplusNetWeight(netWeight.subtract(inOutStorage.getOutNetWeight()));
-			if (billingRules) {
-				inStorage.setSurplusGoodsAmount(inStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
-			} else {
-				inStorage.setSurplusGoodsAmount(inStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
-			}
+			inStorage.setSurplusGoodsAmount(inStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
 			inStorage.setUpdateTime(new Date());
 			inStorage.setUpdateTime(new Date());
 			inStorage.setUpdateUser(AuthUtil.getUserId());
 			inStorage.setUpdateUser(AuthUtil.getUserId());
 			inStorage.setUpdateUserName(AuthUtil.getUserName());
 			inStorage.setUpdateUserName(AuthUtil.getUserName());
@@ -271,11 +264,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 			inOutStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
 			inOutStorage.setSurplusQuantity(quantity.subtract(inOutStorage.getOutQuantity()));
 			inOutStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
 			inOutStorage.setSurplusWeight(grossWeight.subtract(inOutStorage.getOutWeight()));
 			inOutStorage.setSurplusNetWeight(netWeight.subtract(inOutStorage.getOutNetWeight()));
 			inOutStorage.setSurplusNetWeight(netWeight.subtract(inOutStorage.getOutNetWeight()));
-			if (billingRules) {
-				inOutStorage.setSurplusGoodsAmount(inStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
-			} else {
-				inOutStorage.setSurplusGoodsAmount(inStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
-			}
+			inOutStorage.setSurplusGoodsAmount(inStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
 			Bills bills = billsMapper.selectById(inOutStorage.getPid());
 			Bills bills = billsMapper.selectById(inOutStorage.getPid());
 			if (bills != null) {
 			if (bills != null) {
 				BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
 				BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
@@ -443,11 +432,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
 		if (storage == null) {
 		if (storage == null) {
 			throw new RuntimeException("未查到仓库信息");
 			throw new RuntimeException("未查到仓库信息");
 		}
 		}
-		if ("1".equals(storage.getBillingRules())) {
-			outStorage.setSurplusGoodsAmount(inOutStorage.getSurplusWeight().multiply(inOutStorage.getPrice()));
-		} else {
-			outStorage.setSurplusGoodsAmount(inOutStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
-		}
+		outStorage.setSurplusGoodsAmount(inOutStorage.getSurplusNetWeight().multiply(inOutStorage.getPrice()));
 		outStorage.setConfirmDispatchVehicles("0");
 		outStorage.setConfirmDispatchVehicles("0");
 		baseMapper.insert(outStorage);
 		baseMapper.insert(outStorage);
 		if (new BigDecimal("0.00").compareTo(inOutStorage.getSurplusQuantity()) == 0 &&
 		if (new BigDecimal("0.00").compareTo(inOutStorage.getSurplusQuantity()) == 0 &&

+ 5 - 0
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/PayableStorageFeesServiceImpl.java

@@ -279,6 +279,11 @@ public class PayableStorageFeesServiceImpl extends ServiceImpl<PayableStorageFee
 			.eq(PayableStorageFees::getStatus, "录入")
 			.eq(PayableStorageFees::getStatus, "录入")
 			.ne(PayableStorageFees::getId, payableStorageFees.getId()));
 			.ne(PayableStorageFees::getId, payableStorageFees.getId()));
 		if (!lastFeesList.isEmpty()) {
 		if (!lastFeesList.isEmpty()) {
+			for (PayableStorageFees item : lastFeesList) {
+				if (item.getChargingEndDate().compareTo(payableStorageFees.getChargingEndDate()) == 0) {
+					throw new RuntimeException("操作失败,计费截止时间已计算过");
+				}
+			}
 			throw new RuntimeException("操作失败,为了仓储费计算精准,每个仓库只允许存在一个录入单据。");
 			throw new RuntimeException("操作失败,为了仓储费计算精准,每个仓库只允许存在一个录入单据。");
 		}
 		}
 		if (payableStorageFees.getStorageFeesItemsList().isEmpty()) {
 		if (payableStorageFees.getStorageFeesItemsList().isEmpty()) {