wxz 2 years ago
parent
commit
a4fe021211
  1. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyCountCensusResultDTO.java
  2. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  3. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  4. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  5. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  6. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java
  7. 30
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  8. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml

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

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName AgencyCountCensus$
* @Description
* @Date 2023/4/6 16:46
* @Author lichao
**/
@Data
public class AgencyCountCensusResultDTO implements Serializable {
private static final long serialVersionUID = 4360690752084258055L;
private String level;
private Integer count;
}

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

@ -517,5 +517,21 @@ public class CustomerAgencyController {
return customerAgencyService.getCurrentUserCommunityInfo(tokenDTO);
}
/**
* @Description: 返回下级数量统计
* @param agencyId:
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.AgencyCountCensusResultDTO>>
* @Author: lichao
* @Date: 2023/4/7 14:48
*/
@GetMapping("getAgencyCountList")
public Result<List<AgencyCountCensusResultDTO>> getAgencyCountList(@RequestParam String agencyId){
return new Result<List<AgencyCountCensusResultDTO>>().ok(customerAgencyService.getAgencyCountList(agencyId));
}
}

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

@ -429,5 +429,11 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @return
*/
List<AgencyResultDTO> getAllCommunity(String customerId);
List<AgencyCountCensusResultDTO> agencyCount(@Param("pids") String pids);
Integer agencyGridCount(@Param("pids") String pids);
Integer agencyStaffCount(@Param("pids") String pids);
}

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

@ -362,4 +362,11 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @return
*/
String getOrgIdPath(String orgId);
/**
* 返回下级数量
* @param agencyId
* @return
*/
List<AgencyCountCensusResultDTO> getAgencyCountList(String agencyId);
}

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

@ -37,6 +37,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.CustomerGridConstant;
@ -1624,4 +1625,37 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
return customerAgencyEntity.getPids().concat(StrConstant.COLON).concat(orgId);
}
/**
* @Description:
* @param agencyId:
* @Return java.util.List<com.epmet.dto.result.AgencyCountCensusResultDTO>
* @Author: lichao
* @Date: 2023/4/7 14:17
*/
@Override
public List<AgencyCountCensusResultDTO> getAgencyCountList(String agencyId) {
List<AgencyCountCensusResultDTO> agencyCountCensusResultDTOS = new ArrayList<>();
CustomerAgencyEntity customerAgency = baseDao.selectById(agencyId);
if (customerAgency != null){
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
agencyCountCensusResultDTOS = baseDao.agencyCount(pids);
AgencyCountCensusResultDTO agencyCountCensusResultDTOGrid = new AgencyCountCensusResultDTO();
agencyCountCensusResultDTOGrid.setLevel("grid");
agencyCountCensusResultDTOGrid.setCount(baseDao.agencyGridCount(pids));
agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOGrid);
AgencyCountCensusResultDTO agencyCountCensusResultDTOStaff = new AgencyCountCensusResultDTO();
agencyCountCensusResultDTOStaff.setLevel("staff");
agencyCountCensusResultDTOStaff.setCount(baseDao.agencyStaffCount(pids));
agencyCountCensusResultDTOS.add(agencyCountCensusResultDTOStaff);
}else{
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常");
}
return agencyCountCensusResultDTOS;
}
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffLoginLogServiceImpl.java

@ -186,6 +186,12 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao,
@Override
public PageData<AccountActivityInfo> getAccountActivityInfo(CountActivityFormDTO formDTO) {
if (formDTO.getIsPage()) {
List<AccountActivityInfo> accountActivityInfos = baseDao.selectListActivityInfo(formDTO);
int total = CollectionUtils.isEmpty(accountActivityInfos) ? NumConstant.ZERO : accountActivityInfos.size();
return new PageData<>(accountActivityInfos, total);
}
List<AccountActivityInfo> accountActivityInfos = baseDao.selectListActivityInfo(formDTO);
int total = CollectionUtils.isEmpty(accountActivityInfos) ? NumConstant.ZERO : accountActivityInfos.size();
return new PageData<>(accountActivityInfos, total);

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

@ -863,6 +863,36 @@
AND CUSTOMER_ID = #{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
<select id="agencyCount" resultType="com.epmet.dto.result.AgencyCountCensusResultDTO">
select level,count(*)
from customer_agency
where DEL_FLAG = 0
and PIDS like concat(#{pids},'%')
group by level
</select>
<select id="agencyGridCount" resultType="java.lang.Integer">
select count(*)
from customer_grid
where DEL_FLAG = 0
and PIDS like concat(#{pids},'%')
</select>
<select id="agencyStaffCount" resultType="java.lang.Integer">
select count(1)
from customer_staff_agency staff
left join customer_agency agency on staff.AGENCY_ID = agency.ID
where agency.DEL_FLAG = 0
and
staff.DEL_FLAG = 0
and agency.PIDS like concat(#{pids},'%')
</select>
<select id="selectSubOrg" resultType="com.epmet.dto.result.SubOrgResDTO">
SELECT

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffLoginLogDao.xml

@ -49,7 +49,7 @@
and l.LOGIN_TIME &lt;= #{endDate}
</if>
GROUP BY ca.id
order by count(l.id) desc
order by count(l.id) desc,ca.CREATED_TIME desc
</select>
<!--社区活跃列表-->
<select id="selectListActivityInfo" resultType="com.epmet.dto.result.yt.AccountActivityInfo">
@ -111,7 +111,7 @@
and l.LOGIN_TIME &lt;= #{endDate}
</if>
group by ca.id
order by count(l.ID) desc
order by count(l.ID) desc,ca.CREATED_TIME desc
</select>
<!-- 账号登录情况:查看区县-->
@ -176,13 +176,11 @@
customer_agency a
LEFT JOIN staff_login_log l ON a.ID = l.AGENCY_ID
WHERE
a.PIDS LIKE CONCAT(
'%',
#{orgId},
'%'
)
AND a.`LEVEL` = 'community'
a.`LEVEL` = 'community'
AND a.DEL_FLAG = '0'
<if test="orgId!= null and orgId.trim() != ''">
AND a.PIDS LIKE CONCAT('%',#{orgId},'%')
</if>
GROUP BY
a.ID
) t;

Loading…
Cancel
Save