|
@@ -9,6 +9,7 @@ import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
|
import cn.cslg.pas.common.vo.business.EventCountVO;
|
|
|
import cn.cslg.pas.common.vo.business.EventVO;
|
|
|
+import cn.cslg.pas.common.vo.business.PatentProjectVO;
|
|
|
import cn.cslg.pas.domain.business.*;
|
|
|
|
|
|
import cn.cslg.pas.exception.UnLoginException;
|
|
@@ -46,25 +47,14 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
|
|
|
private EventMapper eventMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private FormatQueryService formatQueryService;
|
|
|
-
|
|
|
+ private PatentProjectMapper patentProjectMapper;
|
|
|
@Autowired
|
|
|
- private FileManagerService fileManagerService;
|
|
|
+ private FormatQueryService formatQueryService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private AssoEventFileService assoEventFileService;
|
|
|
|
|
|
@Autowired
|
|
|
private QueryGroupFactory queryGroupFactory;
|
|
|
|
|
|
- @Autowired
|
|
|
- private PermissionService permissionService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SystemDictService systemDictService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private AssoProjectEventMapper assoProjectEventMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private CacheUtils cacheUtils;
|
|
@@ -89,18 +79,13 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
|
|
|
|
|
|
List<String> sqls = formatQueryService.reSqls(queryRequest,"patentProject");
|
|
|
//根据sql查询事件信息
|
|
|
- List<EventVO> eventVOS = eventMapper.getEvent(sqls.get(0),sqls.get(1),sqls.get(2));
|
|
|
-
|
|
|
- //查询总数
|
|
|
- Long total = eventMapper.getEventCount(sqls.get(0));
|
|
|
+ List<PatentProjectVO> patentProjectVOS = patentProjectMapper.getPatentProject(sqls.get(0),sqls.get(1),sqls.get(2));
|
|
|
|
|
|
//装载事件信息
|
|
|
-
|
|
|
Records records = new Records();
|
|
|
records.setCurrent(queryRequest.getCurrent());
|
|
|
records.setSize(queryRequest.getSize());
|
|
|
- records.setData(eventVOS);
|
|
|
- records.setTotal(total);
|
|
|
+ records.setData(patentProjectVOS);
|
|
|
return records;
|
|
|
}
|
|
|
|
|
@@ -122,26 +107,40 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Object updateMessage(Object object, List<MultipartFile> files) {
|
|
|
|
|
|
+
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Object deleteMessage(List<Integer> ids) throws IOException {
|
|
|
- //根据事件id删除事件和文件关联
|
|
|
- LambdaQueryWrapper<AssoEventFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.in(AssoEventFile::getEventId, ids);
|
|
|
- List<AssoEventFile> assoEventFiles = assoEventFileService.list(queryWrapper);
|
|
|
- List<String> guids = assoEventFiles.stream().map(AssoEventFile::getFileGuid).collect(Collectors.toList());
|
|
|
- // 根据guid删除文件
|
|
|
- if (guids.size() != 0) {
|
|
|
- fileManagerService.deleteFileFromFMS(guids);
|
|
|
- }
|
|
|
- //删除事件和文件关联表
|
|
|
- assoEventFiles.remove(queryWrapper);
|
|
|
- //根据事件id删除事件
|
|
|
- this.removeBatchByIds(ids);
|
|
|
- return ids;
|
|
|
+ //TODO 检查是否有关联报告,如果有则提示不允许删除
|
|
|
+
|
|
|
+ //TODO 根据id删除专利数据库和文件关联表
|
|
|
+
|
|
|
+ //TODO 根据id删除专利数据库和事件的关联表
|
|
|
+
|
|
|
+ //TODO 根据id删除专利数据库的自定义字段的标引(es部分,暂时不做)
|
|
|
+
|
|
|
+ //TODO 根据id删除专利数据库的自定义字段(自定义字段模块未完成,暂时不做)
|
|
|
+
|
|
|
+ //TODO 根据id删除专利数据库和事件的关联
|
|
|
+
|
|
|
+ //TODO 根据id删除专利数据库和应用场景关联
|
|
|
+
|
|
|
+ //TODO 根据id删除专利数据库和报告的关联
|
|
|
+
|
|
|
+ //TODO 根据id删除任务信息(任务模块未完成,暂时不做)
|
|
|
+
|
|
|
+ //TODO 根据id删除任专利关联信息(es部分,暂时不做)
|
|
|
+
|
|
|
+ //TODO 根据id删除导入任务信息(导入任务模块未完成,暂时不做)
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
+
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -315,6 +314,12 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
|
|
|
|
|
|
@Override
|
|
|
public Object updateMessage(Object object) {
|
|
|
+ //TODO 更新基本信息
|
|
|
+ //TODO 更新场景
|
|
|
+ //TODO 更新事件
|
|
|
+ //TODO 若产品或产品类别技术类别有更新,则删除产品或产品类别技术类别和专利的标引(只需判断,删除部分,待es完成)
|
|
|
+ //TODO 更新关联附件
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -324,134 +329,6 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
|
|
|
* @param eventVOs
|
|
|
*/
|
|
|
private void loadPatentProject(List<EventVO> eventVOs) throws IOException {
|
|
|
- List<String> createIds = new ArrayList<>();
|
|
|
- List<Integer> clientIds = new ArrayList<>();
|
|
|
- List<Integer> ids = new ArrayList<>();
|
|
|
- List<EventCountVO> eventCountVOS = new ArrayList<>();
|
|
|
- //获得所有文件的guid
|
|
|
- eventVOs.forEach(
|
|
|
- item -> {
|
|
|
- if (item.getClientId() != null) {
|
|
|
- clientIds.add(item.getClientId());
|
|
|
- }
|
|
|
-
|
|
|
- if (item.getCreateId() != null) {
|
|
|
- createIds.add(item.getCreateId());
|
|
|
- }
|
|
|
- if (item.getId() != null) {
|
|
|
- ids.add(item.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- List<Personnel> personnels = new ArrayList<>();
|
|
|
- List<Client> clients = new ArrayList<>();
|
|
|
- List<String> guids = new ArrayList<>();
|
|
|
- List<SystemFile> systemFiles = new ArrayList<>();
|
|
|
- List<AssoEventFile> assoEventFiles = new ArrayList<>();
|
|
|
-
|
|
|
- if (ids.size() != 0) {
|
|
|
- //根据事件id获得事件文件关联表
|
|
|
- LambdaQueryWrapper<AssoEventFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.in(AssoEventFile::getEventId, ids);
|
|
|
- assoEventFiles = assoEventFileService.list(queryWrapper);
|
|
|
- guids = assoEventFiles.stream().map(AssoEventFile::getFileGuid).collect(Collectors.toList());
|
|
|
-
|
|
|
-
|
|
|
- //根据事件id分组查询事件关联专题库或报告数量
|
|
|
- eventCountVOS = assoProjectEventMapper.getEventProjectCount(ids);
|
|
|
- }
|
|
|
-
|
|
|
- //查询创建人名称
|
|
|
- if (createIds.size() != 0) {
|
|
|
- String res = permissionService.getPersonnelByIdsFromPCS(createIds);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
- personnels = JSONObject.parseArray(jsonObject.getString("data"), Personnel.class);
|
|
|
- }
|
|
|
-
|
|
|
- //查询客户名称
|
|
|
- if (clientIds.size() != 0) {
|
|
|
- String res = permissionService.getClientByIdsFromPCS(clientIds);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
- clients = JSONObject.parseArray(jsonObject.getString("data"), Client.class);
|
|
|
- }
|
|
|
-
|
|
|
- //查询文件
|
|
|
- if (guids.size() != 0) {
|
|
|
- String res = fileManagerService.getSystemFileFromFMS(guids);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
- systemFiles = JSONObject.parseArray(jsonObject.getString("data"), SystemFile.class);
|
|
|
- }
|
|
|
-
|
|
|
- //查询关联报告或专题库
|
|
|
-
|
|
|
- //查询应用场景
|
|
|
- List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList("ENTERPRISE_APPLICATION_SCENARIO"));
|
|
|
-
|
|
|
- //查询专题库数量
|
|
|
-
|
|
|
- //装载信息
|
|
|
- for (EventVO eventVO : eventVOs) {
|
|
|
- //装载人员信息
|
|
|
- Personnel personnel = personnels.stream().filter(item -> item.getId().equals(eventVO.getCreateId())).findFirst().orElse(null);
|
|
|
- if (personnel != null) {
|
|
|
- eventVO.setCreateName(personnel.getPersonnelName());
|
|
|
- }
|
|
|
-
|
|
|
- //装载客户信息
|
|
|
- Client client = clients.stream().filter(item -> item.getId().equals(eventVO.getClientId())).findFirst().orElse(null);
|
|
|
- if (client != null) {
|
|
|
- eventVO.setClientName(client.getName());
|
|
|
- }
|
|
|
-
|
|
|
- //装载场景
|
|
|
- SystemDict systemDict = systemDictList.stream().filter(item -> item.getValue().equals(eventVO.getScenarioId().toString())).findFirst().orElse(null);
|
|
|
- if (systemDict != null) {
|
|
|
- eventVO.setScenarioName(systemDict.getLabel());
|
|
|
- }
|
|
|
-
|
|
|
- //装载文件信息
|
|
|
- List<AssoEventFile> assoEventFileTemp = assoEventFiles.stream().filter(item -> item.getEventId().equals(eventVO.getId())).collect(Collectors.toList());
|
|
|
- if (assoEventFileTemp.size() != 0) {
|
|
|
- List<String> guidTemp = assoEventFileTemp.stream().map(AssoEventFile::getFileGuid).collect(Collectors.toList());
|
|
|
- if (guidTemp.size() != 0) {
|
|
|
- List<SystemFile> systemFileTemp = systemFiles.stream().filter(item -> guidTemp.contains(item.getGuid())).collect(Collectors.toList());
|
|
|
- if (systemFileTemp.size() != 0) {
|
|
|
- eventVO.setSystemFileList(systemFileTemp);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //装载专题库或报告数量
|
|
|
- if (eventCountVOS.size() != 0) {
|
|
|
- //专题库数量
|
|
|
- EventCountVO eventCountVO1 = eventCountVOS.stream().filter(item ->
|
|
|
- item.getEventId().equals(eventVO.getId()) && item.getProjectType().equals(1)).findFirst().orElse(null);
|
|
|
-
|
|
|
- //报告数量
|
|
|
- EventCountVO eventCountVO2 = eventCountVOS.stream().filter(item ->
|
|
|
- item.getEventId().equals(eventVO.getId()) && item.getProjectType().equals(2)).findFirst().orElse(null);
|
|
|
-
|
|
|
- //设置专题库数量
|
|
|
- if (eventCountVO1 != null) {
|
|
|
- eventVO.setPatentProjectNum(eventCountVO1.getProjectCount());
|
|
|
- } else {
|
|
|
- eventVO.setPatentProjectNum(0);
|
|
|
- }
|
|
|
-
|
|
|
- //设置报告数量
|
|
|
- if (eventCountVO2 != null) {
|
|
|
- eventVO.setReportProjectNum(eventCountVO2.getProjectCount());
|
|
|
- } else {
|
|
|
- eventVO.setReportProjectNum(0);
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- eventVO.setReportProjectNum(0);
|
|
|
- eventVO.setPatentProjectNum(0);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
}
|