|
@@ -1,14 +1,24 @@
|
|
|
package cn.cslg.pas.service.common;
|
|
|
|
|
|
|
|
|
+import cn.cslg.pas.common.core.base.PatentDictionary;
|
|
|
import cn.cslg.pas.common.core.base.RedisConf;
|
|
|
+import cn.cslg.pas.common.dto.QueryFieldsDTO;
|
|
|
+import cn.cslg.pas.common.dto.patentCount.AddPatentCountDTO;
|
|
|
+import cn.cslg.pas.common.dto.patentCount.GetAllPatentCountDTO;
|
|
|
+import cn.cslg.pas.common.dto.patentCount.GetTabelColumDTO;
|
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.utils.*;
|
|
|
import cn.cslg.pas.common.dto.AddSelfFieldDTO;
|
|
|
+import cn.cslg.pas.common.vo.QueryFiledVO;
|
|
|
+import cn.cslg.pas.common.vo.QueryFieldsVO;
|
|
|
import cn.cslg.pas.common.vo.PersonSelfFieldVO;
|
|
|
+import cn.cslg.pas.common.vo.business.AllCustomFieldVO;
|
|
|
+import cn.cslg.pas.common.vo.patentCount.GetAllPatentCountVO;
|
|
|
import cn.cslg.pas.exception.UnLoginException;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.service.business.CommonService;
|
|
|
+import cn.cslg.pas.service.business.CustomFieldService;
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -28,7 +38,11 @@ public class PersonFieldService {
|
|
|
@Autowired
|
|
|
private LoginUtils loginUtils;
|
|
|
|
|
|
- public List<PersonSelfFieldVO> getCustomField(String tableName) {
|
|
|
+ @Autowired
|
|
|
+ private CustomFieldService customFieldService;
|
|
|
+
|
|
|
+
|
|
|
+ public List<PersonSelfFieldVO> getCustomField(String tableName, Integer projectId) {
|
|
|
|
|
|
//根据登录人id和type查询
|
|
|
PersonnelVO personnelVO = new PersonnelVO();
|
|
@@ -38,13 +52,20 @@ public class PersonFieldService {
|
|
|
throw new UnLoginException("未登录");
|
|
|
}
|
|
|
String userId = personnelVO.getId();
|
|
|
- String key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
|
|
|
+ String key = "";
|
|
|
+
|
|
|
+ if (projectId == null) {
|
|
|
+ key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
|
|
|
+ } else {
|
|
|
+ key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
|
|
|
+ }
|
|
|
+
|
|
|
String json = redisUtil.get(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key);
|
|
|
|
|
|
-// //如果查到
|
|
|
-// if (StringUtils.isNotEmpty(json)) {
|
|
|
-// return JsonUtils.jsonToList(json, PersonSelfFieldVO.class);
|
|
|
-// }
|
|
|
+ //如果查到
|
|
|
+ if (StringUtils.isNotEmpty(json)) {
|
|
|
+ return JsonUtils.jsonToList(json, PersonSelfFieldVO.class);
|
|
|
+ }
|
|
|
String fieldJson = "";
|
|
|
//如果没查询到,则获取所有栏位添加到redis里
|
|
|
try {
|
|
@@ -60,18 +81,31 @@ public class PersonFieldService {
|
|
|
if (fieldVOS == null || fieldVOS.size() == 0) {
|
|
|
throw new XiaoShiException("表中无字段");
|
|
|
}
|
|
|
- fieldVOS.forEach(item->{item.setCreateType(1);});
|
|
|
+ fieldVOS.forEach(item -> {
|
|
|
+ item.setCreateType(1);
|
|
|
+ });
|
|
|
+
|
|
|
+ //当tableName是patent时
|
|
|
+ if (PatentDictionary.NAME.equals(tableName)) {
|
|
|
+ //获得所有自定义字段
|
|
|
+ List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
|
|
|
+ if (allCustomFieldVOS.size() != 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
//装载顺序
|
|
|
Integer order = 0;
|
|
|
for (PersonSelfFieldVO item : fieldVOS) {
|
|
|
item.setOrder(order);
|
|
|
- if(item.getDefaultHidden()!=null&&item.getDefaultHidden().equals(true))
|
|
|
- { item.setIfHidden(true);}
|
|
|
- else{
|
|
|
- item.setIfHidden(false);}
|
|
|
+ if (item.getDefaultHidden() != null && item.getDefaultHidden().equals(true)) {
|
|
|
+ item.setIfHidden(true);
|
|
|
+ } else {
|
|
|
+ item.setIfHidden(false);
|
|
|
+ }
|
|
|
order++;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//保存到redis
|
|
|
redisUtil.set(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
|
|
|
|
|
@@ -92,14 +126,209 @@ public class PersonFieldService {
|
|
|
List<PersonSelfFieldVO> fieldVOS = JSON.parseArray(fieldJson, PersonSelfFieldVO.class);
|
|
|
fieldVOS = fieldVOS.stream().filter(item -> item.getIfShow().equals(true)).collect(Collectors.toList());
|
|
|
|
|
|
- for(PersonSelfFieldVO item:fieldVOS){
|
|
|
- PersonSelfFieldVO temVO= addSelfFieldDTO.getValue().stream().filter(tem->tem.getValue().equals(item.getValue())).findFirst().orElse(null);
|
|
|
- if(temVO==null){
|
|
|
- item.setIfHidden(true);
|
|
|
- }
|
|
|
- else {
|
|
|
- item.setIfHidden(temVO.getIfHidden());
|
|
|
- }
|
|
|
+ for (PersonSelfFieldVO item : fieldVOS) {
|
|
|
+ PersonSelfFieldVO temVO = addSelfFieldDTO.getValue().stream().filter(tem -> tem.getValue().equals(item.getValue())).findFirst().orElse(null);
|
|
|
+ if (temVO == null) {
|
|
|
+ item.setIfHidden(true);
|
|
|
+ } else {
|
|
|
+ item.setIfHidden(temVO.getIfHidden());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer order = 0;
|
|
|
+
|
|
|
+ for (PersonSelfFieldVO item : fieldVOS) {
|
|
|
+ item.setOrder(order);
|
|
|
+ order++;
|
|
|
+ }
|
|
|
+ redisUtil.set(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
|
|
|
+
|
|
|
+ return fieldVOS;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得查询的栏位
|
|
|
+ *
|
|
|
+ * @param queryFieldsDTOs
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<QueryFieldsVO> getQueryFields(List<QueryFieldsDTO> queryFieldsDTOs) {
|
|
|
+ List<QueryFieldsVO> queryFieldsVOS = new ArrayList<>();
|
|
|
+ queryFieldsDTOs.forEach(item -> {
|
|
|
+ String json = null;
|
|
|
+ try {
|
|
|
+ json = CommonService.readJsonFile(item.getTableName() + ".json");
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ Boolean flag = true;
|
|
|
+ if (json != null) {
|
|
|
+ QueryFieldsVO queryFieldsVO = new QueryFieldsVO();
|
|
|
+ queryFieldsVO.setTableName(item.getTableName());
|
|
|
+
|
|
|
+ List<QueryFiledVO> queryConditions = JSON.parseArray(json, QueryFiledVO.class);
|
|
|
+ //过滤出可查询的字段
|
|
|
+ List<QueryFiledVO> queryFiledVOList = queryConditions.stream().filter(i -> flag.equals(i.getIfSearch()) || flag.equals(i.getIfGroup())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //当是专利的配置时
|
|
|
+ if (item.getTableName().trim().equals(PatentDictionary.NAME)) {
|
|
|
+ //根据专题库id 查询所有自定义字段
|
|
|
+ List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(item.getProjectId());
|
|
|
+ //遍历装载
|
|
|
+ List<QueryFiledVO> queryFiledVOS = new ArrayList<>();
|
|
|
+ allCustomFieldVOS.forEach(i -> {
|
|
|
+ QueryFiledVO queryFieldsVO1 = new QueryFiledVO();
|
|
|
+ //装载名称
|
|
|
+ queryFieldsVO1.setName(i.getName());
|
|
|
+ //装载组别
|
|
|
+ queryFieldsVO1.setGroup("customField");
|
|
|
+ //装载类型
|
|
|
+ if (i.getType() <= 6) {
|
|
|
+ queryFieldsVO1.setFiledKind(0);
|
|
|
+ } else {
|
|
|
+ queryFieldsVO1.setFiledKind(i.getType());
|
|
|
+ }
|
|
|
+ //装载id
|
|
|
+ queryFieldsVO1.setField(i.getId().toString());
|
|
|
+ queryFiledVOS.add(queryFieldsVO1);
|
|
|
+ });
|
|
|
+ queryFiledVOList.addAll(queryFiledVOS);
|
|
|
+ }
|
|
|
+ queryFieldsVO.setConditionDTOList(queryFiledVOList);
|
|
|
+ queryFieldsVOS.add(queryFieldsVO);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return queryFieldsVOS;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询表格显示栏位
|
|
|
+ * @param getTabelColumDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<PersonSelfFieldVO> getTableColumns(GetTabelColumDTO getTabelColumDTO) {
|
|
|
+ Integer projectId = getTabelColumDTO.getProjectId();
|
|
|
+ Integer taskId = getTabelColumDTO.getTaskId();
|
|
|
+ String tableName = getTabelColumDTO.getTableName();
|
|
|
+ //根据登录人id和type查询
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
+ try {
|
|
|
+ personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new UnLoginException("未登录");
|
|
|
+ }
|
|
|
+ String userId = personnelVO.getId();
|
|
|
+ String key = "";
|
|
|
+
|
|
|
+ if (projectId == null) {
|
|
|
+ key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
|
|
|
+ } else {
|
|
|
+ key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
|
|
|
+ }
|
|
|
+
|
|
|
+ String json = redisUtil.get(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key);
|
|
|
+
|
|
|
+ //如果查到
|
|
|
+ if (StringUtils.isNotEmpty(json)) {
|
|
|
+ return JsonUtils.jsonToList(json, PersonSelfFieldVO.class);
|
|
|
+ }
|
|
|
+ String fieldJson = "";
|
|
|
+ //如果没查询到,则获取所有栏位添加到redis里
|
|
|
+ try {
|
|
|
+ fieldJson = CommonService.readJsonFile(tableName + ".json");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new XiaoShiException("不存在此表");
|
|
|
+ }
|
|
|
+ List<PersonSelfFieldVO> fieldVOS = JSON.parseArray(fieldJson, PersonSelfFieldVO.class);
|
|
|
+ if (fieldVOS == null) {
|
|
|
+ throw new XiaoShiException("不存在此表");
|
|
|
+ }
|
|
|
+ Boolean flag = true;
|
|
|
+ fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfShow())).collect(Collectors.toList());
|
|
|
+ if (fieldVOS == null || fieldVOS.size() == 0) {
|
|
|
+ throw new XiaoShiException("表中无字段");
|
|
|
+ }
|
|
|
+ fieldVOS.forEach(item -> {
|
|
|
+ item.setCreateType(1);
|
|
|
+ });
|
|
|
+
|
|
|
+ //当tableName是patent时
|
|
|
+ if (PatentDictionary.NAME.equals(tableName)) {
|
|
|
+ //获得所有自定义字段
|
|
|
+ List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
|
|
|
+ if (allCustomFieldVOS.size() != 0) {
|
|
|
+ for (AllCustomFieldVO item : allCustomFieldVOS) {
|
|
|
+ PersonSelfFieldVO personSelfFieldVO = new PersonSelfFieldVO();
|
|
|
+ personSelfFieldVO.setIfHidden(true);
|
|
|
+ personSelfFieldVO.setName(item.getName());
|
|
|
+ personSelfFieldVO.setType(item.getType().toString());
|
|
|
+ personSelfFieldVO.setValue(item.getId().toString());
|
|
|
+ personSelfFieldVO.setDefaultHidden(true);
|
|
|
+ fieldVOS.add(personSelfFieldVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //装载顺序
|
|
|
+ Integer order = 0;
|
|
|
+ for (PersonSelfFieldVO item : fieldVOS) {
|
|
|
+ item.setOrder(order);
|
|
|
+ if (item.getDefaultHidden() != null && item.getDefaultHidden().equals(true)) {
|
|
|
+ item.setIfHidden(true);
|
|
|
+ } else {
|
|
|
+ item.setIfHidden(false);
|
|
|
+ }
|
|
|
+ order++;
|
|
|
+ }
|
|
|
+
|
|
|
+ //保存到redis
|
|
|
+ redisUtil.set(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
|
|
|
+ return fieldVOS;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<PersonSelfFieldVO> setTableColumns(AddSelfFieldDTO addSelfFieldDTO) {
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
+ try {
|
|
|
+ personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new UnLoginException("未登录");
|
|
|
+ }
|
|
|
+ String userId = personnelVO.getId();
|
|
|
+ String tableName = addSelfFieldDTO.getTableName();
|
|
|
+ Integer projectId = addSelfFieldDTO.getProjectId();
|
|
|
+ String key = "";
|
|
|
+ if (projectId == null) {
|
|
|
+ key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
|
|
|
+ } else {
|
|
|
+ key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
|
|
|
+ }
|
|
|
+ String fieldJson = CommonService.readJsonFile(addSelfFieldDTO.getTableName() + ".json");
|
|
|
+ List<PersonSelfFieldVO> fieldVOS = JSON.parseArray(fieldJson, PersonSelfFieldVO.class);
|
|
|
+ fieldVOS = fieldVOS.stream().filter(item -> item.getIfShow().equals(true)).collect(Collectors.toList());
|
|
|
+ //当tableName是patent时
|
|
|
+ if (PatentDictionary.NAME.equals(tableName)) {
|
|
|
+ //获得所有自定义字段
|
|
|
+ List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
|
|
|
+ if (allCustomFieldVOS.size() != 0) {
|
|
|
+ for (AllCustomFieldVO item : allCustomFieldVOS) {
|
|
|
+ PersonSelfFieldVO personSelfFieldVO = new PersonSelfFieldVO();
|
|
|
+ personSelfFieldVO.setIfHidden(true);
|
|
|
+ personSelfFieldVO.setName(item.getName());
|
|
|
+ personSelfFieldVO.setType(item.getType().toString());
|
|
|
+ personSelfFieldVO.setValue(item.getId().toString());
|
|
|
+ personSelfFieldVO.setDefaultHidden(true);
|
|
|
+ fieldVOS.add(personSelfFieldVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (PersonSelfFieldVO item : fieldVOS) {
|
|
|
+ PersonSelfFieldVO temVO = addSelfFieldDTO.getValue().stream().filter(tem -> tem.getValue().equals(item.getValue())).findFirst().orElse(null);
|
|
|
+ if (temVO == null) {
|
|
|
+ item.setIfHidden(true);
|
|
|
+ } else {
|
|
|
+ item.setIfHidden(temVO.getIfHidden());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Integer order = 0;
|
|
@@ -112,4 +341,137 @@ public class PersonFieldService {
|
|
|
|
|
|
return fieldVOS;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询所有的统计字段
|
|
|
+ *
|
|
|
+ * @param getAllPatentCountDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<GetAllPatentCountVO> getAllCountColumns(GetAllPatentCountDTO getAllPatentCountDTO) {
|
|
|
+ Integer taskId = getAllPatentCountDTO.getTaskId();
|
|
|
+ Integer projectId = getAllPatentCountDTO.getProjectId();
|
|
|
+
|
|
|
+ String fieldJson = "";
|
|
|
+ //如果没查询到,则获取所有栏位添加到redis里
|
|
|
+ try {
|
|
|
+ fieldJson = CommonService.readJsonFile(PatentDictionary.NAME + ".json");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new XiaoShiException("不存在此表");
|
|
|
+ }
|
|
|
+ Boolean flag = true;
|
|
|
+ List<GetAllPatentCountVO> fieldVOS = JSON.parseArray(fieldJson, GetAllPatentCountVO.class);
|
|
|
+ fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfStats())).collect(Collectors.toList());
|
|
|
+ fieldVOS.forEach(item -> item.setFiledKind(-1));
|
|
|
+
|
|
|
+ //当专题库id或者报告id不为null时
|
|
|
+ if (taskId != null || projectId != null) {
|
|
|
+ List<AllCustomFieldVO> allCustomFieldVOS = new ArrayList<>();
|
|
|
+
|
|
|
+ if (taskId != null) {
|
|
|
+ allCustomFieldVOS = customFieldService.getAllTaskCustomField(taskId);
|
|
|
+ } else {
|
|
|
+ allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (allCustomFieldVOS != null && allCustomFieldVOS.size() != 0) {
|
|
|
+
|
|
|
+ //遍历查询出的自定义字段进行装载
|
|
|
+ for (AllCustomFieldVO allCustomFieldVO : allCustomFieldVOS) {
|
|
|
+ GetAllPatentCountVO getAllPatentCountVO = new GetAllPatentCountVO();
|
|
|
+ //装载自定义字段的栏位值
|
|
|
+ getAllPatentCountVO.setValue(allCustomFieldVO.getId().toString());
|
|
|
+ //装载自定义栏位名
|
|
|
+ getAllPatentCountVO.setName(allCustomFieldVO.getName());
|
|
|
+ //装载栏位类型
|
|
|
+ if (allCustomFieldVO.getType() <= 6) {
|
|
|
+ getAllPatentCountVO.setFiledKind(0);
|
|
|
+ } else {
|
|
|
+ getAllPatentCountVO.setFiledKind(allCustomFieldVO.getType());
|
|
|
+ }
|
|
|
+ fieldVOS.add(getAllPatentCountVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fieldVOS;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询显示的统计栏位
|
|
|
+ *
|
|
|
+ * @param getAllPatentCountDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<GetAllPatentCountVO> getShowCountColumns(GetAllPatentCountDTO getAllPatentCountDTO) {
|
|
|
+ Integer taskId = getAllPatentCountDTO.getTaskId();
|
|
|
+ Integer projectId = getAllPatentCountDTO.getProjectId();
|
|
|
+ //根据登录人id和type查询
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
+ try {
|
|
|
+ personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new UnLoginException("未登录");
|
|
|
+ }
|
|
|
+ String userId = personnelVO.getId();
|
|
|
+ String key = "";
|
|
|
+
|
|
|
+ if (taskId != null) {
|
|
|
+ key = SecureUtil.md5(RedisConf.TASK_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + taskId);
|
|
|
+ } else {
|
|
|
+ key = SecureUtil.md5(RedisConf.PROJECT_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
|
|
|
+ }
|
|
|
+
|
|
|
+ String json = redisUtil.get(RedisConf.FIELD_COUNT + RedisConf.SYMBOL_COLON + key);
|
|
|
+ //如果查到
|
|
|
+ if (StringUtils.isNotEmpty(json)) {
|
|
|
+ return JsonUtils.jsonToList(json, GetAllPatentCountVO.class);
|
|
|
+ }
|
|
|
+ String fieldJson = "";
|
|
|
+ //如果没查询到,则获取所有栏位添加到redis里
|
|
|
+ try {
|
|
|
+ fieldJson = CommonService.readJsonFile(PatentDictionary.NAME + ".json");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new XiaoShiException("不存在此表");
|
|
|
+ }
|
|
|
+ Boolean flag = true;
|
|
|
+ List<GetAllPatentCountVO> fieldVOS = JSON.parseArray(fieldJson, GetAllPatentCountVO.class);
|
|
|
+ fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfStats()) && flag.equals(item.getDefaultShowStats())).collect(Collectors.toList());
|
|
|
+ fieldVOS.forEach(item -> item.setFiledKind(-1));
|
|
|
+ redisUtil.set(RedisConf.FIELD_COUNT + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
|
|
|
+ return fieldVOS;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询显示的统计栏位
|
|
|
+ *
|
|
|
+ * @param addPatentCountDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<GetAllPatentCountVO> setShowCountColumns(AddPatentCountDTO addPatentCountDTO) {
|
|
|
+ Integer taskId = addPatentCountDTO.getTaskId();
|
|
|
+ Integer projectId = addPatentCountDTO.getProjectId();
|
|
|
+ //根据登录人id和type查询
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
+ try {
|
|
|
+ personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new UnLoginException("未登录");
|
|
|
+ }
|
|
|
+ String userId = personnelVO.getId();
|
|
|
+ String key = "";
|
|
|
+
|
|
|
+ if (taskId != null) {
|
|
|
+ key = SecureUtil.md5(RedisConf.TASK_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + taskId);
|
|
|
+ } else {
|
|
|
+ key = SecureUtil.md5(RedisConf.PROJECT_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
|
|
|
+ }
|
|
|
+
|
|
|
+ Boolean flag = true;
|
|
|
+ List<GetAllPatentCountVO> fieldVOS = addPatentCountDTO.getValue();
|
|
|
+ redisUtil.set(RedisConf.FIELD_COUNT + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
|
|
|
+ return fieldVOS;
|
|
|
+ }
|
|
|
+
|
|
|
}
|