|
@ -7,16 +7,14 @@ import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.datareport.constant.FactConstant; |
|
|
import com.epmet.datareport.constant.FactConstant; |
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; |
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; |
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; |
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; |
|
|
import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao; |
|
|
import com.epmet.datareport.dao.fact.*; |
|
|
import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao; |
|
|
|
|
|
import com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao; |
|
|
|
|
|
import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao; |
|
|
|
|
|
import com.epmet.datareport.service.fact.FactIndexService; |
|
|
import com.epmet.datareport.service.fact.FactIndexService; |
|
|
import com.epmet.evaluationindex.screen.dto.form.*; |
|
|
import com.epmet.evaluationindex.screen.dto.form.*; |
|
|
import com.epmet.evaluationindex.screen.dto.result.*; |
|
|
import com.epmet.evaluationindex.screen.dto.result.*; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.text.ParseException; |
|
|
import java.text.ParseException; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
@ -45,6 +43,10 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
private FactIndexCommunityScoreDao factIndexCommunityScoreDao; |
|
|
private FactIndexCommunityScoreDao factIndexCommunityScoreDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; |
|
|
private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactIndexGridScoreDao factIndexGridScoreDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactIndexGridSubScoreDao factIndexGridSubScoreDao; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param formDTO |
|
|
* @param formDTO |
|
@ -53,76 +55,91 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) { |
|
|
public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) { |
|
|
LinkedList<AblityIndexResultDTO> resultDTO = new LinkedList<>(); |
|
|
LinkedList<AblityIndexResultDTO> resultList = new LinkedList<>(); |
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null; |
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null; |
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null; |
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null; |
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null; |
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null; |
|
|
//分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值 fact_index_agency_score 按月份升序
|
|
|
|
|
|
//1.计算所查月份前12个月的monthId
|
|
|
//1.计算所查月份前12个月的monthId
|
|
|
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); |
|
|
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); |
|
|
//2.根据组织Id查询组织信息
|
|
|
//2.根据类型判断是查询组织数据还是网格数据
|
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); |
|
|
//组织层级数据
|
|
|
if (null == agency) { |
|
|
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { |
|
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); |
|
|
//3.根据组织Id查询组织信息
|
|
|
} |
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); |
|
|
//1.根据组织级别判断查询哪类数据表
|
|
|
if (null == agency) { |
|
|
//区县级、乡镇街道级
|
|
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); |
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
} |
|
|
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
|
|
|
//4.根据组织级别判断查询哪类数据表
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
//区县级、乡镇街道级
|
|
|
djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
|
|
djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
|
|
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
|
|
zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
|
|
|
|
|
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
|
|
|
|
|
|
|
|
//社区级
|
|
|
//社区级
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
|
|
|
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
|
|
|
|
|
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
|
|
|
|
|
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); |
|
|
|
|
|
} |
|
|
|
|
|
//网格层级数据
|
|
|
|
|
|
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) { |
|
|
|
|
|
//5.查询过去12个月网格层级各项能力对应的各项得分数据
|
|
|
|
|
|
//5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
|
|
djList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); |
|
|
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
//5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
|
|
zlList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); |
|
|
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
//5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
|
|
fwList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); |
|
|
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//3.遍历计算每个月能力指数
|
|
|
//6.遍历计算每个月能力指数
|
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>(); |
|
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>(); |
|
|
for (int i = 0; i < djList.size(); i++) { |
|
|
for (int i = 0; i < djList.size(); i++) { |
|
|
AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); |
|
|
AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); |
|
|
nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal()); |
|
|
double num1 = new BigDecimal((djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal())).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore()); |
|
|
nldto.setIndexTotal(num1); |
|
|
nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore()); |
|
|
|
|
|
nldto.setMonthId(djList.get(i).getMonthId()); |
|
|
nldto.setMonthId(djList.get(i).getMonthId()); |
|
|
nlList.add(nldto); |
|
|
nlList.add(nldto); |
|
|
} |
|
|
} |
|
|
//5.封装数据并返回
|
|
|
//5.封装数据并返回
|
|
|
AblityIndexResultDTO nl = new AblityIndexResultDTO(); |
|
|
AblityIndexResultDTO nl = new AblityIndexResultDTO(); |
|
|
nl.setIndexCode(FactConstant.NLZB); |
|
|
nl.setIndexCode(FactConstant.NLZB); |
|
|
nl.setScoreList(djList); |
|
|
nl.setScoreList(nlList); |
|
|
resultDTO.add(nl); |
|
|
if(null != nlList){resultList.add(nl);} |
|
|
AblityIndexResultDTO dj = new AblityIndexResultDTO(); |
|
|
AblityIndexResultDTO dj = new AblityIndexResultDTO(); |
|
|
dj.setIndexCode(FactConstant.DJNL); |
|
|
dj.setIndexCode(FactConstant.DJNL); |
|
|
dj.setScoreList(djList); |
|
|
dj.setScoreList(djList); |
|
|
resultDTO.add(dj); |
|
|
if(null != djList){resultList.add(dj);} |
|
|
AblityIndexResultDTO zl = new AblityIndexResultDTO(); |
|
|
AblityIndexResultDTO zl = new AblityIndexResultDTO(); |
|
|
zl.setIndexCode(FactConstant.ZLNL); |
|
|
zl.setIndexCode(FactConstant.ZLNL); |
|
|
zl.setScoreList(djList); |
|
|
zl.setScoreList(zlList); |
|
|
resultDTO.add(zl); |
|
|
if(null != zlList){resultList.add(zl);} |
|
|
AblityIndexResultDTO fw = new AblityIndexResultDTO(); |
|
|
AblityIndexResultDTO fw = new AblityIndexResultDTO(); |
|
|
fw.setIndexCode(FactConstant.FWNL); |
|
|
fw.setIndexCode(FactConstant.FWNL); |
|
|
fw.setScoreList(djList); |
|
|
fw.setScoreList(fwList); |
|
|
resultDTO.add(fw); |
|
|
if(null != fwList){resultList.add(fw);} |
|
|
|
|
|
|
|
|
return resultDTO; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -132,13 +149,65 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) { |
|
|
public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) { |
|
|
//1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
|
|
|
LinkedList<ScoreListResultDTO> resultList = new LinkedList<>(); |
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
ScoreListResultDTO dj = new ScoreListResultDTO(); |
|
|
ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO); |
|
|
ScoreListResultDTO zl = new ScoreListResultDTO(); |
|
|
//2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
|
|
|
ScoreListResultDTO fw = new ScoreListResultDTO(); |
|
|
//3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
|
|
|
//1.根据类型判断是查询组织数据还是网格数据
|
|
|
|
|
|
//组织层级数据
|
|
|
|
|
|
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { |
|
|
|
|
|
//2.根据组织Id查询组织信息
|
|
|
|
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); |
|
|
|
|
|
if (null == agency) { |
|
|
|
|
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); |
|
|
|
|
|
} |
|
|
|
|
|
//3.根据组织级别判断查询哪类数据表
|
|
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
|
|
//3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
dj = factIndexAgencyScoreDao.selectScoreList(formDTO); |
|
|
|
|
|
//3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zl = factIndexAgencyScoreDao.selectScoreList(formDTO); |
|
|
|
|
|
//3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fw = factIndexAgencyScoreDao.selectScoreList(formDTO); |
|
|
|
|
|
//社区级
|
|
|
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
|
|
//3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
dj = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); |
|
|
|
|
|
//3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zl = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); |
|
|
|
|
|
//3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fw = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return null; |
|
|
//4.网格层级数据
|
|
|
|
|
|
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) { |
|
|
|
|
|
//4-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
dj = factIndexGridScoreDao.selectGridScoreList(formDTO); |
|
|
|
|
|
//4-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zl = factIndexGridScoreDao.selectGridScoreList(formDTO); |
|
|
|
|
|
//4-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fw = factIndexGridScoreDao.selectGridScoreList(formDTO); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); |
|
|
|
|
|
} |
|
|
|
|
|
//5.封装数据并返回
|
|
|
|
|
|
if(null != dj){resultList.add(dj);} |
|
|
|
|
|
if(null != zl){resultList.add(zl);} |
|
|
|
|
|
if(null != fw){resultList.add(fw);} |
|
|
|
|
|
|
|
|
|
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -148,7 +217,78 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) { |
|
|
public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) { |
|
|
return null; |
|
|
LinkedList<MonthScoreListResultDTO> resultList = new LinkedList<>(); |
|
|
|
|
|
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> djList = new LinkedList<>(); |
|
|
|
|
|
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> zlList = new LinkedList<>(); |
|
|
|
|
|
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> fwList = new LinkedList<>(); |
|
|
|
|
|
//1.计算所查月份前12个月的monthId
|
|
|
|
|
|
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); |
|
|
|
|
|
//2.根据类型判断是查询组织数据还是网格数据
|
|
|
|
|
|
//组织层级数据
|
|
|
|
|
|
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { |
|
|
|
|
|
//3.根据组织Id查询组织信息
|
|
|
|
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); |
|
|
|
|
|
if (null == agency) { |
|
|
|
|
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); |
|
|
|
|
|
} |
|
|
|
|
|
//4.根据组织级别判断查询哪类数据表
|
|
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
|
|
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
djList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); |
|
|
|
|
|
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zlList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); |
|
|
|
|
|
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fwList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); |
|
|
|
|
|
|
|
|
|
|
|
//社区级
|
|
|
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
|
|
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
djList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); |
|
|
|
|
|
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zlList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); |
|
|
|
|
|
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fwList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); |
|
|
|
|
|
} |
|
|
|
|
|
//网格层级数据
|
|
|
|
|
|
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) { |
|
|
|
|
|
//5.查询过去12个月网格层级各项能力对应的各项得分数据
|
|
|
|
|
|
//5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
djList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); |
|
|
|
|
|
//5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zlList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); |
|
|
|
|
|
//5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据
|
|
|
|
|
|
formDTO.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fwList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//5.封装数据并返回
|
|
|
|
|
|
MonthScoreListResultDTO dj = new MonthScoreListResultDTO(); |
|
|
|
|
|
dj.setIndexCode(FactConstant.DJNL); |
|
|
|
|
|
dj.setScoreList(djList); |
|
|
|
|
|
if(null != djList){resultList.add(dj);} |
|
|
|
|
|
MonthScoreListResultDTO zl = new MonthScoreListResultDTO(); |
|
|
|
|
|
zl.setIndexCode(FactConstant.ZLNL); |
|
|
|
|
|
zl.setScoreList(zlList); |
|
|
|
|
|
if(null != zlList){resultList.add(zl);} |
|
|
|
|
|
MonthScoreListResultDTO fw = new MonthScoreListResultDTO(); |
|
|
|
|
|
fw.setIndexCode(FactConstant.FWNL); |
|
|
|
|
|
fw.setScoreList(fwList); |
|
|
|
|
|
if(null != fwList){resultList.add(fw);} |
|
|
|
|
|
|
|
|
|
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -159,30 +299,41 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
@Override |
|
|
@Override |
|
|
public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) { |
|
|
public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) { |
|
|
List<AblityListResultDTO> resultList = new ArrayList<>(); |
|
|
List<AblityListResultDTO> resultList = new ArrayList<>(); |
|
|
//按月份查询当前组织各项指标数据 fact_index_agency_sub_score
|
|
|
//1.根据类型判断是查询组织数据还是网格数据
|
|
|
//1.根据组织Id查询组织信息
|
|
|
//组织层级数据
|
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); |
|
|
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { |
|
|
if (null == agency) { |
|
|
//2.根据组织Id查询组织信息
|
|
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); |
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); |
|
|
} |
|
|
if (null == agency) { |
|
|
//2.根据组织级别拼接查询条件,判断查询不同数据表
|
|
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); |
|
|
//区县级、乡镇街道级
|
|
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
|
|
if ("district".equals(agency.getLevel())) { |
|
|
|
|
|
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
|
|
|
} else { |
|
|
|
|
|
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
|
|
|
} |
|
|
} |
|
|
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); |
|
|
//3.根据组织级别拼接查询条件,判断查询不同数据表
|
|
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
|
|
if ("district".equals(agency.getLevel())) { |
|
|
|
|
|
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
|
|
|
} else { |
|
|
|
|
|
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
|
|
|
} |
|
|
|
|
|
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); |
|
|
|
|
|
|
|
|
//社区级
|
|
|
//社区级
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); |
|
|
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); |
|
|
|
|
|
} |
|
|
|
|
|
//网格层级数据
|
|
|
|
|
|
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) { |
|
|
|
|
|
//4.查询网格层级各项能力对应指标数据
|
|
|
|
|
|
formDTO.setAllParentIndexCode(FactConstant.WANG_GE_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
|
|
|
resultList = factIndexGridSubScoreDao.selectGridAblityList(formDTO); |
|
|
} else { |
|
|
} else { |
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); |
|
|
throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); |
|
|
} |
|
|
} |
|
|
//3.调用方法判断各项指标是数字指标还是百分比指标 //TODO
|
|
|
|
|
|
|
|
|
//4.调用方法判断各项指标是数字指标还是百分比指标 //TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -196,24 +347,33 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>(); |
|
|
LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>(); |
|
|
//1.计算所查月份前12个月的monthId
|
|
|
//1.计算所查月份前12个月的monthId
|
|
|
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); |
|
|
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); |
|
|
//2.根据组织Id查询组织信息
|
|
|
//2.根据类型判断是查询组织数据还是网格数据
|
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); |
|
|
//组织层级数据
|
|
|
if (null == agency) { |
|
|
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { |
|
|
throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId())); |
|
|
//3.根据组织Id查询组织信息
|
|
|
} |
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); |
|
|
|
|
|
if (null == agency) { |
|
|
//3.根据组织级别拼接查询条件,判断查询不同数据表
|
|
|
throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getOrgId())); |
|
|
//区县级、乡镇街道级
|
|
|
} |
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
//4.根据组织级别拼接查询条件,判断查询不同数据表
|
|
|
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); |
|
|
//区县级、乡镇街道级
|
|
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
//社区级
|
|
|
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); |
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
//社区级
|
|
|
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); |
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
|
|
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); |
|
|
|
|
|
} |
|
|
|
|
|
//网格层级数据
|
|
|
|
|
|
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) { |
|
|
|
|
|
//5.查询网格层级某项能力对应的一项指标过去12个月份数据
|
|
|
|
|
|
resultList = factIndexGridSubScoreDao.selectGridMonthAblityList(formDTO); |
|
|
} else { |
|
|
} else { |
|
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); |
|
|
throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); |
|
|
} |
|
|
} |
|
|
//3.调用方法判断各项指标是数字指标还是百分比指标//TODO
|
|
|
|
|
|
|
|
|
//6.调用方法判断各项指标是数字指标还是百分比指标//TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
|
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -243,7 +403,7 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) { |
|
|
public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) { |
|
|
//1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据)
|
|
|
//1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据)
|
|
|
List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); |
|
|
List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); |
|
|
return resultList; |
|
|
return resultList; |
|
|
} |
|
|
} |
|
|