Authored by mlge

种草 --前端获取用户身份修改

... ... @@ -94,6 +94,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
@Autowired
private UserInfoCacheHelper userInfoCacheHelper;
@Autowired
private IGrassVirtualGroupDao virtualGroupDao;
// 搜索推荐URL的链接
@Value("${search.server.address}")
private String searchServerAddress;
... ... @@ -1266,6 +1269,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
List<GrassArticleProduct> grassArticlePoductList = grassArticleProductDao.selectByArticleIds(ids);
List<GrassArticleLabel> labelList = grassArticleLabelDao.selectByArticleIdList(ids);
List<GrassArticleTopic> grassArticleTopics = grassArticleTopicDao.selectByArticleIdList(ids);
//用户身份信息
List<GrassVirtualGroup> virtualGroups = virtualGroupDao.selectAllWithStatus();
Map<Integer,String> virtualGroupMap = virtualGroups.stream().collect(Collectors.toMap(GrassVirtualGroup::getId,GrassVirtualGroup::getGroupName));
Map<Integer, Integer> commentCount = new HashMap<>();
... ... @@ -1373,8 +1379,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
rspBo.setTopicGroupId(topic == null ? null : topic.getRelatedGroup());
if (article.getArticleType() == 2) {//资讯来的,前台展示 空
rspBo.setUserType(0);
} else {//10--前台展示用户
rspBo.setUserType(article.getUserType() == null ? 10 : article.getUserType());
rspBo.setUserTypeStr("");
} else {//有货的账户,没有身份,前台展示 用户
rspBo.setUserType(article.getUserType() == null ? -1 : article.getUserType());
Integer userType = article.getUserType();
rspBo.setUserTypeStr(virtualGroupMap.get(userType) == null ? "用户" : virtualGroupMap.get(userType));
}
rspBo.setArticleTitle(article.getArticleTitle());
rspBo.setArticleSubtitle(article.getArticleSubtitle());
... ...
... ... @@ -8,7 +8,6 @@ import com.yoho.service.model.social.request.BaseReqBO;
import com.yoho.service.model.social.request.UicUserReqBO;
import com.yoho.service.model.social.response.UserInfoRspBO;
import com.yoho.service.model.social.response.UserLoginInfoRspBO;
import com.yohobuy.platform.common.enums.GrassVirtualUserGroupEnum;
import com.yohobuy.platform.common.util.BeanTool;
import com.yohobuy.platform.common.util.DateUtil;
import com.yohobuy.platform.dal.grass.*;
... ...
... ... @@ -115,16 +115,6 @@
data:[{text:"全部",value:"8"},{text:"待发布",value:"0"},{text:"未发布",value:"1"}]
});
/* $("#userType").combobox({
valueField : "value",
textField : "text",
required:false,
prompt: "请选择用户身份",
data:[{text:"全部",value:"0"},{text:"用户",value:"10"},{text: "普通马甲", value: "1"},
{text: "编辑", value: "2"}, {text: "官方号", value: "3"},
{text: "社区大号", value: "4"}, {text: "品牌号", value: "5"},
{text: "外部刷评论马甲", value: "6"},{text: "授权KOL", value: "7"}]
});*/
$("#userType").combobox({
valueField: "id",
... ... @@ -291,40 +281,9 @@
},
{
title: "用户身份",
field: "userType",
field: "userTypeStr",
width: 20,
align: "left",
formatter: function (value, rowData, rowIndex) {
debugger
var str = '';//不明身份者
if(rowData.userType == '10'){
str = "用户";
}
if(rowData.userType == '1'){
str = "普通马甲";
}
if(rowData.userType == '2'){
str = "编辑";
}
if(rowData.userType == '3'){
str = "官方号";
}
if(rowData.userType == '4'){
str = "社区大号";
}
if(rowData.userType == '5'){
str = "品牌号";
}
if(rowData.userType == '6'){
str = "外部刷评论马甲";
}
if(rowData.userType == '7'){
str = "授权KOL";
}
return str;
}
align: "left"
},
{
title: "发布时间",
... ...
... ... @@ -126,17 +126,6 @@
data:[{text:"全部",value:"0"},{text:"社区",value:"1"},{text:"资讯",value:"2"},{text:"晒单",value:"4"},{text:"now",value:"5"},{text:"mars",value:"3"},{text:"爬虫数据",value:"7"}]
});
/* $("#userType").combobox({
valueField : "value",
textField : "text",
required:false,
prompt: "请选择用户身份",
data:[{text:"全部",value:"0"},{text:"用户",value:"10"},{text: "普通马甲", value: "1"},
{text: "编辑", value: "2"}, {text: "官方号", value: "3"},
{text: "社区大号", value: "4"}, {text: "品牌号", value: "5"},
{text: "外部刷评论马甲", value: "6"},{text: "授权KOL", value: "7"}]
});*/
$("#userType").combobox({
valueField: "id",
textField: "groupName",
... ... @@ -263,40 +252,9 @@
},{
title: "用户身份",
field: "userType",
field: "userTypeStr",
width: 20,
align: "left",
formatter: function (value, rowData, rowIndex) {
debugger
var str = '';//不明身份者
if(rowData.userType == '10'){
str = "用户";
}
if(rowData.userType == '1'){
str = "普通马甲";
}
if(rowData.userType == '2'){
str = "编辑";
}
if(rowData.userType == '3'){
str = "官方号";
}
if(rowData.userType == '4'){
str = "社区大号";
}
if(rowData.userType == '5'){
str = "品牌号";
}
if(rowData.userType == '6'){
str = "外部刷评论马甲";
}
if(rowData.userType == '7'){
str = "授权KOL";
}
return str;
}
align: "left"
},
{
title: "发布时间",
... ...
... ... @@ -148,14 +148,18 @@
});
$("#userType").combobox({
valueField : "value",
textField : "text",
required:false,
valueField: "id",
textField: "groupName",
required: false,
prompt: "请选择用户身份",
data:[{text:"全部",value:"0"},{text:"用户",value:"10"},{text: "普通马甲", value: "1"},
{text: "编辑", value: "2"}, {text: "官方号", value: "3"},
{text: "社区大号", value: "4"}, {text: "品牌号", value: "5"},
{text: "外部刷评论马甲", value: "6"},{text: "授权KOL", value: "7"}]
selectOnNavigation : true,
url : serverContextPath + "/grassUserManage/getAllVirtualGroup",
loadFilter: function (data) {
var data = defaultLoadFilter(data);
data.unshift({'id': '0', 'groupName': '全部'});
debugger
return data;
}
});
... ... @@ -320,40 +324,9 @@
}
},{
title: "用户身份",
field: "userType",
field: "userTypeStr",
width: 20,
align: "left",
formatter: function (value, rowData, rowIndex) {
debugger
var str = '';//不明身份者
if(rowData.userType == '10'){
str = "用户";
}
if(rowData.userType == '1'){
str = "普通马甲";
}
if(rowData.userType == '2'){
str = "编辑";
}
if(rowData.userType == '3'){
str = "官方号";
}
if(rowData.userType == '4'){
str = "社区大号";
}
if(rowData.userType == '5'){
str = "品牌号";
}
if(rowData.userType == '6'){
str = "外部刷评论马甲";
}
if(rowData.userType == '7'){
str = "授权KOL";
}
return str;
}
align: "left"
},{
title: "发布时间",
field: "publishTime",
... ...