分享列表 签到结果改为查询每天的签到结果
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.sqx.modules.invite.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -19,6 +21,7 @@ import com.sqx.modules.invite.entity.InviteAward;
|
||||
import com.sqx.modules.invite.service.InviteAwardService;
|
||||
import com.sqx.modules.invite.service.InviteMoneyService;
|
||||
import com.sqx.modules.invite.service.InviteService;
|
||||
import com.sqx.modules.orders.service.OrdersService;
|
||||
import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import com.sqx.modules.sys.entity.SysUserMoneyDetails;
|
||||
import com.sqx.modules.sys.service.SysUserMoneyDetailsService;
|
||||
@@ -27,6 +30,7 @@ import com.sqx.modules.sys.service.SysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@@ -61,8 +65,9 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
||||
private SysUserService sysUserService;
|
||||
@Autowired
|
||||
private InviteAchievementService inviteAchievementService;
|
||||
@Autowired
|
||||
private UserInfoService userInfoService;
|
||||
@Resource
|
||||
private OrdersService ordersService;
|
||||
|
||||
private final SysUserMoneyDetailsService sysUserMoneyDetailsService;
|
||||
|
||||
public InviteServiceImpl(SysUserMoneyDetailsService sysUserMoneyDetailsService) {
|
||||
@@ -103,15 +108,20 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
||||
List<InviteAchievement> achievementList = inviteAchievementService.list(queryWrapper1);
|
||||
Set<Long> achievementUserIds = achievementList.stream().map(InviteAchievement::getTargetUserId).collect(Collectors.toSet());
|
||||
|
||||
int signCount = Integer.parseInt(commonInfoService.findOne(913).getValue());
|
||||
List<JSONObject> jsonList = new ArrayList<>();
|
||||
DateTime beginOfDay = DateUtil.beginOfDay(new Date());
|
||||
String format = DateUtil.format(beginOfDay, "yyyy-MM-dd HH:mm:ss");
|
||||
for (UserEntity entity : list) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("userId", entity.getUserId());
|
||||
item.put("avatar", entity.getAvatar());
|
||||
item.put("userName", entity.getUserName());
|
||||
item.put("recordNum", achievementUserIds.contains(entity.getUserId()) ? 1 : 0);
|
||||
int userTag = userInfoService.getAuthUserTag(entity.getUserId());
|
||||
item.put("userTag", userTag);
|
||||
// int userTag = userInfoService.getAuthUserTag(entity.getUserId());
|
||||
// item.put("userTag", userTag);
|
||||
int count = ordersService.countOrderNum(entity.getUserId(), format);
|
||||
item.put("userTag", count >= signCount ? 1 : 0);
|
||||
jsonList.add(item);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,16 +5,11 @@
|
||||
|
||||
|
||||
<select id="selectUserPage" resultType="com.sqx.modules.app.entity.UserEntity">
|
||||
-- select u.*,v.is_vip as member,v.end_time as endTime,v.vip_type as vipType,
|
||||
select u.*,1 as member,
|
||||
s.username as sysUserName
|
||||
from tb_user u
|
||||
-- left join user_vip v on v.user_id=u.user_id
|
||||
left join sys_user s on s.qd_code=u.qd_code
|
||||
where s.sys_user_id is null
|
||||
<!-- <if test="vipType!=null">-->
|
||||
<!-- and v.vip_type = #{vipType}-->
|
||||
<!-- </if>-->
|
||||
<if test="search!=null and search!=''">
|
||||
and (u.user_id=#{search} or u.phone = #{search} or u.user_name =#{search} )
|
||||
</if>
|
||||
@@ -33,15 +28,6 @@
|
||||
<if test="sysPhone!=null and sysPhone!=''">
|
||||
and u.sys_phone=#{sysPhone}
|
||||
</if>
|
||||
<!-- <if test="status!=null and status!=0">-->
|
||||
<!-- and u.status=#{status}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="member!=null and member!=-1 and member!=1">-->
|
||||
<!-- and v.is_vip=#{member}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="member!=null and member==1">-->
|
||||
<!-- and (v.is_vip=1 or v.is_vip is null)-->
|
||||
<!-- </if>-->
|
||||
<if test="inviterCode!=null and inviterCode!=''">
|
||||
and u.inviter_code like concat("%",#{inviterCode},"%")
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user