账户管理
This commit is contained in:
parent
336de40460
commit
0f01e02acf
|
|
@ -1,6 +1,6 @@
|
||||||
package com.bonus.canteen.core.account.controller;
|
package com.bonus.canteen.core.account.controller;
|
||||||
|
|
||||||
import com.bonus.canteen.core.account.domain.AccInfo;
|
import com.bonus.canteen.core.account.domain.AccountInfo;
|
||||||
import com.bonus.canteen.core.account.domain.param.*;
|
import com.bonus.canteen.core.account.domain.param.*;
|
||||||
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
||||||
import com.bonus.canteen.core.account.service.AccOperationHistoryService;
|
import com.bonus.canteen.core.account.service.AccOperationHistoryService;
|
||||||
|
|
@ -82,9 +82,9 @@ public class AccInfoController extends BaseController {
|
||||||
//@RequiresPermissions("account:info:add")
|
//@RequiresPermissions("account:info:add")
|
||||||
@SysLog(title = "账户资料", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增账户资料")
|
@SysLog(title = "账户资料", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增账户资料")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody AccInfo accInfo) {
|
public AjaxResult add(@RequestBody AccountInfo accountInfo) {
|
||||||
try {
|
try {
|
||||||
return toAjax(accInfoService.insertAccInfo(accInfo));
|
return toAjax(accInfoService.insertAccInfo(accountInfo));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -179,8 +179,8 @@ public class AccInfoController extends BaseController {
|
||||||
notes = "移动端查询账户(仅返回钱包余额)"
|
notes = "移动端查询账户(仅返回钱包余额)"
|
||||||
)
|
)
|
||||||
@PostMapping({"/wallet/balance"})
|
@PostMapping({"/wallet/balance"})
|
||||||
public AjaxResult queryWalletBalance(@RequestBody AccInfo accInfo) {
|
public AjaxResult queryWalletBalance(@RequestBody AccountInfo accountInfo) {
|
||||||
return success(this.accInfoService.queryWalletBalance(accInfo));
|
return success(this.accInfoService.queryWalletBalance(accountInfo));
|
||||||
}
|
}
|
||||||
@ApiOperation("单人充值")
|
@ApiOperation("单人充值")
|
||||||
@PostMapping("/recharge")
|
@PostMapping("/recharge")
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class AccInfo extends BaseEntity {
|
public class AccountInfo extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 账户id 主键自增 */
|
/** 账户id 主键自增 */
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.bonus.canteen.core.account.domain.bo;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
@Data
|
||||||
|
public class AccountInfoHistory {
|
||||||
|
/** 主键id */
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 账户id */
|
||||||
|
@ApiModelProperty(value = "账户id")
|
||||||
|
private Long accountId;
|
||||||
|
|
||||||
|
/** 用户id */
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 操作人员用户名 */
|
||||||
|
@ApiModelProperty(value = "操作人员用户名")
|
||||||
|
private String operateUserName;
|
||||||
|
|
||||||
|
/** 操作类型1-冻结2-解冻3-挂失4-解挂 */
|
||||||
|
@ApiModelProperty(value = "操作类型1-冻结2-解冻3-挂失4-解挂")
|
||||||
|
private Integer operationType;
|
||||||
|
|
||||||
|
private String createBy;
|
||||||
|
}
|
||||||
|
|
@ -8,5 +8,5 @@ public class AccountEnableDisableParam {
|
||||||
@ApiModelProperty(value = "人员id")
|
@ApiModelProperty(value = "人员id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
@ApiModelProperty(value = "账户状态 0正常 1停用")
|
@ApiModelProperty(value = "账户状态 0正常 1停用")
|
||||||
private Long accStatus;
|
private Long accountStatus;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.bonus.canteen.core.account.domain.bo;
|
package com.bonus.canteen.core.account.domain.vo;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
|
@ -6,8 +6,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class AccOperationHistory {
|
public class AccountInfoHistoryVO {
|
||||||
@ApiModelProperty("主键")
|
@ApiModelProperty("主键")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@ApiModelProperty("用户编号")
|
@ApiModelProperty("用户编号")
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.bonus.canteen.core.account.mapper;
|
package com.bonus.canteen.core.account.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.bonus.canteen.core.account.domain.AccInfo;
|
import com.bonus.canteen.core.account.domain.AccountInfo;
|
||||||
import com.bonus.canteen.core.account.domain.AccInfoVo;
|
import com.bonus.canteen.core.account.domain.AccInfoVo;
|
||||||
import com.bonus.canteen.core.account.domain.param.AccountInfoQueryParam;
|
import com.bonus.canteen.core.account.domain.param.AccountInfoQueryParam;
|
||||||
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
||||||
|
|
@ -17,40 +17,40 @@ import java.util.List;
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2025-04-05
|
* @date 2025-04-05
|
||||||
*/
|
*/
|
||||||
public interface AccInfoMapper extends BaseMapper<AccInfo> {
|
public interface AccInfoMapper extends BaseMapper<AccountInfo> {
|
||||||
/**
|
/**
|
||||||
* 查询账户资料
|
* 查询账户资料
|
||||||
*
|
*
|
||||||
* @param accId 账户资料主键
|
* @param accId 账户资料主键
|
||||||
* @return 账户资料
|
* @return 账户资料
|
||||||
*/
|
*/
|
||||||
public AccInfo selectAccInfoById(@Param("accId") Long accId);
|
public AccountInfo selectAccInfoById(@Param("accId") Long accId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询账户资料列表
|
* 查询账户资料列表
|
||||||
*
|
*
|
||||||
* @param accInfo 账户资料
|
* @param accountInfo 账户资料
|
||||||
* @return 账户资料集合
|
* @return 账户资料集合
|
||||||
*/
|
*/
|
||||||
public List<AccInfo> selectAccInfoList(AccInfo accInfo);
|
public List<AccountInfo> selectAccInfoList(AccountInfo accountInfo);
|
||||||
|
|
||||||
public AccInfoVo selectAccInfoVo(AccInfo accInfo);
|
public AccInfoVo selectAccInfoVo(AccountInfo accountInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增账户资料
|
* 新增账户资料
|
||||||
*
|
*
|
||||||
* @param accInfo 账户资料
|
* @param accountInfo 账户资料
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertAccInfo(AccInfo accInfo);
|
public int insertAccInfo(AccountInfo accountInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改账户资料
|
* 修改账户资料
|
||||||
*
|
*
|
||||||
* @param accInfo 账户资料
|
* @param accountInfo 账户资料
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateAccInfo(AccInfo accInfo);
|
public int updateAccInfo(AccountInfo accountInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除账户资料
|
* 删除账户资料
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
package com.bonus.canteen.core.account.mapper;
|
package com.bonus.canteen.core.account.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.bonus.canteen.core.account.domain.bo.AccOperationHistory;
|
import com.bonus.canteen.core.account.domain.bo.AccountInfoHistory;
|
||||||
import com.bonus.canteen.core.account.domain.param.AccOperationQueryParam;
|
import com.bonus.canteen.core.account.domain.param.AccOperationQueryParam;
|
||||||
|
import com.bonus.canteen.core.account.domain.vo.AccountInfoHistoryVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface AccOperationHistoryMapper extends BaseMapper<AccOperationHistory> {
|
public interface AccOperationHistoryMapper extends BaseMapper<AccountInfoHistory> {
|
||||||
List<AccOperationHistory> queryPageAccOperationRecord(@Param("param") AccOperationQueryParam param,
|
List<AccountInfoHistoryVO> queryPageAccOperationRecord(@Param("param") AccOperationQueryParam param,
|
||||||
@Param("encryptedSearchValue") String encryptedSearchValue);
|
@Param("encryptedSearchValue") String encryptedSearchValue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
package com.bonus.canteen.core.account.service;
|
package com.bonus.canteen.core.account.service;
|
||||||
|
|
||||||
|
|
||||||
import com.bonus.canteen.core.account.domain.bo.AccOperationHistory;
|
import com.bonus.canteen.core.account.domain.bo.AccountInfoHistory;
|
||||||
import com.bonus.canteen.core.account.domain.param.AccOperationQueryParam;
|
import com.bonus.canteen.core.account.domain.param.AccOperationQueryParam;
|
||||||
|
import com.bonus.canteen.core.account.domain.vo.AccountInfoHistoryVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface AccOperationHistoryService {
|
public interface AccOperationHistoryService {
|
||||||
List<AccOperationHistory> selectAccOperationHistory(AccOperationQueryParam param);
|
List<AccountInfoHistoryVO> selectAccOperationHistory(AccOperationQueryParam param);
|
||||||
void addAccOperationHistory(Long userId, Integer type);
|
void addAccOperationHistory(Long userId, Integer type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.bonus.canteen.core.account.service;
|
package com.bonus.canteen.core.account.service;
|
||||||
|
|
||||||
import com.bonus.canteen.core.account.domain.AccInfo;
|
import com.bonus.canteen.core.account.domain.AccountInfo;
|
||||||
import com.bonus.canteen.core.account.domain.WalletBalanceVO;
|
import com.bonus.canteen.core.account.domain.WalletBalanceVO;
|
||||||
import com.bonus.canteen.core.account.domain.param.*;
|
import com.bonus.canteen.core.account.domain.param.*;
|
||||||
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
||||||
|
|
@ -23,7 +23,7 @@ public interface IAccInfoService {
|
||||||
* @param id 账户资料主键
|
* @param id 账户资料主键
|
||||||
* @return 账户资料
|
* @return 账户资料
|
||||||
*/
|
*/
|
||||||
public AccInfo selectAccInfoById(Long id);
|
public AccountInfo selectAccInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询账户资料列表
|
* 查询账户资料列表
|
||||||
|
|
@ -37,10 +37,10 @@ public interface IAccInfoService {
|
||||||
/**
|
/**
|
||||||
* 新增账户资料
|
* 新增账户资料
|
||||||
*
|
*
|
||||||
* @param accInfo 账户资料
|
* @param accountInfo 账户资料
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertAccInfo(AccInfo accInfo);
|
public int insertAccInfo(AccountInfo accountInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改账户资料
|
* 修改账户资料
|
||||||
|
|
@ -66,7 +66,7 @@ public interface IAccInfoService {
|
||||||
|
|
||||||
public String getOrderQRCode();
|
public String getOrderQRCode();
|
||||||
|
|
||||||
public WalletBalanceVO queryWalletBalance(AccInfo accInfo);
|
public WalletBalanceVO queryWalletBalance(AccountInfo accountInfo);
|
||||||
List<AccInfoDetailsVO> queryAccInfoByUserIds(List<Long> userIds);
|
List<AccInfoDetailsVO> queryAccInfoByUserIds(List<Long> userIds);
|
||||||
AccInfoDetailsVO queryAccInfoByUserId(Long userId);
|
AccInfoDetailsVO queryAccInfoByUserId(Long userId);
|
||||||
void checkAccStatus(AccInfoDetailsVO accInfoVO);
|
void checkAccStatus(AccInfoDetailsVO accInfoVO);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import com.bonus.canteen.core.account.constants.CardStatusEnum;
|
||||||
import com.bonus.canteen.core.account.constants.CardTypeEnum;
|
import com.bonus.canteen.core.account.constants.CardTypeEnum;
|
||||||
import com.bonus.canteen.core.account.domain.AccCard;
|
import com.bonus.canteen.core.account.domain.AccCard;
|
||||||
import com.bonus.canteen.core.account.domain.AccCardHis;
|
import com.bonus.canteen.core.account.domain.AccCardHis;
|
||||||
import com.bonus.canteen.core.account.domain.AccInfo;
|
import com.bonus.canteen.core.account.domain.AccountInfo;
|
||||||
import com.bonus.canteen.core.account.mapper.AccCardHisMapper;
|
import com.bonus.canteen.core.account.mapper.AccCardHisMapper;
|
||||||
import com.bonus.canteen.core.account.mapper.AccCardMapper;
|
import com.bonus.canteen.core.account.mapper.AccCardMapper;
|
||||||
import com.bonus.canteen.core.account.mapper.AccInfoMapper;
|
import com.bonus.canteen.core.account.mapper.AccInfoMapper;
|
||||||
|
|
@ -68,13 +68,13 @@ public class AccCardServiceImpl implements IAccCardService {
|
||||||
accCard.setCreateBy(SecurityUtils.getUsername());
|
accCard.setCreateBy(SecurityUtils.getUsername());
|
||||||
accCard.setCreateTime(DateUtils.getNowDate());
|
accCard.setCreateTime(DateUtils.getNowDate());
|
||||||
try {
|
try {
|
||||||
AccInfo accInfo = accInfoMapper.selectAccInfoById(accCard.getAccountId());
|
AccountInfo accountInfo = accInfoMapper.selectAccInfoById(accCard.getAccountId());
|
||||||
checkAccInfoAndStatus(accInfo);
|
checkAccInfoAndStatus(accountInfo);
|
||||||
accCard.setUserId(accInfo.getUserId());
|
accCard.setUserId(accountInfo.getUserId());
|
||||||
accCard.setCardStatus(CardStatusEnum.NORMAL.getKey());
|
accCard.setCardStatus(CardStatusEnum.NORMAL.getKey());
|
||||||
accCard.setCardType(CardTypeEnum.IC_CARD.getKey());
|
accCard.setCardType(CardTypeEnum.IC_CARD.getKey());
|
||||||
// 发卡前校验是否此用户已有卡, 已退卡、已过期的可以再发放
|
// 发卡前校验是否此用户已有卡, 已退卡、已过期的可以再发放
|
||||||
int cardCountByUserId= accCardMapper.selectAccCardCountByUserId(accInfo.getUserId());
|
int cardCountByUserId= accCardMapper.selectAccCardCountByUserId(accountInfo.getUserId());
|
||||||
if (cardCountByUserId > 0) {
|
if (cardCountByUserId > 0) {
|
||||||
throw new ServiceException("此用户已有卡, 不能再次发放");
|
throw new ServiceException("此用户已有卡, 不能再次发放");
|
||||||
}
|
}
|
||||||
|
|
@ -110,10 +110,10 @@ public class AccCardServiceImpl implements IAccCardService {
|
||||||
accCardHisMapper.insertAccCardHis(accCardHis);
|
accCardHisMapper.insertAccCardHis(accCardHis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkAccInfoAndStatus(AccInfo accInfoVO) {
|
public void checkAccInfoAndStatus(AccountInfo accountInfoVO) {
|
||||||
if (ObjectUtil.isNull(accInfoVO)) {
|
if (ObjectUtil.isNull(accountInfoVO)) {
|
||||||
throw new ServiceException("账户不存在");
|
throw new ServiceException("账户不存在");
|
||||||
} else if (AccStatusEnum.DEACTIVATE.getKey().equals(accInfoVO.getAccountStatus())) {
|
} else if (AccStatusEnum.DEACTIVATE.getKey().equals(accountInfoVO.getAccountStatus())) {
|
||||||
throw new ServiceException("账户已停用");
|
throw new ServiceException("账户已停用");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -134,10 +134,10 @@ public class AccCardServiceImpl implements IAccCardService {
|
||||||
if (cardCountByCardSerialNum > 0) {
|
if (cardCountByCardSerialNum > 0) {
|
||||||
throw new ServiceException("卡号已存在, 卡号不能重复");
|
throw new ServiceException("卡号已存在, 卡号不能重复");
|
||||||
}
|
}
|
||||||
AccInfo accInfo = accInfoMapper.selectAccInfoById(accCard.getAccountId());
|
AccountInfo accountInfo = accInfoMapper.selectAccInfoById(accCard.getAccountId());
|
||||||
checkAccInfoAndStatus(accInfo);
|
checkAccInfoAndStatus(accountInfo);
|
||||||
int count = accCardMapper.updateAccCard(accCard);
|
int count = accCardMapper.updateAccCard(accCard);
|
||||||
accCard.setUserId(accInfo.getUserId());
|
accCard.setUserId(accountInfo.getUserId());
|
||||||
if (CardRecordTypeEnum.CHANGE.getKey().equals(accCard.getOperationType())) {
|
if (CardRecordTypeEnum.CHANGE.getKey().equals(accCard.getOperationType())) {
|
||||||
accCard.setCardStatus(CardStatusEnum.NORMAL.getKey());
|
accCard.setCardStatus(CardStatusEnum.NORMAL.getKey());
|
||||||
saveAccCardChangeRecord(accCard);
|
saveAccCardChangeRecord(accCard);
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ public class AccInfoServiceImpl implements IAccInfoService {
|
||||||
* @return 账户资料
|
* @return 账户资料
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AccInfo selectAccInfoById(Long id) {
|
public AccountInfo selectAccInfoById(Long id) {
|
||||||
return accInfoMapper.selectAccInfoById(id);
|
return accInfoMapper.selectAccInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,14 +112,14 @@ public class AccInfoServiceImpl implements IAccInfoService {
|
||||||
/**
|
/**
|
||||||
* 新增账户资料
|
* 新增账户资料
|
||||||
*
|
*
|
||||||
* @param accInfo 账户资料
|
* @param accountInfo 账户资料
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertAccInfo(AccInfo accInfo) {
|
public int insertAccInfo(AccountInfo accountInfo) {
|
||||||
accInfo.setCreateTime(DateUtils.getNowDate());
|
accountInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
try {
|
try {
|
||||||
return accInfoMapper.insertAccInfo(accInfo);
|
return accInfoMapper.insertAccInfo(accountInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
throw new ServiceException("错误信息描述");
|
||||||
}
|
}
|
||||||
|
|
@ -193,17 +193,17 @@ public class AccInfoServiceImpl implements IAccInfoService {
|
||||||
rollbackFor = {Exception.class}
|
rollbackFor = {Exception.class}
|
||||||
)
|
)
|
||||||
public int syncAccInfo(SysUser sysUser) {
|
public int syncAccInfo(SysUser sysUser) {
|
||||||
AccInfo accInfo = new AccInfo();
|
AccountInfo accountInfo = new AccountInfo();
|
||||||
accInfo.setAccountStatus(AccStatusEnum.NORMAL.getKey());
|
accountInfo.setAccountStatus(AccStatusEnum.NORMAL.getKey());
|
||||||
accInfo.setUserId(sysUser.getUserId());
|
accountInfo.setUserId(sysUser.getUserId());
|
||||||
accInfoMapper.insertAccInfo(accInfo);
|
accInfoMapper.insertAccInfo(accountInfo);
|
||||||
List<AccWalletInfo> accWalletInfos = new ArrayList();
|
List<AccWalletInfo> accWalletInfos = new ArrayList();
|
||||||
AccWalletTypeEnum[] accWalletTypeEnums = AccWalletTypeEnum.values();
|
AccWalletTypeEnum[] accWalletTypeEnums = AccWalletTypeEnum.values();
|
||||||
|
|
||||||
for(int i = 0; i < accWalletTypeEnums.length; ++i) {
|
for(int i = 0; i < accWalletTypeEnums.length; ++i) {
|
||||||
AccWalletTypeEnum accWalletTypeEnum = accWalletTypeEnums[i];
|
AccWalletTypeEnum accWalletTypeEnum = accWalletTypeEnums[i];
|
||||||
AccWalletInfo accWalletInfo = new AccWalletInfo();
|
AccWalletInfo accWalletInfo = new AccWalletInfo();
|
||||||
accWalletInfo.setAccountId(accInfo.getAccountId());
|
accWalletInfo.setAccountId(accountInfo.getAccountId());
|
||||||
accWalletInfo.setUserId(sysUser.getUserId());
|
accWalletInfo.setUserId(sysUser.getUserId());
|
||||||
accWalletInfo.setWalletType(accWalletTypeEnum.getKey());
|
accWalletInfo.setWalletType(accWalletTypeEnum.getKey());
|
||||||
accWalletInfos.add(accWalletInfo);
|
accWalletInfos.add(accWalletInfo);
|
||||||
|
|
@ -314,13 +314,13 @@ public class AccInfoServiceImpl implements IAccInfoService {
|
||||||
|
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public void editAccountStatus(AccountEnableDisableParam accountEnableDisableParam) {
|
public void editAccountStatus(AccountEnableDisableParam accountEnableDisableParam) {
|
||||||
int flag = accInfoMapper.update((((Wrappers.lambdaUpdate(AccInfo.class)
|
int flag = accInfoMapper.update((((Wrappers.lambdaUpdate(AccountInfo.class)
|
||||||
.set(AccInfo::getAccountStatus, accountEnableDisableParam.getAccStatus()))
|
.set(AccountInfo::getAccountStatus, accountEnableDisableParam.getAccountStatus()))
|
||||||
.set(AccInfo::getUpdateBy, SecurityUtils.getUserId()))
|
.set(AccountInfo::getUpdateBy, SecurityUtils.getUserId()))
|
||||||
.set(AccInfo::getUpdateTime, LocalDateTime.now()))
|
.set(AccountInfo::getUpdateTime, LocalDateTime.now()))
|
||||||
.eq(AccInfo::getUserId, accountEnableDisableParam.getUserId()));
|
.eq(AccountInfo::getUserId, accountEnableDisableParam.getUserId()));
|
||||||
if (flag > 0) {
|
if (flag > 0) {
|
||||||
this.accOperationHistoryService.addAccOperationHistory(accountEnableDisableParam.getUserId(), accountEnableDisableParam.getAccStatus().intValue());
|
this.accOperationHistoryService.addAccOperationHistory(accountEnableDisableParam.getUserId(), accountEnableDisableParam.getAccountStatus().intValue());
|
||||||
try {
|
try {
|
||||||
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePerson(Math.toIntExact(accountEnableDisableParam.getUserId()),"update");
|
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePerson(Math.toIntExact(accountEnableDisableParam.getUserId()),"update");
|
||||||
String jsonString = JacksonUtil.writeValueAsString(bean);
|
String jsonString = JacksonUtil.writeValueAsString(bean);
|
||||||
|
|
@ -333,9 +333,9 @@ public class AccInfoServiceImpl implements IAccInfoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public WalletBalanceVO queryWalletBalance(AccInfo accInfo) {
|
public WalletBalanceVO queryWalletBalance(AccountInfo accountInfo) {
|
||||||
log.info("查询账户余额入参={}", JSONUtil.toJsonStr(accInfo));
|
log.info("查询账户余额入参={}", JSONUtil.toJsonStr(accountInfo));
|
||||||
AccInfoVo accInfoVO = accInfoMapper.selectAccInfoVo(accInfo);
|
AccInfoVo accInfoVO = accInfoMapper.selectAccInfoVo(accountInfo);
|
||||||
if (ObjectUtil.isNull(accInfoVO)) {
|
if (ObjectUtil.isNull(accInfoVO)) {
|
||||||
throw new ServiceException("账户不存在");
|
throw new ServiceException("账户不存在");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ import cn.hutool.core.collection.CollUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.bonus.canteen.core.account.domain.bo.AccOperationHistory;
|
import com.bonus.canteen.core.account.domain.bo.AccountInfoHistory;
|
||||||
import com.bonus.canteen.core.account.domain.param.AccOperationQueryParam;
|
import com.bonus.canteen.core.account.domain.param.AccOperationQueryParam;
|
||||||
|
import com.bonus.canteen.core.account.domain.vo.AccountInfoHistoryVO;
|
||||||
import com.bonus.canteen.core.account.mapper.AccOperationHistoryMapper;
|
import com.bonus.canteen.core.account.mapper.AccOperationHistoryMapper;
|
||||||
import com.bonus.canteen.core.account.service.AccOperationHistoryService;
|
import com.bonus.canteen.core.account.service.AccOperationHistoryService;
|
||||||
import com.bonus.common.core.constant.SecurityConstants;
|
import com.bonus.common.core.constant.SecurityConstants;
|
||||||
|
|
@ -22,14 +23,14 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class AccOperationHistoryServiceImpl extends ServiceImpl<AccOperationHistoryMapper, AccOperationHistory> implements AccOperationHistoryService {
|
public class AccOperationHistoryServiceImpl extends ServiceImpl<AccOperationHistoryMapper, AccountInfoHistory> implements AccOperationHistoryService {
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteUserService remoteUserService;
|
private RemoteUserService remoteUserService;
|
||||||
public List<AccOperationHistory> selectAccOperationHistory(AccOperationQueryParam param) {
|
public List<AccountInfoHistoryVO> selectAccOperationHistory(AccOperationQueryParam param) {
|
||||||
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue());
|
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue());
|
||||||
List<AccOperationHistory> operationRecordList = this.baseMapper.queryPageAccOperationRecord(param, encryptedSearchValue);
|
List<AccountInfoHistoryVO> operationRecordList = this.baseMapper.queryPageAccOperationRecord(param, encryptedSearchValue);
|
||||||
if(CollUtil.isNotEmpty(operationRecordList)) {
|
if(CollUtil.isNotEmpty(operationRecordList)) {
|
||||||
for(AccOperationHistory history : operationRecordList) {
|
for(AccountInfoHistoryVO history : operationRecordList) {
|
||||||
history.setPhone(SM4EncryptUtils.sm4Decrypt(history.getPhone()));
|
history.setPhone(SM4EncryptUtils.sm4Decrypt(history.getPhone()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -40,13 +41,11 @@ public class AccOperationHistoryServiceImpl extends ServiceImpl<AccOperationHist
|
||||||
AjaxResult userResult = remoteUserService.getInfo(userId , SecurityConstants.INNER);
|
AjaxResult userResult = remoteUserService.getInfo(userId , SecurityConstants.INNER);
|
||||||
if(Objects.nonNull(userResult)) {
|
if(Objects.nonNull(userResult)) {
|
||||||
SysUser sysUser = JSONObject.parseObject(JSON.toJSONString(userResult.get(AjaxResult.DATA_TAG)), SysUser.class);
|
SysUser sysUser = JSONObject.parseObject(JSON.toJSONString(userResult.get(AjaxResult.DATA_TAG)), SysUser.class);
|
||||||
AccOperationHistory accOperationRecord = new AccOperationHistory();
|
AccountInfoHistory accOperationRecord = new AccountInfoHistory();
|
||||||
accOperationRecord.setOperationType(type);
|
accOperationRecord.setOperationType(type);
|
||||||
accOperationRecord.setUserId(userId);
|
accOperationRecord.setUserId(userId);
|
||||||
accOperationRecord.setUserName(sysUser.getUserName());
|
accOperationRecord.setOperateUserName(sysUser.getUserName());
|
||||||
accOperationRecord.setPhone(sysUser.getPhonenumber());
|
|
||||||
accOperationRecord.setCreateBy(SecurityUtils.getUsername());
|
accOperationRecord.setCreateBy(SecurityUtils.getUsername());
|
||||||
accOperationRecord.setCreateTime(LocalDateTime.now());
|
|
||||||
this.baseMapper.insert(accOperationRecord);
|
this.baseMapper.insert(accOperationRecord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.canteen.core.account.mapper.AccInfoMapper">
|
<mapper namespace="com.bonus.canteen.core.account.mapper.AccInfoMapper">
|
||||||
<resultMap type="com.bonus.canteen.core.account.domain.AccInfo" id="AccInfoResult">
|
<resultMap type="com.bonus.canteen.core.account.domain.AccountInfo" id="AccInfoResult">
|
||||||
<result property="accountId" column="account_id" />
|
<result property="accountId" column="account_id" />
|
||||||
<result property="accountName" column="account_name" />
|
<result property="accountName" column="account_name" />
|
||||||
<result property="userId" column="user_id" />
|
<result property="userId" column="user_id" />
|
||||||
|
|
@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from account_info
|
from account_info
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectAccInfoList" parameterType="com.bonus.canteen.core.account.domain.AccInfo" resultMap="AccInfoResult">
|
<select id="selectAccInfoList" parameterType="com.bonus.canteen.core.account.domain.AccountInfo" resultMap="AccInfoResult">
|
||||||
<include refid="selectAccInfoVo"/>
|
<include refid="selectAccInfoVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="accountId != null "> and account_id = #{accountId}</if>
|
<if test="accountId != null "> and account_id = #{accountId}</if>
|
||||||
|
|
@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAccInfoVo" parameterType="com.bonus.canteen.core.account.domain.AccInfo" resultType="com.bonus.canteen.core.account.domain.AccInfoVo">
|
<select id="selectAccInfoVo" parameterType="com.bonus.canteen.core.account.domain.AccountInfo" resultType="com.bonus.canteen.core.account.domain.AccInfoVo">
|
||||||
<include refid="selectAccInfoVo"/>
|
<include refid="selectAccInfoVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="accountId != null "> and account_id = #{accountId}</if>
|
<if test="accountId != null "> and account_id = #{accountId}</if>
|
||||||
|
|
@ -115,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where account_id = #{accId}
|
where account_id = #{accId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertAccInfo" parameterType="com.bonus.canteen.core.account.domain.AccInfo" useGeneratedKeys="true" keyProperty="accId">
|
<insert id="insertAccInfo" parameterType="com.bonus.canteen.core.account.domain.AccountInfo" useGeneratedKeys="true" keyProperty="accId">
|
||||||
insert into account_info
|
insert into account_info
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="accountName != null and accountName != ''">account_name,</if>
|
<if test="accountName != null and accountName != ''">account_name,</if>
|
||||||
|
|
@ -180,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateAccInfo" parameterType="com.bonus.canteen.core.account.domain.AccInfo">
|
<update id="updateAccInfo" parameterType="com.bonus.canteen.core.account.domain.AccountInfo">
|
||||||
update account_info
|
update account_info
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="accountId != null">account_id = #{accountId},</if>
|
<if test="accountId != null">account_id = #{accountId},</if>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.canteen.core.account.mapper.AccOperationHistoryMapper">
|
<mapper namespace="com.bonus.canteen.core.account.mapper.AccOperationHistoryMapper">
|
||||||
<select id="queryPageAccOperationRecord" resultType="com.bonus.canteen.core.account.domain.bo.AccOperationHistory">
|
<select id="queryPageAccOperationRecord" resultType="com.bonus.canteen.core.account.domain.vo.AccountInfoHistoryVO">
|
||||||
SELECT aih.id,
|
SELECT aih.id,
|
||||||
aih.user_id,
|
aih.user_id,
|
||||||
su.nick_name as userName,
|
su.nick_name as userName,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue