Просмотр исходного кода

[拓客分析][新增]渠道查询接口

release_toaliyun_real
jinguo24@163.com 7 лет назад
Родитель
Сommit
4b4a53fc16
4 измененных файлов: 47 добавлений и 6 удалений
  1. +27
    -3
      mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java
  2. +14
    -0
      mallinkService/src/main/java/com/simple/domain/po/WxCUser.java
  3. +4
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxUserChannelServiceImpl.java
  4. +2
    -2
      mallinkService/src/main/resources/mapper/WxUserChannelMapper.xml

+ 27
- 3
mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java Просмотреть файл

@@ -9,6 +9,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -167,9 +168,32 @@ public class WxUserStructureController {
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",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) {
PageInfo<WxCUser> list = wxCUserService.listByChannel(null, pageNum, pageSize);
return new ResultData(list);
public ResultData findUserByChannel(String channelName,Integer pageNum, Integer pageSize) {
List<String> sceneList =null;
if(StringUtils.isNotBlank(channelName)) {
WxUserChannel c= new WxUserChannel();
c.setChannelName(channelName);
PageInfo<WxUserChannel> page = wxUserChannelService.listAsPage(c, 1, 100);
if(page.getSize()>0) {
sceneList = new ArrayList<>();
for(WxUserChannel wuc:page.getList()) {
sceneList.add(wuc.getSceneAddress());
}
}
}
PageInfo<WxCUser> page = wxCUserService.listByChannel(sceneList, pageNum, pageSize);
for(WxCUser u:page.getList()) {
WxUserChannel c= new WxUserChannel();
c.setSceneAddress(u.getSceneAddress());
PageInfo<WxUserChannel> uc = wxUserChannelService.listAsPage(c, 1, 1);
if(uc.getSize()>0) {
u.setChannelName(uc.getList().get(0).getChannelName());
}else {
u.setChannelName("其他来源");
}
}
return new ResultData(page);
}
@ApiOperation("获取用户所有渠道")


+ 14
- 0
mallinkService/src/main/java/com/simple/domain/po/WxCUser.java Просмотреть файл

@@ -116,6 +116,20 @@ public class WxCUser implements Serializable {
/*用户过期时间**/
@io.swagger.annotations.ApiModelProperty(value="用户过期时间",name="expireTime")
private Date expireTime;
//渠道名称
@Transient
private String channelName;
public String getChannelName() {
return channelName;
}

public void setChannelName(String channelName) {
this.channelName = channelName;
}

public String getTenantId() {
return tenantId;
}


+ 4
- 1
mallinkService/src/main/java/com/simple/service/impl/WxUserChannelServiceImpl.java Просмотреть файл

@@ -46,8 +46,11 @@ public class WxUserChannelServiceImpl implements WxUserChannelService {

@Override
public List<WxUserChannel> findDistinctChannel() {
return wxUserChannelMapper.findDistinctChannel();
}
}

+ 2
- 2
mallinkService/src/main/resources/mapper/WxUserChannelMapper.xml Просмотреть файл

@@ -21,12 +21,12 @@
</if>
<if test=" null != channelName ">
and `channel_name` like concat('%', #{channelName},'%')
and `channel_name` = #{channelName}
</if>
<if test=" null != sceneAddress ">
and `scene_address` like concat('%', #{sceneAddress},'%')
and `scene_address` = #{sceneAddress}
</if>


Загрузка…
Отмена
Сохранить