Browse Source

dto

release
yinzuomei 3 years ago
parent
commit
def998c5ae
  1. 6
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java
  2. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  3. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  4. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java
  5. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  6. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  7. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java
  8. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

6
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java

@ -21,6 +21,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
@ -172,4 +173,9 @@ public class CustomerAgencyDTO implements Serializable {
* 联系电话 * 联系电话
*/ */
private String mobile; private String mobile;
/**
* 地区编码全路径例如37,3702,370203,370203005,370203005015
*/
private List<String> areaCodePath;
} }

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -21,10 +21,10 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean; import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums; import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService; import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govorg.GovOrgService;
@ -242,8 +242,8 @@ public class GovOrgController {
* @date 2021/11/5 2:54 下午 * @date 2021/11/5 2:54 下午
*/ */
@PostMapping("agency") @PostMapping("agency")
public Result<CustomerAgencyEntity> getAgencyInfo(@RequestParam("agencyId")String agencyId){ public Result<CustomerAgencyDTO> getAgencyInfo(@RequestParam("agencyId")String agencyId){
return new Result<CustomerAgencyEntity>().ok(govOrgService.getAgencyInfo(agencyId)); return new Result<CustomerAgencyDTO>().ok(govOrgService.getAgencyInfo(agencyId));
} }
/** /**
@ -305,7 +305,7 @@ public class GovOrgController {
CustomerGridDTO gridInfo = govOrgService.getGridInfo(orgId); CustomerGridDTO gridInfo = govOrgService.getGridInfo(orgId);
Optional.ofNullable(gridInfo).ifPresent((g) -> orgName.set(g.getGridName())); Optional.ofNullable(gridInfo).ifPresent((g) -> orgName.set(g.getGridName()));
} else if ("agency".equals(orgType)) { } else if ("agency".equals(orgType)) {
CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(orgId); CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(orgId);
Optional.ofNullable(agencyInfo).ifPresent((a) -> orgName.set(a.getOrganizationName())); Optional.ofNullable(agencyInfo).ifPresent((a) -> orgName.set(a.getOrganizationName()));
} }

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -106,5 +106,4 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/ */
LinkedList<GridLivelyResultDTO> subAgencyListAndGridSumNum(@Param("agencyId") String agencyId); LinkedList<GridLivelyResultDTO> subAgencyListAndGridSumNum(@Param("agencyId") String agencyId);
CustomerAgencyEntity selectByAgencyId(@Param("agencyId")String agencyId);
} }

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java

@ -22,8 +22,6 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* 机关单位信息表 * 机关单位信息表
* *
@ -76,11 +74,6 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
*/ */
private String areaCode; private String areaCode;
/**
* 地区编码全路径例如37,3702,370203,370203005,370203005015
*/
private List<String> areaCodePath;
/** /**
* 总人数 * 总人数
*/ */

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -8,7 +8,6 @@ import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
@ -162,7 +161,7 @@ public interface GovOrgService {
* @author zxc * @author zxc
* @date 2021/11/5 2:54 下午 * @date 2021/11/5 2:54 下午
*/ */
CustomerAgencyEntity getAgencyInfo(String agencyId); CustomerAgencyDTO getAgencyInfo(String agencyId);
/** /**
* @Description 查询网格信息 * @Description 查询网格信息

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.DataSourceConstant;
@ -608,17 +609,17 @@ public class GovOrgServiceImpl implements GovOrgService {
* @date 2021/11/5 2:54 下午 * @date 2021/11/5 2:54 下午
*/ */
@Override @Override
public CustomerAgencyEntity getAgencyInfo(String agencyId) { public CustomerAgencyDTO getAgencyInfo(String agencyId) {
CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectByAgencyId(agencyId); CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectById(agencyId);
CustomerAgencyDTO res= ConvertUtils.sourceToTarget(customerAgencyEntity,CustomerAgencyDTO.class);
//设置行政地区编码全路径 //设置行政地区编码全路径
if (StringUtils.isNotBlank(customerAgencyEntity.getAreaCode()) && StringUtils.isNotBlank(customerAgencyEntity.getParentAreaCode())) { if (StringUtils.isNotBlank(res.getAreaCode()) && StringUtils.isNotBlank(res.getParentAreaCode())) {
customerAgencyEntity.setAreaCodePath(queryAreaCodePath(customerAgencyEntity)); res.setAreaCodePath(queryAreaCodePath(res));
} }
return res;
return customerAgencyEntity;
} }
private List<String> queryAreaCodePath(CustomerAgencyEntity customerAgencyEntity) { private List<String> queryAreaCodePath(CustomerAgencyDTO customerAgencyEntity) {
List<String> areaCodePath = new ArrayList<>(); List<String> areaCodePath = new ArrayList<>();
switch (customerAgencyEntity.getLevel()) { switch (customerAgencyEntity.getLevel()) {
case Constant.COMMUNITY: case Constant.COMMUNITY:

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java

@ -8,10 +8,10 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.dto.epmetuser.result.StaffPatrolRecordDailyResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffPatrolRecordDailyResultDTO;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.service.AggreGridService; import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
@ -22,7 +22,6 @@ import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import sun.rmi.runtime.Log;
import java.util.*; import java.util.*;
@ -173,7 +172,7 @@ public class AggreGridServiceImpl implements AggreGridService {
* @return * @return
*/ */
private String getPidsByAgencyId(String agencyId) { private String getPidsByAgencyId(String agencyId) {
CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(agencyId); CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(agencyId);
if (agencyInfo == null) { if (agencyInfo == null) {
String errorMsg = "【网格员数据统计查询pcwork】查询组织信息返回为null"; String errorMsg = "【网格员数据统计查询pcwork】查询组织信息返回为null";

8
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -299,12 +299,4 @@
ORDER BY created_time ASC ORDER BY created_time ASC
</select> </select>
<select id="selectByAgencyId" parameterType="map" resultType="com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity">
select ca.*
FROM
customer_agency ca
WHERE
id = #{agencyId}
and del_flag = '0'
</select>
</mapper> </mapper>

Loading…
Cancel
Save