mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 13:42:07 +08:00
1、新增BaseEnum、EnumConvert、EnumFormat:支持excel导出从枚举获取描述;2、购买记录、组织余额excel导出文件内容修正;
This commit is contained in:
+1
@@ -32,5 +32,6 @@ public class DictTypeConstants {
|
||||
|
||||
|
||||
public static final String ADVERTISEMENT_POSITION = "advertisement_position";
|
||||
public static final String PURCHASE_PAYMENT_METHOD = "diffPayStyle"; // 产品购买方式
|
||||
|
||||
}
|
||||
|
||||
+11
-1
@@ -1,6 +1,11 @@
|
||||
package com.cf.imes.module.system.controller.admin.funds.balancedetails.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.cf.imes.framework.excel.core.annotations.EnumFormat;
|
||||
import com.cf.imes.framework.excel.core.convert.EnumConvert;
|
||||
import com.cf.imes.module.system.enums.pay.IncomeExpenseTypeEnum;
|
||||
import com.cf.imes.module.system.enums.pay.TradeTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -17,11 +22,14 @@ public class BalanceDetailsRespVO {
|
||||
|
||||
|
||||
@Schema(description = "交易类型,0充值 1软件购买")
|
||||
@ExcelProperty("交易类型")
|
||||
@ExcelProperty(value = "交易类型",converter = EnumConvert.class)
|
||||
@EnumFormat(value = TradeTypeEnum.class)
|
||||
private Integer tradeType;
|
||||
|
||||
|
||||
@Schema(description = "收支类型,0收入 1支出")
|
||||
@ExcelProperty(value = "收支类型",converter = EnumConvert.class)
|
||||
@EnumFormat(value = IncomeExpenseTypeEnum.class)
|
||||
private Integer incomeExpenseType;
|
||||
|
||||
|
||||
@@ -71,11 +79,13 @@ public class BalanceDetailsRespVO {
|
||||
|
||||
|
||||
@Schema(description = "支出/入账现金金额")
|
||||
@ExcelIgnore
|
||||
private BigDecimal cashAmountChange;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "支出/入账赠送金金额")
|
||||
@ExcelIgnore
|
||||
private BigDecimal giftAmountChange;
|
||||
|
||||
|
||||
|
||||
+33
-10
@@ -1,6 +1,14 @@
|
||||
package com.cf.imes.module.system.controller.admin.funds.purchase.vo;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.cf.imes.framework.excel.core.annotations.DictFormat;
|
||||
import com.cf.imes.framework.excel.core.annotations.EnumFormat;
|
||||
import com.cf.imes.framework.excel.core.convert.DictConvert;
|
||||
import com.cf.imes.framework.excel.core.convert.EnumConvert;
|
||||
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||
import com.cf.imes.module.system.enums.pay.InvoiceStatusEnum;
|
||||
import com.cf.imes.module.system.enums.pay.DurationUnitEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -13,78 +21,93 @@ public class PurchaseRecordRespVO {
|
||||
|
||||
|
||||
@Schema(description = "购买记录ID")
|
||||
@ExcelProperty("购买记录编码")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "组织ID")
|
||||
@ExcelProperty("组织编号")
|
||||
private Long organId;
|
||||
|
||||
|
||||
@Schema(description = "产品ID")
|
||||
@ExcelProperty("产品编号")
|
||||
private Long productId;
|
||||
|
||||
|
||||
@Schema(description = "产品明细ID")
|
||||
@ExcelProperty("产品明细编号")
|
||||
private Long productDetailsId;
|
||||
|
||||
|
||||
@Schema(description = "产品名称")
|
||||
@ExcelProperty("产品名称")
|
||||
private String productName;
|
||||
|
||||
|
||||
@Schema(description = "购买时长", example = "1")
|
||||
@ExcelProperty("购买时长")
|
||||
private Integer purchaseDuration;
|
||||
|
||||
@Schema(description = "购买时长单位,0:年、1:月、2:日", example = "1")
|
||||
@ExcelProperty(value = "购买时长单位", converter = EnumConvert.class)
|
||||
@EnumFormat(value = DurationUnitEnum.class)
|
||||
private Integer purchaseDurationUnit;
|
||||
|
||||
@Schema(description = "赠送时长", example = "1")
|
||||
@ExcelProperty("赠送时长")
|
||||
private Integer giftDuration;
|
||||
|
||||
@Schema(description = "赠送时长单位,0:年、1:月、2:日", example = "1")
|
||||
@ExcelProperty(value = "赠送时长单位", converter = EnumConvert.class)
|
||||
@EnumFormat(value = DurationUnitEnum.class)
|
||||
private Integer giftDurationUnit;
|
||||
|
||||
@Schema(description = "支付方式")
|
||||
@ExcelProperty(value = "支付方式", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.PURCHASE_PAYMENT_METHOD)
|
||||
private Integer paymentMethod;
|
||||
|
||||
|
||||
@Schema(description = "订单总额")
|
||||
@ExcelProperty("订单总额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
|
||||
@Schema(description = "现金余额支出")
|
||||
@ExcelProperty("现金余额支出")
|
||||
private BigDecimal accountBalanceSpent;
|
||||
|
||||
|
||||
@Schema(description = "支付宝支出")
|
||||
@ExcelProperty("支付宝支出")
|
||||
private BigDecimal alipaySpent;
|
||||
|
||||
|
||||
@Schema(description = "微信支出")
|
||||
@ExcelProperty("微信支出")
|
||||
private BigDecimal wechatSpent;
|
||||
|
||||
|
||||
@Schema(description = "赠送金")
|
||||
@ExcelProperty("赠送金")
|
||||
private BigDecimal giftMoneySpent;
|
||||
|
||||
|
||||
@Schema(description = "货币类型")
|
||||
private Integer currency;
|
||||
|
||||
|
||||
@Schema(description = "货币单位")
|
||||
private String currencyUnit;
|
||||
|
||||
|
||||
@Schema(description = "是否开票")
|
||||
@ExcelProperty(value = "是否开票", converter = EnumConvert.class)
|
||||
@EnumFormat(value = InvoiceStatusEnum.class)
|
||||
private Integer isInvocing;
|
||||
|
||||
|
||||
@Schema(description = "购买时间")
|
||||
@ExcelProperty("购买时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "失效时间")
|
||||
@ExcelProperty("失效时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "操作人")
|
||||
@ExcelProperty("操作人")
|
||||
private String creator;
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public interface PurchaseRecordMapper extends BaseMapperX<PurchaseRecordDO> {
|
||||
.leIfPresent(PurchaseRecordDO::getTotalAmount, ObjectUtil.isNotNull(pageReqVO.getInvoiceAmount()) ? pageReqVO.getInvoiceAmount()[1] : null)
|
||||
.eq(PurchaseRecordDO::getOrganId, SecurityFrameworkUtils.getUserOrganId())
|
||||
.eq(PurchaseRecordDO::getDeleted, false)
|
||||
.in(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.INVOICABLE.getStatus(), InvoiceStatusEnum.INVOICINGFAILED.getStatus())
|
||||
.in(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.INVOICABLE.getCode(), InvoiceStatusEnum.INVOICINGFAILED.getCode())
|
||||
.orderByDesc(PurchaseRecordDO::getCreateTime)
|
||||
);
|
||||
|
||||
|
||||
+10
-9
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.enums.products;
|
||||
package com.cf.imes.module.system.enums.pay;
|
||||
|
||||
import com.cf.imes.framework.common.core.IntArrayValuable;
|
||||
import com.cf.imes.framework.excel.core.convert.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -14,22 +15,22 @@ import java.util.Objects;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DurationUnitEnum implements IntArrayValuable {
|
||||
public enum DurationUnitEnum implements IntArrayValuable, BaseEnum {
|
||||
|
||||
YEAR(0, "年"),
|
||||
MONTH(1, "月"),
|
||||
DAY(2, "日");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DurationUnitEnum::getStatus).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DurationUnitEnum::getCode).toArray();
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer status;
|
||||
private final Integer code;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
@@ -37,20 +38,20 @@ public enum DurationUnitEnum implements IntArrayValuable {
|
||||
}
|
||||
|
||||
public static boolean isYear(String name) {
|
||||
return Objects.equals(YEAR.name, name);
|
||||
return Objects.equals(YEAR.code, name);
|
||||
}
|
||||
|
||||
public static boolean isMonth(String name) {
|
||||
return Objects.equals(MONTH.name, name);
|
||||
return Objects.equals(MONTH.code, name);
|
||||
}
|
||||
|
||||
public static boolean isDay(String name) {
|
||||
return Objects.equals(DAY.name, name);
|
||||
return Objects.equals(DAY.code, name);
|
||||
}
|
||||
|
||||
public static DurationUnitEnum fromStatus(Integer status) {
|
||||
return Arrays.stream(values())
|
||||
.filter(bean -> Objects.equals(bean.status, status))
|
||||
.filter(bean -> Objects.equals(bean.code, status))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
+5
-4
@@ -2,6 +2,7 @@ package com.cf.imes.module.system.enums.pay;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.excel.core.convert.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -11,7 +12,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum IncomeExpenseTypeEnum {
|
||||
public enum IncomeExpenseTypeEnum implements BaseEnum {
|
||||
|
||||
/**
|
||||
* 收入
|
||||
@@ -27,12 +28,12 @@ public enum IncomeExpenseTypeEnum {
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
private final Integer code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
private final String desc;
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +42,7 @@ public enum IncomeExpenseTypeEnum {
|
||||
return null;
|
||||
}
|
||||
for (IncomeExpenseTypeEnum value : values()) {
|
||||
if (ObjectUtil.equal(value.getType(), type)) {
|
||||
if (ObjectUtil.equal(value.code, type)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -2,6 +2,7 @@ package com.cf.imes.module.system.enums.pay;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.excel.core.convert.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -11,7 +12,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum InvoiceStatusEnum {
|
||||
public enum InvoiceStatusEnum implements BaseEnum {
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,13 +37,12 @@ public enum InvoiceStatusEnum {
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
private final Integer code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
private final String desc;
|
||||
|
||||
|
||||
public static InvoiceStatusEnum fromType(Integer status) {
|
||||
@@ -50,7 +50,7 @@ public enum InvoiceStatusEnum {
|
||||
return null;
|
||||
}
|
||||
for (InvoiceStatusEnum value : values()) {
|
||||
if (ObjectUtil.equal(value.getStatus(), status)) {
|
||||
if (ObjectUtil.equal(value.code, status)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-3
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.enums.pay;
|
||||
|
||||
import com.cf.imes.framework.excel.core.convert.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -10,19 +11,21 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum TradeTypeEnum {
|
||||
public enum TradeTypeEnum implements BaseEnum {
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
RECHARGE(0),
|
||||
RECHARGE(0, "充值"),
|
||||
|
||||
/**
|
||||
* 产品购买
|
||||
*/
|
||||
PRODUCT(1);
|
||||
PRODUCT(1, "产品购买");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static TradeTypeEnum fromCode(Integer code) {
|
||||
for (TradeTypeEnum value : TradeTypeEnum.values()) {
|
||||
if (value.code.equals(code)) {
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class IncomeExpenseServiceImpl implements IncomeExpenseService {
|
||||
|
||||
// 根据收支类型赋值对应的 支出/收入字段
|
||||
result.getList().forEach(f -> {
|
||||
if (IncomeExpenseTypeEnum.INCOME.getType().equals(f.getIncomeExpenseType())) {
|
||||
if (IncomeExpenseTypeEnum.INCOME.getCode().equals(f.getIncomeExpenseType())) {
|
||||
f.setEntryAmount(f.getCashAmountChange());
|
||||
f.setEntryGiftAmount(f.getGiftAmountChange());
|
||||
} else {
|
||||
|
||||
+8
-8
@@ -159,7 +159,7 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
.eq(PurchaseRecordDO::getOrganId, organId)
|
||||
.eq(PurchaseRecordDO::getDeleted, false)
|
||||
.in(PurchaseRecordDO::getId, purchaseRecordId)
|
||||
.set(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.PENDINGINVOICING.getStatus()));
|
||||
.set(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.PENDINGINVOICING.getCode()));
|
||||
if (update != purchaseRecordId.size()) {
|
||||
throw new ServiceException(ORG_INVOICE_PURCHASE_RECORD_UPDATE_NUM_NOT_MATCH_ERROR);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
.invoiceAmount(invoicableAmount)
|
||||
.invoiceTitleId(invoiceTitleInfoDO.getId())
|
||||
.invoiceTitleInfo(zipString(toJsonString(invoiceTitleInfoDO)))
|
||||
.status(InvoiceStatusEnum.PENDINGINVOICING.getStatus())
|
||||
.status(InvoiceStatusEnum.PENDINGINVOICING.getCode())
|
||||
.build());
|
||||
}
|
||||
|
||||
@@ -241,8 +241,8 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
// 校验发票申请记录是否存在
|
||||
InvoiceRecordsDO invoiceRecordsDO = validateInvoiceExists(reqVO.getId());
|
||||
|
||||
if (invoiceRecordsDO.getStatus().equals(InvoiceStatusEnum.INVOICINGFAILED.getStatus())
|
||||
|| invoiceRecordsDO.getStatus().equals(InvoiceStatusEnum.INVOICINGSUCCESSFUL.getStatus())) {
|
||||
if (invoiceRecordsDO.getStatus().equals(InvoiceStatusEnum.INVOICINGFAILED.getCode())
|
||||
|| invoiceRecordsDO.getStatus().equals(InvoiceStatusEnum.INVOICINGSUCCESSFUL.getCode())) {
|
||||
throw exception(THIS_INVOICE_IS_FAIL);
|
||||
}
|
||||
|
||||
@@ -254,10 +254,10 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
if (reqVO.isAgree()) {
|
||||
// 同意开票
|
||||
// 更新发票申请记录状态
|
||||
invoiceRecordsDO.setStatus(InvoiceStatusEnum.INVOICINGSUCCESSFUL.getStatus());
|
||||
invoiceRecordsDO.setStatus(InvoiceStatusEnum.INVOICINGSUCCESSFUL.getCode());
|
||||
invoiceRecordsDO.setRemark(reqVO.getRemark());
|
||||
// 更新购买记录状态
|
||||
purchaseRecordDOS.forEach(f -> f.setIsInvocing(InvoiceStatusEnum.INVOICINGSUCCESSFUL.getStatus()));
|
||||
purchaseRecordDOS.forEach(f -> f.setIsInvocing(InvoiceStatusEnum.INVOICINGSUCCESSFUL.getCode()));
|
||||
|
||||
// 发票文件入库
|
||||
if (ObjectUtil.isNull(file) || file.isEmpty()) {
|
||||
@@ -269,12 +269,12 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||
} else {
|
||||
// 拒绝开票
|
||||
// 更新发票申请记录状态
|
||||
invoiceRecordsDO.setStatus(InvoiceStatusEnum.INVOICINGFAILED.getStatus());
|
||||
invoiceRecordsDO.setStatus(InvoiceStatusEnum.INVOICINGFAILED.getCode());
|
||||
String remark = Optional.ofNullable(reqVO.getRemark()).orElseThrow(() -> new ServiceException(INVOICING_REJECT_REASON));
|
||||
invoiceRecordsDO.setRemark(remark);
|
||||
|
||||
// 更新购买记录状态
|
||||
purchaseRecordDOS.forEach(f -> f.setIsInvocing(InvoiceStatusEnum.INVOICABLE.getStatus()));
|
||||
purchaseRecordDOS.forEach(f -> f.setIsInvocing(InvoiceStatusEnum.INVOICABLE.getCode()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public class PurchaseServiceImpl implements PurchaseService {
|
||||
purchaseRecordMapper.update(new LambdaUpdateWrapper<PurchaseRecordDO>()
|
||||
.eq(PurchaseRecordDO::getId, purchaseRecordId)
|
||||
.eq(PurchaseRecordDO::getOrganId, organId)
|
||||
.set(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.INVOICABLE.getStatus()));
|
||||
.set(PurchaseRecordDO::getIsInvocing, InvoiceStatusEnum.INVOICABLE.getCode()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -513,7 +513,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
.organId(organId)
|
||||
.businessNo(payNo)
|
||||
.tradeType(TradeTypeEnum.RECHARGE.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.INCOME.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.INCOME.getCode())
|
||||
.cashAmountChange(price)
|
||||
.giftAmountChange(giftAmount)
|
||||
.availableAmount(rechargeAmountRespVO.getAvailableAmount())
|
||||
@@ -629,7 +629,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
IncomeExpenseDetailsDO incomeExpenseDetailsDO = IncomeExpenseDetailsDO.builder()
|
||||
.organId(organId)
|
||||
.tradeType(TradeTypeEnum.PRODUCT.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.INCOME.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.INCOME.getCode())
|
||||
.cashAmountChange(accountBalanceSpent)
|
||||
.giftAmountChange(giftMoneySpent)
|
||||
.availableAmount(organRefundProductRespVO.getAvailableAmount())
|
||||
|
||||
+10
-10
@@ -21,7 +21,7 @@ import com.cf.imes.module.system.enums.pay.PayConstants;
|
||||
import com.cf.imes.module.system.enums.pay.PayOrderStatusEnum;
|
||||
import com.cf.imes.module.system.enums.pay.PayProductChannelCodeEnum;
|
||||
import com.cf.imes.module.system.enums.pay.TradeTypeEnum;
|
||||
import com.cf.imes.module.system.enums.products.DurationUnitEnum;
|
||||
import com.cf.imes.module.system.enums.pay.DurationUnitEnum;
|
||||
import com.cf.imes.module.system.framework.snowflake.config.MybatisIdProperties;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -132,7 +132,7 @@ public class PayProductProcessor {
|
||||
.paymentMethod(PayProductChannelCodeEnum.BALANCE_ONLY.getCode())
|
||||
.totalAmount(price)
|
||||
.accountBalanceSpent(price)
|
||||
.isInvocing(InvoiceStatusEnum.INVOICABLE.getStatus())
|
||||
.isInvocing(InvoiceStatusEnum.INVOICABLE.getCode())
|
||||
.build();
|
||||
purchaseRecordDO.setEndTime(calculateEndTime(purchaseRecordDO.getStartTime(),
|
||||
purchaseRecordDO.getPurchaseDuration(), purchaseRecordDO.getPurchaseDurationUnit(),
|
||||
@@ -145,7 +145,7 @@ public class PayProductProcessor {
|
||||
.organId(organId)
|
||||
.purchaseId(purchaseRecordDO.getId())
|
||||
.tradeType(TradeTypeEnum.PRODUCT.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getCode())
|
||||
.cashAmountChange(price)
|
||||
.availableAmount(newBalance.add(giftAmount))
|
||||
.amount(newBalance)
|
||||
@@ -183,7 +183,7 @@ public class PayProductProcessor {
|
||||
.paymentMethod(PayProductChannelCodeEnum.BALANCE_ONLY.getCode())
|
||||
.totalAmount(price)
|
||||
.accountBalanceSpent(price)
|
||||
.isInvocing(InvoiceStatusEnum.INVOICABLE.getStatus())
|
||||
.isInvocing(InvoiceStatusEnum.INVOICABLE.getCode())
|
||||
.build();
|
||||
purchaseRecordDO.setEndTime(calculateEndTime(purchaseRecordDO.getStartTime(),
|
||||
purchaseRecordDO.getPurchaseDuration(), purchaseRecordDO.getPurchaseDurationUnit(),
|
||||
@@ -196,7 +196,7 @@ public class PayProductProcessor {
|
||||
.organId(organId)
|
||||
.purchaseId(purchaseRecordDO.getId())
|
||||
.tradeType(TradeTypeEnum.PRODUCT.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getCode())
|
||||
.giftAmountChange(price)
|
||||
.availableAmount(amount.add(newGift))
|
||||
.amount(amount)
|
||||
@@ -300,7 +300,7 @@ public class PayProductProcessor {
|
||||
.startTime(LocalDateTime.now())
|
||||
.paymentMethod(PayProductChannelCodeEnum.BALANCE_AND_GIFT.getCode())
|
||||
.totalAmount(price)
|
||||
.isInvocing(InvoiceStatusEnum.INVOICABLE.getStatus())
|
||||
.isInvocing(InvoiceStatusEnum.INVOICABLE.getCode())
|
||||
.build();
|
||||
purchaseRecordDO.setEndTime(calculateEndTime(purchaseRecordDO.getStartTime(),
|
||||
purchaseRecordDO.getPurchaseDuration(), purchaseRecordDO.getPurchaseDurationUnit(),
|
||||
@@ -333,7 +333,7 @@ public class PayProductProcessor {
|
||||
.organId(organId)
|
||||
.purchaseId(purchaseRecordDO.getId())
|
||||
.tradeType(TradeTypeEnum.PRODUCT.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getCode())
|
||||
.cashAmountChange(usedBalance)
|
||||
.giftAmountChange(usedGift)
|
||||
.availableAmount(newAmounta.add(newGift))
|
||||
@@ -391,7 +391,7 @@ public class PayProductProcessor {
|
||||
.organId(organId)
|
||||
.purchaseId(purchaseRecordDO.getId())
|
||||
.tradeType(TradeTypeEnum.PRODUCT.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getCode())
|
||||
.cashAmountChange(usedBalance)
|
||||
.availableAmount(newAmounta.add(giftAmount))
|
||||
.amount(newAmounta)
|
||||
@@ -461,7 +461,7 @@ public class PayProductProcessor {
|
||||
.organId(organId)
|
||||
.purchaseId(purchaseRecordDO.getId())
|
||||
.tradeType(TradeTypeEnum.PRODUCT.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getCode())
|
||||
.giftAmountChange(usedGift)
|
||||
.availableAmount(amount.add(newGift))
|
||||
.amount(amount)
|
||||
@@ -539,7 +539,7 @@ public class PayProductProcessor {
|
||||
.organId(organId)
|
||||
.purchaseId(purchaseRecordDO.getId())
|
||||
.tradeType(TradeTypeEnum.PRODUCT.getCode())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getType())
|
||||
.incomeExpenseType(IncomeExpenseTypeEnum.EXPENSES.getCode())
|
||||
.cashAmountChange(usedBalance)
|
||||
.giftAmountChange(usedGift)
|
||||
.availableAmount(newAmounta.add(newGift))
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package com.cf.imes.module.system.validation.products;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.module.system.enums.products.DurationUnitEnum;
|
||||
import com.cf.imes.module.system.enums.pay.DurationUnitEnum;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class TimeUnitValidator implements ConstraintValidator<TimeUnitValid, Int
|
||||
return true;
|
||||
}
|
||||
for (DurationUnitEnum unitEnum : DurationUnitEnum.values()) {
|
||||
if (Objects.equals(unitEnum.getStatus(), value)) {
|
||||
if (Objects.equals(unitEnum.getCode(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user