|
@@ -14,6 +14,7 @@ import cn.cslg.report.entity.Report;
|
|
|
import cn.cslg.report.entity.ReportFiles;
|
|
|
import cn.cslg.report.entity.asso.AssoReportFile;
|
|
|
import cn.cslg.report.mapper.ReportMapper;
|
|
|
+import cn.cslg.report.service.IAvoidDesignDirectionService;
|
|
|
import cn.cslg.report.service.IProductService;
|
|
|
import cn.cslg.report.service.OutInterfaceService;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -59,11 +60,12 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
private final FeatureService featureService;
|
|
|
private final CompareScenariosService compareScenariosService;
|
|
|
private final IProductService productService;
|
|
|
+ private final IAvoidDesignDirectionService avoidDesignDirectionService;
|
|
|
private final CompareFilesService compareFilesService;
|
|
|
private final CompareMessageService compareMessageService;
|
|
|
private final ImportTaskService importTaskService;
|
|
|
private final InvalidRecordService invalidRecordService;
|
|
|
- private final ReportDocumentService reportDocumentService;
|
|
|
+ private final ReportDocumentService reportDocumentService;
|
|
|
private final ReportReferencesService reportReferencesService;
|
|
|
|
|
|
/**
|
|
@@ -111,13 +113,13 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @Transactional(rollbackFor = Exception.class)
|
|
|
+ // @Transactional(rollbackFor = Exception.class)
|
|
|
//查询报告
|
|
|
public String queryReport(ReportVO reportVO) throws IOException {
|
|
|
- Integer id =loginUtils.getId();
|
|
|
- List<Integer> departIds =outInterfaceService.getDutyDepartsFromPCS(id);
|
|
|
+ Integer id = loginUtils.getId();
|
|
|
+ List<Integer> departIds = outInterfaceService.getDutyDepartsFromPCS(id);
|
|
|
LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.ne(Report::getId,0);
|
|
|
+ queryWrapper.ne(Report::getId, 0);
|
|
|
if (reportVO.getName() != null) {
|
|
|
queryWrapper.like(Report::getName, reportVO.getName());
|
|
|
}
|
|
@@ -139,12 +141,11 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
SecurityUtils.startDataScope("/pcs/report/query");
|
|
|
long count = this.count(queryWrapper);
|
|
|
return Response.success(reports, DataUtils.setPageColumn(reportVO.getSize(), reportVO.getCurrent(), Math.toIntExact(count)));
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
SecurityUtils.startDataScope("/pcs/report/query");
|
|
|
List<Report> reports = this.list(queryWrapper);
|
|
|
SecurityUtils.startDataScope("/pcs/report/query");
|
|
|
- long count =this.count(queryWrapper);
|
|
|
+ long count = this.count(queryWrapper);
|
|
|
reports = this.reportData(reports);
|
|
|
return Response.success(reports, DataUtils.setPageColumn(0, 0, Math.toIntExact(count)));
|
|
|
}
|
|
@@ -185,52 +186,52 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
//解析jason获得标的专利的权要
|
|
|
List<Personnel> personnels = JSON.parseArray(jsonObject1.getString("data"), Personnel.class);
|
|
|
//根据部门Id 获得部门信息
|
|
|
- List<Map<String, Object>> mapDeparts =new ArrayList<>();
|
|
|
- if(departIds.size()!=0) {
|
|
|
+ List<Map<String, Object>> mapDeparts = new ArrayList<>();
|
|
|
+ if (departIds.size() != 0) {
|
|
|
String res2 = outInterfaceService.getDeparts(departIds);
|
|
|
mapDeparts = JSONObject.parseArray(res2);
|
|
|
}
|
|
|
//根据客户Id 获得客户信息
|
|
|
- List<Map<String, Object>> mapClients =new ArrayList<>();
|
|
|
- if(clientIds.size()!=0) {
|
|
|
+ List<Map<String, Object>> mapClients = new ArrayList<>();
|
|
|
+ if (clientIds.size() != 0) {
|
|
|
String res3 = outInterfaceService.getClientNameFromPAS(clientIds);
|
|
|
- mapClients =JSONObject.parseArray(res3);
|
|
|
+ mapClients = JSONObject.parseArray(res3);
|
|
|
}
|
|
|
//过滤报告
|
|
|
- for(Report item :reports){
|
|
|
- //装载创建人名和负责人名
|
|
|
- List<Personnel> mapCre = personnels.stream().filter(tem -> tem.getId().equals(item.getCreatePersonId())).collect(Collectors.toList());
|
|
|
- List<Personnel> mapDuty = personnels.stream().filter(tem -> tem.getId().equals(item.getPersonId())).collect(Collectors.toList());
|
|
|
- if(mapDuty.size()!=0)
|
|
|
- item.setPersonName(mapDuty.get(0).getPersonnelName());
|
|
|
- if(mapCre.size()!=0)
|
|
|
- item.setCreatePersonName(mapCre.get(0).getPersonnelName());
|
|
|
- //装载部门名
|
|
|
- List<Map<String, Object>> mapDeaprt = mapDeparts.stream().filter(tem -> tem.get("departId").toString().equals(item.getDepartmentId().toString())).collect(Collectors.toList());
|
|
|
- if(mapDeaprt.size()!=0){
|
|
|
- item.setDepartmentName(mapDeaprt.get(0).get("departName").toString());
|
|
|
- }
|
|
|
- //装载客户
|
|
|
- List<Map<String, Object>> mapClient = mapClients.stream().filter(tem -> tem.get("clientId").toString().equals(item.getClientId().toString())).collect(Collectors.toList());
|
|
|
- if(mapClient.size()!=0){
|
|
|
- item.setClientName(mapClient.get(0).get("clientName").toString());
|
|
|
- }
|
|
|
- //装载报告应用场景
|
|
|
- if (StringUtils.isNotEmpty(item.getScenarioId())) {
|
|
|
- item.setScenarioList(StringUtils.changeStringToString(item.getScenarioId(), ","));
|
|
|
- item.setScenarioNames(list.stream().filter(systemDict -> systemDict.getType().equals(Constants.ENTERPRISE_APPLICATION_SCENARIO) && item.getScenarioList().contains(systemDict.getValue())).map(SystemDictVO::getLabel).collect(Collectors.toList()));
|
|
|
- item.setScenarioId(null);
|
|
|
- }
|
|
|
- //装载报告文件
|
|
|
- List<AssoReportFile> partReportFiles = assoReportFiles.stream().filter(tem -> tem.getReportId().equals(item.getId())).collect(Collectors.toList());
|
|
|
- if (partReportFiles.size() == 0) {
|
|
|
- item.setReportFiles(null);
|
|
|
- } else {
|
|
|
- List<Integer> partFileIds = partReportFiles.stream().map(AssoReportFile::getFileId).collect(Collectors.toList());
|
|
|
- List<ReportFiles> partFiles = temList.stream().filter(tem -> partFileIds.contains(tem.getId())).collect(Collectors.toList());
|
|
|
- item.setReportFiles(partFiles);
|
|
|
- }
|
|
|
- }
|
|
|
+ for (Report item : reports) {
|
|
|
+ //装载创建人名和负责人名
|
|
|
+ List<Personnel> mapCre = personnels.stream().filter(tem -> tem.getId().equals(item.getCreatePersonId())).collect(Collectors.toList());
|
|
|
+ List<Personnel> mapDuty = personnels.stream().filter(tem -> tem.getId().equals(item.getPersonId())).collect(Collectors.toList());
|
|
|
+ if (mapDuty.size() != 0)
|
|
|
+ item.setPersonName(mapDuty.get(0).getPersonnelName());
|
|
|
+ if (mapCre.size() != 0)
|
|
|
+ item.setCreatePersonName(mapCre.get(0).getPersonnelName());
|
|
|
+ //装载部门名
|
|
|
+ List<Map<String, Object>> mapDeaprt = mapDeparts.stream().filter(tem -> tem.get("departId").toString().equals(item.getDepartmentId().toString())).collect(Collectors.toList());
|
|
|
+ if (mapDeaprt.size() != 0) {
|
|
|
+ item.setDepartmentName(mapDeaprt.get(0).get("departName").toString());
|
|
|
+ }
|
|
|
+ //装载客户
|
|
|
+ List<Map<String, Object>> mapClient = mapClients.stream().filter(tem -> tem.get("clientId").toString().equals(item.getClientId().toString())).collect(Collectors.toList());
|
|
|
+ if (mapClient.size() != 0) {
|
|
|
+ item.setClientName(mapClient.get(0).get("clientName").toString());
|
|
|
+ }
|
|
|
+ //装载报告应用场景
|
|
|
+ if (StringUtils.isNotEmpty(item.getScenarioId())) {
|
|
|
+ item.setScenarioList(StringUtils.changeStringToString(item.getScenarioId(), ","));
|
|
|
+ item.setScenarioNames(list.stream().filter(systemDict -> systemDict.getType().equals(Constants.ENTERPRISE_APPLICATION_SCENARIO) && item.getScenarioList().contains(systemDict.getValue())).map(SystemDictVO::getLabel).collect(Collectors.toList()));
|
|
|
+ item.setScenarioId(null);
|
|
|
+ }
|
|
|
+ //装载报告文件
|
|
|
+ List<AssoReportFile> partReportFiles = assoReportFiles.stream().filter(tem -> tem.getReportId().equals(item.getId())).collect(Collectors.toList());
|
|
|
+ if (partReportFiles.size() == 0) {
|
|
|
+ item.setReportFiles(null);
|
|
|
+ } else {
|
|
|
+ List<Integer> partFileIds = partReportFiles.stream().map(AssoReportFile::getFileId).collect(Collectors.toList());
|
|
|
+ List<ReportFiles> partFiles = temList.stream().filter(tem -> partFileIds.contains(tem.getId())).collect(Collectors.toList());
|
|
|
+ item.setReportFiles(partFiles);
|
|
|
+ }
|
|
|
+ }
|
|
|
return reports;
|
|
|
}
|
|
|
|
|
@@ -290,8 +291,10 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
compareScenariosService.deleteByReportId(id);
|
|
|
//删除任务人员关联信息表
|
|
|
assoTaskPersonelService.deleAssoTaskPersonel(id);
|
|
|
- //陈宇 ↓ 删除和报告有关的产品表数据、删除和产品有关的产品文件关联表数据、删除和产品有关的报告系统文件表数据
|
|
|
+ //陈宇 ↓ 删除和报告有关的产品相关数据
|
|
|
productService.deleteProduct(id);
|
|
|
+ //陈宇 ↓ 删除和报告有关的回避设计方案相关数据
|
|
|
+ avoidDesignDirectionService.deleteAvoidDesignDirection(id);
|
|
|
//删除对比文件
|
|
|
compareFilesService.delete(id);
|
|
|
//导入删除导入任务
|
|
@@ -301,13 +304,12 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
reportDocumentService.deleteByReportId(id);
|
|
|
//删除报告参考资料
|
|
|
reportReferencesService.deleteByReportId(id);
|
|
|
- //删除对比信息
|
|
|
+ //删除对比信息
|
|
|
compareMessageService.deleteByreportID(id);
|
|
|
|
|
|
|
|
|
-
|
|
|
- Boolean dele =this.removeById(id);
|
|
|
- if (dele ==true) {
|
|
|
+ Boolean dele = this.removeById(id);
|
|
|
+ if (dele == true) {
|
|
|
return Response.success();
|
|
|
}
|
|
|
return Response.error("没有数据");
|
|
@@ -330,11 +332,12 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
|
|
|
/**
|
|
|
* 修改报告的状态
|
|
|
+ *
|
|
|
* @param reportId 报告id
|
|
|
- * @param status 状态
|
|
|
+ * @param status 状态
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public void updateStatus(Integer reportId,Integer status){
|
|
|
+ public void updateStatus(Integer reportId, Integer status) {
|
|
|
LambdaQueryWrapper<Report> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(Report::getId, reportId);
|
|
|
Report report = this.list(wrapper).get(0);
|
|
@@ -344,5 +347,4 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|