Browse Source

Merge remote-tracking branch 'origin/dev_pyscreen' into dev_temp

dev_shibei_match
zxc 5 years ago
parent
commit
2ceca250af
  1. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java
  2. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  3. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  4. 38
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  5. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
  6. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java

@ -32,4 +32,9 @@ public class AgencyNumTypeParamFormDTO implements Serializable {
@NotBlank(message = "类型不能为空", groups = AgencyNumTypeParamGroup.class)
private String type;
/**
* 地区编码
*/
private String areaCode;
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java

@ -42,6 +42,15 @@ public interface ScreenDifficultyDataDao {
**/
List<DifficultProjectResultDTO> selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type);
/**
* @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数new
* @Param orgIds
* @Param type
* @author zxc
* @date 2021/2/25 下午6:41
*/
List<DifficultProjectResultDTO> selectDifficultyNew(@Param("orgIds")List<String> orgIds,@Param("type")String type);
ProjectDetailResultDTO projectDetail(@Param("eventId")String projectId);
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java

@ -41,4 +41,13 @@ public interface ScreenGovernRankDataDao{
* @date 2020.08.20 17:34
**/
List<GovernCapacityResultDTO> selectGovernCapacityRatio(@Param("monthId") String monthId,@Param("agencyId") String agencyId);
/**
* @Description 查询政府治理能力各项指标new
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2021/2/26 上午9:22
*/
List<GovernCapacityResultDTO> selectGovernCapacityRatioNew(@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
}

38
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.*;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant;
@ -58,6 +59,9 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
private OperCrmOpenFeignClient crmClient;
@Autowired
private ScreenCustomerAgencyDao agencyDao;
@Autowired
private AgencyService screenCustomerAgencyService;
/**
* @Description 1热心市民积分排行
@ -100,11 +104,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<DifficultProjectResultDTO> difficultProject(AgencyNumTypeParamFormDTO param) {
List<String> nextAgencyIds = new ArrayList<>();
List<DifficultProjectResultDTO> result = new ArrayList<>();
if(null == param.getTopNum()){
param.setTopNum(NumConstant.TWO);
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<DifficultProjectResultDTO> result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType());
if (StringUtils.isNotEmpty(param.getAreaCode())){
nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId());
if (CollectionUtils.isEmpty(nextAgencyIds)){
return new ArrayList<>();
}
result = screenDifficultyDataDao.selectDifficultyNew(nextAgencyIds,param.getType());
}else {
result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType());
}
for(DifficultProjectResultDTO resultDTO:result){
if (StringUtils.isNotBlank(resultDTO.getImgUrl()) && !resultDTO.getImgUrl().contains("http")) {
resultDTO.setImgUrl(StrConstant.EPMETY_STR);
@ -202,19 +216,33 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<GovernCapacityRankResultDTO> governCapacityRank(AgencyAndNumFormDTO param) {
List<GovernCapacityResultDTO> orderList = new ArrayList<>();
if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE);
if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
String monthId = dateUtils.getCurrentMonthId();
List<GovernCapacityResultDTO> orderList =
screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId());
if (StringUtils.isNotEmpty(param.getAreaCode())){
List<String> nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId());
if (CollectionUtils.isEmpty(nextAgencyIds)){
return new ArrayList<>();
}
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds);
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
orderList =
screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId());
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds);
}
}else {
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId());
int time = NumConstant.TWELVE;
while (CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE) {
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
PageHelper.startPage(NumConstant.ONE, param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId());
}
}
if(null == orderList || orderList.isEmpty()) return new ArrayList<>();
List<GovernCapacityRankResultDTO> result = new LinkedList<>();

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml

@ -52,4 +52,28 @@
AND dd.EVENT_ID = #{eventId}
</select>
<!-- 查询难点赌点-耗时最长|涉及部门最多|处理次数【new】 -->
<select id="selectDifficultyNew" resultType="com.epmet.evaluationindex.screen.dto.result.DifficultProjectResultDTO">
SELECT
diff.EVENT_ID AS projectId,
diff.EVENT_CONTENT AS title,
diff.EVENT_STATUS_CODE AS STATUS,
ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours,
diff.EVENT_SOURCE AS gridName,
diff.EVENT_IMG_URL AS imgUrl,
IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName,
diff.EVENT_RE_ORG AS handleDepts,
diff.EVENT_RE_ORG AS handleCount
FROM
screen_difficulty_data diff
WHERE
diff.DEL_FLAG = '0'
AND (
<foreach collection="orgIds" item="id" separator=" OR ">
diff.ALL_PARENT_IDS LIKE CONCAT('%',#{id},'%')
</foreach>
)
ORDER BY (CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT ELSE diff.EVENT_RE_ORG END) DESC
</select>
</mapper>

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml

@ -25,4 +25,28 @@
(rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC
</select>
<!-- -->
<select id="selectGovernCapacityRatioNew" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
SELECT
rankData.ORG_NAME AS agencyName,
rankData.RESPONSE_RATIO,
rankData.RESOLVED_RATIO,
rankData.GOVERN_RATIO,
rankData.SATISFACTION_RATIO,
agency.AGENCY_NAME AS parentAgencyName
FROM
screen_govern_rank_data rankData
LEFT JOIN screen_customer_agency agency ON rankData.PARENT_ID = agency.AGENCY_ID AND agency.DEL_FLAG = '0'
WHERE
rankData.DEL_FLAG = '0'
AND (
<foreach collection="orgIds" item="orgId" separator=" OR ">
rankData.PARENT_ID = #{orgId}
</foreach>
)
AND rankData.MONTH_ID = #{monthId}
ORDER BY
(rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC
</select>
</mapper>
Loading…
Cancel
Save