Browse Source

身边党员-积分排行 接口(未测)

dev_shibei_match
zhangyongzhangyong 5 years ago
parent
commit
cd3acc1ca4
  1. 53
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiAroundPartyPointRankFormDTO.java
  2. 39
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiAroundPartyPointRankResultDTO.java
  3. 26
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  4. 41
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java
  5. 11
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java
  6. 79
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
  7. 153
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml
  8. 32
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInCommunityDTO.java
  9. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  10. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  11. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  12. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  13. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  14. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  15. 16
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

53
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiAroundPartyPointRankFormDTO.java

@ -0,0 +1,53 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 身边党员 积分排行接口 入参
* @Auth zy
*/
@Data
public class ResiAroundPartyPointRankFormDTO implements Serializable {
private static final long serialVersionUID = 1534061512200591149L;
public interface ResiAroundPartyPointRankGroup extends CustomerClientShowGroup{}
/**
* 页码
* */
@Min(value = 1,groups = ResiAroundPartyPointRankGroup.class)
private Integer pageNo = 1;
/**
* 每页数据条数
* */
private Integer pageSize = 10;
/**
* 身边党员 grid 社区党员community
* */
@NotBlank(message = "查询的部门维度scope不能为空",groups = ResiAroundPartyPointRankFormDTO.ResiAroundPartyPointRankGroup.class)
private String scope;
/**
* 本月 monthly 总排行 all;
* */
@NotBlank(message = "查询的时间维度type不能为空",groups = ResiAroundPartyPointRankFormDTO.ResiAroundPartyPointRankGroup.class)
private String type;
/**
* 当前网格id
* */
@NotBlank(message = "网格id不能为空",groups = ResiAroundPartyPointRankFormDTO.ResiAroundPartyPointRankGroup.class)
private String gridId;
/**
* 客户Id不做校验如果前端不传则使用userId查询相应的客户Id
* */
private String customerId;
}

39
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiAroundPartyPointRankResultDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 身边党员 积分排行接口返参DTO
* @Auth zy
*/
@Data
public class ResiAroundPartyPointRankResultDTO implements Serializable {
private static final long serialVersionUID = 685408245193506541L;
/**
* 排序
* */
private Integer ranking;
/**
* 积分
* */
private Integer point;
/**
* 头像
* */
private String userHeadPhoto;
/**
* 名称
* */
private String realName;
/**
* 用户id
* */
private String userId;
}

26
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java

@ -6,11 +6,9 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.PointExchangeResponseResultDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.dto.result.*;
import com.epmet.service.PointVerificationLogService;
import com.epmet.service.UserPointActionLogService;
import com.epmet.service.UserPointStatisticalDailyService;
@ -141,4 +139,24 @@ public class ResiPointController {
public Result<PointExchangeResponseResultDTO> exchangeCallback(@LoginUser TokenDto tokenDto){
return new Result<PointExchangeResponseResultDTO>().ok(pointVerificationLogService.resiExchangeCallback(tokenDto.getUserId()));
}
/**
* 身边党员-积分排行
* 查询规则 scope grid && type monthly 表示按网格统计对本月党员增加的积分 进行排序
* scope grid && type all 表示按网格统计对党员累计可用积分 排序
* scope community && type monthly 表示按社区统计对本月党员增加的积分 进行排序
* scope community && type all 表示按社区统计对党员累计可用积分 排序
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.ResiAroundPartyPointRankResultDTO>>
* @Author zhangyong
* @Date 16:17 2020-12-28
**/
@PostMapping("aroundparty")
public Result<List<ResiAroundPartyPointRankResultDTO>> aroundPartyPointRank(@LoginUser TokenDto tokenDto, @RequestBody ResiAroundPartyPointRankFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,ResiAroundPartyPointRankFormDTO.ResiAroundPartyPointRankGroup.class);
List<ResiAroundPartyPointRankResultDTO> resultDTOS = userPointStatisticalDailyService.listAroundPartyPointRank(formDTO);
return new Result<List<ResiAroundPartyPointRankResultDTO>>().ok(resultDTOS);
}
}

41
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java

@ -18,6 +18,8 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO;
import com.epmet.dto.result.ResiPointRankResultDTO;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -62,4 +64,43 @@ public interface UserPointStatisticalDailyDao extends BaseDao<UserPointStatistic
* @date 2020.08.11 17:40
**/
void insertOrUpdate(UserPointStatisticalDailyEntity entity);
/**
* 身边党员-积分排行 按网格统计对党员累计可用积分 排序
* @param formDTO
* @return java.util.List<com.epmet.dto.result.ResiAroundPartyPointRankResultDTO>
* @Author zhangyong
* @Date 09:24 2020-12-29
**/
List<ResiAroundPartyPointRankResultDTO> selectListGridPartyRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO);
/**
* 身边党员-积分排行 按网格统计对本月党员增加的积分 进行排序
* @param formDTO
* @return java.util.List<com.epmet.dto.result.ResiAroundPartyPointRankResultDTO>
* @Author zhangyong
* @Date 09:24 2020-12-29
**/
List<ResiAroundPartyPointRankResultDTO> selectListGridPartyRankPointByMonth(ResiAroundPartyPointRankFormDTO formDTO);
/**
* 身边党员-积分排行 按社区(社区下的所有网格)统计对党员累计可用积分 排序
* @param formDTO
* @param grids 社区下的所有网格id
* @return java.util.List<com.epmet.dto.result.ResiAroundPartyPointRankResultDTO>
* @Author zhangyong
* @Date 09:24 2020-12-29
**/
List<ResiAroundPartyPointRankResultDTO> selectListCommunityPartyRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO,
@Param("grids")List<String> grids);
/**
* 身边党员-积分排行 按社区(社区下的所有网格)统计对本月党员增加的积分 进行排序
* @param formDTO
* @return java.util.List<com.epmet.dto.result.ResiAroundPartyPointRankResultDTO>
* @Author zhangyong
* @Date 09:24 2020-12-29
**/
List<ResiAroundPartyPointRankResultDTO> selectListCommunityPartyRankPointByMonth(ResiAroundPartyPointRankFormDTO formDTO,
@Param("grids")List<String> grids);
}

11
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java

@ -20,7 +20,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserPointStatisticalDailyDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.entity.UserPointStatisticalDailyEntity;
@ -114,4 +116,13 @@ public interface UserPointStatisticalDailyService extends BaseService<UserPointS
void insertOrUpdate(UserPointStatisticalDailyEntity entity);
void test(UserPointStatisticalDailyEntity entity);
/**
* 身边党员-积分排行
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.ResiAroundPartyPointRankResultDTO>>
* @Author zhangyong
* @Date 16:17 2020-12-28
**/
List<ResiAroundPartyPointRankResultDTO> listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO);
}

79
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java

@ -27,13 +27,12 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserPointStatisticalDailyDao;
import com.epmet.dto.UserPointStatisticalDailyDTO;
import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.dto.result.ResiPointRankResultDTO;
import com.epmet.dto.result.ResiPointRankingResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
@ -59,6 +58,8 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public PageData<UserPointStatisticalDailyDTO> page(Map<String, Object> params) {
@ -230,5 +231,75 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
baseDao.insertOrUpdate(entity);
}
@Override
public List<ResiAroundPartyPointRankResultDTO> listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO) {
//查询条件
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<ResiAroundPartyPointRankResultDTO> resultDTOS = new ArrayList<>();
// 获取党员信息
// 按网格统计
if ("grid".equals(formDTO.getScope())){
if ("monthly".equals(formDTO.getType())){
// scope : grid && type :monthly 表示:按网格统计,对本月党员增加的积分 进行排序
resultDTOS = baseDao.selectListGridPartyRankPointByMonth(formDTO);
} else if ("all".equals(formDTO.getType())){
// scope : grid && type :all 表示:按网格统计,对党员累计可用积分 排序
resultDTOS = baseDao.selectListGridPartyRankByUsablePoint(formDTO);
}
}
// 按社区统计
if ("community".equals(formDTO.getScope())){
// 根据网格id,获取社区下的所有网格id
Result<List<String>> gridInCommunity = govOrgOpenFeignClient.getGridInCommunity(formDTO.getGridId());
if (gridInCommunity.getData().size() <= NumConstant.ZERO){
log.error("根据" + formDTO.getGridId() + "网格id, 查询不到同属于一个社区下的所有网格id");
return resultDTOS;
}
if ("monthly".equals(formDTO.getType())){
// scope : community && type :monthly 表示:按社区统计,对本月党员增加的积分 进行排序
resultDTOS = baseDao.selectListCommunityPartyRankPointByMonth(formDTO, gridInCommunity.getData());
} else if ("all".equals(formDTO.getType())){
// scope : community && type :all 表示:按社区统计,对党员累计可用积分 排序
resultDTOS = baseDao.selectListCommunityPartyRankByUsablePoint(formDTO, gridInCommunity.getData());
}
}
// 给排好序的 身边党员-积分排行, 赋值 【头像】
resultDTOS = getPartyBaseInfo(resultDTOS);
return resultDTOS;
}
/*
* 给排好序的 身边党员-积分排行 赋值 头像
* @param rankResultDTOS
* @return java.util.List<com.epmet.dto.result.ResiAroundPartyPointRankResultDTO>
* @Author zhangyong
* @Date 10:14 2020-12-29
**/
private List<ResiAroundPartyPointRankResultDTO> getPartyBaseInfo(List<ResiAroundPartyPointRankResultDTO> rankResultDTOS){
// 1.获取当前党员Id
List<String> userIdParam = new LinkedList<>();
for (ResiAroundPartyPointRankResultDTO formDTO : rankResultDTOS){
userIdParam.add(formDTO.getUserId());
}
if (userIdParam.size() == NumConstant.ZERO){
return rankResultDTOS;
}
// 2.获取用户基本信息
Result<List<UserBaseInfoResultDTO>> myResiInfoResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam);
if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){
for (UserBaseInfoResultDTO resiInfo : myResiInfoResult.getData()){
for (ResiAroundPartyPointRankResultDTO formDTO : rankResultDTOS){
if (formDTO.getUserId().equals(resiInfo.getUserId())){
formDTO.setUserHeadPhoto(resiInfo.getHeadImgUrl());
}
}
}
}
return rankResultDTOS;
}
}

153
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml

@ -130,4 +130,157 @@
</insert>
<!-- 身边党员-积分排行 :按网格统计,对党员累计可用积分 排序 -->
<select id="selectListGridPartyRankByUsablePoint" resultType="com.epmet.dto.result.ResiAroundPartyPointRankResultDTO" >
SELECT
@curRank := @curRank + 1 AS rank,
partyInfo.realName,
partyInfo.USER_ID userId,
partyInfo.point
FROM(
SELECT
partys.realName,
partys.USER_ID,
partys.GRID_ID,
IFNULL(p.USABLE_POINT, 0) point
FROM(
SELECT
CONCAT(SURNAME, `NAME`) realName,
USER_ID,
GRID_ID
FROM
epmet_resi_partymember.partymember_info
WHERE DEL_FLAG = 0 AND CONFIRM_RESULT IN ('auto_confirm_success', 'approved')
AND CUSTOMER_ID = #{customerId} AND GRID_ID = #{gridId}
) partys LEFT JOIN epmet_point.user_point_total p ON partys.USER_ID = p.USER_ID
) partyInfo,
( SELECT @curRank := 0 ) r
ORDER BY partyInfo.point DESC, convert(partyInfo.realName using gbk) ASC
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 身边党员-积分排行 :按网格统计,对本月党员增加的积分 进行排序 -->
<select id="selectListGridPartyRankPointByMonth" resultType="com.epmet.dto.result.ResiAroundPartyPointRankResultDTO" >
SELECT
@curRank := @curRank + 1 AS rank,
partyInfo.realName,
partyInfo.USER_ID userId,
partyInfo.point
FROM(
SELECT
partys.realName,
partys.USER_ID,
partys.GRID_ID,
IFNULL(p.point, 0) point
FROM (
SELECT
CONCAT(SURNAME, `NAME`) realName,
USER_ID,
GRID_ID
FROM
epmet_resi_partymember.partymember_info
WHERE DEL_FLAG = 0 AND CONFIRM_RESULT IN ('auto_confirm_success', 'approved')
AND CUSTOMER_ID = #{customerId} AND GRID_ID = #{gridId}
) partys
LEFT JOIN (
SELECT pl.USER_ID, SUM(PL.POINT) point
FROM epmet_point.user_point_action_log pl
WHERE pl.DEL_FLAG = '0' AND DATE_FORMAT(pl.CREATED_TIME, '%Y%m')= DATE_FORMAT( CURDATE( ) , '%Y%m' ) AND pl.action_flag = 'plus'
GROUP BY pl.USER_ID
) p ON partys.USER_ID = p.USER_ID
) partyInfo,
( SELECT @curRank := 0 ) r
ORDER BY partyInfo.point DESC, convert(partyInfo.realName using gbk) ASC
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 身边党员-积分排行 :按社区(社区下的所有网格)统计,对党员累计可用积分 排序 -->
<select id="selectListCommunityPartyRankByUsablePoint" resultType="com.epmet.dto.result.ResiAroundPartyPointRankResultDTO" >
SELECT
@curRank := @curRank + 1 AS rank,
partyInfo.realName,
partyInfo.USER_ID userId,
partyInfo.point
FROM(
SELECT
partys.realName,
partys.USER_ID,
partys.GRID_ID,
IFNULL(p.USABLE_POINT, 0) point
FROM(
SELECT
pg.realName,
pg.USER_ID,
pg.GRID_ID
FROM (
SELECT
CONCAT(SURNAME, `NAME`) realName,
USER_ID,
GRID_ID
FROM
epmet_resi_partymember.partymember_info
WHERE DEL_FLAG = 0 AND CONFIRM_RESULT IN ('auto_confirm_success', 'approved')
AND CUSTOMER_ID = #{customerId}
) pg WHERE 1=1
<if test="null != grids and grids.size() > 0">
WHERE pg.GRID_ID IN
<foreach collection="grids" item="grid" open="AND (" separator=" OR " close=" )">
#{grid}
</foreach>
</if>
) partys LEFT JOIN epmet_point.user_point_total p ON partys.USER_ID = p.USER_ID
) partyInfo,
( SELECT @curRank := 0 ) r
ORDER BY partyInfo.point DESC, convert(partyInfo.realName using gbk) ASC
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 身边党员-积分排行 :按网格统计,对本月党员增加的积分 进行排序 -->
<select id="selectListCommunityPartyRankPointByMonth" resultType="com.epmet.dto.result.ResiAroundPartyPointRankResultDTO" >
SELECT
@curRank := @curRank + 1 AS rank,
partyInfo.realName,
partyInfo.USER_ID userId,
partyInfo.point
FROM(
SELECT
partys.realName,
partys.USER_ID,
partys.GRID_ID,
IFNULL(p.point, 0) point
FROM(
SELECT
pg.realName,
pg.USER_ID,
pg.GRID_ID
FROM (
SELECT
CONCAT(SURNAME, `NAME`) realName,
USER_ID,
GRID_ID
FROM
epmet_resi_partymember.partymember_info
WHERE DEL_FLAG = 0 AND CONFIRM_RESULT IN ('auto_confirm_success', 'approved')
AND CUSTOMER_ID = '45687aa479955f9d06204d415238f7cc'
) pg
<if test="null != grids and grids.size() > 0">
WHERE pg.GRID_ID IN
<foreach collection="grids" item="grid" open="AND (" separator=" OR " close=" )">
#{grid}
</foreach>
</if>
) partys
LEFT JOIN (
SELECT pl.USER_ID, SUM(PL.POINT) point
FROM epmet_point.user_point_action_log pl
WHERE pl.DEL_FLAG = '0' AND DATE_FORMAT(pl.CREATED_TIME, '%Y%m')= DATE_FORMAT( CURDATE( ) , '%Y%m' ) AND pl.action_flag = 'plus'
GROUP BY pl.USER_ID
) p ON partys.USER_ID = p.USER_ID
) partyInfo, ( SELECT @curRank := 0 ) r
ORDER BY partyInfo.point DESC, convert(partyInfo.realName using gbk) ASC
LIMIT #{pageNo}, #{pageSize}
</select>
</mapper>

32
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInCommunityDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 根据网格id查询它的父级 社区id
最后返回 社区id 下的所有网格信息
* @Author zy
* @Date 2020/12/28 23:16
*/
@Data
public class GridInCommunityDTO implements Serializable {
private static final long serialVersionUID = 4360690752084258055L;
/**
* 网格ID
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 客户ID
*/
private String customerId;
}

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -314,4 +314,14 @@ public interface GovOrgOpenFeignClient {
**/
@PostMapping("/gov/org/customergrid/griddatafilter")
Result<CommonDataFilterResultDTO> gridDataFilter(CommonGridIdFormDTO gridForm);
/**
* 根据 网格id查询同属于一个社区下的所有网格id
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List<java.lang.String>>
* @Author zhangyong
* @Date 17:44 2020-12-28
**/
@GetMapping("/gov/org/customergrid/getGridInCommunity/{gridId}")
Result<List<String>> getGridInCommunity(@PathVariable("gridId") String gridId);
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -181,6 +181,10 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
@Override
public Result<CommonDataFilterResultDTO> gridDataFilter(CommonGridIdFormDTO gridForm) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridDataFilter", gridForm);
}
@Override
public Result<List<String>> getGridInCommunity(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInCommunity", gridId);
}
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -228,4 +228,16 @@ public class CustomerGridController {
return new Result<CustomerGridCountResultDTO>().ok(customerGridService.selectGridCount(customerIdFormDTO));
}
/**
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List<java.lang.String>>
* @Author zy
* @Description 根据 网格id查询同属于一个社区下的所有网格id网格name
* @Date 2020/12/28 23:16
**/
@GetMapping("getGridInCommunity/{gridId}")
public Result<List<String>> getGridInCommunity(@PathVariable("gridId") String gridId) {
List<String> resultDTOS = customerGridService.listGridInCommunity(gridId);
return new Result<List<String>>().ok(resultDTOS);
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -246,4 +246,13 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
List<OrgInfoResultDTO> selectOrgInfoByAgency(@Param("orgIds")List<String> orgIds);
List<OrgInfoResultDTO> selectOrgInfoByGrid(@Param("orgIds")List<String> orgIds);
List<OrgInfoResultDTO> selectOrgInfoByDept(@Param("orgIds")List<String> orgIds);
/**
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List<java.lang.String>>
* @Author zy
* @Description 根据 网格id查询同属于一个社区下的所有网格id网格name
* @Date 2020/12/28 23:16
**/
List<String> selectListGridInCommunity(@Param("gridId") String gridId);
}

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

@ -277,4 +277,13 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @date 2020/11/10 2:55 下午
*/
List<OrgInfoResultDTO> selectOrgInfo(OrgInfoFormDTO orgInfoFormDTO);
/**
* @param gridId
* @return com.epmet.commons.tools.utils.Result<java.util.List<java.lang.String>>
* @Author zy
* @Description 根据 网格id查询同属于一个社区下的所有网格id网格name
* @Date 2020/12/28 23:16
**/
List<String> listGridInCommunity(String gridId);
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -692,4 +692,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return result;
}
@Override
public List<String> listGridInCommunity(String gridId) {
return baseDao.selectListGridInCommunity(gridId);
}
}

16
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -545,4 +545,20 @@
ID = #{orgId}
</foreach>
</select>
<!--根据 网格id,查询同属于一个社区下的所有网格id-->
<select id="selectListGridInCommunity" resultType="java.lang.String">
SELECT
ID
FROM customer_grid
WHERE PID = (
SELECT
PID
FROM customer_grid
WHERE DEL_FLAG = 0
<if test="gridId != null and gridId != '' ">
AND ID = #{gridId}
</if>
)
</select>
</mapper>

Loading…
Cancel
Save