|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.datareport.service.fact.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
@ -12,6 +13,7 @@ import com.epmet.datareport.dao.fact.*; |
|
|
|
import com.epmet.datareport.service.fact.FactIndexService; |
|
|
|
import com.epmet.evaluationindex.screen.dto.form.*; |
|
|
|
import com.epmet.evaluationindex.screen.dto.result.*; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -29,6 +31,7 @@ import java.util.regex.Pattern; |
|
|
|
* |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|
|
|
public class FactIndexServiceImpl implements FactIndexService { |
|
|
@ -77,12 +80,12 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
} |
|
|
|
//4.根据组织级别判断查询哪类数据表
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { |
|
|
|
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分数据
|
|
|
|
list = factIndexAgencyScoreDao.selectAgencyAblityWeightScoreIndex(formDTO); |
|
|
|
|
|
|
|
//社区级
|
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
} else if ("community".equals(agency.getAgencyLevel())) { |
|
|
|
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据
|
|
|
|
list = factIndexCommunityScoreDao.selectCommunityAblityWeightScore(formDTO); |
|
|
|
} else { |
|
|
@ -179,11 +182,11 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
} |
|
|
|
//3.根据组织级别判断查询哪类数据表
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { |
|
|
|
//3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分
|
|
|
|
resultList = factIndexAgencyScoreDao.selectAgencyWeightScoreList(formDTO); |
|
|
|
//社区级
|
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
} else if ("community".equals(agency.getAgencyLevel())) { |
|
|
|
//3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分
|
|
|
|
resultList = factIndexCommunityScoreDao.selectCommunityWeightScoreList(formDTO); |
|
|
|
} else { |
|
|
@ -221,22 +224,25 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { |
|
|
|
//3.根据组织Id查询组织信息
|
|
|
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); |
|
|
|
log.debug("monthScoreList search agency result:{}", JSON.toJSONString(agency)); |
|
|
|
if (null == agency) { |
|
|
|
//throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
|
|
|
|
log.warn(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
//4.根据组织级别判断查询哪类数据表
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { |
|
|
|
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据
|
|
|
|
list = factIndexAgencyScoreDao.selectAgencyMonthWeightScoreList(formDTO); |
|
|
|
|
|
|
|
log.debug("monthScoreList search selectAgencyMonthWeightScoreList result:{}", JSON.toJSONString(list)); |
|
|
|
//社区级
|
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
} else if ("community".equals(agency.getAgencyLevel())) { |
|
|
|
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据
|
|
|
|
list = factIndexCommunityScoreDao.selectCommunityMonthWeightScoreList(formDTO); |
|
|
|
log.debug("monthScoreList search selectCommunityMonthWeightScoreList result:{}", JSON.toJSONString(list)); |
|
|
|
} else { |
|
|
|
//throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
|
|
|
|
log.warn(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); |
|
|
|
log.debug("monthScoreList search othoer result:{}", JSON.toJSONString(list)); |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
//网格层级数据
|
|
|
@ -246,7 +252,7 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
} else { |
|
|
|
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); |
|
|
|
} |
|
|
|
|
|
|
|
log.debug("monthScoreList search result:{}", JSON.toJSONString(list)); |
|
|
|
//5.封装数据并返回
|
|
|
|
for (MonthScoreListResultDTO.ScoreListResultDTO l : list) { |
|
|
|
if (FactConstant.DJNL.equals(l.getIndexCode())) { |
|
|
@ -275,7 +281,7 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
if (null != fwList) { |
|
|
|
resultList.add(fw); |
|
|
|
} |
|
|
|
|
|
|
|
log.debug("monthScoreList search return result:{}", JSON.toJSONString(resultList)); |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
@ -298,8 +304,8 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
} |
|
|
|
//3.根据组织级别拼接查询条件,判断查询不同数据表
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
if ("district".equals(agency.getLevel())) { |
|
|
|
if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { |
|
|
|
if ("district".equals(agency.getAgencyLevel())) { |
|
|
|
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
|
} else { |
|
|
|
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
@ -307,7 +313,7 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); |
|
|
|
|
|
|
|
//社区级
|
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
} else if ("community".equals(agency.getAgencyLevel())) { |
|
|
|
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
|
|
|
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); |
|
|
|
} else { |
|
|
@ -366,10 +372,10 @@ public class FactIndexServiceImpl implements FactIndexService { |
|
|
|
} |
|
|
|
//4.根据组织级别拼接查询条件,判断查询不同数据表
|
|
|
|
//区县级、乡镇街道级
|
|
|
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
|
|
|
if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { |
|
|
|
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); |
|
|
|
//社区级
|
|
|
|
} else if ("community".equals(agency.getLevel())) { |
|
|
|
} else if ("community".equals(agency.getAgencyLevel())) { |
|
|
|
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); |
|
|
|
} else { |
|
|
|
//throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
|
|
|
|