|
|
|
|
@@ -66,116 +66,115 @@ public class AppInviteController {
|
|
|
|
|
@RequestMapping(value = "/selectInviteCount", method = RequestMethod.GET)
|
|
|
|
|
@ApiOperation("查看我邀请的人员数量")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Result selectInviteCount(Integer state,Long userId){
|
|
|
|
|
return Result.success().put("data",inviteService.selectInviteCount(state,userId));
|
|
|
|
|
public Result selectInviteCount(Integer state, Long userId) {
|
|
|
|
|
return Result.success().put("data", inviteService.selectInviteCount(state, userId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Login
|
|
|
|
|
@RequestMapping(value = "/selectUserMoney", method = RequestMethod.GET)
|
|
|
|
|
@ApiOperation("查看我的钱包")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Result selectUserMoney(@RequestAttribute("userId") Long userId){
|
|
|
|
|
return Result.success().put("data",userMoneyService.selectUserMoneyByUserId(userId));
|
|
|
|
|
public Result selectUserMoney(@RequestAttribute("userId") Long userId) {
|
|
|
|
|
return Result.success().put("data", userMoneyService.selectUserMoneyByUserId(userId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/selectInviteAndPoster", method = RequestMethod.GET)
|
|
|
|
|
@ApiOperation("查看我的邀请码和海报二维码")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Result selectInviteAndPoster(Long userId){
|
|
|
|
|
public Result selectInviteAndPoster(Long userId) {
|
|
|
|
|
UserEntity userEntity = userService.queryByUserId(userId);
|
|
|
|
|
CommonInfo one = commonInfoService.findOne(19);
|
|
|
|
|
Map<String,Object> map=new HashMap<>();
|
|
|
|
|
map.put("url",one.getValue());
|
|
|
|
|
map.put("user",userEntity);
|
|
|
|
|
return Result.success().put("data",map);
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("url", one.getValue());
|
|
|
|
|
map.put("user", userEntity);
|
|
|
|
|
return Result.success().put("data", map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Login
|
|
|
|
|
@RequestMapping(value = "/selectInviteMoney", method = RequestMethod.GET)
|
|
|
|
|
@ApiOperation("我的收益")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Result selectInviteMoney(@RequestAttribute("userId") Long userId){
|
|
|
|
|
public Result selectInviteMoney(@RequestAttribute("userId") Long userId) {
|
|
|
|
|
InviteMoney inviteMoney = inviteMoneyService.selectInviteMoneyByUserId(userId);
|
|
|
|
|
Integer inviteCount = inviteService.selectInviteCount(-1, userId);
|
|
|
|
|
Integer inviteSignCount = inviteService.selectInviteCount(1, userId);
|
|
|
|
|
Map<String,Object> result=new HashMap<>();
|
|
|
|
|
result.put("inviteMoney",inviteMoney);
|
|
|
|
|
result.put("inviteCount",inviteCount);
|
|
|
|
|
result.put("inviteSignCount",inviteSignCount);
|
|
|
|
|
return Result.success().put("data",result);
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
result.put("inviteMoney", inviteMoney);
|
|
|
|
|
result.put("inviteCount", inviteCount);
|
|
|
|
|
result.put("inviteSignCount", inviteSignCount);
|
|
|
|
|
return Result.success().put("data", result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/mpCreateQr")
|
|
|
|
|
@ApiOperation("微信小程序推广二维码")
|
|
|
|
|
public void mpCreateQr(String invitationCode,String page, HttpServletResponse response) {
|
|
|
|
|
SenInfoCheckUtil.getPoster(invitationCode,page,response);
|
|
|
|
|
public void mpCreateQr(String invitationCode, String page, HttpServletResponse response) {
|
|
|
|
|
SenInfoCheckUtil.getPoster(invitationCode, page, response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/dyCreateQr")
|
|
|
|
|
@ApiOperation("抖音小程序推广二维码")
|
|
|
|
|
public void dyCreateQr(String invitationCode,String page, HttpServletResponse response) {
|
|
|
|
|
SenInfoCheckUtil.getDyImg(invitationCode,page,response);
|
|
|
|
|
public void dyCreateQr(String invitationCode, String page, HttpServletResponse response) {
|
|
|
|
|
SenInfoCheckUtil.getDyImg(invitationCode, page, response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/insertQrCode")
|
|
|
|
|
@ApiOperation("生成二维码")
|
|
|
|
|
public void selectQrCode(String content,String courseId, HttpServletResponse servletResponse) throws Exception{
|
|
|
|
|
public void selectQrCode(String content, String courseId, HttpServletResponse servletResponse) throws Exception {
|
|
|
|
|
String invitationCode = commonInfoService.findOne(88).getValue();
|
|
|
|
|
String value="";
|
|
|
|
|
if(StringUtils.isNotBlank(courseId)){
|
|
|
|
|
value=urlAddressService.selectUrlAddressOne().getUrlAddress()+"?invitation="+invitationCode+"&qdCode="+content+"&id="+courseId;
|
|
|
|
|
}else{
|
|
|
|
|
value=urlAddressService.selectUrlAddressOne().getUrlAddress()+"?invitation="+invitationCode+"&qdCode="+content;
|
|
|
|
|
String value = "";
|
|
|
|
|
if (StringUtils.isNotBlank(courseId)) {
|
|
|
|
|
value = urlAddressService.selectUrlAddressOne().getUrlAddress() + "?invitation=" + invitationCode + "&qdCode=" + content + "&id=" + courseId;
|
|
|
|
|
} else {
|
|
|
|
|
value = urlAddressService.selectUrlAddressOne().getUrlAddress() + "?invitation=" + invitationCode + "&qdCode=" + content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QrCodeUtil.generate(value,qrconig,"png",servletResponse.getOutputStream());
|
|
|
|
|
QrCodeUtil.generate(value, qrconig, "png", servletResponse.getOutputStream());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Login
|
|
|
|
|
@RequestMapping(value = "/selectInviteByUserIdLists", method = RequestMethod.GET)
|
|
|
|
|
@ApiOperation("查看我邀请的人员列表(查看所有邀请列表)")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Result selectInviteByUserIdLists(int page,int limit,@RequestAttribute("userId") Long userId,Integer userType){
|
|
|
|
|
PageUtils pageUtils = inviteService.selectInviteUser(page, limit, userId,null,userType);
|
|
|
|
|
return Result.success().put("data",pageUtils);
|
|
|
|
|
public Result selectInviteByUserIdLists(int page, int limit, @RequestAttribute("userId") Long userId, Integer userType) {
|
|
|
|
|
PageUtils pageUtils = inviteService.selectInviteUser(page, limit, userId, null, userType);
|
|
|
|
|
return Result.success().put("data", pageUtils);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Login
|
|
|
|
|
@ApiOperation("钱包明细")
|
|
|
|
|
@GetMapping("/queryUserMoneyDetails")
|
|
|
|
|
public Result queryUserMoneyDetails(Integer page, Integer limit,@RequestAttribute("userId") Long userId,Integer classify,Integer type) {
|
|
|
|
|
return userMoneyDetailsService.queryUserMoneyDetails(page, limit,null, userId,2,type);
|
|
|
|
|
public Result queryUserMoneyDetails(Integer page, Integer limit, @RequestAttribute("userId") Long userId, Integer classify, Integer type, Integer moneyType) {
|
|
|
|
|
return userMoneyDetailsService.queryUserMoneyDetails(page, limit, null, userId, 2, type, moneyType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/selectInviteAwardList")
|
|
|
|
|
@ApiOperation("查询邀请奖励列表")
|
|
|
|
|
public Result selectInviteAwardList(Integer page,Integer limit){
|
|
|
|
|
return Result.success().put("data",inviteAwardService.page(new Page<>(page,limit),new QueryWrapper<InviteAward>().orderByAsc("invite_count")));
|
|
|
|
|
public Result selectInviteAwardList(Integer page, Integer limit) {
|
|
|
|
|
return Result.success().put("data", inviteAwardService.page(new Page<>(page, limit), new QueryWrapper<InviteAward>().orderByAsc("invite_count")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Login
|
|
|
|
|
@GetMapping("/selectInviteAwardByUserId")
|
|
|
|
|
@ApiOperation("查询当前邀请人数的下一个等级")
|
|
|
|
|
public Result selectInviteAwardByUserId(@LoginUser UserEntity userEntity){
|
|
|
|
|
public Result selectInviteAwardByUserId(@LoginUser UserEntity userEntity) {
|
|
|
|
|
int inviterCount = userService.queryInviterCount(userEntity.getInvitationCode());
|
|
|
|
|
return Result.success().put("data",inviteAwardService.getOne(new QueryWrapper<InviteAward>().gt("invite_count",inviterCount)
|
|
|
|
|
return Result.success().put("data", inviteAwardService.getOne(new QueryWrapper<InviteAward>().gt("invite_count", inviterCount)
|
|
|
|
|
.last(" order by invite_count limit 1")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Login
|
|
|
|
|
@GetMapping("/selectInviteUserListByUserId")
|
|
|
|
|
@ApiOperation("查询当前邀请人列表")
|
|
|
|
|
public Result selectInviteUserListByUserId(@LoginUser UserEntity userEntity){
|
|
|
|
|
return Result.success().put("data",userService.list(new QueryWrapper<UserEntity>().eq("inviter_code",userEntity.getInvitationCode())));
|
|
|
|
|
public Result selectInviteUserListByUserId(@LoginUser UserEntity userEntity) {
|
|
|
|
|
return Result.success().put("data", userService.list(new QueryWrapper<UserEntity>().eq("inviter_code", userEntity.getInvitationCode())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Login
|
|
|
|
|
@PostMapping("/inviteMoneyConvertUserMoney")
|
|
|
|
|
@ApiOperation("收益充值京豆")
|
|
|
|
|
public Result inviteMoneyConvertUserMoney(@LoginUser UserEntity userEntity, Long payClassifyId){
|
|
|
|
|
return inviteMoneyService.inviteMoneyConvertUserMoney(userEntity,payClassifyId);
|
|
|
|
|
public Result inviteMoneyConvertUserMoney(@LoginUser UserEntity userEntity, Long payClassifyId) {
|
|
|
|
|
return inviteMoneyService.inviteMoneyConvertUserMoney(userEntity, payClassifyId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|