Browse Source

社区列表

dev
lichao 2 years ago
parent
commit
c0d9dac17d
  1. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CommunityCountCensusFormDTO.java
  2. 11
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyIdResultDTO.java
  3. 6
      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. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  6. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  7. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

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

@ -25,4 +25,8 @@ public class CommunityCountCensusFormDTO implements Serializable {
private Date timeStart; private Date timeStart;
private Date timeEnd; private Date timeEnd;
private Integer pageNum;
private Integer pageSize;
} }

11
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyIdResultDTO.java

@ -4,6 +4,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* @Description: * @Description:
@ -14,11 +15,19 @@ import java.io.Serializable;
public class CommunityListByAgencyIdResultDTO implements Serializable { public class CommunityListByAgencyIdResultDTO implements Serializable {
private static final long serialVersionUID = -1677303397440121269L; private static final long serialVersionUID = -1677303397440121269L;
private String id;
private String pids;
private String name; private String name;
private String streeName; private String streeName;
// private String streeId;
private String districtName; private String districtName;
private String createTime; // private String districtId;
private Date createTime;
} }

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

@ -548,9 +548,9 @@ public class CustomerAgencyController {
* @Author: lichao * @Author: lichao
* @Date: 2023/4/7 16:49 * @Date: 2023/4/7 16:49
*/ */
@GetMapping("getCommunityList") @PostMapping("getCommunityList")
public Result<List<CommunityListByAgencyIdResultDTO>> getCommunityList(@RequestBody CommunityCountCensusFormDTO dto){ public Result<PageData<CommunityListByAgencyIdResultDTO>> getCommunityList(@RequestBody CommunityCountCensusFormDTO dto){
return new Result<List<CommunityListByAgencyIdResultDTO>>().ok(customerAgencyService.getCommunityList(dto)); return new Result<PageData<CommunityListByAgencyIdResultDTO>>().ok(customerAgencyService.getCommunityList(dto));
} }
} }

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

@ -437,5 +437,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
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); Integer getCommunityCount(@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
List<CommunityListByAgencyIdResultDTO> getCommunityByPidList (@Param("pids")String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
} }

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

@ -386,5 +386,5 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Author: lichao * @Author: lichao
* @Date: 2023/4/7 16:49 * @Date: 2023/4/7 16:49
*/ */
List<CommunityListByAgencyIdResultDTO> getCommunityList(CommunityCountCensusFormDTO dto); PageData<CommunityListByAgencyIdResultDTO> getCommunityList(CommunityCountCensusFormDTO dto);
} }

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

@ -45,6 +45,7 @@ import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.*; import com.epmet.dao.*;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.region.LogOperationResultDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity; import com.epmet.entity.CustomerDepartmentEntity;
@ -58,6 +59,8 @@ import com.epmet.feign.OperCrmFeignClient;
import com.epmet.redis.CustomerAgencyRedis; import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerAgencyService;
import com.epmet.util.ModuleConstant; import com.epmet.util.ModuleConstant;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -1689,19 +1692,40 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
} }
@Override @Override
public List<CommunityListByAgencyIdResultDTO> getCommunityList(CommunityCountCensusFormDTO dto) { public PageData<CommunityListByAgencyIdResultDTO> getCommunityList(CommunityCountCensusFormDTO dto) {
CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId()); CustomerAgencyEntity customerAgency = baseDao.selectById(dto.getAgencyId());
if (customerAgency!=null){ if (customerAgency!=null){
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids()); String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<CommunityListByAgencyIdResultDTO> entityList = baseDao.getCommunityByPidList(pids,dto.getTimeStart(),dto.getTimeEnd());
entityList.forEach(
entity->{
String[] pidArray = entity.getPids().split(":");
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper = new LambdaQueryWrapper<CustomerAgencyEntity>().in(CustomerAgencyEntity::getId,pidArray);
List<CustomerAgencyEntity> customerAgencyEntities = baseDao.selectList(queryWrapper);
for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) {
if (customerAgencyEntity.getLevel().equals("district")){
entity.setDistrictName(customerAgencyEntity.getOrganizationName());
}
if (customerAgencyEntity.getLevel().equals("street")){
entity.setStreeName(customerAgencyEntity.getOrganizationName());
}
}
}
);
PageInfo<CommunityListByAgencyIdResultDTO> pageInfo = new PageInfo<>(entityList);
return new PageData<>(entityList, pageInfo.getTotal(),dto.getPageSize());
}else { }else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常");
} }
return null;
} }
} }

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

@ -1198,4 +1198,19 @@
and agency.CREATED_TIME &lt;= #{timeEnd} and agency.CREATED_TIME &lt;= #{timeEnd}
</if> </if>
</select> </select>
<select id="getCommunityByPidList" resultType="com.epmet.dto.result.CommunityListByAgencyIdResultDTO">
SELECT
ID,ORGANIZATION_NAME as name,CREATED_TIME as createTime,PIDS as pids
FROM customer_agency
WHERE DEL_FLAG = '0'
AND `LEVEL` = 'community'
AND PIDS LIKE CONCAT(#{agencyId},'%')
<if test="timeStart != null">
and CREATED_TIME &gt;= #{timeStart}
</if>
<if test="timeEnd != null">
and CREATED_TIME &lt;= #{timeEnd}
</if>
</select>
</mapper> </mapper>

Loading…
Cancel
Save