补贴管理/账户管理修改

This commit is contained in:
gaowdong 2025-04-10 17:24:20 +08:00
parent 4498029f6c
commit 67c7bbc121
19 changed files with 60 additions and 42 deletions

View File

@ -23,6 +23,11 @@ public enum AccStatusEnum {
return enumValue != null ? enumValue.getDesc() : "";
}
public static List<Integer> getAllKeys() {
return Arrays.stream(AccStatusEnum.values())
.map(AccStatusEnum::getKey)
.collect(Collectors.toList());
}
public static AccStatusEnum getEnum(Integer key) {
return ENUM_MAP.get(key);
}

View File

@ -52,8 +52,8 @@ public class AccInfoController extends BaseController {
*/
@ApiOperation(value = "查询账户资料列表")
//@RequiresPermissions("account:info:list")
@GetMapping("/list")
public TableDataInfo list(AccountInfoQueryParam accountInfoQueryParam) {
@PostMapping("/list")
public TableDataInfo list(@RequestBody AccountInfoQueryParam accountInfoQueryParam) {
startPage();
return getDataTable(accInfoService.selectAccInfoList(accountInfoQueryParam));
}
@ -159,8 +159,9 @@ public class AccInfoController extends BaseController {
@ApiOperation("账户操作记录")
@PostMapping({"/operation/record"})
public AjaxResult queryPageAccOperationRecord(@RequestBody AccOperationQueryParam param) {
return AjaxResult.success(this.accOperationHistoryService.selectAccOperationHistory(param));
public TableDataInfo queryPageAccOperationRecord(@RequestBody AccOperationQueryParam param) {
startPage();
return getDataTable(this.accOperationHistoryService.selectAccOperationHistory(param));
}
/**

View File

@ -1,6 +1,7 @@
package com.bonus.canteen.core.account.domain.param;
import com.bonus.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -14,9 +15,13 @@ public class AccOperationQueryParam extends BaseEntity {
@ApiModelProperty("操作事件 1启用 2停用")
private Integer type;
@ApiModelProperty("查询组织id集合")
private List<Long> deptIdList;
private List<Long> deptIds;
@ApiModelProperty("开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startDateTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("结束时间")
private LocalDateTime endDateTime;
private String searchValue;
private String createBy;
}

View File

@ -1,6 +1,7 @@
package com.bonus.canteen.core.account.domain.param;
import com.bonus.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -11,12 +12,16 @@ import java.util.List;
@Data
public class AccSubOperationQueryParam extends BaseEntity {
@ApiModelProperty("查询组织id集合")
private List<Long> deptIdList;
private List<Long> deptIds;
@ApiModelProperty("开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startDateTime;
@ApiModelProperty("结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endDateTime;
@ApiModelProperty("交易类型")
@JsonIgnore
private Integer tradeType;
private String searchValue;
private String createBy;
}

View File

@ -28,7 +28,4 @@ public class AccSubsidyAddParam extends BaseEntity {
value = 1L,
message = "小于最小充值金额"
) BigDecimal amount;
@ApiModelProperty("操作类型 补贴-1 清空补贴-2")
@JsonIgnore
private Integer operationType;
}

View File

@ -32,7 +32,4 @@ public class AccSubsidyBatchAddParam extends BaseEntity {
value = 1L,
message = "小于最小充值金额"
) BigDecimal amount;
@ApiModelProperty("操作类型 补贴-1 清空补贴-2")
@JsonIgnore
private Integer operationType;
}

View File

@ -21,7 +21,4 @@ public class AccSubsidyBatchClearParam extends BaseEntity {
) List<Long> userIds;
@ApiModelProperty("清空类型 清空-1 清空至-2")
private Integer clearType = 1;
@ApiModelProperty("操作类型 补贴-1 清空补贴-2")
@JsonIgnore
private Integer operationType;
}

View File

@ -19,7 +19,4 @@ public class AccSubsidyClearParam extends BaseEntity {
@ApiModelProperty("清空类型 清空-1 清空至-2")
private Integer clearType = 1;
@ApiModelProperty("操作类型 补贴-1 清空补贴-2")
@JsonIgnore
private Integer operationType;
}

View File

@ -11,6 +11,6 @@ import java.time.LocalDate;
public class AccountEnableDisableParam {
@ApiModelProperty(value = "人员id")
private Long userId;
@ApiModelProperty(value = "账户状态 1正常 2冻结 3销户")
@ApiModelProperty(value = "账户状态 0正常 1停用")
private Long accStatus;
}

View File

@ -11,8 +11,8 @@ import java.util.List;
@Data
public class AccountInfoQueryParam extends BaseEntity {
@ApiModelProperty("用户编号集合")
private List<Long> userIds;
// @ApiModelProperty("用户编号集合")
// private List<Long> userIds;
@ApiModelProperty("账户状态 1正常 2停用")
private List<Integer> accStatusList;
@ApiModelProperty("筛选钱包类型 0-账户总余额 1-个人钱包 2-补贴钱包")
@ -23,6 +23,7 @@ public class AccountInfoQueryParam extends BaseEntity {
private LocalDateTime startDateTime;
@ApiModelProperty("结束时间")
private LocalDateTime endDateTime;
private String searchValue;
// @ApiModelProperty("钱包最小金额")
// private BigDecimal walletMinAmount;
// @ApiModelProperty("钱包最大金额")

View File

@ -2,6 +2,7 @@ package com.bonus.canteen.core.account.domain.vo;
import cn.hutool.core.util.ObjectUtil;
import com.bonus.canteen.core.account.constants.AccTradeStateEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -11,6 +12,7 @@ import java.time.LocalDateTime;
@Data
public class AccSubOperationListVO {
@ApiModelProperty("补贴时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime tradeTime;
@ApiModelProperty("人员id")
private Long userId;

View File

@ -5,6 +5,7 @@ import com.bonus.canteen.core.account.domain.AccTrade;
import com.bonus.canteen.core.account.domain.param.AccSubOperationQueryParam;
import com.bonus.canteen.core.account.domain.vo.AccSubOperationListVO;
import com.bonus.canteen.core.account.domain.vo.AccTradeVo;
import org.apache.ibatis.annotations.Param;
/**
* 账户交易记录Mapper接口
@ -65,5 +66,6 @@ public interface AccTradeMapper {
*/
public int deleteAccTradeByTradeIds(Long[] tradeIds);
List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param);
List<AccSubOperationListVO> queryAccSubOperationList(@Param("param") AccSubOperationQueryParam param,
@Param("encryptedSearchValue") String encryptedSearchValue);
}

View File

@ -93,7 +93,7 @@ public class AccInfoServiceImpl implements IAccInfoService {
public List<AccInfoDetailsVO> selectAccInfoList(AccountInfoQueryParam accountInfoQueryParam) {
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(accountInfoQueryParam.getSearchValue());
if(CollUtil.isEmpty(accountInfoQueryParam.getAccStatusList())) {
accountInfoQueryParam.setAccStatusList(Arrays.asList(AccStatusEnum.NORMAL.getKey(), AccStatusEnum.DEACTIVATE.getKey()));
accountInfoQueryParam.setAccStatusList(AccStatusEnum.getAllKeys());
}
List<AccInfoDetailsVO> list = accInfoMapper.queryAccInfoDetails(accountInfoQueryParam, encryptedSearchValue);
handleResult(list);
@ -246,7 +246,10 @@ public class AccInfoServiceImpl implements IAccInfoService {
if (CollUtil.isEmpty(list)) {
return;
}
list = list.stream().peek(item -> {
String decryptedPhoneNumber = SM4EncryptUtils.sm4Decrypt(item.getPhoneNumber());
item.setPhoneNumber(decryptedPhoneNumber);
}).collect(Collectors.toList());
List<Long> custIdList = list.stream()
.map(AccInfoDetailsVO::getUserId)
.collect(Collectors.toList());
@ -294,7 +297,7 @@ public class AccInfoServiceImpl implements IAccInfoService {
public AccInfoDetailsVO queryAccInfoBalanceSum(AccountInfoQueryParam accountInfoQueryParam) {
if(CollUtil.isEmpty(accountInfoQueryParam.getAccStatusList())) {
accountInfoQueryParam.setAccStatusList(Arrays.asList(AccStatusEnum.NORMAL.getKey(), AccStatusEnum.DEACTIVATE.getKey()));
accountInfoQueryParam.setAccStatusList(AccStatusEnum.getAllKeys());
}
return accInfoMapper.queryAccInfoBalanceSum(accountInfoQueryParam);
}

View File

@ -20,6 +20,7 @@ import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Service
public class AccOperationHistoryServiceImpl extends ServiceImpl<AccOperationHistoryMapper, AccOperationHistory> implements AccOperationHistoryService {
@ -27,7 +28,11 @@ public class AccOperationHistoryServiceImpl extends ServiceImpl<AccOperationHist
private RemoteUserService remoteUserService;
public List<AccOperationHistory> selectAccOperationHistory(AccOperationQueryParam param) {
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue());
return this.baseMapper.queryPageAccOperationRecord(param, encryptedSearchValue);
List<AccOperationHistory> operationRecordList = this.baseMapper.queryPageAccOperationRecord(param, encryptedSearchValue);
operationRecordList = operationRecordList.stream().peek(accOperationRecord -> {
accOperationRecord.setPhone(SM4EncryptUtils.sm4Decrypt(accOperationRecord.getPhone()));
}).collect(Collectors.toList());
return operationRecordList;
}
public void addAccOperationHistory(Long userId, Integer type) {

View File

@ -20,6 +20,7 @@ import com.bonus.canteen.core.account.utils.AccRedisUtils;
import com.bonus.canteen.core.pay.constants.PayChannelEnum;
import com.bonus.canteen.core.pay.constants.PayTypeEnum;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.houqin.utils.SM4EncryptUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -33,6 +34,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Service
public class AccSubServiceImpl implements AccSubService {
@ -353,6 +355,10 @@ public class AccSubServiceImpl implements AccSubService {
}
@Override
public List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param) {
return accTradeService.queryAccSubOperationList(param);
List<AccSubOperationListVO> operationListVOList = accTradeService.queryAccSubOperationList(param);
operationListVOList = operationListVOList.stream().peek(operation -> {
operation.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(operation.getPhoneNumber()));
}).collect(Collectors.toList());
return operationListVOList ;
}
}

View File

@ -8,6 +8,7 @@ import com.bonus.canteen.core.account.mapper.AccTradeMapper;
import com.bonus.canteen.core.account.service.IAccTradeService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.houqin.utils.SM4EncryptUtils;
import com.bonus.common.houqin.utils.id.Id;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -123,6 +124,7 @@ public class AccTradeServiceImpl implements IAccTradeService {
@Override
public List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param) {
return accTradeMapper.queryAccSubOperationList(param);
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue());
return accTradeMapper.queryAccSubOperationList(param, encryptedSearchValue);
}
}

View File

@ -228,7 +228,7 @@ public class AccWalletInfoServiceImpl implements IAccWalletInfoService {
accTrade.setUserId(operation.getUserId());
accTrade.setPayChannel(operation.getPayChannel());
accTrade.setPayType(operation.getPayType());
accTrade.setCreateBy(SecurityUtils.getUserId().toString());
accTrade.setCreateBy(SecurityUtils.getUsername());
if(Objects.nonNull(sysUser)) {
accTrade.setDeptId(sysUser.getDeptId());
}
@ -244,6 +244,7 @@ public class AccWalletInfoServiceImpl implements IAccWalletInfoService {
}).map(AccWalletInfo::getWalletBal).filter(ObjectUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
accTradeWalletDetail.setWalletBal(walletBalByWalletId);
accTradeWalletDetail.setTradeTime(DateUtils.getNowDate());
accTradeWalletDetail.setCreateBy(SecurityUtils.getUsername());
this.accTradeWalletDetailService.insertAccTradeWalletDetail(accTradeWalletDetail);
}
}

View File

@ -428,7 +428,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="accountInfoQueryParam.searchValue != null and accountInfoQueryParam.searchValue != ''">
and (t2.nick_name = #{accountInfoQueryParam.searchValue}
or t2.phonenumber = #{encryptedSearchValue}
or t2.nick_name_like LIKE CONCAT('%',#{accountInfoQueryParam.searchValue},'%')
)
</if>
<if test="accountInfoQueryParam.deptIdList != null and accountInfoQueryParam.deptIdList.size() > 0">

View File

@ -226,7 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ate.trade_id,
ate.trade_state,
ate.amount,
atwd.wallet_bal,
atwd.wallet_bal
FROM
acc_trade ate
LEFT JOIN sys_user su ON su.user_id = ate.user_id
@ -235,9 +235,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN acc_trade_wallet_detail atwd ON ate.trade_id = atwd.trade_id
<where>
ate.trade_type = #{param.tradeType} and ate.pay_state = 3
<if test="param.tradeId != null">
and ate.trade_id = #{param.tradeId}
</if>
<if test="param.startDateTime != null">
and ate.trade_time <![CDATA[ >= ]]> #{param.startDateTime}
</if>
@ -245,23 +242,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ate.trade_time <![CDATA[ <= ]]> #{param.endDateTime}
</if>
<if test="param.createBy != null and param.createBy != ''">
and ate.create_by like #{param.createBy}
and ate.create_by like concat('%', #{param.createBy}, '%')
</if>
<if test="param.deptIdList != null and param.deptIdList.size() > 0">
<if test="param.deptIds != null and param.deptIds.size() > 0">
and ate.dept_id in
<foreach collection="param.deptIdList" item="deptId" separator="," open="(" close=")">
<foreach collection="param.deptIds" item="deptId" separator="," open="(" close=")">
#{deptId}
</foreach>
</if>
<if test="param.keyword != null and param.keyword != ''">
<if test="param.searchValue != null and param.searchValue != ''">
and (su.nick_name = #{param.searchValue}
or su.phonenumber = #{encryptedSearchValue}
or su.nick_name_like LIKE CONCAT('%',#{param.searchValue},'%')
)
</if>
<if test="param.custId != null">
and ate.user_id = #{param.userId}
</if>
</where>
</select>