Commit 15932139 by shenjunjie

Merge branch 'feature' into 'dev'

恢复渠道统计

See merge request !36
parents 3b0a4cb0 db6bc9bd
......@@ -22,7 +22,7 @@ import java.util.Date;
public class UserRole {
// 默认绑定阿里项目
private final static String DEFAULT_PROJECT_ID = "627a0880abed6402f00039ef";
private final static String DEFAULT_PROJECT_ID = "62beadd1bbf8eb20f96d2f1c";
// 默认导出1000
private final static int DEFAULT_EXPORT_LIMIT = 1000;
// 默认角色ID
......
......@@ -1814,7 +1814,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
long total = mediaTypeMap.values().stream().mapToLong(v -> v).sum();
mediaTypeMap.forEach((percentName, size) -> {
mediaTypePercent.put(percentName, (double) size / total);
mediaTypePercent.put(percentName, (double) size / total == 0 ? 1 : total);
});
return mediaTypePercent;
}
......
......@@ -241,6 +241,8 @@ public class ReportServiceImpl implements ReportService {
@Override
public PageVO<JSONObject> findReportList(ReportSearchDTO reportSearch) {
Criteria criteria = new Criteria();
// 项目限制
criteria.and("projectId").is(UserThreadLocal.getProjectId());
if (null != reportSearch.getStartTime()) {
criteria.and("startTime").gte(reportSearch.getStartTime());
}
......
......@@ -100,8 +100,7 @@ public class TaskServiceImpl implements TaskService {
// 替换成新的记录map
channelIndexRecordMap = newRecordMap;
ListUtils.partition(insertList, 1000).forEach(list -> {
// TODO 2
// channelDao.insertMany(list);
channelDao.insertMany(list);
});
log.info("渠道统计-渠道总计-录入完毕,新增渠道{}条,更新渠道{}条", insertList.size(), channelIndexRecordMap.size() - insertList.size());
// 获得单位时间内最小最大时间戳
......@@ -123,8 +122,7 @@ public class TaskServiceImpl implements TaskService {
insertList.add(channelService.calculateChannelEmotionIndex(channel));
} else {
channel.setRecord(entry.getValue());
// TODO 2
// channelDao.updateOne(channelService.calculateChannelEmotionIndex(channel));
channelDao.updateOne(channelService.calculateChannelEmotionIndex(channel));
}
// 设置查询数值
entry.getKey().setChannelInfo(channel);
......
......@@ -214,16 +214,16 @@ public class UserServiceImpl implements UserService {
if (userOld.isBindUser()) {
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());
if (null == user) {
// 通过用户中心查询
CenterUser centerUser = userInfoClient.getUserById(Integer.parseInt(UserThreadLocal.getUserId()));
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()) {
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