diff --git a/bms-back/bms-admin/src/main/java/com/bms/web/controller/data/PayPostcodeController.java b/bms-back/bms-admin/src/main/java/com/bms/web/controller/data/PayPostcodeController.java index fe81bfad..bddf6764 100644 --- a/bms-back/bms-admin/src/main/java/com/bms/web/controller/data/PayPostcodeController.java +++ b/bms-back/bms-admin/src/main/java/com/bms/web/controller/data/PayPostcodeController.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import com.bms.common.annotation.Log; @@ -43,6 +44,15 @@ public class PayPostcodeController extends BaseController return getDataTable(list); } + /** 按国家去重区块,供附加费编辑分区下拉 */ + @PreAuthorize("@ss.hasPermi('data:payPostcode:list')") + @GetMapping("/blockOptions") + public AjaxResult blockOptions(@RequestParam(required = false) String countryCode, + @RequestParam(required = false) String countryName) + { + return success(payPostcodeService.selectBlockTitlesByCountry(countryCode, countryName)); + } + @PreAuthorize("@ss.hasPermi('data:payPostcode:query')") @GetMapping("/{groupId}") public AjaxResult getInfo(@PathVariable Long groupId) diff --git a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/BillingController.java b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/BillingController.java index bd66466a..5ba7bd8e 100644 --- a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/BillingController.java +++ b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/BillingController.java @@ -147,6 +147,22 @@ public class BillingController extends BaseController @PreAuthorize("@ss.hasPermi('price:billing:bill')") @GetMapping("/bill/list") public TableDataInfo billList(PrcOrderBill query) + { + return doBillList(query); + } + + /** + * POST 计费列表:大批单号等筛选放请求体,避免 GET URL 过长触发 HTTP 431。 + * pageNum/pageSize 仍走 URL 查询参数,供 PageHelper 读取。 + */ + @PreAuthorize("@ss.hasPermi('price:billing:bill')") + @PostMapping("/bill/list") + public TableDataInfo billListPost(@RequestBody(required = false) PrcOrderBill query) + { + return doBillList(query); + } + + private TableDataInfo doBillList(PrcOrderBill query) { if (query == null) { @@ -220,6 +236,19 @@ public class BillingController extends BaseController return getDataTable(list); } + /** + * POST 列表:筛选(尤其是大批量单号)放请求体,避免 GET URL 过长触发 HTTP 431。 + * pageNum/pageSize 仍走 URL 查询参数,供 TableSupport/PageHelper 读取。 + */ + @PreAuthorize("@ss.hasPermi('price:orderBill:list')") + @PostMapping("/orderBill/list") + public TableDataInfo orderBillListPost(@RequestBody(required = false) PrcOrderBill query) + { + startPage(); + List list = prcOrderBillService.selectBillList(query == null ? new PrcOrderBill() : query); + return getDataTable(list); + } + /** 订单列表弹窗:按 billId 查询计费失败原因(受数据权限控制)。 */ @PreAuthorize("@ss.hasPermi('price:orderBill:list')") diff --git a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/SurchargeController.java b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/SurchargeController.java index effc5f6b..fd1a7493 100644 --- a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/SurchargeController.java +++ b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/SurchargeController.java @@ -20,6 +20,7 @@ import com.bms.common.core.page.TableDataInfo; import com.bms.common.enums.BusinessType; import com.bms.price.domain.PrcSurcharge; import com.bms.price.domain.PrcSurchargeRel; +import com.bms.price.service.IPayPostcodeService; import com.bms.price.service.IPrcSurchargeRelService; import com.bms.price.service.IPrcSurchargeService; @@ -38,6 +39,9 @@ public class SurchargeController extends BaseController @Autowired private IPrcSurchargeRelService surchargeRelService; + @Autowired + private IPayPostcodeService payPostcodeService; + @PreAuthorize("@ss.hasPermi('price:surcharge:list')") @GetMapping("/list") public TableDataInfo list(PrcSurcharge surcharge) @@ -47,6 +51,15 @@ public class SurchargeController extends BaseController return getDataTable(list); } + /** 按国家从应付邮编配置拉取区块/分区选项 */ + @PreAuthorize("@ss.hasPermi('price:surcharge:list') or @ss.hasPermi('price:surcharge:query') or @ss.hasPermi('price:surcharge:add') or @ss.hasPermi('price:surcharge:edit')") + @GetMapping("/blockOptions") + public AjaxResult blockOptions(@RequestParam(required = false) String countryCode, + @RequestParam(required = false) String countryName) + { + return success(payPostcodeService.selectBlockTitlesByCountry(countryCode, countryName)); + } + @PreAuthorize("@ss.hasPermi('price:surcharge:query')") @GetMapping("/{scId}") public AjaxResult getInfo(@PathVariable Long scId) diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcSurcharge.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcSurcharge.java index 212ab670..99266a8a 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcSurcharge.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcSurcharge.java @@ -16,8 +16,10 @@ public class PrcSurcharge extends BaseEntity private String scName; /** 字典 bms_fee_type */ private String feeType; - /** FIXED / WEIGHT / RATE */ + /** 计费方式:ALWAYS/每票都收、POSTCODE/命中邮编、ZONE/命中分区、EXTRA_KG/超重续收、WEIGHT/超重、SIZE/超尺寸、RETURN/退件、MANUAL/暂不计费 */ private String chargeType; + /** 渠道产品(字典 payment_product_type.dict_value) */ + private String dictValue; private BigDecimal chargeValue; private String currency; /** 字典 bms_round_mode:UP / DOWN / HALF_UP */ @@ -29,6 +31,8 @@ public class PrcSurcharge extends BaseEntity public static final String IS_DEL_YES = "1"; private String isDel; private String countryCode; + /** 分区/区块(对应 pay_postcode_group.block_title) */ + private String blockTitle; private String scNote; private Long tmsId; } diff --git a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayPostcodeMapper.java b/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayPostcodeMapper.java index 02bb6c98..8097bd09 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayPostcodeMapper.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayPostcodeMapper.java @@ -10,6 +10,10 @@ public interface PayPostcodeMapper { List selectGroupList(PayPostcodeGroup query); + /** 按国家去重区块标题 */ + List selectBlockTitlesByCountry(@Param("countryCode") String countryCode, + @Param("countryName") String countryName); + PayPostcodeGroup selectGroupById(Long groupId); int updateGroup(PayPostcodeGroup group); diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/IPayPostcodeService.java b/bms-back/bms-system/src/main/java/com/bms/price/service/IPayPostcodeService.java index 9b11e9ed..b8d88206 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/IPayPostcodeService.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/IPayPostcodeService.java @@ -10,6 +10,9 @@ public interface IPayPostcodeService { List selectGroupList(PayPostcodeGroup query); + /** 附加费分区下拉:按国家去重区块标题 */ + List selectBlockTitlesByCountry(String countryCode, String countryName); + PayPostcodeGroup selectGroupById(Long groupId); int updateGroup(PayPostcodeGroup group); diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayPostcodeServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayPostcodeServiceImpl.java index 3f07be82..2417c28b 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayPostcodeServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayPostcodeServiceImpl.java @@ -34,6 +34,12 @@ public class PayPostcodeServiceImpl implements IPayPostcodeService return payPostcodeMapper.selectGroupList(query); } + @Override + public List selectBlockTitlesByCountry(String countryCode, String countryName) + { + return payPostcodeMapper.selectBlockTitlesByCountry(countryCode, countryName); + } + @Override public PayPostcodeGroup selectGroupById(Long groupId) { diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java index 80aeb418..5ae57441 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcOrderBillServiceImpl.java @@ -1716,21 +1716,13 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService return BigDecimal.ZERO; } RoundingMode rm = resolveFeeRoundingMode(surcharge.getRoundMode()); - String chargeType = surcharge.getChargeType() == null ? "FIXED" : surcharge.getChargeType().toUpperCase(); - BigDecimal amount; - if ("WEIGHT".equals(chargeType)) + String chargeType = surcharge.getChargeType() == null ? "MANUAL" : surcharge.getChargeType().toUpperCase(); + // MANUAL=暂不计费;其他计费方式暂按固定金额 charge_value + if ("MANUAL".equals(chargeType)) { - amount = surcharge.getChargeValue().multiply(nz(weight)); + return BigDecimal.ZERO.setScale(4, rm); } - else if ("RATE".equals(chargeType)) - { - amount = nz(freightAmount).multiply(surcharge.getChargeValue()); - } - else - { - amount = surcharge.getChargeValue(); - } - return amount.setScale(4, rm); + return surcharge.getChargeValue().setScale(4, rm); } private RoundingMode resolveFeeRoundingMode(String roundMode) diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcSurchargeServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcSurchargeServiceImpl.java index 98eceeae..ccc06c97 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcSurchargeServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcSurchargeServiceImpl.java @@ -79,11 +79,13 @@ public class PrcSurchargeServiceImpl implements IPrcSurchargeService fresh.setScName(surcharge.getScName()); fresh.setFeeType(StringUtils.isNotEmpty(surcharge.getFeeType()) ? surcharge.getFeeType() : old.getFeeType()); fresh.setChargeType(surcharge.getChargeType()); + fresh.setDictValue(surcharge.getDictValue()); fresh.setChargeValue(surcharge.getChargeValue()); fresh.setCurrency(surcharge.getCurrency()); fresh.setRoundMode(surcharge.getRoundMode()); fresh.setSsCode(old.getSsCode()); fresh.setCountryCode(surcharge.getCountryCode()); + fresh.setBlockTitle(surcharge.getBlockTitle()); fresh.setScNote(surcharge.getScNote()); applyInsertDefaults(fresh); fresh.setCreateBy(operator); @@ -99,10 +101,12 @@ public class PrcSurchargeServiceImpl implements IPrcSurchargeService return eq(old.getScName(), updated.getScName()) && eq(old.getFeeType(), updated.getFeeType()) && eq(old.getChargeType(), updated.getChargeType()) + && eq(old.getDictValue(), updated.getDictValue()) && eqDecimal(old.getChargeValue(), updated.getChargeValue()) && eq(old.getCurrency(), updated.getCurrency()) && eq(old.getRoundMode(), updated.getRoundMode()) && eq(old.getCountryCode(), updated.getCountryCode()) + && eq(old.getBlockTitle(), updated.getBlockTitle()) && eq(old.getScNote(), updated.getScNote()); } @@ -161,6 +165,10 @@ public class PrcSurchargeServiceImpl implements IPrcSurchargeService { surcharge.setRoundMode("HALF_UP"); } + if (StringUtils.isEmpty(surcharge.getChargeType())) + { + surcharge.setChargeType("MANUAL"); + } } private void validate(PrcSurcharge surcharge) diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/TmsPriceQuoteServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/TmsPriceQuoteServiceImpl.java index 763ca04a..b147991f 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/TmsPriceQuoteServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/TmsPriceQuoteServiceImpl.java @@ -1841,21 +1841,13 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService return BigDecimal.ZERO; } RoundingMode rm = resolveRoundingMode(rel.getRoundMode()); - String chargeType = rel.getChargeType() == null ? "FIXED" : rel.getChargeType().toUpperCase(); - BigDecimal amount; - if ("WEIGHT".equals(chargeType)) + String chargeType = rel.getChargeType() == null ? "MANUAL" : rel.getChargeType().toUpperCase(); + // MANUAL=暂不计费;其他计费方式暂按固定金额 charge_value + if ("MANUAL".equals(chargeType)) { - amount = rel.getChargeValue().multiply(nvl(weight)); + return BigDecimal.ZERO.setScale(2, rm); } - else if ("RATE".equals(chargeType)) - { - amount = nvl(freightAmount).multiply(rel.getChargeValue()); - } - else - { - amount = rel.getChargeValue(); - } - return amount.setScale(2, rm); + return rel.getChargeValue().setScale(2, rm); } private void persistQuote(String quoteKey, TmsPriceQuoteRequest request, BigDecimal weight, diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PayPostcodeMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PayPostcodeMapper.xml index 719bfeef..be2da3d6 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PayPostcodeMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PayPostcodeMapper.xml @@ -30,6 +30,26 @@ order by group_id desc + +