Browse Source

分类饼2

master
yinzuomei 3 years ago
parent
commit
5a0f3c1845
  1. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java
  2. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  3. 11
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  4. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  5. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  6. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  7. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  8. 22
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  9. 1
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java
  10. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  11. 24
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  12. 24
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 当前组织的直属下级下级组织+直属网格
*/
@Data
public class SubOrgResDTO implements Serializable {
private String orgId;
/**
* agency
* grid
*/
private String orgType;
private String orgName;
}

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

@ -624,4 +624,12 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/house/houseupdate")
Result houseUpdate(@RequestBody IcHouseAddFormDTO formDTO);
/**
* 直属网格+下一级组织
* @param agencyId
* @return
*/
@GetMapping("/gov/org/customeragency/subOrgList/{agencyId}")
Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId")String agencyId);
}

11
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -403,4 +403,15 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result houseUpdate( IcHouseAddFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "houseUpdate",formDTO);
}
/**
* 直属网格+下一级组织
*
* @param agencyId
* @return
*/
@Override
public Result<List<SubOrgResDTO>> subOrgList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList",agencyId);
}
}

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

@ -415,4 +415,16 @@ public class CustomerAgencyController {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.rootAgencyGridTree(formDTO.getAgencyId()));
}
/**
* 当前agencyId的下一级组织+直属网格
* @param agencyId
* @return
*/
@GetMapping("subOrgList/{agencyId}")
public Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId") String agencyId) {
List<SubOrgResDTO> list = customerAgencyService.subOrgList(agencyId);
return new Result<List<SubOrgResDTO>>().ok(list);
}
}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -316,5 +316,6 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/
List<CommunityListResultDTO> getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId);
List<SubOrgResDTO> selectSubOrg(String agencyId);
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -288,4 +288,11 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @author sun
**/
AgencyTreeResultDTO rootAgencyGridTree(String agencyId);
/**
* 当前agencyId的下一级组织+直属网格
* @param agencyId
* @return
*/
List<SubOrgResDTO> subOrgList(String agencyId);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1442,4 +1442,15 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return result;
}
/**
* 当前agencyId的下一级组织+直属网格
*
* @param agencyId
* @return
*/
@Override
public List<SubOrgResDTO> subOrgList(String agencyId) {
return baseDao.selectSubOrg(agencyId);
}
}

22
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -756,4 +756,26 @@
AND CUSTOMER_ID = #{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
<select id="selectSubOrg" resultType="com.epmet.dto.result.SubOrgResDTO">
SELECT
ca.ID AS orgId,
ca.ORGANIZATION_NAME AS orgName,
'agency' AS orgType
FROM
customer_agency ca
WHERE
ca.DEL_FLAG = '0'
AND ca.PID = #{agencyId}
union ALL
SELECT
cg.ID AS orgId,
cg.GRID_NAME AS orgName,
'grid' AS orgType
FROM
customer_grid cg
WHERE
cg.DEL_FLAG = '0'
AND cg.PID = #{agencyId}
</select>
</mapper>

1
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java

@ -5,6 +5,7 @@ import lombok.Data;
import java.io.Serializable;
@Data
public class IcEventAnalysisOrgResDTO implements Serializable {
private String orgId;

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java

@ -83,4 +83,14 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
* @return
*/
List<IcEventCategoryAnalysisResDTO> selectFirstCategoryTotal(IcEventCategoryAnalysisFormDTO formDTO);
Integer selectGridTotal(String gridId);
/**
*
* @param orgId
* @param orgType
* @return
*/
Integer selectOrgTotal(@Param("orgId") String orgId, @Param("orgType") String orgType);
}

24
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -755,8 +755,28 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
*/
@Override
public List<IcEventAnalysisOrgResDTO> analysisOrgTotal(IcEventCategoryAnalysisFormDTO formDTO) {
//todo
return null;
List<IcEventAnalysisOrgResDTO> list = new ArrayList<>();
if ("grid".equals(formDTO.getOrgType())) {
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfoCache) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常");
}
IcEventAnalysisOrgResDTO grid = ConvertUtils.sourceToTarget(formDTO,IcEventAnalysisOrgResDTO.class);
grid.setOrgName(gridInfoCache.getGridName());
grid.setTotal(baseDao.selectGridTotal(formDTO.getOrgId()));
list.add(grid);
return list;
}
Result<List<SubOrgResDTO>> subOrgListRes = govOrgOpenFeignClient.subOrgList(formDTO.getOrgId());
if (!subOrgListRes.success() || CollectionUtils.isEmpty(subOrgListRes.getData())) {
return list;
}
for (SubOrgResDTO org : subOrgListRes.getData()) {
IcEventAnalysisOrgResDTO resultDto = ConvertUtils.sourceToTarget(org, IcEventAnalysisOrgResDTO.class);
resultDto.setTotal(baseDao.selectOrgTotal(org.getOrgId(), org.getOrgType()));
list.add(resultDto);
}
return list;
}

24
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -168,4 +168,28 @@
ORDER BY
total DESC
</select>
<select id="selectGridTotal" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
count( ie.id ) as total
FROM
ic_event ie
WHERE
ie.DEL_FLAG = '0'
AND ie.GRID_ID =#{gridId}
</select>
<select id="selectOrgTotal" parameterType="map" resultType="java.lang.Integer">
SELECT LEFT
count( ie.id ) as total
FROM
ic_event ie
WHERE
ie.DEL_FLAG = '0'
<if test="orgType == 'agency'">
and ie.GRID_PIDS like CONCAT('%',#{orgId},'%')
</if>
<if test="orgType == 'grid'">
and ie.GRID_ID=#{orgId}
</if>
</select>
</mapper>
Loading…
Cancel
Save