| @@ -18,6 +18,7 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| @@ -415,11 +416,12 @@ public class WxUserStructureController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData findUserByChannel(String channelName, Integer pageNum, Integer pageSize) { | |||||
| public ResultData findUserByChannel(@ModelAttribute WxCUser wxCUser, | |||||
| Integer pageNum, Integer pageSize) { | |||||
| List<String> sceneList = null; | List<String> sceneList = null; | ||||
| if (StringUtils.isNotBlank(channelName)) { | |||||
| if (StringUtils.isNotBlank(wxCUser.getChannelName())) { | |||||
| WxUserChannel c = new WxUserChannel(); | WxUserChannel c = new WxUserChannel(); | ||||
| c.setChannelName(channelName); | |||||
| c.setChannelName(wxCUser.getChannelName()); | |||||
| PageInfo<WxUserChannel> page = wxUserChannelService.listAsPage(c, 1, 100); | PageInfo<WxUserChannel> page = wxUserChannelService.listAsPage(c, 1, 100); | ||||
| if (page.getSize() > 0) { | if (page.getSize() > 0) { | ||||
| sceneList = new ArrayList<>(); | sceneList = new ArrayList<>(); | ||||
| @@ -428,7 +430,8 @@ public class WxUserStructureController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(getTenantId(), sceneList, pageNum, pageSize); | |||||
| wxCUser.setSceneList(sceneList); | |||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(wxCUser, pageNum, pageSize); | |||||
| for (WxCUser u : page.getList()) { | for (WxCUser u : page.getList()) { | ||||
| WxUserChannel c = new WxUserChannel(); | WxUserChannel c = new WxUserChannel(); | ||||
| c.setSceneAddress(u.getSceneAddress()); | c.setSceneAddress(u.getSceneAddress()); | ||||
| @@ -138,14 +138,47 @@ public class WxCUser implements Serializable { | |||||
| this.extraInfo = extraInfo; | this.extraInfo = extraInfo; | ||||
| } | } | ||||
| //渠道名称 | //渠道名称 | ||||
| @Transient | @Transient | ||||
| private String channelName; | private String channelName; | ||||
| //渠道描述 | //渠道描述 | ||||
| @Transient | @Transient | ||||
| protected String sceneDescription; | protected String sceneDescription; | ||||
| @Transient | |||||
| List<String> sceneList; | |||||
| @Transient | |||||
| protected Date startDate; | |||||
| @Transient | |||||
| protected Date endDate; | |||||
| public Date getStartDate() { | |||||
| return startDate; | |||||
| } | |||||
| public void setStartDate(Date startDate) { | |||||
| this.startDate = startDate; | |||||
| } | |||||
| public Date getEndDate() { | |||||
| return endDate; | |||||
| } | |||||
| public void setEndDate(Date endDate) { | |||||
| this.endDate = endDate; | |||||
| } | |||||
| public List<String> getSceneList() { | |||||
| return sceneList; | |||||
| } | |||||
| public void setSceneList(List<String> sceneList) { | |||||
| this.sceneList = sceneList; | |||||
| } | |||||
| public String getChannelName() { | public String getChannelName() { | ||||
| return channelName; | return channelName; | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.mapper; | package com.iformall.mapper; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| @@ -12,14 +13,12 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| List<WxCUser> findList(WxCUser wxCUser); | List<WxCUser> findList(WxCUser wxCUser); | ||||
| WxCUser findByOpenId(WxCUser record); | WxCUser findByOpenId(WxCUser record); | ||||
| WxCUser findByToken(String token); | WxCUser findByToken(String token); | ||||
| long findCount(WxCUserBasicInfoDto dto); | long findCount(WxCUserBasicInfoDto dto); | ||||
| List<WxCUser> listByChannel(@Param("sceneList")List<String> sceneList, @Param("tenantId")String tenantId); | |||||
| List<WxCUser> listByChannel(WxCUser wxCUser); | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| @@ -66,12 +67,12 @@ public interface WxCUserService { | |||||
| /** | /** | ||||
| * 通过渠道获取会员信息 | * 通过渠道获取会员信息 | ||||
| * @param sceneList | |||||
| * @param user | |||||
| * @param pageIndex | * @param pageIndex | ||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCUser> listByChannel(String tenantId, List<String> sceneList, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| @@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| @Service | @Service | ||||
| @@ -93,8 +94,8 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<WxCUser> listByChannel(String tenantId, List<String> sceneList, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listByChannel(sceneList, tenantId)); | |||||
| public PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listByChannel(user)); | |||||
| } | } | ||||
| @@ -203,6 +203,12 @@ | |||||
| <if test="null != tenantId"> | <if test="null != tenantId"> | ||||
| and tenant_id =#{tenantId} | and tenant_id =#{tenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != startDate "> | |||||
| and create_date >= #{startDate} | |||||
| </if> | |||||
| <if test=" null != endDate"> | |||||
| and create_date < #{endDate} | |||||
| </if> | |||||
| <if test=" sceneList!= null "> | <if test=" sceneList!= null "> | ||||
| and scene_address in | and scene_address in | ||||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | ||||