From acdbbb63e123067cddb35c6c8f29e148a37bfc4c Mon Sep 17 00:00:00 2001 From: chengkun <2500338766@qq.com> Date: Fri, 1 Jul 2022 10:26:03 +0800 Subject: [PATCH] =?UTF-8?q?feature1.0.0-img:=E6=B7=BB=E5=8A=A0=E6=94=B6?= =?UTF-8?q?=E7=9B=8A=E7=BB=9F=E8=AE=A1=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/utils/DesensitizedUtils.java | 4 +- .../img/controller/CreatorMiniController.java | 7 ++++ .../bnyer/img/mapper/CreatorProfitMapper.java | 35 +++++++++++++++++ .../impl/CreatorProfitServiceImpl.java | 19 ++++++++- .../main/java/com/bnyer/img/vo/ProfitVo.java | 21 +++++----- .../bnyer/img/mapper/CreatorProfitMapper.xml | 39 +++++++++++++++++++ 6 files changed, 111 insertions(+), 14 deletions(-) diff --git a/bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/utils/DesensitizedUtils.java b/bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/utils/DesensitizedUtils.java index a28a3d7..621d1b9 100644 --- a/bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/utils/DesensitizedUtils.java +++ b/bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/utils/DesensitizedUtils.java @@ -178,7 +178,7 @@ public class DesensitizedUtils { } else if (value instanceof Collection) {//对集合类型的字段进行递归过滤 Collection c = (Collection) value; Iterator it = c.iterator(); - while (it.hasNext()) {// TODO: 待优化 + while (it.hasNext()) { Object collectionObj = it.next(); if (isNotGeneralType(collectionObj.getClass(), collectionObj, referenceCounter)) { replace(ObjectUtils.getAllFields(collectionObj), collectionObj, referenceCounter); @@ -249,7 +249,7 @@ public class DesensitizedUtils { } else if (value instanceof Collection) {//对集合类型的字段进行递归过滤 Collection c = (Collection) value; Iterator it = c.iterator(); - while (it.hasNext()) {// TODO: 待优化 + while (it.hasNext()) { Object collectionObj = it.next(); if (isNotGeneralType(collectionObj.getClass(), collectionObj, referenceCounter)) { guangFaReplace(ObjectUtils.getAllFields(collectionObj), collectionObj, referenceCounter); diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/controller/CreatorMiniController.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/controller/CreatorMiniController.java index 5818ae9..ac35ddc 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/controller/CreatorMiniController.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/controller/CreatorMiniController.java @@ -250,6 +250,13 @@ public class CreatorMiniController extends BaseController { return AjaxResult.success(creatorProfitService.queryFrontEndProfitAmt(params.getCreatorId(),params.getType())); } + //@TokenCheck + @ApiOperation(value="查询指定艺术家收益统计") + @GetMapping(value = "/queryFrontProfitInfo/{creatorId}") + public AjaxResult queryFrontProfitInfo(@PathVariable @ApiParam("艺术家id") Long creatorId){ + return AjaxResult.success(creatorProfitService.queryFrontProfitInfo(creatorId)); + } + //@TokenCheck @PostMapping("/login") @ApiOperation("小程序艺术家登录") diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/mapper/CreatorProfitMapper.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/mapper/CreatorProfitMapper.java index 041e6be..c1fbe96 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/mapper/CreatorProfitMapper.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/mapper/CreatorProfitMapper.java @@ -148,4 +148,39 @@ public interface CreatorProfitMapper extends BaseMapper { * @param list 订单列表 */ int batchUpdateTransInfo(@Param("list") List list); + + /** + * 查询艺术家累计收益 + * @param creatorId 艺术家id + * @return - + */ + BigDecimal queryTotalProfit(@Param("creatorId") Long creatorId); + + /** + * 查询艺术家上月收益 + * @param creatorId 艺术家 + * @return - + */ + BigDecimal queryLastMonthProfit(@Param("creatorId") Long creatorId); + + /** + * 查询艺术家本月收益 + * @param creatorId 艺术家 + * @return - + */ + BigDecimal queryThisMonthProfit(@Param("creatorId") Long creatorId); + + /** + * 查询艺术家昨日广告收益 + * @param creatorId 艺术家id + * @return - + */ + BigDecimal queryLastDayAdProfit(@Param("creatorId") Long creatorId); + + /** + * 查询艺术家昨日邀请收益 + * @param creatorId 艺术家id + * @return - + */ + BigDecimal queryLastDayInviteProfit(@Param("creatorId") Long creatorId); } diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java index 918e915..0fb4040 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/CreatorProfitServiceImpl.java @@ -232,8 +232,23 @@ public class CreatorProfitServiceImpl implements CreatorProfitService { @Override public ProfitVo queryFrontProfitInfo(Long creatorId) { - //TODO 计算收益 - return null; + //累计收益 + BigDecimal totalProfit = creatorProfitMapper.queryTotalProfit(creatorId); + //上月收益 + BigDecimal lastMonthProfit = creatorProfitMapper.queryLastMonthProfit(creatorId); + //本月收益 + BigDecimal thisMonthProfit = creatorProfitMapper.queryThisMonthProfit(creatorId); + //昨日广告收益 + BigDecimal yesterdayAdProfit = creatorProfitMapper.queryLastDayAdProfit(creatorId); + //昨日邀请收益 + BigDecimal yesterdayInviteProfit = creatorProfitMapper.queryLastDayInviteProfit(creatorId); + ProfitVo result = new ProfitVo(); + result.setTotalProfit(totalProfit); + result.setLastMonthProfit(lastMonthProfit); + result.setThisMonthProfit(thisMonthProfit); + result.setYesterdayAdProfit(yesterdayAdProfit); + result.setYesterdayInviteProfit(yesterdayInviteProfit); + return result; } @Override diff --git a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/vo/ProfitVo.java b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/vo/ProfitVo.java index decebf7..c753e00 100644 --- a/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/vo/ProfitVo.java +++ b/bnyer-services/bnyer-img/src/main/java/com/bnyer/img/vo/ProfitVo.java @@ -6,6 +6,7 @@ import lombok.Getter; import lombok.Setter; import java.io.Serializable; +import java.math.BigDecimal; @Getter @@ -13,20 +14,20 @@ import java.io.Serializable; @ApiModel("收益响应体") public class ProfitVo implements Serializable { - @ApiModelProperty(value="昨日广告收益(单位毫分)") - private Integer yesterdayProfit; + @ApiModelProperty(value="昨日广告收益") + private BigDecimal yesterdayAdProfit; - @ApiModelProperty(value="昨日邀请收益(单位毫分)") - private Integer yesterdayInviteProfit; + @ApiModelProperty(value="昨日邀请收益") + private BigDecimal yesterdayInviteProfit; - @ApiModelProperty(value="累计收益(单位毫分)") - private Integer totalProfit; + @ApiModelProperty(value="累计收益") + private BigDecimal totalProfit; - @ApiModelProperty(value="上月收益(单位毫分)") - private Integer lastMonthProfit; + @ApiModelProperty(value="上月收益") + private BigDecimal lastMonthProfit; - @ApiModelProperty(value="当月收益(单位毫分)") - private Integer thisMonthProfit; + @ApiModelProperty(value="当月收益") + private BigDecimal thisMonthProfit; private static final long serialVersionUID = 1L; } diff --git a/bnyer-services/bnyer-img/src/main/resources/com/bnyer/img/mapper/CreatorProfitMapper.xml b/bnyer-services/bnyer-img/src/main/resources/com/bnyer/img/mapper/CreatorProfitMapper.xml index 16bd055..127525e 100644 --- a/bnyer-services/bnyer-img/src/main/resources/com/bnyer/img/mapper/CreatorProfitMapper.xml +++ b/bnyer-services/bnyer-img/src/main/resources/com/bnyer/img/mapper/CreatorProfitMapper.xml @@ -219,4 +219,43 @@ #{item} + + + + + + + + + +