forked from angelo/java-retail-app
## Opt - 业绩列表-增加金额&数字/10000(保留4位小数)
This commit is contained in:
parent
c92af0fffc
commit
8e4d915ac8
|
@ -524,10 +524,12 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
|
||||||
pkMemberList = baseMapper.selectDirectPushByPkMember(member.getPkId(), SecurityUtils.getSystemType());
|
pkMemberList = baseMapper.selectDirectPushByPkMember(member.getPkId(), SecurityUtils.getSystemType());
|
||||||
}
|
}
|
||||||
List<PerformanceVO> meList = baseMapper.getPerformanceList(settleTable, Collections.singletonList(member.getPkId()), targetDayStart, targetDayEnd);
|
List<PerformanceVO> meList = baseMapper.getPerformanceList(settleTable, Collections.singletonList(member.getPkId()), targetDayStart, targetDayEnd);
|
||||||
|
formatAmount(meList);
|
||||||
PageUtils.startPage(param.getPageNum(), param.getPageSize());
|
PageUtils.startPage(param.getPageNum(), param.getPageSize());
|
||||||
List<PerformanceVO> otherList = new ArrayList<>();
|
List<PerformanceVO> otherList = new ArrayList<>();
|
||||||
if(CollUtil.isNotEmpty(pkMemberList)){
|
if(CollUtil.isNotEmpty(pkMemberList)){
|
||||||
otherList = baseMapper.getPerformanceList(settleTable, pkMemberList, targetDayStart, targetDayEnd);
|
otherList = baseMapper.getPerformanceList(settleTable, pkMemberList, targetDayStart, targetDayEnd);
|
||||||
|
formatAmount(otherList);
|
||||||
}
|
}
|
||||||
PageUtils.clearPage();
|
PageUtils.clearPage();
|
||||||
if(param.getPageNum() == 1){
|
if(param.getPageNum() == 1){
|
||||||
|
@ -537,6 +539,18 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
|
||||||
return otherList;
|
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) {
|
public static boolean isCurrentMonth(String yearStr, String monthStr) {
|
||||||
if (yearStr == null || monthStr == null || yearStr.trim().isEmpty() || monthStr.trim().isEmpty()) {
|
if (yearStr == null || monthStr == null || yearStr.trim().isEmpty() || monthStr.trim().isEmpty()) {
|
||||||
throw new IllegalArgumentException("年份和月份不能为空");
|
throw new IllegalArgumentException("年份和月份不能为空");
|
||||||
|
|
|
@ -29,6 +29,11 @@ public class PerformanceVO implements Serializable {
|
||||||
*/
|
*/
|
||||||
@BigDecimalFormat
|
@BigDecimalFormat
|
||||||
private BigDecimal currentMonthPv;
|
private BigDecimal currentMonthPv;
|
||||||
|
/**
|
||||||
|
* 当月金额
|
||||||
|
*/
|
||||||
|
@BigDecimalFormat
|
||||||
|
private BigDecimal currentMonthAmount;
|
||||||
/**
|
/**
|
||||||
* 当月盒数
|
* 当月盒数
|
||||||
*/
|
*/
|
||||||
|
@ -38,6 +43,11 @@ public class PerformanceVO implements Serializable {
|
||||||
*/
|
*/
|
||||||
@BigDecimalFormat
|
@BigDecimalFormat
|
||||||
private BigDecimal repurchasePv;
|
private BigDecimal repurchasePv;
|
||||||
|
/**
|
||||||
|
* 复购金额
|
||||||
|
*/
|
||||||
|
@BigDecimalFormat
|
||||||
|
private BigDecimal repurchaseAmount;
|
||||||
/**
|
/**
|
||||||
* 复购盒数
|
* 复购盒数
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -744,29 +744,16 @@
|
||||||
currentMonth.ENABLE_STATUS,
|
currentMonth.ENABLE_STATUS,
|
||||||
NVL( currentMonth.MONTH_CONSUME_PV + currentMonth.TEAM_MONTH_PV, 0 ) currentMonthPv,
|
NVL( currentMonth.MONTH_CONSUME_PV + currentMonth.TEAM_MONTH_PV, 0 ) currentMonthPv,
|
||||||
NVL( currentMonth.MONTH_BOX_NUM + currentMonth.TEAM_MONTH_BOX_NUM, 0 ) currentMonthBoxNum,
|
NVL( currentMonth.MONTH_BOX_NUM + currentMonth.TEAM_MONTH_BOX_NUM, 0 ) currentMonthBoxNum,
|
||||||
NVL( repurchasePv, 0 ) repurchasePv,
|
NVL( currentMonth.MONTH_CONSUME_AMOUNT + currentMonth.TEAM_MONTH_AMOUNT, 0 ) currentMonthAmount,
|
||||||
NVL( repurchaseBox, 0 ) repurchaseBox
|
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
|
FROM
|
||||||
cu_member cu
|
cu_member cu
|
||||||
LEFT JOIN ${tableName} currentMonth ON cu.PK_ID = currentMonth.PK_MEMBER
|
LEFT JOIN ${tableName} currentMonth ON cu.PK_ID = currentMonth.PK_MEMBER
|
||||||
AND cu.CATEGORY = 0
|
AND cu.CATEGORY = 0
|
||||||
LEFT JOIN BD_GRADE grade ON grade.PK_ID = cu.PK_SETTLE_GRADE
|
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 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
|
WHERE cu.pk_id in
|
||||||
<foreach collection="memberIdList" item="memberId" separator="," open="(" close=")">
|
<foreach collection="memberIdList" item="memberId" separator="," open="(" close=")">
|
||||||
#{memberId}
|
#{memberId}
|
||||||
|
|
Loading…
Reference in New Issue