5 files modified
6 files added
| | |
| | |
|
| | |
|
| | | #log
|
| | | project.log.path=xzx/logs
|
| | | project.log.path=/xzx/logs
|
| | | logstash.server.url=localhost:4560
|
| | |
|
| | | #spring
|
| | |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.user.dto.DistribJoinDto; |
| | | import com.xzx.gc.user.dto.HeadProfitLitDto; |
| | | import com.xzx.gc.user.dto.HeadTeamDto; |
| | | import com.xzx.gc.user.service.DistribService; |
| | | import com.xzx.gc.user.vo.HeadInfoVo; |
| | | import com.xzx.gc.user.vo.HeadProfitListVo; |
| | | import com.xzx.gc.user.vo.HeadTeamVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | return JsonResult.success(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取团长信息") |
| | | @PostMapping(value = "/distrib/headInfo") |
| | | public JsonResult<HeadInfoVo> headInfo(HttpServletRequest request) { |
| | | return JsonResult.success(distribService.findHeadInfo(getUserId(request))); |
| | | } |
| | | |
| | | @ApiOperation("我的收益") |
| | | @PostMapping(value = "/distrib/headProfit") |
| | | public JsonResult<List<HeadProfitListVo>> headProfitList(@RequestBody HeadProfitLitDto headProfitLitDto, HttpServletRequest request) { |
| | | headProfitLitDto.setUserId(getUserId(request)); |
| | | return JsonResult.success(distribService.findHeadProfitListInPage(headProfitLitDto)); |
| | | } |
| | | |
| | | @ApiOperation("我的团队") |
| | | @PostMapping(value = "/distrib/headTeam") |
| | | public JsonResult<List<HeadTeamVo>> headTimeList(@RequestBody HeadTeamDto headTeamDto, HttpServletRequest request) { |
| | | headTeamDto.setUserId(getUserId(request)); |
| | | return JsonResult.success(distribService.findHeadTeamListInPage(headTeamDto)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.user.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-07-14 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "HeadProfitLitDto", description = "我的收益接收参数类") |
| | | public class HeadProfitLitDto { |
| | | @ApiModelProperty(value = "第几页", required = true) |
| | | private int page; |
| | | |
| | | @ApiModelProperty(value = "每一页数量", required = true) |
| | | private int limit; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.user.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-07-14 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "HeadTeamDto", description = "我的团队接收参数类") |
| | | public class HeadTeamDto { |
| | | |
| | | @ApiModelProperty(value = "第几页", required = true) |
| | | private int page; |
| | | |
| | | @ApiModelProperty(value = "每一页数量", required = true) |
| | | private int limit; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.user.mapper; |
| | | |
| | | import com.xzx.gc.entity.UserHeadDetails; |
| | | import com.xzx.gc.user.dto.HeadProfitLitDto; |
| | | import com.xzx.gc.user.vo.HeadProfitListVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface UserHeadDetailsMapper extends GcMapper<UserHeadDetails> { |
| | | |
| | | List<HeadProfitListVo> selectHeadProfitListInPage(@Param("userId") String userId); |
| | | } |
| | |
| | | |
| | | import com.xzx.gc.entity.UserHeadRelate; |
| | | import com.xzx.gc.user.vo.HeadInfoVo; |
| | | import com.xzx.gc.user.vo.HeadTeamVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface UserHeadRelateMapper extends GcMapper<UserHeadRelate> { |
| | | |
| | | UserHeadRelate selectMemberByUserId(@Param("userId") String userId); |
| | | |
| | | HeadInfoVo selectHeadStatisticsData(@Param("userId") String userId); |
| | | |
| | | List<HeadTeamVo> selectHeadTeamListInPage(@Param("userId") String userId); |
| | | } |
| | |
| | | import com.xzx.gc.entity.SysMessage; |
| | | import com.xzx.gc.entity.UserHeadRelate; |
| | | import com.xzx.gc.entity.UserShareInfo; |
| | | import com.xzx.gc.user.dto.HeadProfitLitDto; |
| | | import com.xzx.gc.user.dto.HeadTeamDto; |
| | | import com.xzx.gc.user.mapper.*; |
| | | import com.xzx.gc.user.vo.HeadInfoVo; |
| | | import com.xzx.gc.user.vo.HeadProfitListVo; |
| | | import com.xzx.gc.user.vo.HeadTeamVo; |
| | | import com.xzx.gc.user.dto.AdddistribDto; |
| | | import com.xzx.gc.user.dto.DistribListDto; |
| | | import com.xzx.gc.user.mapper.AccountMapper; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | |
| | | private RedPaperRuleMapper redPaperRuleMapper; |
| | | @Autowired |
| | | private UserHeadRelateMapper userHeadRelateMapper; |
| | | |
| | | @Autowired |
| | | private UserHeadDetailsMapper userHeadDetailsMapper; |
| | | @Autowired |
| | | private AccountMapper accountMapper; |
| | | @Autowired |
| | |
| | | return headInfoVo; |
| | | } |
| | | |
| | | public List<HeadProfitListVo> findHeadProfitListInPage(HeadProfitLitDto profitLitDto) { |
| | | PageHelper.startPage(profitLitDto.getPage(), profitLitDto.getLimit()); |
| | | return userHeadDetailsMapper.selectHeadProfitListInPage(profitLitDto.getUserId()); |
| | | } |
| | | |
| | | public List<HeadTeamVo> findHeadTeamListInPage(HeadTeamDto teamDto) { |
| | | PageHelper.startPage(teamDto.getPage(), teamDto.getLimit()); |
| | | return userHeadRelateMapper.selectHeadTeamListInPage(teamDto.getUserId()); |
| | | } |
| | | |
| | | public void addSetting(UpdateSettingDto model) { |
| | | RedPaperRule redPaperRule = new RedPaperRule(); |
| | | StringBuffer stringBuffer = new StringBuffer(); |
| New file |
| | |
| | | package com.xzx.gc.user.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-07-14 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "HeadProfitListVo", description = "我的收益接口返回参数类") |
| | | public class HeadProfitListVo { |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "会员名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private BigDecimal orderAmount; |
| | | |
| | | @ApiModelProperty(value = "完成时间") |
| | | private String finishTime; |
| | | |
| | | @ApiModelProperty(value = "回收类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "环保币") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private BigDecimal score; |
| | | } |
| New file |
| | |
| | | package com.xzx.gc.user.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-07-14 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "HeadTeamVo", description = "我的团队返回参数类") |
| | | public class HeadTeamVo { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "绑定时间") |
| | | private String bindTime; |
| | | |
| | | @ApiModelProperty(value = "最后下单时间") |
| | | private String lastOrderTime; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private BigDecimal score; |
| | | |
| | | @ApiModelProperty(value = "环保币") |
| | | private BigDecimal amount; |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xzx.gc.user.mapper.UserHeadDetailsMapper"> |
| | | |
| | | <select id="selectHeadProfitListInPage" resultType="com.xzx.gc.user.vo.HeadProfitListVo"> |
| | | select |
| | | a.order_no orderNo, |
| | | FROM_BASE64(d.nick_name) name, |
| | | a.score, |
| | | a.amount, |
| | | b.receiving_time finishTime, |
| | | "住宅" type, |
| | | sum(c.score) orderAmount |
| | | from xzx_user_head_details a |
| | | inner join xzx_jhy_order b on a.order_no=b.order_no |
| | | inner join xzx_jhy_order_items c on b.id=c.order_id |
| | | inner join xzx_user_info d on b.user_id = d.user_id |
| | | where head_user_id=#{userId} |
| | | group by a.order_no, d.nick_name, a.score, a.amount, b.receiving_time |
| | | </select> |
| | | </mapper> |
| | |
| | | where a.head_user_id=#{userId} |
| | | group by a.head_user_id |
| | | </select> |
| | | |
| | | <select id="selectHeadTeamListInPage" resultType="com.xzx.gc.user.vo.HeadTeamVo"> |
| | | select |
| | | from_base64(b.nick_name) name, |
| | | b.avatar, |
| | | date_format(a.CREATED_TIME, '%Y/%m/%d') bindTime, |
| | | a.score, |
| | | a.amount, |
| | | date_format((select c.CREATED_TIME from xzx_jhy_order c where b.user_id=c.user_id and c.status=3 order by id desc limit 1), '%Y/%m/%d') lastOrderTime |
| | | from xzx_user_head_relate a |
| | | inner join xzx_user_info b on a.user_id=b.user_id |
| | | where a.head_user_id=#{userId} |
| | | </select> |
| | | </mapper> |