短剧新需求
This commit is contained in:
parent
d14d80db85
commit
03cff5e66f
|
|
@ -0,0 +1,31 @@
|
|||
package com.sqx.modules.ext.controller;
|
||||
|
||||
import cn.hutool.core.exceptions.ValidateException;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.ext.param.InviteFriendConfigParam;
|
||||
import com.sqx.modules.ext.service.ExtSysService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 扩展功能控制层
|
||||
* @author tankaikai
|
||||
* @since 2025-03-28 09:32
|
||||
*/
|
||||
@RestController
|
||||
@Api(value = "APP扩展功能", tags = {"APP扩展功能"})
|
||||
@RequestMapping("/app/ext/sys")
|
||||
public class AppExtSysController {
|
||||
|
||||
@Autowired
|
||||
private ExtSysService extSysService;
|
||||
|
||||
@GetMapping("/invite/friend/config/get")
|
||||
@ApiOperation("获取邀请好友配置信息")
|
||||
public Result getInviteFriendConfig(){
|
||||
InviteFriendConfigParam data = extSysService.getInviteFriendConfig();
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,13 @@
|
|||
package com.sqx.modules.ext.controller;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.exceptions.ValidateException;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.entity.App;
|
||||
import com.sqx.modules.app.entity.VipDetails;
|
||||
import com.sqx.modules.coupon.entity.Coupon;
|
||||
import com.sqx.modules.ext.param.InviteFriendConfigParam;
|
||||
import com.sqx.modules.ext.service.ExtSysService;
|
||||
|
|
@ -11,15 +17,17 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 扩展功能控制层
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-28 09:32
|
||||
*/
|
||||
@RestController
|
||||
@Api(value = "扩展功能", tags = {"扩展功能"})
|
||||
@RequestMapping(value = {"/ext/sys","/app/ext/sys"})
|
||||
@Api(value = "ADMIN扩展功能", tags = {"ADMIN扩展功能"})
|
||||
@RequestMapping("/ext/sys")
|
||||
public class ExtSysController {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -27,10 +35,10 @@ public class ExtSysController {
|
|||
|
||||
@PostMapping("/invite/friend/config/save")
|
||||
@ApiOperation("保存邀请好友配置信息")
|
||||
public Result saveInviteFriendConfig(@RequestBody InviteFriendConfigParam param){
|
||||
public Result saveInviteFriendConfig(@RequestBody InviteFriendConfigParam param) {
|
||||
try {
|
||||
extSysService.saveInviteFriendConfig(param);
|
||||
}catch (ValidateException e){
|
||||
} catch (ValidateException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.success();
|
||||
|
|
@ -38,8 +46,29 @@ public class ExtSysController {
|
|||
|
||||
@GetMapping("/invite/friend/config/get")
|
||||
@ApiOperation("获取邀请好友配置信息")
|
||||
public Result getInviteFriendConfig(){
|
||||
public Result getInviteFriendConfig() {
|
||||
InviteFriendConfigParam data = extSysService.getInviteFriendConfig();
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
|
||||
@GetMapping("/invite/friend/award/page")
|
||||
@ApiOperation("邀请好友奖励分页")
|
||||
public Result getInviteFriendAwardPage(Integer page, Integer limit, String keywords) {
|
||||
PageUtils data = extSysService.queryInviteFriendRecord(page, limit, keywords);
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
|
||||
@GetMapping("/invite/friend/signIn/page")
|
||||
@ApiOperation("邀请好友奖励-签到人数分页")
|
||||
public Result getInviteFriendSignInPage(Integer page, Integer limit, String userId) {
|
||||
PageUtils data = extSysService.queryInviteSignInRecord(page, limit, Convert.toLong(userId));
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
|
||||
@GetMapping("/invite/friend/award/detail/page")
|
||||
@ApiOperation("邀请好友奖励详情分页")
|
||||
public Result getInviteFriendAwardDetailPage(Integer page, Integer limit, String userId) {
|
||||
PageUtils data = extSysService.queryInviteAwardDetailRecord(page, limit, Convert.toLong(userId));
|
||||
return Result.success().put("data", data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.sqx.modules.ext.dao;
|
||||
|
||||
import com.sqx.modules.ext.dto.InviteAwardDTO;
|
||||
import com.sqx.modules.ext.dto.InviteFriendDTO;
|
||||
import com.sqx.modules.ext.dto.SignInNumDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 扩展系统数据访问层
|
||||
* @author tankaikai
|
||||
* @since 2025-03-28 10:39
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExtSysDao {
|
||||
List<InviteFriendDTO> findInviteFriendList(@Param("keywords") String keywords);
|
||||
|
||||
List<SignInNumDTO> findInviteSignInList(@Param("userId") Long userId);
|
||||
|
||||
List<InviteAwardDTO> findInviteAwardDetailList(@Param("userId") Long userId);
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.sqx.modules.ext.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 邀请奖励明细
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-28 10:07
|
||||
*/
|
||||
@Data
|
||||
public class InviteAwardDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 奖励id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
/**
|
||||
* 发放金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 有效邀请人
|
||||
*/
|
||||
private String userPhone;
|
||||
/**
|
||||
* 发放时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.sqx.modules.ext.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 邀请好友DTO
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-28 09:56
|
||||
*/
|
||||
@Data
|
||||
public class InviteFriendDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 签到人数
|
||||
*/
|
||||
private Integer signInNum;
|
||||
/**
|
||||
* 已发放奖励金额
|
||||
*/
|
||||
private BigDecimal awardAmount;
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.sqx.modules.ext.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 签到人数DTO
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-28 10:24
|
||||
*/
|
||||
@Data
|
||||
public class SignInNumDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 签到账号ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realName;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCardNo;
|
||||
/**
|
||||
* 银行名称
|
||||
*/
|
||||
private String bankName;
|
||||
/**
|
||||
* 银行卡号
|
||||
*/
|
||||
private String bankCardNo;
|
||||
/**
|
||||
* 银行预留手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
private String bankBranch;
|
||||
/**
|
||||
* 发放时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.sqx.modules.ext.service;
|
||||
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.modules.ext.param.InviteFriendConfigParam;
|
||||
|
||||
/**
|
||||
|
|
@ -12,4 +13,10 @@ public interface ExtSysService {
|
|||
void saveInviteFriendConfig(InviteFriendConfigParam param);
|
||||
|
||||
InviteFriendConfigParam getInviteFriendConfig();
|
||||
|
||||
PageUtils queryInviteFriendRecord(Integer page, Integer limit, String keywords);
|
||||
|
||||
PageUtils queryInviteSignInRecord(Integer page, Integer limit, Long userId);
|
||||
|
||||
PageUtils queryInviteAwardDetailRecord(Integer page, Integer limit, Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,27 @@ import cn.hutool.core.convert.Convert;
|
|||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.exceptions.ValidateException;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.entity.UserEntity;
|
||||
import com.sqx.modules.app.entity.VipDetails;
|
||||
import com.sqx.modules.common.dao.CommonInfoDao;
|
||||
import com.sqx.modules.common.entity.CommonInfo;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.ext.dao.ExtSysDao;
|
||||
import com.sqx.modules.ext.dto.InviteAwardDTO;
|
||||
import com.sqx.modules.ext.dto.InviteFriendDTO;
|
||||
import com.sqx.modules.ext.dto.SignInNumDTO;
|
||||
import com.sqx.modules.ext.param.InviteFriendConfigParam;
|
||||
import com.sqx.modules.ext.service.ExtSysService;
|
||||
import com.sqx.modules.utils.TimeCompleteUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 扩展功能服务实现类
|
||||
*
|
||||
|
|
@ -22,6 +35,8 @@ import org.springframework.stereotype.Service;
|
|||
public class ExtSysServiceImpl implements ExtSysService {
|
||||
@Autowired
|
||||
private CommonInfoDao commonInfoDao;
|
||||
@Autowired
|
||||
private ExtSysDao extSysDao;
|
||||
|
||||
@Override
|
||||
public void saveInviteFriendConfig(InviteFriendConfigParam param) {
|
||||
|
|
@ -63,4 +78,28 @@ public class ExtSysServiceImpl implements ExtSysService {
|
|||
data.setImageUrl(commonInfo.getValue());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryInviteFriendRecord(Integer page, Integer limit, String keywords) {
|
||||
PageHelper.startPage(page,limit);
|
||||
List<InviteFriendDTO> list = extSysDao.findInviteFriendList(keywords);
|
||||
PageInfo<InviteFriendDTO> pageInfo = new PageInfo<>(list);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryInviteSignInRecord(Integer page, Integer limit, Long userId) {
|
||||
PageHelper.startPage(page,limit);
|
||||
List<SignInNumDTO> list = extSysDao.findInviteSignInList(userId);
|
||||
PageInfo<SignInNumDTO> pageInfo = new PageInfo<>(list);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryInviteAwardDetailRecord(Integer page, Integer limit, Long userId) {
|
||||
PageHelper.startPage(page,limit);
|
||||
List<InviteAwardDTO> list = extSysDao.findInviteAwardDetailList(userId);
|
||||
PageInfo<InviteAwardDTO> pageInfo = new PageInfo<>(list);
|
||||
return PageUtils.page(pageInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
<?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.sqx.modules.ext.dao.ExtSysDao">
|
||||
|
||||
<select id="findInviteFriendList" resultType="com.sqx.modules.ext.dto.InviteFriendDTO">
|
||||
select
|
||||
t1.user_id as userId,
|
||||
t1.user_name as userName,
|
||||
t1.phone,
|
||||
t1.avatar,
|
||||
t2.signInNum,
|
||||
t2.awardAmount
|
||||
from tb_user t1
|
||||
left JOIN (select user_id,sum(money) as awardAmount,sum(case when title = '签到奖励' then 1 else 0 end) as signInNum from user_money_details where classify = 6 group by user_id) t2 on t1.user_id = t2.user_id
|
||||
<where>
|
||||
and t2.awardAmount is not null
|
||||
<if test="keywords != null and keywords != ''">
|
||||
and (t1.user_name like concat('%',#{keywords},'%') or t1.phone like concat('%',#{keywords},'%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY t1.user_id
|
||||
</select>
|
||||
<select id="findInviteSignInList" resultType="com.sqx.modules.ext.dto.SignInNumDTO">
|
||||
SELECT
|
||||
t1.by_user_id AS userId,
|
||||
MIN( t1.create_time ) as createTime,
|
||||
t2.user_name as userName,
|
||||
t2.phone,
|
||||
t3.cert_name as realName,
|
||||
t3.cert_no as idCardNo,
|
||||
t3.bank_name as bankName,
|
||||
t3.account_no as bankCardNo,
|
||||
t3.mobile,
|
||||
t3.province,
|
||||
t3.city,
|
||||
t3.bank_branch
|
||||
FROM
|
||||
user_money_details t1
|
||||
LEFT JOIN tb_user t2 on t1.by_user_id = t2.user_id
|
||||
LEFT JOIN user_info t3 on t1.by_user_id = t3.user_id
|
||||
WHERE
|
||||
t1.user_id = #{userId}
|
||||
AND t1.classify = 6
|
||||
AND t1.title = '签到奖励'
|
||||
GROUP BY t1.by_user_id
|
||||
ORDER BY t1.by_user_id
|
||||
</select>
|
||||
<select id="findInviteAwardDetailList" resultType="com.sqx.modules.ext.dto.InviteAwardDTO">
|
||||
SELECT DISTINCT
|
||||
t1.by_user_id AS userId,
|
||||
t1.money as amount,
|
||||
t2.phone as userPhone,
|
||||
t1.create_time as createTime
|
||||
FROM
|
||||
user_money_details t1
|
||||
LEFT JOIN tb_user t2 on t1.by_user_id = t2.user_id
|
||||
WHERE
|
||||
t1.user_id = #{userId}
|
||||
AND t1.classify = '6'
|
||||
and t1.by_user_id is not null
|
||||
and t2.user_id is not null
|
||||
order by t1.create_time desc,t1.by_user_id asc
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue