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.util.Date;
import java.util.List;
/**
@ -172,4 +173,9 @@ public class CustomerAgencyDTO implements Serializable {
* 联系电话
*/
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.validator.ValidatorUtils;
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.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
@ -242,8 +242,8 @@ public class GovOrgController {
* @date 2021/11/5 2:54 下午
*/
@PostMapping("agency")
public Result<CustomerAgencyEntity> getAgencyInfo(@RequestParam("agencyId")String agencyId){
return new Result<CustomerAgencyEntity>().ok(govOrgService.getAgencyInfo(agencyId));
public Result<CustomerAgencyDTO> getAgencyInfo(@RequestParam("agencyId")String agencyId){
return new Result<CustomerAgencyDTO>().ok(govOrgService.getAgencyInfo(agencyId));
}
/**
@ -305,7 +305,7 @@ public class GovOrgController {
CustomerGridDTO gridInfo = govOrgService.getGridInfo(orgId);
Optional.ofNullable(gridInfo).ifPresent((g) -> orgName.set(g.getGridName()));
} else if ("agency".equals(orgType)) {
CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(orgId);
CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(orgId);
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);
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.EqualsAndHashCode;
import java.util.List;
/**
* 机关单位信息表
*
@ -76,11 +74,6 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
*/
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.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -162,7 +161,7 @@ public interface GovOrgService {
* @author zxc
* @date 2021/11/5 2:54 下午
*/
CustomerAgencyEntity getAgencyInfo(String agencyId);
CustomerAgencyDTO getAgencyInfo(String agencyId);
/**
* @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.GridInfoCache;
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.Result;
import com.epmet.dataaggre.constant.DataSourceConstant;
@ -608,17 +609,17 @@ public class GovOrgServiceImpl implements GovOrgService {
* @date 2021/11/5 2:54 下午
*/
@Override
public CustomerAgencyEntity getAgencyInfo(String agencyId) {
CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectByAgencyId(agencyId);
public CustomerAgencyDTO getAgencyInfo(String agencyId) {
CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectById(agencyId);
CustomerAgencyDTO res= ConvertUtils.sourceToTarget(customerAgencyEntity,CustomerAgencyDTO.class);
//设置行政地区编码全路径
if (StringUtils.isNotBlank(customerAgencyEntity.getAreaCode()) && StringUtils.isNotBlank(customerAgencyEntity.getParentAreaCode())) {
customerAgencyEntity.setAreaCodePath(queryAreaCodePath(customerAgencyEntity));
if (StringUtils.isNotBlank(res.getAreaCode()) && StringUtils.isNotBlank(res.getParentAreaCode())) {
res.setAreaCodePath(queryAreaCodePath(res));
}
return customerAgencyEntity;
return res;
}
private List<String> queryAreaCodePath(CustomerAgencyEntity customerAgencyEntity) {
private List<String> queryAreaCodePath(CustomerAgencyDTO customerAgencyEntity) {
List<String> areaCodePath = new ArrayList<>();
switch (customerAgencyEntity.getLevel()) {
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.utils.DateUtils;
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.result.GridMemberDataAnalysisResultDTO;
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.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
@ -22,7 +22,6 @@ import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.rmi.runtime.Log;
import java.util.*;
@ -173,7 +172,7 @@ public class AggreGridServiceImpl implements AggreGridService {
* @return
*/
private String getPidsByAgencyId(String agencyId) {
CustomerAgencyEntity agencyInfo = govOrgService.getAgencyInfo(agencyId);
CustomerAgencyDTO agencyInfo = govOrgService.getAgencyInfo(agencyId);
if (agencyInfo == 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
</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>

Loading…
Cancel
Save