提交 b9effaf4 作者: 刘明祎-运维用途

Merge branch 'develop'

package com.mmc.iuav.user.model.qo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.domain.Page;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageQO {
@ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
package com.mmc.iuav.user.model.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Admin
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserPointsSortVO {
private Integer id;
private Integer userAccountId;
private Integer totalPoints;
private UserAccountVO userAccountVO;
}
...@@ -5,6 +5,7 @@ import com.mmc.iuav.group.Update; ...@@ -5,6 +5,7 @@ import com.mmc.iuav.group.Update;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.dto.UserBaseInfoDTO; import com.mmc.iuav.user.model.dto.UserBaseInfoDTO;
import com.mmc.iuav.user.model.qo.PageQO;
import com.mmc.iuav.user.model.qo.UserAccountQO; import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO; import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO; import com.mmc.iuav.user.model.qo.UserRcdQO;
...@@ -150,6 +151,13 @@ public class UserAccountController extends BaseController { ...@@ -150,6 +151,13 @@ public class UserAccountController extends BaseController {
return userAccountService.topRcd(topNum); return userAccountService.topRcd(topNum);
} }
@ApiOperation(value = "积分排行榜")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("topPoints")
public ResultBody topPoints(@RequestBody PageQO pageQO) {
return userAccountService.topPoints(pageQO);
}
@ApiOperation(value = "手机号查询用户信息") @ApiOperation(value = "手机号查询用户信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("getUserAccountByPhoneNum") @GetMapping("getUserAccountByPhoneNum")
......
...@@ -84,7 +84,7 @@ public class UserPointsController extends BaseController { ...@@ -84,7 +84,7 @@ public class UserPointsController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/feignChangeUserPoints") @GetMapping("/feignChangeUserPoints")
@ApiIgnore @ApiIgnore
public ResultBody feignChangeUserPoints(HttpServletRequest request,@RequestParam("id") int changePoint,String reason) { public ResultBody feignChangeUserPoints(HttpServletRequest request,@RequestParam("changePoint") int changePoint,String reason) {
return userPointsService.changeUserPoints(this.getUserLoginInfoFromRedis(request).getUserAccountId(), null,changePoint,reason); return userPointsService.changeUserPoints(this.getUserLoginInfoFromRedis(request).getUserAccountId(), null,changePoint,reason);
} }
......
package com.mmc.iuav.user.dao.userpoints; package com.mmc.iuav.user.dao.userpoints;
import com.mmc.iuav.user.entity.userpoints.UserPointsDO; import com.mmc.iuav.user.entity.userpoints.UserPointsDO;
import com.mmc.iuav.user.model.qo.PageQO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointQO; import com.mmc.iuav.user.model.qo.userpoints.UserPointQO;
import com.mmc.iuav.user.model.vo.BuyPointsVO; import com.mmc.iuav.user.model.vo.BuyPointsVO;
import com.mmc.iuav.user.model.vo.UserPointsSortVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -31,4 +33,11 @@ public interface UserPointsDao { ...@@ -31,4 +33,11 @@ public interface UserPointsDao {
void insertBuyPointsType(BuyPointsVO buyPointsVO); void insertBuyPointsType(BuyPointsVO buyPointsVO);
void updateBuyPointsType(BuyPointsVO buyPointsVO); void updateBuyPointsType(BuyPointsVO buyPointsVO);
/**
* 积分排行榜
* @param pageQO
* @return {@link List}<{@link UserPointsSortVO}>
*/
List<UserPointsSortVO> selectUserPointsSort(PageQO pageQO);
} }
...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.entity.UserStateDO; ...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.entity.UserStateDO;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO; import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.dto.UserBaseInfoDTO; import com.mmc.iuav.user.model.dto.UserBaseInfoDTO;
import com.mmc.iuav.user.model.qo.PageQO;
import com.mmc.iuav.user.model.qo.UserAccountQO; import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO; import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO; import com.mmc.iuav.user.model.qo.UserRcdQO;
...@@ -168,6 +169,8 @@ public interface UserAccountService { ...@@ -168,6 +169,8 @@ public interface UserAccountService {
*/ */
ResultBody topRcd(Integer topNum); ResultBody topRcd(Integer topNum);
ResultBody topPoints(PageQO pageQO);
/** /**
* 通过手机号查询用户信息 * 通过手机号查询用户信息
* *
......
...@@ -18,6 +18,7 @@ import com.mmc.iuav.user.model.dto.LoginSuccessDTO; ...@@ -18,6 +18,7 @@ import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.dto.RealNameAuthDTO; import com.mmc.iuav.user.model.dto.RealNameAuthDTO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.dto.UserBaseInfoDTO; import com.mmc.iuav.user.model.dto.UserBaseInfoDTO;
import com.mmc.iuav.user.model.qo.PageQO;
import com.mmc.iuav.user.model.qo.UserAccountQO; import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO; import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO; import com.mmc.iuav.user.model.qo.UserRcdQO;
...@@ -40,6 +41,7 @@ import java.util.List; ...@@ -40,6 +41,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @author: zj * @author: zj
...@@ -118,60 +120,11 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -118,60 +120,11 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override @Override
public UserAccountVO getUserAccountById(Integer userAccountId) { public UserAccountVO getUserAccountById(Integer userAccountId) {
UserAccountDO userAccountDO = userServiceDao.getUserAccountById(userAccountId); return getUserAccountVO(userAccountId);
if (userAccountDO == null) {
return null;
}
String districtChild = userServiceDao.getDistrictChild(userAccountDO.getDistrictChildId());
userAccountDO.setRegion(districtChild);
UserAccountVO userAccountVO = userAccountDO.buildUserAccountVO();
ResultBody<RealNameAuthDTO> nameAuthDTOResultBody = realNameAuthService.userDetail(userAccountId);
RealNameAuthDTO realNameAuthDTO = nameAuthDTOResultBody.getResult();
if (realNameAuthDTO != null && realNameAuthDTO.getCheckStatus().equals(1)) {
userAccountVO.setRealNameAuthStatus(1);
userAccountVO.setUserName(realNameAuthDTO.getUserName());
}
CompanyAuthVO companyAuthVO = companyAuthService.getCompanyAuthByUId(userAccountId);
if (companyAuthVO != null) {
userAccountVO.setCompanyAuthStatus(companyAuthVO.getAuthStatus());
} else {
userAccountVO.setCompanyAuthStatus(0);
}
List<CooperationTagDO> cooperationTagDOS = cooperationDao.listUserCooperationTag(userAccountId);
if (!CollectionUtils.isEmpty(cooperationTagDOS)) {
List<CooperationTagVO> cooperationTags = cooperationTagDOS.stream().map(CooperationTagDO::buildCooperationTagVO).collect(Collectors.toList());
userAccountVO.setCooperationTagVOS(cooperationTags);
}
XzAuthDO xzAuthDO = xzDao.getXzAuthByUserAccountId(userAccountId);
if (xzAuthDO != null) {
userAccountVO.setXzAuthStatus(xzAuthDO.getXzAuthStatus());
} else {
userAccountVO.setXzAuthStatus(0);
}
UserSubInfoDO userSubInfoDO = userSubInfoDao.getUserSubInfoByUnionId(userAccountDO.getUnionId());
if (userSubInfoDO != null && userSubInfoDO.getRegStatus().equals(1)) {
userAccountVO.setSubStatus(1);
} else {
userAccountVO.setSubStatus(0);
}
CompanyInfoDO companyInfoDO = certificationDao.selectCompanyInfoByPilotId(userAccountId,1);
if(companyInfoDO !=null) {
CompanyInfoVO companyInfoVO = companyInfoDO.buildCompanyInfoVO();
userAccountVO.setCompanyInfoVO(companyInfoVO);
}
Integer backUserId = certificationDao.selectBackUserIdByUserId(userAccountId);
// log.info("userAccountId {} 用户对应的backUserId=============》{}",userAccountId,backUserId);
if(backUserId!=null) {
userAccountVO.setBackUserId(backUserId);
}
Integer userStateId = userAccountDO.getUserStateId();
if(userStateId != null){
userAccountVO.setUserStateVO(userServiceDao.getUserState(userStateId));
}
return userAccountVO;
} }
@Override @Override
public ResultBody update(UserAccountVO userAccountVO) { public ResultBody update(UserAccountVO userAccountVO) {
UserAccountDO userAccountDO = new UserAccountDO(userAccountVO); UserAccountDO userAccountDO = new UserAccountDO(userAccountVO);
...@@ -522,6 +475,18 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -522,6 +475,18 @@ public class UserAccountServiceImpl implements UserAccountService {
} }
@Override @Override
public ResultBody topPoints(PageQO pageQO) {
int count = userPointsDao.count(null);
pageQO.buildCurrentPage();
List<UserPointsSortVO> userPointsSortVOS = userPointsDao.selectUserPointsSort(pageQO);
List<UserPointsSortVO> collect = userPointsSortVOS.stream().peek(UserPointsSortVO -> {
UserAccountVO userAccountVO = getUserAccountVO(UserPointsSortVO.getUserAccountId());
UserPointsSortVO.setUserAccountVO(userAccountVO);
}).collect(Collectors.toList());
return ResultBody.success(PageResult.buildPage(pageQO.getPageNo(), pageQO.getPageSize(), count,collect));
}
@Override
public ResultBody getUserAccountByPhoneNum(String phoneNum) { public ResultBody getUserAccountByPhoneNum(String phoneNum) {
List<UserAccountDO> userAccountDOS = userServiceDao.getUserAccountByPhoneNum(phoneNum); List<UserAccountDO> userAccountDOS = userServiceDao.getUserAccountByPhoneNum(phoneNum);
if (!CollectionUtils.isEmpty(userAccountDOS)) { if (!CollectionUtils.isEmpty(userAccountDOS)) {
...@@ -606,6 +571,59 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -606,6 +571,59 @@ public class UserAccountServiceImpl implements UserAccountService {
List<UserStateDO> stateList = userServiceDao.getStateList(); List<UserStateDO> stateList = userServiceDao.getStateList();
return ResultBody.success(stateList); return ResultBody.success(stateList);
} }
private UserAccountVO getUserAccountVO(Integer userAccountId) {
UserAccountDO userAccountDO = userServiceDao.getUserAccountById(userAccountId);
if (userAccountDO == null) {
return null;
}
String districtChild = userServiceDao.getDistrictChild(userAccountDO.getDistrictChildId());
userAccountDO.setRegion(districtChild);
UserAccountVO userAccountVO = userAccountDO.buildUserAccountVO();
ResultBody<RealNameAuthDTO> nameAuthDTOResultBody = realNameAuthService.userDetail(userAccountId);
RealNameAuthDTO realNameAuthDTO = nameAuthDTOResultBody.getResult();
if (realNameAuthDTO != null && realNameAuthDTO.getCheckStatus().equals(1)) {
userAccountVO.setRealNameAuthStatus(1);
userAccountVO.setUserName(realNameAuthDTO.getUserName());
}
CompanyAuthVO companyAuthVO = companyAuthService.getCompanyAuthByUId(userAccountId);
if (companyAuthVO != null) {
userAccountVO.setCompanyAuthStatus(companyAuthVO.getAuthStatus());
} else {
userAccountVO.setCompanyAuthStatus(0);
}
List<CooperationTagDO> cooperationTagDOS = cooperationDao.listUserCooperationTag(userAccountId);
if (!CollectionUtils.isEmpty(cooperationTagDOS)) {
List<CooperationTagVO> cooperationTags = cooperationTagDOS.stream().map(CooperationTagDO::buildCooperationTagVO).collect(Collectors.toList());
userAccountVO.setCooperationTagVOS(cooperationTags);
}
XzAuthDO xzAuthDO = xzDao.getXzAuthByUserAccountId(userAccountId);
if (xzAuthDO != null) {
userAccountVO.setXzAuthStatus(xzAuthDO.getXzAuthStatus());
} else {
userAccountVO.setXzAuthStatus(0);
}
UserSubInfoDO userSubInfoDO = userSubInfoDao.getUserSubInfoByUnionId(userAccountDO.getUnionId());
if (userSubInfoDO != null && userSubInfoDO.getRegStatus().equals(1)) {
userAccountVO.setSubStatus(1);
} else {
userAccountVO.setSubStatus(0);
}
CompanyInfoDO companyInfoDO = certificationDao.selectCompanyInfoByPilotId(userAccountId,1);
if(companyInfoDO !=null) {
CompanyInfoVO companyInfoVO = companyInfoDO.buildCompanyInfoVO();
userAccountVO.setCompanyInfoVO(companyInfoVO);
}
Integer backUserId = certificationDao.selectBackUserIdByUserId(userAccountId);
// log.info("userAccountId {} 用户对应的backUserId=============》{}",userAccountId,backUserId);
if(backUserId!=null) {
userAccountVO.setBackUserId(backUserId);
}
Integer userStateId = userAccountDO.getUserStateId();
if(userStateId != null){
userAccountVO.setUserStateVO(userServiceDao.getUserState(userStateId));
}
return userAccountVO;
}
} }
...@@ -99,6 +99,10 @@ ...@@ -99,6 +99,10 @@
select * select *
from user_points_buy from user_points_buy
</select> </select>
<select id="selectUserPointsSort" resultType="com.mmc.iuav.user.model.vo.UserPointsSortVO">
select id,user_account_id,total_points from user_points
order by total_points desc limit #{pageNo},#{pageSize}
</select>
</mapper> </mapper>
...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 1966122d880d4fab152a1df377c526bcccdc0adf newTag: 78f5993c9236a4ee708042ac2ccc5eef3957d48d
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论