Browse Source

文章标题+作者模糊查询,消费金豆数量校验,频道排除空记录

huangqizheng/feature-20250808172612-bug修复
lijianlin 1 week ago
parent
commit
8b50783248
  1. 11
      src/main/java/com/example/demo/serviceImpl/bean/BeanConsumeServiceImpl.java
  2. 4
      src/main/resources/jindouMapper/BeanConsumeMapper.xml
  3. 2
      src/main/resources/liveMapper/LiveMapper.xml

11
src/main/java/com/example/demo/serviceImpl/bean/BeanConsumeServiceImpl.java

@ -4,6 +4,7 @@ import com.example.demo.Util.BaseDES2;
import com.example.demo.domain.vo.bean.*;
import com.example.demo.domain.vo.coin.*;
import com.example.demo.mapper.bean.BeanConsumeMapper;
import com.example.demo.mapper.bean.BeanUserMapper;
import com.example.demo.mapper.coin.UserMapper;
import com.example.demo.mapper.live.LiveMapper;
import com.example.demo.service.bean.BeanConsumeService;
@ -47,6 +48,8 @@ public class BeanConsumeServiceImpl implements BeanConsumeService {
// 构建接口URL及参数
@Value("${bean.consume.url}")
String apiUrl;
@Autowired
private BeanUserMapper beanUserMapper;
//获取消费用户分部
@Override
@ -65,6 +68,14 @@ public class BeanConsumeServiceImpl implements BeanConsumeService {
@Override
public Result reduce(BeanConsume consume) {
//获取用户当前余额
BeanUserCard user= beanUserMapper.userCard(consume.getJwcode());
if (user.getFreeBean() < consume.getFreeBean()) {
return Result.error("用户免费金豆余额不足");
}
if (user.getPermanentBean() < consume.getPermanentBean()) {
return Result.error("用户永久金豆余额不足");
}
// 验证精网号是否有效
if (consume.getJwcode() == null || consume.getJwcode().isEmpty()) {
return Result.error("精网号不能为空");

4
src/main/resources/jindouMapper/BeanConsumeMapper.xml

@ -229,10 +229,10 @@
AND (SELECT fm2.nickname
FROM fx_member fm2
WHERE fm2.jwcode = fyr.source_jwcode
LIMIT 1)=#{beanConsumeArticle.author}
LIMIT 1)LIKE CONCAT('%',#{beanConsumeArticle.author}, '%')
</if>
<if test="beanConsumeArticle.ArticleName != null and beanConsumeArticle.ArticleName != ''">
AND fyr.source_name =#{beanConsumeArticle.articleName}
AND fyr.source_name LIKE CONCAT('%',#{beanConsumeArticle.articleName}, '%')
</if>
<if test="beanConsumeArticle.articleId != null and beanConsumeArticle.articleId != ''">

2
src/main/resources/liveMapper/LiveMapper.xml

@ -61,7 +61,7 @@
</select>
<!--获取直播频道列表-->
<select id="getLiveChannel" resultType="java.lang.String">
select distinct title from live_pindao
select distinct title from live_pindao where title is not null and title != ''
</select>
<!--计算直播消费金豆合计数-->
<select id="selectSumLiveBy" resultType="com.example.demo.domain.vo.bean.BeanConsumeGold">

Loading…
Cancel
Save