|
@@ -3,7 +3,6 @@ package com.ims.eval.service.impl;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.ims.common.utils.Constant;
|
|
|
import com.ims.common.utils.StringUtils;
|
|
|
import com.ims.eval.cache.CacheContext;
|
|
|
import com.ims.eval.config.CustomException;
|
|
@@ -155,34 +154,55 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean saveOrUpdateBatch2(List<ResponsibilityIndicatorInfo> responsibilityIndicatorInfoList) {
|
|
|
- boolean b = false;
|
|
|
- for (ResponsibilityIndicatorInfo obj : responsibilityIndicatorInfoList) {
|
|
|
- ResponsibilityIndicatorInfo responsibilityIndicatorInfo = super.getById(obj.getId());
|
|
|
- if (!"失效".equals(responsibilityIndicatorInfo.getDataState())) {
|
|
|
- obj.setDataState("失效");
|
|
|
- b = super.updateById(obj);
|
|
|
- if (b) {
|
|
|
+ public boolean revisionResponsibilityIndicatorInfo(List<JSONObject> jsonObjects) {
|
|
|
+ for (JSONObject json : jsonObjects) {
|
|
|
+ Map<String, Object> idMap = new HashMap();
|
|
|
+ Map valueMap = new HashMap();
|
|
|
+ for (String key : json.keySet()) {
|
|
|
+ Object value = json.get(key);
|
|
|
+ if (key.startsWith("ID_")) {
|
|
|
+ idMap.put(key, value);
|
|
|
+ } else {
|
|
|
+ valueMap.put(key, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (Map.Entry<String, Object> entry : idMap.entrySet()) {
|
|
|
+ ResponsibilityIndicatorInfo responsibilityIndicatorInfo = super.getById(entry.getValue().toString());
|
|
|
+ String quantified = valueMap.get(entry.getKey().replace("ID_", "IS_LH_")).toString();
|
|
|
+ double quantifiedValue = 0;
|
|
|
+ if ("1".equals(quantified)) {
|
|
|
+ if (MathCalculatorUtil.isNumber(String.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString()))) {
|
|
|
+ quantifiedValue = Double.valueOf(valueMap.get(entry.getKey().replace("ID_", "")).toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String nonQuantifiedValue = valueMap.get(entry.getKey().replace("ID_", "")).toString();
|
|
|
+ if (quantifiedValue != responsibilityIndicatorInfo.getQuantifiedValue() || !nonQuantifiedValue.equals(responsibilityIndicatorInfo.getNonQuantifiedValue())) {
|
|
|
ResponsibilityIndicatorInfo info = new ResponsibilityIndicatorInfo();
|
|
|
info.setDeptResponsibilityId(responsibilityIndicatorInfo.getDeptResponsibilityId());
|
|
|
info.setOrganizationEvaluationRuleId(responsibilityIndicatorInfo.getOrganizationEvaluationRuleId());
|
|
|
info.setIndicatorId(responsibilityIndicatorInfo.getIndicatorId());
|
|
|
info.setIndicatorDictionaryId(responsibilityIndicatorInfo.getIndicatorDictionaryId());
|
|
|
info.setOptionCode(responsibilityIndicatorInfo.getOptionCode());
|
|
|
- info.setIsQuantified(obj.getIsQuantified());
|
|
|
- info.setQuantifiedValue(obj.getQuantifiedValue());
|
|
|
- info.setNonQuantifiedValue(obj.getNonQuantifiedValue());
|
|
|
+ info.setIsQuantified(responsibilityIndicatorInfo.getIsQuantified());
|
|
|
+ info.setQuantifiedValue(quantifiedValue);
|
|
|
+ info.setNonQuantifiedValue(nonQuantifiedValue);
|
|
|
info.setCreateTime(new Date());
|
|
|
- info.setState(obj.getState());
|
|
|
+ info.setRemark(responsibilityIndicatorInfo.getRemark());
|
|
|
+ info.setState(valueMap.get("state").toString());
|
|
|
info.setDataState("有效");
|
|
|
- b = super.save(info);
|
|
|
+ info.setDeptId(responsibilityIndicatorInfo.getDeptId());
|
|
|
+ info.setChildCode(responsibilityIndicatorInfo.getChildCode());
|
|
|
+ info.setEvaluateRuleInfoId(responsibilityIndicatorInfo.getEvaluateRuleInfoId());
|
|
|
+ info.setOrganizationId(responsibilityIndicatorInfo.getOrganizationId());
|
|
|
+ boolean b = this.save(info);
|
|
|
+ if (b) {
|
|
|
+ responsibilityIndicatorInfo.setDataState("失效");
|
|
|
+ this.updateById(responsibilityIndicatorInfo);
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- obj.setUpdateTime(new Date());
|
|
|
- b = super.updateById(obj);
|
|
|
}
|
|
|
}
|
|
|
- return b;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -197,19 +217,19 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
|
|
|
//判断是否是(重点专项和管理事项)
|
|
|
List<Map> indicatorMap = new ArrayList<>();
|
|
|
- if("ZDZX".equals(CacheContext.bseIdObject.get(binStage).getStageCode()) || "GLSX".equals(CacheContext.bseIdObject.get(binStage).getStageCode())){
|
|
|
+ if ("ZDZX".equals(CacheContext.bseIdObject.get(binStage).getStageCode()) || "GLSX".equals(CacheContext.bseIdObject.get(binStage).getStageCode())) {
|
|
|
|
|
|
- List<Indicator> indicatorList = indicatorService.listAll("","","",binSection,binStage,"","");
|
|
|
- if(null != indicatorList && indicatorList.size()>0){
|
|
|
- for (Indicator i : indicatorList){
|
|
|
+ List<Indicator> indicatorList = indicatorService.listAll("", "", "", binSection, binStage, "", "");
|
|
|
+ if (null != indicatorList && indicatorList.size() > 0) {
|
|
|
+ for (Indicator i : indicatorList) {
|
|
|
Map map = new HashMap();
|
|
|
- map.put("id",i.getId());
|
|
|
- map.put("indicator_name",i.getIndicatorName());
|
|
|
+ map.put("id", i.getId());
|
|
|
+ map.put("indicator_name", i.getIndicatorName());
|
|
|
indicatorMap.add(map);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
indicatorMap = baseMapper.selectResponsibilityIndicatorList(responsibilityId, binSection, binStage);
|
|
|
}
|
|
|
|
|
@@ -224,13 +244,13 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
|
|
|
boolean titlemark = true;//标记生成标题
|
|
|
|
|
|
- List<Map> indicatorMap = getResponsibilityIndicatorList(responsibilityId, binSection, binStage,request);
|
|
|
+ List<Map> indicatorMap = getResponsibilityIndicatorList(responsibilityId, binSection, binStage, request);
|
|
|
|
|
|
List<String> idList = indicatorMap.stream()
|
|
|
.map(map -> String.valueOf(map.get("id"))) // 提取每个Map中key为"id"的值,并转换成String
|
|
|
.collect(Collectors.toList()); // 将提取的值收集到List中
|
|
|
- if(null == idList || idList.size()<=0){
|
|
|
- throw new CustomException("未查询到数据");
|
|
|
+ if (null == idList || idList.size() <= 0) {
|
|
|
+ throw new CustomException("未查询到数据");
|
|
|
}
|
|
|
List<IndicatorResDTO> indicatorResDTOS = indicatorService.getGroupChildCodeByIds(idList);
|
|
|
|
|
@@ -238,35 +258,35 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
// 遍历分组后的Map
|
|
|
Map title = new LinkedHashMap();//保存所有的指标名
|
|
|
|
|
|
- for (IndicatorResDTO dto : indicatorResDTOS) {
|
|
|
- List<Map> titleArray = new ArrayList<>();
|
|
|
- // 处理每个分组中的元素
|
|
|
- Map titlemap = new LinkedHashMap();
|
|
|
- titlemap.put("childName",dto.getChildName());//子指标名
|
|
|
- titlemap.put("key", dto.getDeptName());//名称
|
|
|
- titlemap.put("code",dto.getChildCode()+"_"+dto.getOptionCode());//名称
|
|
|
- titlemap.put("flag", dto.getIsQuantified());//是否量化
|
|
|
- titleArray.add(titlemap);
|
|
|
- title.put(dto.getChildName(), titleArray);
|
|
|
- }
|
|
|
+ for (IndicatorResDTO dto : indicatorResDTOS) {
|
|
|
+ List<Map> titleArray = new ArrayList<>();
|
|
|
+ // 处理每个分组中的元素
|
|
|
+ Map titlemap = new LinkedHashMap();
|
|
|
+ titlemap.put("childName", dto.getChildName());//子指标名
|
|
|
+ titlemap.put("key", dto.getDeptName());//名称
|
|
|
+ titlemap.put("code", dto.getChildCode() + "_" + dto.getOptionCode());//名称
|
|
|
+ titlemap.put("flag", dto.getIsQuantified());//是否量化
|
|
|
+ titleArray.add(titlemap);
|
|
|
+ title.put(dto.getChildName(), titleArray);
|
|
|
+ }
|
|
|
|
|
|
//状态标题头
|
|
|
Map deptstateMap = new LinkedHashMap();
|
|
|
List<Map> titlestateArray = new ArrayList<>();
|
|
|
deptstateMap.put("key", "填报状态");//名称
|
|
|
- deptstateMap.put("code","state");//名称
|
|
|
+ deptstateMap.put("code", "state");//名称
|
|
|
deptstateMap.put("flag", false);//是否编辑
|
|
|
titlestateArray.add(deptstateMap);
|
|
|
title.put("状态", titlestateArray);
|
|
|
|
|
|
- data.put("title",title);
|
|
|
+ data.put("title", title);
|
|
|
titlemark = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
//获取数据
|
|
|
List<Map> datamapList = new ArrayList<>();
|
|
|
- List<ResponsibilityIndicatorInfoResDTO> dataList = baseMapper.getResponsibilityInfoList(responsibilityId, indicatorId,organizationShortName, binSection, binStage);
|
|
|
+ List<ResponsibilityIndicatorInfoResDTO> dataList = baseMapper.getResponsibilityInfoList(responsibilityId, indicatorId, organizationShortName, binSection, binStage);
|
|
|
|
|
|
Map<String, List<ResponsibilityIndicatorInfoResDTO>> groupeddataMap = dataList.stream().collect(Collectors.groupingBy(ResponsibilityIndicatorInfoResDTO::getOrganizationId)); // 根据organizationId进行分组
|
|
|
|
|
@@ -287,18 +307,18 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
for (IndicatorResDTO d : indicatorResDTOS) {
|
|
|
boolean mark = true;//标记给公司名赋值
|
|
|
if (mark) {
|
|
|
- indicatormap.put("organizationShortName", resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getOrganizationShortName());//公司名
|
|
|
- indicatormap.put("organizationId", resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getOrganizationId());//公司id
|
|
|
- indicatormap.put("state",resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getState());
|
|
|
- indicatormap.put("IS_LH_state","3");
|
|
|
+ indicatormap.put("organizationShortName", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationShortName());//公司名
|
|
|
+ indicatormap.put("organizationId", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationId());//公司id
|
|
|
+ indicatormap.put("state", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getState());
|
|
|
+ indicatormap.put("IS_LH_state", "3");
|
|
|
mark = false;
|
|
|
}
|
|
|
//指标属性
|
|
|
- indicatormap.put(d.getChildCode() + "_" + d.getOptionCode(), null == resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getNonQuantifiedValue() ? "" : resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getNonQuantifiedValue());
|
|
|
+ indicatormap.put(d.getChildCode() + "_" + d.getOptionCode(), null == resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getNonQuantifiedValue() ? "" : resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getNonQuantifiedValue());
|
|
|
//指标id
|
|
|
- indicatormap.put("ID_" + d.getChildCode() + "_" + d.getOptionCode(), resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getId());
|
|
|
+ indicatormap.put("ID_" + d.getChildCode() + "_" + d.getOptionCode(), resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getId());
|
|
|
//是否量化
|
|
|
- indicatormap.put("IS_LH_" +d.getChildCode() + "_" + d.getOptionCode(),resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getIsQuantified()?"1":"2");
|
|
|
+ indicatormap.put("IS_LH_" + d.getChildCode() + "_" + d.getOptionCode(), resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getIsQuantified() ? "1" : "2");
|
|
|
}
|
|
|
datamapList.add(indicatormap);
|
|
|
}
|
|
@@ -311,24 +331,24 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
@Override
|
|
|
public boolean updateResponsibilityIndicatorInfo(List<JSONObject> jsonObjects) {
|
|
|
|
|
|
- for (JSONObject json :jsonObjects){
|
|
|
+ for (JSONObject json : jsonObjects) {
|
|
|
|
|
|
- Map<String,Object > idMap = new HashMap();
|
|
|
- Map valueMap = new HashMap();
|
|
|
+ Map<String, Object> idMap = new HashMap();
|
|
|
+ Map valueMap = new HashMap();
|
|
|
for (String key : json.keySet()) {
|
|
|
Object value = json.get(key);
|
|
|
- if(key.startsWith("ID_")){
|
|
|
- idMap.put(key,value);
|
|
|
- }else {
|
|
|
- valueMap.put(key,value);
|
|
|
+ if (key.startsWith("ID_")) {
|
|
|
+ idMap.put(key, value);
|
|
|
+ } else {
|
|
|
+ valueMap.put(key, value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<ResponsibilityIndicatorInfo> responsibilityInfos =new ArrayList<>();
|
|
|
- for (Map.Entry<String,Object > entry : idMap.entrySet()) {
|
|
|
+ List<ResponsibilityIndicatorInfo> responsibilityInfos = new ArrayList<>();
|
|
|
+ for (Map.Entry<String, Object> entry : idMap.entrySet()) {
|
|
|
ResponsibilityIndicatorInfo info = new ResponsibilityIndicatorInfo();
|
|
|
info.setId(entry.getValue().toString());
|
|
|
- String quantified = valueMap.get(entry.getKey().replace("ID_","IS_LH_")).toString();
|
|
|
+ String quantified = valueMap.get(entry.getKey().replace("ID_", "IS_LH_")).toString();
|
|
|
|
|
|
if ("1".equals(quantified)) {
|
|
|
|
|
@@ -340,12 +360,12 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
}
|
|
|
|
|
|
|
|
|
- info.setNonQuantifiedValue(valueMap.get(entry.getKey().replace("ID_","")).toString());
|
|
|
+ info.setNonQuantifiedValue(valueMap.get(entry.getKey().replace("ID_", "")).toString());
|
|
|
info.setState(valueMap.get("state").toString());//
|
|
|
responsibilityInfos.add(info);
|
|
|
}
|
|
|
- boolean b = this.saveOrUpdateBatch(responsibilityInfos);
|
|
|
- if(!b){
|
|
|
+ boolean b = this.saveOrUpdateBatch(responsibilityInfos);
|
|
|
+ if (!b) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -361,14 +381,14 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
//获取指标名称
|
|
|
String[] values = new String[]{"不合格", "待确认", "已确认"};
|
|
|
boolean titlemark = true;//标记生成标题
|
|
|
- Map<String ,List<Map<String,String>>> title = new LinkedHashMap();//保存所有的指标名
|
|
|
- List<Map> indicatorMap = getResponsibilityIndicatorList(responsibilityId, binSection, binStage,request);
|
|
|
+ Map<String, List<Map<String, String>>> title = new LinkedHashMap();//保存所有的指标名
|
|
|
+ List<Map> indicatorMap = getResponsibilityIndicatorList(responsibilityId, binSection, binStage, request);
|
|
|
|
|
|
List<String> idList = indicatorMap.stream()
|
|
|
.map(map -> String.valueOf(map.get("id"))) // 提取每个Map中key为"id"的值,并转换成String
|
|
|
.collect(Collectors.toList()); // 将提取的值收集到List中
|
|
|
- if(null == idList || idList.size()<=0){
|
|
|
- throw new CustomException("未查询导数据");
|
|
|
+ if (null == idList || idList.size() <= 0) {
|
|
|
+ throw new CustomException("未查询导数据");
|
|
|
}
|
|
|
List<IndicatorResDTO> indicatorResDTOS = indicatorService.getGroupChildCodeByIds(idList);
|
|
|
|
|
@@ -387,23 +407,23 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
// // 进一步处理每个分组
|
|
|
|
|
|
|
|
|
- for (IndicatorResDTO dto : indicatorResDTOS) {
|
|
|
- Map titlemap = new LinkedHashMap();
|
|
|
- List<Map<String,String>> titleArray = new ArrayList<>();
|
|
|
- // 处理每个分组中的元素
|
|
|
- titlemap.put(dto.getChildCode()+"_"+dto.getOptionCode(),dto.getDeptName());//名称
|
|
|
- titleArray.add(titlemap);
|
|
|
- title.put(dto.getChildName(), titleArray);
|
|
|
- }
|
|
|
+ for (IndicatorResDTO dto : indicatorResDTOS) {
|
|
|
+ Map titlemap = new LinkedHashMap();
|
|
|
+ List<Map<String, String>> titleArray = new ArrayList<>();
|
|
|
+ // 处理每个分组中的元素
|
|
|
+ titlemap.put(dto.getChildCode() + "_" + dto.getOptionCode(), dto.getDeptName());//名称
|
|
|
+ titleArray.add(titlemap);
|
|
|
+ title.put(dto.getChildName(), titleArray);
|
|
|
+ }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//状态标题头
|
|
|
- List<Map<String,String>> titleStateArray = new ArrayList<>();
|
|
|
+ List<Map<String, String>> titleStateArray = new ArrayList<>();
|
|
|
Map titleStateMap = new LinkedHashMap();
|
|
|
- titleStateMap.put("state","填报状态");
|
|
|
+ titleStateMap.put("state", "填报状态");
|
|
|
titleStateArray.add(titleStateMap);
|
|
|
- title.put("状态",titleStateArray);
|
|
|
+ title.put("状态", titleStateArray);
|
|
|
|
|
|
titlemark = false;
|
|
|
}
|
|
@@ -411,7 +431,7 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
|
|
|
//获取数据
|
|
|
List<Map> datamapList = new ArrayList<>();
|
|
|
- List<ResponsibilityIndicatorInfoResDTO> dataList = baseMapper.getResponsibilityInfoList(responsibilityId, indicatorId,"", binSection, binStage);
|
|
|
+ List<ResponsibilityIndicatorInfoResDTO> dataList = baseMapper.getResponsibilityInfoList(responsibilityId, indicatorId, "", binSection, binStage);
|
|
|
|
|
|
Map<String, List<ResponsibilityIndicatorInfoResDTO>> groupeddataMap = dataList.stream().collect(Collectors.groupingBy(ResponsibilityIndicatorInfoResDTO::getOrganizationId)); // 根据organizationId进行分组
|
|
|
|
|
@@ -433,22 +453,20 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
for (IndicatorResDTO d : indicatorResDTOS) {
|
|
|
boolean mark = true;//标记给公司名赋值
|
|
|
if (mark) {
|
|
|
- indicatormap.put("organizationShortName", resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getOrganizationShortName());//公司名
|
|
|
- indicatormap.put("organizationId", resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getOrganizationId());//公司id
|
|
|
- String state2 = resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getState();//(-1:不合格;0:待确认;1:已确认)
|
|
|
- state = stateConvert(state2,true);
|
|
|
+ indicatormap.put("organizationShortName", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationShortName());//公司名
|
|
|
+ indicatormap.put("organizationId", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationId());//公司id
|
|
|
+ String state2 = resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getState();//(-1:不合格;0:待确认;1:已确认)
|
|
|
+ state = stateConvert(state2, true);
|
|
|
mark = false;
|
|
|
}
|
|
|
//指标属性
|
|
|
- indicatormap.put(d.getChildCode() + "_" + d.getOptionCode(), null == resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getNonQuantifiedValue() ? "" : resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getNonQuantifiedValue());
|
|
|
+ indicatormap.put(d.getChildCode() + "_" + d.getOptionCode(), null == resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getNonQuantifiedValue() ? "" : resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getNonQuantifiedValue());
|
|
|
}
|
|
|
- indicatormap.put("state",state);//状态
|
|
|
+ indicatormap.put("state", state);//状态
|
|
|
datamapList.add(indicatormap);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//获取主表对象
|
|
|
|
|
|
DeptResponsibility responsibility = deptResponsibilityService.getById(responsibilityId);
|
|
@@ -503,7 +521,7 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
|
|
|
|
|
|
Cell header3Cell0 = headerRow3.createCell(0);
|
|
|
- header3Cell0.setCellValue("zhidmap,respId="+responsibilityId);
|
|
|
+ header3Cell0.setCellValue("zhidmap,respId=" + responsibilityId);
|
|
|
|
|
|
Cell header3Cell1 = headerRow3.createCell(1);
|
|
|
header3Cell1.setCellValue("organizationShortName");
|
|
@@ -514,29 +532,29 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
|
|
|
Integer colsize = 2;
|
|
|
Integer optioncols = 3;
|
|
|
- for (String key : title.keySet()) {//存在多个标题
|
|
|
- List<Map<String,String>> titleArray2 = title.get(key);
|
|
|
- Cell headerCellcolsize = headerRow1.createCell(colsize+1);
|
|
|
+ for (String key : title.keySet()) {//存在多个标题
|
|
|
+ List<Map<String, String>> titleArray2 = title.get(key);
|
|
|
+ Cell headerCellcolsize = headerRow1.createCell(colsize + 1);
|
|
|
headerCellcolsize.setCellValue(key);
|
|
|
|
|
|
|
|
|
//设置宽度
|
|
|
int contentWidth = headerCellcolsize.getStringCellValue().length() * 310;
|
|
|
- contentWidth = (contentWidth<=4000) ? 4000 :5000;
|
|
|
+ contentWidth = (contentWidth <= 4000) ? 4000 : 5000;
|
|
|
// 设置指定列的宽度为计算得到的宽度值
|
|
|
- sheet.setColumnWidth(colsize+1, contentWidth);
|
|
|
+ sheet.setColumnWidth(colsize + 1, contentWidth);
|
|
|
|
|
|
headerCellcolsize.setCellStyle(cellStyle);
|
|
|
headerCellcolsize.setCellStyle(cellStyle);
|
|
|
|
|
|
- System.out.println("key="+key);
|
|
|
+ System.out.println("key=" + key);
|
|
|
|
|
|
- for (Map<String,String> key2 : titleArray2) {
|
|
|
- if(key2.size()>1){
|
|
|
- sheet.addMergedRegion(new CellRangeAddress(1, 1, colsize+1, colsize + key2.size()));
|
|
|
+ for (Map<String, String> key2 : titleArray2) {
|
|
|
+ if (key2.size() > 1) {
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(1, 1, colsize + 1, colsize + key2.size()));
|
|
|
}
|
|
|
colsize = colsize + key2.size();
|
|
|
- for (String key3 : key2.keySet()) {
|
|
|
+ for (String key3 : key2.keySet()) {
|
|
|
|
|
|
Cell header3Cell3 = headerRow3.createCell(optioncols);
|
|
|
header3Cell3.setCellValue(key3);
|
|
@@ -547,7 +565,7 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
header2Cell2.setCellStyle(cellStyle);
|
|
|
|
|
|
// 隐藏列
|
|
|
- if(key3.startsWith("ID_") || key3.startsWith("IS_LH_")){
|
|
|
+ if (key3.startsWith("ID_") || key3.startsWith("IS_LH_")) {
|
|
|
sheet.setColumnHidden(optioncols, true);
|
|
|
}
|
|
|
optioncols++;
|
|
@@ -557,19 +575,19 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
|
|
|
|
|
|
Integer rowdate = 4;
|
|
|
- for (Map<String,String > datamaps : datamapList) {
|
|
|
+ for (Map<String, String> datamaps : datamapList) {
|
|
|
Integer colsdata = 1;
|
|
|
Row headerRowdate = sheet.createRow(rowdate);
|
|
|
Cell dataCell0 = headerRowdate.createCell(0);
|
|
|
- dataCell0.setCellValue(rowdate-3);
|
|
|
+ dataCell0.setCellValue(rowdate - 3);
|
|
|
dataCell0.setCellStyle(cellStyle);
|
|
|
- for (String datakey: datamaps.keySet()) {
|
|
|
+ for (String datakey : datamaps.keySet()) {
|
|
|
|
|
|
Cell dataCell1 = headerRowdate.createCell(colsdata);
|
|
|
dataCell1.setCellValue(datamaps.get(datakey).toString());
|
|
|
dataCell1.setCellStyle(cellStyle);
|
|
|
|
|
|
- if("state".equals(datakey)){
|
|
|
+ if ("state".equals(datakey)) {
|
|
|
// 创建一个数据验证对象
|
|
|
DataValidationHelper validationHelper = sheet.getDataValidationHelper();
|
|
|
DataValidationConstraint constraint = validationHelper.createExplicitListConstraint(values);
|
|
@@ -658,35 +676,37 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
}
|
|
|
workbook.close();
|
|
|
|
|
|
- for(Map<String, Object> map : dataList){
|
|
|
- Map<String,String > idMap = new HashMap();
|
|
|
- Map<String,String > valueMap = new HashMap();
|
|
|
+ for (Map<String, Object> map : dataList) {
|
|
|
+ Map<String, String> idMap = new HashMap();
|
|
|
+ Map<String, String> valueMap = new HashMap();
|
|
|
for (String key : map.keySet()) {
|
|
|
String value = String.valueOf(map.get(key));
|
|
|
- if(key.startsWith("zhidmap")){
|
|
|
+ if (key.startsWith("zhidmap")) {
|
|
|
String[] zhidmap = key.split(",");
|
|
|
- idMap.put("respId",zhidmap[1].split("=")[1]);
|
|
|
+ idMap.put("respId", zhidmap[1].split("=")[1]);
|
|
|
continue;
|
|
|
- }if(key.startsWith("organization")){
|
|
|
- idMap.put(key,value);
|
|
|
+ }
|
|
|
+ if (key.startsWith("organization")) {
|
|
|
+ idMap.put(key, value);
|
|
|
continue;
|
|
|
- }if(key.startsWith("state")){
|
|
|
- idMap.put(key,value);
|
|
|
+ }
|
|
|
+ if (key.startsWith("state")) {
|
|
|
+ idMap.put(key, value);
|
|
|
continue;
|
|
|
- }else {
|
|
|
- valueMap.put(key,value);
|
|
|
+ } else {
|
|
|
+ valueMap.put(key, value);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- List<ResponsibilityIndicatorInfo> responsibilityInfos =new ArrayList<>();
|
|
|
- for (Map.Entry<String,String > entry : valueMap.entrySet()) {
|
|
|
+ List<ResponsibilityIndicatorInfo> responsibilityInfos = new ArrayList<>();
|
|
|
+ for (Map.Entry<String, String> entry : valueMap.entrySet()) {
|
|
|
//organizationEvaluationId 考评记录id
|
|
|
// organizationId 组织id
|
|
|
// childOptionCode 组合子指标和指标项
|
|
|
- List<ResponsibilityIndicatorInfo> responsibilityInfoList = getResponsibilityInfooByOptionCodeList(idMap.get("respId"),idMap.get("organizationId"),entry.getKey());
|
|
|
+ List<ResponsibilityIndicatorInfo> responsibilityInfoList = getResponsibilityInfooByOptionCodeList(idMap.get("respId"), idMap.get("organizationId"), entry.getKey());
|
|
|
ResponsibilityIndicatorInfo info = new ResponsibilityIndicatorInfo();
|
|
|
ResponsibilityIndicatorInfo oriinfo = null;
|
|
|
- if(null !=responsibilityInfoList && responsibilityInfoList.size()>0){
|
|
|
+ if (null != responsibilityInfoList && responsibilityInfoList.size() > 0) {
|
|
|
oriinfo = responsibilityInfoList.get(0);//原始数据
|
|
|
info.setId(oriinfo.getId());
|
|
|
}
|
|
@@ -699,8 +719,8 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
}
|
|
|
}
|
|
|
info.setNonQuantifiedValue(entry.getValue());
|
|
|
- String state2 = idMap.get("state").toString();
|
|
|
- String state = stateConvert(state2,false);
|
|
|
+ String state2 = idMap.get("state").toString();
|
|
|
+ String state = stateConvert(state2, false);
|
|
|
info.setState(state);
|
|
|
responsibilityInfos.add(info);
|
|
|
}
|
|
@@ -735,13 +755,14 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
|
|
|
/**
|
|
|
* 状态抓换 (-1:不合格;0:待确认;1:已确认)
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- private String stateConvert(String state,boolean flge) {
|
|
|
+ private String stateConvert(String state, boolean flge) {
|
|
|
// (-1:不合格;0:待确认;1:已确认)
|
|
|
String state2 = "";
|
|
|
if (flge) {
|
|
|
- if(StringUtils.isEmpty(state)){
|
|
|
+ if (StringUtils.isEmpty(state)) {
|
|
|
state2 = "待确认";
|
|
|
return state2;
|
|
|
}
|
|
@@ -762,7 +783,7 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- if(StringUtils.isEmpty(state)){
|
|
|
+ if (StringUtils.isEmpty(state)) {
|
|
|
state2 = "0";
|
|
|
return state2;
|
|
|
}
|