## 会员奖金明细添加本月实发收益字段;
This commit is contained in:
parent
a2a6cc8e01
commit
942140ba38
|
@ -26,13 +26,6 @@ import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description:
|
|
||||||
* @Author: sui q
|
|
||||||
* @Time: 2023/1/13 9:39
|
|
||||||
* @Classname: ApiCuMemberBonusController
|
|
||||||
* @PackageName: com.hzs.member.bonus.controller.api
|
|
||||||
*/
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/bonus")
|
@RequestMapping("/api/bonus")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -200,16 +193,28 @@ public class ApiCuMemberBonusController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/query-bonus-total")
|
@PostMapping("/query-bonus-total")
|
||||||
public TableDataInfo lisBonusTotal(@RequestBody BonusParam bonusParam) {
|
public TableDataInfo lisBonusTotal(@RequestBody BonusParam bonusParam) {
|
||||||
|
Date nowDate = DateUtils.currentDate();
|
||||||
bonusParam.setPkCountry(SecurityUtils.getPkCountry());
|
bonusParam.setPkCountry(SecurityUtils.getPkCountry());
|
||||||
bonusParam.setPkMember(SecurityUtils.getUserId());
|
bonusParam.setPkMember(SecurityUtils.getUserId());
|
||||||
bonusParam.setStartDate(DateUtils.beforeDate(1, ChronoUnit.DAYS));
|
// bonusParam.setStartDate(DateUtils.beforeDate(1, ChronoUnit.DAYS));
|
||||||
bonusParam.setEndDate(DateUtils.currentDate());
|
bonusParam.setStartDate(DateUtils.currentMonthFirstDate(nowDate));
|
||||||
|
bonusParam.setEndDate(nowDate);
|
||||||
List<CuMemberBonusExt> cuMemberBonusList = cuMemberBonusService.queryMemberBonusTotalByCondition(bonusParam);
|
List<CuMemberBonusExt> cuMemberBonusList = cuMemberBonusService.queryMemberBonusTotalByCondition(bonusParam);
|
||||||
MemberRealIncomeVO memberRealIncomeVO = new MemberRealIncomeVO();
|
MemberRealIncomeVO memberRealIncomeVO = MemberRealIncomeVO.builder()
|
||||||
if (CollectionUtil.isEmpty(cuMemberBonusList)) {
|
.realIncomeTotal(BigDecimal.ZERO)
|
||||||
memberRealIncomeVO.setRealIncomeTotal(BigDecimal.ZERO);
|
.monthIncomeTotal(BigDecimal.ZERO)
|
||||||
} else {
|
.build();
|
||||||
memberRealIncomeVO.setRealIncomeTotal(cuMemberBonusList.get(0).getRealIncomeTotal());
|
if (CollectionUtil.isNotEmpty(cuMemberBonusList)) {
|
||||||
|
if (DateUtils.beforeDate(1, ChronoUnit.DAYS, nowDate).equals(cuMemberBonusList.get(0).getSettleDate())) {
|
||||||
|
// 最新数据是昨天的奖金数据
|
||||||
|
BigDecimal monthTotal = BigDecimal.ZERO;
|
||||||
|
for (CuMemberBonusExt cuMemberBonusExt : cuMemberBonusList) {
|
||||||
|
monthTotal = monthTotal.add(cuMemberBonusExt.getRealIncomeTotal());
|
||||||
|
}
|
||||||
|
memberRealIncomeVO.setMonthIncomeTotal(monthTotal);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return getDataTable(Collections.singletonList(memberRealIncomeVO));
|
return getDataTable(Collections.singletonList(memberRealIncomeVO));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,33 @@
|
||||||
package com.hzs.bonus.bonus.vo;
|
package com.hzs.bonus.bonus.vo;
|
||||||
|
|
||||||
|
import com.hzs.common.core.annotation.BigDecimalFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 会员实发收益
|
* 会员实发收益
|
||||||
* @author: sui q
|
|
||||||
* @time: 2023/7/6 14:25
|
|
||||||
* @classname: MemberRealIncomeVO
|
|
||||||
* @package_name: com.hzs.member.bonus.vo
|
|
||||||
* version 1.0.0
|
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
public class MemberRealIncomeVO implements Serializable {
|
public class MemberRealIncomeVO implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实发收益总计
|
* 实发收益总计
|
||||||
*/
|
*/
|
||||||
|
@BigDecimalFormat
|
||||||
private BigDecimal realIncomeTotal;
|
private BigDecimal realIncomeTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月实发收益
|
||||||
|
*/
|
||||||
|
@BigDecimalFormat
|
||||||
|
private BigDecimal monthIncomeTotal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue