Merge branch 'master' of http://git.lionquexpress.com/wuweihua/BMS
This commit is contained in:
@@ -21,6 +21,8 @@ public class ArBillDetail implements Serializable {
|
||||
private Integer detailNo;
|
||||
private String orderNo;
|
||||
private String trackingNo;
|
||||
/** 转单号快照;账单生成时从来源计费订单复制,保证历史账单可追溯。 */
|
||||
private String transferNo;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date receiveTime;
|
||||
private String productCode;
|
||||
|
||||
@@ -17,9 +17,9 @@ public class ArBillGenerateQuery
|
||||
|
||||
private String currency;
|
||||
|
||||
/** 订单号或运单号关键词,按 OR 条件模糊查询。 */
|
||||
/** 订单号、运单号或转单号关键词,按 OR 条件模糊查询。 */
|
||||
private String orderOrTrackingNo;
|
||||
|
||||
/** 全选模式下,排除弹窗使用的附加订单号或运单号关键词。 */
|
||||
/** 全选模式下,排除弹窗使用的附加订单号、运单号或转单号关键词。 */
|
||||
private String excludeOrderOrTrackingNo;
|
||||
}
|
||||
|
||||
+8
-1
@@ -3,8 +3,11 @@ package com.ruoyi.ar.domain.vo;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import com.ruoyi.common.config.serializer.StrictDateDeserializer;
|
||||
import com.ruoyi.ar.enums.ArBillSelectionMode;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -15,11 +18,13 @@ public class ArBillGenerateRequest
|
||||
@NotNull(message = "客户不能为空")
|
||||
private Long customerId;
|
||||
@NotBlank(message = "账单名称不能为空")
|
||||
@Size(max = 100, message = "账单名称不能超过100个字符")
|
||||
private String billName;
|
||||
private String customerCode;
|
||||
private String customerName;
|
||||
@NotNull(message = "账单截止日不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonDeserialize(using = StrictDateDeserializer.class)
|
||||
private Date billPeriodEnd;
|
||||
/** 手动模式选中的来源订单 ID;全选模式为空。 */
|
||||
private List<String> sourceBillIds;
|
||||
@@ -28,13 +33,15 @@ public class ArBillGenerateRequest
|
||||
/** 全选模式中用户明确排除的来源订单 ID。 */
|
||||
private List<String> excludedSourceBillIds;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonDeserialize(using = StrictDateDeserializer.class)
|
||||
private Date billDate;
|
||||
private String currency = "CNY";
|
||||
/** 订单号或运单号关键词,生成时用于再次校验筛选条件。 */
|
||||
/** 订单号、运单号或转单号关键词,生成时用于再次校验筛选条件。 */
|
||||
private String orderOrTrackingNo;
|
||||
private String bankAccountName;
|
||||
private String bankAccountNo;
|
||||
private String bankName;
|
||||
@Size(max = 500, message = "备注不能超过500个字符")
|
||||
private String remark;
|
||||
/** 前端幂等号;重复提交同一请求时复用原任务。 */
|
||||
private String requestId;
|
||||
|
||||
+3
@@ -90,6 +90,9 @@ public class ArBalanceWriteoffServiceImpl implements IArBalanceWriteoffService {
|
||||
throw new ServiceException("核销金额必须大于0");
|
||||
}
|
||||
amount = amount.setScale(MONEY_SCALE, RoundingMode.HALF_UP);
|
||||
if (amount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new ServiceException("核销金额保留两位小数后必须大于0");
|
||||
}
|
||||
|
||||
// 1. 行锁锁定账单(加锁顺序:账单 -> 账户,与反核销保持一致)
|
||||
ArBill bill = billMapper.selectArBillByIdForUpdate(cmd.getArBillId());
|
||||
|
||||
+11
-2
@@ -984,6 +984,7 @@ public class ArBillServiceImpl implements IArBillService {
|
||||
detail.setDetailNo(detailNo);
|
||||
detail.setOrderNo(source.getOrderNo());
|
||||
detail.setTrackingNo(source.getTrackingNo());
|
||||
detail.setTransferNo(source.getTransferNo());
|
||||
detail.setReceiveTime(source.getOrderTime());
|
||||
detail.setProductCode(source.getProductCode());
|
||||
detail.setProductName(source.getProductName());
|
||||
@@ -1631,15 +1632,23 @@ public class ArBillServiceImpl implements IArBillService {
|
||||
}
|
||||
|
||||
private void validatePeriod(ArBillGenerateRequest request) {
|
||||
if (request == null || request.getCustomerId() == null || StringUtils.isEmpty(request.getBillName())
|
||||
if (request == null || request.getCustomerId() == null || request.getCustomerId() <= 0
|
||||
|| StringUtils.isEmpty(request.getBillName())
|
||||
|| request.getBillName().trim().isEmpty()
|
||||
|| request.getBillPeriodEnd() == null) {
|
||||
throw new ServiceException("客户、账单名称和账单截止日不能为空");
|
||||
}
|
||||
if (request.getBillName().trim().length() > 100) {
|
||||
throw new ServiceException("账单名称不能超过100个字符");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(request.getRemark()) && request.getRemark().trim().length() > 500) {
|
||||
throw new ServiceException("备注不能超过500个字符");
|
||||
}
|
||||
}
|
||||
|
||||
private void validatePreviewQuery(ArBillGenerateQuery query) {
|
||||
if (query == null || query.getCustomerId() == null || query.getBillPeriodEnd() == null) {
|
||||
if (query == null || query.getCustomerId() == null || query.getCustomerId() <= 0
|
||||
|| query.getBillPeriodEnd() == null) {
|
||||
throw new ServiceException("客户和账单截止日不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
+44
-2
@@ -376,9 +376,10 @@ public class CustomerAccountApiImpl implements ICustomerAccountApi
|
||||
BigDecimal afterBalance = beforeBalance.subtract(changeAmount);
|
||||
BigDecimal frozenBalance = nz(account.getFrozenBalance());
|
||||
account.setBalance(afterBalance);
|
||||
BigDecimal beforeUsedCredit = nz(account.getUsedCredit());
|
||||
if (Boolean.TRUE.equals(command.getReleaseUsedCredit()))
|
||||
{
|
||||
account.setUsedCredit(nz(account.getUsedCredit()).subtract(changeAmount).max(BigDecimal.ZERO)
|
||||
account.setUsedCredit(beforeUsedCredit.subtract(changeAmount).max(BigDecimal.ZERO)
|
||||
.setScale(MONEY_SCALE, RoundingMode.HALF_UP));
|
||||
}
|
||||
account.setUpdateBy(username);
|
||||
@@ -390,6 +391,18 @@ public class CustomerAccountApiImpl implements ICustomerAccountApi
|
||||
CustomerBalanceFlow flow = newBalanceFlow(account, command, flowCurrency, originalAmount, -1,
|
||||
beforeBalance, afterBalance, frozenBalance, frozenBalance, username, userId);
|
||||
customerMoneyMapper.insertFlow(flow);
|
||||
|
||||
// 核销扣款联动释放已用额度:补写额度流水(RELEASE),保证 used_credit 变动台账完整
|
||||
BigDecimal afterUsedCredit = nz(account.getUsedCredit());
|
||||
if (Boolean.TRUE.equals(command.getReleaseUsedCredit())
|
||||
&& afterUsedCredit.compareTo(beforeUsedCredit) < 0)
|
||||
{
|
||||
writeUsedCreditFlow(account, toCreditUsageCommand(command, accountCurrency, null),
|
||||
CustomerCreditFlow.CHANGE_RELEASE, -1,
|
||||
beforeUsedCredit, afterUsedCredit,
|
||||
beforeUsedCredit.subtract(afterUsedCredit),
|
||||
username, userId);
|
||||
}
|
||||
return flow;
|
||||
}
|
||||
|
||||
@@ -412,10 +425,11 @@ public class CustomerAccountApiImpl implements ICustomerAccountApi
|
||||
BigDecimal afterBalance = beforeBalance.add(changeAmount);
|
||||
BigDecimal frozenBalance = nz(account.getFrozenBalance());
|
||||
account.setBalance(afterBalance);
|
||||
BigDecimal beforeUsedCredit = nz(account.getUsedCredit());
|
||||
if (Boolean.TRUE.equals(command.getReoccupyUsedCredit()))
|
||||
{
|
||||
// 反核销回补:账单恢复未清偿,授信占用同步加回(允许出现高于总额度的占用存量)
|
||||
account.setUsedCredit(nz(account.getUsedCredit()).add(changeAmount)
|
||||
account.setUsedCredit(beforeUsedCredit.add(changeAmount)
|
||||
.setScale(MONEY_SCALE, RoundingMode.HALF_UP));
|
||||
}
|
||||
account.setUpdateBy(username);
|
||||
@@ -427,11 +441,39 @@ public class CustomerAccountApiImpl implements ICustomerAccountApi
|
||||
CustomerBalanceFlow flow = newBalanceFlow(account, command, flowCurrency, originalAmount, 1,
|
||||
beforeBalance, afterBalance, frozenBalance, frozenBalance, username, userId);
|
||||
customerMoneyMapper.insertFlow(flow);
|
||||
|
||||
// 反核销回补联动重新占用已用额度:补写额度流水(OCCUPY),与核销释放流水方向相反、可勾稽
|
||||
BigDecimal afterUsedCredit = nz(account.getUsedCredit());
|
||||
if (Boolean.TRUE.equals(command.getReoccupyUsedCredit())
|
||||
&& afterUsedCredit.compareTo(beforeUsedCredit) > 0)
|
||||
{
|
||||
String reoccupyReason = "反核销重新占用授信额度"
|
||||
+ (StringUtils.hasText(command.getBizNo()) ? ":" + command.getBizNo() : "");
|
||||
writeUsedCreditFlow(account, toCreditUsageCommand(command, accountCurrency, reoccupyReason),
|
||||
CustomerCreditFlow.CHANGE_OCCUPY, 1,
|
||||
beforeUsedCredit, afterUsedCredit,
|
||||
afterUsedCredit.subtract(beforeUsedCredit),
|
||||
username, userId);
|
||||
}
|
||||
return flow;
|
||||
}
|
||||
|
||||
/* ================= 内部实现 ================= */
|
||||
|
||||
/** 余额变动命令 -> 额度占用命令(复用业务单据信息,金额取实际联动额由调用方写流水时传入) */
|
||||
private CreditUsageCommand toCreditUsageCommand(BalanceChangeCommand source, String accountCurrency, String reason)
|
||||
{
|
||||
CreditUsageCommand target = new CreditUsageCommand();
|
||||
target.setCustomerId(source.getCustomerId());
|
||||
target.setCurrency(accountCurrency);
|
||||
target.setAmount(money(source.getAmount()));
|
||||
target.setBizType(source.getBizType());
|
||||
target.setBizId(source.getBizId());
|
||||
target.setBizNo(source.getBizNo());
|
||||
target.setReason(reason);
|
||||
return target;
|
||||
}
|
||||
|
||||
/** 额度占用/释放写额度流水(before/after 为已用额度快照) */
|
||||
private CustomerCreditFlow writeUsedCreditFlow(CustomerAccount account, CreditUsageCommand command,
|
||||
String changeType, int direction, BigDecimal beforeUsed, BigDecimal afterUsed,
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.customer.customermoney.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.customer.customermoney.domain.CustomerBalanceFlow;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 客户余额流水导出 VO(列与页面余额流水 tab 对齐,枚举导出为中文文案)
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-21
|
||||
*/
|
||||
@Data
|
||||
public class CustomerBalanceFlowExportVO implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "流水号", width = 22)
|
||||
private String flowNo;
|
||||
|
||||
@Excel(name = "时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "业务类型", width = 12)
|
||||
private String bizTypeLabel;
|
||||
|
||||
@Excel(name = "收支", width = 8)
|
||||
private String directionLabel;
|
||||
|
||||
@Excel(name = "原币金额", width = 16)
|
||||
private String amountText;
|
||||
|
||||
@Excel(name = "汇率", width = 12)
|
||||
private String exchangeRate;
|
||||
|
||||
@Excel(name = "本位币变动(CNY)", width = 18)
|
||||
private BigDecimal baseChangeAmount;
|
||||
|
||||
@Excel(name = "变动前余额", width = 14)
|
||||
private BigDecimal beforeBalance;
|
||||
|
||||
@Excel(name = "变动后余额", width = 14)
|
||||
private BigDecimal afterBalance;
|
||||
|
||||
@Excel(name = "关联单号", width = 22)
|
||||
private String bizNo;
|
||||
|
||||
@Excel(name = "操作人", width = 12)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "备注", width = 30)
|
||||
private String remark;
|
||||
|
||||
public static CustomerBalanceFlowExportVO from(CustomerBalanceFlow f)
|
||||
{
|
||||
CustomerBalanceFlowExportVO vo = new CustomerBalanceFlowExportVO();
|
||||
vo.setFlowNo(f.getFlowNo());
|
||||
vo.setCreateTime(f.getCreateTime());
|
||||
vo.setBizTypeLabel(bizTypeLabel(f.getBizType()));
|
||||
boolean income = f.getDirection() != null && f.getDirection() == 1;
|
||||
vo.setDirectionLabel(income ? "收入" : "支出");
|
||||
String amt = f.getAmount() == null ? "" : f.getAmount().stripTrailingZeros().toPlainString();
|
||||
vo.setAmountText((f.getCurrency() == null ? "" : f.getCurrency() + " ") + amt);
|
||||
vo.setExchangeRate(f.getExchangeRate() == null ? null : f.getExchangeRate().stripTrailingZeros().toPlainString());
|
||||
BigDecimal base = f.getBaseAmount() != null ? f.getBaseAmount() : f.getAmount();
|
||||
// 支出导出为负数(配合“收支”列阅读,同时保持 Excel 数值类型)
|
||||
vo.setBaseChangeAmount(base == null ? null : (income ? base : base.negate()));
|
||||
vo.setBeforeBalance(f.getBeforeBalance());
|
||||
vo.setAfterBalance(f.getAfterBalance());
|
||||
vo.setBizNo(f.getBizNo());
|
||||
vo.setCreateBy(f.getCreateBy());
|
||||
vo.setRemark(f.getRemark());
|
||||
return vo;
|
||||
}
|
||||
|
||||
private static String bizTypeLabel(String v)
|
||||
{
|
||||
if ("RECEIPT".equals(v)) return "收款";
|
||||
if ("AR_BILL".equals(v)) return "应收账单";
|
||||
if ("BILL_PAY".equals(v)) return "账单核销";
|
||||
if ("ORDER".equals(v)) return "计费订单";
|
||||
if ("REFUND".equals(v)) return "退款";
|
||||
if ("ADJUST".equals(v)) return "手工调整";
|
||||
if ("FREEZE".equals(v)) return "冻结";
|
||||
if ("UNFREEZE".equals(v)) return "解冻";
|
||||
return v;
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package com.ruoyi.customer.customermoney.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.customer.customermoney.domain.CustomerCreditFlow;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 客户额度流水导出 VO(列与页面额度流水 tab 对齐,枚举导出为中文文案)
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-21
|
||||
*/
|
||||
@Data
|
||||
public class CustomerCreditFlowExportVO implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "流水号", width = 22)
|
||||
private String flowNo;
|
||||
|
||||
@Excel(name = "时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "业务单号", width = 22)
|
||||
private String bizNo;
|
||||
|
||||
@Excel(name = "变动类型", width = 12)
|
||||
private String changeTypeLabel;
|
||||
|
||||
@Excel(name = "变动维度", width = 18)
|
||||
private String dimensionLabel;
|
||||
|
||||
@Excel(name = "调整方式", width = 10)
|
||||
private String adjustModeLabel;
|
||||
|
||||
@Excel(name = "方向", width = 8)
|
||||
private String directionLabel;
|
||||
|
||||
@Excel(name = "变动前", width = 12)
|
||||
private BigDecimal beforeAmount;
|
||||
|
||||
@Excel(name = "变动额", width = 12)
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
@Excel(name = "变动后", width = 12)
|
||||
private BigDecimal afterAmount;
|
||||
|
||||
@Excel(name = "已用额度快照", width = 14)
|
||||
private BigDecimal usedCredit;
|
||||
|
||||
@Excel(name = "生效日期", width = 12, dateFormat = "yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
|
||||
@Excel(name = "失效日期", width = 12)
|
||||
private String expireDateText;
|
||||
|
||||
@Excel(name = "调整原因", width = 30)
|
||||
private String reason;
|
||||
|
||||
@Excel(name = "操作人", width = 12)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "备注", width = 30)
|
||||
private String remark;
|
||||
|
||||
public static CustomerCreditFlowExportVO from(CustomerCreditFlow f)
|
||||
{
|
||||
CustomerCreditFlowExportVO vo = new CustomerCreditFlowExportVO();
|
||||
vo.setFlowNo(f.getFlowNo());
|
||||
vo.setCreateTime(f.getCreateTime());
|
||||
vo.setBizNo(f.getBizNo());
|
||||
vo.setChangeTypeLabel(changeTypeLabel(f.getChangeType()));
|
||||
boolean usageFlow = "OCCUPY".equals(f.getChangeType()) || "RELEASE".equals(f.getChangeType());
|
||||
vo.setDimensionLabel(usageFlow ? "授信占用(已用额度)" : "授信额度");
|
||||
vo.setAdjustModeLabel(adjustModeLabel(f.getAdjustMode()));
|
||||
Integer dir = f.getDirection();
|
||||
vo.setDirectionLabel(dir == null ? "-" : (dir == 1 ? "增加" : "减少"));
|
||||
vo.setBeforeAmount(f.getBeforeAmount());
|
||||
// 减少导出为负数(配合“方向”列阅读,同时保持 Excel 数值类型)
|
||||
BigDecimal change = f.getChangeAmount();
|
||||
if (change != null && dir != null && dir == -1)
|
||||
{
|
||||
change = change.negate();
|
||||
}
|
||||
vo.setChangeAmount(change);
|
||||
vo.setAfterAmount(f.getAfterAmount());
|
||||
// 占用/释放流水的已用额度快照在页面上不展示
|
||||
vo.setUsedCredit(usageFlow ? null : f.getUsedCredit());
|
||||
vo.setEffectiveDate(f.getEffectiveDate());
|
||||
vo.setExpireDateText(f.getExpireDate() == null ? "长期" : new java.text.SimpleDateFormat("yyyy-MM-dd").format(f.getExpireDate()));
|
||||
vo.setReason(f.getReason());
|
||||
vo.setCreateBy(f.getCreateBy());
|
||||
vo.setRemark(f.getRemark());
|
||||
return vo;
|
||||
}
|
||||
|
||||
private static String changeTypeLabel(String v)
|
||||
{
|
||||
if ("INIT".equals(v)) return "初始化";
|
||||
if ("ADJUST".equals(v)) return "手工调整";
|
||||
if ("EXPIRE".equals(v)) return "到期失效";
|
||||
if ("OCCUPY".equals(v)) return "授信占用";
|
||||
if ("RELEASE".equals(v)) return "授信释放";
|
||||
return v;
|
||||
}
|
||||
|
||||
private static String adjustModeLabel(String v)
|
||||
{
|
||||
if ("SET".equals(v)) return "设置为";
|
||||
if ("ADD".equals(v)) return "增加";
|
||||
if ("SUB".equals(v)) return "减少";
|
||||
return v;
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.customer.customermoney.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.customer.customermoney.domain.CustomerReceipt;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 客户收款记录导出 VO(列与页面收款记录 tab 对齐,枚举导出为中文文案)
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-21
|
||||
*/
|
||||
@Data
|
||||
public class CustomerReceiptExportVO implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "收款单号", width = 22)
|
||||
private String receiptNo;
|
||||
|
||||
@Excel(name = "收款日期", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date receivedAt;
|
||||
|
||||
@Excel(name = "收款类型", width = 12)
|
||||
private String receiptTypeLabel;
|
||||
|
||||
@Excel(name = "币种", width = 8)
|
||||
private String currency;
|
||||
|
||||
@Excel(name = "原币金额", width = 14)
|
||||
private BigDecimal amount;
|
||||
|
||||
@Excel(name = "汇率", width = 12)
|
||||
private String exchangeRate;
|
||||
|
||||
@Excel(name = "汇率来源", width = 10)
|
||||
private String rateSourceLabel;
|
||||
|
||||
@Excel(name = "本位币金额(CNY)", width = 16)
|
||||
private BigDecimal baseAmount;
|
||||
|
||||
@Excel(name = "收款方式", width = 12)
|
||||
private String payMethodLabel;
|
||||
|
||||
@Excel(name = "客户银行账号", width = 24)
|
||||
private String bankAccountNo;
|
||||
|
||||
@Excel(name = "银行/平台流水号", width = 22)
|
||||
private String bankTransactionNo;
|
||||
|
||||
@Excel(name = "状态", width = 10)
|
||||
private String statusLabel;
|
||||
|
||||
@Excel(name = "登记人", width = 12)
|
||||
private String createBy;
|
||||
|
||||
@Excel(name = "备注", width = 30)
|
||||
private String remark;
|
||||
|
||||
public static CustomerReceiptExportVO from(CustomerReceipt r)
|
||||
{
|
||||
CustomerReceiptExportVO vo = new CustomerReceiptExportVO();
|
||||
vo.setReceiptNo(r.getReceiptNo());
|
||||
vo.setReceivedAt(r.getReceivedAt());
|
||||
vo.setReceiptTypeLabel(receiptTypeLabel(r.getReceiptType()));
|
||||
vo.setCurrency(r.getCurrency());
|
||||
vo.setAmount(r.getAmount());
|
||||
vo.setExchangeRate(r.getExchangeRate() == null ? null : r.getExchangeRate().stripTrailingZeros().toPlainString());
|
||||
vo.setRateSourceLabel(rateSourceLabel(r.getRateSource()));
|
||||
vo.setBaseAmount(r.getBaseAmount());
|
||||
vo.setPayMethodLabel(payMethodLabel(r.getPayMethod()));
|
||||
vo.setBankAccountNo(r.getBankAccountNo());
|
||||
vo.setBankTransactionNo(r.getBankTransactionNo());
|
||||
vo.setStatusLabel(statusLabel(r.getStatus()));
|
||||
vo.setCreateBy(r.getCreateBy());
|
||||
vo.setRemark(r.getRemark());
|
||||
return vo;
|
||||
}
|
||||
|
||||
private static String receiptTypeLabel(String v)
|
||||
{
|
||||
if ("PREPAY".equals(v)) return "预充值";
|
||||
if ("REPAY".equals(v)) return "还款核销";
|
||||
if ("MIXED".equals(v)) return "混合";
|
||||
return v;
|
||||
}
|
||||
|
||||
private static String statusLabel(String v)
|
||||
{
|
||||
if ("PENDING".equals(v)) return "待确认";
|
||||
if ("CONFIRMED".equals(v)) return "已确认";
|
||||
if ("CANCELLED".equals(v)) return "已取消";
|
||||
return v;
|
||||
}
|
||||
|
||||
private static String payMethodLabel(String v)
|
||||
{
|
||||
if ("BANK_TRANSFER".equals(v)) return "银行转账";
|
||||
if ("ALIPAY".equals(v)) return "支付宝";
|
||||
if ("WECHAT".equals(v)) return "微信";
|
||||
if ("CASH".equals(v)) return "现金";
|
||||
if ("OTHER".equals(v)) return "其他";
|
||||
return v;
|
||||
}
|
||||
|
||||
private static String rateSourceLabel(String v)
|
||||
{
|
||||
if ("RATE_TABLE".equals(v)) return "汇率表";
|
||||
if ("MANUAL".equals(v)) return "手工修改";
|
||||
if ("SYSTEM".equals(v)) return "系统默认";
|
||||
return v;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user