api/v4/app/account/wallet/balance查询账户(仅返回钱包余额)--移动端查询账户(仅返回钱包余额)
api/v4/app/account/info查询账户(基础信息+余额)--移动端查询账户(基础信息+余额)
This commit is contained in:
parent
3bdcf42f3f
commit
468591a2f1
|
|
@ -127,7 +127,16 @@
|
|||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.34.0.ALL</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.11</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,236 @@
|
|||
package com.bonus.core.account.v3.api.vo;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.core.account.v3.constants.AccStatusEnum;
|
||||
import com.bonus.core.common.encrypt.LeNiuDecryptDataProcess;
|
||||
import com.bonus.core.common.encrypt.LeNiuDecryptField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@LeNiuDecryptDataProcess
|
||||
public class AccInfoDetailVO {
|
||||
@ApiModelProperty("人员id")
|
||||
private Long custId;
|
||||
@ApiModelProperty("人员姓名")
|
||||
@LeNiuDecryptField
|
||||
private String custName;
|
||||
@ApiModelProperty("账户Id")
|
||||
private Long accId;
|
||||
@ApiModelProperty("第三方人员Id")
|
||||
private String custThirdId;
|
||||
@ApiModelProperty("组织id")
|
||||
private Long orgId;
|
||||
@ApiModelProperty("人员类别")
|
||||
private Integer psnType;
|
||||
@ApiModelProperty("账户状态 1正常 2冻结 3销户 4过期")
|
||||
private Integer accStatus;
|
||||
@ApiModelProperty("账户可用总余额(不包括冻结金额)")
|
||||
private BigDecimal accBalTotal;
|
||||
@ApiModelProperty("账户总余额(包含冻结金额)")
|
||||
private BigDecimal accAllBal;
|
||||
@ApiModelProperty("个人钱包(可用)余额/分")
|
||||
private BigDecimal walletBal;
|
||||
@ApiModelProperty("补贴钱包(可用)余额/分")
|
||||
private BigDecimal subsidyBal;
|
||||
@ApiModelProperty("红包余额")
|
||||
private BigDecimal redEnvelope;
|
||||
@ApiModelProperty("个人钱包冻结金额")
|
||||
private BigDecimal walletFreezeBal;
|
||||
@ApiModelProperty("补贴钱包冻结金额")
|
||||
private BigDecimal subFreezeBal;
|
||||
@ApiModelProperty("总冻结金额")
|
||||
private BigDecimal accFreezeBalTotal;
|
||||
@ApiModelProperty("卡序列号")
|
||||
private String serialNum;
|
||||
@ApiModelProperty("卡状态")
|
||||
private Integer cardStatus;
|
||||
@ApiModelProperty("押金")
|
||||
private Integer deposit;
|
||||
@ApiModelProperty("工本费")
|
||||
private Integer productCost;
|
||||
|
||||
public boolean isNormal() {
|
||||
return AccStatusEnum.NORMAL.getKey().equals(this.accStatus);
|
||||
}
|
||||
|
||||
public BigDecimal getAccBalTotal() {
|
||||
return ObjectUtil.isNull(this.accBalTotal) ? BigDecimal.ZERO : this.accBalTotal;
|
||||
}
|
||||
|
||||
public BigDecimal getWalletBal() {
|
||||
return ObjectUtil.isNull(this.walletBal) ? BigDecimal.ZERO : this.walletBal;
|
||||
}
|
||||
|
||||
public BigDecimal getSubsidyBal() {
|
||||
return ObjectUtil.isNull(this.subsidyBal) ? BigDecimal.ZERO : this.subsidyBal;
|
||||
}
|
||||
|
||||
public BigDecimal getRedEnvelope() {
|
||||
return ObjectUtil.isNull(this.redEnvelope) ? BigDecimal.ZERO : this.redEnvelope;
|
||||
}
|
||||
|
||||
public static AccInfoDetailVOBuilder builder() {
|
||||
return new AccInfoDetailVOBuilder();
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public String getCustName() {
|
||||
return this.custName;
|
||||
}
|
||||
|
||||
public Long getAccId() {
|
||||
return this.accId;
|
||||
}
|
||||
|
||||
public String getCustThirdId() {
|
||||
return this.custThirdId;
|
||||
}
|
||||
|
||||
public Long getOrgId() {
|
||||
return this.orgId;
|
||||
}
|
||||
|
||||
public Integer getPsnType() {
|
||||
return this.psnType;
|
||||
}
|
||||
|
||||
public Integer getAccStatus() {
|
||||
return this.accStatus;
|
||||
}
|
||||
|
||||
public BigDecimal getAccAllBal() {
|
||||
return this.accAllBal;
|
||||
}
|
||||
|
||||
public BigDecimal getWalletFreezeBal() {
|
||||
return this.walletFreezeBal;
|
||||
}
|
||||
|
||||
public BigDecimal getSubFreezeBal() {
|
||||
return this.subFreezeBal;
|
||||
}
|
||||
|
||||
public BigDecimal getAccFreezeBalTotal() {
|
||||
return this.accFreezeBalTotal;
|
||||
}
|
||||
|
||||
public String getSerialNum() {
|
||||
return this.serialNum;
|
||||
}
|
||||
|
||||
public Integer getCardStatus() {
|
||||
return this.cardStatus;
|
||||
}
|
||||
|
||||
public Integer getDeposit() {
|
||||
return this.deposit;
|
||||
}
|
||||
|
||||
public Integer getProductCost() {
|
||||
return this.productCost;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setCustName(final String custName) {
|
||||
this.custName = custName;
|
||||
}
|
||||
|
||||
public void setAccId(final Long accId) {
|
||||
this.accId = accId;
|
||||
}
|
||||
|
||||
public void setCustThirdId(final String custThirdId) {
|
||||
this.custThirdId = custThirdId;
|
||||
}
|
||||
|
||||
public void setOrgId(final Long orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public void setPsnType(final Integer psnType) {
|
||||
this.psnType = psnType;
|
||||
}
|
||||
|
||||
public void setAccStatus(final Integer accStatus) {
|
||||
this.accStatus = accStatus;
|
||||
}
|
||||
|
||||
public void setAccBalTotal(final BigDecimal accBalTotal) {
|
||||
this.accBalTotal = accBalTotal;
|
||||
}
|
||||
|
||||
public void setAccAllBal(final BigDecimal accAllBal) {
|
||||
this.accAllBal = accAllBal;
|
||||
}
|
||||
|
||||
public void setWalletBal(final BigDecimal walletBal) {
|
||||
this.walletBal = walletBal;
|
||||
}
|
||||
|
||||
public void setSubsidyBal(final BigDecimal subsidyBal) {
|
||||
this.subsidyBal = subsidyBal;
|
||||
}
|
||||
|
||||
public void setRedEnvelope(final BigDecimal redEnvelope) {
|
||||
this.redEnvelope = redEnvelope;
|
||||
}
|
||||
|
||||
public void setWalletFreezeBal(final BigDecimal walletFreezeBal) {
|
||||
this.walletFreezeBal = walletFreezeBal;
|
||||
}
|
||||
|
||||
public void setSubFreezeBal(final BigDecimal subFreezeBal) {
|
||||
this.subFreezeBal = subFreezeBal;
|
||||
}
|
||||
|
||||
public void setAccFreezeBalTotal(final BigDecimal accFreezeBalTotal) {
|
||||
this.accFreezeBalTotal = accFreezeBalTotal;
|
||||
}
|
||||
|
||||
public void setSerialNum(final String serialNum) {
|
||||
this.serialNum = serialNum;
|
||||
}
|
||||
|
||||
public void setCardStatus(final Integer cardStatus) {
|
||||
this.cardStatus = cardStatus;
|
||||
}
|
||||
|
||||
public void setDeposit(final Integer deposit) {
|
||||
this.deposit = deposit;
|
||||
}
|
||||
|
||||
public void setProductCost(final Integer productCost) {
|
||||
this.productCost = productCost;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class AccInfoDetailVOBuilder {
|
||||
private Long custId;
|
||||
private String custName;
|
||||
private Long accId;
|
||||
private String custThirdId;
|
||||
private Long orgId;
|
||||
private Integer psnType;
|
||||
private Integer accStatus;
|
||||
private BigDecimal accBalTotal;
|
||||
private BigDecimal accAllBal;
|
||||
private BigDecimal walletBal;
|
||||
private BigDecimal subsidyBal;
|
||||
private BigDecimal redEnvelope;
|
||||
private BigDecimal walletFreezeBal;
|
||||
private BigDecimal subFreezeBal;
|
||||
private BigDecimal accFreezeBalTotal;
|
||||
private String serialNum;
|
||||
private Integer cardStatus;
|
||||
private Integer deposit;
|
||||
private Integer productCost;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.bonus.core.account.v3.constants;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum AccStatusEnum {
|
||||
NORMAL(1, "正常"),
|
||||
DEACTIVATE(2, "停用"),
|
||||
CANCEL(3, "注销"),
|
||||
OVERDUE(4, "过期");
|
||||
|
||||
private final Integer key;
|
||||
private final String desc;
|
||||
|
||||
private AccStatusEnum(Integer key, String desc) {
|
||||
this.key = key;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static String getDesc(Integer key) {
|
||||
AccStatusEnum[] var1 = values();
|
||||
int var2 = var1.length;
|
||||
|
||||
for(int var3 = 0; var3 < var2; ++var3) {
|
||||
AccStatusEnum temp = var1[var3];
|
||||
if (temp.getKey().equals(key)) {
|
||||
return temp.getDesc();
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static AccStatusEnum getEnum(Integer key) {
|
||||
AccStatusEnum[] var1 = values();
|
||||
int var2 = var1.length;
|
||||
|
||||
for(int var3 = 0; var3 < var2; ++var3) {
|
||||
AccStatusEnum temp = var1[var3];
|
||||
if (temp.getKey().equals(key)) {
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Integer> sendMqStatus() {
|
||||
return Arrays.asList(DEACTIVATE.getKey(), OVERDUE.getKey());
|
||||
}
|
||||
|
||||
public static List<Integer> accStatusForAppWork() {
|
||||
return ListUtil.toList(new Integer[]{NORMAL.getKey(), DEACTIVATE.getKey(), OVERDUE.getKey()});
|
||||
}
|
||||
|
||||
public static boolean ifNotAllowRechargeRepeal(Integer key) {
|
||||
return ListUtil.toList(new Integer[]{CANCEL.getKey()}).contains(key);
|
||||
}
|
||||
|
||||
public Integer getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
// $FF: synthetic method
|
||||
private static AccStatusEnum[] $values() {
|
||||
return new AccStatusEnum[]{NORMAL, DEACTIVATE, CANCEL, OVERDUE};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.core.account.v3.custom;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
|
||||
import com.bonus.core.account.v4.app.dto.AppAccInfoV4DTO;
|
||||
import com.bonus.core.account.v4.app.vo.AppAccInfoV4VO;
|
||||
import com.bonus.core.common.custom.business.CustomBusiness;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AccForAppCustomBusiness implements CustomBusiness {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccForAppCustomBusiness.class);
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "账户移动端";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomBusiness.Version> versions() {
|
||||
return CollUtil.newArrayList(new CustomBusiness.Version[]{CustomBusiness.Version.of("5.1.0", "初版")});
|
||||
}
|
||||
|
||||
public void didGetAccInfoDetail(AccInfoDetailVO content) {
|
||||
log.info("获取小牛账户详情后操作");
|
||||
}
|
||||
|
||||
public void didGetAccInfoDetailV4(AppAccInfoV4DTO appAccInfoV4DTO, AppAccInfoV4VO appAccInfoV4VO) {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.core.account.v3.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
|
||||
import com.bonus.core.account.v3.model.AccInfo;
|
||||
import com.bonus.core.account.v3.web.vo.AccInfoVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AccInfoMapper extends BaseMapper<AccInfo> {
|
||||
AccInfoVO getAccInfoVOByCustId(@Param("custId") Long custId);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.core.account.v3.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.account.v3.model.AccTradeWalletDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AccTradeWalletDetailMapper extends BaseMapper<AccTradeWalletDetail> {
|
||||
List<AccTradeWalletDetail> listCustMonthAccSubsidyExpirationTrade(@Param("custId") Long custId, @Param("startDateTime") LocalDateTime startDateTime, @Param("endDateTime") LocalDateTime endDateTime);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.core.account.v3.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.account.v3.model.AccWalletInfo;
|
||||
import com.bonus.core.account.v3.web.vo.AccWalletInfoVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AccWalletInfoMapper extends BaseMapper<AccWalletInfo> {
|
||||
List<AccWalletInfoVO> queryAccWalletInfoVOListByCustId(@Param("custId") Long custId);
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package com.bonus.core.account.v3.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("acc_info")
|
||||
@ApiModel("账户信息表")
|
||||
public class AccInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId
|
||||
private Long id;
|
||||
private Long accId;
|
||||
private Long custId;
|
||||
private Integer scope;
|
||||
private LocalDate endDate;
|
||||
private Integer accStatus;
|
||||
private String payPwd;
|
||||
@TableField(
|
||||
value = "crby",
|
||||
fill = FieldFill.INSERT
|
||||
)
|
||||
private String crby;
|
||||
private LocalDateTime crtime;
|
||||
@TableField(
|
||||
value = "upby",
|
||||
fill = FieldFill.UPDATE
|
||||
)
|
||||
private String upby;
|
||||
private LocalDateTime uptime;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getAccId() {
|
||||
return this.accId;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Integer getScope() {
|
||||
return this.scope;
|
||||
}
|
||||
|
||||
public LocalDate getEndDate() {
|
||||
return this.endDate;
|
||||
}
|
||||
|
||||
public Integer getAccStatus() {
|
||||
return this.accStatus;
|
||||
}
|
||||
|
||||
public String getPayPwd() {
|
||||
return this.payPwd;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setAccId(final Long accId) {
|
||||
this.accId = accId;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setScope(final Integer scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public void setEndDate(final LocalDate endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public void setAccStatus(final Integer accStatus) {
|
||||
this.accStatus = accStatus;
|
||||
}
|
||||
|
||||
public void setPayPwd(final String payPwd) {
|
||||
this.payPwd = payPwd;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
package com.bonus.core.account.v3.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("acc_trade_wallet_detail")
|
||||
public class AccTradeWalletDetail implements Serializable {
|
||||
@TableId(
|
||||
type = IdType.AUTO
|
||||
)
|
||||
private Long id;
|
||||
private Long tradeId;
|
||||
private Long custId;
|
||||
private Integer walletId;
|
||||
private BigDecimal amount;
|
||||
private BigDecimal walletBal;
|
||||
private Integer tradeType;
|
||||
private LocalDateTime crtime;
|
||||
private LocalDateTime uptime;
|
||||
private BigDecimal frozenBalance;
|
||||
private LocalDateTime tradeTime;
|
||||
private LocalDateTime validateTime;
|
||||
private BigDecimal useAmount;
|
||||
private Integer expiredClear;
|
||||
@TableField(
|
||||
exist = false
|
||||
)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getTradeId() {
|
||||
return this.tradeId;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Integer getWalletId() {
|
||||
return this.walletId;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public BigDecimal getWalletBal() {
|
||||
return this.walletBal;
|
||||
}
|
||||
|
||||
public Integer getTradeType() {
|
||||
return this.tradeType;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public BigDecimal getFrozenBalance() {
|
||||
return this.frozenBalance;
|
||||
}
|
||||
|
||||
public LocalDateTime getTradeTime() {
|
||||
return this.tradeTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getValidateTime() {
|
||||
return this.validateTime;
|
||||
}
|
||||
|
||||
public BigDecimal getUseAmount() {
|
||||
return this.useAmount;
|
||||
}
|
||||
|
||||
public Integer getExpiredClear() {
|
||||
return this.expiredClear;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setTradeId(final Long tradeId) {
|
||||
this.tradeId = tradeId;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setWalletId(final Integer walletId) {
|
||||
this.walletId = walletId;
|
||||
}
|
||||
|
||||
public void setAmount(final BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public void setWalletBal(final BigDecimal walletBal) {
|
||||
this.walletBal = walletBal;
|
||||
}
|
||||
|
||||
public void setTradeType(final Integer tradeType) {
|
||||
this.tradeType = tradeType;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
public void setFrozenBalance(final BigDecimal frozenBalance) {
|
||||
this.frozenBalance = frozenBalance;
|
||||
}
|
||||
|
||||
public void setTradeTime(final LocalDateTime tradeTime) {
|
||||
this.tradeTime = tradeTime;
|
||||
}
|
||||
|
||||
public void setValidateTime(final LocalDateTime validateTime) {
|
||||
this.validateTime = validateTime;
|
||||
}
|
||||
|
||||
public void setUseAmount(final BigDecimal useAmount) {
|
||||
this.useAmount = useAmount;
|
||||
}
|
||||
|
||||
public void setExpiredClear(final Integer expiredClear) {
|
||||
this.expiredClear = expiredClear;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.bonus.core.account.v3.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("acc_wallet_info")
|
||||
public class AccWalletInfo implements Serializable {
|
||||
@TableId
|
||||
private Long custId;
|
||||
private Long accId;
|
||||
private Integer walletId;
|
||||
private BigDecimal walletBal;
|
||||
private BigDecimal limitBalance;
|
||||
private BigDecimal frozenBalance;
|
||||
private LocalDateTime expiredTime;
|
||||
private BigDecimal lastSubsidyAmount;
|
||||
private LocalDateTime lastSubsidyTime;
|
||||
private LocalDateTime crtime;
|
||||
private LocalDateTime uptime;
|
||||
private Long updateId;
|
||||
@TableField(
|
||||
exist = false
|
||||
)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Long getAccId() {
|
||||
return this.accId;
|
||||
}
|
||||
|
||||
public Integer getWalletId() {
|
||||
return this.walletId;
|
||||
}
|
||||
|
||||
public BigDecimal getWalletBal() {
|
||||
return this.walletBal;
|
||||
}
|
||||
|
||||
public BigDecimal getLimitBalance() {
|
||||
return this.limitBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getFrozenBalance() {
|
||||
return this.frozenBalance;
|
||||
}
|
||||
|
||||
public LocalDateTime getExpiredTime() {
|
||||
return this.expiredTime;
|
||||
}
|
||||
|
||||
public BigDecimal getLastSubsidyAmount() {
|
||||
return this.lastSubsidyAmount;
|
||||
}
|
||||
|
||||
public LocalDateTime getLastSubsidyTime() {
|
||||
return this.lastSubsidyTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public Long getUpdateId() {
|
||||
return this.updateId;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setAccId(final Long accId) {
|
||||
this.accId = accId;
|
||||
}
|
||||
|
||||
public void setWalletId(final Integer walletId) {
|
||||
this.walletId = walletId;
|
||||
}
|
||||
|
||||
public void setWalletBal(final BigDecimal walletBal) {
|
||||
this.walletBal = walletBal;
|
||||
}
|
||||
|
||||
public void setLimitBalance(final BigDecimal limitBalance) {
|
||||
this.limitBalance = limitBalance;
|
||||
}
|
||||
|
||||
public void setFrozenBalance(final BigDecimal frozenBalance) {
|
||||
this.frozenBalance = frozenBalance;
|
||||
}
|
||||
|
||||
public void setExpiredTime(final LocalDateTime expiredTime) {
|
||||
this.expiredTime = expiredTime;
|
||||
}
|
||||
|
||||
public void setLastSubsidyAmount(final BigDecimal lastSubsidyAmount) {
|
||||
this.lastSubsidyAmount = lastSubsidyAmount;
|
||||
}
|
||||
|
||||
public void setLastSubsidyTime(final LocalDateTime lastSubsidyTime) {
|
||||
this.lastSubsidyTime = lastSubsidyTime;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
public void setUpdateId(final Long updateId) {
|
||||
this.updateId = updateId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.bonus.core.account.v3.service;
|
||||
|
||||
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
|
||||
import com.bonus.core.account.v3.web.dto.AccInfoDetailDTO;
|
||||
|
||||
public interface AccInfoService {
|
||||
AccInfoDetailVO getAccInfoDetail(AccInfoDetailDTO content);
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.bonus.core.account.v3.service;
|
||||
|
||||
|
||||
import com.bonus.core.account.v3.model.AccTradeWalletDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AccTradeWalletDetailService {
|
||||
|
||||
List<AccTradeWalletDetail> listCustMonthAccSubsidyExpirationTrade(Long custId);
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.bonus.core.account.v3.service;
|
||||
|
||||
import com.bonus.core.account.v3.web.vo.AccWalletInfoVO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public interface AccWalletInfoService {
|
||||
List<AccWalletInfoVO> findAccWalletInfoVOListByCustId(Long custId);
|
||||
BigDecimal calculateSubsidyExpirationAmount(Long custId);
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.bonus.core.account.v3.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.constant.LeConstants;
|
||||
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
|
||||
import com.bonus.core.account.v3.constants.AccStatusEnum;
|
||||
import com.bonus.core.account.v3.mapper.AccInfoMapper;
|
||||
import com.bonus.core.account.v3.metadata.enums.AccWalletIdEnum;
|
||||
import com.bonus.core.account.v3.model.AccInfo;
|
||||
import com.bonus.core.account.v3.service.AccInfoService;
|
||||
import com.bonus.core.account.v3.service.AccWalletInfoService;
|
||||
import com.bonus.core.account.v3.utils.AccUtils;
|
||||
import com.bonus.core.account.v3.web.dto.AccInfoDetailDTO;
|
||||
import com.bonus.core.account.v3.web.vo.AccInfoVO;
|
||||
import com.bonus.core.account.v3.web.vo.AccWalletInfoVO;
|
||||
import com.bonus.core.account.v4.api.CardInfoServiceV4Api;
|
||||
import com.bonus.core.account.v4.web.model.AccCard;
|
||||
import com.bonus.core.common.redis.RedisUtil;
|
||||
import com.bonus.core.common.utils.TenantContextHolder;
|
||||
import com.bonus.utils.Id;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class AccInfoServiceImpl extends ServiceImpl<AccInfoMapper, AccInfo> implements AccInfoService {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccInfoServiceImpl.class);
|
||||
public static final String ACC_NOT_EXITS = "acc_not_exits";
|
||||
private static final Long CACHE_EXPIRATION_TIME = 60L;
|
||||
@Resource
|
||||
@Lazy
|
||||
private AccWalletInfoService accWalletInfoService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CardInfoServiceV4Api cardInfoServiceV4Api;
|
||||
|
||||
|
||||
@Override
|
||||
public AccInfoDetailVO getAccInfoDetail(AccInfoDetailDTO content) {
|
||||
AccInfoVO accInfo = this.getAccInfoVoByCustId(content.getCustId());
|
||||
AccInfoDetailVO accInfoDetailVO = new AccInfoDetailVO();
|
||||
BeanUtil.copyProperties(accInfo, accInfoDetailVO, new String[0]);
|
||||
accInfoDetailVO.setWalletBal(AccUtils.getWalletBal(accInfo.getWalletInfoList(), AccWalletIdEnum.WALLET.getKey()));
|
||||
accInfoDetailVO.setSubsidyBal(AccUtils.getWalletBal(accInfo.getWalletInfoList(), AccWalletIdEnum.SUBSIDY.getKey()));
|
||||
accInfoDetailVO.setRedEnvelope(AccUtils.getWalletBal(accInfo.getWalletInfoList(), AccWalletIdEnum.LUCK_MONEY.getKey()));
|
||||
accInfoDetailVO.setWalletFreezeBal(AccUtils.getWalletFrozenBal(accInfo.getWalletInfoList(), AccWalletIdEnum.WALLET.getKey()));
|
||||
accInfoDetailVO.setSubFreezeBal(AccUtils.getWalletFrozenBal(accInfo.getWalletInfoList(), AccWalletIdEnum.SUBSIDY.getKey()));
|
||||
accInfoDetailVO.setAccFreezeBalTotal(accInfo.getAccFreezeBalTotal());
|
||||
if (content.getIfQueryCardInfoBoolean()) {
|
||||
AccCard accCard = this.cardInfoServiceV4Api.queryOneCardInfoByCustId(accInfo.getCustId());
|
||||
if (ObjectUtil.isNotNull(accCard)) {
|
||||
accInfoDetailVO.setSerialNum(accCard.getSerialNum());
|
||||
accInfoDetailVO.setCardStatus(accCard.getCardStatus());
|
||||
accInfoDetailVO.setDeposit(accCard.getDeposit());
|
||||
accInfoDetailVO.setProductCost(accCard.getProductCost());
|
||||
}
|
||||
}
|
||||
return accInfoDetailVO;
|
||||
}
|
||||
|
||||
public AccInfoVO getAccInfoVoByCustId(Long custId) {
|
||||
log.info("获取账户(钱包)信息,入参={}", custId);
|
||||
AccInfoVO accInfoVO = ((AccInfoMapper)this.baseMapper).getAccInfoVOByCustId(custId);
|
||||
if (ObjectUtil.isNull(accInfoVO)) {
|
||||
throw new ServiceException("账户不存在");
|
||||
} else {
|
||||
List<AccWalletInfoVO> walletInfoList = this.accWalletInfoService.findAccWalletInfoVOListByCustId(custId);
|
||||
this.setAccInfoVODetailList(accInfoVO, walletInfoList);
|
||||
log.info("获取账户(钱包)信息,出参={}", JSONUtil.toJsonStr(accInfoVO));
|
||||
return accInfoVO;
|
||||
}
|
||||
}
|
||||
protected void setAccInfoVODetailList(AccInfoVO accInfoVO, List<AccWalletInfoVO> walletInfoList) {
|
||||
if (ObjectUtil.isNotEmpty(walletInfoList)) {
|
||||
accInfoVO.setAccBalTotal((BigDecimal)walletInfoList.stream().map(AccWalletInfoVO::getWalletBal).filter(ObjectUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
BigDecimal frozenBalanceAll = (BigDecimal)walletInfoList.stream().map(AccWalletInfoVO::getFrozenBalance).filter(ObjectUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
accInfoVO.setAccFreezeBalTotal(frozenBalanceAll);
|
||||
accInfoVO.setAccAllBal(NumberUtil.add(accInfoVO.getAccBalTotal(), accInfoVO.getAccFreezeBalTotal()));
|
||||
accInfoVO.setWalletInfoList(walletInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.core.account.v3.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.core.account.v3.mapper.AccTradeWalletDetailMapper;
|
||||
import com.bonus.core.account.v3.model.AccTradeWalletDetail;
|
||||
import com.bonus.core.account.v3.service.AccTradeWalletDetailService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AccTradeWalletDetailServiceImpl extends ServiceImpl<AccTradeWalletDetailMapper, AccTradeWalletDetail> implements AccTradeWalletDetailService {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccTradeWalletDetailServiceImpl.class);
|
||||
|
||||
|
||||
@Override
|
||||
public List<AccTradeWalletDetail> listCustMonthAccSubsidyExpirationTrade(Long custId) {
|
||||
return ((AccTradeWalletDetailMapper)this.baseMapper).listCustMonthAccSubsidyExpirationTrade(custId, LocalDateTime.now(), LocalDate.now().with(TemporalAdjusters.lastDayOfMonth()).atTime(23, 59, 59));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.bonus.core.account.v3.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.core.account.v3.mapper.AccWalletInfoMapper;
|
||||
import com.bonus.core.account.v3.model.AccTradeWalletDetail;
|
||||
import com.bonus.core.account.v3.model.AccWalletInfo;
|
||||
import com.bonus.core.account.v3.service.AccTradeWalletDetailService;
|
||||
import com.bonus.core.account.v3.service.AccWalletInfoService;
|
||||
import com.bonus.core.account.v3.web.vo.AccWalletInfoVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AccWalletInfoServiceImpl extends ServiceImpl<AccWalletInfoMapper, AccWalletInfo> implements AccWalletInfoService {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccWalletInfoServiceImpl.class);
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private AccTradeWalletDetailService accTradeWalletDetailService;
|
||||
@Override
|
||||
public List<AccWalletInfoVO> findAccWalletInfoVOListByCustId(Long custId) {
|
||||
return ((AccWalletInfoMapper)this.baseMapper).queryAccWalletInfoVOListByCustId(custId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BigDecimal calculateSubsidyExpirationAmount(Long custId) {
|
||||
List<AccWalletInfoVO> walletInfoVOList = ((AccWalletInfoMapper)this.baseMapper).queryAccWalletInfoVOListByCustId(custId);
|
||||
BigDecimal subBalAll = (BigDecimal)walletInfoVOList.stream().map((item) -> {
|
||||
return item.getWalletBal().add(item.getFrozenBalance());
|
||||
}).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
if (subBalAll.compareTo(BigDecimal.ZERO) > 0) {
|
||||
List<AccTradeWalletDetail> detailList = this.accTradeWalletDetailService.listCustMonthAccSubsidyExpirationTrade(custId);
|
||||
if (CollUtil.isEmpty(detailList)) {
|
||||
return BigDecimal.ZERO;
|
||||
} else {
|
||||
BigDecimal rechargeAmountSum = (BigDecimal)detailList.stream().map(AccTradeWalletDetail::getAmount).filter(ObjectUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal useAmountSum = (BigDecimal)detailList.stream().map(AccTradeWalletDetail::getUseAmount).filter(ObjectUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal noUseAmount = rechargeAmountSum.subtract(useAmountSum).max(BigDecimal.ZERO);
|
||||
return subBalAll.min(noUseAmount);
|
||||
}
|
||||
} else {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.bonus.core.account.v3.utils;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bonus.constant.LeConstants;
|
||||
import com.bonus.constant.RetCodeEnum;
|
||||
import com.bonus.core.account.v3.constants.AccStatusEnum;
|
||||
import com.bonus.core.account.v3.metadata.enums.AccWalletIdEnum;
|
||||
import com.bonus.core.account.v3.web.vo.AccInfoVO;
|
||||
import com.bonus.core.account.v3.web.vo.AccWalletInfoVO;
|
||||
import com.bonus.core.common.utils.TenantContextHolder;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class AccUtils {
|
||||
private static final Logger log = LoggerFactory.getLogger(AccUtils.class);
|
||||
|
||||
private AccUtils() {
|
||||
}
|
||||
|
||||
|
||||
public static BigDecimal getWalletBal(List<AccWalletInfoVO> walletInfoList, Integer walletId) {
|
||||
return (BigDecimal)walletInfoList.stream().filter((item) -> {
|
||||
return item.getWalletId().equals(walletId);
|
||||
}).map(AccWalletInfoVO::getWalletBal).filter(ObjectUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
public static BigDecimal getWalletFrozenBal(List<AccWalletInfoVO> walletInfoList, Integer walletId) {
|
||||
return (BigDecimal)walletInfoList.stream().filter((item) -> {
|
||||
return item.getWalletId().equals(walletId);
|
||||
}).map(AccWalletInfoVO::getFrozenBalance).filter(ObjectUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
public static String getRechargeBatchNum(Integer walletId) {
|
||||
AccWalletIdEnum anEnum = AccWalletIdEnum.getEnum(walletId);
|
||||
String walletPrefix;
|
||||
switch ((AccWalletIdEnum)Objects.requireNonNull(anEnum)) {
|
||||
case WALLET:
|
||||
walletPrefix = "w";
|
||||
break;
|
||||
case SUBSIDY:
|
||||
walletPrefix = "s";
|
||||
break;
|
||||
case LUCK_MONEY:
|
||||
walletPrefix = "r";
|
||||
break;
|
||||
default:
|
||||
walletPrefix = "n";
|
||||
}
|
||||
|
||||
String date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
|
||||
return walletPrefix + date;
|
||||
}
|
||||
|
||||
public static LocalDateTime nowPlusDayTime(Integer days) {
|
||||
if (ObjectUtil.isNotNull(days) && days > 0) {
|
||||
LocalDate plus = LocalDate.now().plusDays((long)days);
|
||||
return plus.atTime(23, 59, 59);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.bonus.core.account.v3.web.dto;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class AccInfoDetailDTO {
|
||||
@ApiModelProperty("人员id")
|
||||
private @NotNull(
|
||||
message = "{acc_single_null_custid_exception}"
|
||||
) Long custId;
|
||||
@ApiModelProperty("是否查询用户卡片信息,默认查询")
|
||||
private Boolean ifQueryCardInfoBoolean;
|
||||
|
||||
public Boolean getIfQueryCardInfoBoolean() {
|
||||
return ObjectUtil.isNull(this.ifQueryCardInfoBoolean) ? Boolean.TRUE : this.ifQueryCardInfoBoolean;
|
||||
}
|
||||
|
||||
public static AccInfoDetailDTOBuilder builder() {
|
||||
return new AccInfoDetailDTOBuilder();
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setIfQueryCardInfoBoolean(final Boolean ifQueryCardInfoBoolean) {
|
||||
this.ifQueryCardInfoBoolean = ifQueryCardInfoBoolean;
|
||||
}
|
||||
|
||||
public AccInfoDetailDTO(final Long custId, final Boolean ifQueryCardInfoBoolean) {
|
||||
this.custId = custId;
|
||||
this.ifQueryCardInfoBoolean = ifQueryCardInfoBoolean;
|
||||
}
|
||||
|
||||
public AccInfoDetailDTO() {
|
||||
}
|
||||
|
||||
public static class AccInfoDetailDTOBuilder {
|
||||
private Long custId;
|
||||
private Boolean ifQueryCardInfoBoolean;
|
||||
|
||||
AccInfoDetailDTOBuilder() {
|
||||
}
|
||||
|
||||
public AccInfoDetailDTOBuilder custId(final Long custId) {
|
||||
this.custId = custId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AccInfoDetailDTOBuilder ifQueryCardInfoBoolean(final Boolean ifQueryCardInfoBoolean) {
|
||||
this.ifQueryCardInfoBoolean = ifQueryCardInfoBoolean;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AccInfoDetailDTO build() {
|
||||
return new AccInfoDetailDTO(this.custId, this.ifQueryCardInfoBoolean);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,200 @@
|
|||
package com.bonus.core.account.v3.web.vo;
|
||||
|
||||
|
||||
import com.bonus.core.account.v3.constants.AccStatusEnum;
|
||||
import com.bonus.core.common.encrypt.LeNiuDecryptDataProcess;
|
||||
import com.bonus.core.common.encrypt.LeNiuDecryptField;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@LeNiuDecryptDataProcess
|
||||
public class AccInfoVO {
|
||||
private Long id;
|
||||
private Long custId;
|
||||
private Long accId;
|
||||
private String custThirdId;
|
||||
private String custNum;
|
||||
@LeNiuDecryptField
|
||||
private String custName;
|
||||
@LeNiuDecryptField
|
||||
private String mobile;
|
||||
private Long orgId;
|
||||
private String orgFullName;
|
||||
private Integer psnType;
|
||||
private String psnTypeName;
|
||||
private LocalDate endDate;
|
||||
private Integer accStatus;
|
||||
private BigDecimal accBalTotal;
|
||||
private BigDecimal accAllBal;
|
||||
private BigDecimal accFreezeBalTotal;
|
||||
private List<AccWalletInfoVO> walletInfoList;
|
||||
private String serialNum;
|
||||
private Integer deposit;
|
||||
private Integer productCost;
|
||||
|
||||
public boolean isNormal() {
|
||||
return AccStatusEnum.NORMAL.getKey().equals(this.accStatus);
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Long getAccId() {
|
||||
return this.accId;
|
||||
}
|
||||
|
||||
public String getCustThirdId() {
|
||||
return this.custThirdId;
|
||||
}
|
||||
|
||||
public String getCustNum() {
|
||||
return this.custNum;
|
||||
}
|
||||
|
||||
public String getCustName() {
|
||||
return this.custName;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return this.mobile;
|
||||
}
|
||||
|
||||
public Long getOrgId() {
|
||||
return this.orgId;
|
||||
}
|
||||
|
||||
public String getOrgFullName() {
|
||||
return this.orgFullName;
|
||||
}
|
||||
|
||||
public Integer getPsnType() {
|
||||
return this.psnType;
|
||||
}
|
||||
|
||||
public String getPsnTypeName() {
|
||||
return this.psnTypeName;
|
||||
}
|
||||
|
||||
public LocalDate getEndDate() {
|
||||
return this.endDate;
|
||||
}
|
||||
|
||||
public Integer getAccStatus() {
|
||||
return this.accStatus;
|
||||
}
|
||||
|
||||
public BigDecimal getAccBalTotal() {
|
||||
return this.accBalTotal;
|
||||
}
|
||||
|
||||
public BigDecimal getAccAllBal() {
|
||||
return this.accAllBal;
|
||||
}
|
||||
|
||||
public BigDecimal getAccFreezeBalTotal() {
|
||||
return this.accFreezeBalTotal;
|
||||
}
|
||||
|
||||
public List<AccWalletInfoVO> getWalletInfoList() {
|
||||
return this.walletInfoList;
|
||||
}
|
||||
|
||||
public String getSerialNum() {
|
||||
return this.serialNum;
|
||||
}
|
||||
|
||||
public Integer getDeposit() {
|
||||
return this.deposit;
|
||||
}
|
||||
|
||||
public Integer getProductCost() {
|
||||
return this.productCost;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setAccId(final Long accId) {
|
||||
this.accId = accId;
|
||||
}
|
||||
|
||||
public void setCustThirdId(final String custThirdId) {
|
||||
this.custThirdId = custThirdId;
|
||||
}
|
||||
|
||||
public void setCustNum(final String custNum) {
|
||||
this.custNum = custNum;
|
||||
}
|
||||
|
||||
public void setCustName(final String custName) {
|
||||
this.custName = custName;
|
||||
}
|
||||
|
||||
public void setMobile(final String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public void setOrgId(final Long orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public void setOrgFullName(final String orgFullName) {
|
||||
this.orgFullName = orgFullName;
|
||||
}
|
||||
|
||||
public void setPsnType(final Integer psnType) {
|
||||
this.psnType = psnType;
|
||||
}
|
||||
|
||||
public void setPsnTypeName(final String psnTypeName) {
|
||||
this.psnTypeName = psnTypeName;
|
||||
}
|
||||
|
||||
public void setEndDate(final LocalDate endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public void setAccStatus(final Integer accStatus) {
|
||||
this.accStatus = accStatus;
|
||||
}
|
||||
|
||||
public void setAccBalTotal(final BigDecimal accBalTotal) {
|
||||
this.accBalTotal = accBalTotal;
|
||||
}
|
||||
|
||||
public void setAccAllBal(final BigDecimal accAllBal) {
|
||||
this.accAllBal = accAllBal;
|
||||
}
|
||||
|
||||
public void setAccFreezeBalTotal(final BigDecimal accFreezeBalTotal) {
|
||||
this.accFreezeBalTotal = accFreezeBalTotal;
|
||||
}
|
||||
|
||||
public void setWalletInfoList(final List<AccWalletInfoVO> walletInfoList) {
|
||||
this.walletInfoList = walletInfoList;
|
||||
}
|
||||
|
||||
public void setSerialNum(final String serialNum) {
|
||||
this.serialNum = serialNum;
|
||||
}
|
||||
|
||||
public void setDeposit(final Integer deposit) {
|
||||
this.deposit = deposit;
|
||||
}
|
||||
|
||||
public void setProductCost(final Integer productCost) {
|
||||
this.productCost = productCost;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.bonus.core.account.v3.web.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class AccWalletInfoVO {
|
||||
private Long custId;
|
||||
private Long accId;
|
||||
private Integer walletId;
|
||||
private BigDecimal walletBal;
|
||||
private BigDecimal limitBalance;
|
||||
private BigDecimal frozenBalance;
|
||||
private BigDecimal lastSubsidyAmount;
|
||||
private LocalDateTime lastSubsidyTime;
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Long getAccId() {
|
||||
return this.accId;
|
||||
}
|
||||
|
||||
public Integer getWalletId() {
|
||||
return this.walletId;
|
||||
}
|
||||
|
||||
public BigDecimal getWalletBal() {
|
||||
return this.walletBal;
|
||||
}
|
||||
|
||||
public BigDecimal getLimitBalance() {
|
||||
return this.limitBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getFrozenBalance() {
|
||||
return this.frozenBalance;
|
||||
}
|
||||
|
||||
public BigDecimal getLastSubsidyAmount() {
|
||||
return this.lastSubsidyAmount;
|
||||
}
|
||||
|
||||
public LocalDateTime getLastSubsidyTime() {
|
||||
return this.lastSubsidyTime;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setAccId(final Long accId) {
|
||||
this.accId = accId;
|
||||
}
|
||||
|
||||
public void setWalletId(final Integer walletId) {
|
||||
this.walletId = walletId;
|
||||
}
|
||||
|
||||
public void setWalletBal(final BigDecimal walletBal) {
|
||||
this.walletBal = walletBal;
|
||||
}
|
||||
|
||||
public void setLimitBalance(final BigDecimal limitBalance) {
|
||||
this.limitBalance = limitBalance;
|
||||
}
|
||||
|
||||
public void setFrozenBalance(final BigDecimal frozenBalance) {
|
||||
this.frozenBalance = frozenBalance;
|
||||
}
|
||||
|
||||
public void setLastSubsidyAmount(final BigDecimal lastSubsidyAmount) {
|
||||
this.lastSubsidyAmount = lastSubsidyAmount;
|
||||
}
|
||||
|
||||
public void setLastSubsidyTime(final LocalDateTime lastSubsidyTime) {
|
||||
this.lastSubsidyTime = lastSubsidyTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.bonus.core.account.v4.api;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.core.account.v4.constant.CardStatusEnum;
|
||||
import com.bonus.core.account.v4.web.model.AccCard;
|
||||
import com.bonus.core.account.v4.web.service.CardInfoV4Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CardInfoServiceV4Api {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private CardInfoV4Service cardInfoService;
|
||||
|
||||
public AccCard queryOneCardInfoByCustId(Long custId) {
|
||||
List<AccCard> accCards = this.queryCardInfoByCustIdOrSerialNum(custId, (String) null);
|
||||
return CollUtil.isNotEmpty(accCards) ? (AccCard) accCards.get(0) : null;
|
||||
}
|
||||
|
||||
public List<AccCard> queryCardInfoByCustIdOrSerialNum(Long custId, String serialNum) {
|
||||
return this.cardInfoService.list(Wrappers.lambdaQuery(AccCard.class)
|
||||
.eq(ObjectUtil.isNotNull(custId), AccCard::getCustId, custId)
|
||||
.eq(ObjectUtil.isNotNull(serialNum), AccCard::getSerialNum, serialNum)
|
||||
.in(AccCard::getCardStatus, CardStatusEnum.normalAndLoss())
|
||||
.orderByDesc(AccCard::getUptime));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.bonus.core.account.v4.app.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.core.account.v4.app.dto.AppAccInfoV4DTO;
|
||||
import com.bonus.core.account.v4.app.service.impl.AppAccV4Service;
|
||||
import com.bonus.core.account.v4.app.vo.AppAccInfoV4VO;
|
||||
import com.bonus.core.account.v4.app.vo.AppWalletBalanceVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/api/v4/app/account"})
|
||||
@Api(
|
||||
value = "账户管理/移动端/v4",
|
||||
tags = {"账户管理/移动端/v4"}
|
||||
)
|
||||
public class AppAccV4Controller extends BaseController {
|
||||
private static final Logger log = LoggerFactory.getLogger(AppAccV4Controller.class);
|
||||
@Resource
|
||||
private AppAccV4Service appAccV4Service;
|
||||
|
||||
@ApiOperation(
|
||||
value = "查询账户(仅返回钱包余额)",
|
||||
notes = "移动端查询账户(仅返回钱包余额)"
|
||||
)
|
||||
@PostMapping({"/wallet/balance"})
|
||||
public AjaxResult queryWalletBalance(@RequestBody AppAccInfoV4DTO o) {
|
||||
return success(this.appAccV4Service.queryWalletBalance(o));
|
||||
}
|
||||
|
||||
@ApiOperation(
|
||||
value = "查询账户(基础信息+余额)",
|
||||
notes = "移动端查询账户(基础信息+余额)"
|
||||
)
|
||||
@PostMapping({"/info"})
|
||||
public AjaxResult queryAccInfoForApp(@RequestBody AppAccInfoV4DTO o) {
|
||||
return success(this.appAccV4Service.queryAccInfoForApp(o));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.core.account.v4.app.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class AppAccInfoV4DTO {
|
||||
@ApiModelProperty("人员Id")
|
||||
private @NotNull(message = "{acc_single_null_custid_exception}") Long custId;
|
||||
@ApiModelProperty(value = "openid", hidden = true)
|
||||
private String openid;
|
||||
@ApiModelProperty(value = "来源类型 1-微信小程序 2-微信公众号 3-企业微信 5-支付宝 7-h5 9-钉钉", hidden = true)
|
||||
private Integer sourceType;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.bonus.core.account.v4.app.service;
|
||||
|
||||
|
||||
public interface AppWorkV4Service {
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.bonus.core.account.v4.app.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
|
||||
import com.bonus.core.account.v3.custom.AccForAppCustomBusiness;
|
||||
import com.bonus.core.account.v3.service.AccInfoService;
|
||||
import com.bonus.core.account.v3.service.AccWalletInfoService;
|
||||
import com.bonus.core.account.v3.web.dto.AccInfoDetailDTO;
|
||||
import com.bonus.core.account.v4.app.dto.AppAccInfoV4DTO;
|
||||
import com.bonus.core.account.v4.app.vo.AppAccInfoV4VO;
|
||||
import com.bonus.core.account.v4.app.vo.AppWalletBalanceVO;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class AppAccV4Service {
|
||||
private static final Logger log = LoggerFactory.getLogger(AppAccV4Service.class);
|
||||
@Resource
|
||||
@Lazy
|
||||
private AccInfoService accInfoService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private AccForAppCustomBusiness accForAppCustomBusiness;
|
||||
@Resource
|
||||
@Lazy
|
||||
private AccWalletInfoService accWalletInfoService;
|
||||
|
||||
public AppWalletBalanceVO queryWalletBalance(AppAccInfoV4DTO appAccInfoV4DTO) {
|
||||
log.info("[app]v4查询账户余额入参={}", JSONUtil.toJsonStr(appAccInfoV4DTO));
|
||||
AccInfoDetailVO accInfoDetailVO = this.accInfoService.getAccInfoDetail(AccInfoDetailDTO.builder().custId(appAccInfoV4DTO.getCustId()).ifQueryCardInfoBoolean(Boolean.FALSE).build());
|
||||
AppWalletBalanceVO walletBalanceVO = AppWalletBalanceVO.of(accInfoDetailVO);
|
||||
log.info("[app]v4查询账户余额入参={}", JSONUtil.toJsonStr(walletBalanceVO));
|
||||
return walletBalanceVO;
|
||||
}
|
||||
|
||||
public AppAccInfoV4VO queryAccInfoForApp(AppAccInfoV4DTO appAccInfoV4DTO) {
|
||||
log.info("[app]v4查询账户信息入参={}", JSONUtil.toJsonStr(appAccInfoV4DTO));
|
||||
AccInfoDetailVO accInfoDetailVO = this.accInfoService.getAccInfoDetail(AccInfoDetailDTO.builder().custId(appAccInfoV4DTO.getCustId()).ifQueryCardInfoBoolean(Boolean.FALSE).build());
|
||||
AppAccInfoV4VO appAccInfoV4VO = AppAccInfoV4VO.of(accInfoDetailVO);
|
||||
appAccInfoV4VO.setSubsidyExpirationToast(this.calculateSubsidyExpirationAmount(appAccInfoV4VO.getCustId()));
|
||||
this.accForAppCustomBusiness.didGetAccInfoDetailV4(appAccInfoV4DTO, appAccInfoV4VO);
|
||||
log.info("[app]v4查询账户信息结果vo={}", JSONUtil.toJsonStr(appAccInfoV4VO));
|
||||
return appAccInfoV4VO;
|
||||
}
|
||||
|
||||
protected String calculateSubsidyExpirationAmount(Long custId) {
|
||||
BigDecimal amountFen = this.accWalletInfoService.calculateSubsidyExpirationAmount(custId);
|
||||
if (amountFen.compareTo(BigDecimal.ZERO) > 0) {
|
||||
BigDecimal amountYuan = amountFen.divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP);
|
||||
return "本月¥" + String.valueOf(amountYuan) + "补贴即将过期";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.bonus.core.account.v4.app.service.impl;
|
||||
|
||||
import com.bonus.core.account.v4.app.service.AppWorkV4Service;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AppWorkV4ServiceImpl implements AppWorkV4Service {
|
||||
private static final Logger log = LoggerFactory.getLogger(AppWorkV4ServiceImpl.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.bonus.core.account.v4.app.vo;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
|
||||
import com.bonus.core.common.encrypt.LeNiuDecryptField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@Data
|
||||
public class AppAccInfoV4VO {
|
||||
@ApiModelProperty("人员id")
|
||||
private Long custId;
|
||||
@ApiModelProperty("人员姓名")
|
||||
@LeNiuDecryptField
|
||||
private String custName;
|
||||
@ApiModelProperty("账户Id")
|
||||
private Long accId;
|
||||
@ApiModelProperty("第三方人员Id")
|
||||
private String custThirdId;
|
||||
@ApiModelProperty("组织id")
|
||||
private Long orgId;
|
||||
@ApiModelProperty("人员类别")
|
||||
private Integer psnType;
|
||||
@ApiModelProperty("账户状态 1正常 2冻结 3销户 4过期")
|
||||
private Integer accStatus;
|
||||
@ApiModelProperty("个人钱包(可用)余额/分")
|
||||
private BigDecimal walletBal;
|
||||
@ApiModelProperty("补贴钱包(可用)余额/分")
|
||||
private BigDecimal subsidyBal;
|
||||
@ApiModelProperty("红包(可用)余额")
|
||||
private BigDecimal redEnvelope;
|
||||
@ApiModelProperty("补贴钱包总金额(可用+冻结)")
|
||||
private BigDecimal subBalTotal;
|
||||
@ApiModelProperty("个人钱包冻结金额")
|
||||
private BigDecimal walletFreezeBal;
|
||||
@ApiModelProperty("补贴钱包冻结金额")
|
||||
private BigDecimal subFreezeBal;
|
||||
@ApiModelProperty("总冻结金额")
|
||||
private BigDecimal accFreezeBalTotal;
|
||||
@ApiModelProperty("账户总余额(包含冻结金额)")
|
||||
private BigDecimal accAllBal;
|
||||
@ApiModelProperty("账户可用余额总余额(不包括冻结金额)")
|
||||
private BigDecimal accBalTotal;
|
||||
@ApiModelProperty("补贴过期即将过期提示")
|
||||
private String subsidyExpirationToast;
|
||||
|
||||
public static AppAccInfoV4VO of(AccInfoDetailVO accInfoDetailVO) {
|
||||
AppAccInfoV4VO appAccInfoV4VO = new AppAccInfoV4VO();
|
||||
appAccInfoV4VO.setCustId(accInfoDetailVO.getCustId());
|
||||
appAccInfoV4VO.setCustName(accInfoDetailVO.getCustName());
|
||||
appAccInfoV4VO.setAccId(accInfoDetailVO.getAccId());
|
||||
appAccInfoV4VO.setCustThirdId(accInfoDetailVO.getCustThirdId());
|
||||
appAccInfoV4VO.setOrgId(accInfoDetailVO.getOrgId());
|
||||
appAccInfoV4VO.setPsnType(accInfoDetailVO.getPsnType());
|
||||
appAccInfoV4VO.setAccBalTotal(accInfoDetailVO.getAccBalTotal());
|
||||
appAccInfoV4VO.setAccAllBal(accInfoDetailVO.getAccAllBal());
|
||||
appAccInfoV4VO.setWalletBal(accInfoDetailVO.getWalletBal());
|
||||
appAccInfoV4VO.setSubsidyBal(accInfoDetailVO.getSubsidyBal());
|
||||
appAccInfoV4VO.setRedEnvelope(accInfoDetailVO.getRedEnvelope());
|
||||
appAccInfoV4VO.setWalletFreezeBal(accInfoDetailVO.getWalletFreezeBal());
|
||||
appAccInfoV4VO.setSubFreezeBal(accInfoDetailVO.getSubFreezeBal());
|
||||
appAccInfoV4VO.setAccFreezeBalTotal(accInfoDetailVO.getAccFreezeBalTotal());
|
||||
appAccInfoV4VO.setAccStatus(accInfoDetailVO.getAccStatus());
|
||||
appAccInfoV4VO.setSubBalTotal(accInfoDetailVO.getSubsidyBal().add(accInfoDetailVO.getSubFreezeBal()));
|
||||
return appAccInfoV4VO;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.bonus.core.account.v4.app.vo;
|
||||
|
||||
import com.bonus.core.account.v3.api.vo.AccInfoDetailVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@Data
|
||||
public class AppWalletBalanceVO {
|
||||
@ApiModelProperty("个人钱包余额/分")
|
||||
private BigDecimal walletBal;
|
||||
@ApiModelProperty("补贴钱包余额/分")
|
||||
private BigDecimal subsidyBal;
|
||||
@ApiModelProperty("红包余额")
|
||||
private BigDecimal redEnvelope;
|
||||
@ApiModelProperty("个人钱包冻结金额")
|
||||
private BigDecimal walletFreezeBal;
|
||||
@ApiModelProperty("补贴钱包冻结金额")
|
||||
private BigDecimal subFreezeBal;
|
||||
@ApiModelProperty("冻结金额")
|
||||
private BigDecimal accFreezeBalTotal;
|
||||
@ApiModelProperty("账户总余额(包含冻结金额)")
|
||||
private BigDecimal accAllBal;
|
||||
@ApiModelProperty("账户可用余额总余额(不包括冻结金额)")
|
||||
private BigDecimal accBalTotal;
|
||||
@ApiModelProperty("账户状态 1正常 2冻结 3销户 4过期")
|
||||
private Integer accStatus;
|
||||
|
||||
|
||||
public static AppWalletBalanceVO of(AccInfoDetailVO accInfoDetailVO) {
|
||||
AppWalletBalanceVO walletBalanceVO = new AppWalletBalanceVO();
|
||||
walletBalanceVO.setAccBalTotal(accInfoDetailVO.getAccBalTotal());
|
||||
walletBalanceVO.setAccAllBal(accInfoDetailVO.getAccAllBal());
|
||||
walletBalanceVO.setWalletBal(accInfoDetailVO.getWalletBal());
|
||||
walletBalanceVO.setSubsidyBal(accInfoDetailVO.getSubsidyBal());
|
||||
walletBalanceVO.setRedEnvelope(accInfoDetailVO.getRedEnvelope());
|
||||
walletBalanceVO.setWalletFreezeBal(accInfoDetailVO.getWalletFreezeBal());
|
||||
walletBalanceVO.setSubFreezeBal(accInfoDetailVO.getSubFreezeBal());
|
||||
walletBalanceVO.setAccFreezeBalTotal(accInfoDetailVO.getAccFreezeBalTotal());
|
||||
walletBalanceVO.setAccStatus(accInfoDetailVO.getAccStatus());
|
||||
return walletBalanceVO;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.core.account.v4.constant;
|
||||
|
||||
|
||||
import com.bonus.core.common.converter.LeExcelFieldConvertor;
|
||||
import com.bonus.core.common.converter.LeExcelFieldEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum CardStatusEnum implements LeExcelFieldEnum<CardStatusEnum> {
|
||||
NORMAL(1, "正常"),
|
||||
LOSS(4, "挂失"),
|
||||
APPLY(5, "发卡"),
|
||||
REFUND(6, "退卡"),
|
||||
EXPIRED(7, "已过期");
|
||||
|
||||
private final Integer key;
|
||||
private final String desc;
|
||||
|
||||
private CardStatusEnum(Integer key, String desc) {
|
||||
this.key = key;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static String getDesc(Integer key) {
|
||||
CardStatusEnum[] var1 = values();
|
||||
int var2 = var1.length;
|
||||
|
||||
for(int var3 = 0; var3 < var2; ++var3) {
|
||||
CardStatusEnum temp = var1[var3];
|
||||
if (temp.getKey().equals(key)) {
|
||||
return temp.getDesc();
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<Integer> normalAndLoss() {
|
||||
return Arrays.asList(NORMAL.getKey(), LOSS.getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
// $FF: synthetic method
|
||||
private static CardStatusEnum[] $values() {
|
||||
return new CardStatusEnum[]{NORMAL, LOSS, APPLY, REFUND, EXPIRED};
|
||||
}
|
||||
|
||||
public static class ExcelConvertor extends LeExcelFieldConvertor<CardStatusEnum> {
|
||||
public ExcelConvertor() {
|
||||
super(CardStatusEnum.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.core.account.v4.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.account.v4.web.model.AccCard;
|
||||
import com.bonus.core.account.vo.AccCardBaseInfoVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AccCardMapper extends BaseMapper<AccCard> {
|
||||
@Select({"SELECT ci.cust_num, ac.serial_num FROM acc_card ac LEFT JOIN cust_info ci ON ac.cust_id = ci.cust_id where ac.card_status in (1,4)"})
|
||||
List<AccCardBaseInfoVO> listAccCardBaseInfo();
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.core.account.v4.web.mapper.AccCardMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,265 @@
|
|||
package com.bonus.core.account.v4.web.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("acc_card")
|
||||
@ApiModel("人员卡片资料表")
|
||||
public class AccCard extends Model<AccCard> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId
|
||||
@ApiModelProperty("主键自增")
|
||||
private Long id;
|
||||
@ApiModelProperty("人员id")
|
||||
private Long custId;
|
||||
@ApiModelProperty("账户id")
|
||||
private Long accId;
|
||||
@ApiModelProperty("卡号")
|
||||
private Integer cardNum;
|
||||
@ApiModelProperty("卡序列号")
|
||||
private String serialNum;
|
||||
@ApiModelProperty("卡类型")
|
||||
private Integer cardType;
|
||||
@ApiModelProperty("卡状态 1-正常 4-挂失")
|
||||
private Integer cardStatus;
|
||||
@ApiModelProperty("押金 单位分")
|
||||
private Integer deposit;
|
||||
@ApiModelProperty("工本费 单位分")
|
||||
private Integer productCost;
|
||||
@ApiModelProperty("待缴工本费金额 单位分")
|
||||
private Integer pendProductCost;
|
||||
@ApiModelProperty("卡片有效期")
|
||||
private LocalDate validityDate;
|
||||
@ApiModelProperty("预留字段1")
|
||||
private String reserved1;
|
||||
@ApiModelProperty("预留字段2")
|
||||
private String reserved2;
|
||||
@ApiModelProperty("预留字段3")
|
||||
private String reserved3;
|
||||
@ApiModelProperty("乐观锁")
|
||||
private Integer revision;
|
||||
@TableField(
|
||||
value = "crby",
|
||||
fill = FieldFill.INSERT
|
||||
)
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(
|
||||
value = "crtime",
|
||||
fill = FieldFill.INSERT
|
||||
)
|
||||
private LocalDateTime crtime;
|
||||
@TableField(
|
||||
value = "upby",
|
||||
fill = FieldFill.UPDATE
|
||||
)
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
@TableField(
|
||||
value = "uptime",
|
||||
fill = FieldFill.UPDATE
|
||||
)
|
||||
private LocalDateTime uptime;
|
||||
@ApiModelProperty("三方卡号")
|
||||
private String thirdSerialNum;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
@ApiModelProperty("卡面号")
|
||||
private String cardFaceNum;
|
||||
@ApiModelProperty("发卡来源")
|
||||
private String cardSourceType;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getCustId() {
|
||||
return this.custId;
|
||||
}
|
||||
|
||||
public Long getAccId() {
|
||||
return this.accId;
|
||||
}
|
||||
|
||||
public Integer getCardNum() {
|
||||
return this.cardNum;
|
||||
}
|
||||
|
||||
public String getSerialNum() {
|
||||
return this.serialNum;
|
||||
}
|
||||
|
||||
public Integer getCardType() {
|
||||
return this.cardType;
|
||||
}
|
||||
|
||||
public Integer getCardStatus() {
|
||||
return this.cardStatus;
|
||||
}
|
||||
|
||||
public Integer getDeposit() {
|
||||
return this.deposit;
|
||||
}
|
||||
|
||||
public Integer getProductCost() {
|
||||
return this.productCost;
|
||||
}
|
||||
|
||||
public Integer getPendProductCost() {
|
||||
return this.pendProductCost;
|
||||
}
|
||||
|
||||
public LocalDate getValidityDate() {
|
||||
return this.validityDate;
|
||||
}
|
||||
|
||||
public String getReserved1() {
|
||||
return this.reserved1;
|
||||
}
|
||||
|
||||
public String getReserved2() {
|
||||
return this.reserved2;
|
||||
}
|
||||
|
||||
public String getReserved3() {
|
||||
return this.reserved3;
|
||||
}
|
||||
|
||||
public Integer getRevision() {
|
||||
return this.revision;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public String getThirdSerialNum() {
|
||||
return this.thirdSerialNum;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return this.remark;
|
||||
}
|
||||
|
||||
public String getCardFaceNum() {
|
||||
return this.cardFaceNum;
|
||||
}
|
||||
|
||||
public String getCardSourceType() {
|
||||
return this.cardSourceType;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setCustId(final Long custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public void setAccId(final Long accId) {
|
||||
this.accId = accId;
|
||||
}
|
||||
|
||||
public void setCardNum(final Integer cardNum) {
|
||||
this.cardNum = cardNum;
|
||||
}
|
||||
|
||||
public void setSerialNum(final String serialNum) {
|
||||
this.serialNum = serialNum;
|
||||
}
|
||||
|
||||
public void setCardType(final Integer cardType) {
|
||||
this.cardType = cardType;
|
||||
}
|
||||
|
||||
public void setCardStatus(final Integer cardStatus) {
|
||||
this.cardStatus = cardStatus;
|
||||
}
|
||||
|
||||
public void setDeposit(final Integer deposit) {
|
||||
this.deposit = deposit;
|
||||
}
|
||||
|
||||
public void setProductCost(final Integer productCost) {
|
||||
this.productCost = productCost;
|
||||
}
|
||||
|
||||
public void setPendProductCost(final Integer pendProductCost) {
|
||||
this.pendProductCost = pendProductCost;
|
||||
}
|
||||
|
||||
public void setValidityDate(final LocalDate validityDate) {
|
||||
this.validityDate = validityDate;
|
||||
}
|
||||
|
||||
public void setReserved1(final String reserved1) {
|
||||
this.reserved1 = reserved1;
|
||||
}
|
||||
|
||||
public void setReserved2(final String reserved2) {
|
||||
this.reserved2 = reserved2;
|
||||
}
|
||||
|
||||
public void setReserved3(final String reserved3) {
|
||||
this.reserved3 = reserved3;
|
||||
}
|
||||
|
||||
public void setRevision(final Integer revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
public void setThirdSerialNum(final String thirdSerialNum) {
|
||||
this.thirdSerialNum = thirdSerialNum;
|
||||
}
|
||||
|
||||
public void setRemark(final String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public void setCardFaceNum(final String cardFaceNum) {
|
||||
this.cardFaceNum = cardFaceNum;
|
||||
}
|
||||
|
||||
public void setCardSourceType(final String cardSourceType) {
|
||||
this.cardSourceType = cardSourceType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.bonus.core.account.v4.web.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.core.account.v4.web.mapper.AccCardMapper;
|
||||
import com.bonus.core.account.v4.web.model.AccCard;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class CardInfoV4Service extends ServiceImpl<AccCardMapper, AccCard> {
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.bonus.core.account.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class AccCardBaseInfoVO {
|
||||
@ApiModelProperty("人员编号")
|
||||
private String custNum;
|
||||
@ApiModelProperty("卡序列号")
|
||||
private String serialNum;
|
||||
|
||||
public String getCustNum() {
|
||||
return this.custNum;
|
||||
}
|
||||
|
||||
public String getSerialNum() {
|
||||
return this.serialNum;
|
||||
}
|
||||
|
||||
public void setCustNum(final String custNum) {
|
||||
this.custNum = custNum;
|
||||
}
|
||||
|
||||
public void setSerialNum(final String serialNum) {
|
||||
this.serialNum = serialNum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.core.allocation.alloc.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("数据管理配置项")
|
||||
@Data
|
||||
public class DataManageMetadataModel {
|
||||
@ApiModelProperty("手机号脱敏")
|
||||
private String phoneDesensitization = "1";
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.core.common.converter;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class LeExcelFieldConvertor<T extends LeExcelFieldEnum<?>> implements Converter<Integer> {
|
||||
private final Class<T> clz;
|
||||
|
||||
protected LeExcelFieldConvertor(Class<T> clz) {
|
||||
this.clz = clz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
|
||||
if (Objects.isNull(value)) {
|
||||
return new WriteCellData("");
|
||||
} else {
|
||||
String desc = "";
|
||||
T[] enumConstants = (T[]) this.clz.getEnumConstants();
|
||||
if (enumConstants != null) {
|
||||
LeExcelFieldEnum[] var6 = enumConstants;
|
||||
int var7 = enumConstants.length;
|
||||
|
||||
for(int var8 = 0; var8 < var7; ++var8) {
|
||||
T t = (T) var6[var8];
|
||||
if (ObjectUtil.equals(value, t.getKey())) {
|
||||
desc = t.getDesc();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new WriteCellData(desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.bonus.core.common.converter;
|
||||
|
||||
public interface LeExcelFieldEnum<E extends Enum<E>> {
|
||||
default Integer getKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getDesc() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.bonus.core.common.custom.business;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CustomBusiness {
|
||||
default String name() {
|
||||
return "订单定制业务";
|
||||
}
|
||||
|
||||
default List<Version> versions() {
|
||||
return CollUtil.newArrayList(new Version[0]);
|
||||
}
|
||||
|
||||
default Version customVersion() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class Version {
|
||||
private String code;
|
||||
private String desc;
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
public void setCode(final String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setDesc(final String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
private Version(final String code, final String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static Version of(final String code, final String desc) {
|
||||
return new Version(code, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.core.common.encrypt;
|
||||
|
||||
public enum HandleType {
|
||||
DECRYPT,
|
||||
DESENSITIZE_MOBILE_PHONE,
|
||||
DESENSITIZE_ID_CARD,
|
||||
DESENSITIZE_CHINESE_NAME,
|
||||
DESENSITIZE_EMAIL,
|
||||
DESENSITIZE_ADDRESS;
|
||||
|
||||
// $FF: synthetic method
|
||||
private static HandleType[] $values() {
|
||||
return new HandleType[]{DECRYPT, DESENSITIZE_MOBILE_PHONE, DESENSITIZE_ID_CARD, DESENSITIZE_CHINESE_NAME, DESENSITIZE_EMAIL, DESENSITIZE_ADDRESS};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.bonus.core.common.encrypt;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import cn.hutool.core.util.DesensitizedUtil.DesensitizedType;
|
||||
import com.bonus.core.allocation.alloc.model.DataManageMetadataModel;
|
||||
import com.bonus.core.allocation.api.AllocMetadataApi;
|
||||
import com.bonus.core.common.enums.MetadataModelTypeEnum;
|
||||
import com.bonus.utils.SM4EncryptUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Component
|
||||
public class LeNiuDataHandler {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private AllocMetadataApi allocMetadataApi;
|
||||
|
||||
public <T> T resultProcess(T result) throws IllegalAccessException {
|
||||
Class<?> resultClass = result.getClass();
|
||||
Class<?> superclass = resultClass.getSuperclass();
|
||||
Field[] declaredFields = resultClass.getDeclaredFields();
|
||||
Field[] superFields = superclass.getDeclaredFields();
|
||||
Field[] allFields = (Field[])Stream.concat(Arrays.stream(declaredFields), Arrays.stream(superFields)).toArray((x$0) -> {
|
||||
return new Field[x$0];
|
||||
});
|
||||
Set<Field> decryptField = this.getProcessField(allFields);
|
||||
Page localPage = PageMethod.getLocalPage();
|
||||
PageMethod.clearPage();
|
||||
DataManageMetadataModel metadata = (DataManageMetadataModel)this.allocMetadataApi.queryMetadataModel(MetadataModelTypeEnum.MERCHANT, new DataManageMetadataModel());
|
||||
if (Objects.nonNull(localPage)) {
|
||||
PageMethod.setLocalPage(localPage);
|
||||
}
|
||||
|
||||
Iterator var10 = decryptField.iterator();
|
||||
|
||||
while(var10.hasNext()) {
|
||||
Field field = (Field)var10.next();
|
||||
Object object = field.get(result);
|
||||
if (object instanceof String) {
|
||||
String dbValue = (String) object;
|
||||
String decrypted;
|
||||
if (((LeNiuDecryptField)field.getAnnotation(LeNiuDecryptField.class)).value().equals(HandleType.DECRYPT)) {
|
||||
decrypted = SM4EncryptUtils.sm4Decrypt(dbValue);
|
||||
field.set(result, decrypted);
|
||||
} else {
|
||||
decrypted = SM4EncryptUtils.sm4Decrypt(dbValue);
|
||||
if (metadata != null && "1".equals(metadata.getPhoneDesensitization())) {
|
||||
String name = ((LeNiuDecryptField)field.getAnnotation(LeNiuDecryptField.class)).value().name();
|
||||
String type = name.replace("DESENSITIZE_", "");
|
||||
DesensitizedType desensitizedType = DesensitizedType.valueOf(type);
|
||||
decrypted = DesensitizedUtil.desensitized(decrypted, desensitizedType);
|
||||
}
|
||||
|
||||
field.set(result, decrypted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected Set<Field> getProcessField(Field[] declaredFields) {
|
||||
Set<Field> fieldSet = (Set)Arrays.stream(declaredFields).filter((fieldx) -> {
|
||||
return fieldx.isAnnotationPresent(LeNiuDecryptField.class) && fieldx.getType() == String.class;
|
||||
}).collect(Collectors.toSet());
|
||||
Iterator var3 = fieldSet.iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
Field field = (Field)var3.next();
|
||||
field.setAccessible(true);
|
||||
}
|
||||
|
||||
return fieldSet;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.bonus.core.common.encrypt;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Inherited
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface LeNiuDecryptDataProcess {
|
||||
Class decryptionMode() default LeNiuDataHandler.class;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.bonus.core.common.encrypt;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface LeNiuDecryptField {
|
||||
HandleType value() default HandleType.DECRYPT;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.core.account.v3.mapper.AccInfoMapper">
|
||||
<select id="getAccInfoVOByCustId" resultType="com.bonus.core.account.v3.web.vo.AccInfoVO">
|
||||
SELECT ai.id,
|
||||
ai.acc_id,
|
||||
ai.cust_id,
|
||||
ai.end_date,
|
||||
ai.acc_status,
|
||||
ci.cust_num,
|
||||
ci.cust_name,
|
||||
ci.mobile,
|
||||
ci.psn_type,
|
||||
cpt.psn_type_name,
|
||||
ci.org_id,
|
||||
co.org_full_name,
|
||||
ci.cust_third_id
|
||||
FROM acc_info ai
|
||||
LEFT JOIN cust_info ci ON ci.cust_id = ai.cust_id
|
||||
LEFT JOIN cust_psn_type cpt ON cpt.psn_type = ci.psn_type
|
||||
LEFT JOIN cust_org co ON co.org_id = ci.org_id
|
||||
WHERE ai.cust_id = #{custId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.core.account.v3.mapper.AccTradeWalletDetailMapper">
|
||||
<!-- 获取当用户月即将过期的补贴记录集合-->
|
||||
<select id="listCustMonthAccSubsidyExpirationTrade"
|
||||
resultType="com.bonus.core.account.v3.model.AccTradeWalletDetail">
|
||||
SELECT t1.*
|
||||
FROM acc_trade_wallet_detail t1
|
||||
WHERE
|
||||
t1.cust_id = #{custId}
|
||||
AND t1.trade_type = 20
|
||||
AND t1.validate_time BETWEEN #{startDateTime} AND #{endDateTime}
|
||||
AND t1.expired_clear = 2
|
||||
AND EXISTS (SELECT t2.id
|
||||
FROM acc_trade t2
|
||||
WHERE t2.id = t1.trade_id
|
||||
AND t2.trade_state = 2
|
||||
AND t2.pay_state = 3
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.core.account.v3.mapper.AccWalletInfoMapper">
|
||||
|
||||
<!-- 根据客户id 获取钱包信息-->
|
||||
<select id="queryAccWalletInfoVOListByCustId" resultType="com.bonus.core.account.v3.web.vo.AccWalletInfoVO">
|
||||
SELECT
|
||||
cust_id,
|
||||
acc_id,
|
||||
wallet_id,
|
||||
wallet_bal,
|
||||
limit_balance,
|
||||
frozen_balance,
|
||||
last_subsidy_amount,
|
||||
last_subsidy_time
|
||||
FROM acc_wallet_info
|
||||
WHERE cust_id = #{custId}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue