## Opt - 业绩列表-增加金额&数字/10000(保留4位小数)

This commit is contained in:
sangelxiu1 2025-09-05 10:01:34 +08:00 committed by cabbage
parent f95ab28f03
commit 1d76aac109
3 changed files with 28 additions and 17 deletions

View File

@ -524,10 +524,12 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
pkMemberList = baseMapper.selectDirectPushByPkMember(member.getPkId(), SecurityUtils.getSystemType());
}
List<PerformanceVO> meList = baseMapper.getPerformanceList(settleTable, Collections.singletonList(member.getPkId()), targetDayStart, targetDayEnd);
formatAmount(meList);
PageUtils.startPage(param.getPageNum(), param.getPageSize());
List<PerformanceVO> otherList = new ArrayList<>();
if(CollUtil.isNotEmpty(pkMemberList)){
otherList = baseMapper.getPerformanceList(settleTable, pkMemberList, targetDayStart, targetDayEnd);
formatAmount(otherList);
}
PageUtils.clearPage();
if(param.getPageNum() == 1){
@ -537,6 +539,18 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return otherList;
}
}
private void formatAmount(List<PerformanceVO> list){
for (PerformanceVO performanceVO : list) {
// debug
performanceVO.setCurrentMonthPv(performanceVO.getCurrentMonthAmount());
performanceVO.setRepurchasePv(performanceVO.getRepurchasePv());
performanceVO.setRepurchasePv(DataStatisticsUtil.formatPV(performanceVO.getRepurchasePv()));
performanceVO.setRepurchaseAmount(DataStatisticsUtil.formatPV(performanceVO.getRepurchaseAmount()));
performanceVO.setCurrentMonthPv(DataStatisticsUtil.formatPV(performanceVO.getCurrentMonthPv()));
performanceVO.setCurrentMonthAmount(DataStatisticsUtil.formatPV(performanceVO.getCurrentMonthAmount()));
}
}
public static boolean isCurrentMonth(String yearStr, String monthStr) {
if (yearStr == null || monthStr == null || yearStr.trim().isEmpty() || monthStr.trim().isEmpty()) {
throw new IllegalArgumentException("年份和月份不能为空");

View File

@ -29,6 +29,11 @@ public class PerformanceVO implements Serializable {
*/
@BigDecimalFormat
private BigDecimal currentMonthPv;
/**
* 当月金额
*/
@BigDecimalFormat
private BigDecimal currentMonthAmount;
/**
* 当月盒数
*/
@ -38,6 +43,11 @@ public class PerformanceVO implements Serializable {
*/
@BigDecimalFormat
private BigDecimal repurchasePv;
/**
* 复购金额
*/
@BigDecimalFormat
private BigDecimal repurchaseAmount;
/**
* 复购盒数
*/

View File

@ -744,29 +744,16 @@
currentMonth.ENABLE_STATUS,
NVL( currentMonth.MONTH_CONSUME_PV + currentMonth.TEAM_MONTH_PV, 0 ) currentMonthPv,
NVL( currentMonth.MONTH_BOX_NUM + currentMonth.TEAM_MONTH_BOX_NUM, 0 ) currentMonthBoxNum,
NVL( repurchasePv, 0 ) repurchasePv,
NVL( repurchaseBox, 0 ) repurchaseBox
NVL( currentMonth.MONTH_CONSUME_AMOUNT + currentMonth.TEAM_MONTH_AMOUNT, 0 ) currentMonthAmount,
NVL( currentMonth.MONTH_REP_CONSUME_PV, 0 ) repurchasePv,
NVL( currentMonth.MONTH_REP_CONSUME_AMOUNT, 0 ) repurchaseAmount,
NVL( currentMonth.MONTH_REP_BOX_NUM, 0 ) repurchaseBox
FROM
cu_member cu
LEFT JOIN ${tableName} currentMonth ON cu.PK_ID = currentMonth.PK_MEMBER
AND cu.CATEGORY = 0
LEFT JOIN BD_GRADE grade ON grade.PK_ID = cu.PK_SETTLE_GRADE
LEFT JOIN BD_AWARDS awards ON awards.PK_ID = cu.PK_AWARDS
LEFT JOIN (
SELECT
PK_MEMBER,
sum( ORDER_ACHIEVE ) repurchasePv,
sum( BOX_NUM ) repurchaseBox
FROM
sa_order
WHERE
ORDER_TYPE = 43
AND DEL_FLAG = 0
AND ORDER_STATUS = 1
AND PAY_TIME BETWEEN #{targetDayStart} and #{targetDayEnd}
GROUP BY
PK_MEMBER
) fg ON fg.pk_member = cu.pk_id
WHERE cu.pk_id in
<foreach collection="memberIdList" item="memberId" separator="," open="(" close=")">
#{memberId}