Browse Source

Merge branch 'yantai_zhengwu_master' of http://121.42.41.42:7070/r/epmet-cloud into yantai_zhengwu_master

dev
曲树通 2 years ago
parent
commit
cfb16c68ef
  1. 28
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommunityCountCensusFormDTO.java
  2. 23
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountCensusResultDTO.java
  3. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  5. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  6. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  7. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

28
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommunityCountCensusFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName AgencyCountCensus$
* @Description
* @Date 2023/4/6 16:46
* @Author lichao
**/
@Data
public class CommunityCountCensusFormDTO implements Serializable {
private static final long serialVersionUID = 4360690752084258055L;
@NotBlank(message = "组织Id不能为空")
private String agencyId;
private Date timeStart;
private Date timeEnd;
}

23
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountCensusResultDTO.java

@ -0,0 +1,23 @@
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 CommunityCountCensusResultDTO implements Serializable {
private static final long serialVersionUID = 4360690752084258055L;
private String agencyId;
private String agencyName;
private Integer count;
}

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

@ -529,6 +529,19 @@ public class CustomerAgencyController {
return new Result<List<AgencyCountCensusResultDTO>>().ok(customerAgencyService.getAgencyCountList(agencyId)); return new Result<List<AgencyCountCensusResultDTO>>().ok(customerAgencyService.getAgencyCountList(agencyId));
} }
/**
* @Description: 获取下级组织数量统计
* @param dto:
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.CommunityCountCensusResultDTO>>
* @Author: lichao
* @Date: 2023/4/7 15:08
*/
@PostMapping("getCommunityCountList")
public Result<List<CommunityCountCensusResultDTO>> getCommunityCountList(@RequestBody CommunityCountCensusFormDTO dto){
return new Result<List<CommunityCountCensusResultDTO>>().ok(customerAgencyService.getCommunityCountList(dto));
}

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

@ -435,5 +435,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
Integer agencyGridCount(@Param("pids") String pids); Integer agencyGridCount(@Param("pids") String pids);
Integer agencyStaffCount(@Param("pids") String pids); Integer agencyStaffCount(@Param("pids") String pids);
Integer getCommunityCount(@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
} }

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

@ -369,4 +369,13 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @return * @return
*/ */
List<AgencyCountCensusResultDTO> getAgencyCountList(String agencyId); List<AgencyCountCensusResultDTO> getAgencyCountList(String agencyId);
/**
* @Description: 获取下级组织的社区数量
* @param dto:
* @Return java.util.List<com.epmet.dto.result.CommunityCountCensusResultDTO>
* @Author: lichao
* @Date: 2023/4/7 15:09
*/
List<CommunityCountCensusResultDTO> getCommunityCountList(CommunityCountCensusFormDTO dto);
} }

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

@ -17,6 +17,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -1658,4 +1659,33 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return agencyCountCensusResultDTOS; return agencyCountCensusResultDTOS;
} }
@Override
public List<CommunityCountCensusResultDTO> getCommunityCountList(CommunityCountCensusFormDTO dto) {
List<CommunityCountCensusResultDTO> resultDTOS = new ArrayList<>();
CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId());
if (customerAgency!=null){
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper = new LambdaQueryWrapper<CustomerAgencyEntity>().eq(CustomerAgencyEntity::getPids,pids);
List<CustomerAgencyEntity> agencyEntityList = baseDao.selectList(queryWrapper);
agencyEntityList.forEach(
entity->{
CommunityCountCensusResultDTO communityCountCensusResultDTO = new CommunityCountCensusResultDTO();
communityCountCensusResultDTO.setAgencyId(entity.getId());
communityCountCensusResultDTO.setAgencyName(entity.getOrganizationName());
String agencyPids = PidUtils.convertPid2OrgIdPath(entity.getId(),entity.getPids());
communityCountCensusResultDTO.setCount(baseDao.getCommunityCount(agencyPids,dto.getTimeStart(),dto.getTimeEnd()));
resultDTOS.add(communityCountCensusResultDTO);
}
);
}else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常");
}
return resultDTOS;
}
} }

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

@ -1184,4 +1184,18 @@
ca.del_flag = '0' ca.del_flag = '0'
AND ca.customer_id = #{customerId} AND ca.customer_id = #{customerId}
</select> </select>
<select id="getCommunityCount" resultType="java.lang.Integer">
select count(1)
from customer_agency agency
where agency.DEL_FLAG = 0
and agency.LEVEL = 'community'
and agency.PIDS like concat(#{pids},'%')
<if test="timeStart != null">
and agency.CREATED_TIME &gt;= #{timeStart}
</if>
<if test="timeEnd != null">
and agency.CREATED_TIME &lt;= #{timeEnd}
</if>
</select>
</mapper> </mapper>

Loading…
Cancel
Save