用户是否已读文章、系统配置

This commit is contained in:
墨大叔 2024-09-19 18:10:13 +08:00
parent c9859e4b78
commit 87b2bd73e7
10 changed files with 61 additions and 4 deletions

View File

@ -186,4 +186,10 @@ public class SmUser extends BaseEntity
@Excel(name = "限制退款原因") @Excel(name = "限制退款原因")
@ApiModelProperty("限制退款原因") @ApiModelProperty("限制退款原因")
private String limitRefundReason; private String limitRefundReason;
@Excel(name = "是否已阅读过商户协议")
@ApiModelProperty("是否已阅读过商户协议")
@JsonView(JsonViewProfile.App.class)
private Boolean readMchLicence;
} }

View File

@ -1,11 +1,18 @@
package com.ruoyi.ss.article.domain; package com.ruoyi.ss.article.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author wjh * @author wjh
* 2024/4/3 * 2024/4/3
*/ */
@Data @Data
public class SmArticleQuery extends SmArticle { public class SmArticleQuery extends SmArticle {
@ApiModelProperty("文章ID列表")
private List<Long> articleIds;
} }

View File

@ -17,7 +17,8 @@ public enum LicenceType {
USER("user", "ss.licence.user.id"), // 用户协议 USER("user", "ss.licence.user.id"), // 用户协议
PRIVACY("privacy", "ss.licence.privacy.id"), // 隐私协议 PRIVACY("privacy", "ss.licence.privacy.id"), // 隐私协议
COLLECT("collection", "ss.licence.collection.id"), // 个人信息收集清单 COLLECT("collection", "ss.licence.collection.id"), // 个人信息收集清单
ABOUT("about", "ss.licence.about.id"); // 关于我们 ABOUT("about", "ss.licence.about.id"), // 关于我们
MCH("mch", "ss.licence.mch.id"); // 商户协议
private final String type; // 类型 private final String type; // 类型
private final String key; // 配置键值 private final String key; // 配置键值

View File

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.ss.article.mapper.SmArticleMapper"> <mapper namespace="com.ruoyi.ss.article.mapper.SmArticleMapper">
<resultMap type="SmArticle" id="SmArticleResult"> <resultMap type="SmArticle" id="SmArticleResult" autoMapping="true">
<result property="articleId" column="article_id" /> <result property="articleId" column="article_id" />
<result property="classifyId" column="classify_id" /> <result property="classifyId" column="classify_id" />
<result property="title" column="title" /> <result property="title" column="title" />
@ -74,6 +74,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="classifyId != null and classifyId != ''"> and a.classify_id = #{classifyId}</if> <if test="classifyId != null and classifyId != ''"> and a.classify_id = #{classifyId}</if>
<if test="title != null and title != ''"> and a.title like concat('%', #{title}, '%')</if> <if test="title != null and title != ''"> and a.title like concat('%', #{title}, '%')</if>
<if test="isHot != null and isHot != ''"> and a.is_hot = #{isHot}</if> <if test="isHot != null and isHot != ''"> and a.is_hot = #{isHot}</if>
<if test="articleIds != null and articleIds.size() > 0">
and a.article_id in
<foreach collection="articleIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where> </where>
order by a.create_time desc order by a.create_time desc
</select> </select>

View File

@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
su.limit_withdraw_reason, su.limit_withdraw_reason,
su.limit_refund, su.limit_refund,
su.limit_refund_reason, su.limit_refund_reason,
su.read_mch_licence,
(select sum(stb.money) from sm_transaction_bill stb where stb.user_id = su.user_id and stb.type = '1' and stb.status = '2') as recharge_amount, (select sum(stb.money) from sm_transaction_bill stb where stb.user_id = su.user_id and stb.type = '1' and stb.status = '2') as recharge_amount,
(select sum(stb.arrival_amount) from sm_transaction_bill stb where stb.user_id = su.user_id and stb.type = '2' and stb.status = '14') as with_drawl_amount, (select sum(stb.arrival_amount) from sm_transaction_bill stb where stb.user_id = su.user_id and stb.type = '2' and stb.status = '14') as with_drawl_amount,
(select sum(stb.arrival_amount) from sm_transaction_bill stb where stb.mch_id = su.user_id and stb.type = '1' and stb.status = '2') as total_income (select sum(stb.arrival_amount) from sm_transaction_bill stb where stb.mch_id = su.user_id and stb.type = '1' and stb.status = '2') as total_income
@ -72,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="serviceType != null and serviceType != ''"> and service_type = #{serviceType}</if> <if test="serviceType != null and serviceType != ''"> and service_type = #{serviceType}</if>
<if test="limitWithdraw != null "> and limit_withdraw = #{limitWithdraw}</if> <if test="limitWithdraw != null "> and limit_withdraw = #{limitWithdraw}</if>
<if test="limitRefund != null "> and limit_refund = #{limitRefund}</if> <if test="limitRefund != null "> and limit_refund = #{limitRefund}</if>
<if test="readMchLicence != null "> and read_mch_licence = #{readMchLicence}</if>
<if test="tenantDeviceId != null"> <if test="tenantDeviceId != null">
and su.user_id in ( and su.user_id in (
select sdt.tenant_id select sdt.tenant_id
@ -169,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="limitWithdrawReason != null">limit_withdraw_reason,</if> <if test="limitWithdrawReason != null">limit_withdraw_reason,</if>
<if test="limitRefund != null">limit_refund,</if> <if test="limitRefund != null">limit_refund,</if>
<if test="limitRefundReason != null">limit_refund_reason,</if> <if test="limitRefundReason != null">limit_refund_reason,</if>
<if test="readMchLicence != null">read_mch_licence,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userName != null and userName != ''">#{userName},</if> <if test="userName != null and userName != ''">#{userName},</if>
@ -206,6 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="limitWithdrawReason != null">#{limitWithdrawReason},</if> <if test="limitWithdrawReason != null">#{limitWithdrawReason},</if>
<if test="limitRefund != null">#{limitRefund},</if> <if test="limitRefund != null">#{limitRefund},</if>
<if test="limitRefundReason != null">#{limitRefundReason},</if> <if test="limitRefundReason != null">#{limitRefundReason},</if>
<if test="readMchLicence != null">#{readMchLicence},</if>
</trim> </trim>
</insert> </insert>
@ -253,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="limitWithdrawReason != null">limit_withdraw_reason = #{limitWithdrawReason},</if> <if test="limitWithdrawReason != null">limit_withdraw_reason = #{limitWithdrawReason},</if>
<if test="limitRefund != null">limit_refund = #{limitRefund},</if> <if test="limitRefund != null">limit_refund = #{limitRefund},</if>
<if test="limitRefundReason != null">limit_refund_reason = #{limitRefundReason},</if> <if test="limitRefundReason != null">limit_refund_reason = #{limitRefundReason},</if>
<if test="readMchLicence != null">read_mch_licence = #{readMchLicence},</if>
</trim> </trim>
where user_id = #{userId} where user_id = #{userId}
</update> </update>

View File

@ -209,4 +209,9 @@ public interface ISmUserService
* 实名认证 * 实名认证
*/ */
int realName(UserRealNameDTO dto); int realName(UserRealNameDTO dto);
/**
* 标记已读商户协议
*/
int readMchLicence(Long userId);
} }

View File

@ -297,6 +297,14 @@ public class SmUserServiceImpl implements ISmUserService
return smUserMapper.updateSmUser(data); return smUserMapper.updateSmUser(data);
} }
@Override
public int readMchLicence(Long userId) {
SmUser data = new SmUser();
data.setUserId(userId);
data.setReadMchLicence(true);
return smUserMapper.updateSmUser(data);
}
/** /**
* 逻辑删除前校验 * 逻辑删除前校验
* @param userIds * @param userIds

View File

@ -75,4 +75,10 @@ public class AppUserController extends BaseController {
return toAjax(userService.realName(dto)); return toAjax(userService.realName(dto));
} }
@ApiOperation("标记用户已读商户协议")
@PutMapping("/readMchLicence")
public AjaxResult readMchLicence() {
return toAjax(userService.readMchLicence(getUserId()));
}
} }

View File

@ -48,6 +48,19 @@ public class SmArticleController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询文章列表ByIds
*/
@PreAuthorize("@ss.hasPermi('system:article:list')")
@GetMapping("/listByIds/{ids}")
public AjaxResult listByIds(@PathVariable List<Long> ids)
{
SmArticleQuery query = new SmArticleQuery();
query.setArticleIds(ids);
List<SmArticle> list = asArticleService.selectSmArticleList(query);
return success(list);
}
/** /**
* 导出文章列表 * 导出文章列表
*/ */

View File

@ -145,8 +145,8 @@ public class SysConfigController extends BaseController
/** /**
* 根据参数键名列表查询参数值 * 根据参数键名列表查询参数值
*/ */
@GetMapping(value = "/configKeys/{configKeys}") @PostMapping(value = "/configKeys")
public AjaxResult getConfigKeys(@PathVariable List<String> configKeys) public AjaxResult getConfigKeys(@RequestBody List<String> configKeys)
{ {
SysConfigQuery query = new SysConfigQuery(); SysConfigQuery query = new SysConfigQuery();
query.setConfigKeys(configKeys); query.setConfigKeys(configKeys);