From bd8f3c43e53ccca587a253815f83f2093fd936ae Mon Sep 17 00:00:00 2001 From: "jinguo24@163.com" Date: Wed, 29 Aug 2018 20:11:05 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=8B=93=E5=AE=A2=E5=88=86=E6=9E=90][?= =?UTF-8?q?=E6=96=B0=E5=A2=9E]=E6=B8=A0=E9=81=93=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxUserStructureController.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java b/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java index 8dcbf13ca..98984d28d 100644 --- a/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java +++ b/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java @@ -18,10 +18,12 @@ import com.github.pagehelper.PageInfo; import com.simple.common.ResultData; import com.simple.domain.dto.WxCuerBasicInfoDto; import com.simple.domain.po.WxCUser; +import com.simple.domain.po.WxUserChannel; import com.simple.domain.vo.UserStructureVo; import com.simple.enums.EnumAgeInfo; import com.simple.service.WxCUserBasicInfoService; import com.simple.service.WxCUserService; +import com.simple.service.WxUserChannelService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -38,6 +40,8 @@ public class WxUserStructureController { @Autowired private WxCUserService wxCUserService; + @Autowired + private WxUserChannelService wxUserChannelService; @ApiOperation("查询会员性别结构") @GetMapping("/findUserSexStructure") @@ -163,10 +167,21 @@ public class WxUserStructureController { @ApiImplicitParams({ @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) - private ResultData findUserByChannel(String channelName,Integer pageNum, Integer pageSize) { + public ResultData findUserByChannel(String channelName,Integer pageNum, Integer pageSize) { PageInfo list = wxCUserService.listByChannel(null, pageNum, pageSize); return new ResultData(list); } + + @ApiOperation("获取用户所有渠道") + @GetMapping("/findAllUserChannel") + public ResultData findAllUserChannel() { + List channels=wxUserChannelService.findDistinctChannel(); + List vos = new ArrayList<>(); + for(WxUserChannel w:channels) { + vos.add(w.getChannelName()); + } + return new ResultData(vos); + } private long getCountByAge(EnumAgeInfo a,Calendar c, WxCuerBasicInfoDto dto ) {