Commit 15932139 by shenjunjie

Merge branch 'feature' into 'dev'

恢复渠道统计

See merge request !36
parents 3b0a4cb0 db6bc9bd
...@@ -22,7 +22,7 @@ import java.util.Date; ...@@ -22,7 +22,7 @@ import java.util.Date;
public class UserRole { public class UserRole {
// 默认绑定阿里项目 // 默认绑定阿里项目
private final static String DEFAULT_PROJECT_ID = "627a0880abed6402f00039ef"; private final static String DEFAULT_PROJECT_ID = "62beadd1bbf8eb20f96d2f1c";
// 默认导出1000 // 默认导出1000
private final static int DEFAULT_EXPORT_LIMIT = 1000; private final static int DEFAULT_EXPORT_LIMIT = 1000;
// 默认角色ID // 默认角色ID
......
...@@ -1814,7 +1814,7 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -1814,7 +1814,7 @@ public class MarkDataServiceImpl implements MarkDataService {
} }
long total = mediaTypeMap.values().stream().mapToLong(v -> v).sum(); long total = mediaTypeMap.values().stream().mapToLong(v -> v).sum();
mediaTypeMap.forEach((percentName, size) -> { mediaTypeMap.forEach((percentName, size) -> {
mediaTypePercent.put(percentName, (double) size / total); mediaTypePercent.put(percentName, (double) size / total == 0 ? 1 : total);
}); });
return mediaTypePercent; return mediaTypePercent;
} }
......
...@@ -241,6 +241,8 @@ public class ReportServiceImpl implements ReportService { ...@@ -241,6 +241,8 @@ public class ReportServiceImpl implements ReportService {
@Override @Override
public PageVO<JSONObject> findReportList(ReportSearchDTO reportSearch) { public PageVO<JSONObject> findReportList(ReportSearchDTO reportSearch) {
Criteria criteria = new Criteria(); Criteria criteria = new Criteria();
// 项目限制
criteria.and("projectId").is(UserThreadLocal.getProjectId());
if (null != reportSearch.getStartTime()) { if (null != reportSearch.getStartTime()) {
criteria.and("startTime").gte(reportSearch.getStartTime()); criteria.and("startTime").gte(reportSearch.getStartTime());
} }
......
...@@ -100,8 +100,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -100,8 +100,7 @@ public class TaskServiceImpl implements TaskService {
// 替换成新的记录map // 替换成新的记录map
channelIndexRecordMap = newRecordMap; channelIndexRecordMap = newRecordMap;
ListUtils.partition(insertList, 1000).forEach(list -> { ListUtils.partition(insertList, 1000).forEach(list -> {
// TODO 2 channelDao.insertMany(list);
// channelDao.insertMany(list);
}); });
log.info("渠道统计-渠道总计-录入完毕,新增渠道{}条,更新渠道{}条", insertList.size(), channelIndexRecordMap.size() - insertList.size()); log.info("渠道统计-渠道总计-录入完毕,新增渠道{}条,更新渠道{}条", insertList.size(), channelIndexRecordMap.size() - insertList.size());
// 获得单位时间内最小最大时间戳 // 获得单位时间内最小最大时间戳
...@@ -123,8 +122,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -123,8 +122,7 @@ public class TaskServiceImpl implements TaskService {
insertList.add(channelService.calculateChannelEmotionIndex(channel)); insertList.add(channelService.calculateChannelEmotionIndex(channel));
} else { } else {
channel.setRecord(entry.getValue()); channel.setRecord(entry.getValue());
// TODO 2 channelDao.updateOne(channelService.calculateChannelEmotionIndex(channel));
// channelDao.updateOne(channelService.calculateChannelEmotionIndex(channel));
} }
// 设置查询数值 // 设置查询数值
entry.getKey().setChannelInfo(channel); entry.getKey().setChannelInfo(channel);
......
...@@ -214,16 +214,16 @@ public class UserServiceImpl implements UserService { ...@@ -214,16 +214,16 @@ public class UserServiceImpl implements UserService {
if (userOld.isBindUser()) { if (userOld.isBindUser()) {
ExceptionCast.cast(CommonCodeEnum.INVALID_PARAM.message("该账号已被绑定")); ExceptionCast.cast(CommonCodeEnum.INVALID_PARAM.message("该账号已被绑定"));
} }
List<UserProjectOldDaoImpl.UserProjectOld> userProjects = userProjectOldDao.findListByKeywordFuzz(new Query(Criteria.where("userId").is(userOld.getId())), null, null);
if (null == userProjects) {
ExceptionCast.cast(CommonCodeEnum.FAIL);
}
User user = userDao.findOneById(UserThreadLocal.getUserId()); User user = userDao.findOneById(UserThreadLocal.getUserId());
if (null == user) { if (null == user) {
// 通过用户中心查询 // 通过用户中心查询
CenterUser centerUser = userInfoClient.getUserById(Integer.parseInt(UserThreadLocal.getUserId())); CenterUser centerUser = userInfoClient.getUserById(Integer.parseInt(UserThreadLocal.getUserId()));
user = User.createFromCenterUser(centerUser); user = User.createFromCenterUser(centerUser);
} }
List<UserProjectOldDaoImpl.UserProjectOld> userProjects = userProjectOldDao.findList(new Query(Criteria.where("userId").is(user.getId())));
if (userProjects.isEmpty()) {
ExceptionCast.cast(CommonCodeEnum.FAIL);
}
// 超级管理员 // 超级管理员
if (userOld.isSuperAdmin()) { if (userOld.isSuperAdmin()) {
user.setSuperAdmin(true); user.setSuperAdmin(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment