|
@@ -38,7 +38,6 @@ import org.springblade.los.finance.fee.mapper.FeeCenterMapper;
|
|
|
import org.springblade.los.trade.entity.AgentItems;
|
|
import org.springblade.los.trade.entity.AgentItems;
|
|
|
import org.springblade.los.trade.entity.InOutStorage;
|
|
import org.springblade.los.trade.entity.InOutStorage;
|
|
|
import org.springblade.los.trade.entity.Storage;
|
|
import org.springblade.los.trade.entity.Storage;
|
|
|
-import org.springblade.los.trade.entity.StorageFeeItems;
|
|
|
|
|
import org.springblade.los.trade.mapper.AgentItemsMapper;
|
|
import org.springblade.los.trade.mapper.AgentItemsMapper;
|
|
|
import org.springblade.los.trade.mapper.InOutStorageMapper;
|
|
import org.springblade.los.trade.mapper.InOutStorageMapper;
|
|
|
import org.springblade.los.trade.service.IInOutStorageService;
|
|
import org.springblade.los.trade.service.IInOutStorageService;
|
|
@@ -233,7 +232,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
agentItemsMapper.updateById(items);
|
|
agentItemsMapper.updateById(items);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
inOutStorage.setWarehouseUnitPrice(inOutStorage.getPrice());
|
|
inOutStorage.setWarehouseUnitPrice(inOutStorage.getPrice());
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -260,7 +259,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
baseMapper.updateById(inStorage);
|
|
baseMapper.updateById(inStorage);
|
|
|
Bills bills = billsMapper.selectById(inOutStorage.getPid());
|
|
Bills bills = billsMapper.selectById(inOutStorage.getPid());
|
|
|
if (bills != null) {
|
|
if (bills != null) {
|
|
|
- Storage storage = storageService.getById(inOutStorage.getWarehouseId());
|
|
|
|
|
|
|
+ /*Storage storage = storageService.getById(inOutStorage.getWarehouseId());
|
|
|
if (storage == null) {
|
|
if (storage == null) {
|
|
|
throw new RuntimeException("未查到可用仓库,请先维护");
|
|
throw new RuntimeException("未查到可用仓库,请先维护");
|
|
|
}
|
|
}
|
|
@@ -271,6 +270,13 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
.eq(StorageFeeItems::getGoodsType, inOutStorage.getGoodsType()));
|
|
.eq(StorageFeeItems::getGoodsType, inOutStorage.getGoodsType()));
|
|
|
if (ObjectUtils.isNull(storageFeeItems)) {
|
|
if (ObjectUtils.isNull(storageFeeItems)) {
|
|
|
throw new RuntimeException("未查到可用仓储费规则,请先维护");
|
|
throw new RuntimeException("未查到可用仓储费规则,请先维护");
|
|
|
|
|
+ }*/
|
|
|
|
|
+ BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
|
|
|
|
|
+ .eq(BFees::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
+ .eq(BFees::getIsDeleted, 0)
|
|
|
|
|
+ .eq(BFees::getCode, "CCF"));
|
|
|
|
|
+ if (fees == null) {
|
|
|
|
|
+ throw new RuntimeException("请先维护仓储费用基础信息");
|
|
|
}
|
|
}
|
|
|
long nd = 1000 * 24 * 60 * 60;
|
|
long nd = 1000 * 24 * 60 * 60;
|
|
|
long diff = inOutStorage.getOutStorageDate().getTime() - inStorage.getStorageDate().getTime();
|
|
long diff = inOutStorage.getOutStorageDate().getTime() - inStorage.getStorageDate().getTime();
|
|
@@ -279,8 +285,10 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
StringBuilder remark = new StringBuilder("仓储费:");
|
|
StringBuilder remark = new StringBuilder("仓储费:");
|
|
|
BigDecimal outWeight = inOutStorage.getOutWeight().divide(new BigDecimal("1000"), 4, RoundingMode.HALF_UP);
|
|
BigDecimal outWeight = inOutStorage.getOutWeight().divide(new BigDecimal("1000"), 4, RoundingMode.HALF_UP);
|
|
|
BigDecimal dayDecimal = new BigDecimal(day);
|
|
BigDecimal dayDecimal = new BigDecimal(day);
|
|
|
- BigDecimal amountSum = dayDecimal.multiply(storageFeeItems.getPrice()).multiply(outWeight);
|
|
|
|
|
- remark.append(day).append("天*").append(storageFeeItems.getPrice()).append("元*").append(outWeight).append("吨=").append(amountSum).append("元 ");
|
|
|
|
|
|
|
+// BigDecimal amountSum = dayDecimal.multiply(storageFeeItems.getPrice()).multiply(outWeight);
|
|
|
|
|
+ BigDecimal amountSum = dayDecimal.multiply(inOutStorage.getStorageFeePriceD()).multiply(outWeight);
|
|
|
|
|
+// remark.append(day).append("天*").append(storageFeeItems.getPrice()).append("元*").append(outWeight).append("吨=").append(amountSum).append("元 ");
|
|
|
|
|
+ remark.append(day).append("天*").append(inOutStorage.getStorageFeePriceD()).append("元*").append(outWeight).append("吨=").append(amountSum).append("元 ");
|
|
|
FeeCenter feeCenter = new FeeCenter();
|
|
FeeCenter feeCenter = new FeeCenter();
|
|
|
feeCenter.setCreateTime(new Date());
|
|
feeCenter.setCreateTime(new Date());
|
|
|
feeCenter.setCreateUser(AuthUtil.getUserId());
|
|
feeCenter.setCreateUser(AuthUtil.getUserId());
|
|
@@ -308,10 +316,6 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
feeCenter.setPodCode(bills.getPodCode());
|
|
feeCenter.setPodCode(bills.getPodCode());
|
|
|
feeCenter.setPodCnName(bills.getPodCnName());
|
|
feeCenter.setPodCnName(bills.getPodCnName());
|
|
|
feeCenter.setPodEnName(bills.getPodEnName());
|
|
feeCenter.setPodEnName(bills.getPodEnName());
|
|
|
- BFees fees = bFeesService.getById(storageFeeItems.getFeeId());
|
|
|
|
|
- if (fees == null) {
|
|
|
|
|
- throw new RuntimeException("请先维护" + storageFeeItems.getFeeName() + "费用信息");
|
|
|
|
|
- }
|
|
|
|
|
feeCenter.setFeeId(fees.getId());
|
|
feeCenter.setFeeId(fees.getId());
|
|
|
feeCenter.setFeeCode(fees.getCode());
|
|
feeCenter.setFeeCode(fees.getCode());
|
|
|
feeCenter.setFeeCnName(fees.getCnName());
|
|
feeCenter.setFeeCnName(fees.getCnName());
|
|
@@ -325,7 +329,8 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
feeCenter.setElementsEnName(fees.getElementsEnName());
|
|
feeCenter.setElementsEnName(fees.getElementsEnName());
|
|
|
feeCenter.setUnitNo("JOB");
|
|
feeCenter.setUnitNo("JOB");
|
|
|
feeCenter.setQuantity(outWeight);
|
|
feeCenter.setQuantity(outWeight);
|
|
|
- feeCenter.setPrice(storageFeeItems.getPrice());
|
|
|
|
|
|
|
+// feeCenter.setPrice(storageFeeItems.getPrice());
|
|
|
|
|
+ feeCenter.setPrice(inOutStorage.getStorageFeePriceD());
|
|
|
feeCenter.setAmount(amountSum);
|
|
feeCenter.setAmount(amountSum);
|
|
|
feeCenter.setRemarks(remark.toString());
|
|
feeCenter.setRemarks(remark.toString());
|
|
|
feeCenter.setDays(Integer.parseInt(day + ""));
|
|
feeCenter.setDays(Integer.parseInt(day + ""));
|
|
@@ -334,8 +339,10 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
feeCenter.setSrcItemId(inOutStorage.getId());
|
|
feeCenter.setSrcItemId(inOutStorage.getId());
|
|
|
feeCenterMapper.insert(feeCenter);
|
|
feeCenterMapper.insert(feeCenter);
|
|
|
StringBuilder remarkC = new StringBuilder("仓储费:");
|
|
StringBuilder remarkC = new StringBuilder("仓储费:");
|
|
|
- BigDecimal amountSumC = dayDecimal.multiply(storageFeeItems.getPriceC()).multiply(outWeight);
|
|
|
|
|
- remarkC.append(day).append("天*").append(storageFeeItems.getPriceC()).append("元*").append(outWeight).append("吨=").append(amountSumC).append("元 ");
|
|
|
|
|
|
|
+// BigDecimal amountSumC = dayDecimal.multiply(storageFeeItems.getPriceC()).multiply(outWeight);
|
|
|
|
|
+ BigDecimal amountSumC = dayDecimal.multiply(inOutStorage.getStorageFeePriceC()).multiply(outWeight);
|
|
|
|
|
+// remarkC.append(day).append("天*").append(storageFeeItems.getPriceC()).append("元*").append(outWeight).append("吨=").append(amountSumC).append("元 ");
|
|
|
|
|
+ remarkC.append(day).append("天*").append(inOutStorage.getStorageFeePriceC()).append("元*").append(outWeight).append("吨=").append(amountSumC).append("元 ");
|
|
|
FeeCenter feeCenterC = new FeeCenter();
|
|
FeeCenter feeCenterC = new FeeCenter();
|
|
|
feeCenterC.setCreateTime(new Date());
|
|
feeCenterC.setCreateTime(new Date());
|
|
|
feeCenterC.setCreateUser(AuthUtil.getUserId());
|
|
feeCenterC.setCreateUser(AuthUtil.getUserId());
|
|
@@ -376,7 +383,8 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
feeCenterC.setElementsEnName(fees.getElementsEnName());
|
|
feeCenterC.setElementsEnName(fees.getElementsEnName());
|
|
|
feeCenterC.setUnitNo("JOB");
|
|
feeCenterC.setUnitNo("JOB");
|
|
|
feeCenterC.setQuantity(outWeight);
|
|
feeCenterC.setQuantity(outWeight);
|
|
|
- feeCenterC.setPrice(storageFeeItems.getPriceC());
|
|
|
|
|
|
|
+// feeCenterC.setPrice(storageFeeItems.getPriceC());
|
|
|
|
|
+ feeCenterC.setPrice(inOutStorage.getStorageFeePriceC());
|
|
|
feeCenterC.setAmount(amountSumC);
|
|
feeCenterC.setAmount(amountSumC);
|
|
|
feeCenterC.setRemarks(remarkC.toString());
|
|
feeCenterC.setRemarks(remarkC.toString());
|
|
|
feeCenterC.setDays(Integer.parseInt(day + ""));
|
|
feeCenterC.setDays(Integer.parseInt(day + ""));
|
|
@@ -601,7 +609,7 @@ public class InOutStorageServiceImpl extends ServiceImpl<InOutStorageMapper, InO
|
|
|
//仓储单价 = 单价 + 本次分摊金额
|
|
//仓储单价 = 单价 + 本次分摊金额
|
|
|
inOutStorage.setWarehouseUnitPrice(inOutStorage.getPrice().add(sharedAmount));
|
|
inOutStorage.setWarehouseUnitPrice(inOutStorage.getPrice().add(sharedAmount));
|
|
|
text = text + "仓储单价(单价 + 本次分摊金额):" + inOutStorage.getWarehouseUnitPrice() + ";";
|
|
text = text + "仓储单价(单价 + 本次分摊金额):" + inOutStorage.getWarehouseUnitPrice() + ";";
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
text = text + "仓储单价:" + inOutStorage.getPrice() + ";";
|
|
text = text + "仓储单价:" + inOutStorage.getPrice() + ";";
|
|
|
}
|
|
}
|
|
|
return R.data(text);
|
|
return R.data(text);
|