一些無用的改動
This commit is contained in:
parent
8af8d1282f
commit
c009850d30
|
@ -47,7 +47,7 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ActHistoryService {
|
public class ActHistoryService {
|
||||||
private static Logger logger = LoggerFactory.getLogger(ActHistoryService.class);
|
private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected RepositoryService repositoryService;
|
protected RepositoryService repositoryService;
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
/**
|
package io.renren.modules.notice.enums;
|
||||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* https://www.renren.io
|
|
||||||
* <p>
|
|
||||||
* 版权所有,侵权必究!
|
|
||||||
*/package io.renren.modules.notice.enums;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知阅读状态枚举
|
* 通知阅读状态枚举
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
/**
|
package io.renren.modules.notice.enums;
|
||||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* https://www.renren.io
|
|
||||||
* <p>
|
|
||||||
* 版权所有,侵权必究!
|
|
||||||
*/package io.renren.modules.notice.enums;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知状态枚举
|
* 通知状态枚举
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
/**
|
package io.renren.modules.notice.enums;
|
||||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* https://www.renren.io
|
|
||||||
* <p>
|
|
||||||
* 版权所有,侵权必究!
|
|
||||||
*/package io.renren.modules.notice.enums;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接受者类型枚举
|
* 接受者类型枚举
|
||||||
|
|
|
@ -41,6 +41,7 @@ import java.util.Map;
|
||||||
@RequestMapping("/resource")
|
@RequestMapping("/resource")
|
||||||
@Api(tags = "资源表")
|
@Api(tags = "资源表")
|
||||||
public class ResourceController {
|
public class ResourceController {
|
||||||
|
|
||||||
@Value("${qdyjj.ipAndPort}")
|
@Value("${qdyjj.ipAndPort}")
|
||||||
private String ipAndPort;
|
private String ipAndPort;
|
||||||
|
|
||||||
|
@ -77,7 +78,7 @@ public class ResourceController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RestTemplate restTemplate;
|
private RestTemplate restTemplate;
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(ResourceController.class);
|
private static final Logger logger = LoggerFactory.getLogger(ResourceController.class);
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@ApiOperation("分页查询资源信息")
|
@ApiOperation("分页查询资源信息")
|
||||||
|
@ -93,9 +94,7 @@ public class ResourceController {
|
||||||
})
|
})
|
||||||
public Result<PageData<ResourceDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
public Result<PageData<ResourceDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
PageData<ResourceDTO> page = resourceService.page(params);
|
PageData<ResourceDTO> page = resourceService.page(params);
|
||||||
page.getList().forEach(item -> {
|
page.getList().forEach(item -> item.setInfoList(resourceService.selectAttrsByResourceId(item.getId())));
|
||||||
item.setInfoList(resourceService.selectAttrsByResourceId(item.getId()));
|
|
||||||
});
|
|
||||||
return new Result<PageData<ResourceDTO>>().ok(page);
|
return new Result<PageData<ResourceDTO>>().ok(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +191,7 @@ public class ResourceController {
|
||||||
@LogOperation("修改")
|
@LogOperation("修改")
|
||||||
//@RequiresPermissions("resource:resource:update")
|
//@RequiresPermissions("resource:resource:update")
|
||||||
public Result update(@RequestBody ResourceDTO dto) {
|
public Result update(@RequestBody ResourceDTO dto) {
|
||||||
////效验数据
|
//效验数据
|
||||||
//ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
//ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
resourceService.updateWithAttrs(dto);
|
resourceService.updateWithAttrs(dto);
|
||||||
|
|
|
@ -23,10 +23,7 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
|
||||||
|
|
||||||
List<ResourceDTO> selectWithAttrs(@Param("dto") ResourceDTO resourceDTO,
|
List<ResourceDTO> selectWithAttrs(@Param("dto") ResourceDTO resourceDTO,
|
||||||
@Param("orderField") String orderField,
|
@Param("orderField") String orderField,
|
||||||
@Param("orderType") String orderType,
|
@Param("orderType") String orderType);
|
||||||
@Param("pageNum") Integer pageNum,
|
|
||||||
@Param("pageSize") Integer pageSize
|
|
||||||
);
|
|
||||||
|
|
||||||
List<Map> selectTypeCount();
|
List<Map> selectTypeCount();
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEntity, ResourceDTO> implements ResourceService {
|
public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEntity, ResourceDTO> implements ResourceService {
|
||||||
private static Logger logger = LoggerFactory.getLogger(ResourceServiceImpl.class);
|
private static final Logger logger = LoggerFactory.getLogger(ResourceServiceImpl.class);
|
||||||
@Value("${zsk.appid}")
|
@Value("${zsk.appid}")
|
||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
|
@ -143,6 +143,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
BeanUtils.copyProperties(dto, resourceEntity);
|
BeanUtils.copyProperties(dto, resourceEntity);
|
||||||
Long resourceID = IdWorker.getId(resourceEntity);
|
Long resourceID = IdWorker.getId(resourceEntity);
|
||||||
resourceEntity.setId(resourceID);
|
resourceEntity.setId(resourceID);
|
||||||
|
resourceEntity.setVisits(0L);
|
||||||
if (dto.getDelFlag() == null) {
|
if (dto.getDelFlag() == null) {
|
||||||
resourceEntity.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag());
|
resourceEntity.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag());
|
||||||
}
|
}
|
||||||
|
@ -215,13 +216,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
Page<ResourceDTO> resultPage = new Page<>(pageNum, pageSize);
|
Page<ResourceDTO> resultPage = new Page<>(pageNum, pageSize);
|
||||||
if (resourceDTO.getInfoList().isEmpty()) {
|
if (resourceDTO.getInfoList().isEmpty()) {
|
||||||
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
|
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
|
||||||
//resourceDTOS.forEach(item -> {
|
|
||||||
// item.setInfoList(this.selectAttrsByResourceId(item.getId()));
|
|
||||||
//});
|
|
||||||
resultPage.setRecords(resourceDTOS);
|
resultPage.setRecords(resourceDTOS);
|
||||||
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
|
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
|
||||||
} else {
|
} else {
|
||||||
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType, (pageNum - 1) * pageSize, pageSize);
|
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType);
|
||||||
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
|
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
|
||||||
if (resourceDTOS.isEmpty()) {
|
if (resourceDTOS.isEmpty()) {
|
||||||
resultPage.setRecords(null);
|
resultPage.setRecords(null);
|
||||||
|
@ -302,7 +300,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
@Override
|
@Override
|
||||||
public Object selectRecommend() {
|
public Object selectRecommend() {
|
||||||
Long userId = SecurityUser.getUser().getId();
|
Long userId = SecurityUser.getUser().getId();
|
||||||
//根据用户收藏和申请数据查出应用领域排名,在根据应用领域查询热门能力推荐给用户
|
//根据用户收藏和申请数据查出应用领域排名,再根据应用领域查询热门能力推荐给用户
|
||||||
List<Map> applyAreaList = resourceDao.selectApplyArea(userId);
|
List<Map> applyAreaList = resourceDao.selectApplyArea(userId);
|
||||||
//没有收藏和申请过,按最热能力选取,否则根据应用领域最多类型推荐
|
//没有收藏和申请过,按最热能力选取,否则根据应用领域最多类型推荐
|
||||||
JSONObject object = new JSONObject();
|
JSONObject object = new JSONObject();
|
||||||
|
@ -324,19 +322,19 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
jsonObject.put("pageSize", 9);
|
jsonObject.put("pageSize", 9);
|
||||||
jsonObject.put("orderField", "total");
|
jsonObject.put("orderField", "total");
|
||||||
jsonObject.put("orderType", "DESC");
|
jsonObject.put("orderType", "DESC");
|
||||||
Page<ResourceDTO> Page = (Page<ResourceDTO>) this.pageWithAttrs(jsonObject);
|
Page<ResourceDTO> page = (Page<ResourceDTO>) this.pageWithAttrs(jsonObject);
|
||||||
//若查出数据不足9条则在热门能力补充缺少的数量
|
//若查出数据不足9条则在热门能力补充缺少的数量
|
||||||
if (Page.getRecords().size() < 9) {
|
if (page.getRecords().size() < 9) {
|
||||||
for (int i = 0; Page.getRecords().size() < 9; i++) {
|
for (int i = 0; page.getRecords().size() < 9; i++) {
|
||||||
for (int j = 0; j < Page.getRecords().size(); j++) {
|
for (int j = 0; j < page.getRecords().size(); j++) {
|
||||||
if (!Page.getRecords().get(j).getId().equals(resultPage.getRecords().get(i).getId())) {
|
if (!page.getRecords().get(j).getId().equals(resultPage.getRecords().get(i).getId())) {
|
||||||
Page.getRecords().add(resultPage.getRecords().get(i));
|
page.getRecords().add(resultPage.getRecords().get(i));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Page;
|
return page;
|
||||||
} else {
|
} else {
|
||||||
return resultPage;
|
return resultPage;
|
||||||
}
|
}
|
||||||
|
@ -344,8 +342,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getAmountGroupByType() {
|
public List<Map<String, Object>> getAmountGroupByType() {
|
||||||
List<Map<String, Object>> amountInfo = resourceDao.getAmountGroupByType();
|
return resourceDao.getAmountGroupByType();
|
||||||
return amountInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -374,9 +371,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("type", item.getKey());
|
map.put("type", item.getKey());
|
||||||
map.put("total", resourceDao.selectTypeCountByDept(item.getKey(), jsonObject.getString("type")));
|
map.put("total", resourceDao.selectTypeCountByDept(item.getKey(), jsonObject.getString("type")));
|
||||||
item.getValue().forEach(item1 -> {
|
item.getValue().forEach(item1 -> item1.remove("type"));
|
||||||
item1.remove("type");
|
|
||||||
});
|
|
||||||
map.put("dataList", item.getValue());
|
map.put("dataList", item.getValue());
|
||||||
resultList.add(map);
|
resultList.add(map);
|
||||||
});
|
});
|
||||||
|
@ -387,14 +382,12 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
areaMap.put("type", "区级");
|
areaMap.put("type", "区级");
|
||||||
areaMap.put("total", resourceDao.selectTypeCountByDept("区级", jsonObject.getString("type")));
|
areaMap.put("total", resourceDao.selectTypeCountByDept("区级", jsonObject.getString("type")));
|
||||||
ArrayList<Map> areaListTemp = new ArrayList<>();
|
ArrayList<Map> areaListTemp = new ArrayList<>();
|
||||||
areaTypeList.orElse(new HashMap<>()).entrySet().stream().forEach(item -> {
|
areaTypeList.orElse(new HashMap<>()).forEach((key, value) -> {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("type", item.getKey());
|
map.put("type", key);
|
||||||
map.put("total", resourceDao.selectTypeCountByDist(item.getKey(), jsonObject.getString("type")));
|
map.put("total", resourceDao.selectTypeCountByDist(key, jsonObject.getString("type")));
|
||||||
item.getValue().forEach(item1 -> {
|
value.forEach(item1 -> item1.remove("type"));
|
||||||
item1.remove("type");
|
map.put("dataList", value);
|
||||||
});
|
|
||||||
map.put("dataList", item.getValue());
|
|
||||||
areaListTemp.add(map);
|
areaListTemp.add(map);
|
||||||
});
|
});
|
||||||
areaMap.put("dataList", areaListTemp);
|
areaMap.put("dataList", areaListTemp);
|
||||||
|
@ -428,13 +421,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
List<Map> deptTypeCount = resourceDao.selectDeptTypeCount();
|
List<Map> deptTypeCount = resourceDao.selectDeptTypeCount();
|
||||||
map.entrySet().forEach(item -> {
|
map.entrySet().forEach(item -> deptTypeCount.forEach(index -> {
|
||||||
deptTypeCount.forEach(index -> {
|
if (index.get("type").equals(item.getKey())) {
|
||||||
if (index.get("type").equals(item.getKey())) {
|
item.setValue(index.get("count"));
|
||||||
item.setValue(index.get("count"));
|
}
|
||||||
}
|
}));
|
||||||
});
|
|
||||||
});
|
|
||||||
resultMap.put("deptTypeCount", map);
|
resultMap.put("deptTypeCount", map);
|
||||||
List<Map> deptTotalCount = resourceDao.selectDeptTotalCount();
|
List<Map> deptTotalCount = resourceDao.selectDeptTotalCount();
|
||||||
HashMap<String, Object> map1 = new HashMap() {
|
HashMap<String, Object> map1 = new HashMap() {
|
||||||
|
@ -446,13 +437,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
put("20", 0);
|
put("20", 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
map1.entrySet().forEach(item -> {
|
map1.entrySet().forEach(item -> deptTotalCount.forEach(index -> {
|
||||||
deptTotalCount.forEach(index -> {
|
if (index.get("type").equals(item.getKey())) {
|
||||||
if (index.get("type").equals(item.getKey())) {
|
item.setValue(index.get("total"));
|
||||||
item.setValue(index.get("total"));
|
}
|
||||||
}
|
}));
|
||||||
});
|
|
||||||
});
|
|
||||||
resultMap.put("deptTotalCount", map1);
|
resultMap.put("deptTotalCount", map1);
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
@ -515,9 +504,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
typeCountListMap.forEach((k, v) -> {
|
typeCountListMap.forEach((k, v) -> {
|
||||||
HashMap<Object, Object> map = new HashMap<>();
|
HashMap<Object, Object> map = new HashMap<>();
|
||||||
map.put("name", k);
|
map.put("name", k);
|
||||||
v.forEach(item -> {
|
v.forEach(item -> map.put(item.get("type").toString(), item.get("count")));
|
||||||
map.put(item.get("type").toString(), item.get("count"));
|
|
||||||
});
|
|
||||||
resultList.add(map);
|
resultList.add(map);
|
||||||
});
|
});
|
||||||
return resultList;
|
return resultList;
|
||||||
|
@ -531,9 +518,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
typeCountListMap.forEach((k, v) -> {
|
typeCountListMap.forEach((k, v) -> {
|
||||||
HashMap<Object, Object> map = new HashMap<>();
|
HashMap<Object, Object> map = new HashMap<>();
|
||||||
map.put("name", k);
|
map.put("name", k);
|
||||||
v.forEach(item -> {
|
v.forEach(item -> map.put(item.get("type").toString(), item.get("count")));
|
||||||
map.put(item.get("type").toString(), item.get("count"));
|
|
||||||
});
|
|
||||||
resultList.add(map);
|
resultList.add(map);
|
||||||
});
|
});
|
||||||
return resultList;
|
return resultList;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
|
||||||
*/
|
*/
|
||||||
@Component("knowledgeBaseTask")
|
@Component("knowledgeBaseTask")
|
||||||
public class KnowledgeBaseTask implements ITask {
|
public class KnowledgeBaseTask implements ITask {
|
||||||
private static Logger logger = LoggerFactory.getLogger(KnowledgeBaseTask.class);
|
private static final Logger logger = LoggerFactory.getLogger(KnowledgeBaseTask.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResourceService resourceService;
|
private ResourceService resourceService;
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,12 @@ package io.renren.modules.resourceBrowse.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.renren.common.service.impl.CrudServiceImpl;
|
import io.renren.common.service.impl.CrudServiceImpl;
|
||||||
import io.renren.common.constant.Constant;
|
|
||||||
import io.renren.common.utils.DateUtils;
|
import io.renren.common.utils.DateUtils;
|
||||||
import io.renren.modules.resourceBrowse.dao.ResourceBrowseDao;
|
import io.renren.modules.resourceBrowse.dao.ResourceBrowseDao;
|
||||||
import io.renren.modules.resourceBrowse.dto.ResourceBrowseDTO;
|
import io.renren.modules.resourceBrowse.dto.ResourceBrowseDTO;
|
||||||
import io.renren.modules.resourceBrowse.entity.ResourceBrowseEntity;
|
import io.renren.modules.resourceBrowse.entity.ResourceBrowseEntity;
|
||||||
import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
|
import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
|
||||||
import io.renren.modules.security.user.SecurityUser;
|
import io.renren.modules.security.user.SecurityUser;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -64,12 +62,12 @@ public class ResourceBrowseServiceImpl extends CrudServiceImpl<ResourceBrowseDao
|
||||||
startDay = DateUtils.addDateDays(startDay, 1);
|
startDay = DateUtils.addDateDays(startDay, 1);
|
||||||
}
|
}
|
||||||
ArrayList<Map<String, Object>> resultMap = new ArrayList<>();
|
ArrayList<Map<String, Object>> resultMap = new ArrayList<>();
|
||||||
for (int i = 0; i < dayList.size(); i++) {
|
for (String s : dayList) {
|
||||||
HashMap<String, Object> dayMap = new HashMap<>();
|
HashMap<String, Object> dayMap = new HashMap<>();
|
||||||
dayMap.put(dayList.get(i), 0);
|
dayMap.put(s, 0);
|
||||||
for (Map map : maps) {
|
for (Map map : maps) {
|
||||||
if (dayList.get(i).equals(map.get("date"))) {
|
if (s.equals(map.get("date"))) {
|
||||||
dayMap.put(dayList.get(i), map.get("count"));
|
dayMap.put(s, map.get("count"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resultMap.add(dayMap);
|
resultMap.add(dayMap);
|
||||||
|
|
|
@ -4,20 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.renren.common.service.impl.CrudServiceImpl;
|
import io.renren.common.service.impl.CrudServiceImpl;
|
||||||
import io.renren.common.constant.Constant;
|
|
||||||
import io.renren.modules.resource.service.ResourceService;
|
import io.renren.modules.resource.service.ResourceService;
|
||||||
import io.renren.modules.resourceCar.dto.ResourceCarDTO;
|
|
||||||
import io.renren.modules.resourceCollection.dao.ResourceCollectionDao;
|
import io.renren.modules.resourceCollection.dao.ResourceCollectionDao;
|
||||||
import io.renren.modules.resourceCollection.dto.ResourceCollectionDTO;
|
import io.renren.modules.resourceCollection.dto.ResourceCollectionDTO;
|
||||||
import io.renren.modules.resourceCollection.entity.ResourceCollectionEntity;
|
import io.renren.modules.resourceCollection.entity.ResourceCollectionEntity;
|
||||||
import io.renren.modules.resourceCollection.service.ResourceCollectionService;
|
import io.renren.modules.resourceCollection.service.ResourceCollectionService;
|
||||||
import io.renren.modules.security.user.SecurityUser;
|
import io.renren.modules.security.user.SecurityUser;
|
||||||
import io.renren.modules.security.user.UserDetail;
|
import io.renren.modules.security.user.UserDetail;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.ObjectUtils;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -52,9 +48,7 @@ public class ResourceCollectionServiceImpl extends CrudServiceImpl<ResourceColle
|
||||||
Page<ResourceCollectionDTO> page = new Page(pageNum, pageSize);
|
Page<ResourceCollectionDTO> page = new Page(pageNum, pageSize);
|
||||||
params.put("userId", user.getId());
|
params.put("userId", user.getId());
|
||||||
List<ResourceCollectionDTO> resourceCollectionDTOS = resourceCollectionDao.selectPageWithResource(params, (pageNum - 1) * pageSize, pageSize);
|
List<ResourceCollectionDTO> resourceCollectionDTOS = resourceCollectionDao.selectPageWithResource(params, (pageNum - 1) * pageSize, pageSize);
|
||||||
resourceCollectionDTOS.forEach(item -> {
|
resourceCollectionDTOS.forEach(item -> item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId())));
|
||||||
item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId()));
|
|
||||||
});
|
|
||||||
List<ResourceCollectionDTO> resourceCollectionDTOSs = resourceCollectionDao.selectPageWithResource(params, 0, 100000);
|
List<ResourceCollectionDTO> resourceCollectionDTOSs = resourceCollectionDao.selectPageWithResource(params, 0, 100000);
|
||||||
page.setRecords(resourceCollectionDTOS);
|
page.setRecords(resourceCollectionDTOS);
|
||||||
page.setTotal(resourceCollectionDTOSs.size());
|
page.setTotal(resourceCollectionDTOSs.size());
|
||||||
|
|
|
@ -3,14 +3,10 @@ package io.renren.modules.workDynamics.service.impl;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.renren.common.service.impl.CrudServiceImpl;
|
import io.renren.common.service.impl.CrudServiceImpl;
|
||||||
import io.renren.common.constant.Constant;
|
|
||||||
import io.renren.modules.workDynamics.dao.WorkDynamicsDao;
|
import io.renren.modules.workDynamics.dao.WorkDynamicsDao;
|
||||||
import io.renren.modules.workDynamics.dto.WorkDynamicsDTO;
|
import io.renren.modules.workDynamics.dto.WorkDynamicsDTO;
|
||||||
import io.renren.modules.workDynamics.entity.WorkDynamicsEntity;
|
import io.renren.modules.workDynamics.entity.WorkDynamicsEntity;
|
||||||
import io.renren.modules.workDynamics.service.WorkDynamicsService;
|
import io.renren.modules.workDynamics.service.WorkDynamicsService;
|
||||||
import io.renren.modules.security.user.SecurityUser;
|
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
/**
|
|
||||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* https://www.renren.io
|
|
||||||
* <p>
|
|
||||||
* 版权所有,侵权必究!
|
|
||||||
*/
|
|
||||||
package io.renren.websocket;
|
package io.renren.websocket;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
@ -31,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
@Component
|
@Component
|
||||||
@ServerEndpoint(value = "/websocket", configurator = WebSocketConfig.class)
|
@ServerEndpoint(value = "/websocket", configurator = WebSocketConfig.class)
|
||||||
public class WebSocketServer {
|
public class WebSocketServer {
|
||||||
private static Logger logger = LoggerFactory.getLogger(WebSocketServer.class);
|
private static final Logger logger = LoggerFactory.getLogger(WebSocketServer.class);
|
||||||
|
|
||||||
public WebSocketServer() {
|
public WebSocketServer() {
|
||||||
logger.info("-------------websocket----------------");
|
logger.info("-------------websocket----------------");
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
/**
|
package io.renren.websocket.config;
|
||||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* https://www.renren.io
|
|
||||||
* <p>
|
|
||||||
* 版权所有,侵权必究!
|
|
||||||
*/package io.renren.websocket.config;
|
|
||||||
|
|
||||||
import io.renren.common.constant.Constant;
|
import io.renren.common.constant.Constant;
|
||||||
import io.renren.modules.security.user.SecurityUser;
|
import io.renren.modules.security.user.SecurityUser;
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
/**
|
package io.renren.websocket.data;
|
||||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* https://www.renren.io
|
|
||||||
* <p>
|
|
||||||
* 版权所有,侵权必究!
|
|
||||||
*/package io.renren.websocket.data;
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
/**
|
package io.renren.websocket.data;
|
||||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
|
||||||
* <p>
|
|
||||||
* https://www.renren.io
|
|
||||||
* <p>
|
|
||||||
* 版权所有,侵权必究!
|
|
||||||
*/package io.renren.websocket.data;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
|
@ -87,6 +87,7 @@ system:
|
||||||
|
|
||||||
yawei:
|
yawei:
|
||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
#知识库
|
#知识库
|
||||||
zsk:
|
zsk:
|
||||||
url:
|
url:
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
====================================================================================================================
|
.----------------. .----------------. .----------------. .----------------. .----------------.
|
||||||
|
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
|
||||||
欢迎使用 renren-security 人人权限专业版 - Powered By https://www.renren.io
|
| | ____ ____ | || | _________ | || | ____ ____ | || | ________ | || | ________ | |
|
||||||
|
| | |_ _||_ _| | || | | _ _ | | || | |_ || _| | || | |_ ___ `. | || | | __ _| | |
|
||||||
====================================================================================================================
|
| | \ \ / / | || | |_/ | | \_| | || | | |__| | | || | | | `. \ | || | |_/ / / | |
|
||||||
|
| | \ \/ / | || | | | | || | | __ | | || | | | | | | || | .'.' _ | |
|
||||||
|
| | _| |_ | || | _| |_ | || | _| | | |_ | || | _| |___.' / | || | _/ /__/ | | |
|
||||||
|
| | |______| | || | |_____| | || | |____||____| | || | |________.' | || | |________| | |
|
||||||
|
| | | || | | || | | || | | || | | |
|
||||||
|
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
|
||||||
|
'----------------' '----------------' '----------------' '----------------' '----------------'
|
|
@ -121,10 +121,11 @@
|
||||||
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag
|
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag
|
||||||
= 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
= 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, user_id, ( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"
|
LEFT JOIN ( SELECT resource_id, user_id, ( IF(COUNT( id ) = 1, 'true', 'false') ) AS "isCollect"
|
||||||
FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY resource_id
|
FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY resource_id
|
||||||
) trc2 ON tdr.id = trc2.resource_id
|
) trc2 ON tdr.id = trc2.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, user_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator}
|
LEFT JOIN ( SELECT resource_id, user_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0
|
||||||
|
AND user_id = #{dto.creator}
|
||||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
||||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -251,14 +252,17 @@
|
||||||
( taa2.approve_status < 1, '未申请', "已申请" ) AS "applyState"
|
( taa2.approve_status < 1, '未申请', "已申请" ) AS "applyState"
|
||||||
FROM
|
FROM
|
||||||
tb_data_resource tdr
|
tb_data_resource tdr
|
||||||
LEFT JOIN ( SELECT resource_id, AVG( score ) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trs ON tdr.id = trs.resource_id
|
LEFT JOIN ( SELECT resource_id, AVG( score ) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0
|
||||||
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
GROUP BY resource_id ) trs ON tdr.id = trs.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag
|
||||||
|
= 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
||||||
|
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND
|
||||||
|
del_flag = 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
resource_id,
|
resource_id,
|
||||||
user_id,
|
user_id,
|
||||||
( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"
|
( IF(COUNT( id ) = 1, 'true', 'false') ) AS "isCollect"
|
||||||
FROM
|
FROM
|
||||||
tb_resource_collection
|
tb_resource_collection
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -268,7 +272,8 @@
|
||||||
GROUP BY
|
GROUP BY
|
||||||
resource_id
|
resource_id
|
||||||
) trc2 ON tdr.id = trc2.resource_id
|
) trc2 ON tdr.id = trc2.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{userId} GROUP BY resource_id ) taa2 ON tdr.id = taa2.resource_id
|
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
|
||||||
|
AND del_flag = 0 AND user_id = #{userId} GROUP BY resource_id ) taa2 ON tdr.id = taa2.resource_id
|
||||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
|
@ -293,10 +298,11 @@
|
||||||
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag
|
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag
|
||||||
= 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
= 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, user_id, ( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"
|
LEFT JOIN ( SELECT resource_id, user_id, ( IF(COUNT( id ) = 1, 'true', 'false') ) AS "isCollect"
|
||||||
FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator}
|
FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator}
|
||||||
GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id
|
GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id
|
||||||
LEFT JOIN ( SELECT DISTINCT resource_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator}
|
LEFT JOIN ( SELECT DISTINCT resource_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0
|
||||||
|
AND user_id = #{dto.creator}
|
||||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
||||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -412,12 +418,12 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
*
|
type,
|
||||||
|
deptCount
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
||||||
sd.NAME AS "deptName",
|
|
||||||
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
|
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
|
||||||
FROM
|
FROM
|
||||||
sys_dept sd
|
sys_dept sd
|
||||||
|
@ -451,15 +457,13 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
*
|
type, deptCount, districtName
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
||||||
sd.NAME AS "deptName",
|
|
||||||
IFNULL( tdr.deptCount, 0) AS "deptCount",
|
IFNULL( tdr.deptCount, 0) AS "deptCount",
|
||||||
IFNULL(sr.name, '暂无该地区') AS "districtName",
|
IFNULL(sr.name, '暂无该地区') AS "districtName",
|
||||||
sr.id AS "districtId"
|
|
||||||
FROM
|
FROM
|
||||||
sys_dept sd
|
sys_dept sd
|
||||||
LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource
|
LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource
|
||||||
|
@ -609,8 +613,7 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
COUNT( id ) AS "count",
|
COUNT( id ) AS "count"
|
||||||
dept_id
|
|
||||||
FROM
|
FROM
|
||||||
tb_data_resource
|
tb_data_resource
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -673,8 +676,7 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
COUNT( taa.id ) AS "count",
|
COUNT( taa.id ) AS "count"
|
||||||
su.dept_id
|
|
||||||
FROM
|
FROM
|
||||||
t_ability_application taa,
|
t_ability_application taa,
|
||||||
sys_user su
|
sys_user su
|
||||||
|
@ -787,7 +789,7 @@
|
||||||
SELECT
|
SELECT
|
||||||
MAX( count ) AS "total"
|
MAX( count ) AS "total"
|
||||||
FROM
|
FROM
|
||||||
( SELECT COUNT( id ) AS "count", type FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp2
|
( SELECT COUNT( id ) AS "count" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp2
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue