diff --git a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PayOrderController.java b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PayOrderController.java index d17ed1dd..c187b945 100644 --- a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PayOrderController.java +++ b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PayOrderController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController; import com.bms.common.core.controller.BaseController; import com.bms.common.core.domain.AjaxResult; import com.bms.common.core.page.TableDataInfo; +import com.bms.price.domain.PayOrderFeeBatch; import com.bms.price.domain.PayOrderFeeLine; import com.bms.price.domain.PayOrderQuery; import com.bms.price.domain.PayOrderRecalcCommand; @@ -112,6 +113,19 @@ public class PayOrderController extends BaseController return success(payOrderListService.fees(billId)); } + /** + * 给勾选订单批量增加手工费用。创建人取当前登录用户,来源为手工,并记新增日志。 + * + * @param batch 订单和费用行 + * @return 写入的费用条数 + */ + @PreAuthorize("@ss.hasPermi('price:payOrder:feeBatch')") + @PostMapping("/fees/batch") + public AjaxResult addFees(@RequestBody PayOrderFeeBatch batch) + { + return success(payOrderListService.addManualFees(batch)); + } + /** * 在某一段手工增加一行应付费用。创建人取当前登录用户。 * diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PayOrderFeeBatch.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PayOrderFeeBatch.java new file mode 100644 index 00000000..a598a8b8 --- /dev/null +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/PayOrderFeeBatch.java @@ -0,0 +1,15 @@ +package com.bms.price.domain; + +import java.util.List; +import lombok.Data; + +/** 应付列表勾选订单后,批量写入同一组手工费用。 */ +@Data +public class PayOrderFeeBatch +{ + /** 勾选的计费订单 ID */ + private List billIds; + + /** 要加到每一票订单上的费用 */ + private List fees; +} diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PayOrderRow.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PayOrderRow.java index e2b45f8f..52556a83 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/PayOrderRow.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/PayOrderRow.java @@ -17,6 +17,9 @@ public class PayOrderRow private String trackingNo; + /** 客户编码,列表展示用 */ + private String customerCode; + private String customerName; private String productName; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPayBill.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPayBill.java index 9c16139a..99383101 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPayBill.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPayBill.java @@ -24,9 +24,21 @@ public class PrcPayBill implements Serializable private BigDecimal redlineAmount; /** 成本价合计(当前计费结果) */ private BigDecimal costAmount; - /** 应付合计(当前等于成本价,落库后按全部未删除明细重算) */ + /** 应付合计(当前等于成本价,落库后按全部未删除明细折人民币重算) */ private BigDecimal payTotal; + /** A段合计,人民币 */ + private BigDecimal amountA; + + /** B段合计,人民币 */ + private BigDecimal amountB; + + /** C段合计,人民币 */ + private BigDecimal amountC; + + /** D段合计,人民币 */ + private BigDecimal amountD; + /** 应付计费状态,字典 bms_pay_calc_status:1计费成功,2计费失败 */ private Integer payCalcStatus; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java index 2edcc59d..e888df6c 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/vo/TmsPriceQuoteResult.java @@ -72,6 +72,18 @@ public class TmsPriceQuoteResult implements Serializable private BigDecimal incomeTotal; /** 应付合计(订单账单);也是报价应付 */ private BigDecimal payTotal; + + /** 应付 A 段合计,来自 prc_pay_bill.amount_a */ + private BigDecimal amountA; + + /** 应付 B 段合计,来自 prc_pay_bill.amount_b */ + private BigDecimal amountB; + + /** 应付 C 段合计,来自 prc_pay_bill.amount_c */ + private BigDecimal amountC; + + /** 应付 D 段合计,来自 prc_pay_bill.amount_d */ + private BigDecimal amountD; /** 报价 / 历史字段;账单同步时与 incomeTotal 相同 */ private BigDecimal payableTotal; private String currency = "CNY"; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPayBillMapper.java b/bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPayBillMapper.java index 2aa4af89..8ef8a00a 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPayBillMapper.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPayBillMapper.java @@ -1,6 +1,5 @@ package com.bms.price.mapper; -import java.math.BigDecimal; import java.util.List; import org.apache.ibatis.annotations.Param; import com.bms.price.domain.PrcPayBill; @@ -64,8 +63,8 @@ public interface PrcPayBillMapper */ int refreshPayTotal(@Param("billIds") List billIds); - /** 把折成人民币后的应付汇总写到主表,明细金额和币种不动。 */ - int updateCnyPayTotal(@Param("billId") Long billId, @Param("payTotal") BigDecimal payTotal); + /** 把折成人民币后的应付总额和 ABCD 段合计写到主表,明细金额和币种不动。 */ + int updateCnyPayTotal(PrcPayBill row); /** 订单还没有应付主表时补一行,总额随后按明细重算。单次不超过 1000 个订单。 */ int insertMissingPayBills(@Param("billIds") List billIds, @Param("operator") String operator); diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/IPayOrderListService.java b/bms-back/bms-system/src/main/java/com/bms/price/service/IPayOrderListService.java index 4f44a9b0..f601878b 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/IPayOrderListService.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/IPayOrderListService.java @@ -2,6 +2,7 @@ package com.bms.price.service; import java.util.List; import com.bms.price.domain.PayOrderCostResult; +import com.bms.price.domain.PayOrderFeeBatch; import com.bms.price.domain.PayOrderFeeBoard; import com.bms.price.domain.PayOrderFeeLine; import com.bms.price.domain.PayOrderQuery; @@ -26,6 +27,14 @@ public interface IPayOrderListService */ PayOrderFeeLine addManualFee(String billId, PayOrderFeeLine line); + /** + * 给勾选的订单批量增加同一组手工费用。来源记 MANUAL,创建人是当前登录用户,并记新增日志。 + * + * @param batch 订单和费用行 + * @return 写入的费用条数 + */ + int addManualFees(PayOrderFeeBatch batch); + /** * 逻辑删除一条应付费用。已经进入应付账单的费用不能删。 * diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPayBillFeeService.java b/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPayBillFeeService.java index ad0bfe64..a52f81dc 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPayBillFeeService.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPayBillFeeService.java @@ -10,7 +10,7 @@ public interface IPrcPayBillFeeService { /** * 分批写入应付明细,并回写这些订单的应付总额。 - * 明细每批最多 1000 条,金额和币种按原样写入 prc_pay_bill_fee。汇总时外币按汇率折成人民币,只回写 prc_pay_bill.pay_total。 + * 明细每批最多 1000 条,金额和币种按原样写入 prc_pay_bill_fee。汇总时外币按汇率折成人民币,ABCD 段分别四舍五入到两位后写入 prc_pay_bill,应付总额取这四段之和。 * * @param fees 本次新增的应付明细 */ diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderCostServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderCostServiceImpl.java index 09fb14a6..3f962cf3 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderCostServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderCostServiceImpl.java @@ -698,6 +698,7 @@ public class PayOrderCostServiceImpl implements IPayOrderCostService scId = fallback++; } row.setScId(scId); + row.setFeeLevel("4"); String userId = PayFeeMoney.userId(); row.setAmount(fee.getAmount()); row.setCurrency(fee.getCurrency()); diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderListServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderListServiceImpl.java index 7ff153a4..ec922ca0 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderListServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayOrderListServiceImpl.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.UUID; +import java.util.concurrent.atomic.AtomicLong; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.security.core.context.SecurityContextHolder; @@ -23,6 +24,7 @@ import com.bms.common.utils.uuid.IdUtils; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.bms.price.domain.PayOrderCostResult; +import com.bms.price.domain.PayOrderFeeBatch; import com.bms.price.domain.PayOrderFeeBoard; import com.bms.price.domain.PrcPayBill; import com.bms.price.domain.PayOrderFeeLine; @@ -51,6 +53,10 @@ public class PayOrderListServiceImpl implements IPayOrderListService private static final int MAX_LADING_NOS = 10; + private static final int MAX_BATCH_LINES = 20; + + private static final AtomicLong MANUAL_SC_SEQ = new AtomicLong(); + private static final Map TITLES = new LinkedHashMap<>(); static @@ -434,67 +440,12 @@ public class PayOrderListServiceImpl implements IPayOrderListService public PayOrderFeeLine addManualFee(String billId, PayOrderFeeLine line) { PayOrderRow order = requireOrder(billId); - if (line == null) - { - throw new ServiceException("请填写费用"); - } - String level = line.getLevel() == null ? "" : line.getLevel().trim(); - if (!TITLES.containsKey(level)) - { - throw new ServiceException("请选择费用阶段"); - } - String feeName = firstText(line.getFeeName(), line.getFeeType()); - if (feeName.isEmpty()) - { - throw new ServiceException("请填写费用项"); - } - if (feeName.length() > 100) - { - feeName = feeName.substring(0, 100); - } - String feeType = firstText(line.getFeeType(), "MANUAL"); - if (feeType.length() > 30) - { - feeType = "MANUAL"; - } - if (line.getAmount() == null) - { - throw new ServiceException("请填写金额"); - } - String currency = firstText(line.getCurrency(), "CNY").toUpperCase(); - if (currency.length() > 10) - { - throw new ServiceException("币种过长"); - } - BigDecimal amount = line.getAmount().setScale(2, RoundingMode.HALF_UP); - if (amount.abs().compareTo(new BigDecimal("9999999999.99")) > 0) - { - throw new ServiceException("金额超出范围"); - } - String remark = line.getRemark() == null ? null : line.getRemark().trim(); - if (remark != null && remark.length() > 200) - { - throw new ServiceException("说明不能超过200字"); - } + PayOrderFeeLine ready = checkedLine(line); Long orderBillId = Long.valueOf(order.getBillId().trim()); - String operator = operator(); String userId = PayFeeMoney.userId(); - payBillMapper.insertMissingPayBills(List.of(orderBillId), operator); + payBillMapper.insertMissingPayBills(List.of(orderBillId), operator()); PrcPayBill payBill = payBillMapper.selectByBillId(orderBillId); - PrcPayBillFee fee = new PrcPayBillFee(); - fee.setFeeId(UUID.randomUUID().toString()); - fee.setBillId(orderBillId); - fee.setPayBillId(payBill == null ? null : payBill.getPayBillId()); - fee.setFeeType(feeType); - fee.setFeeName(feeName); - fee.setScId(manualScId()); - fee.setFeeLevel(level); - fee.setAmount(amount); - fee.setCurrency(currency); - fee.setRemark(remark == null || remark.isEmpty() ? null : remark); - fee.setFeeSource("MANUAL"); - fee.setCreateBy(userId); - fee.setUpdateBy(userId); + PrcPayBillFee fee = newManualFee(orderBillId, payBill == null ? null : payBill.getPayBillId(), ready, userId); payBillFeeMapper.insertManual(fee); payBillFeeService.refreshTotals(List.of(orderBillId)); payBillFeeLogService.record(fee, PayBillFeeLogService.ADD); @@ -502,6 +453,34 @@ public class PayOrderListServiceImpl implements IPayOrderListService return toLine(saved == null ? fee : saved); } + /** + * 同一组费用写到每一票勾选订单上。应付总额和 ABCD 段在写入后一起重算。 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int addManualFees(PayOrderFeeBatch batch) + { + List billIds = batchBillIds(batch); + List lines = batchLines(batch); + List orders = payOrderListMapper.selectByBillIds(billIds); + if (orders == null || orders.size() != billIds.size()) + { + throw new ServiceException("有订单不在应付列表中,请重新勾选"); + } + String userId = PayFeeMoney.userId(); + List fees = new ArrayList<>(billIds.size() * lines.size()); + for (Long billId : billIds) + { + for (PayOrderFeeLine line : lines) + { + fees.add(newManualFee(billId, null, line, userId)); + } + } + payBillFeeService.insertBatchAndRefreshTotals(fees); + payBillFeeLogService.record(fees, PayBillFeeLogService.ADD); + return fees.size(); + } + /** * 逻辑删除一条费用,并按剩余未删除明细重算应付总额。 * @@ -579,10 +558,144 @@ public class PayOrderListServiceImpl implements IPayOrderListService return fallback == null ? "" : fallback.trim(); } + /** 校验并收成可落库的一行。金额保留三位,和费用明细的小数位一致。 */ + private PayOrderFeeLine checkedLine(PayOrderFeeLine line) + { + if (line == null) + { + throw new ServiceException("请填写费用"); + } + String level = line.getLevel() == null ? "" : line.getLevel().trim(); + if (!TITLES.containsKey(level)) + { + throw new ServiceException("请选择费用阶段"); + } + String feeName = firstText(line.getFeeName(), line.getFeeType()); + if (feeName.isEmpty()) + { + throw new ServiceException("请填写费用项"); + } + if (feeName.length() > 100) + { + feeName = feeName.substring(0, 100); + } + String feeType = firstText(line.getFeeType(), "MANUAL"); + if (feeType.length() > 30) + { + feeType = "MANUAL"; + } + if (line.getAmount() == null) + { + throw new ServiceException("请填写金额"); + } + String currency = firstText(line.getCurrency(), "CNY").toUpperCase(Locale.ROOT); + if (currency.length() > 10) + { + throw new ServiceException("币种过长"); + } + BigDecimal amount = line.getAmount().setScale(3, RoundingMode.HALF_UP); + if (amount.abs().compareTo(new BigDecimal("9999999999.999")) > 0) + { + throw new ServiceException("金额超出范围"); + } + String remark = line.getRemark() == null ? null : line.getRemark().trim(); + if (remark != null && remark.length() > 200) + { + throw new ServiceException("说明不能超过200字"); + } + PayOrderFeeLine ready = new PayOrderFeeLine(); + ready.setLevel(level); + ready.setFeeName(feeName); + ready.setFeeType(feeType); + ready.setAmount(amount); + ready.setCurrency(currency); + ready.setRemark(remark == null || remark.isEmpty() ? null : remark); + return ready; + } + + private List batchBillIds(PayOrderFeeBatch batch) + { + if (batch == null || batch.getBillIds() == null || batch.getBillIds().isEmpty()) + { + throw new ServiceException("请勾选订单"); + } + LinkedHashSet ids = new LinkedHashSet<>(); + for (String raw : batch.getBillIds()) + { + if (raw == null || raw.isBlank()) + { + continue; + } + try + { + ids.add(Long.valueOf(raw.trim())); + } + catch (NumberFormatException ex) + { + throw new ServiceException("订单编号不正确"); + } + } + if (ids.isEmpty()) + { + throw new ServiceException("请勾选订单"); + } + if (ids.size() > MAX_ORDER_NOS) + { + throw new ServiceException("一次最多选择" + MAX_ORDER_NOS + "个订单"); + } + return new ArrayList<>(ids); + } + + private List batchLines(PayOrderFeeBatch batch) + { + if (batch.getFees() == null || batch.getFees().isEmpty()) + { + throw new ServiceException("请填写费用"); + } + if (batch.getFees().size() > MAX_BATCH_LINES) + { + throw new ServiceException("一次最多增加" + MAX_BATCH_LINES + "条费用"); + } + List lines = new ArrayList<>(batch.getFees().size()); + for (PayOrderFeeLine line : batch.getFees()) + { + if (line != null && (line.getLevel() == null || line.getLevel().isBlank())) + { + line.setLevel("4"); + } + lines.add(checkedLine(line)); + } + return lines; + } + + /** 手工费用。创建人和更新人记当前登录用户主键,来源固定为手工。 */ + private static PrcPayBillFee newManualFee(Long billId, String payBillId, PayOrderFeeLine line, String userId) + { + PrcPayBillFee fee = new PrcPayBillFee(); + fee.setFeeId(UUID.randomUUID().toString()); + fee.setBillId(billId); + fee.setPayBillId(payBillId); + fee.setFeeType(line.getFeeType()); + fee.setFeeName(line.getFeeName()); + fee.setScId(manualScId()); + fee.setFeeLevel(line.getLevel()); + fee.setAmount(line.getAmount()); + fee.setCurrency(line.getCurrency()); + fee.setRemark(line.getRemark()); + fee.setFeeSource("MANUAL"); + fee.setIsDeleted("0"); + fee.setCreateBy(userId); + fee.setUpdateBy(userId); + return fee; + } + /** 手工费用用负数序号,避免和同一费用项的计算费用撞上唯一键。 */ private static long manualScId() { - long tick = System.nanoTime(); + long tick = MANUAL_SC_SEQ.updateAndGet(current -> { + long next = System.nanoTime(); + return next > current ? next : current + 1L; + }); if (tick == Long.MIN_VALUE) { return -1L; 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 2f21a0ba..ccbed0a5 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 @@ -493,9 +493,16 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService TmsPriceQuoteResult result = toResult(bill, incomeBillFeeMapper.selectByBillId(bill.getBillId()), payBillFeeMapper.selectByBillId(bill.getBillId())); PrcPayBill payBill = payBillMapper.selectByBillId(bill.getBillId()); - if (payBill != null && payBill.getPayTotal() != null) + if (payBill != null) { - result.setPayTotal(payBill.getPayTotal()); + if (payBill.getPayTotal() != null) + { + result.setPayTotal(payBill.getPayTotal()); + } + result.setAmountA(payBill.getAmountA()); + result.setAmountB(payBill.getAmountB()); + result.setAmountC(payBill.getAmountC()); + result.setAmountD(payBill.getAmountD()); } return result; } diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPayBillFeeServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPayBillFeeServiceImpl.java index 902a0d5d..5450962b 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPayBillFeeServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPayBillFeeServiceImpl.java @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.bms.common.utils.SecurityUtils; +import com.bms.price.domain.PrcPayBill; import com.bms.price.domain.PrcPayBillFee; import com.bms.price.mapper.PrcPayBillFeeMapper; import com.bms.price.mapper.PrcPayBillMapper; @@ -83,13 +84,13 @@ public class PrcPayBillFeeServiceImpl implements IPrcPayBillFeeService } } - /** 不改 prc_pay_bill_fee。按计费日汇率把明细折成人民币后相加,四舍五入到两位,只写入 prc_pay_bill.pay_total。 */ + /** 不改 prc_pay_bill_fee。按计费日汇率把明细折成人民币后,ABCD 段分别四舍五入到两位,应付总额取这四段之和,写入 prc_pay_bill。 */ private void writeCnyTotals(List billIds) { - Map sums = new LinkedHashMap<>(); + Map sums = new LinkedHashMap<>(); for (Long billId : billIds) { - sums.put(billId, BigDecimal.ZERO); + sums.put(billId, new BigDecimal[] { BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO }); } List fees = payBillFeeMapper.selectOpenFees(billIds); if (fees != null) @@ -100,20 +101,52 @@ public class PrcPayBillFeeServiceImpl implements IPrcPayBillFeeService { continue; } + BigDecimal[] bucket = sums.get(fee.getBillId()); + if (bucket == null) + { + continue; + } BigDecimal cny = payFeeMoney.toCny(fee.getAmount(), fee.getCurrency(), fee.getBizDate()); if (cny == null) { continue; } - sums.merge(fee.getBillId(), cny, BigDecimal::add); + int segment = segmentIndex(fee.getFeeLevel()); + bucket[segment] = bucket[segment].add(cny); } } - for (Map.Entry entry : sums.entrySet()) + for (Map.Entry entry : sums.entrySet()) { - payBillMapper.updateCnyPayTotal(entry.getKey(), PayFeeMoney.total(entry.getValue())); + BigDecimal[] bucket = entry.getValue(); + PrcPayBill row = new PrcPayBill(); + row.setBillId(entry.getKey()); + row.setAmountA(PayFeeMoney.total(bucket[0])); + row.setAmountB(PayFeeMoney.total(bucket[1])); + row.setAmountC(PayFeeMoney.total(bucket[2])); + row.setAmountD(PayFeeMoney.total(bucket[3])); + row.setPayTotal(row.getAmountA().add(row.getAmountB()).add(row.getAmountC()).add(row.getAmountD())); + payBillMapper.updateCnyPayTotal(row); } } + /** 0A 1B 2C,其余含未标阶段的尾程计算费用归到 D。 */ + private static int segmentIndex(String feeLevel) + { + if ("1".equals(feeLevel)) + { + return 0; + } + if ("2".equals(feeLevel)) + { + return 1; + } + if ("3".equals(feeLevel)) + { + return 2; + } + return 3; + } + private static String currentOperator() { try diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PayBillMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PayBillMapper.xml index 4246c7d0..2dbfbb4f 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PayBillMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PayBillMapper.xml @@ -70,7 +70,7 @@ left join srv_bill_air_fee air on f.fee_source = 'LADING' and air.id = f.sc_id left join prc_surcharge air_sc on air_sc.sc_id = air.sc_id left join prc_surcharge item_sc on ifnull(f.fee_source, '') <> 'LADING' and item_sc.sc_id = f.sc_id - left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value = f.fee_type + left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value COLLATE utf8mb4_general_ci = f.fee_type COLLATE utf8mb4_general_ci where f.bill_id = o.bill_id and f.is_deleted = '0') as feeText, (select count(*) from prc_pay_bill_fee f where f.bill_id = o.bill_id and ifnull(f.is_deleted, '0') = '0') as feeCount, @@ -130,7 +130,7 @@ left join srv_bill_air_fee air on f.fee_source = 'LADING' and air.id = f.sc_id left join prc_surcharge air_sc on air_sc.sc_id = air.sc_id left join prc_surcharge item_sc on ifnull(f.fee_source, '') <> 'LADING' and item_sc.sc_id = f.sc_id - left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value = f.fee_type + left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value COLLATE utf8mb4_general_ci = f.fee_type COLLATE utf8mb4_general_ci where f.is_deleted = '0' and f.bill_id in #{id} @@ -262,7 +262,7 @@ left join srv_bill_air_fee air on f.fee_source = 'LADING' and air.id = f.sc_id left join prc_surcharge air_sc on air_sc.sc_id = air.sc_id left join prc_surcharge item_sc on ifnull(f.fee_source, '') <> 'LADING' and item_sc.sc_id = f.sc_id - left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value = f.fee_type + left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value COLLATE utf8mb4_general_ci = f.fee_type COLLATE utf8mb4_general_ci where ifnull(f.is_deleted, '0') = '0' and f.statement_line_id is null and f.bill_id in diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PayOrderListMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PayOrderListMapper.xml index 389fcab0..3c2552b8 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PayOrderListMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PayOrderListMapper.xml @@ -7,6 +7,7 @@ p.order_no as orderNo, nullif(trim(e.air_no_old), '') as ladingNo, p.tracking_no as trackingNo, + p.customer_code as customerCode, p.customer_name as customerName, p.product_name as productName, p.country_name as countryName, diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PrcPayBillFeeMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PrcPayBillFeeMapper.xml index f70d9bb4..e72287a3 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PrcPayBillFeeMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PrcPayBillFeeMapper.xml @@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join prc_surcharge air_sc on air_sc.sc_id = air.sc_id left join pay_surcharge pay_sc on f.fee_type = 'SURCHARGE' and ifnull(f.fee_source, '') <> 'LADING' and pay_sc.surcharge_id = f.sc_id left join prc_surcharge item_sc on f.fee_type = 'SURCHARGE' and ifnull(f.fee_source, '') <> 'LADING' and item_sc.sc_id = f.sc_id - left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value = f.fee_type + left join sys_dict_data dict on dict.dict_type = 'bms_fee_type' and dict.dict_value COLLATE utf8mb4_general_ci = f.fee_type COLLATE utf8mb4_general_ci @@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where u.del_flag = '0' and ( (${column} regexp '^[0-9]+$' and u.user_id = cast(${column} as unsigned)) - or (ifnull(${column}, '') not regexp '^[0-9]+$' and u.user_name = ${column} COLLATE utf8mb4_general_ci) + or (ifnull(${column}, '') not regexp '^[0-9]+$' and u.user_name COLLATE utf8mb4_general_ci = ${column} COLLATE utf8mb4_general_ci) ) limit 1 ), ${column}) @@ -197,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"