Browse Source

Merge remote-tracking branch 'origin/dev_data_fusion' into develop

master
yinzuomei 4 years ago
parent
commit
735f561ce3
  1. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  2. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  3. 60
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  4. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

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

@ -393,8 +393,15 @@ public class AgencyServiceImpl implements AgencyService {
ScreenCustomerAgencyDTO rootAgency=screenCustomerAgencyDao.selectCustomerRootAgency(formDTO.getCustomerId());
agencysResultDTO.setRootlevel(rootAgency.getLevel());
agencysResultDTO.setRootAgencyId(rootAgency.getAgencyId());
//3、当前登录用户所属客户,是否开启了area_code开关
agencysResultDTO.setAreaCodeSwitch(govOrgOpenFeignClient.getAreaCodeSwitch(formDTO.getCustomerId()).getData());
Result<String> govOrgRes=govOrgOpenFeignClient.getAreaCodeSwitch(formDTO.getCustomerId());
log.info("当前登录用户所属客户,是否开启了area_code开关,返参:"+ JSON.toJSONString(govOrgRes));
if(govOrgRes.success()&&StringUtils.isNotBlank(govOrgRes.getData())){
agencysResultDTO.setAreaCodeSwitch(govOrgRes.getData());
}else{
agencysResultDTO.setAreaCodeSwitch("closed");
}
//4、如果当前客户不存在子客户则areaCode置为空
Result<List<String>> crmRes=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java

@ -375,7 +375,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}
@ -444,7 +448,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}
@ -525,7 +533,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}
@ -606,7 +618,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}

60
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -297,8 +297,7 @@
<select id="selectGridResponse" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.ORG_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT ORG_ID,
COUNT( ID ) AS "count"
@ -323,12 +322,22 @@
AND MONTH_ID = #{monthId}
GROUP BY ORG_ID ) b
ON a.ORG_ID = b.ORG_ID
LEFT JOIN
(SELECT ORG_ID,
COUNT(DISTINCT ID ) AS "count"
FROM fact_origin_project_log_daily
WHERE ORG_TYPE = 'grid'
AND ACTION_CODE = 'response'
AND IS_ACTIVE = 1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY ORG_ID ) c
ON a.ORG_ID = c.ORG_ID
</select>
<select id="selectOrgResponse" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.AGENCY_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT da.ID AS AGENCY_ID,
COUNT( f.ID ) AS "count"
@ -356,6 +365,19 @@
AND f.MONTH_ID = #{monthId}
GROUP BY da.ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
LEFT JOIN
(SELECT da.ID AS AGENCY_ID,
COUNT(DISTINCT f.ID ) AS "count"
FROM fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.PIDS LIKE CONCAT( '%', da.ID, '%' )
AND da.`LEVEL` = #{level}
WHERE
ACTION_CODE = 'response'
AND f.IS_ACTIVE = 1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY da.ID ) c
ON a.AGENCY_ID = c.AGENCY_ID
</select>
<select id="selectGridSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
@ -570,8 +592,7 @@
<select id="selectOrgResponseDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.AGENCY_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT da.ID AS AGENCY_ID,
COUNT( f.ID ) AS "count"
@ -599,12 +620,24 @@
AND f.DATE_ID &lt;= #{dateId}
GROUP BY da.ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
LEFT JOIN
(SELECT da.ID AS AGENCY_ID,
COUNT(DISTINCT f.ID ) AS "count"
FROM fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.PIDS LIKE CONCAT( '%', da.ID, '%' )
AND da.`LEVEL` = #{level}
WHERE
ACTION_CODE = 'response'
AND f.IS_ACTIVE = 1
AND f.CUSTOMER_ID = #{customerId}
AND f.DATE_ID &lt;= #{dateId}
GROUP BY da.ID ) c
ON a.AGENCY_ID = c.AGENCY_ID
</select>
<select id="selectGridResponseDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.ORG_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT ORG_ID,
COUNT( ID ) AS "count"
@ -627,6 +660,17 @@
AND DATE_ID &lt;= #{dateId}
GROUP BY ORG_ID ) b
ON a.ORG_ID = b.ORG_ID
LEFT JOIN
(SELECT ORG_ID,
COUNT( DISTINCT ID ) AS "count"
FROM fact_origin_project_log_daily
WHERE ORG_TYPE = 'grid'
AND ACTION_CODE = 'response'
AND IS_ACTIVE = 1
AND CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
GROUP BY ORG_ID ) c
ON a.ORG_ID = c.ORG_ID
</select>
<select id="selectGridSelfDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -350,6 +350,6 @@ public interface GovOrgOpenFeignClient {
* @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填closed: 无需选择地区编码;;0409新增返参;没配置,返回closed
* @Date 2021/6/24 16:11
**/
@PostMapping(value = "/gov/org/customeragency/getAreaCodeSwitch/{customerId}")
@GetMapping(value = "/gov/org/customeragency/getareacodeswitch/{customerId}")
Result<String> getAreaCodeSwitch(@PathVariable("customerId")String customerId);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -298,7 +298,7 @@ public class CustomerAgencyController {
return new Result<OrganizeTreeResultDTO>().ok(customerAgencyService.organizeTree(agencyId));
}
@PostMapping("getAreaCodeSwitch/{customerId}")
@GetMapping("getareacodeswitch/{customerId}")
public Result<String> getAreaCodeSwitch(@PathVariable("customerId")String customerId){
return new Result<String>().ok(customerOrgParameterService.getAreaCodeSwitch(customerId));
}

Loading…
Cancel
Save