|
@@ -45,8 +45,8 @@ import static com.ims.eval.util.ExcelUtil.readExcel;
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* 考评指标明细
|
|
* 考评指标明细
|
|
-
|
|
|
|
- 服务实现类
|
|
|
|
|
|
+ * <p>
|
|
|
|
+ * 服务实现类
|
|
* </p>
|
|
* </p>
|
|
*
|
|
*
|
|
* @author wang
|
|
* @author wang
|
|
@@ -81,7 +81,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
private IOrganizationEvaluationService organizationEvaluationService;
|
|
private IOrganizationEvaluationService organizationEvaluationService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private IOrganizationEvaluationRuleService organizationEvaluationRuleService;
|
|
|
|
|
|
+ private IOrganizationEvaluationRuleService organizationEvaluationRuleService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private WorkflowServiceImpl workflowService;
|
|
private WorkflowServiceImpl workflowService;
|
|
@@ -91,17 +91,14 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
private ICiteCalculationIndicatorService citeCalculationIndicatorService;
|
|
private ICiteCalculationIndicatorService citeCalculationIndicatorService;
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Map finishValueList(String organizationEvaluationId, String dept, HttpServletRequest request) {
|
|
public Map finishValueList(String organizationEvaluationId, String dept, HttpServletRequest request) {
|
|
|
|
|
|
- List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectListEvaluationInfoId(organizationEvaluationId,dept,"","");//默认获取指定的怎目标
|
|
|
|
- list.stream().forEach(i->{
|
|
|
|
|
|
+ List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectListEvaluationInfoId(organizationEvaluationId, dept, "", "");//默认获取指定的怎目标
|
|
|
|
+ list.stream().forEach(i -> {
|
|
i.setUpdateMark(true);
|
|
i.setUpdateMark(true);
|
|
});
|
|
});
|
|
- Map<String ,List<OrganizationEvaluationInfoResDTO>> map = list.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getIsQuantified));
|
|
|
|
|
|
+ Map<String, List<OrganizationEvaluationInfoResDTO>> map = list.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getIsQuantified));
|
|
map.put("quantifiedList", map.remove(true));
|
|
map.put("quantifiedList", map.remove(true));
|
|
map.put("nonQuantifiedList", map.remove(false));
|
|
map.put("nonQuantifiedList", map.remove(false));
|
|
return map;
|
|
return map;
|
|
@@ -116,14 +113,14 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
OrganizationEvaluationInfo info = baseMapper.selectById(entity.getId());
|
|
OrganizationEvaluationInfo info = baseMapper.selectById(entity.getId());
|
|
|
|
|
|
info.setQuantifiedValue(entity.getQuantifiedValue());//量化值
|
|
info.setQuantifiedValue(entity.getQuantifiedValue());//量化值
|
|
- if(!entity.getIsQuantified() && "JKF".equals(info.getOptionCode())){//加扣分
|
|
|
|
- if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
|
|
|
|
|
|
+ if (!entity.getIsQuantified() && "JKF".equals(info.getOptionCode())) {//加扣分
|
|
|
|
+ if (StringUtils.isNumber(entity.getNonQuantifiedValue())) {
|
|
info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(!entity.getIsQuantified() && "JCF".equals(info.getOptionCode())){//基础分
|
|
|
|
- if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
|
|
|
|
|
|
+ if (!entity.getIsQuantified() && "JCF".equals(info.getOptionCode())) {//基础分
|
|
|
|
+ if (StringUtils.isNumber(entity.getNonQuantifiedValue())) {
|
|
info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
info.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -134,17 +131,17 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
info.setRemark(entity.getRemark());//备注
|
|
info.setRemark(entity.getRemark());//备注
|
|
info.setState(entity.getState());//初始状态
|
|
info.setState(entity.getState());//初始状态
|
|
boolean b = super.saveOrUpdate(info);
|
|
boolean b = super.saveOrUpdate(info);
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new CustomException("更新失败");
|
|
throw new CustomException("更新失败");
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
entity.setCreateTime(new Date());
|
|
entity.setCreateTime(new Date());
|
|
|
|
|
|
if (StringUtils.isEmpty(entity.getIndicatorId())) {
|
|
if (StringUtils.isEmpty(entity.getIndicatorId())) {
|
|
throw new CustomException("保存失败");
|
|
throw new CustomException("保存失败");
|
|
}
|
|
}
|
|
- List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("",entity.getIndicatorId(),"","");
|
|
|
|
- for(IndicatorDictionary d : dictionaryList){
|
|
|
|
|
|
+ List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("", entity.getIndicatorId(), "", "");
|
|
|
|
+ for (IndicatorDictionary d : dictionaryList) {
|
|
|
|
|
|
OrganizationEvaluationInfo addinfo = new OrganizationEvaluationInfo();
|
|
OrganizationEvaluationInfo addinfo = new OrganizationEvaluationInfo();
|
|
addinfo.setOrganizationEvaluationId(entity.getOrganizationEvaluationId());
|
|
addinfo.setOrganizationEvaluationId(entity.getOrganizationEvaluationId());
|
|
@@ -156,14 +153,14 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
addinfo.setIsQuantified(entity.getIsQuantified());
|
|
addinfo.setIsQuantified(entity.getIsQuantified());
|
|
addinfo.setQuantifiedValue(entity.getQuantifiedValue());
|
|
addinfo.setQuantifiedValue(entity.getQuantifiedValue());
|
|
|
|
|
|
- if(!entity.getIsQuantified() && "JKF".equals(d.getOptionCode())){//加扣分
|
|
|
|
- if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
|
|
|
|
|
|
+ if (!entity.getIsQuantified() && "JKF".equals(d.getOptionCode())) {//加扣分
|
|
|
|
+ if (StringUtils.isNumber(entity.getNonQuantifiedValue())) {
|
|
addinfo.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
addinfo.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(!entity.getIsQuantified() && "JCF".equals(d.getOptionCode())){//基础分
|
|
|
|
- if(StringUtils.isNumber(entity.getNonQuantifiedValue())){
|
|
|
|
|
|
+ if (!entity.getIsQuantified() && "JCF".equals(d.getOptionCode())) {//基础分
|
|
|
|
+ if (StringUtils.isNumber(entity.getNonQuantifiedValue())) {
|
|
addinfo.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
addinfo.setQuantifiedValue(Double.valueOf(entity.getNonQuantifiedValue()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -172,7 +169,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
addinfo.setCreateTime(new Date());
|
|
addinfo.setCreateTime(new Date());
|
|
|
|
|
|
boolean b = super.saveOrUpdate(addinfo);
|
|
boolean b = super.saveOrUpdate(addinfo);
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new CustomException("保存失败");
|
|
throw new CustomException("保存失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -198,28 +195,24 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
- public List<OrganizationEvaluationInfoResDTO> finishValueList(String organizationEvaluationId, String dept, String organizationShortName, String indicatorName, String binSection,String isQuantified, HttpServletRequest request) {
|
|
|
|
- List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectListEvaluationInfoId2(organizationEvaluationId,dept,organizationShortName,indicatorName,binSection,isQuantified,"","");//默认获取指定的怎目标
|
|
|
|
|
|
+ public List<OrganizationEvaluationInfoResDTO> finishValueList(String organizationEvaluationId, String dept, String organizationShortName, String indicatorName, String binSection, String isQuantified, HttpServletRequest request) {
|
|
|
|
+ List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectListEvaluationInfoId2(organizationEvaluationId, dept, organizationShortName, indicatorName, binSection, isQuantified, "", "");//默认获取指定的怎目标
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public boolean calculationByEvaluationId(String id, String indicatorId,String organizationEvaluationId,String optionCode) {
|
|
|
|
|
|
+ public boolean calculationByEvaluationId(String id, String indicatorId, String organizationEvaluationId, String optionCode, String binStage, String binSection) {
|
|
try {
|
|
try {
|
|
- List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectByIdAndEvaluationInfoId(id,indicatorId,organizationEvaluationId,"");
|
|
|
|
|
|
+ List<OrganizationEvaluationInfoResDTO> list = baseMapper.selectByIdAndEvaluationInfoId(id, indicatorId, organizationEvaluationId, "", binStage, binSection);
|
|
//根据板块分组
|
|
//根据板块分组
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> binSectionGropList = list.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getBinSection));
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> binSectionGropList = list.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getBinSection));
|
|
|
|
|
|
//计算前置属性(差值、利润贡献、单位千瓦利润)的最大最小值
|
|
//计算前置属性(差值、利润贡献、单位千瓦利润)的最大最小值
|
|
- for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> binSectionGropEntry : binSectionGropList.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> binSectionGropEntry : binSectionGropList.entrySet()) {
|
|
|
|
|
|
List<OrganizationEvaluationInfo> listUpdateInfos = new ArrayList<>();
|
|
List<OrganizationEvaluationInfo> listUpdateInfos = new ArrayList<>();
|
|
- if (binSectionGropEntry.getValue().size() > 0){
|
|
|
|
|
|
+ if (binSectionGropEntry.getValue().size() > 0) {
|
|
//按照指标分组
|
|
//按照指标分组
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropList = binSectionGropEntry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getIndicatorId));
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropList = binSectionGropEntry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getIndicatorId));
|
|
for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropListEntry : indicatorGropList.entrySet()) {
|
|
for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropListEntry : indicatorGropList.entrySet()) {
|
|
@@ -239,8 +232,8 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> childCodeGropListEntry : childCodeGropList.entrySet()) {
|
|
for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> childCodeGropListEntry : childCodeGropList.entrySet()) {
|
|
for (OrganizationEvaluationInfoResDTO dto : childCodeGropListEntry.getValue()) {
|
|
for (OrganizationEvaluationInfoResDTO dto : childCodeGropListEntry.getValue()) {
|
|
|
|
|
|
- if (!(dto.getOptionCode().equals("LRZE") || dto.getOptionCode().equals("CZ") || dto.getOptionCode().equals("LRGXKH")|| dto.getOptionCode().equals("LRGXL") || dto.getOptionCode().equals("DWQWLR")) || StringUtils.isEmpty(dto.getFormula())) {
|
|
|
|
- System.out.println("前置跳过--|"+dto.getOptionCode());
|
|
|
|
|
|
+ if (!(dto.getOptionCode().equals("LRZE") || dto.getOptionCode().equals("CZ") || dto.getOptionCode().equals("LRGXKH") || dto.getOptionCode().equals("LRGXL") || dto.getOptionCode().equals("DWQWLR")) || StringUtils.isEmpty(dto.getFormula())) {
|
|
|
|
+ System.out.println("前置跳过--|" + dto.getOptionCode());
|
|
continue;//当前属性没有配置公式跳过
|
|
continue;//当前属性没有配置公式跳过
|
|
}
|
|
}
|
|
|
|
|
|
@@ -248,8 +241,8 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
List<String> optionCodes = getOptionCode(dto.getFormula());
|
|
List<String> optionCodes = getOptionCode(dto.getFormula());
|
|
|
|
|
|
List<OrganizationEvaluationInfoResDTO> newInfoResInfo = childCodeGropListEntry.getValue().stream()
|
|
List<OrganizationEvaluationInfoResDTO> newInfoResInfo = childCodeGropListEntry.getValue().stream()
|
|
- .filter(item -> optionCodes.contains(item.getOptionCode()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
+ .filter(item -> optionCodes.contains(item.getOptionCode()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
//循环替换属性
|
|
//循环替换属性
|
|
for (OrganizationEvaluationInfoResDTO f : newInfoResInfo) {
|
|
for (OrganizationEvaluationInfoResDTO f : newInfoResInfo) {
|
|
@@ -278,81 +271,81 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
//计算差值等的最大值最小值
|
|
//计算差值等的最大值最小值
|
|
|
|
|
|
- if(null != listUpdateInfos && listUpdateInfos.size()>0){
|
|
|
|
|
|
+ if (null != listUpdateInfos && listUpdateInfos.size() > 0) {
|
|
this.saveOrUpdateBatch(listUpdateInfos);
|
|
this.saveOrUpdateBatch(listUpdateInfos);
|
|
}
|
|
}
|
|
|
|
|
|
- iCalculateIndicatorItemInfoService.saveIndicatorInfoDTO(organizationEvaluationId,indicatorGropListEntry.getValue(),indicatorGropListEntry.getKey());
|
|
|
|
|
|
+ iCalculateIndicatorItemInfoService.saveIndicatorInfoDTO(organizationEvaluationId, indicatorGropListEntry.getValue(), indicatorGropListEntry.getKey());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//获取计算的差值最大最小值
|
|
//获取计算的差值最大最小值
|
|
- List<CalculateIndicatorItemInfo> calculateIndicatorItemInfos = calculateIndicatorItemInfoMapper.selectList("","","","","",organizationEvaluationId,"");
|
|
|
|
|
|
+ List<CalculateIndicatorItemInfo> calculateIndicatorItemInfos = calculateIndicatorItemInfoMapper.selectList("", "", "", "", "", organizationEvaluationId, "");
|
|
Map<String, List<CalculateIndicatorItemInfo>> groupedItemInfoMap = calculateIndicatorItemInfos.stream()
|
|
Map<String, List<CalculateIndicatorItemInfo>> groupedItemInfoMap = calculateIndicatorItemInfos.stream()
|
|
.collect(Collectors.groupingBy(item -> item.getIndicatorId() + "_" + item.getChildCode()));
|
|
.collect(Collectors.groupingBy(item -> item.getIndicatorId() + "_" + item.getChildCode()));
|
|
|
|
|
|
//计算得分
|
|
//计算得分
|
|
- for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> binSectionGropEntry : binSectionGropList.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> binSectionGropEntry : binSectionGropList.entrySet()) {
|
|
|
|
|
|
- if (binSectionGropEntry.getValue().size() > 0){
|
|
|
|
|
|
+ if (binSectionGropEntry.getValue().size() > 0) {
|
|
List<OrganizationEvaluationInfo> listUpdateInfos = new ArrayList<>();
|
|
List<OrganizationEvaluationInfo> listUpdateInfos = new ArrayList<>();
|
|
//按照指标分组
|
|
//按照指标分组
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropList = binSectionGropEntry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getIndicatorId));
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropList = binSectionGropEntry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getIndicatorId));
|
|
|
|
|
|
- for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropListEntry : indicatorGropList.entrySet()){
|
|
|
|
- for (OrganizationEvaluationInfoResDTO d : indicatorGropListEntry.getValue()){
|
|
|
|
- System.out.println(d.getOrganizationShortName()+"|"+d.getIndicatorName()+"|"+d.getOptionName()+"|"+d.getQuantifiedValue());
|
|
|
|
|
|
+ for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> indicatorGropListEntry : indicatorGropList.entrySet()) {
|
|
|
|
+ for (OrganizationEvaluationInfoResDTO d : indicatorGropListEntry.getValue()) {
|
|
|
|
+ System.out.println(d.getOrganizationShortName() + "|" + d.getIndicatorName() + "|" + d.getOptionName() + "|" + d.getQuantifiedValue());
|
|
}
|
|
}
|
|
|
|
|
|
- if (indicatorGropListEntry.getValue().size() > 0){
|
|
|
|
|
|
+ if (indicatorGropListEntry.getValue().size() > 0) {
|
|
//按照公司规则分组
|
|
//按照公司规则分组
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> ruleIdGropList = indicatorGropListEntry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getOrganizationEvaluationRuleId));
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> ruleIdGropList = indicatorGropListEntry.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getOrganizationEvaluationRuleId));
|
|
|
|
|
|
|
|
|
|
//遍历公司指标
|
|
//遍历公司指标
|
|
- for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> ruleIdGropListEntry : ruleIdGropList.entrySet()){
|
|
|
|
- if (ruleIdGropListEntry.getValue().size() > 0){
|
|
|
|
|
|
+ for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> ruleIdGropListEntry : ruleIdGropList.entrySet()) {
|
|
|
|
+ if (ruleIdGropListEntry.getValue().size() > 0) {
|
|
|
|
|
|
List<OrganizationEvaluationInfoResDTO> indicator = ruleIdGropListEntry.getValue();
|
|
List<OrganizationEvaluationInfoResDTO> indicator = ruleIdGropListEntry.getValue();
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> childCodeGropList = indicator.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getChildCode));
|
|
Map<String, List<OrganizationEvaluationInfoResDTO>> childCodeGropList = indicator.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getChildCode));
|
|
double totalScore = 0.00;
|
|
double totalScore = 0.00;
|
|
EvaluationScoreCount scoreCount = new EvaluationScoreCount();
|
|
EvaluationScoreCount scoreCount = new EvaluationScoreCount();
|
|
double standardScore = 0;
|
|
double standardScore = 0;
|
|
- for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> childCodeGropListEntry : childCodeGropList.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> childCodeGropListEntry : childCodeGropList.entrySet()) {
|
|
|
|
|
|
// List<CalculateIndicatorItemInfo> calculateIndicatorItemInfo = calculateIndicatorItemInfoMapper.selectList("","","","",childCodeGropListEntry.getValue().get(0).getIndicatorId(),childCodeGropListEntry.getValue().get(0).getOrganizationEvaluationId(),childCodeGropListEntry.getValue().get(0).getChildCode());
|
|
// List<CalculateIndicatorItemInfo> calculateIndicatorItemInfo = calculateIndicatorItemInfoMapper.selectList("","","","",childCodeGropListEntry.getValue().get(0).getIndicatorId(),childCodeGropListEntry.getValue().get(0).getOrganizationEvaluationId(),childCodeGropListEntry.getValue().get(0).getChildCode());
|
|
- List<CalculateIndicatorItemInfo> calculateIndicatorItemInfo = groupedItemInfoMap.get(childCodeGropListEntry.getValue().get(0).getIndicatorId()+"_"+childCodeGropListEntry.getValue().get(0).getChildCode());
|
|
|
|
|
|
+ List<CalculateIndicatorItemInfo> calculateIndicatorItemInfo = groupedItemInfoMap.get(childCodeGropListEntry.getValue().get(0).getIndicatorId() + "_" + childCodeGropListEntry.getValue().get(0).getChildCode());
|
|
|
|
|
|
- Map<String ,Double> map = new HashMap<>();
|
|
|
|
|
|
+ Map<String, Double> map = new HashMap<>();
|
|
if (null != calculateIndicatorItemInfo && calculateIndicatorItemInfo.size() > 0) {
|
|
if (null != calculateIndicatorItemInfo && calculateIndicatorItemInfo.size() > 0) {
|
|
for (CalculateIndicatorItemInfo itemInfo : calculateIndicatorItemInfo) {
|
|
for (CalculateIndicatorItemInfo itemInfo : calculateIndicatorItemInfo) {
|
|
map.put(itemInfo.getOptionCode(), itemInfo.getQuantifiedValue());
|
|
map.put(itemInfo.getOptionCode(), itemInfo.getQuantifiedValue());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- for (OrganizationEvaluationInfoResDTO dto: childCodeGropListEntry.getValue()){
|
|
|
|
|
|
+ for (OrganizationEvaluationInfoResDTO dto : childCodeGropListEntry.getValue()) {
|
|
|
|
|
|
//保存加减分原因
|
|
//保存加减分原因
|
|
- if("YY".equals(dto.getOptionCode()) || "JFYY".equals(dto.getOptionCode()) ||"KFYY".equals(dto.getOptionCode())){
|
|
|
|
- scoreCount.setJfRemark(("YY".equals(dto.getOptionCode()) || "JFYY".equals(dto.getOptionCode()))?dto.getNonQuantifiedValue():"");
|
|
|
|
- scoreCount.setKfRemark("KFYY".equals(dto.getOptionCode()) ? dto.getNonQuantifiedValue():"");
|
|
|
|
|
|
+ if ("YY".equals(dto.getOptionCode()) || "JFYY".equals(dto.getOptionCode()) || "KFYY".equals(dto.getOptionCode())) {
|
|
|
|
+ scoreCount.setJfRemark(("YY".equals(dto.getOptionCode()) || "JFYY".equals(dto.getOptionCode())) ? dto.getNonQuantifiedValue() : "");
|
|
|
|
+ scoreCount.setKfRemark("KFYY".equals(dto.getOptionCode()) ? dto.getNonQuantifiedValue() : "");
|
|
}
|
|
}
|
|
|
|
|
|
//保存加减分
|
|
//保存加减分
|
|
- if("JF".equals(dto.getOptionCode())){
|
|
|
|
|
|
+ if ("JF".equals(dto.getOptionCode())) {
|
|
scoreCount.setJfScore(dto.getQuantifiedValue());
|
|
scoreCount.setJfScore(dto.getQuantifiedValue());
|
|
}
|
|
}
|
|
- if("KF".equals(dto.getOptionCode())){
|
|
|
|
|
|
+ if ("KF".equals(dto.getOptionCode())) {
|
|
scoreCount.setKfScore(dto.getQuantifiedValue());
|
|
scoreCount.setKfScore(dto.getQuantifiedValue());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- if ((dto.getOptionCode().endsWith("MAX") ||dto.getOptionCode().endsWith("MIN")
|
|
|
|
- ||dto.getOptionCode().equals("CZ") || dto.getOptionCode().equals("LRGXL")
|
|
|
|
- || dto.getOptionCode().equals("DWQWLR")) || StringUtils.isEmpty(dto.getFormula())){
|
|
|
|
|
|
+ if ((dto.getOptionCode().endsWith("MAX") || dto.getOptionCode().endsWith("MIN")
|
|
|
|
+ || dto.getOptionCode().equals("CZ") || dto.getOptionCode().equals("LRGXL")
|
|
|
|
+ || dto.getOptionCode().equals("DWQWLR")) || StringUtils.isEmpty(dto.getFormula())) {
|
|
|
|
|
|
- if(!(dto.getOptionCode().equals("DF")||dto.getOptionCode().equals("DF2")||dto.getOptionCode().equals("JHDF"))){
|
|
|
|
|
|
+ if (!(dto.getOptionCode().equals("DF") || dto.getOptionCode().equals("DF2") || dto.getOptionCode().equals("JHDF"))) {
|
|
continue;//当前属性没有配置公式跳过或者不需要参与此次计算的属性
|
|
continue;//当前属性没有配置公式跳过或者不需要参与此次计算的属性
|
|
}
|
|
}
|
|
|
|
|
|
@@ -366,60 +359,60 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
//获取去参与计算的属性
|
|
//获取去参与计算的属性
|
|
List<String> optionCodes = getOptionCode(dto.getFormula());
|
|
List<String> optionCodes = getOptionCode(dto.getFormula());
|
|
List<OrganizationEvaluationInfoResDTO> newInfoResInfo = childCodeGropListEntry.getValue().stream()
|
|
List<OrganizationEvaluationInfoResDTO> newInfoResInfo = childCodeGropListEntry.getValue().stream()
|
|
- .filter(item -> optionCodes.contains(item.getOptionCode()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
+ .filter(item -> optionCodes.contains(item.getOptionCode()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
//替换属性值
|
|
//替换属性值
|
|
- for (OrganizationEvaluationInfoResDTO f : newInfoResInfo){
|
|
|
|
- if(f.getOptionCode().endsWith("MIN") || f.getOptionCode().endsWith("MAX")){
|
|
|
|
|
|
+ for (OrganizationEvaluationInfoResDTO f : newInfoResInfo) {
|
|
|
|
+ if (f.getOptionCode().endsWith("MIN") || f.getOptionCode().endsWith("MAX")) {
|
|
f.setQuantifiedValue(map.get(f.getOptionCode()));
|
|
f.setQuantifiedValue(map.get(f.getOptionCode()));
|
|
}
|
|
}
|
|
- dto.setFormula(dto.getFormula().replace("["+f.getOptionCode()+"]", f.getQuantifiedValue() + ""));
|
|
|
|
|
|
+ dto.setFormula(dto.getFormula().replace("[" + f.getOptionCode() + "]", f.getQuantifiedValue() + ""));
|
|
}
|
|
}
|
|
- log.info("计算公式为:"+dto.getFormula());
|
|
|
|
|
|
+ log.info("计算公式为:" + dto.getFormula());
|
|
double score = 0.00;
|
|
double score = 0.00;
|
|
- if(StringUtils.isNotEmpty(dto.getFormula())){
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getFormula())) {
|
|
score = FormulaUtils.calculateFormula(dto.getFormula());
|
|
score = FormulaUtils.calculateFormula(dto.getFormula());
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
score = dto.getQuantifiedValue();
|
|
score = dto.getQuantifiedValue();
|
|
}
|
|
}
|
|
|
|
|
|
- if(dto.getOptionCode().equals("DF")||dto.getOptionCode().equals("DF2")
|
|
|
|
- ||dto.getOptionCode().equals("JHDF")){
|
|
|
|
|
|
+ if (dto.getOptionCode().equals("DF") || dto.getOptionCode().equals("DF2")
|
|
|
|
+ || dto.getOptionCode().equals("JHDF")) {
|
|
standardScore = dto.getStandardScore();
|
|
standardScore = dto.getStandardScore();
|
|
- totalScore = totalScore+score;
|
|
|
|
|
|
+ totalScore = totalScore + score;
|
|
scoreCount.setRemark(dto.getIndicatorName());
|
|
scoreCount.setRemark(dto.getIndicatorName());
|
|
}
|
|
}
|
|
|
|
|
|
- log.info(dto.getOrganizationShortName()+"|"+dto.getIndicatorName()+"|"+dto.getOptionCode()+"----------"+dto.getFormula()+"="+score);
|
|
|
|
- OrganizationEvaluationInfo info = new OrganizationEvaluationInfo();
|
|
|
|
|
|
+ log.info(dto.getOrganizationShortName() + "|" + dto.getIndicatorName() + "|" + dto.getOptionCode() + "----------" + dto.getFormula() + "=" + score);
|
|
|
|
+ OrganizationEvaluationInfo info = new OrganizationEvaluationInfo();
|
|
//将计算结果保存
|
|
//将计算结果保存
|
|
info.setId(dto.getId());
|
|
info.setId(dto.getId());
|
|
info.setQuantifiedValue(score);
|
|
info.setQuantifiedValue(score);
|
|
- info.setNonQuantifiedValue(score+"");
|
|
|
|
|
|
+ info.setNonQuantifiedValue(score + "");
|
|
dto.setQuantifiedValue(score);
|
|
dto.setQuantifiedValue(score);
|
|
- dto.setNonQuantifiedValue(score+"");
|
|
|
|
|
|
+ dto.setNonQuantifiedValue(score + "");
|
|
listUpdateInfos.add(info);
|
|
listUpdateInfos.add(info);
|
|
// this.saveOrUpdate(info);
|
|
// this.saveOrUpdate(info);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- log.info("综合得分:"+totalScore);
|
|
|
|
- if(null==scoreCount.getOrganizationEvaluationId()|| null== scoreCount.getOrganizationEvaluationRuleId() || null == scoreCount.getIndicatorId()){
|
|
|
|
|
|
+ log.info("综合得分:" + totalScore);
|
|
|
|
+ if (null == scoreCount.getOrganizationEvaluationId() || null == scoreCount.getOrganizationEvaluationRuleId() || null == scoreCount.getIndicatorId()) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- if(standardScore>0 && totalScore != standardScore){
|
|
|
|
- scoreCount.setStandard(totalScore>standardScore?"1":"-1");
|
|
|
|
- }else {
|
|
|
|
|
|
+ if (standardScore > 0 && totalScore != standardScore) {
|
|
|
|
+ scoreCount.setStandard(totalScore > standardScore ? "1" : "-1");
|
|
|
|
+ } else {
|
|
scoreCount.setStandard("0");
|
|
scoreCount.setStandard("0");
|
|
}
|
|
}
|
|
scoreCount.setScore(totalScore);
|
|
scoreCount.setScore(totalScore);
|
|
scoreCount.setObversionScore(totalScore);
|
|
scoreCount.setObversionScore(totalScore);
|
|
scoreCount.setIsQuantified("1");
|
|
scoreCount.setIsQuantified("1");
|
|
|
|
|
|
- List<EvaluationScoreCount> listcount = evaluatioinScoreCountService.getEvaluationScoreCountList(scoreCount.getOrganizationEvaluationId(),scoreCount.getOrganizationEvaluationRuleId(),scoreCount.getIndicatorId(),scoreCount.getBinSection());
|
|
|
|
- if(null != listcount && listcount.size() >0){
|
|
|
|
|
|
+ List<EvaluationScoreCount> listcount = evaluatioinScoreCountService.getEvaluationScoreCountList(scoreCount.getOrganizationEvaluationId(), scoreCount.getOrganizationEvaluationRuleId(), scoreCount.getIndicatorId(), scoreCount.getBinSection());
|
|
|
|
+ if (null != listcount && listcount.size() > 0) {
|
|
List<String> ids = listcount.stream().map(EvaluationScoreCount::getId).collect(Collectors.toList());
|
|
List<String> ids = listcount.stream().map(EvaluationScoreCount::getId).collect(Collectors.toList());
|
|
boolean cod = evaluatioinScoreCountService.removeByIds(ids);
|
|
boolean cod = evaluatioinScoreCountService.removeByIds(ids);
|
|
}
|
|
}
|
|
@@ -433,7 +426,6 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return false;
|
|
return false;
|
|
@@ -463,14 +455,14 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
// }
|
|
// }
|
|
//
|
|
//
|
|
// }else {
|
|
// }else {
|
|
- indicatorMap = baseMapper.selectEvaluationIndicatorList(organizationEvaluationId,binSection,binStage);
|
|
|
|
|
|
+ indicatorMap = baseMapper.selectEvaluationIndicatorList(organizationEvaluationId, binSection, binStage);
|
|
// }
|
|
// }
|
|
|
|
|
|
return indicatorMap;
|
|
return indicatorMap;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Map getEvaluationInfoList(String organizationEvaluationId,String organizationShortName, String indicatorId, String binSection, String binStage, HttpServletRequest request) {
|
|
|
|
|
|
+ public Map getEvaluationInfoList(String organizationEvaluationId, String organizationShortName, String indicatorId, String binSection, String binStage, HttpServletRequest request) {
|
|
|
|
|
|
Map data = new HashMap();
|
|
Map data = new HashMap();
|
|
|
|
|
|
@@ -484,16 +476,15 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
// data.put("editFlag",editFlag);
|
|
// data.put("editFlag",editFlag);
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
//获取用户信息 23031009
|
|
//获取用户信息 23031009
|
|
boolean deptFlag = false;
|
|
boolean deptFlag = false;
|
|
try {
|
|
try {
|
|
MyuserResDTO user = userService.getSysUser(request);
|
|
MyuserResDTO user = userService.getSysUser(request);
|
|
- if(null != user){
|
|
|
|
|
|
+ if (null != user) {
|
|
// String deptId = "23031009";
|
|
// String deptId = "23031009";
|
|
Optional<DataDictionary> any = CacheContext.ddSuperKeyMap.get("BM0001").stream().filter(t -> t.getKeyName().equals(user.getDeptName())).findAny();
|
|
Optional<DataDictionary> any = CacheContext.ddSuperKeyMap.get("BM0001").stream().filter(t -> t.getKeyName().equals(user.getDeptName())).findAny();
|
|
- if(any.isPresent()){
|
|
|
|
- deptFlag = "ZZRSB".equals(any.get().getDataKey()) ? true: false;
|
|
|
|
|
|
+ if (any.isPresent()) {
|
|
|
|
+ deptFlag = "ZZRSB".equals(any.get().getDataKey()) ? true : false;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -502,7 +493,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
boolean titlemark = true;//标记生成标题
|
|
boolean titlemark = true;//标记生成标题
|
|
- List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId,organizationShortName, indicatorId,binSection,binStage,"");
|
|
|
|
|
|
+ List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId, organizationShortName, indicatorId, binSection, binStage, "");
|
|
List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("", indicatorId, "", "");
|
|
List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("", indicatorId, "", "");
|
|
List<IndicatorDictionary> dictionaryList2 = dictionaryList.stream().filter(dl -> !"1642801934302707714".equals(dl.getIndicatorId()) || !"CZMAX".equals(dl.getOptionCode()) && !"CZMIN".equals(dl.getOptionCode())).collect(Collectors.toList());
|
|
List<IndicatorDictionary> dictionaryList2 = dictionaryList.stream().filter(dl -> !"1642801934302707714".equals(dl.getIndicatorId()) || !"CZMAX".equals(dl.getOptionCode()) && !"CZMIN".equals(dl.getOptionCode())).collect(Collectors.toList());
|
|
Indicator indicator = indicatorService.getById(indicatorId);
|
|
Indicator indicator = indicatorService.getById(indicatorId);
|
|
@@ -511,7 +502,6 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
.collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getOrganizationId));
|
|
.collect(Collectors.groupingBy(OrganizationEvaluationInfoResDTO::getOrganizationId));
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
|
|
|
//设置数据标题
|
|
//设置数据标题
|
|
@@ -528,27 +518,27 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
titlemap.put("key", d.getOptionName());//名称
|
|
titlemap.put("key", d.getOptionName());//名称
|
|
- titlemap.put("code",d.getChildCode()+"_"+d.getOptionCode());//名称
|
|
|
|
- titlemap.put("flag", d.getIsQuantified()?"1":"2");//是否量化
|
|
|
|
|
|
+ titlemap.put("code", d.getChildCode() + "_" + d.getOptionCode());//名称
|
|
|
|
+ titlemap.put("flag", d.getIsQuantified() ? "1" : "2");//是否量化
|
|
titleArray.add(titlemap);
|
|
titleArray.add(titlemap);
|
|
|
|
|
|
}
|
|
}
|
|
- title.put(childCodeEntry.getKey().split(",")[1]+"-对标", titleArray);
|
|
|
|
|
|
+ title.put(childCodeEntry.getKey().split(",")[1] + "-对标", titleArray);
|
|
}
|
|
}
|
|
- if(groupedChildCode.size()>1 || dictionaryList.get(0).getChildCode().endsWith("LRZE") || dictionaryList.get(0).getChildCode().endsWith("JLR")){
|
|
|
|
|
|
+ if (groupedChildCode.size() > 1 || dictionaryList.get(0).getChildCode().endsWith("LRZE") || dictionaryList.get(0).getChildCode().endsWith("JLR")) {
|
|
Map zhdfMap = new LinkedHashMap();
|
|
Map zhdfMap = new LinkedHashMap();
|
|
List<Map> zhdfArray = new ArrayList<>();
|
|
List<Map> zhdfArray = new ArrayList<>();
|
|
zhdfMap.put("key", "得分");//名称
|
|
zhdfMap.put("key", "得分");//名称
|
|
- zhdfMap.put("code","totalScore");//名称
|
|
|
|
|
|
+ zhdfMap.put("code", "totalScore");//名称
|
|
zhdfMap.put("flag", "1");//数值
|
|
zhdfMap.put("flag", "1");//数值
|
|
zhdfArray.add(zhdfMap);
|
|
zhdfArray.add(zhdfMap);
|
|
title.put("综合得分", zhdfArray);
|
|
title.put("综合得分", zhdfArray);
|
|
}
|
|
}
|
|
- if(deptFlag){
|
|
|
|
|
|
+ if (deptFlag) {
|
|
Map deptstateMap = new LinkedHashMap();
|
|
Map deptstateMap = new LinkedHashMap();
|
|
List<Map> titlestateArray = new ArrayList<>();
|
|
List<Map> titlestateArray = new ArrayList<>();
|
|
deptstateMap.put("key", "状态");//名称
|
|
deptstateMap.put("key", "状态");//名称
|
|
- deptstateMap.put("code","state");//名称
|
|
|
|
|
|
+ deptstateMap.put("code", "state");//名称
|
|
deptstateMap.put("flag", "3");//下拉
|
|
deptstateMap.put("flag", "3");//下拉
|
|
titlestateArray.add(deptstateMap);
|
|
titlestateArray.add(deptstateMap);
|
|
title.put("填报状态", titlestateArray);
|
|
title.put("填报状态", titlestateArray);
|
|
@@ -569,7 +559,6 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
//获取行数据
|
|
//获取行数据
|
|
//遍历按照公司分组后的数据
|
|
//遍历按照公司分组后的数据
|
|
for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> entry : groupedData.entrySet()) {
|
|
for (Map.Entry<String, List<OrganizationEvaluationInfoResDTO>> entry : groupedData.entrySet()) {
|
|
@@ -591,44 +580,44 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
if (mark) {
|
|
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("operation","PUBLIC".equals(resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getDeptId()));
|
|
|
|
- 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("operation", "PUBLIC".equals(resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getDeptId()));
|
|
|
|
+ indicatormap.put("IS_LH_state", "3");
|
|
|
|
|
|
mark = false;
|
|
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
|
|
//指标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()).getIsQuantified2()?"1":"2");
|
|
|
|
|
|
+ indicatormap.put("IS_LH_" + d.getChildCode() + "_" + d.getOptionCode(), resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getIsQuantified2() ? "1" : "2");
|
|
|
|
|
|
//累计分数
|
|
//累计分数
|
|
- if(d.getOptionCode().equals("DF")||d.getOptionCode().equals("DF2")||d.getOptionCode().equals("JHDF")){
|
|
|
|
- score = score + resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getQuantifiedValue();
|
|
|
|
|
|
+ if (d.getOptionCode().equals("DF") || d.getOptionCode().equals("DF2") || d.getOptionCode().equals("JHDF")) {
|
|
|
|
+ score = score + resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getQuantifiedValue();
|
|
|
|
|
|
//判断最大最小值 ;是否存在值
|
|
//判断最大最小值 ;是否存在值
|
|
- if(null != resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getMinScore()){
|
|
|
|
- minScore =resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getMinScore();
|
|
|
|
|
|
+ if (null != resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getMinScore()) {
|
|
|
|
+ minScore = resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getMinScore();
|
|
}
|
|
}
|
|
- if(null != resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getMaxScore()){
|
|
|
|
- maxScore =resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getMaxScore();
|
|
|
|
|
|
+ if (null != resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getMaxScore()) {
|
|
|
|
+ maxScore = resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getMaxScore();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- indicatormap.put("totalScore",score);
|
|
|
|
|
|
+ indicatormap.put("totalScore", score);
|
|
|
|
|
|
- if(score!=0 && (minScore!=0 || maxScore!=0)){
|
|
|
|
- boolean valueFlag = DoubleUtils.isIncludeValue(score,minScore,maxScore);
|
|
|
|
- indicatormap.put("valueFlag",valueFlag);
|
|
|
|
- }else {
|
|
|
|
- indicatormap.put("valueFlag",true);
|
|
|
|
|
|
+ if (score != 0 && (minScore != 0 || maxScore != 0)) {
|
|
|
|
+ boolean valueFlag = DoubleUtils.isIncludeValue(score, minScore, maxScore);
|
|
|
|
+ indicatormap.put("valueFlag", valueFlag);
|
|
|
|
+ } else {
|
|
|
|
+ indicatormap.put("valueFlag", true);
|
|
}
|
|
}
|
|
mapList.add(indicatormap);
|
|
mapList.add(indicatormap);
|
|
}
|
|
}
|
|
@@ -637,23 +626,23 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public byte[] downloadExcel(String organizationEvaluationId, String indicatorId, String binSection, String binStage,HttpServletRequest request) throws Exception{
|
|
|
|
|
|
+ public byte[] downloadExcel(String organizationEvaluationId, String indicatorId, String binSection, String binStage, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
//获取用户信息 23031009
|
|
//获取用户信息 23031009
|
|
boolean deptFlag = false;
|
|
boolean deptFlag = false;
|
|
MyuserResDTO user = userService.getSysUser(request);
|
|
MyuserResDTO user = userService.getSysUser(request);
|
|
- if(null != user){
|
|
|
|
|
|
+ if (null != user) {
|
|
String deptId = "23031009";
|
|
String deptId = "23031009";
|
|
- if(deptId.equals(user.getDeptId())){
|
|
|
|
|
|
+ if (deptId.equals(user.getDeptId())) {
|
|
deptFlag = true;
|
|
deptFlag = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
String[] values = new String[]{"不合格", "待确认", "已确认"};
|
|
String[] values = new String[]{"不合格", "待确认", "已确认"};
|
|
|
|
|
|
- Map<String ,List<Map<String,String>>> title = new LinkedHashMap();//标题
|
|
|
|
- List<Map<String,String>> mapList = new ArrayList<>();//数据list
|
|
|
|
|
|
+ Map<String, List<Map<String, String>>> title = new LinkedHashMap();//标题
|
|
|
|
+ List<Map<String, String>> mapList = new ArrayList<>();//数据list
|
|
boolean titlemark = true;//标记生成标题
|
|
boolean titlemark = true;//标记生成标题
|
|
- List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId, "",indicatorId,binSection,binStage,"");
|
|
|
|
|
|
+ List<OrganizationEvaluationInfoResDTO> infoResDTOList = baseMapper.selectEvaluationInfoList(organizationEvaluationId, "", indicatorId, binSection, binStage, "");
|
|
List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("", indicatorId, "", "");
|
|
List<IndicatorDictionary> dictionaryList = indicatorDictionaryService.list("", indicatorId, "", "");
|
|
|
|
|
|
//根据组织(公司)id分组
|
|
//根据组织(公司)id分组
|
|
@@ -681,24 +670,24 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
for (Map.Entry<String, List<IndicatorDictionary>> childCodeEntry : groupedChildCode.entrySet()) {
|
|
for (Map.Entry<String, List<IndicatorDictionary>> childCodeEntry : groupedChildCode.entrySet()) {
|
|
|
|
|
|
|
|
|
|
- List<Map<String,String>> titleArray = new ArrayList<>();
|
|
|
|
|
|
+ List<Map<String, String>> titleArray = new ArrayList<>();
|
|
Map titlemap = new LinkedHashMap();
|
|
Map titlemap = new LinkedHashMap();
|
|
for (IndicatorDictionary d : childCodeEntry.getValue()) {
|
|
for (IndicatorDictionary d : childCodeEntry.getValue()) {
|
|
if (!d.getIsShow()) {
|
|
if (!d.getIsShow()) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- titlemap.put(d.getChildCode()+"_"+d.getOptionCode(), d.getOptionName());//名称
|
|
|
|
|
|
+ titlemap.put(d.getChildCode() + "_" + d.getOptionCode(), d.getOptionName());//名称
|
|
}
|
|
}
|
|
titleArray.add(titlemap);
|
|
titleArray.add(titlemap);
|
|
title.put(childCodeEntry.getKey().split(",")[1], titleArray);
|
|
title.put(childCodeEntry.getKey().split(",")[1], titleArray);
|
|
|
|
|
|
}
|
|
}
|
|
//状态标题头
|
|
//状态标题头
|
|
- List<Map<String,String>> titleStateArray = new ArrayList<>();
|
|
|
|
|
|
+ List<Map<String, String>> titleStateArray = new ArrayList<>();
|
|
Map titleStateMap = new LinkedHashMap();
|
|
Map titleStateMap = new LinkedHashMap();
|
|
- titleStateMap.put("state","填报状态");
|
|
|
|
|
|
+ titleStateMap.put("state", "填报状态");
|
|
titleStateArray.add(titleStateMap);
|
|
titleStateArray.add(titleStateMap);
|
|
- title.put("状态",titleStateArray);
|
|
|
|
|
|
+ title.put("状态", titleStateArray);
|
|
|
|
|
|
titlemark = false;
|
|
titlemark = false;
|
|
}
|
|
}
|
|
@@ -714,15 +703,15 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
indicatormap.put("organizationShortName", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationShortName());//公司名
|
|
indicatormap.put("organizationShortName", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationShortName());//公司名
|
|
indicatormap.put("organizationId", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationId());//公司编号
|
|
indicatormap.put("organizationId", resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getOrganizationId());//公司编号
|
|
|
|
|
|
- String state2 = resultMap.get(d.getChildCode()+"_"+d.getOptionCode()).getState();//(-1:不合格;0:待确认;1:已确认)
|
|
|
|
- state = stateConvert(state2,true);
|
|
|
|
|
|
+ String state2 = resultMap.get(d.getChildCode() + "_" + d.getOptionCode()).getState();//(-1:不合格;0:待确认;1:已确认)
|
|
|
|
+ state = stateConvert(state2, true);
|
|
mark = false;
|
|
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);//状态
|
|
mapList.add(indicatormap);
|
|
mapList.add(indicatormap);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -775,7 +764,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
sheet.addMergedRegion(new CellRangeAddress(1, 2, 2, 2));
|
|
sheet.addMergedRegion(new CellRangeAddress(1, 2, 2, 2));
|
|
|
|
|
|
Cell header3Cell0 = headerRow3.createCell(0);
|
|
Cell header3Cell0 = headerRow3.createCell(0);
|
|
- header3Cell0.setCellValue("zhidmap,evalId="+organizationEvaluationId+",indId="+indicatorId);
|
|
|
|
|
|
+ header3Cell0.setCellValue("zhidmap,evalId=" + organizationEvaluationId + ",indId=" + indicatorId);
|
|
|
|
|
|
Cell header3Cell1 = headerRow3.createCell(1);
|
|
Cell header3Cell1 = headerRow3.createCell(1);
|
|
header3Cell1.setCellValue("organizationShortName");
|
|
header3Cell1.setCellValue("organizationShortName");
|
|
@@ -786,21 +775,21 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
|
|
|
|
Integer colsize = 2;
|
|
Integer colsize = 2;
|
|
Integer optioncols = 3;
|
|
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);
|
|
headerCellcolsize.setCellValue(key);
|
|
headerCellcolsize.setCellStyle(cellStyle);
|
|
headerCellcolsize.setCellStyle(cellStyle);
|
|
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();
|
|
colsize = colsize + key2.size();
|
|
- for (String key3 : key2.keySet()) {
|
|
|
|
|
|
+ for (String key3 : key2.keySet()) {
|
|
|
|
|
|
Cell header3Cell3 = headerRow3.createCell(optioncols);
|
|
Cell header3Cell3 = headerRow3.createCell(optioncols);
|
|
header3Cell3.setCellValue(key3);
|
|
header3Cell3.setCellValue(key3);
|
|
@@ -811,7 +800,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
header2Cell2.setCellStyle(cellStyle);
|
|
header2Cell2.setCellStyle(cellStyle);
|
|
|
|
|
|
// 隐藏列
|
|
// 隐藏列
|
|
- if(key3.startsWith("ID_") || key3.startsWith("IS_LH_")){
|
|
|
|
|
|
+ if (key3.startsWith("ID_") || key3.startsWith("IS_LH_")) {
|
|
sheet.setColumnHidden(optioncols, true);
|
|
sheet.setColumnHidden(optioncols, true);
|
|
}
|
|
}
|
|
optioncols++;
|
|
optioncols++;
|
|
@@ -820,19 +809,19 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
Integer rowdate = 4;
|
|
Integer rowdate = 4;
|
|
- for (Map<String,String > datamaps : mapList) {
|
|
|
|
|
|
+ for (Map<String, String> datamaps : mapList) {
|
|
Integer colsdata = 1;
|
|
Integer colsdata = 1;
|
|
Row headerRowdate = sheet.createRow(rowdate);
|
|
Row headerRowdate = sheet.createRow(rowdate);
|
|
Cell dataCell0 = headerRowdate.createCell(0);
|
|
Cell dataCell0 = headerRowdate.createCell(0);
|
|
- dataCell0.setCellValue(rowdate-3);
|
|
|
|
|
|
+ dataCell0.setCellValue(rowdate - 3);
|
|
dataCell0.setCellStyle(cellStyle);
|
|
dataCell0.setCellStyle(cellStyle);
|
|
- for (String datakey: datamaps.keySet()) {
|
|
|
|
|
|
+ for (String datakey : datamaps.keySet()) {
|
|
|
|
|
|
Cell dataCell1 = headerRowdate.createCell(colsdata);
|
|
Cell dataCell1 = headerRowdate.createCell(colsdata);
|
|
dataCell1.setCellValue(datamaps.get(datakey).toString());
|
|
dataCell1.setCellValue(datamaps.get(datakey).toString());
|
|
dataCell1.setCellStyle(cellStyle);
|
|
dataCell1.setCellStyle(cellStyle);
|
|
|
|
|
|
- if("state".equals(datakey)){
|
|
|
|
|
|
+ if ("state".equals(datakey)) {
|
|
// 创建一个数据验证对象
|
|
// 创建一个数据验证对象
|
|
DataValidationHelper validationHelper = sheet.getDataValidationHelper();
|
|
DataValidationHelper validationHelper = sheet.getDataValidationHelper();
|
|
DataValidationConstraint constraint = validationHelper.createExplicitListConstraint(values);
|
|
DataValidationConstraint constraint = validationHelper.createExplicitListConstraint(values);
|
|
@@ -866,9 +855,8 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
- public boolean importExcel(MultipartFile file,HttpServletRequest request) throws IOException {
|
|
|
|
|
|
+ public boolean importExcel(MultipartFile file, HttpServletRequest request) throws IOException {
|
|
|
|
|
|
List<LinkedHashMap<String, Object>> dataList = new ArrayList<>();
|
|
List<LinkedHashMap<String, Object>> dataList = new ArrayList<>();
|
|
try {
|
|
try {
|
|
@@ -925,39 +913,41 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
dataList.add(dataMap);
|
|
dataList.add(dataMap);
|
|
}
|
|
}
|
|
workbook.close();
|
|
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()) {
|
|
for (String key : map.keySet()) {
|
|
String value = String.valueOf(map.get(key));
|
|
String value = String.valueOf(map.get(key));
|
|
- if(key.startsWith("zhidmap")){
|
|
|
|
|
|
+ if (key.startsWith("zhidmap")) {
|
|
String[] zhidmap = key.split(",");
|
|
String[] zhidmap = key.split(",");
|
|
- idMap.put("evalId",zhidmap[1].split("=")[1]);
|
|
|
|
|
|
+ idMap.put("evalId", zhidmap[1].split("=")[1]);
|
|
idMap.put("indId", zhidmap[2].split("=")[1]);
|
|
idMap.put("indId", zhidmap[2].split("=")[1]);
|
|
continue;
|
|
continue;
|
|
- }if(key.startsWith("organization")){
|
|
|
|
- idMap.put(key,value);
|
|
|
|
|
|
+ }
|
|
|
|
+ if (key.startsWith("organization")) {
|
|
|
|
+ idMap.put(key, value);
|
|
continue;
|
|
continue;
|
|
- }if(key.startsWith("state")){
|
|
|
|
- idMap.put(key,value);
|
|
|
|
|
|
+ }
|
|
|
|
+ if (key.startsWith("state")) {
|
|
|
|
+ idMap.put(key, value);
|
|
continue;
|
|
continue;
|
|
- }else {
|
|
|
|
- valueMap.put(key,value);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ valueMap.put(key, value);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<OrganizationEvaluationInfo> evaluationInfos =new ArrayList<>();
|
|
|
|
- for (Map.Entry<String,String > entry : valueMap.entrySet()) {
|
|
|
|
|
|
+ List<OrganizationEvaluationInfo> evaluationInfos = new ArrayList<>();
|
|
|
|
+ for (Map.Entry<String, String> entry : valueMap.entrySet()) {
|
|
try {
|
|
try {
|
|
//organizationEvaluationId 考评记录id
|
|
//organizationEvaluationId 考评记录id
|
|
// indicatorId 指标id
|
|
// indicatorId 指标id
|
|
// organizationId 组织id
|
|
// organizationId 组织id
|
|
// childOptionCode 组合子指标和指标项
|
|
// childOptionCode 组合子指标和指标项
|
|
- List<OrganizationEvaluationInfo> organizationEvaluationInfoList = getEvaluationInfoByOptionCodeList(idMap.get("evalId"),idMap.get("indId"),idMap.get("organizationId"),entry.getKey());
|
|
|
|
|
|
+ List<OrganizationEvaluationInfo> organizationEvaluationInfoList = getEvaluationInfoByOptionCodeList(idMap.get("evalId"), idMap.get("indId"), idMap.get("organizationId"), entry.getKey());
|
|
OrganizationEvaluationInfo info = new OrganizationEvaluationInfo();
|
|
OrganizationEvaluationInfo info = new OrganizationEvaluationInfo();
|
|
OrganizationEvaluationInfo oriinfo = null;
|
|
OrganizationEvaluationInfo oriinfo = null;
|
|
- if(null !=organizationEvaluationInfoList && organizationEvaluationInfoList.size()>0){
|
|
|
|
- oriinfo = organizationEvaluationInfoList.get(0);//原始数据
|
|
|
|
|
|
+ if (null != organizationEvaluationInfoList && organizationEvaluationInfoList.size() > 0) {
|
|
|
|
+ oriinfo = organizationEvaluationInfoList.get(0);//原始数据
|
|
info.setId(oriinfo.getId());
|
|
info.setId(oriinfo.getId());
|
|
} else {
|
|
} else {
|
|
continue;
|
|
continue;
|
|
@@ -971,8 +961,8 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
}
|
|
}
|
|
info.setNonQuantifiedValue(entry.getValue());
|
|
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);
|
|
info.setState(state);
|
|
evaluationInfos.add(info);
|
|
evaluationInfos.add(info);
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
@@ -992,37 +982,37 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public boolean updateEvaluationInfo(List<JSONObject> jsonObjects) {
|
|
public boolean updateEvaluationInfo(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()) {
|
|
for (String key : json.keySet()) {
|
|
Object value = json.get(key);
|
|
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<OrganizationEvaluationInfo> evaluationInfos =new ArrayList<>();
|
|
|
|
|
|
+ List<OrganizationEvaluationInfo> evaluationInfos = new ArrayList<>();
|
|
//总分 加扣分
|
|
//总分 加扣分
|
|
double score = 0.00;
|
|
double score = 0.00;
|
|
double jfScore = 0.00;
|
|
double jfScore = 0.00;
|
|
double kfScore = 0.00;
|
|
double kfScore = 0.00;
|
|
|
|
|
|
//加扣分原因
|
|
//加扣分原因
|
|
- String jfRemark ="";
|
|
|
|
- String kfRemark ="";
|
|
|
|
|
|
+ String jfRemark = "";
|
|
|
|
+ String kfRemark = "";
|
|
|
|
|
|
- String scoreid ="";
|
|
|
|
|
|
+ String scoreid = "";
|
|
|
|
|
|
- for (Map.Entry<String,Object > entry : idMap.entrySet()) {
|
|
|
|
|
|
+ for (Map.Entry<String, Object> entry : idMap.entrySet()) {
|
|
OrganizationEvaluationInfo info = this.getById(entry.getValue().toString());
|
|
OrganizationEvaluationInfo info = this.getById(entry.getValue().toString());
|
|
info.setId(entry.getValue().toString());
|
|
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();
|
|
scoreid = entry.getValue().toString();
|
|
scoreid = entry.getValue().toString();
|
|
- if(null != valueMap.get(entry.getKey().replace("ID_", ""))) {
|
|
|
|
|
|
+ if (null != valueMap.get(entry.getKey().replace("ID_", ""))) {
|
|
|
|
|
|
// //加分 扣分 加扣分原因
|
|
// //加分 扣分 加扣分原因
|
|
if (entry.getKey().endsWith("_JFYY")) {
|
|
if (entry.getKey().endsWith("_JFYY")) {
|
|
@@ -1059,7 +1049,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
info.setNonQuantifiedValue(valueMap.get(entry.getKey().replace("ID_", "")).toString());
|
|
info.setNonQuantifiedValue(valueMap.get(entry.getKey().replace("ID_", "")).toString());
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
info.setQuantifiedValue(0);
|
|
info.setQuantifiedValue(0);
|
|
info.setNonQuantifiedValue("");
|
|
info.setNonQuantifiedValue("");
|
|
}
|
|
}
|
|
@@ -1067,14 +1057,14 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
evaluationInfos.add(info);
|
|
evaluationInfos.add(info);
|
|
}
|
|
}
|
|
|
|
|
|
- if(null == evaluationInfos || evaluationInfos.size()<=0){
|
|
|
|
|
|
+ if (null == evaluationInfos || evaluationInfos.size() <= 0) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
boolean b = this.saveOrUpdateBatch(evaluationInfos);
|
|
boolean b = this.saveOrUpdateBatch(evaluationInfos);
|
|
- if(b && null !=evaluationInfos && evaluationInfos.size()>0){
|
|
|
|
|
|
+ if (b && null != evaluationInfos && evaluationInfos.size() > 0) {
|
|
OrganizationEvaluationInfo info = this.getById(scoreid);
|
|
OrganizationEvaluationInfo info = this.getById(scoreid);
|
|
- List<EvaluationScoreCount> listcount = evaluatioinScoreCountService.getEvaluationScoreCountList(info.getOrganizationEvaluationId(),info.getOrganizationEvaluationRuleId(),info.getIndicatorId(),"");
|
|
|
|
- if(null != listcount && listcount.size()>0){
|
|
|
|
|
|
+ List<EvaluationScoreCount> listcount = evaluatioinScoreCountService.getEvaluationScoreCountList(info.getOrganizationEvaluationId(), info.getOrganizationEvaluationRuleId(), info.getIndicatorId(), "");
|
|
|
|
+ if (null != listcount && listcount.size() > 0) {
|
|
EvaluationScoreCount count = listcount.get(0);
|
|
EvaluationScoreCount count = listcount.get(0);
|
|
count.setJfScore(jfScore);
|
|
count.setJfScore(jfScore);
|
|
count.setKfScore(kfScore);
|
|
count.setKfScore(kfScore);
|
|
@@ -1083,8 +1073,8 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
count.setScore(score);
|
|
count.setScore(score);
|
|
count.setObversionScore(score);
|
|
count.setObversionScore(score);
|
|
evaluatioinScoreCountService.saveOrUpdate(count);
|
|
evaluatioinScoreCountService.saveOrUpdate(count);
|
|
- }else {
|
|
|
|
- calculationByEvaluationId("", info.getIndicatorId(),info.getOrganizationEvaluationId(),"");
|
|
|
|
|
|
+ } else {
|
|
|
|
+ calculationByEvaluationId("", info.getIndicatorId(), info.getOrganizationEvaluationId(), "", "", "");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1148,7 +1138,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
info.setOptionCode(d.getOptionCode());
|
|
info.setOptionCode(d.getOptionCode());
|
|
info.setIsQuantified(d.getIsQuantified());
|
|
info.setIsQuantified(d.getIsQuantified());
|
|
if (null != optionMap.get(d.getChildCode() + "_" + d.getOptionCode())) {
|
|
if (null != optionMap.get(d.getChildCode() + "_" + d.getOptionCode())) {
|
|
- Object value = optionMap.get(d.getChildCode() + "_" +d.getOptionCode());
|
|
|
|
|
|
+ Object value = optionMap.get(d.getChildCode() + "_" + d.getOptionCode());
|
|
if (null != value) {
|
|
if (null != value) {
|
|
info.setNonQuantifiedValue(String.valueOf(value));
|
|
info.setNonQuantifiedValue(String.valueOf(value));
|
|
if (d.getIsQuantified()) {
|
|
if (d.getIsQuantified()) {
|
|
@@ -1173,29 +1163,29 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
//todo 后续添加需要计算的指标项
|
|
//todo 后续添加需要计算的指标项
|
|
- public boolean calculateIdicatorItem(List<OrganizationEvaluationInfo> organizationEvaluationInfos){
|
|
|
|
|
|
+ public boolean calculateIdicatorItem(List<OrganizationEvaluationInfo> organizationEvaluationInfos) {
|
|
|
|
|
|
|
|
|
|
//根据考评规则分组
|
|
//根据考评规则分组
|
|
Map<String, List<OrganizationEvaluationInfo>> collect1 = organizationEvaluationInfos.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getOrganizationEvaluationRuleId));
|
|
Map<String, List<OrganizationEvaluationInfo>> collect1 = organizationEvaluationInfos.stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getOrganizationEvaluationRuleId));
|
|
- for (Map.Entry<String, List<OrganizationEvaluationInfo>> entry1 : collect1.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, List<OrganizationEvaluationInfo>> entry1 : collect1.entrySet()) {
|
|
//根据指标id分组
|
|
//根据指标id分组
|
|
Map<String, List<OrganizationEvaluationInfo>> collect = entry1.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getIndicatorId));
|
|
Map<String, List<OrganizationEvaluationInfo>> collect = entry1.getValue().stream().collect(Collectors.groupingBy(OrganizationEvaluationInfo::getIndicatorId));
|
|
- for(Map.Entry<String, List<OrganizationEvaluationInfo>> entry : collect.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, List<OrganizationEvaluationInfo>> entry : collect.entrySet()) {
|
|
//过滤差值考评指标明细
|
|
//过滤差值考评指标明细
|
|
List<OrganizationEvaluationInfo> cz = entry.getValue().stream().filter(r -> r.getOptionCode().equals("CZ")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> cz = entry.getValue().stream().filter(r -> r.getOptionCode().equals("CZ")).collect(Collectors.toList());
|
|
- if (cz.size() == 1){
|
|
|
|
|
|
+ if (cz.size() == 1) {
|
|
List<OrganizationEvaluationInfo> wcz = entry.getValue().stream().filter(r -> r.getOptionCode().equals("WCZ")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> wcz = entry.getValue().stream().filter(r -> r.getOptionCode().equals("WCZ")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> value = entry.getValue().stream().filter(r -> r.getOptionCode().equals("JHZ") || r.getOptionCode().equals("DBZ") || r.getOptionCode().equals("MBZ")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> value = entry.getValue().stream().filter(r -> r.getOptionCode().equals("JHZ") || r.getOptionCode().equals("DBZ") || r.getOptionCode().equals("MBZ")).collect(Collectors.toList());
|
|
|
|
|
|
//完成值与目标值 ||计划值||对标值进行计算
|
|
//完成值与目标值 ||计划值||对标值进行计算
|
|
- if (wcz.size() == 1 && value.size() == 1){
|
|
|
|
|
|
+ if (wcz.size() == 1 && value.size() == 1) {
|
|
double wczValue = wcz.get(0).getQuantifiedValue();
|
|
double wczValue = wcz.get(0).getQuantifiedValue();
|
|
double dbzvalue = value.get(0).getQuantifiedValue();
|
|
double dbzvalue = value.get(0).getQuantifiedValue();
|
|
cz.get(0).setQuantifiedValue(wczValue - dbzvalue);
|
|
cz.get(0).setQuantifiedValue(wczValue - dbzvalue);
|
|
cz.get(0).setCreateTime(new Date());
|
|
cz.get(0).setCreateTime(new Date());
|
|
boolean b = super.saveOrUpdate(cz.get(0));
|
|
boolean b = super.saveOrUpdate(cz.get(0));
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new CustomException("更新失败");
|
|
throw new CustomException("更新失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1203,28 +1193,28 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
|
|
|
|
//过滤单位千瓦利润考评指标明细
|
|
//过滤单位千瓦利润考评指标明细
|
|
List<OrganizationEvaluationInfo> dwqwlr = entry.getValue().stream().filter(r -> r.getOptionCode().equals("DWQWLR")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> dwqwlr = entry.getValue().stream().filter(r -> r.getOptionCode().equals("DWQWLR")).collect(Collectors.toList());
|
|
- if (dwqwlr.size() == 1){
|
|
|
|
|
|
+ if (dwqwlr.size() == 1) {
|
|
List<OrganizationEvaluationInfo> lrgxl = entry.getValue().stream().filter(r -> r.getOptionCode().equals("LRGXL")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> lrgxl = entry.getValue().stream().filter(r -> r.getOptionCode().equals("LRGXL")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> zjrl = entry.getValue().stream().filter(r -> r.getOptionCode().equals("ZJRL")).collect(Collectors.toList());
|
|
List<OrganizationEvaluationInfo> zjrl = entry.getValue().stream().filter(r -> r.getOptionCode().equals("ZJRL")).collect(Collectors.toList());
|
|
|
|
|
|
//完成值与目标值 ||计划值||对标值进行计算
|
|
//完成值与目标值 ||计划值||对标值进行计算
|
|
- if (lrgxl.size() == 1 && zjrl.size() == 1){
|
|
|
|
|
|
+ if (lrgxl.size() == 1 && zjrl.size() == 1) {
|
|
double wczValue = lrgxl.get(0).getQuantifiedValue();
|
|
double wczValue = lrgxl.get(0).getQuantifiedValue();
|
|
double dbzvalue = zjrl.get(0).getQuantifiedValue();
|
|
double dbzvalue = zjrl.get(0).getQuantifiedValue();
|
|
- if (dbzvalue == 0 || dbzvalue == 0.0){
|
|
|
|
|
|
+ if (dbzvalue == 0 || dbzvalue == 0.0) {
|
|
dwqwlr.get(0).setQuantifiedValue(0);
|
|
dwqwlr.get(0).setQuantifiedValue(0);
|
|
dwqwlr.get(0).setCreateTime(new Date());
|
|
dwqwlr.get(0).setCreateTime(new Date());
|
|
boolean b = super.saveOrUpdate(dwqwlr.get(0));
|
|
boolean b = super.saveOrUpdate(dwqwlr.get(0));
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new CustomException("更新失败");
|
|
throw new CustomException("更新失败");
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
//double保留两位小数
|
|
//double保留两位小数
|
|
double v = new BigDecimal(wczValue / dbzvalue).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
double v = new BigDecimal(wczValue / dbzvalue).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
dwqwlr.get(0).setQuantifiedValue(v);
|
|
dwqwlr.get(0).setQuantifiedValue(v);
|
|
dwqwlr.get(0).setCreateTime(new Date());
|
|
dwqwlr.get(0).setCreateTime(new Date());
|
|
boolean b = super.saveOrUpdate(dwqwlr.get(0));
|
|
boolean b = super.saveOrUpdate(dwqwlr.get(0));
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new CustomException("更新失败");
|
|
throw new CustomException("更新失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1277,7 +1267,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
// Integer count = baseMapper.selectCount(qw);
|
|
// Integer count = baseMapper.selectCount(qw);
|
|
- Integer count = baseMapper.selectEvaluationInfoByStateCount(organizationEvaluationId,deptId,state);
|
|
|
|
|
|
+ Integer count = baseMapper.selectEvaluationInfoByStateCount(organizationEvaluationId, deptId, state);
|
|
return count;
|
|
return count;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1323,13 +1313,14 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
|
|
|
|
/**
|
|
/**
|
|
* 状态抓换 (-1:不合格;0:待确认;1:已确认)
|
|
* 状态抓换 (-1:不合格;0:待确认;1:已确认)
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private String stateConvert(String state,boolean flge) {
|
|
|
|
|
|
+ private String stateConvert(String state, boolean flge) {
|
|
// (-1:不合格;0:待确认;1:已确认)
|
|
// (-1:不合格;0:待确认;1:已确认)
|
|
String state2 = "";
|
|
String state2 = "";
|
|
if (flge) {
|
|
if (flge) {
|
|
- if(StringUtils.isEmpty(state)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(state)) {
|
|
state2 = "待确认";
|
|
state2 = "待确认";
|
|
return state2;
|
|
return state2;
|
|
}
|
|
}
|
|
@@ -1350,7 +1341,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- if(StringUtils.isEmpty(state)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(state)) {
|
|
state2 = "0";
|
|
state2 = "0";
|
|
return state2;
|
|
return state2;
|
|
}
|
|
}
|
|
@@ -1374,7 +1365,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
|
|
|
|
|
|
|
|
private List<String> getOptionCode(String formula) {
|
|
private List<String> getOptionCode(String formula) {
|
|
- List<String> setOptionCode = new ArrayList<>();
|
|
|
|
|
|
+ List<String> setOptionCode = new ArrayList<>();
|
|
if (StringUtils.isEmpty(formula)) {
|
|
if (StringUtils.isEmpty(formula)) {
|
|
return setOptionCode;
|
|
return setOptionCode;
|
|
}
|
|
}
|
|
@@ -1387,7 +1378,7 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
|
|
optionCode.add(match);
|
|
optionCode.add(match);
|
|
}
|
|
}
|
|
Set<String> uniqueOptionCode = new HashSet<>(optionCode);
|
|
Set<String> uniqueOptionCode = new HashSet<>(optionCode);
|
|
- setOptionCode = new ArrayList<>(uniqueOptionCode);
|
|
|
|
|
|
+ setOptionCode = new ArrayList<>(uniqueOptionCode);
|
|
return setOptionCode;
|
|
return setOptionCode;
|
|
}
|
|
}
|
|
|
|
|