Commit cc2431cd by 崔彦峰

fix(goods): 修复商品列表提交服务中的成本计算逻辑

- 在默认产品成本获取条件中增加serviceItem非空校验
- 添加查询服务项目的入参和响应日志记录
- 添加查询产品成本的入参和响应日志记录
- 优化成本计算流程的日志输出便于调试
1 parent 30f784bc
...@@ -3013,7 +3013,7 @@ public class GoodsListingSubmitService { ...@@ -3013,7 +3013,7 @@ public class GoodsListingSubmitService {
// 这里只要模板里配置了成本获取方式,就直接在导入阶段算出并写入明细表。 // 这里只要模板里配置了成本获取方式,就直接在导入阶段算出并写入明细表。
if (Objects.equals(upgradeProductCostStyle, CostStyleEnum.CUSTOM_COST.getValue())) { if (Objects.equals(upgradeProductCostStyle, CostStyleEnum.CUSTOM_COST.getValue())) {
upgradeProductCost = parseAmountWithRange(row.getUpgradeProductCost(), BigDecimal.ZERO, CommonConstants.DECIMAL_VALUE_ALMOST_MILLION); upgradeProductCost = parseAmountWithRange(row.getUpgradeProductCost(), BigDecimal.ZERO, CommonConstants.DECIMAL_VALUE_ALMOST_MILLION);
} else if (Objects.equals(upgradeProductCostStyle, CostStyleEnum.DEFAULT_PRODUCT_COST.getValue())) { } else if (Objects.equals(upgradeProductCostStyle, CostStyleEnum.DEFAULT_PRODUCT_COST.getValue()) && StringUtils.isNotBlank(serviceItem)) {
// TODO 默认带入产品成本,后续补充自动取值逻辑 // TODO 默认带入产品成本,后续补充自动取值逻辑
RpcPagination<ConstructionServiceItmesDTO> pagination = new RpcPagination<>(); RpcPagination<ConstructionServiceItmesDTO> pagination = new RpcPagination<>();
ConstructionServiceItmesDTO request = new ConstructionServiceItmesDTO(); ConstructionServiceItmesDTO request = new ConstructionServiceItmesDTO();
...@@ -3022,11 +3022,16 @@ public class GoodsListingSubmitService { ...@@ -3022,11 +3022,16 @@ public class GoodsListingSubmitService {
pagination.setCondition(request); pagination.setCondition(request);
pagination.setPageNum(1); pagination.setPageNum(1);
pagination.setPageSize(1); pagination.setPageSize(1);
log.info("查询服务项目入参:businessCode:{},upgradeGoodsId:{},pagination:{}",businessCode,upgradeGoodsId,JSON.toJSONString(pagination));
RpcResponse<RpcPagination<ConstructionServiceItmes>> constructionItemPage = constructionRemote.findConstructionItemPage(pagination); RpcResponse<RpcPagination<ConstructionServiceItmes>> constructionItemPage = constructionRemote.findConstructionItemPage(pagination);
log.info("查询服务项目入参:businessCode:{},upgradeGoodsId:{},pagination:{},响应结果response:{}",businessCode,upgradeGoodsId,JSON.toJSONString(pagination),JSON.toJSONString(constructionItemPage));
if (constructionItemPage.isSuccess()) { if (constructionItemPage.isSuccess()) {
if (constructionItemPage.getResult() != null && CollectionUtils.isNotEmpty(constructionItemPage.getResult().getList())) { if (constructionItemPage.getResult() != null && CollectionUtils.isNotEmpty(constructionItemPage.getResult().getList())) {
ConstructionServiceItmes constructionServiceItmes = constructionItemPage.getResult().getList().get(0); ConstructionServiceItmes constructionServiceItmes = constructionItemPage.getResult().getList().get(0);
log.info("查询产品成本入参:businessCode:{},upgradeGoodsId:{},constructionServiceItmes:{}",businessCode,upgradeGoodsId,JSON.toJSONString(constructionServiceItmes));
RpcResponse<ProductCostCalculateDTO> productCostCalculateDTORpcResponse = merchantGoodsInfoRemote.calculateProductCost(upgradeGoodsId, constructionServiceItmes.getId()); RpcResponse<ProductCostCalculateDTO> productCostCalculateDTORpcResponse = merchantGoodsInfoRemote.calculateProductCost(upgradeGoodsId, constructionServiceItmes.getId());
log.info("查询产品成本入参:businessCode:{},upgradeGoodsId:{},constructionServiceItmes:{},响应结果response:{}",
businessCode,upgradeGoodsId,JSON.toJSONString(constructionServiceItmes),JSON.toJSONString(productCostCalculateDTORpcResponse));
if (productCostCalculateDTORpcResponse.isSuccess()) { if (productCostCalculateDTORpcResponse.isSuccess()) {
if (productCostCalculateDTORpcResponse.getResult() != null) { if (productCostCalculateDTORpcResponse.getResult() != null) {
upgradeProductCost = productCostCalculateDTORpcResponse.getResult().getUpgradeCost(); upgradeProductCost = productCostCalculateDTORpcResponse.getResult().getUpgradeCost();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!