fix conflict
This commit is contained in:
commit
4d50b29254
|
|
@ -23,4 +23,14 @@ public enum AccTradeStateEnum {
|
|||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
public static String getDesc(Integer key) {
|
||||
AccTradeStateEnum[] tradeValues = values();
|
||||
for (AccTradeStateEnum temp : tradeValues) {
|
||||
if (temp.getKey().equals(key)) {
|
||||
return temp.getDesc();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,17 @@
|
|||
package com.bonus.canteen.core.account.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.canteen.core.account.domain.AccInfo;
|
||||
import com.bonus.canteen.core.account.domain.param.AccOperationQueryParam;
|
||||
import com.bonus.canteen.core.account.domain.param.AccSubsidyParam;
|
||||
import com.bonus.canteen.core.account.domain.param.AccountEnableDisableParam;
|
||||
import com.bonus.canteen.core.account.domain.param.AccountInfoQueryParam;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
||||
import com.bonus.canteen.core.account.service.AccOperationHistoryService;
|
||||
import com.bonus.canteen.core.account.constants.AccTradeTypeEnum;
|
||||
import com.bonus.canteen.core.account.domain.param.*;
|
||||
import com.bonus.canteen.core.account.service.AccSubService;
|
||||
import com.bonus.canteen.core.account.service.IAccInfoService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.houqin.constant.RetCodeEnum;
|
||||
import com.bonus.common.houqin.i18n.I18n;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账户资料Controller
|
||||
|
|
@ -79,9 +63,19 @@ public class AccSubsidyController extends BaseController {
|
|||
return AjaxResult.success(accSubService.batchOperationWalletClearCheck(param));
|
||||
}
|
||||
|
||||
// @ApiOperation("补贴记录")
|
||||
// @PostMapping({"/history"})
|
||||
// public AjaxResult queryAccSubRechargePage(@RequestBody AccSubRechargePageDTO request) {
|
||||
// return AjaxResult.success(this.accSubService.queryAccSubRechargePage(request));
|
||||
// }
|
||||
@ApiOperation("补贴记录")
|
||||
@PostMapping({"/add/history"})
|
||||
public TableDataInfo queryAccSubOperationAddList(@RequestBody AccSubOperationQueryParam request) {
|
||||
startPage();
|
||||
request.setTradeType(AccTradeTypeEnum.SUBSIDY.getKey());
|
||||
return getDataTable(accSubService.queryAccSubOperationList(request));
|
||||
}
|
||||
|
||||
@ApiOperation("补贴清空记录")
|
||||
@PostMapping({"/clear/history"})
|
||||
public TableDataInfo queryAccSubOperationClearList(@RequestBody AccSubOperationQueryParam request) {
|
||||
startPage();
|
||||
request.setTradeType(AccTradeTypeEnum.CLEAR.getKey());
|
||||
return getDataTable(accSubService.queryAccSubOperationList(request));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.canteen.core.account.domain.param;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AccSubOperationQueryParam extends BaseEntity {
|
||||
@ApiModelProperty("查询组织id集合")
|
||||
private List<Long> deptIdList;
|
||||
@ApiModelProperty("开始时间")
|
||||
private LocalDateTime startDateTime;
|
||||
@ApiModelProperty("结束时间")
|
||||
private LocalDateTime endDateTime;
|
||||
@ApiModelProperty("交易类型")
|
||||
@JsonIgnore
|
||||
private Integer tradeType;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.bonus.canteen.core.account.domain.vo;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.canteen.core.account.constants.AccTradeStateEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class AccSubOperationListVO {
|
||||
@ApiModelProperty("补贴时间")
|
||||
private LocalDateTime tradeTime;
|
||||
@ApiModelProperty("人员id")
|
||||
private Long userId;
|
||||
@ApiModelProperty("用户姓名")
|
||||
private String nickName;
|
||||
@ApiModelProperty("用户手机号")
|
||||
private String phoneNumber;
|
||||
@ApiModelProperty("所属组织")
|
||||
private String deptName;
|
||||
@ApiModelProperty("人员类别")
|
||||
private Integer userType;
|
||||
@ApiModelProperty("用户类别(展示)")
|
||||
private String userTypeName;
|
||||
@ApiModelProperty("补贴金额")
|
||||
private BigDecimal amount;
|
||||
@ApiModelProperty("补贴后补贴钱包余额")
|
||||
private BigDecimal walletBal;
|
||||
@ApiModelProperty("补贴记录交易状态")
|
||||
private Integer tradeState;
|
||||
@ApiModelProperty("充值结果名称")
|
||||
private String tradeStateName;
|
||||
@ApiModelProperty("操作员")
|
||||
private String createBy;
|
||||
@ApiModelProperty("补贴订单号")
|
||||
private Long tradeId;
|
||||
|
||||
public String getTradeStateName() {
|
||||
if (ObjectUtil.isNotNull(this.tradeState)) {
|
||||
return AccTradeStateEnum.TAKE_EFFECT.getKey().equals(this.tradeState) ? "成功" : AccTradeStateEnum.getDesc(this.tradeState);
|
||||
} else {
|
||||
return this.tradeStateName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.bonus.canteen.core.account.mapper;
|
|||
|
||||
import java.util.List;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
|
@ -62,4 +64,6 @@ public interface AccTradeMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAccTradeByTradeIds(Long[] tradeIds);
|
||||
|
||||
List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.bonus.canteen.core.account.service;
|
||||
|
||||
import com.bonus.canteen.core.account.domain.param.AccSubOperationQueryParam;
|
||||
import com.bonus.canteen.core.account.domain.param.AccSubsidyParam;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccBatchOperationWalletPreCheckVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccSubOperationListVO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
|
@ -21,4 +22,7 @@ public interface AccSubService {
|
|||
AccBatchOperationWalletPreCheckVO batchOperationWalletClearCheck(AccSubsidyParam param);
|
||||
|
||||
public void addAccWalletBalance(BigDecimal amount, Long userId, Integer walletId);
|
||||
|
||||
List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.bonus.canteen.core.account.service;
|
||||
|
||||
import java.util.List;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* 账户交易记录Service接口
|
||||
*
|
||||
|
|
@ -62,4 +65,6 @@ public interface IAccTradeService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAccTradeByTradeId(Long tradeId);
|
||||
|
||||
List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,19 +7,20 @@ import com.bonus.canteen.core.account.constants.AccWalletIdEnum;
|
|||
import com.bonus.canteen.core.account.constants.WalletBalanceOperationEnum;
|
||||
import com.bonus.canteen.core.account.domain.AccWalletInfo;
|
||||
import com.bonus.canteen.core.account.domain.bo.WalletBalanceOperation;
|
||||
import com.bonus.canteen.core.account.domain.param.AccSubOperationQueryParam;
|
||||
import com.bonus.canteen.core.account.domain.param.AccSubsidyParam;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccBatchOperationWallerErrorVO;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccBatchOperationWalletPreCheckVO;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccSubOperationListVO;
|
||||
import com.bonus.canteen.core.account.service.AccSubService;
|
||||
import com.bonus.canteen.core.account.service.IAccInfoService;
|
||||
import com.bonus.canteen.core.account.service.IAccTradeService;
|
||||
import com.bonus.canteen.core.account.service.IAccWalletInfoService;
|
||||
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.canteen.core.pay.constants.TradeTypeEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.houqin.i18n.I18n;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -43,6 +44,10 @@ public class AccSubServiceImpl implements AccSubService {
|
|||
@Autowired
|
||||
@Lazy
|
||||
private IAccWalletInfoService accWalletInfoService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
IAccTradeService accTradeService;
|
||||
|
||||
@Resource(
|
||||
name = "smartCanteenTaskExecutor"
|
||||
)
|
||||
|
|
@ -95,7 +100,7 @@ public class AccSubServiceImpl implements AccSubService {
|
|||
if(Objects.isNull(walletInfo)) {
|
||||
throw new ServiceException("补贴钱包不存在");
|
||||
}
|
||||
clearAccWalletBalance(param.getUserId(), AccWalletIdEnum.SUBSIDY.getKey());
|
||||
clearAccWalletBalance(walletInfo.getWalletBal(), param.getUserId(), AccWalletIdEnum.SUBSIDY.getKey());
|
||||
}
|
||||
|
||||
private BigDecimal calculateClearAmount(BigDecimal walletBal, Integer clearType, BigDecimal amount) {
|
||||
|
|
@ -239,12 +244,13 @@ public class AccSubServiceImpl implements AccSubService {
|
|||
}
|
||||
}
|
||||
|
||||
public void clearAccWalletBalance(Long userId, Integer walletId) {
|
||||
public void clearAccWalletBalance(BigDecimal amount, Long userId, Integer walletId) {
|
||||
log.info("清空补贴入参: userId:{},walletId:{}", userId, walletId);
|
||||
AccRedisUtils.lockUpdateAccWalletBalance(userId);
|
||||
try {
|
||||
WalletBalanceOperation operation = new WalletBalanceOperation();
|
||||
operation.setUserId(userId);
|
||||
operation.setAmount(amount);
|
||||
operation.setWalletId(walletId);
|
||||
operation.setOperationType(WalletBalanceOperationEnum.REDUCE_BAL.getKey());
|
||||
operation.setTradeType(AccTradeTypeEnum.CLEAR.getKey());
|
||||
|
|
@ -347,4 +353,8 @@ public class AccSubServiceImpl implements AccSubService {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param) {
|
||||
return accTradeService.queryAccSubOperationList(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
package com.bonus.canteen.core.account.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.canteen.core.account.domain.bo.AccOperationHistory;
|
||||
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 com.bonus.canteen.core.account.mapper.AccOperationHistoryMapper;
|
||||
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.id.Id;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.account.mapper.AccTradeMapper;
|
||||
import com.bonus.canteen.core.account.domain.AccTrade;
|
||||
import com.bonus.canteen.core.account.service.IAccTradeService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账户交易记录Service业务层处理
|
||||
|
|
@ -121,4 +120,9 @@ public class AccTradeServiceImpl implements IAccTradeService {
|
|||
public int deleteAccTradeByTradeId(Long tradeId) {
|
||||
return accTradeMapper.deleteAccTradeByTradeId(tradeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccSubOperationListVO> queryAccSubOperationList(AccSubOperationQueryParam param) {
|
||||
return accTradeMapper.queryAccSubOperationList(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,9 +185,9 @@ public class AccWalletInfoServiceImpl implements IAccWalletInfoService {
|
|||
accWalletInfoMapper.reduceAccWalletInfo(operation.getAmount(), operation.getUserId(), operation.getWalletId());
|
||||
}
|
||||
|
||||
private void clearAccWalletInfo(WalletBalanceOperation operation) {
|
||||
accWalletInfoMapper.clearAccWalletInfo(operation.getUserId(), operation.getWalletId());
|
||||
}
|
||||
// private void clearAccWalletInfo(WalletBalanceOperation operation) {
|
||||
// accWalletInfoMapper.clearAccWalletInfo(operation.getUserId(), operation.getWalletId());
|
||||
// }
|
||||
|
||||
public void acWalletBalanceOperation(WalletBalanceOperation operation) {
|
||||
switch (WalletBalanceOperationEnum.getEnum(operation.getOperationType())) {
|
||||
|
|
@ -195,7 +195,7 @@ public class AccWalletInfoServiceImpl implements IAccWalletInfoService {
|
|||
addAccWalletInfo(operation);
|
||||
break;
|
||||
case REDUCE_BAL:
|
||||
clearAccWalletInfo(operation);
|
||||
reduceAccWalletInfo(operation);
|
||||
break;
|
||||
default:
|
||||
throw new ServiceException("钱包操作类型错误");
|
||||
|
|
@ -208,7 +208,6 @@ public class AccWalletInfoServiceImpl implements IAccWalletInfoService {
|
|||
if(Objects.nonNull(userResult)) {
|
||||
sysUser = userResult.getDataAs(SysUser.class);
|
||||
}
|
||||
|
||||
long tradeId = Id.next();
|
||||
LocalDateTime tradeTime = LocalDateTime.now();
|
||||
AccTrade accTrade = new AccTrade();
|
||||
|
|
|
|||
|
|
@ -213,4 +213,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{tradeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="queryAccSubOperationList" resultType="com.bonus.canteen.core.account.domain.vo.AccSubOperationListVO">
|
||||
SELECT ate.trade_time,
|
||||
ate.user_id,
|
||||
su.nick_name,
|
||||
su.phonenumber as phoneNumber,
|
||||
sd.dept_name,
|
||||
su.user_type,
|
||||
sdd.dict_label as userTypeName,
|
||||
ate.create_by,
|
||||
ate.trade_id,
|
||||
ate.trade_state,
|
||||
ate.amount,
|
||||
atwd.wallet_bal,
|
||||
FROM
|
||||
acc_trade ate
|
||||
LEFT JOIN sys_user su ON su.user_id = ate.user_id
|
||||
LEFT JOIN sys_dict_data sdd on sdd.dict_type = 'user_psn_type' and sdd.dict_value = su.user_type
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = ate.dept_id
|
||||
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>
|
||||
<if test="param.endDateTime != null">
|
||||
and ate.trade_time <![CDATA[ <= ]]> #{param.endDateTime}
|
||||
</if>
|
||||
<if test="param.createBy != null and param.createBy != ''">
|
||||
and ate.create_by like #{param.createBy}
|
||||
</if>
|
||||
<if test="param.deptIdList != null and param.deptIdList.size() > 0">
|
||||
and ate.dept_id in
|
||||
<foreach collection="param.deptIdList" item="deptId" separator="," open="(" close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
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>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue