Showing
6 changed files
with
57 additions
and
4 deletions
| ... | ... | @@ -9,6 +9,7 @@ import com.lframework.xingyun.sc.entity.OrderDetailReport; |
| 9 | 9 | import io.swagger.annotations.ApiModelProperty; |
| 10 | 10 | |
| 11 | 11 | import lombok.Data; |
| 12 | +import org.apache.commons.lang3.StringUtils; | |
| 12 | 13 | |
| 13 | 14 | /** |
| 14 | 15 | * <p> |
| ... | ... | @@ -295,6 +296,16 @@ public class GetOrderDetailReportBo extends BaseBo<OrderDetailReport> { |
| 295 | 296 | |
| 296 | 297 | @Override |
| 297 | 298 | protected void afterInit(OrderDetailReport dto) { |
| 298 | - | |
| 299 | + if ("PROCESS_STD_AGMT".equals(dto.getContractType())) { | |
| 300 | + if (StringUtils.isBlank(this.returnShippingCost) && StringUtils.isNotBlank(this.shippingCost)) { | |
| 301 | + this.returnShippingCost = this.shippingCost; | |
| 302 | + } | |
| 303 | + this.shippingCost = null; | |
| 304 | + } else { | |
| 305 | + if (StringUtils.isBlank(this.shippingCost) && StringUtils.isNotBlank(this.returnShippingCost)) { | |
| 306 | + this.shippingCost = this.returnShippingCost; | |
| 307 | + } | |
| 308 | + this.returnShippingCost = null; | |
| 309 | + } | |
| 299 | 310 | } |
| 300 | 311 | } | ... | ... |
| ... | ... | @@ -354,6 +354,17 @@ public class QueryOrderDetailReportBo extends BaseBo<OrderDetailReport> { |
| 354 | 354 | this.specialRequirements = getDicItemNameOrOriginal(DIC_SPECIAL_REQUIREMENTS, this.specialRequirements); |
| 355 | 355 | this.deptCode = convertDeptNameToDeptCode(this.deptName); |
| 356 | 356 | this.contractTypeName = handleContractType(this.contractTypeCode); |
| 357 | + if ("PROCESS_STD_AGMT".equals(this.contractTypeCode)) { | |
| 358 | + if (StringUtils.isBlank(this.returnShippingCost) && StringUtils.isNotBlank(this.shippingCost)) { | |
| 359 | + this.returnShippingCost = this.shippingCost; | |
| 360 | + } | |
| 361 | + this.shippingCost = null; | |
| 362 | + } else { | |
| 363 | + if (StringUtils.isBlank(this.shippingCost) && StringUtils.isNotBlank(this.returnShippingCost)) { | |
| 364 | + this.shippingCost = this.returnShippingCost; | |
| 365 | + } | |
| 366 | + this.returnShippingCost = null; | |
| 367 | + } | |
| 357 | 368 | } |
| 358 | 369 | |
| 359 | 370 | private static String getDicItemNameOrOriginal(String dicCode, String itemCode) { | ... | ... |
| ... | ... | @@ -952,8 +952,17 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 952 | 952 | vo.setPerformance(orderDetailReport.getPerformance()); |
| 953 | 953 | vo.setPackaging(orderDetailReport.getPackaging()); |
| 954 | 954 | vo.setRemarks(orderDetailReport.getRemarks()); |
| 955 | - vo.setReturnShippingCost(orderDetailReport.getReturnShippingCost()); | |
| 956 | - vo.setShippingCost(orderDetailReport.getShippingCost()); | |
| 955 | + if (orderDetailReport.getContractType() != null && orderDetailReport.getContractType().contains("加工")) { | |
| 956 | + vo.setReturnShippingCost(StringUtils.isNotBlank(orderDetailReport.getReturnShippingCost()) | |
| 957 | + ? orderDetailReport.getReturnShippingCost() | |
| 958 | + : orderDetailReport.getShippingCost()); | |
| 959 | + vo.setShippingCost(null); | |
| 960 | + } else { | |
| 961 | + vo.setShippingCost(StringUtils.isNotBlank(orderDetailReport.getShippingCost()) | |
| 962 | + ? orderDetailReport.getShippingCost() | |
| 963 | + : orderDetailReport.getReturnShippingCost()); | |
| 964 | + vo.setReturnShippingCost(null); | |
| 965 | + } | |
| 957 | 966 | vo.setCustomerType(orderDetailReport.getCustomerType()); |
| 958 | 967 | vo.setQuality(orderDetailReport.getQuality()); |
| 959 | 968 | vo.setContractType(orderDetailReport.getContractType()); | ... | ... |
| ... | ... | @@ -577,8 +577,10 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR |
| 577 | 577 | String type = standard.getType(); |
| 578 | 578 | if ("PROCESS_STD_AGMT".equals(type)) { |
| 579 | 579 | vo.setReturnShippingCost(orderInfo.getShippingCost()); |
| 580 | + vo.setShippingCost(null); | |
| 580 | 581 | } else { |
| 581 | 582 | vo.setShippingCost(orderInfo.getShippingCost()); |
| 583 | + vo.setReturnShippingCost(null); | |
| 582 | 584 | } |
| 583 | 585 | vo.setCustomerType(orderDetailReport.getCustomerType()); |
| 584 | 586 | vo.setQuality(line.getQuality()); | ... | ... |
| ... | ... | @@ -380,8 +380,10 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 380 | 380 | String type = standard.getType(); |
| 381 | 381 | if ("PROCESS_STD_AGMT".equals(type)) { |
| 382 | 382 | vo.setReturnShippingCost(purchaseOrderInfo.getShippingCost()); |
| 383 | + vo.setShippingCost(null); | |
| 383 | 384 | } else { |
| 384 | 385 | vo.setShippingCost(purchaseOrderInfo.getShippingCost()); |
| 386 | + vo.setReturnShippingCost(null); | |
| 385 | 387 | } |
| 386 | 388 | if (customerCredit != null) { |
| 387 | 389 | SysDataDicItem dataDicItem = sysDataDicItemService.findByCode("ENTERPRISE_TYPE", customerCredit.getEnterpriseType()); | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/statistics/OrderDetailReportServiceImpl.java
| ... | ... | @@ -250,6 +250,23 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
| 250 | 250 | log.error("超协价格式错误,使用原始销售价。value=" + assessmentExceedsAgreement); |
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | + | |
| 254 | + String shippingCost = StringUtil.isBlank(vo.getShippingCost()) ? null : vo.getShippingCost(); | |
| 255 | + String returnShippingCost = null; | |
| 256 | + boolean isProcessContract = false; | |
| 257 | + PurchaseOrderLine purchaseOrderLine = purchaseOrderLineService.findById(vo.getPurchaseOrderLineId()); | |
| 258 | + if (purchaseOrderLine != null && StringUtils.isNotBlank(purchaseOrderLine.getPurchaseOrderId())) { | |
| 259 | + PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(purchaseOrderLine.getPurchaseOrderId()); | |
| 260 | + if (purchaseOrderInfo != null && StringUtils.isNotBlank(purchaseOrderInfo.getContractId())) { | |
| 261 | + ContractDistributorStandard standard = contractDistributorStandardService.findById(purchaseOrderInfo.getContractId()); | |
| 262 | + isProcessContract = standard != null && "PROCESS_STD_AGMT".equals(standard.getType()); | |
| 263 | + } | |
| 264 | + } | |
| 265 | + if (isProcessContract) { | |
| 266 | + returnShippingCost = shippingCost; | |
| 267 | + shippingCost = null; | |
| 268 | + } | |
| 269 | + | |
| 253 | 270 | LambdaUpdateWrapper<OrderDetailReport> updateWrapper = Wrappers.lambdaUpdate(OrderDetailReport.class) |
| 254 | 271 | .set(OrderDetailReport::getDeliveryDate, vo.getDeliveryDate() == null ? null : vo.getDeliveryDate()) |
| 255 | 272 | .set(OrderDetailReport::getAssessmentExceedsAgreement, StringUtil.isBlank(vo.getAssessmentExceedsAgreement()) ? null : vo.getAssessmentExceedsAgreement()) |
| ... | ... | @@ -262,7 +279,8 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
| 262 | 279 | .set(OrderDetailReport::getPerformance, StringUtil.isBlank(vo.getPerformance()) ? null : vo.getPerformance()) |
| 263 | 280 | .set(OrderDetailReport::getPackaging, StringUtil.isBlank(vo.getPackaging()) ? null : vo.getPackaging()) |
| 264 | 281 | .set(OrderDetailReport::getRemarks, StringUtil.isBlank(vo.getRemarks()) ? null : vo.getRemarks()) |
| 265 | - .set(OrderDetailReport::getShippingCost, StringUtil.isBlank(vo.getShippingCost()) ? null : vo.getShippingCost()) | |
| 282 | + .set(OrderDetailReport::getShippingCost, shippingCost) | |
| 283 | + .set(OrderDetailReport::getReturnShippingCost, returnShippingCost) | |
| 266 | 284 | .set(OrderDetailReport::getSuggestedPrice, StringUtil.isBlank(vo.getSuggestedPrice()) ? null : vo.getSuggestedPrice()) |
| 267 | 285 | .set(OrderDetailReport::getProductionProcess, StringUtil.isBlank(vo.getProductionProcess()) ? null : vo.getProductionProcess()) |
| 268 | 286 | .eq(OrderDetailReport::getShowOrder, 0) | ... | ... |