Browse Source

查询可用数据

master
zhangyuan 3 years ago
parent
commit
9211f2b39c
  1. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  2. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  3. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  4. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  5. 20
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -505,4 +505,19 @@ public class AgencyController {
List<AgencyAddressBookTreeResultDTO> dto = agencyService.getAddressTree(name, customerId);
return new Result<List<AgencyAddressBookTreeResultDTO>>().ok(dto);
}
/**
* 获取区域编码下级的所有客户信息
*
* @param areaCode
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.AgencyResultDTO>>
* @author zhy
* @date 2022/7/7 10:12
*/
@GetMapping("/areasubagency/{areaCode}")
public Result<List<AgencyResultDTO>> getAreaSubAgency(@PathVariable String areaCode) {
List<AgencyResultDTO> dto = agencyService.getAreaSubAgency(areaCode);
return new Result<List<AgencyResultDTO>>().ok(dto);
}
}

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

@ -353,5 +353,16 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
CommunityInfoResultDTO getCommunityInfo(OrgInfoPointFormDTO formDTO);
CommunityInfoResultDTO getCommunityInfoByUserId(@Param("userId") String userId);
/**
* 获取区域编码下级的所有客户信息
*
* @param areaCode
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.AgencyResultDTO>>
* @author zhy
* @date 2022/7/7 10:12
*/
List<AgencyResultDTO> getAreaSubAgency(@Param("areaCode") String areaCode);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -178,4 +178,15 @@ public interface AgencyService {
* @date 2022/5/16 10:43
*/
List<AgencyAddressBookTreeResultDTO> getAddressTree(String name, String customerId);
/**
* 获取区域编码下级的所有客户信息
*
* @param areaCode
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.AgencyResultDTO>>
* @author zhy
* @date 2022/7/7 10:12
*/
List<AgencyResultDTO> getAreaSubAgency(String areaCode);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -902,6 +902,11 @@ public class AgencyServiceImpl implements AgencyService {
return NodeTreeUtils.build(list);
}
@Override
public List<AgencyResultDTO> getAreaSubAgency(String areaCode) {
return customerAgencyDao.getAreaSubAgency(areaCode);
}
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) {
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
insertEntity.setOrganizationName(formDTO.getAgencyName());

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

@ -930,4 +930,24 @@
limit 1
</select>
<select id="getAreaSubAgency" resultType="com.epmet.dto.result.AgencyResultDTO">
SELECT
ac.ID AS agencyId,
ac.ORGANIZATION_NAME AS agencyName,
ac.*
FROM
customer_agency ac
INNER JOIN customer_org_parameter cop ON cop.CUSTOMER_ID = ac.CUSTOMER_ID
WHERE
ac.DEL_FLAG = '0'
AND cop.DEL_FLAG = '0'
AND cop.PARAMETER_KEY = 'area_code_switch'
AND ac.PID = '0'
AND cop.PARAMETER_VALUE = 'open'
<if test="areaCode != null and areaCode != ''">
AND AREA_CODE != #{areaCode}
AND AREA_CODE LIKE CONCAT(#{areaCode}, '%')
</if>
</select>
</mapper>

Loading…
Cancel
Save