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