Browse Source

新增:先进排行->居民积分排行列表(不含党员)

新增:先进排行->党员积分排行
master
wxz 4 years ago
parent
commit
77e2146f22
  1. 35
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java
  2. 35
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java
  3. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java
  4. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java
  5. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java
  6. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java
  7. 56
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

35
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java

@ -0,0 +1,35 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 党员积分排行--接口入参
* @Author sun
*/
@Data
public class PartyPointRankFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织或网格Id
*/
@NotBlank(message = "组织或网格ID不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 类型组织agency 网格grid
*/
@NotBlank(message = "数据类型不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class})
private String orgType;
/**
* 默认显示前5名
*/
@Min(value = 1, message = "查询条数必须大于0", groups = {PartyPointRankFormDTO.AddUserInternalGroup.class })
private Integer topNum;
public interface AddUserInternalGroup {}
}

35
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java

@ -0,0 +1,35 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
@Data
public class PartyPointRankResultDTO {
/**
* 组织ID
*/
private String agencyId;
/**
* 组织名称
*/
private String agencyName;
/**
* 用户Id
*/
private String userId;
/**
* 用户名称
*/
private String userName;
/**
* 网格Id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 党员积分
*/
private Double pointTotal;
}

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java

@ -1,13 +1,13 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService;
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -40,6 +40,18 @@ public class ScreenUserController {
return new Result<List<UserPointRankListResultDTO>>().ok(screenUserService.userPointRank(formDTO));
}
/**
* 热心市民积分排行列表(不包含党员)
* @param formDTO
* @return
* @author wxz
*/
@PostMapping("userpointrank/withoutpartymember")
public Result<List<UserPointRankListResultDTO>> userPointRankWithoutPartyMem(@RequestBody UserPointRankFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class);
return new Result<List<UserPointRankListResultDTO>>().ok(screenUserService.userPointRankWithoutPartyMem(formDTO));
}
/**
* @param formDTO
* @Description 党员指标得分排行
@ -52,5 +64,17 @@ public class ScreenUserController {
}
/**
* @param formDTO
* @Description 党员积分排行
* @author wxz
*/
@PostMapping("partypointrank")
public Result<List<PartyPointRankResultDTO>> partyPointRank(@RequestBody PartyPointRankFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class);
return new Result<List<PartyPointRankResultDTO>>().ok(screenUserService.partyPointRank(formDTO));
}
}

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java

@ -19,11 +19,9 @@ package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.user.KcUserPointRankResultDTO;
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO;
import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -65,6 +63,13 @@ public interface ScreenPartyUserRankDataDao{
*/
List<UserPointRankListResultDTO> selectAgencyUserPointList(UserPointRankFormDTO formDTO);
/**
* 查询组织下居民(不包含党员)积分排行按积分值降序
* @param formDTO
* @return
*/
List<UserPointRankListResultDTO> selectAgencyResiPointListWithoutPartyMem(UserPointRankFormDTO formDTO);
/**
* @param formDTO
* @Description 查询组织下党员的积分排行按积分值降序
@ -75,4 +80,11 @@ public interface ScreenPartyUserRankDataDao{
List<PartyUserPointResultDTO> selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode);
List<UserPointResultDTO> selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode);
/**
* 党员积分排行
* @param formDTO
* @return
*/
List<PartyPointRankResultDTO> listPartymemberPointRank(PartyPointRankFormDTO formDTO);
}

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java

@ -1,8 +1,10 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO;
import java.util.List;
@ -21,10 +23,19 @@ public interface ScreenUserService {
*/
List<UserPointRankListResultDTO> userPointRank(UserPointRankFormDTO formDTO);
List<UserPointRankListResultDTO> userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO);
/**
* @param formDTO
* @Description 党员指标得分排行
* @author sun
*/
List<PartIndexScroeRankResultDTO> partIndexScroeRank(PartIndexScroeRankFormDTO formDTO);
/**
* 党员积分排行
* @param formDTO
* @return
*/
List<PartyPointRankResultDTO> partyPointRank(PartyPointRankFormDTO formDTO);
}

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java

@ -7,8 +7,10 @@ import com.epmet.datareport.constant.FactConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService;
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -43,6 +45,22 @@ public class ScreenUserServiceImpl implements ScreenUserService {
return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO);
}
/**
* @param formDTO
* @Description 热心市民积分排行列表不包含党员
* @author sun
*/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<UserPointRankListResultDTO> userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO) {
//1.参数校验
if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) {
throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType()));
}
//2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data
return screenPartyUserRankDataDao.selectAgencyResiPointListWithoutPartyMem(formDTO);
}
/**
* @param formDTO
* @Description 党员指标得分排行
@ -59,4 +77,14 @@ public class ScreenUserServiceImpl implements ScreenUserService {
return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO);
}
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<PartyPointRankResultDTO> partyPointRank(PartyPointRankFormDTO formDTO) {
//1.参数校验
if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) {
throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType()));
}
return screenPartyUserRankDataDao.listPartymemberPointRank(formDTO);
}
}

56
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -131,4 +131,60 @@
m.POINT_TOTAL DESC,
m.user_name
</select>
<select id="selectAgencyResiPointListWithoutPartyMem"
resultType="com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO">
SELECT
org_id AS "agencyId",
org_name AS "agencyName",
grid_id AS "gridId",
grid_name AS "gridName",
user_id AS "userId",
user_name AS "userName",
point_total AS "pointTotal"
FROM
screen_party_user_rank_data
WHERE
del_flag = '0'
AND PARTY_FLAG = 0
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND all_parent_ids LIKE CONCAT('%',#{orgId},'%')
</if>
<if test="orgType == 'grid'">
AND grid_id = #{orgId}
</if>
</if>
ORDER BY
point_total DESC
LIMIT #{topNum}
</select>
<!--党员积分排行-->
<select id="listPartymemberPointRank" resultType="com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO">
SELECT
org_id AS "agencyId",
org_name AS "agencyName",
grid_id AS "gridId",
grid_name AS "gridName",
user_id AS "userId",
user_name AS "userName",
point_total AS "pointTotal"
FROM
screen_party_user_rank_data
WHERE
del_flag = '0'
AND party_flag = '1'<!-- 是否是党员标志:1是。0不是党员 -->
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND all_parent_ids LIKE CONCAT('%',#{orgId},'%')
</if>
<if test="orgType == 'grid'">
AND grid_id = #{orgId}
</if>
</if>
ORDER BY
point_total DESC
LIMIT #{topNum}
</select>
</mapper>
Loading…
Cancel
Save