wms费用科目bug修改;

This commit is contained in:
王奎兴
2026-04-11 17:19:37 +08:00
parent e9d4f699ee
commit 0a9e127d64
5 changed files with 49 additions and 18 deletions
@@ -288,6 +288,7 @@ public class HandoverTaskOrderApplicationService {
if (!handoverTaskOrderIds.isEmpty()) {
HandoverTaskOrderDO completeDO = new HandoverTaskOrderDO();
completeDO.setHandoverTaskOrderIds(handoverTaskOrderIds);
completeDO.setBillingJson(handoverTaskOrderDO.getBillingJson());
handoverTaskOrderDomainService.completeHandover(completeDO);
}
}
@@ -3,6 +3,7 @@ package com.mhd.wms.application.service.stockInOrder;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -297,6 +298,7 @@ public class StockInOrderApplicationService {
BigDecimal amount = account.getAmount();
String subjectCode = account.getSubjectCode();
String subjectName = account.getSubjectName();
String serviceItemsCode = account.getServiceItemsCode();
if (shipperId == null) {
continue;
@@ -309,8 +311,21 @@ public class StockInOrderApplicationService {
businessDataPushDTO.setBillAmount(account.getAmount());//计费金额
businessDataPushDTO.setEstimatedCost(account.getSettlementAmount());//计算金额
businessDataPushDTO.setOriginalBusinessNum(inOrderNumber);
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
if ("装卸费".equals(subjectName)) {
String amountJson = account.getAmountJson();
if (amountJson != null) {
List<Map<String, Object>> billingParamsList = JSON.parseObject(amountJson, new TypeReference<List<Map<String, Object>>>() {});
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
for (Map<String, Object> stringObjectMap : billingParamsList) {
Integer isFee = (Integer) stringObjectMap.get("isFee");
if (isFee==1) {
jsonObject.put((String) stringObjectMap.get("fields"), stringObjectMap.get("price"));
} else {
jsonObject.put((String) stringObjectMap.get("fields"), stringObjectMap.get("num"));
}
}
businessDataPushDTO.setDocumentFormJson(jsonObject.toJSONString());
}
/*if ("装卸费".equals(subjectName)) {
jsonObject.put("loading_unloading_unit_price", account.getPrice());//装卸货单价
jsonObject.put("cargo_quantity",account.getNum());//货物数量
} else if ("贴标费".equals(subjectName)) {
@@ -321,8 +336,8 @@ public class StockInOrderApplicationService {
} else if ("进出仓操作费".equals(subjectName)) {
jsonObject.put("cargo_quantity", account.getNum());//货物数量
jsonObject.put("warehouse_handling_unit_price",account.getPrice());//进出仓操作费单价
}
businessDataPushDTO.setDocumentFormJson(jsonObject.toJSONString());
}*/
businessDataPushDTO.setDocumentTypeCode("WMS_ckjccd");
businessDataPushDTO.setSettlementEntityId(shipperId);
businessDataPushDTO.setSecondSubjectCode(subjectCode);
@@ -360,20 +375,20 @@ public class StockInOrderApplicationService {
businessDataPushDTO.setBillAmount(account.getAmount());//计费金额
businessDataPushDTO.setEstimatedCost(account.getSettlementAmount());//计算金额
businessDataPushDTO.setOriginalBusinessNum(inOrderNumber);
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
if ("装卸费".equals(subjectName)) {
jsonObject.put("loading_unloading_unit_price", account.getPrice());//装卸货单价
jsonObject.put("cargo_quantity",account.getNum());//货物数量
} else if ("贴标费".equals(subjectName)) {
jsonObject.put("wooden_case_labeling_unit_price", account.getPrice());//木箱单价
jsonObject.put("carton_labeling_unit_price",account.getPrice());//纸箱单价
jsonObject.put("wooden_case_quantity",account.getNum());//木箱数量
jsonObject.put("carton_quantity",account.getNum());//纸箱数量
} else if ("进出仓操作费".equals(subjectName)) {
jsonObject.put("cargo_quantity", account.getNum());//货物数量
jsonObject.put("warehouse_handling_unit_price",account.getPrice());//进出仓操作费单价
String amountJson = account.getAmountJson();
if (amountJson!=null) {
List<Map<String, Object>> billingParamsList = JSON.parseObject(amountJson, new TypeReference<List<Map<String, Object>>>() {});
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
for (Map<String, Object> stringObjectMap : billingParamsList) {
Integer isFee = (Integer) stringObjectMap.get("isFee");
if (isFee==1) {
jsonObject.put((String) stringObjectMap.get("fields"), stringObjectMap.get("price"));
} else {
jsonObject.put((String) stringObjectMap.get("fields"), stringObjectMap.get("num"));
}
}
businessDataPushDTO.setDocumentFormJson(jsonObject.toJSONString());
}
businessDataPushDTO.setDocumentFormJson(jsonObject.toJSONString());
businessDataPushDTO.setDocumentTypeCode("WMS_ckjccd");
businessDataPushDTO.setSettlementEntityId(shipperId);
businessDataPushDTO.setSecondSubjectCode(subjectCode);
@@ -39,6 +39,7 @@ import com.mhd.wms.domain.receiptMaterialDetail.repository.todo.ReceiptMaterialD
import com.mhd.wms.domain.receiptMaterialDetail.service.ReceiptMaterialDetailDomainService;
import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount;
import com.mhd.wms.domain.receiptOrderAccount.repository.facade.IReceiptOrderAccountService;
import com.mhd.wms.domain.stockInOrder.repository.facade.IStockInOrderService;
import com.mhd.wms.domain.stockInOrder.repository.todo.StockInOrderDO;
import com.mhd.wms.domain.stockReceiptOrder.repository.po.StockReceiptOrderPO;
import com.mhd.wms.domain.stockReceiptOrder.repository.todo.NoReceiptOrderDO;
@@ -97,6 +98,8 @@ public class StockReceiptOrderApplicationService {
private IdGenerator idGenerator;
@Autowired
private IReceiptOrderAccountService receiptOrderAccountService;
@Autowired
private IStockInOrderService stockInOrderService;
/**
@@ -767,6 +767,10 @@ public class StockReceiptOrderDomainService {
String inOrderNumber = stockReceiptOrderDTO.getInOrderNumber();
Long receiptOrderId = stockReceiptOrderDTO.getReceiptOrderId();
String billingJson = stockReceiptOrderDTO.getBillingJson();
if (inOrderNumber == null) {
StockReceiptOrder stockReceiptOrder = stockReceiptOrderService.getById(receiptOrderId);
inOrderNumber = stockReceiptOrder.getInOrderNumber();
}
stockInOrderService.update(null, new UpdateWrapper<StockInOrder>().lambda().set(StockInOrder::getBillingJson,billingJson).eq(StockInOrder::getInOrderNumber, inOrderNumber));
stockReceiptOrderService.update(null, new UpdateWrapper<StockReceiptOrder>().lambda().set(StockReceiptOrder::getBillingJson,billingJson).eq(StockReceiptOrder::getReceiptOrderId, receiptOrderId));
}
@@ -98,10 +98,18 @@ public class StockReceiptOrderApi extends BaseController {
return toAjax(stockReceiptOrderApplicationService.completeReceipt(receiptOrderId));
}
@ApiOperation("完成收货")
@PostMapping("/completeReceiptAndUpdateJson")
public AjaxResult completeReceipt(@RequestBody StockReceiptOrderDTO stockReceiptOrderDTO) {
Long receiptOrderId = stockReceiptOrderDTO.getReceiptOrderId();
stockReceiptOrderApplicationService.updateInOrder(stockReceiptOrderDTO);
return toAjax(stockReceiptOrderApplicationService.completeReceipt(receiptOrderId));
}
@ApiOperation("整单收货")
@GetMapping("/entireReceipt/{receiptOrderIds}")
public AjaxResult entireReceipt(@PathVariable("receiptOrderIds") Long[] receiptOrderIds) {
return toAjax(stockReceiptOrderApplicationService.entireReceipt(receiptOrderIds));
}
}
}