New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.service.partybuilding.NewStriveForFeign; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"双挣双评新模块-小程序"}) |
| | | @RestController |
| | | @RequestMapping("/StriveFor/") |
| | | public class NewStriveAppApi extends BaseController |
| | | { |
| | | |
| | | @Resource |
| | | private NewStriveForFeign newStriveForFeign; |
| | | |
| | | @GetMapping("/NewStriveFor/getUserRank") |
| | | public R getUserRank() |
| | | { |
| | | return newStriveForFeign.getUserRank(getUserId()+""); |
| | | } |
| | | |
| | | @GetMapping("/NewStriveFor/getUserRankList") |
| | | public R getUserRankList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) |
| | | { |
| | | return newStriveForFeign.getUserRankList(pageNum,pageSize,getUserId()+""); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.partybuilding; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("用户排序内容") |
| | | public class UserRankDTO |
| | | { |
| | | @ApiModelProperty("社区id") |
| | | private String communityId; |
| | | |
| | | @ApiModelProperty("单位id") |
| | | private String checkUnitId; |
| | | |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty("用户名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("单位名") |
| | | private String unitName; |
| | | |
| | | @ApiModelProperty("社区名") |
| | | private String communityName; |
| | | |
| | | @ApiModelProperty("积分") |
| | | private String amount; |
| | | |
| | | @ApiModelProperty("排名") |
| | | private String rank; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.partybuilding; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @FeignClient(name = "huacheng-partybuilding") |
| | | public interface NewStriveForFeign |
| | | { |
| | | |
| | | @GetMapping("/NewStriveFor/getUserRank") |
| | | public R getUserRank(@RequestParam("userId") String userId); |
| | | |
| | | @GetMapping("/NewStriveFor/getUserRankList") |
| | | public R getUserRankList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam("userId") String userId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"双挣双评新模块-后台"}) |
| | | @RestController |
| | | @RequestMapping("/StriveFor/") |
| | | public class NewStriveApi |
| | | { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.partybuilding.UserRankDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_dangjian.service.NewStriveForService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/NewStriveFor") |
| | | public class NewStriveForApi |
| | | { |
| | | @Resource |
| | | private NewStriveForService forService; |
| | | |
| | | @GetMapping("/getUserRank") |
| | | public R getUserRank(@RequestParam("userId") String userId) |
| | | { |
| | | return R.ok(forService.getUserRank(userId)); |
| | | } |
| | | |
| | | @GetMapping("/getUserRankList") |
| | | public R getUserRankList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam("userId") String userId) |
| | | { |
| | | return R.ok(forService.getUserRankList(pageNum,pageSize,userId)); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComPbServiceTeamDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.UserRankDTO; |
| | | import com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamVO; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbServiceTeamDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员双争双评排序 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2021-01-21 17:37 |
| | | **/ |
| | | @Mapper |
| | | public interface NewStriveForDAO extends BaseMapper<UserRankDTO> |
| | | { |
| | | |
| | | UserRankDTO getUserRank(@Param("userId")String userId); |
| | | |
| | | IPage<UserRankDTO> getUserRankList(Page page,@Param("userId")String userId); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComListPartyDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.UserRankDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.west.PartyOrganizationVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党组织 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 11:39 |
| | | **/ |
| | | public interface NewStriveForService |
| | | { |
| | | UserRankDTO getUserRank(String userId); |
| | | |
| | | IPage<UserRankDTO> getUserRankList(int pageNum,int pageSize,String userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.partybuilding.UserRankDTO; |
| | | import com.panzhihua.service_dangjian.dao.NewStriveForDAO; |
| | | import com.panzhihua.service_dangjian.service.NewStriveForService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党组织 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 11:40 |
| | | **/ |
| | | @Service |
| | | public class NewStriveForServiceImpl extends ServiceImpl<NewStriveForDAO,UserRankDTO > |
| | | implements NewStriveForService |
| | | { |
| | | |
| | | @Override |
| | | public UserRankDTO getUserRank(String userId) { |
| | | return baseMapper.getUserRank(userId); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<UserRankDTO> getUserRankList(int pageNum,int pageSize, String userId) |
| | | { |
| | | Page page = new Page<>(pageNum,pageSize); |
| | | return baseMapper.getUserRankList(page,userId); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_dangjian.dao.NewStriveForDAO"> |
| | | |
| | | |
| | | <!-- 通过用户id 查询人员的排名 --> |
| | | <select id="getUserRank" resultType="com.panzhihua.common.model.dtos.partybuilding.UserRankDTO"> |
| | | SELECT |
| | | tab2.community_id, |
| | | tab2.check_unit_id, |
| | | tab2.image_url, |
| | | tab2.user_id, |
| | | tab2.user_name, |
| | | tab2.unit_name, |
| | | tab2.community_name, |
| | | tab2.amount, |
| | | tab2.rank |
| | | FROM(SELECT |
| | | tab.community_id, |
| | | tab.check_unit_id, |
| | | tab.image_url, |
| | | tab.user_id, |
| | | tab.user_name, |
| | | tab.unit_name, |
| | | tab.community_name, |
| | | tab.amount, |
| | | (@row_number:=@row_number+1) AS rank |
| | | FROM (SELECT |
| | | cpm.community_id as community_id, |
| | | cpm.check_unit_id as check_unit_id, |
| | | su.image_url as image_url, |
| | | cpm.user_id as user_id, |
| | | cpm.`name` as user_name, |
| | | cpcu.`name` as unit_name, |
| | | ca.`name` as community_name, |
| | | IFNULL(SUM(caiu.integral_sum),0) as amount |
| | | FROM com_pb_member as cpm |
| | | LEFT JOIN com_pb_check_unit as cpcu on cpcu.id=cpm.check_unit_id |
| | | LEFT JOIN sys_user as su on su.user_id=cpm.user_id |
| | | LEFT JOIN com_act as ca on ca.community_id = cpm.community_id |
| | | LEFT JOIN com_act_integral_user as caiu on cpm.user_id=caiu.user_id and cpm.community_id=caiu.community_id |
| | | WHERE cpm.check_unit_id=(SELECT check_unit_id FROM com_pb_member WHERE user_id=#{userId}) |
| | | GROUP BY cpm.user_id |
| | | order by amount desc,user_id desc) as tab |
| | | ,(SELECT @row_number:=0) AS t) tab2 |
| | | WHERE tab2.user_id =#{userId} |
| | | </select> |
| | | |
| | | <!-- 查询人员的排名 --> |
| | | <select id="getUserRankList" resultType="com.panzhihua.common.model.dtos.partybuilding.UserRankDTO"> |
| | | SELECT |
| | | tab.community_id, |
| | | tab.check_unit_id, |
| | | tab.image_url, |
| | | tab.user_id, |
| | | tab.user_name, |
| | | tab.unit_name, |
| | | tab.community_name, |
| | | tab.amount, |
| | | (@row_number:=@row_number+1) AS rank |
| | | FROM (SELECT |
| | | cpm.community_id as community_id, |
| | | cpm.check_unit_id as check_unit_id, |
| | | su.image_url as image_url, |
| | | cpm.user_id as user_id, |
| | | cpm.`name` as user_name, |
| | | cpcu.`name` as unit_name, |
| | | ca.`name` as community_name, |
| | | IFNULL(SUM(caiu.integral_sum),0) as amount |
| | | FROM com_pb_member as cpm |
| | | LEFT JOIN com_pb_check_unit as cpcu on cpcu.id=cpm.check_unit_id |
| | | LEFT JOIN sys_user as su on su.user_id=cpm.user_id |
| | | LEFT JOIN com_act as ca on ca.community_id = cpm.community_id |
| | | LEFT JOIN com_act_integral_user as caiu on cpm.user_id=caiu.user_id and cpm.community_id=caiu.community_id |
| | | WHERE cpm.check_unit_id=(SELECT check_unit_id FROM com_pb_member WHERE user_id=#{userId}) |
| | | GROUP BY cpm.user_id |
| | | order by amount desc,user_id desc) as tab |
| | | ,(SELECT @row_number:=0) AS t |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | | |