1 files added
4 files modified
| | |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; |
| | | import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; |
| | | import com.matrix.system.shopXcx.vo.SalesmanVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page, |
| | | @Param("record")ShopSalesmanAppliingDto shopSalesmanAppliingDto); |
| | | |
| | | SalesmanCenterInfo selectSalesmanCenterInfo(String openId); |
| | | } |
| | |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; |
| | | import com.matrix.system.shopXcx.vo.SalesmanVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询分销员中心信息", notes = "") |
| | | @PostMapping(value = "/getSalesmanCenterInfo") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanCenterInfo.class) |
| | | }) |
| | | AjaxResult getSalesmanCenterInfo() { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SalesmanCenterInfo salesmanCenterInfo= salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getOpenId()); |
| | | return AjaxResult.buildSuccessInstance(salesmanCenterInfo); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | if(hasInvitationMan){ |
| | | ShopSalesmanGrade invitationManGrade = shopSalesmanGradeDao.selectById(invitationMan.getSalesmanGrade()); |
| | | invitationAmount+=item.getTotalPrice().doubleValue()*(invitationManGrade.getSealesCommission()/100); |
| | | invitationAmount+=item.getTotalPrice().doubleValue()*(invitationManGrade.getInvitationCommission()/100); |
| | | } |
| | | |
| | | }else{ |
New file |
| | |
| | | package com.matrix.system.shopXcx.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SalesmanCenterInfo", description = " 销售员中心返回参数") |
| | | public class SalesmanCenterInfo { |
| | | |
| | | @ApiModelProperty(value = "累计收益") |
| | | private String totalRevenue; |
| | | |
| | | |
| | | @ApiModelProperty(value = "待结算收益") |
| | | private String djsRevenue; |
| | | |
| | | |
| | | @ApiModelProperty(value = "可提现金额") |
| | | private String withdrawalCash; |
| | | |
| | | @ApiModelProperty(value = "推广订单数") |
| | | private String orderCount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "客户数") |
| | | private Double customerCount; |
| | | |
| | | @ApiModelProperty(value = "邀请下级数") |
| | | private Double invitationCount; |
| | | |
| | | |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSalesmanCenterInfo" resultType="com.matrix.system.shopXcx.vo.SalesmanCenterInfo"> |
| | | select |
| | | IFNULL(withdrawal_cash,0) as withdrawal_cash, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum(IFNULL( b.amount, 0 )),0) |
| | | FROM |
| | | shop_salesman_order b |
| | | WHERE |
| | | b.user_id = a.open_id |
| | | and order_status=2 |
| | | AND b.sales_user_id = #{openId} |
| | | |
| | | ) AS totalRevenue, |
| | | IFNULL(withdrawal_cash,0) as withdrawal_cash, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum(IFNULL( b.amount, 0 )),0) |
| | | FROM |
| | | shop_salesman_order b |
| | | WHERE |
| | | b.user_id = a.open_id |
| | | and order_status=1 |
| | | AND b.sales_user_id = #{openId} |
| | | |
| | | ) AS djsRevenue, |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} ) AS orderCount, |
| | | (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=1) as invitationCount, |
| | | (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=2) as customerCount |
| | | from biz_user a where |
| | | a.open_id=#{openId} |
| | | |
| | | </select> |
| | | |
| | | </mapper> |