|
@@ -5,10 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
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 com.ims.eval.cache.CacheContext;
|
|
import com.ims.eval.cache.CacheContext;
|
|
-import com.ims.eval.dao.OrganizationEvaluationInfoMapper;
|
|
|
|
import com.ims.eval.dao.OrganizationRatingMapper;
|
|
import com.ims.eval.dao.OrganizationRatingMapper;
|
|
import com.ims.eval.entity.*;
|
|
import com.ims.eval.entity.*;
|
|
-import com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO;
|
|
|
|
import com.ims.eval.entity.dto.result.R;
|
|
import com.ims.eval.entity.dto.result.R;
|
|
import com.ims.eval.service.*;
|
|
import com.ims.eval.service.*;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -64,9 +62,6 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
private IEvaluationPortalService iEvaluationPortalService;
|
|
private IEvaluationPortalService iEvaluationPortalService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
- private OrganizationEvaluationInfoMapper organizationEvaluationInfoMapper;
|
|
|
|
-
|
|
|
|
- @Resource
|
|
|
|
private IEvaluateReportService iEvaluateReportService;
|
|
private IEvaluateReportService iEvaluateReportService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -158,7 +153,7 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
* 导出
|
|
* 导出
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void exportExcel(HttpServletResponse response, String binSection, String year) throws IOException {
|
|
|
|
|
|
+ public R exportExcel(HttpServletResponse response, List<OrganizationRating> ls, String binSection, String year) throws IOException {
|
|
// 设置响应头信息,以附件形式下载
|
|
// 设置响应头信息,以附件形式下载
|
|
response.setHeader("Content-Disposition", "attachment; filename=organization_rating.xlsx");
|
|
response.setHeader("Content-Disposition", "attachment; filename=organization_rating.xlsx");
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
@@ -171,24 +166,22 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
|
|
|
|
// 创建表头
|
|
// 创建表头
|
|
Row headerRow = sheet.createRow(0);
|
|
Row headerRow = sheet.createRow(0);
|
|
- List<String> headers = Arrays.asList("考评单位", "业务板块", "考评年度", "年度安全环保评级", "否决事项:无0,有1", "净利润", "经营业绩考核综合得分百分比", "生产经营评级", "年度项目进度目标完成率",
|
|
|
|
|
|
+ List<String> headers = Arrays.asList("考评单位", "业务板块", "考评年度", "年度安全环保评级", "否决事项:无0,有1", "净利润", "经营业绩考核综合得分%", "生产经营评级", "年度项目进度目标完成率",
|
|
"先进性指标考核得分有无加分", "前期评级", "基建工程综合得分排名", "基建工程项目等级", "基建评级", "综合得分", "年度评级");
|
|
"先进性指标考核得分有无加分", "前期评级", "基建工程综合得分排名", "基建工程项目等级", "基建评级", "综合得分", "年度评级");
|
|
|
|
|
|
-
|
|
|
|
for (int i = 0; i < headers.size(); i++) {
|
|
for (int i = 0; i < headers.size(); i++) {
|
|
Cell cell = headerRow.createCell(i);
|
|
Cell cell = headerRow.createCell(i);
|
|
cell.setCellValue(headers.get(i));
|
|
cell.setCellValue(headers.get(i));
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//行数据
|
|
//行数据
|
|
- Page<OrganizationRating> page = new Page<>(1, 100000);
|
|
|
|
- IPage<OrganizationRating> orgRating = baseMapper.selectList(page, null, null, binSection, year, null, null,
|
|
|
|
- null, null, null, null, null, null, null, null, null);
|
|
|
|
|
|
+// Page<OrganizationRating> page = new Page<>(1, 100000);
|
|
|
|
+// IPage<OrganizationRating> orgRating = baseMapper.selectList(page, null, null, binSection, year, null, null,
|
|
|
|
+// null, null, null, null, null, null, null, null, null);
|
|
|
|
|
|
// 填充数据到工作表
|
|
// 填充数据到工作表
|
|
int rowIndex = 1; // 从第二行开始填充数据(第一行是表头)
|
|
int rowIndex = 1; // 从第二行开始填充数据(第一行是表头)
|
|
- for (OrganizationRating or : orgRating.getRecords()) {
|
|
|
|
|
|
+ for (OrganizationRating or : ls) {
|
|
Row row = sheet.createRow(rowIndex++);
|
|
Row row = sheet.createRow(rowIndex++);
|
|
|
|
|
|
// 设置数据
|
|
// 设置数据
|
|
@@ -241,7 +234,7 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
// 关闭工作簿
|
|
// 关闭工作簿
|
|
workbook.close();
|
|
workbook.close();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ return R.ok();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -301,7 +294,23 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
lep.add(ep);
|
|
lep.add(ep);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- boolean b = iEvaluationPortalService.saveBatch(lep);
|
|
|
|
|
|
+// boolean b = iEvaluationPortalService.saveBatch(lep);
|
|
|
|
+ List<EvaluationPortal> leUpdate = new ArrayList<>();
|
|
|
|
+ List<EvaluationPortal> leSave = new ArrayList<>();
|
|
|
|
+ for (EvaluationPortal evaluationPortal : lep) {
|
|
|
|
+ LambdaQueryWrapper<EvaluationPortal> lqw = new LambdaQueryWrapper<>();
|
|
|
|
+ lqw.eq(EvaluationPortal::getCompany, evaluationPortal.getCompany()).eq(EvaluationPortal::getYear, evaluationPortal.getYear())
|
|
|
|
+ .isNull(EvaluationPortal::getSeason).eq(EvaluationPortal::getBinSection, evaluationPortal.getBinSection());
|
|
|
|
+ List<EvaluationPortal> list = iEvaluationPortalService.list(lqw);
|
|
|
|
+ if (null == list || list.isEmpty()) {
|
|
|
|
+ leSave.add(evaluationPortal);
|
|
|
|
+ } else {
|
|
|
|
+ evaluationPortal.setId(list.get(0).getId());
|
|
|
|
+ leUpdate.add(evaluationPortal);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ boolean save = iEvaluationPortalService.saveBatch(leSave);
|
|
|
|
+ boolean update = iEvaluationPortalService.updateBatchById(leUpdate);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -559,7 +568,8 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
organizationYearRatingId, String binSection, String year, String organizationShortName, String organizationId, String safetyEnvProtection,
|
|
organizationYearRatingId, String binSection, String year, String organizationShortName, String organizationId, String safetyEnvProtection,
|
|
String veto, String netProfit, String compositeScore, String annualTarget, String bonusPoint, String compositeScoreRaking, String projectLevel, String score) {
|
|
String veto, String netProfit, String compositeScore, String annualTarget, String bonusPoint, String compositeScoreRaking, String projectLevel, String score) {
|
|
List<BinSection> bsnList = CacheContext.bsnList;
|
|
List<BinSection> bsnList = CacheContext.bsnList;
|
|
- Map<String, List<BinSection>> bsnMap = bsnList.stream().collect(Collectors.groupingBy(BinSection::getId));
|
|
|
|
|
|
+ List<BinSection> bsnls = bsnList.stream().filter(s -> null != s.getMemo1() && s.getMemo1().equals("DWPJ")).collect(Collectors.toList());
|
|
|
|
+ Map<String, List<BinSection>> bsnMap = bsnls.stream().collect(Collectors.groupingBy(BinSection::getId));
|
|
String[] s = organizationYearRatingId.split("_");
|
|
String[] s = organizationYearRatingId.split("_");
|
|
|
|
|
|
Page<OrganizationRating> page = new Page<>(pageNum, pageSize);
|
|
Page<OrganizationRating> page = new Page<>(pageNum, pageSize);
|
|
@@ -591,47 +601,82 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private void getRatingInfo(String organizationYearRatingId, String year, String s, Map<String, List<BinSection>> bsnMap) {
|
|
|
|
- List<OrganizationEvaluationInfoResDTO> infoResDTOList = organizationEvaluationInfoMapper.selectEvaluationInfoList(s, "", "", "", "", "");
|
|
|
|
- if (null == infoResDTOList || infoResDTOList.isEmpty()) {
|
|
|
|
- return;
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public R binSection(String organizationYearRatingId) {
|
|
|
|
+ List<BinSection> bsnList = CacheContext.bsnList;
|
|
|
|
+
|
|
|
|
+ Map<String, List<BinSection>> bsnMap = bsnList.stream().collect(Collectors.groupingBy(BinSection::getId));
|
|
|
|
+ String[] s = organizationYearRatingId.split("_");
|
|
|
|
+
|
|
|
|
+ List<EvaluateReport> evaReport = iEvaluateReportService.list(s[0], "");
|
|
|
|
+ if (null == evaReport || evaReport.isEmpty()) {
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+ Set<BinSection> lb = new HashSet<>();
|
|
|
|
+ for (EvaluateReport evaluateReport : evaReport) {
|
|
|
|
+ LambdaQueryWrapper<EvaluateReportInfo> lqw = new LambdaQueryWrapper<>();
|
|
|
|
+ lqw.eq(EvaluateReportInfo::getEvaluateReportId, evaluateReport.getId());
|
|
|
|
+ List<EvaluateReportInfo> evaReportInfos = evaluateReportInfoService.list(lqw);
|
|
|
|
+ if (null != evaReportInfos && !(evaReportInfos.isEmpty())) {
|
|
|
|
+ lb.add(bsnMap.get(evaluateReport.getBinSection()).get(0));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- Map<String, List<OrganizationEvaluationInfoResDTO>> binSec = infoResDTOList.stream()
|
|
|
|
- .collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getBinSection));
|
|
|
|
-
|
|
|
|
- for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> entry : binSec.entrySet()) {
|
|
|
|
- List<OrganizationRating> lors = new ArrayList<>();
|
|
|
|
- List<OrganizationEvaluationInfoResDTO> orgEvaInfos = entry.getValue();
|
|
|
|
-
|
|
|
|
- List<EvaluateReport> evaReport = iEvaluateReportService.list(s, entry.getKey());
|
|
|
|
- List<EvaluateReportInfo> evaReportInfos = null;
|
|
|
|
- if ((null!=evaReport) &&(!evaReport.isEmpty())) {
|
|
|
|
- LambdaQueryWrapper<EvaluateReportInfo> lqw = new LambdaQueryWrapper<>();
|
|
|
|
- lqw.eq(EvaluateReportInfo::getEvaluateReportId, evaReport.get(0).getId());
|
|
|
|
- evaReportInfos = evaluateReportInfoService.list(lqw);
|
|
|
|
|
|
+ List<BinSection> lbs = new ArrayList<>(lb);
|
|
|
|
+ for (BinSection binSection : lbs) {
|
|
|
|
+ if ("HD".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("1");
|
|
|
|
+ }else if ("SD".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("2");
|
|
|
|
+ }else if ("XNYFG".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("3");
|
|
|
|
+ }else if ("MDYTH".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("4");
|
|
|
|
+ }else if ("GJYW".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("5");
|
|
|
|
+ }else if ("ZHZC".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("6");
|
|
|
|
+ }else if ("TJGS".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("7");
|
|
|
|
+ }else if ("GCGS".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("8");
|
|
|
|
+ }else if ("QQ".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("9");
|
|
|
|
+ }else if ("JJ".equals(binSection.getSectionCode())) {
|
|
|
|
+ binSection.setMemo4("10");
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ List<BinSection> col = lbs.stream().sorted(Comparator.comparing(BinSection::getMemo4)).collect(Collectors.toList());
|
|
|
|
+ return R.ok().data(col);
|
|
|
|
+ }
|
|
|
|
|
|
- Map<String, List<OrganizationEvaluationInfoResDTO>> orgName = orgEvaInfos.stream()
|
|
|
|
- .collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getOrganizationShortName));
|
|
|
|
- for (String keys : orgName.keySet()) {
|
|
|
|
- OrganizationEvaluationInfoResDTO oe = orgName.get(keys).get(0);
|
|
|
|
|
|
+
|
|
|
|
+ private void getRatingInfo(String organizationYearRatingId, String year, String s, Map<String, List<BinSection>> bsnMap) {
|
|
|
|
+ List<EvaluateReport> evaReport = iEvaluateReportService.list(s, "");
|
|
|
|
+ if (null == evaReport || evaReport.isEmpty()) {
|
|
|
|
+ throw new RuntimeException("考评报告未生成,请先生成考评报告");
|
|
|
|
+ }
|
|
|
|
+// Set<BinSection> lb = new HashSet<>();
|
|
|
|
+ List<OrganizationRating> lors = new ArrayList<>();
|
|
|
|
+ for (EvaluateReport evaluateReport : evaReport) {
|
|
|
|
+ LambdaQueryWrapper<EvaluateReportInfo> lqw = new LambdaQueryWrapper<>();
|
|
|
|
+ lqw.eq(EvaluateReportInfo::getEvaluateReportId, evaluateReport.getId());
|
|
|
|
+ List<EvaluateReportInfo> evaReportInfos = evaluateReportInfoService.list(lqw);
|
|
|
|
+ if (null == evaReportInfos || evaReportInfos.isEmpty()) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ for (EvaluateReportInfo evaReportInfo : evaReportInfos) {
|
|
OrganizationRating or = new OrganizationRating();
|
|
OrganizationRating or = new OrganizationRating();
|
|
or.setOrganizationYearRatingId(organizationYearRatingId);
|
|
or.setOrganizationYearRatingId(organizationYearRatingId);
|
|
- or.setOrganizationShortName(oe.getOrganizationShortName());
|
|
|
|
- or.setOrganizationId(oe.getOrganizationId());
|
|
|
|
|
|
+ or.setOrganizationShortName(evaReportInfo.getOrganizationName());
|
|
|
|
+ or.setOrganizationId(evaReportInfo.getOrganizationId());
|
|
or.setYear(year);
|
|
or.setYear(year);
|
|
- or.setBinSection(bsnMap.get(oe.getBinSection()).get(0).getSectionCode());
|
|
|
|
- if ((evaReportInfos != null) && (!evaReportInfos.isEmpty())) {
|
|
|
|
- for (EvaluateReportInfo evaReportInfo : evaReportInfos) {
|
|
|
|
- if (evaReportInfo.getOrganizationName().equals(keys)) {
|
|
|
|
- or.setScore(evaReportInfo.getScore() != 0.0 ? String.valueOf(evaReportInfo.getScore()) : null);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ or.setBinSection(bsnMap.get(evaluateReport.getBinSection()).get(0).getSectionCode());
|
|
|
|
+ or.setScore(evaReportInfo.getScore() != 0.0 ? String.valueOf(evaReportInfo.getScore()) : null);
|
|
lors.add(or);
|
|
lors.add(or);
|
|
|
|
+// lb.add(bsnMap.get(evaluateReport.getBinSection()).get(0));
|
|
}
|
|
}
|
|
- iOrganizationRatingService.saveBatch(lors);
|
|
|
|
}
|
|
}
|
|
|
|
+ iOrganizationRatingService.saveBatch(lors);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|