1、查询用户总数,已注册用户,已绑定仪器用户数

2、批量/全量 添加小程序标签
master
382696293@qq.com 2 years ago
parent 1953bad578
commit 28508a9ee1

@ -0,0 +1,118 @@
package com.flossom.common.core.domain.entity;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* wx_user_tag
*
* @author flossom
* @date 2023-12-19
*/
public class WxUserTag extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* id
*/
private Long userId;
/**
*
*/
private String tagName;
/**
* id
*/
private Long tagId;
/**
* 1 2
*/
private Integer type;
/**
* 0 1
*/
private Long status;
public WxUserTag(Long id, Long userId, String tagName, Long tagId, Integer type, Long status) {
this.id = id;
this.userId = userId;
this.tagName = tagName;
this.tagId = tagId;
this.type = type;
this.status = status;
}
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getUserId() {
return userId;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
public String getTagName() {
return tagName;
}
public void setTagId(Long tagId) {
this.tagId = tagId;
}
public Long getTagId() {
return tagId;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getType() {
return type;
}
public void setStatus(Long status) {
this.status = status;
}
public Long getStatus() {
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("tagName", getTagName())
.append("tagId", getTagId())
.append("type", getType())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,10 +1,7 @@
package com.flossom.common.core.domain.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -13,24 +10,22 @@ import java.util.Date;
* @author flossom
* @date 2023-12-08
*/
public class WxUserMemberVm {
public class WxUserMemberVm extends BaseEntity {
/**
*
* (``)
*/
private Long id;
private String id;
/**
*
*/
@Excel(name = "会员昵称")
private String nickname;
/**
*
*/
@Excel(name = "积分")
private Integer creditStart;
/**
@ -41,56 +36,76 @@ public class WxUserMemberVm {
/**
* 0 1
*/
@Excel(name = "用户类型0游客 1会员")
private Integer userType;
/**
*
*/
@Excel(name = "手机")
private String mobile;
/**
* id
*/
@Excel(name = "省id")
private String provinceId;
/**
* id
*/
@Excel(name = "市id")
private String cityId;
/**
* id
*/
@Excel(name = "区id")
private String areaId;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;
/**
*
*/
private Date createTimeStart;
private Date beginTime;
/**
*
*/
private Date createTimeEnd;
private Date endTime;
/**
*
*/
private Integer deviceNumStart;
/**
*
*/
private Integer deviceNumEnd;
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
public WxUserMemberVm() {
}
public WxUserMemberVm(Long id, String nickname, Integer creditStart, Integer creditEnd, Integer userType, String mobile, String provinceId, String cityId, String areaId, Date birthday, Date createTimeStart, Date createTimeEnd) {
public WxUserMemberVm(String id, String nickname, Integer creditStart, Integer creditEnd, Integer userType, String mobile, String provinceId, String cityId, String areaId, Date birthday, Date beginTime, Date endTime) {
this.id = id;
this.nickname = nickname;
this.creditStart = creditStart;
@ -101,15 +116,15 @@ public class WxUserMemberVm {
this.cityId = cityId;
this.areaId = areaId;
this.birthday = birthday;
this.createTimeStart = createTimeStart;
this.createTimeEnd = createTimeEnd;
this.beginTime = beginTime;
this.endTime = endTime;
}
public Long getId() {
public String getId() {
return id;
}
public void setId(Long id) {
public void setId(String id) {
this.id = id;
}
@ -185,19 +200,35 @@ public class WxUserMemberVm {
this.birthday = birthday;
}
public Date getCreateTimeStart() {
return createTimeStart;
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Integer getDeviceNumStart() {
return deviceNumStart;
}
public void setCreateTimeStart(Date createTimeStart) {
this.createTimeStart = createTimeStart;
public void setDeviceNumStart(Integer deviceNumStart) {
this.deviceNumStart = deviceNumStart;
}
public Date getCreateTimeEnd() {
return createTimeEnd;
public Integer getDeviceNumEnd() {
return deviceNumEnd;
}
public void setCreateTimeEnd(Date createTimeEnd) {
this.createTimeEnd = createTimeEnd;
public void setDeviceNumEnd(Integer deviceNumEnd) {
this.deviceNumEnd = deviceNumEnd;
}
}

@ -0,0 +1,26 @@
package com.flossom.common.core.enums;
/**
*
*
* @author flossom
*/
public enum TagTypeStatus {
ENTERPRISE_WECHAT(1, "正常"), MINI_PROGRAM(2, "停用");
private final Integer code;
private final String info;
TagTypeStatus(Integer code, String info) {
this.code = code;
this.info = info;
}
public Integer getCode() {
return code;
}
public String getInfo() {
return info;
}
}

@ -75,4 +75,11 @@ public interface WxUserMemberMapper {
void upgradeMember(@Param("phoneNumber") String phoneNumber, @Param("id") Integer id);
List<WxUserMember> selectWxUserMemberListByVm(WxUserMemberVm wxUserMemberVm);
List<Integer> selectUserCount();
List<Integer> selectWxUserMemberIdList();
}

@ -0,0 +1,67 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxUserTag;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2023-12-19
*/
public interface WxUserTagMapper {
/**
*
*
* @param id
* @return
*/
public WxUserTag selectWxUserTagById(Long id);
/**
*
*
* @param wxUserTag
* @return
*/
public List<WxUserTag> selectWxUserTagList(WxUserTag wxUserTag);
/**
*
*
* @param wxUserTag
* @return
*/
public int insertWxUserTag(WxUserTag wxUserTag);
/**
*
*
* @param wxUserTag
* @return
*/
public int updateWxUserTag(WxUserTag wxUserTag);
/**
*
*
* @param id
* @return
*/
public int deleteWxUserTagById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxUserTagByIds(Long[] ids);
List<Integer> selectWxUserTagByTagId(@Param("tagId") Integer tagId, @Param("type") Integer type);
void insertBatch(@Param("list") List<WxUserTag> list);
}

@ -84,15 +84,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWxUserMemberListByVm" parameterType="WxUserMemberVm" resultMap="WxUserMemberResult">
<include refid="selectWxUserMemberVo"/>
<where>
<if test="id != null" >id = #{id}</if>
<if test="id!=null and id !=''">
and
<foreach collection="id.split(',')" index="index" item="item" open="(" separator="OR"
close=")">
id = #{item}
</foreach>
</if>
<if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
<if test="creditStart != null and creditEnd != null"> and credit &gt;= #{creditStart} and credit &lt;= #{creditEnd}</if>
<if test="userType != null "> and user_type = #{userType}</if>
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
<if test="mobile!=null and mobile !=''">
and
<foreach collection="mobile.split(',')" index="index" item="item" open="(" separator="OR"
close=")">
mobile like concat('%', #{item}, '%')
</foreach>
</if>
<if test="provinceId != null and provinceId != ''"> and province = #{provinceId}</if>
<if test="cityId != null and cityId != ''"> and city = #{cityId}</if>
<if test="areaId != null and areaId != ''"> and area = #{areaId}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="params.beginTime != null and params.beginTime != ''">
and create_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and create_time &lt;= #{params.endTime}
</if>
and status = 0
</where>
</select>
@ -224,4 +242,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTouristUser" parameterType="WxUserMember" useGeneratedKeys="true" keyProperty="id">
INSERT INTO `wx_user_member` (login_time, create_time) VALUES(sysdate(), sysdate());
</insert>
<select id="selectUserCount" resultType="integer">
SELECT count(1) as count FROM `wx_user_member`
union ALL
SELECT count(1) as count FROM `wx_user_member` WHERE mobile is not null
union ALL
SELECT count(1) as count FROM `wx_user_member` WHERE devices_num > 0
</select>
<select id="selectWxUserMemberIdList" resultType="java.lang.Integer">
SELECT id FROM `wx_user_member`
</select>
</mapper>

@ -0,0 +1,115 @@
<?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.flossom.common.core.mapper.WxUserTagMapper">
<resultMap type="WxUserTag" id="WxUserTagResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="tagName" column="tag_name" />
<result property="tagId" column="tag_id" />
<result property="type" column="type" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWxUserTagVo">
select id, user_id, tag_name, tag_id, type, status, create_by, create_time, update_by, update_time from wx_user_tag
</sql>
<select id="selectWxUserTagList" parameterType="WxUserTag" resultMap="WxUserTagResult">
<include refid="selectWxUserTagVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="tagName != null and tagName != ''"> and tag_name like concat('%', #{tagName}, '%')</if>
<if test="tagId != null "> and tag_id = #{tagId}</if>
<if test="type != null "> and type = #{type}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxUserTagById" parameterType="Long" resultMap="WxUserTagResult">
<include refid="selectWxUserTagVo"/>
where id = #{id}
</select>
<select id="selectWxUserTagByTagId" resultType="java.lang.Integer">
SELECT
user_id
FROM
`wx_user_tag`
WHERE
tag_id = #{tagId} AND type = #{type} AND status = 0
</select>
<insert id="insertWxUserTag" parameterType="WxUserTag" useGeneratedKeys="true" keyProperty="id">
insert into wx_user_tag
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="tagName != null">tag_name,</if>
<if test="tagId != null">tag_id,</if>
<if test="type != null">type,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="tagName != null">#{tagName},</if>
<if test="tagId != null">#{tagId},</if>
<if test="type != null">#{type},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="insertBatch" useGeneratedKeys="true" keyProperty="id">
insert into wx_user_tag (user_id, tag_name, tag_id, `type`, create_time)
values
<foreach collection="list" item="userTag" separator="," >
(
#{userTag.userId},
#{userTag.tagName},
#{userTag.tagId},
#{userTag.type},
#{userTag.createTime}
)
</foreach>
</insert>
<update id="updateWxUserTag" parameterType="WxUserTag">
update wx_user_tag
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="tagName != null">tag_name = #{tagName},</if>
<if test="tagId != null">tag_id = #{tagId},</if>
<if test="type != null">type = #{type},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxUserTagById" parameterType="Long">
delete from wx_user_tag where id = #{id}
</delete>
<delete id="deleteWxUserTagByIds" parameterType="String">
delete from wx_user_tag where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -23,7 +23,3 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
logging:
level:
org.springframework.jdbc.core.JdbcTemplate: DEBUG # 这里使用了Spring Boot默认的数据源连接池若使用其他连接池则根据对应的类名进行调整
com.flossom.miniProgram.mapper: TRACE # 将com.example.mapper替换为自定义Mapper接口的全限定名

@ -2,8 +2,10 @@ package com.flossom.system.controller;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
@ -13,16 +15,10 @@ import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.system.service.IWxUserMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
/**
* Controller
@ -97,4 +93,44 @@ public class WxUserMemberController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxUserMemberService.deleteWxUserMemberByIds(ids));
}
/**
*
*/
@GetMapping("/selectUserCount")
public R selectUserCount() {
return R.ok(wxUserMemberService.selectUserCount());
}
/**
*
*/
@PostMapping("/batchAddMiniProgramTag")
public R batchAddMiniProgramTag(@RequestParam("tagIdList") List<Integer> tagIdList,
@RequestParam(value = "userIdList") List<Integer> userIdList) {
if (tagIdList == null || tagIdList.size() == 0) {
logger.error("参数有误");
throw new ServiceException("参数有误");
}
wxUserMemberService.batchAddMiniProgramTag(tagIdList, userIdList);
return R.ok();
}
/**
*
*/
@PostMapping("/allAddMiniProgramTag")
public R allAddMiniProgramTag(@RequestParam("tagIdList") List<Integer> tagIdList, WxUserMemberVm wxUserMemberVm) {
if (tagIdList == null || tagIdList.size() == 0) {
logger.error("参数有误");
throw new ServiceException("参数有误");
}
List<WxUserMember> list = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
if (list != null && list.size() > 0) {
List<Integer> collect = list.stream().map(wxUserMember -> wxUserMember.getId().intValue()).collect(Collectors.toList());
wxUserMemberService.batchAddMiniProgramTag(tagIdList, collect);
}
return R.ok();
}
}

@ -69,4 +69,8 @@ public interface IWxUserMemberService
* @return
*/
public int deleteWxUserMemberById(Long id);
List<Integer> selectUserCount();
void batchAddMiniProgramTag(List<Integer> tagId, List<Integer> userIds);
}

@ -0,0 +1,61 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.WxUserTag;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2023-12-19
*/
public interface IWxUserTagService {
/**
*
*
* @param id
* @return
*/
public WxUserTag selectWxUserTagById(Long id);
/**
*
*
* @param wxUserTag
* @return
*/
public List<WxUserTag> selectWxUserTagList(WxUserTag wxUserTag);
/**
*
*
* @param wxUserTag
* @return
*/
public int insertWxUserTag(WxUserTag wxUserTag);
/**
*
*
* @param wxUserTag
* @return
*/
public int updateWxUserTag(WxUserTag wxUserTag);
/**
*
*
* @param ids
* @return
*/
public int deleteWxUserTagByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWxUserTagById(Long id);
}

@ -1,10 +1,17 @@
package com.flossom.system.service.impl;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.entity.WxUserTag;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.enums.TagTypeStatus;
import com.flossom.common.core.mapper.SysTagMapper;
import com.flossom.common.core.mapper.WxUserMemberMapper;
import com.flossom.common.core.mapper.WxUserTagMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -17,11 +24,16 @@ import com.flossom.system.service.IWxUserMemberService;
* @date 2023-12-08
*/
@Service
public class WxUserMemberServiceImpl implements IWxUserMemberService
{
public class WxUserMemberServiceImpl implements IWxUserMemberService {
@Autowired
private WxUserMemberMapper wxUserMemberMapper;
@Autowired
private WxUserTagMapper wxUserTagMapper;
@Autowired
private SysTagMapper sysTagMapper;
/**
*
*
@ -29,8 +41,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService
* @return
*/
@Override
public WxUserMember selectWxUserMemberById(Long id)
{
public WxUserMember selectWxUserMemberById(Long id) {
return wxUserMemberMapper.selectWxUserMemberById(id);
}
@ -41,8 +52,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService
* @return
*/
@Override
public List<WxUserMember> selectWxUserMemberList(WxUserMember wxUserMember)
{
public List<WxUserMember> selectWxUserMemberList(WxUserMember wxUserMember) {
return wxUserMemberMapper.selectWxUserMemberList(wxUserMember);
}
@ -53,8 +63,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService
* @return
*/
@Override
public List<WxUserMember> selectWxUserMemberList(WxUserMemberVm wxUserMemberVm)
{
public List<WxUserMember> selectWxUserMemberList(WxUserMemberVm wxUserMemberVm) {
return wxUserMemberMapper.selectWxUserMemberListByVm(wxUserMemberVm);
}
@ -65,8 +74,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService
* @return
*/
@Override
public int insertWxUserMember(WxUserMember wxUserMember)
{
public int insertWxUserMember(WxUserMember wxUserMember) {
wxUserMember.setCreateTime(DateUtils.getNowDate());
return wxUserMemberMapper.insertWxUserMember(wxUserMember);
}
@ -78,8 +86,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService
* @return
*/
@Override
public int updateWxUserMember(WxUserMember wxUserMember)
{
public int updateWxUserMember(WxUserMember wxUserMember) {
wxUserMember.setUpdateTime(DateUtils.getNowDate());
return wxUserMemberMapper.updateWxUserMember(wxUserMember);
}
@ -91,8 +98,7 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService
* @return
*/
@Override
public int deleteWxUserMemberByIds(Long[] ids)
{
public int deleteWxUserMemberByIds(Long[] ids) {
return wxUserMemberMapper.deleteWxUserMemberByIds(ids);
}
@ -103,8 +109,48 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService
* @return
*/
@Override
public int deleteWxUserMemberById(Long id)
{
public int deleteWxUserMemberById(Long id) {
return wxUserMemberMapper.deleteWxUserMemberById(id);
}
@Override
public List<Integer> selectUserCount() {
return wxUserMemberMapper.selectUserCount();
}
@Override
public void batchAddMiniProgramTag(List<Integer> tagIdList, List<Integer> userIds) {
if (tagIdList != null && tagIdList.size() > 0) {
// 对单个标签操作
for (Integer tagId : tagIdList) {
SysTag sysTag = sysTagMapper.selectDeptById(tagId.longValue());
if (sysTag != null) {
List<Integer> needAddIdList = new ArrayList<>();
// 1、查询该标签下有那些用户关联
List<Integer> existedUserList = wxUserTagMapper.selectWxUserTagByTagId(tagId, TagTypeStatus.MINI_PROGRAM.getCode());
if (existedUserList != null && existedUserList.size() > 0) {
Iterator<Integer> iterator = userIds.iterator();
while (iterator.hasNext()) {
Integer element = iterator.next();
if (!existedUserList.contains(element)) {
needAddIdList.add(element);
}
}
}
// 2、添加用户与标签的关联
List<WxUserTag> list = new ArrayList<>();
WxUserTag wxUserTag;
if (needAddIdList != null && needAddIdList.size() > 0) {
for (Integer userId : needAddIdList) {
wxUserTag = new WxUserTag(null, userId.longValue(), sysTag.getTagName(), tagId.longValue(), TagTypeStatus.MINI_PROGRAM.getCode(), null);
wxUserTag.setCreateTime(DateUtils.getNowDate());
list.add(wxUserTag);
}
wxUserTagMapper.insertBatch(list);
}
}
}
}
}
}

@ -0,0 +1,90 @@
package com.flossom.system.service.impl;
import java.util.List;
import com.flossom.common.core.domain.entity.WxUserTag;
import com.flossom.common.core.mapper.WxUserTagMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxUserTagService;
/**
* Service
*
* @author flossom
* @date 2023-12-19
*/
@Service
public class WxUserTagServiceImpl implements IWxUserTagService {
@Autowired
private WxUserTagMapper wxUserTagMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WxUserTag selectWxUserTagById(Long id) {
return wxUserTagMapper.selectWxUserTagById(id);
}
/**
*
*
* @param wxUserTag
* @return
*/
@Override
public List<WxUserTag> selectWxUserTagList(WxUserTag wxUserTag) {
return wxUserTagMapper.selectWxUserTagList(wxUserTag);
}
/**
*
*
* @param wxUserTag
* @return
*/
@Override
public int insertWxUserTag(WxUserTag wxUserTag) {
wxUserTag.setCreateTime(DateUtils.getNowDate());
return wxUserTagMapper.insertWxUserTag(wxUserTag);
}
/**
*
*
* @param wxUserTag
* @return
*/
@Override
public int updateWxUserTag(WxUserTag wxUserTag) {
wxUserTag.setUpdateTime(DateUtils.getNowDate());
return wxUserTagMapper.updateWxUserTag(wxUserTag);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWxUserTagByIds(Long[] ids) {
return wxUserTagMapper.deleteWxUserTagByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWxUserTagById(Long id) {
return wxUserTagMapper.deleteWxUserTagById(id);
}
}

@ -1,11 +1,11 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="用户类型" prop="userType">
<el-select v-model="queryParams.userType" @keyup.enter.native="handleQuery">
<el-option label="全部" value=""></el-option>
<el-option label="会员" value="0"></el-option>
<el-option label="游客" value="1"></el-option>
<el-select v-model="queryParams.userType" @keyup.enter.native="handleQuery" style="width: 50%">
<el-option label="全部"></el-option>
<el-option label="会员" :value="1"></el-option>
<el-option label="游客" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="会员昵称" prop="nickname">
@ -61,7 +61,7 @@
</el-form-item>
<el-form-item label="用户注册时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
v-model="dateRange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
@ -70,12 +70,9 @@
</el-date-picker>
</el-form-item>
<el-form-item label="积分范围" prop="credit">
<el-input
v-model="queryParams.credit"
placeholder="请输入积分"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input-number v-model="queryParams.creditStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.creditEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -309,6 +306,8 @@ export default {
title: "",
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
@ -316,7 +315,8 @@ export default {
nickname: null,
headimg: null,
username: null,
credit: null,
creditStart: undefined,
creditEnd: undefined,
openid: null,
unionid: null,
userType: null,
@ -340,7 +340,7 @@ export default {
collagenMount: null,
loginTime: null,
status: null,
createTime: null,
// createTime: [],
},
//
form: {},
@ -356,7 +356,7 @@ export default {
/** 查询用户列表 */
getList() {
this.loading = true;
listMember(this.queryParams).then(response => {
listMember(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.memberList = response.rows;
this.total = response.total;
this.loading = false;
@ -410,6 +410,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},

Loading…
Cancel
Save