From 7683dbebcd71a934d294df737578027599062664 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Wed, 21 Aug 2024 19:04:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=80=80=E6=AC=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccountItemResourceController.java | 18 ++++++---- .../operator/enums/AccountItemTypeEnum.java | 36 +++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/operator/enums/AccountItemTypeEnum.java diff --git a/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java b/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java index 1b795d3..eba9984 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java +++ b/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java @@ -1,7 +1,7 @@ package cn.com.tenlion.operator.controller.resource.accountitem; +import cn.com.tenlion.operator.enums.AccountItemTypeEnum; import cn.com.tenlion.operator.pojo.bos.accountitem.AccountItemBO; -import cn.com.tenlion.operator.pojo.dtos.agent.AgentDTO; import cn.com.tenlion.operator.pojo.vos.accountitem.AccountItemOrderVO; import cn.com.tenlion.operator.util.EncryptUtil; import com.alibaba.fastjson.JSONObject; @@ -13,7 +13,6 @@ import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.SuccessResult; -import ink.wgink.pojo.result.SuccessResultData; import ink.wgink.pojo.result.SuccessResultList; import cn.com.tenlion.operator.pojo.dtos.accountitem.AccountItemDTO; import cn.com.tenlion.operator.pojo.vos.accountitem.AccountItemVO; @@ -22,9 +21,7 @@ import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; @@ -142,7 +139,11 @@ public class AccountItemResourceController extends DefaultBaseController { } AccountItemVO accountItemVO = new AccountItemVO(); accountItemVO.setMode(1); // 入账 - accountItemVO.setType(accountItemOrderVO.getType() == 1 || accountItemOrderVO.getType() == 5 ? accountItemOrderVO.getType() : 5); // 收入类型 充值 | 订单收入 + accountItemVO.setType(( + accountItemOrderVO.getType() == AccountItemTypeEnum.RECHARGE.getValue() || + accountItemOrderVO.getType() == AccountItemTypeEnum.PAYMENT_SPLIT.getValue() || + accountItemOrderVO.getType() == AccountItemTypeEnum.REFUND.getValue() + ) ? accountItemOrderVO.getType() : AccountItemTypeEnum.PAYMENT_SPLIT.getValue()); // 收入类型 充值 | 分账入账 | 退款入账 accountItemVO.setAccountId(accountItemOrderVO.getUserId()); accountItemVO.setAccountMoney(accountItemOrderVO.getAccountMoney()); accountItemVO.setDescription(accountItemOrderVO.getDescription()); @@ -179,7 +180,12 @@ public class AccountItemResourceController extends DefaultBaseController { } AccountItemVO accountItemVO = new AccountItemVO(); accountItemVO.setMode(2); // 出账 - accountItemVO.setType(accountItemOrderVO.getType() == 2 || accountItemOrderVO.getType() == 3 || accountItemOrderVO.getType() == 4 ? accountItemOrderVO.getType() : 2); // 支出类型 系统扣款 | 支出 | 提现 + accountItemVO.setType( + (accountItemOrderVO.getType() == AccountItemTypeEnum.PAY_OUT.getValue() || + accountItemOrderVO.getType() == AccountItemTypeEnum.WITHDRAW_CASH.getValue() || + accountItemOrderVO.getType() == AccountItemTypeEnum.SYSTEM_DEDUCTION.getValue() || + accountItemOrderVO.getType() == AccountItemTypeEnum.REFUND_DEDUCTION.getValue() + ) ? accountItemOrderVO.getType() : AccountItemTypeEnum.PAY_OUT.getValue()); // 支出类型 系统扣款 | 支出 | 提现 / 退款 accountItemVO.setAccountId(accountItemOrderVO.getUserId()); accountItemVO.setAccountMoney(accountItemOrderVO.getAccountMoney()); accountItemVO.setDescription(accountItemOrderVO.getDescription()); diff --git a/src/main/java/cn/com/tenlion/operator/enums/AccountItemTypeEnum.java b/src/main/java/cn/com/tenlion/operator/enums/AccountItemTypeEnum.java new file mode 100644 index 0000000..098f8bf --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/enums/AccountItemTypeEnum.java @@ -0,0 +1,36 @@ +package cn.com.tenlion.operator.enums; + +/** + * @ClassName: AccountItemTypeEnum + * @Description: + * @Author: wanggeng + * @Date: 2024/8/21 15:09 + * @Version: 1.0 + */ +public enum AccountItemTypeEnum { + + RECHARGE(1, "充值"), + PAY_OUT(2, "支出"), + WITHDRAW_CASH(3, "提现"), + SYSTEM_DEDUCTION(4, "系统扣款"), + PAYMENT_SPLIT(5, "分账入账"), + REFUND_DEDUCTION(6, "退款扣款"), + REFUND(7, "退款入账"); + + + private final int value; + private final String text; + + AccountItemTypeEnum(int value, String text) { + this.value = value; + this.text = text; + } + + public int getValue() { + return value; + } + + public String getText() { + return text == null ? "" : text.trim(); + } +}