Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104

master
elliott 2 years ago
commit b9a24b9a3a

@ -0,0 +1,85 @@
package com.flossom.common.core.domain.entity;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* wx_user_remark
*
* @author flossom
* @date 2023-12-21
*/
public class WxUserRemark extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* id
*/
@Excel(name = "微信用户id")
private Long userId;
/**
*
*/
@Excel(name = "备注内容")
private String content;
/**
* 0 1
*/
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Integer 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 setContent(String content) {
this.content = content;
}
public String getContent() {
return content;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getStatus() {
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("content", getContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,262 @@
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_script_log
*
* @author flossom
* @date 2023-12-20
*/
public class WxUserScriptLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
*
*/
private Long wxUserId;
/**
* 01
*/
private Integer isRead;
/**
* 01
*/
private Integer isCustom;
/**
* is_custom = 0
*/
private Integer scriptTemplateId;
/**
*
*/
private String scriptName;
/**
*
*/
private String titile;
/**
*
*/
private String content;
/**
* 1 2
*/
private Integer tagType;
/**
* 013456
*/
private Integer type;
/**
*
*/
private String link;
/**
*
*/
private String linkParams;
/**
* appid
*/
private String redirectAppid;
/**
* url
*/
private String redirectUrl;
/**
*
*/
private String videoNo;
/**
* feedId
*/
private String feedId;
/**
* (xxx,xxx,xxx)
*/
private String tagNames;
/**
* ID(xxxx,xxxx,xxx)
*/
private String tagIds;
/**
* 0 1
*/
private Integer status;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getWxUserId() {
return wxUserId;
}
public void setWxUserId(Long wxUserId) {
this.wxUserId = wxUserId;
}
public Integer getIsRead() {
return isRead;
}
public void setIsRead(Integer isRead) {
this.isRead = isRead;
}
public Integer getIsCustom() {
return isCustom;
}
public void setIsCustom(Integer isCustom) {
this.isCustom = isCustom;
}
public Integer getScriptTemplateId() {
return scriptTemplateId;
}
public void setScriptTemplateId(Integer scriptTemplateId) {
this.scriptTemplateId = scriptTemplateId;
}
public String getScriptName() {
return scriptName;
}
public void setScriptName(String scriptName) {
this.scriptName = scriptName;
}
public String getTitile() {
return titile;
}
public void setTitile(String titile) {
this.titile = titile;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getTagType() {
return tagType;
}
public void setTagType(Integer tagType) {
this.tagType = tagType;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getLinkParams() {
return linkParams;
}
public void setLinkParams(String linkParams) {
this.linkParams = linkParams;
}
public String getRedirectAppid() {
return redirectAppid;
}
public void setRedirectAppid(String redirectAppid) {
this.redirectAppid = redirectAppid;
}
public String getRedirectUrl() {
return redirectUrl;
}
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
public String getVideoNo() {
return videoNo;
}
public void setVideoNo(String videoNo) {
this.videoNo = videoNo;
}
public String getFeedId() {
return feedId;
}
public void setFeedId(String feedId) {
this.feedId = feedId;
}
public String getTagNames() {
return tagNames;
}
public void setTagNames(String tagNames) {
this.tagNames = tagNames;
}
public String getTagIds() {
return tagIds;
}
public void setTagIds(String tagIds) {
this.tagIds = tagIds;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

@ -34,7 +34,7 @@ public class WxUserTag extends BaseEntity {
private Long tagId;
/**
* 1 2
* 1 2
*/
private Integer type;

@ -0,0 +1,53 @@
package com.flossom.common.core.domain.req;
import com.flossom.common.core.web.domain.BaseEntity;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* wx_user_remark
*
* @author flossom
* @date 2023-12-21
*/
public class WxUserRemarkReq {
/**
* id
*/
private List<Long> userIdList;
/**
*
*/
@NotBlank(message = "请输入备注")
@Length(min = 0, max = 100, message = "备注内容不能为空")
private String content;
public WxUserRemarkReq() {
}
public WxUserRemarkReq(List<Long> userIdList, String content) {
this.userIdList = userIdList;
this.content = content;
}
public List<Long> getUserIdList() {
return userIdList;
}
public void setUserIdList(List<Long> userIdList) {
this.userIdList = userIdList;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}

@ -0,0 +1,234 @@
package com.flossom.common.core.domain.req;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
*
*
* @author flossom
* @date 2023-12-20
*/
public class WxUserScriptReq {
/**
* id
*/
@NotNull(message = "用户列表不能为空")
List<Long> userIdList;
/**
* 01
*/
@NotNull(message = "请选择是否自定义话术")
@Range(min = 0, max = 1)
private Integer isCustom;
/**
* is_custom = 0
*/
private Integer scriptTemplateId;
/**
*
*/
private String scriptName;
/**
*
*/
private String titile;
/**
*
*/
private String content;
/**
* 1 2
*/
private Integer tagType;
/**
* 013456
*/
@NotNull(message = "请选择跳转类型")
@Range(min = 0, max = 6)
private Integer type;
/**
*
*/
private String link;
/**
*
*/
private String linkParams;
/**
* appid
*/
private String redirectAppid;
/**
* url
*/
private String redirectUrl;
/**
*
*/
private String videoNo;
/**
* feedId
*/
private String feedId;
/**
* (xxx,xxx,xxx)
*/
private String tagNames;
/**
* ID(xxxx,xxxx,xxx)
*/
private String tagIds;
public List<Long> getUserIdList() {
return userIdList;
}
public void setUserIdList(List<Long> userIdList) {
this.userIdList = userIdList;
}
public Integer getIsCustom() {
return isCustom;
}
public void setIsCustom(Integer isCustom) {
this.isCustom = isCustom;
}
public Integer getScriptTemplateId() {
return scriptTemplateId;
}
public void setScriptTemplateId(Integer scriptTemplateId) {
this.scriptTemplateId = scriptTemplateId;
}
public String getScriptName() {
return scriptName;
}
public void setScriptName(String scriptName) {
this.scriptName = scriptName;
}
public String getTitile() {
return titile;
}
public void setTitile(String titile) {
this.titile = titile;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getTagType() {
return tagType;
}
public void setTagType(Integer tagType) {
this.tagType = tagType;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getLinkParams() {
return linkParams;
}
public void setLinkParams(String linkParams) {
this.linkParams = linkParams;
}
public String getRedirectAppid() {
return redirectAppid;
}
public void setRedirectAppid(String redirectAppid) {
this.redirectAppid = redirectAppid;
}
public String getRedirectUrl() {
return redirectUrl;
}
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
public String getVideoNo() {
return videoNo;
}
public void setVideoNo(String videoNo) {
this.videoNo = videoNo;
}
public String getFeedId() {
return feedId;
}
public void setFeedId(String feedId) {
this.feedId = feedId;
}
public String getTagNames() {
return tagNames;
}
public void setTagNames(String tagNames) {
this.tagNames = tagNames;
}
public String getTagIds() {
return tagIds;
}
public void setTagIds(String tagIds) {
this.tagIds = tagIds;
}
}

@ -7,18 +7,18 @@ package com.flossom.common.core.enums;
*/
public enum Status
{
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
OK(0, "正常"), DISABLE(1, "停用"), DELETED(2, "删除");
private final String code;
private final Integer code;
private final String info;
Status(String code, String info)
Status(Integer code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
public Integer getCode()
{
return code;
}

@ -6,7 +6,7 @@ package com.flossom.common.core.enums;
* @author flossom
*/
public enum TagTypeStatus {
ENTERPRISE_WECHAT(1, "正常"), MINI_PROGRAM(2, "停用");
MINI_PROGRAM(1, "小程序标签"), ENTERPRISE_WECHAT(2, "企业微信标签");
private final Integer code;
private final String info;

@ -115,4 +115,6 @@ public interface SysTagMapper {
* @return
*/
public int deleteDeptById(Long id);
List<SysTag> selectSecondTagByType(@Param("type") Integer type);
}

@ -124,4 +124,6 @@ public interface SysUserMapper {
* @return
*/
public SysUser checkEmailUnique(String email);
int deleteWxUserById(Long userId);
}

@ -62,4 +62,6 @@ public interface WxNoRemindRecordMapper {
public int deleteWxNoRemindRecordByIds(Long[] ids);
int selectWxNoRemindRecordByOpenid(@Param("openid") String openid);
void deleteWxNoRemindRecordByOpenid(@Param("openid") String openid);
}

@ -62,4 +62,6 @@ public interface WxUserIntegralLogMapper
public int deleteWxUserIntegralLogByIds(Long[] ids);
List<WxUserIntegralLog> obtainUserIntegral(@Param("userId") Long userId);
void deleteWxUserIntegralLogByUserId(@Param("userId") Long userId);
}

@ -0,0 +1,64 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxUserRemark;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2023-12-21
*/
public interface WxUserRemarkMapper {
/**
*
*
* @param id
* @return
*/
public WxUserRemark selectWxUserRemarkById(Long id);
/**
*
*
* @param wxUserRemark
* @return
*/
public List<WxUserRemark> selectWxUserRemarkList(WxUserRemark wxUserRemark);
/**
*
*
* @param wxUserRemark
* @return
*/
public int insertWxUserRemark(WxUserRemark wxUserRemark);
/**
*
*
* @param wxUserRemark
* @return
*/
public int updateWxUserRemark(WxUserRemark wxUserRemark);
/**
*
*
* @param id
* @return
*/
public int deleteWxUserRemarkById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxUserRemarkByIds(Long[] ids);
void deleteWxUserRemarkByUserId(@Param("userId") Long userId);
}

@ -0,0 +1,65 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2023-12-20
*/
public interface WxUserScriptLogMapper {
/**
*
*
* @param id
* @return
*/
public WxUserScriptLog selectWxUserScriptLogById(Long id);
/**
*
*
* @param wxUserScriptLog
* @return
*/
public List<WxUserScriptLog> selectWxUserScriptLogList(WxUserScriptLog wxUserScriptLog);
/**
*
*
* @param wxUserScriptLog
* @return
*/
public int insertWxUserScriptLog(WxUserScriptLog wxUserScriptLog);
/**
*
*
* @param wxUserScriptLog
* @return
*/
public int updateWxUserScriptLog(WxUserScriptLog wxUserScriptLog);
/**
*
*
* @param id
* @return
*/
public int deleteWxUserScriptLogById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxUserScriptLogByIds(Long[] ids);
void deleteWxUserScriptLogByWxUserId(@Param("userId") Long userId);
}

@ -66,4 +66,6 @@ public interface WxUserTagMapper {
void insertBatch(@Param("list") List<WxUserTag> list);
void deleteBatch(@Param("tagIdList") List<Integer> tagIdList, @Param("userIdList") List<Integer> userIdList);
void deleteWxUserTagByUserId(@Param("userId") Long userId);
}

@ -89,6 +89,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where tag_name=#{tagName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<select id="selectSecondTagByType" resultMap="SysTagResult">
<include refid="selectDeptVo"/>
WHERE
type = #{type}
AND parent_id != 0
AND del_flag = 0
ORDER BY order_num asc
</select>
<insert id="insertDept" parameterType="SysTag">
insert into sys_tag(
<if test="id != null and id != 0">id,</if>

@ -218,4 +218,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<delete id="deleteWxUserById" parameterType="Long">
delete from sys_user where user_id = #{userId}
</delete>
</mapper>

@ -72,4 +72,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteWxNoRemindRecordByOpenid" parameterType="String">
delete from wx_no_remind_record where openid = #{openid}
</delete>
</mapper>

@ -99,4 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteWxUserIntegralLogByUserId" parameterType="Long">
delete from wx_user_integral_log where user_id = #{userId}
</delete>
</mapper>

@ -0,0 +1,86 @@
<?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.WxUserRemarkMapper">
<resultMap type="WxUserRemark" id="WxUserRemarkResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="content" column="content" />
<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="selectWxUserRemarkVo">
select id, user_id, content, status, create_by, create_time, update_by, update_time from wx_user_remark
</sql>
<select id="selectWxUserRemarkList" parameterType="WxUserRemark" resultMap="WxUserRemarkResult">
<include refid="selectWxUserRemarkVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxUserRemarkById" parameterType="Long" resultMap="WxUserRemarkResult">
<include refid="selectWxUserRemarkVo"/>
where id = #{id}
</select>
<insert id="insertWxUserRemark" parameterType="WxUserRemark" useGeneratedKeys="true" keyProperty="id">
insert into wx_user_remark
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="content != ''">content,</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="content != ''">#{content},</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>
<update id="updateWxUserRemark" parameterType="WxUserRemark">
update wx_user_remark
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="content != null">content = #{content},</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="deleteWxUserRemarkById" parameterType="Long">
delete from wx_user_remark where id = #{id}
</delete>
<delete id="deleteWxUserRemarkByIds" parameterType="String">
delete from wx_user_remark where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteWxUserRemarkByUserId" parameterType="Long">
delete from wx_user_remark where user_id = #{userId}
</delete>
</mapper>

@ -0,0 +1,152 @@
<?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.WxUserScriptLogMapper">
<resultMap type="WxUserScriptLog" id="WxUserScriptLogResult">
<result property="id" column="id" />
<result property="wxUserId" column="wx_user_id" />
<result property="isRead" column="is_read" />
<result property="isCustom" column="is_custom" />
<result property="scriptTemplateId" column="script_template_id" />
<result property="scriptName" column="script_name" />
<result property="titile" column="titile" />
<result property="content" column="content" />
<result property="tagType" column="tag_type" />
<result property="type" column="type" />
<result property="link" column="link" />
<result property="linkParams" column="link_params" />
<result property="redirectAppid" column="redirect_appid" />
<result property="redirectUrl" column="redirect_url" />
<result property="videoNo" column="video_no" />
<result property="feedId" column="feed_id" />
<result property="tagNames" column="tag_names" />
<result property="tagIds" column="tag_ids" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectWxUserScriptLogVo">
select id, wx_user_id, is_read, is_custom, script_template_id, script_name, titile, content, tag_type, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, tag_names, tag_ids, status, create_by, create_time from wx_user_script_log
</sql>
<select id="selectWxUserScriptLogList" parameterType="WxUserScriptLog" resultMap="WxUserScriptLogResult">
<include refid="selectWxUserScriptLogVo"/>
<where>
<if test="wxUserId != null "> and wx_user_id = #{wxUserId}</if>
<if test="isRead != null "> and is_read = #{isRead}</if>
<if test="isCustom != null "> and is_custom = #{isCustom}</if>
<if test="scriptTemplateId != null "> and script_template_id = #{scriptTemplateId}</if>
<if test="scriptName != null and scriptName != ''"> and script_name like concat('%', #{scriptName}, '%')</if>
<if test="titile != null and titile != ''"> and titile = #{titile}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="tagType != null "> and tag_type = #{tagType}</if>
<if test="type != null "> and type = #{type}</if>
<if test="link != null and link != ''"> and link = #{link}</if>
<if test="linkParams != null and linkParams != ''"> and link_params = #{linkParams}</if>
<if test="redirectAppid != null and redirectAppid != ''"> and redirect_appid = #{redirectAppid}</if>
<if test="redirectUrl != null and redirectUrl != ''"> and redirect_url = #{redirectUrl}</if>
<if test="videoNo != null and videoNo != ''"> and video_no = #{videoNo}</if>
<if test="feedId != null and feedId != ''"> and feed_id = #{feedId}</if>
<if test="tagNames != null and tagNames != ''"> and tag_names = #{tagNames}</if>
<if test="tagIds != null and tagIds != ''"> and tag_ids = #{tagIds}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxUserScriptLogById" parameterType="Long" resultMap="WxUserScriptLogResult">
<include refid="selectWxUserScriptLogVo"/>
where id = #{id}
</select>
<insert id="insertWxUserScriptLog" parameterType="WxUserScriptLog" useGeneratedKeys="true" keyProperty="id">
insert into wx_user_script_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="wxUserId != null">wx_user_id,</if>
<if test="isRead != null">is_read,</if>
<if test="isCustom != null">is_custom,</if>
<if test="scriptTemplateId != null">script_template_id,</if>
<if test="scriptName != null">script_name,</if>
<if test="titile != null">titile,</if>
<if test="content != null">content,</if>
<if test="tagType != null">tag_type,</if>
<if test="type != null">type,</if>
<if test="link != null">link,</if>
<if test="linkParams != null">link_params,</if>
<if test="redirectAppid != null">redirect_appid,</if>
<if test="redirectUrl != null">redirect_url,</if>
<if test="videoNo != null">video_no,</if>
<if test="feedId != null">feed_id,</if>
<if test="tagNames != null">tag_names,</if>
<if test="tagIds != null">tag_ids,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wxUserId != null">#{wxUserId},</if>
<if test="isRead != null">#{isRead},</if>
<if test="isCustom != null">#{isCustom},</if>
<if test="scriptTemplateId != null">#{scriptTemplateId},</if>
<if test="scriptName != null">#{scriptName},</if>
<if test="titile != null">#{titile},</if>
<if test="content != null">#{content},</if>
<if test="tagType != null">#{tagType},</if>
<if test="type != null">#{type},</if>
<if test="link != null">#{link},</if>
<if test="linkParams != null">#{linkParams},</if>
<if test="redirectAppid != null">#{redirectAppid},</if>
<if test="redirectUrl != null">#{redirectUrl},</if>
<if test="videoNo != null">#{videoNo},</if>
<if test="feedId != null">#{feedId},</if>
<if test="tagNames != null">#{tagNames},</if>
<if test="tagIds != null">#{tagIds},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateWxUserScriptLog" parameterType="WxUserScriptLog">
update wx_user_script_log
<trim prefix="SET" suffixOverrides=",">
<if test="wxUserId != null">wx_user_id = #{wxUserId},</if>
<if test="isRead != null">is_read = #{isRead},</if>
<if test="isCustom != null">is_custom = #{isCustom},</if>
<if test="scriptTemplateId != null">script_template_id = #{scriptTemplateId},</if>
<if test="scriptName != null">script_name = #{scriptName},</if>
<if test="titile != null">titile = #{titile},</if>
<if test="content != null">content = #{content},</if>
<if test="tagType != null">tag_type = #{tagType},</if>
<if test="type != null">type = #{type},</if>
<if test="link != null">link = #{link},</if>
<if test="linkParams != null">link_params = #{linkParams},</if>
<if test="redirectAppid != null">redirect_appid = #{redirectAppid},</if>
<if test="redirectUrl != null">redirect_url = #{redirectUrl},</if>
<if test="videoNo != null">video_no = #{videoNo},</if>
<if test="feedId != null">feed_id = #{feedId},</if>
<if test="tagNames != null">tag_names = #{tagNames},</if>
<if test="tagIds != null">tag_ids = #{tagIds},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxUserScriptLogById" parameterType="Long">
delete from wx_user_script_log where id = #{id}
</delete>
<delete id="deleteWxUserScriptLogByIds" parameterType="String">
delete from wx_user_script_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteWxUserScriptLogByWxUserId" parameterType="Long">
delete from wx_user_script_log where wx_user_id = #{userId}
</delete>
</mapper>

@ -127,4 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{userId}
</foreach>
</delete>
<delete id="deleteWxUserTagByUserId">
delete from wx_user_tag where user_id = #{userId}
</delete>
</mapper>

@ -4,6 +4,7 @@ import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
@ -103,4 +104,13 @@ public class ActivityChannelInfoController extends BaseController
{
return toAjax(activityChannelInfoService.deleteActivityChannelInfoByIds(ids));
}
/**
*
* @return
*/
@GetMapping("/getPurchaseChannel")
public R getPurchaseChannel() {
return R.ok(activityChannelInfoService.getPurchaseChannel());
}
}

@ -1,6 +1,7 @@
package com.flossom.system.controller;
import com.flossom.common.core.constant.UserConstants;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.SysDept;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.utils.StringUtils;
@ -26,8 +27,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/tagInfo")
public class SysTagController extends BaseController
{
public class SysTagController extends BaseController {
@Autowired
private ISysTagService tagService;
@ -36,8 +36,7 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:dept:list")
@GetMapping("/list")
public AjaxResult list(SysTag sysTag)
{
public AjaxResult list(SysTag sysTag) {
List<SysTag> tags = tagService.selectDeptList(sysTag);
return success(tags);
}
@ -47,8 +46,7 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:tagInfo:list")
@GetMapping("/list/exclude/{id}")
public AjaxResult excludeChild(@PathVariable(value = "id", required = false) Long id)
{
public AjaxResult excludeChild(@PathVariable(value = "id", required = false) Long id) {
List<SysTag> tags = tagService.selectDeptList(new SysTag());
tags.removeIf(d -> d.getId().intValue() == id || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), id + ""));
return success(tags);
@ -59,8 +57,7 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:tagInfo:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable Long id)
{
public AjaxResult getInfo(@PathVariable Long id) {
tagService.checkDeptDataScope(id);
return success(tagService.selectDeptById(id));
}
@ -71,10 +68,8 @@ public class SysTagController extends BaseController
@RequiresPermissions("system:tagInfo:add")
@Log(title = "标签管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysTag tag)
{
if (!tagService.checkDeptNameUnique(tag))
{
public AjaxResult add(@Validated @RequestBody SysTag tag) {
if (!tagService.checkDeptNameUnique(tag)) {
return error("新增标签'" + tag.getTagName() + "'失败,标签名称已存在");
}
tag.setCreateBy(SecurityUtils.getUsername());
@ -87,20 +82,14 @@ public class SysTagController extends BaseController
@RequiresPermissions("system:tagInfo:edit")
@Log(title = "标签管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysTag tag)
{
public AjaxResult edit(@Validated @RequestBody SysTag tag) {
Long id = tag.getId();
tagService.checkDeptDataScope(id);
if (!tagService.checkDeptNameUnique(tag))
{
if (!tagService.checkDeptNameUnique(tag)) {
return error("修改标签'" + tag.getTagName() + "'失败,标签名称已存在");
}
else if (tag.getParentId().equals(id))
{
} else if (tag.getParentId().equals(id)) {
return error("修改标签'" + tag.getTagName() + "'失败,上级标签不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, tag.getStatus()) && tagService.selectNormalChildrenDeptById(id) > 0)
{
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, tag.getStatus()) && tagService.selectNormalChildrenDeptById(id) > 0) {
return error("该标签包含未停用的子标签!");
}
tag.setUpdateBy(SecurityUtils.getUsername());
@ -113,10 +102,8 @@ public class SysTagController extends BaseController
@RequiresPermissions("system:dept:remove")
@Log(title = "标签管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id)
{
if (tagService.hasChildByDeptId(id))
{
public AjaxResult remove(@PathVariable Long id) {
if (tagService.hasChildByDeptId(id)) {
return warn("存在下级标签,不允许删除");
}
// if (tagService.checkDeptExistUser(id))
@ -133,8 +120,27 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:user:list")
@GetMapping("/tagTree")
public AjaxResult tagTree(SysTag tag)
{
public AjaxResult tagTree(SysTag tag) {
return success(tagService.selectTagTreeList(tag));
}
/**
*
*
* @return
*/
@GetMapping("/getMiniProgramTags")
public R getMiniProgramTags() {
return R.ok(tagService.getMiniProgramTags());
}
/**
*
*
* @return
*/
@GetMapping("/getWecomTags")
public R getWecomTags() {
return R.ok(tagService.getWecomTags());
}
}

@ -91,7 +91,7 @@ public class WxUserMemberController extends BaseController {
/**
*
*/
@RequiresPermissions("system:member:remove")
// @RequiresPermissions("system:member:remove")
@Log(title = "用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {

@ -0,0 +1,107 @@
package com.flossom.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserRemark;
import com.flossom.common.core.domain.req.WxUserIntegralVm;
import com.flossom.common.core.domain.req.WxUserRemarkReq;
import com.flossom.common.core.enums.IntegralChangeTypeEnum;
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;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.flossom.system.service.IWxUserRemarkService;
/**
* Controller
*
* @author flossom
* @date 2023-12-21
*/
@RestController
@RequestMapping("/wxUserRemark")
public class WxUserRemarkController extends BaseController {
@Autowired
private IWxUserRemarkService wxUserRemarkService;
/**
*
*/
@RequiresPermissions("system:wxUserRemark:list")
@GetMapping("/list")
public TableDataInfo list(WxUserRemark wxUserRemark) {
startPage();
List<WxUserRemark> list = wxUserRemarkService.selectWxUserRemarkList(wxUserRemark);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:wxUserRemark:export")
@Log(title = "微信用户备注列", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WxUserRemark wxUserRemark) {
List<WxUserRemark> list = wxUserRemarkService.selectWxUserRemarkList(wxUserRemark);
ExcelUtil<WxUserRemark> util = new ExcelUtil<WxUserRemark>(WxUserRemark.class);
util.exportExcel(response, list, "微信用户备注列数据");
}
/**
*
*/
@RequiresPermissions("system:wxUserRemark:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(wxUserRemarkService.selectWxUserRemarkById(id));
}
/**
*
*/
@RequiresPermissions("system:wxUserRemark:add")
@Log(title = "微信用户备注列", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WxUserRemark wxUserRemark) {
return toAjax(wxUserRemarkService.insertWxUserRemark(wxUserRemark));
}
/**
*
*/
@RequiresPermissions("system:wxUserRemark:edit")
@Log(title = "微信用户备注列", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WxUserRemark wxUserRemark) {
return toAjax(wxUserRemarkService.updateWxUserRemark(wxUserRemark));
}
/**
*
*/
@RequiresPermissions("system:wxUserRemark:remove")
@Log(title = "微信用户备注列", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxUserRemarkService.deleteWxUserRemarkByIds(ids));
}
/**
*
*/
@PostMapping("/batchAddRemark")
public R batchAddRemark(@RequestBody @Validated WxUserRemarkReq wxUserRemarkReq) {
wxUserRemarkService.batchAddRemark(wxUserRemarkReq);
return R.ok();
}
}

@ -0,0 +1,164 @@
package com.flossom.system.controller;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import com.flossom.common.core.domain.req.WxUserScriptReq;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.utils.StringUtils;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.flossom.system.service.IWxUserScriptLogService;
import java.util.List;
/**
* Controller
*
* @author flossom
* @date 2023-12-20
*/
@RestController
@RequestMapping("/userScriptLog")
public class WxUserScriptLogController extends BaseController {
@Autowired
private IWxUserScriptLogService wxUserScriptLogService;
/**
*
*/
@RequiresPermissions("system:user_script_log:list")
@GetMapping("/list")
public TableDataInfo list(WxUserScriptLog wxUserScriptLog) {
startPage();
List<WxUserScriptLog> list = wxUserScriptLogService.selectWxUserScriptLogList(wxUserScriptLog);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:user_script_log:export")
@Log(title = "发送话术记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WxUserScriptLog wxUserScriptLog) {
List<WxUserScriptLog> list = wxUserScriptLogService.selectWxUserScriptLogList(wxUserScriptLog);
ExcelUtil<WxUserScriptLog> util = new ExcelUtil<WxUserScriptLog>(WxUserScriptLog.class);
util.exportExcel(response, list, "发送话术记录数据");
}
/**
*
*/
@RequiresPermissions("system:user_script_log:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(wxUserScriptLogService.selectWxUserScriptLogById(id));
}
/**
*
*/
@RequiresPermissions("system:user_script_log:add")
@Log(title = "发送话术记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WxUserScriptLog wxUserScriptLog) {
return toAjax(wxUserScriptLogService.insertWxUserScriptLog(wxUserScriptLog));
}
/**
*
*/
@RequiresPermissions("system:user_script_log:edit")
@Log(title = "发送话术记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WxUserScriptLog wxUserScriptLog) {
return toAjax(wxUserScriptLogService.updateWxUserScriptLog(wxUserScriptLog));
}
/**
*
*/
@RequiresPermissions("system:user_script_log:remove")
@Log(title = "发送话术记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxUserScriptLogService.deleteWxUserScriptLogByIds(ids));
}
/**
*
*
* @return
*/
@PostMapping("/sendScript")
public R sendScript(@RequestBody @Validated WxUserScriptReq wxUserScriptReq) {
if (wxUserScriptReq.getIsCustom() == 0) {
// 模板话术
if (wxUserScriptReq.getScriptTemplateId() == null || wxUserScriptReq.getScriptTemplateId() == 0) {
return R.fail("请选择话术模板");
}
} else if (wxUserScriptReq.getIsCustom() == 1) {
// 自定义话术
if(StringUtils.isBlank(wxUserScriptReq.getTitile())){
return R.fail("请输入话术标题");
}
if(StringUtils.isBlank(wxUserScriptReq.getContent())){
return R.fail("请输入话术内容");
}
// 跳转类型
if (wxUserScriptReq.getType() == 1) {
// 1跳转内部链接
if (StringUtils.isBlank(wxUserScriptReq.getLink())) {
return R.fail("请输入内部链接");
}
if (StringUtils.isBlank(wxUserScriptReq.getLinkParams())) {
return R.fail("请输入跳转参数");
}
}
if (wxUserScriptReq.getType() == 3) {
// 03跳转外部链接
if (StringUtils.isBlank(wxUserScriptReq.getLink())) {
return R.fail("请输入外部链接地址");
}
}
if (wxUserScriptReq.getType() == 4) {
// 4跳转小程序
if (StringUtils.isBlank(wxUserScriptReq.getRedirectAppid())) {
return R.fail("请输入小程序appid");
}
if (StringUtils.isBlank(wxUserScriptReq.getRedirectUrl())) {
return R.fail("请输入小程序页面地址");
}
}
if (wxUserScriptReq.getType() == 5) {
// 5导向视频号
if (StringUtils.isBlank(wxUserScriptReq.getVideoNo())) {
return R.fail("请输入视频号id");
}
if (StringUtils.isBlank(wxUserScriptReq.getFeedId())) {
return R.fail("请输入视频号feedid");
}
}
if (wxUserScriptReq.getType() == 6) {
// 6导向视频号直播间
if (StringUtils.isBlank(wxUserScriptReq.getVideoNo())) {
return R.fail("请输入视频号id");
}
}
}
wxUserScriptLogService.sendScript(wxUserScriptReq);
return R.ok();
}
}

@ -3,6 +3,7 @@ package com.flossom.system.service;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import java.util.List;
import java.util.Map;
/**
* Service
@ -59,4 +60,7 @@ public interface IActivityChannelInfoService
* @return
*/
public int deleteActivityChannelInfoById(Long id);
List<Map<String, Object>> getPurchaseChannel();
}

@ -5,6 +5,7 @@ import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.vo.TreeSelect;
import java.util.List;
import java.util.Map;
/**
@ -132,4 +133,8 @@ public interface ISysTagService
* @return
*/
public List<TreeSelect> selectTagTreeList(SysTag tag);
List<Map<String, Object>> getMiniProgramTags();
List<Map<String, Object>> getWecomTags();
}

@ -204,4 +204,6 @@ public interface ISysUserService
* @return
*/
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
int deleteWxUserById(Long userId);
}

@ -0,0 +1,64 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.WxUserRemark;
import com.flossom.common.core.domain.req.WxUserRemarkReq;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2023-12-21
*/
public interface IWxUserRemarkService {
/**
*
*
* @param id
* @return
*/
public WxUserRemark selectWxUserRemarkById(Long id);
/**
*
*
* @param wxUserRemark
* @return
*/
public List<WxUserRemark> selectWxUserRemarkList(WxUserRemark wxUserRemark);
/**
*
*
* @param wxUserRemark
* @return
*/
public int insertWxUserRemark(WxUserRemark wxUserRemark);
/**
*
*
* @param wxUserRemark
* @return
*/
public int updateWxUserRemark(WxUserRemark wxUserRemark);
/**
*
*
* @param ids
* @return
*/
public int deleteWxUserRemarkByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWxUserRemarkById(Long id);
void batchAddRemark(WxUserRemarkReq wxUserRemarkReq);
}

@ -0,0 +1,64 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import com.flossom.common.core.domain.req.WxUserScriptReq;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2023-12-20
*/
public interface IWxUserScriptLogService {
/**
*
*
* @param id
* @return
*/
public WxUserScriptLog selectWxUserScriptLogById(Long id);
/**
*
*
* @param wxUserScriptLog
* @return
*/
public List<WxUserScriptLog> selectWxUserScriptLogList(WxUserScriptLog wxUserScriptLog);
/**
*
*
* @param wxUserScriptLog
* @return
*/
public int insertWxUserScriptLog(WxUserScriptLog wxUserScriptLog);
/**
*
*
* @param wxUserScriptLog
* @return
*/
public int updateWxUserScriptLog(WxUserScriptLog wxUserScriptLog);
/**
*
*
* @param ids
* @return
*/
public int deleteWxUserScriptLogByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWxUserScriptLogById(Long id);
void sendScript(WxUserScriptReq wxUserScriptReq);
}

@ -1,8 +1,12 @@
package com.flossom.system.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.mapper.ActivityChannelInfoMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,8 +20,7 @@ import com.flossom.system.service.IActivityChannelInfoService;
* @date 2023-12-20
*/
@Service
public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoService
{
public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoService {
@Autowired
private ActivityChannelInfoMapper activityChannelInfoMapper;
@ -28,8 +31,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public ActivityChannelInfo selectActivityChannelInfoById(Long id)
{
public ActivityChannelInfo selectActivityChannelInfoById(Long id) {
return activityChannelInfoMapper.selectActivityChannelInfoById(id);
}
@ -40,8 +42,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo)
{
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo) {
return activityChannelInfoMapper.selectActivityChannelInfoList(activityChannelInfo);
}
@ -52,8 +53,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
{
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo) {
activityChannelInfo.setCreateTime(DateUtils.getNowDate());
return activityChannelInfoMapper.insertActivityChannelInfo(activityChannelInfo);
}
@ -65,8 +65,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
{
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo) {
return activityChannelInfoMapper.updateActivityChannelInfo(activityChannelInfo);
}
@ -77,8 +76,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int deleteActivityChannelInfoByIds(Long[] ids)
{
public int deleteActivityChannelInfoByIds(Long[] ids) {
return activityChannelInfoMapper.deleteActivityChannelInfoByIds(ids);
}
@ -89,8 +87,25 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int deleteActivityChannelInfoById(Long id)
{
public int deleteActivityChannelInfoById(Long id) {
return activityChannelInfoMapper.deleteActivityChannelInfoById(id);
}
@Override
public List<Map<String, Object>> getPurchaseChannel() {
List<Map<String, Object>> channelList = new ArrayList<>();
ActivityChannelInfo query = new ActivityChannelInfo();
List<ActivityChannelInfo> activityChannelInfoList = activityChannelInfoMapper.selectActivityChannelInfoList(query);
if (activityChannelInfoList != null && activityChannelInfoList.size() > 0) {
Map<String, Object> map;
for (ActivityChannelInfo activityChannelInfo : activityChannelInfoList) {
map = new HashMap<>();
map.put("label", activityChannelInfo.getChannelName());
map.put("value", activityChannelInfo.getId());
channelList.add(map);
}
}
return channelList;
}
}

@ -6,6 +6,7 @@ import com.flossom.common.core.domain.entity.SysRole;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.SysUser;
import com.flossom.common.core.domain.vo.TreeSelect;
import com.flossom.common.core.enums.TagTypeStatus;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.mapper.SysDeptMapper;
import com.flossom.common.core.mapper.SysRoleMapper;
@ -20,10 +21,7 @@ import com.flossom.system.service.ISysTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -32,8 +30,7 @@ import java.util.stream.Collectors;
* @author flossom
*/
@Service
public class SysTagServiceImpl implements ISysTagService
{
public class SysTagServiceImpl implements ISysTagService {
@Autowired
private SysTagMapper tagMapper;
@ -48,8 +45,7 @@ public class SysTagServiceImpl implements ISysTagService
*/
@Override
@DataScope(deptAlias = "d")
public List<SysTag> selectDeptList(SysTag tag)
{
public List<SysTag> selectDeptList(SysTag tag) {
return tagMapper.selectDeptList(tag);
}
@ -60,8 +56,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<TreeSelect> selectDeptTreeList(SysTag tag)
{
public List<TreeSelect> selectDeptTreeList(SysTag tag) {
List<SysTag> tags = SpringUtils.getAopProxy(this).selectDeptList(tag);
return buildDeptTreeSelect(tags);
}
@ -73,21 +68,17 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<SysTag> buildDeptTree(List<SysTag> tags)
{
public List<SysTag> buildDeptTree(List<SysTag> tags) {
List<SysTag> returnList = new ArrayList<SysTag>();
List<Long> tempList = tags.stream().map(SysTag::getId).collect(Collectors.toList());
for (SysTag tag : tags)
{
for (SysTag tag : tags) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(tag.getParentId()))
{
if (!tempList.contains(tag.getParentId())) {
recursionFn(tags, tag);
returnList.add(tag);
}
}
if (returnList.isEmpty())
{
if (returnList.isEmpty()) {
returnList = tags;
}
return returnList;
@ -100,8 +91,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<TreeSelect> buildDeptTreeSelect(List<SysTag> tags)
{
public List<TreeSelect> buildDeptTreeSelect(List<SysTag> tags) {
List<SysTag> deptTrees = buildDeptTree(tags);
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
@ -113,8 +103,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<Long> selectDeptListByRoleId(Long roleId)
{
public List<Long> selectDeptListByRoleId(Long roleId) {
SysRole role = roleMapper.selectRoleById(roleId);
return tagMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
}
@ -126,8 +115,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public SysTag selectDeptById(Long id)
{
public SysTag selectDeptById(Long id) {
return tagMapper.selectDeptById(id);
}
@ -138,8 +126,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int selectNormalChildrenDeptById(Long id)
{
public int selectNormalChildrenDeptById(Long id) {
return tagMapper.selectNormalChildrenDeptById(id);
}
@ -150,8 +137,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public boolean hasChildByDeptId(Long id)
{
public boolean hasChildByDeptId(Long id) {
int result = tagMapper.hasChildByDeptId(id);
return result > 0;
}
@ -163,8 +149,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return true false
*/
@Override
public boolean checkDeptExistUser(Long id)
{
public boolean checkDeptExistUser(Long id) {
int result = tagMapper.checkDeptExistUser(id);
return result > 0;
}
@ -176,12 +161,10 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public boolean checkDeptNameUnique(SysTag tag)
{
public boolean checkDeptNameUnique(SysTag tag) {
Long deptId = StringUtils.isNull(tag.getId()) ? -1L : tag.getId();
SysTag info = tagMapper.checkDeptNameUnique(tag.getTagName(), tag.getParentId());
if (StringUtils.isNotNull(info) && info.getId().longValue() != deptId.longValue())
{
if (StringUtils.isNotNull(info) && info.getId().longValue() != deptId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
@ -193,15 +176,12 @@ public class SysTagServiceImpl implements ISysTagService
* @param id id
*/
@Override
public void checkDeptDataScope(Long id)
{
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
{
public void checkDeptDataScope(Long id) {
if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
SysTag tag = new SysTag();
tag.setId(id);
List<SysTag> tags = SpringUtils.getAopProxy(this).selectDeptList(tag);
if (StringUtils.isEmpty(tags))
{
if (StringUtils.isEmpty(tags)) {
throw new ServiceException("没有权限访问标签数据!");
}
}
@ -214,15 +194,14 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int insertDept(SysTag tag)
{
public int insertDept(SysTag tag) {
SysTag info = tagMapper.selectDeptById(tag.getParentId());
// 如果父节点不为正常状态,则不允许新增子节点
// if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
// {
// throw new ServiceException("标签停用,不允许新增");
// }
if(Objects.isNull(info)) {
if (Objects.isNull(info)) {
tag.setAncestors("0");
tag.setParentId(0l);
}
@ -237,12 +216,10 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int updateDept(SysTag tag)
{
public int updateDept(SysTag tag) {
SysTag newParentDept = tagMapper.selectDeptById(tag.getParentId());
SysTag oldDept = tagMapper.selectDeptById(tag.getId());
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept))
{
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getId();
String oldAncestors = oldDept.getAncestors();
tag.setAncestors(newAncestors);
@ -250,8 +227,7 @@ public class SysTagServiceImpl implements ISysTagService
}
int result = tagMapper.updateDept(tag);
if (UserConstants.DEPT_NORMAL.equals(tag.getStatus()) && StringUtils.isNotEmpty(tag.getAncestors())
&& !StringUtils.equals("0", tag.getAncestors()))
{
&& !StringUtils.equals("0", tag.getAncestors())) {
// 如果该标签是启用状态,则启用该标签的所有上级标签
updateParentDeptStatusNormal(tag);
}
@ -263,8 +239,7 @@ public class SysTagServiceImpl implements ISysTagService
*
* @param
*/
private void updateParentDeptStatusNormal(SysTag tag)
{
private void updateParentDeptStatusNormal(SysTag tag) {
String ancestors = tag.getAncestors();
Long[] deptIds = Convert.toLongArray(ancestors);
tagMapper.updateDeptStatusNormal(deptIds);
@ -277,15 +252,12 @@ public class SysTagServiceImpl implements ISysTagService
* @param newAncestors ID
* @param oldAncestors ID
*/
public void updateDeptChildren(Long id, String newAncestors, String oldAncestors)
{
public void updateDeptChildren(Long id, String newAncestors, String oldAncestors) {
List<SysTag> children = tagMapper.selectChildrenDeptById(id);
for (SysTag child : children)
{
for (SysTag child : children) {
child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
}
if (children.size() > 0)
{
if (children.size() > 0) {
tagMapper.updateDeptChildren(children);
}
}
@ -297,8 +269,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int deleteDeptById(Long id)
{
public int deleteDeptById(Long id) {
return tagMapper.deleteDeptById(id);
}
@ -308,18 +279,49 @@ public class SysTagServiceImpl implements ISysTagService
return buildDeptTreeSelect(tags);
}
@Override
public List<Map<String, Object>> getMiniProgramTags() {
List<Map<String, Object>> tagList = new ArrayList<>();
// 获取小程序标签
List<SysTag> miniProgramTags = tagMapper.selectSecondTagByType(TagTypeStatus.MINI_PROGRAM.getCode());
if (miniProgramTags != null && miniProgramTags.size() > 0) {
Map<String, Object> map;
for (SysTag miniProgramTag : miniProgramTags) {
map = new HashMap<>();
map.put("label", miniProgramTag.getTagName());
map.put("value", miniProgramTag.getId());
tagList.add(map);
}
}
return tagList;
}
@Override
public List<Map<String, Object>> getWecomTags() {
List<Map<String, Object>> tagList = new ArrayList<>();
// 获取小程序标签
List<SysTag> miniProgramTags = tagMapper.selectSecondTagByType(TagTypeStatus.ENTERPRISE_WECHAT.getCode());
if (miniProgramTags != null && miniProgramTags.size() > 0) {
Map<String, Object> map;
for (SysTag miniProgramTag : miniProgramTags) {
map = new HashMap<>();
map.put("label", miniProgramTag.getTagName());
map.put("value", miniProgramTag.getId());
tagList.add(map);
}
}
return tagList;
}
/**
*
*/
private void recursionFn(List<SysTag> list, SysTag t)
{
private void recursionFn(List<SysTag> list, SysTag t) {
// 得到子节点列表
List<SysTag> childList = getChildList(list, t);
t.setChildren(childList);
for (SysTag tChild : childList)
{
if (hasChild(list, tChild))
{
for (SysTag tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
@ -328,15 +330,12 @@ public class SysTagServiceImpl implements ISysTagService
/**
*
*/
private List<SysTag> getChildList(List<SysTag> list, SysTag t)
{
private List<SysTag> getChildList(List<SysTag> list, SysTag t) {
List<SysTag> tlist = new ArrayList<SysTag>();
Iterator<SysTag> it = list.iterator();
while (it.hasNext())
{
while (it.hasNext()) {
SysTag n = (SysTag) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue())
{
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
tlist.add(n);
}
}
@ -346,8 +345,7 @@ public class SysTagServiceImpl implements ISysTagService
/**
*
*/
private boolean hasChild(List<SysTag> list, SysTag t)
{
private boolean hasChild(List<SysTag> list, SysTag t) {
return getChildList(list, t).size() > 0 ? true : false;
}
}

@ -441,6 +441,16 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.deleteUserById(userId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteWxUserById(Long userId) {
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(userId);
// 删除用户与岗位表
userPostMapper.deleteUserPostByUserId(userId);
return userMapper.deleteWxUserById(userId);
}
/**
*
*

@ -4,20 +4,15 @@ 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.WxUserIntegralLog;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.entity.WxUserTag;
import com.flossom.common.core.domain.entity.*;
import com.flossom.common.core.domain.req.WxUserIntegralVm;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.enums.IntegralChangeTypeEnum;
import com.flossom.common.core.enums.TagTypeStatus;
import com.flossom.common.core.mapper.SysTagMapper;
import com.flossom.common.core.mapper.WxUserIntegralLogMapper;
import com.flossom.common.core.mapper.WxUserMemberMapper;
import com.flossom.common.core.mapper.WxUserTagMapper;
import com.flossom.common.core.mapper.*;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.system.service.ISysUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -44,6 +39,18 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
@Autowired
private WxUserIntegralLogMapper wxUserIntegralLogMapper;
@Autowired
private ISysUserService sysUserService;
@Autowired
private WxNoRemindRecordMapper wxNoRemindRecordMapper;
@Autowired
private WxUserRemarkMapper wxUserRemarkMapper;
@Autowired
private WxUserScriptLogMapper wxUserScriptLogMapper;
/**
*
*
@ -107,8 +114,30 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
* @param ids
* @return
*/
@Transactional
@Override
public int deleteWxUserMemberByIds(Long[] ids) {
for (Long id : ids) {
WxUserMember wxUserMember = wxUserMemberMapper.selectWxUserMemberById(id);
if (wxUserMember != null) {
// sys_user 删除系统用户关联表
SysUser sysUser = sysUserService.selectUserByUserName(wxUserMember.getOpenid());
if (sysUser != null) {
sysUserService.deleteWxUserById(sysUser.getUserId());
}
// wx_user_integral_log 用户积分关联表
wxUserIntegralLogMapper.deleteWxUserIntegralLogByUserId(wxUserMember.getId());
// wx_no_remain_record 不提醒关联表
wxNoRemindRecordMapper.deleteWxNoRemindRecordByOpenid(wxUserMember.getOpenid());
// wx_user_remark 备注关联表
wxUserRemarkMapper.deleteWxUserRemarkByUserId(wxUserMember.getId());
// wx_user_script_log 话术发送记录关联表
wxUserScriptLogMapper.deleteWxUserScriptLogByWxUserId(wxUserMember.getId());
// wx_user_tag 用户标签关联表
wxUserTagMapper.deleteWxUserTagByUserId(wxUserMember.getId());
}
}
// wx_user_member 微信用户表
return wxUserMemberMapper.deleteWxUserMemberByIds(ids);
}

@ -0,0 +1,122 @@
package com.flossom.system.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import com.flossom.common.core.domain.entity.WxUserRemark;
import com.flossom.common.core.domain.req.WxUserRemarkReq;
import com.flossom.common.core.enums.Status;
import com.flossom.common.core.mapper.WxUserMemberMapper;
import com.flossom.common.core.mapper.WxUserRemarkMapper;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxUserRemarkService;
/**
* Service
*
* @author flossom
* @date 2023-12-21
*/
@Service
public class WxUserRemarkServiceImpl implements IWxUserRemarkService {
@Autowired
private WxUserRemarkMapper wxUserRemarkMapper;
@Autowired
private WxUserMemberMapper wxUserMemberMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WxUserRemark selectWxUserRemarkById(Long id) {
return wxUserRemarkMapper.selectWxUserRemarkById(id);
}
/**
*
*
* @param wxUserRemark
* @return
*/
@Override
public List<WxUserRemark> selectWxUserRemarkList(WxUserRemark wxUserRemark) {
return wxUserRemarkMapper.selectWxUserRemarkList(wxUserRemark);
}
/**
*
*
* @param wxUserRemark
* @return
*/
@Override
public int insertWxUserRemark(WxUserRemark wxUserRemark) {
wxUserRemark.setCreateTime(DateUtils.getNowDate());
return wxUserRemarkMapper.insertWxUserRemark(wxUserRemark);
}
/**
*
*
* @param wxUserRemark
* @return
*/
@Override
public int updateWxUserRemark(WxUserRemark wxUserRemark) {
wxUserRemark.setUpdateTime(DateUtils.getNowDate());
return wxUserRemarkMapper.updateWxUserRemark(wxUserRemark);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWxUserRemarkByIds(Long[] ids) {
return wxUserRemarkMapper.deleteWxUserRemarkByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWxUserRemarkById(Long id) {
return wxUserRemarkMapper.deleteWxUserRemarkById(id);
}
@Override
public void batchAddRemark(WxUserRemarkReq wxUserRemarkReq) {
if (wxUserRemarkReq.getUserIdList() == null || wxUserRemarkReq.getUserIdList().size() == 0) {
List<Integer> userIdList = wxUserMemberMapper.selectWxUserMemberIdList();
if (userIdList != null && userIdList.size() > 0) {
List<Long> collect = userIdList.stream().map(Integer::longValue).collect(Collectors.toList());
wxUserRemarkReq.setUserIdList(collect);
}
}
if (wxUserRemarkReq.getUserIdList() != null && wxUserRemarkReq.getUserIdList().size() > 0) {
WxUserRemark wxUserRemark = new WxUserRemark();
for (Long userId : wxUserRemarkReq.getUserIdList()) {
wxUserRemark.setUserId(userId);
wxUserRemark.setContent(wxUserRemarkReq.getContent());
wxUserRemark.setStatus(Status.OK.getCode());
wxUserRemark.setCreateTime(DateUtils.getNowDate());
// wxUserRemark.setCreateBy(SecurityUtils.getUsername());
wxUserRemarkMapper.insertWxUserRemark(wxUserRemark);
}
}
}
}

@ -0,0 +1,143 @@
package com.flossom.system.service.impl;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxScriptTemplate;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import com.flossom.common.core.domain.req.WxUserScriptReq;
import com.flossom.common.core.mapper.*;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.core.utils.StringUtils;
import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.system.service.IWxUserMemberService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxUserScriptLogService;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author flossom
* @date 2023-12-20
*/
@Service
public class WxUserScriptLogServiceImpl implements IWxUserScriptLogService {
@Autowired
private WxUserScriptLogMapper wxUserScriptLogMapper;
@Autowired
private IWxUserMemberService wxUserMemberService;
@Autowired
private WxScriptTemplateMapper wxScriptTemplateMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WxUserScriptLog selectWxUserScriptLogById(Long id) {
return wxUserScriptLogMapper.selectWxUserScriptLogById(id);
}
/**
*
*
* @param wxUserScriptLog
* @return
*/
@Override
public List<WxUserScriptLog> selectWxUserScriptLogList(WxUserScriptLog wxUserScriptLog) {
return wxUserScriptLogMapper.selectWxUserScriptLogList(wxUserScriptLog);
}
/**
*
*
* @param wxUserScriptLog
* @return
*/
@Override
public int insertWxUserScriptLog(WxUserScriptLog wxUserScriptLog) {
wxUserScriptLog.setCreateTime(DateUtils.getNowDate());
return wxUserScriptLogMapper.insertWxUserScriptLog(wxUserScriptLog);
}
/**
*
*
* @param wxUserScriptLog
* @return
*/
@Override
public int updateWxUserScriptLog(WxUserScriptLog wxUserScriptLog) {
return wxUserScriptLogMapper.updateWxUserScriptLog(wxUserScriptLog);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWxUserScriptLogByIds(Long[] ids) {
return wxUserScriptLogMapper.deleteWxUserScriptLogByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWxUserScriptLogById(Long id) {
return wxUserScriptLogMapper.deleteWxUserScriptLogById(id);
}
@Override
@Transactional
public void sendScript(WxUserScriptReq wxUserScriptReq) {
List<Long> userIdList = wxUserScriptReq.getUserIdList();
// 保存消息
for (Long wxUserId : userIdList) {
WxUserScriptLog wxUserScriptLog = new WxUserScriptLog();
BeanUtils.copyProperties(wxUserScriptReq, wxUserScriptLog);
wxUserScriptLog.setWxUserId(wxUserId);
wxUserScriptLog.setCreateBy(SecurityUtils.getUsername());
wxUserScriptLog.setCreateTime(DateUtils.getNowDate());
wxUserScriptLogMapper.insertWxUserScriptLog(wxUserScriptLog);
}
// 保存标签关联
if (wxUserScriptReq.getIsCustom() == 0) {
// 模板话术
Integer scriptTemplateId = wxUserScriptReq.getScriptTemplateId();
WxScriptTemplate wxScriptTemplate = wxScriptTemplateMapper.selectWxScriptTemplateById(scriptTemplateId.longValue());
if (StringUtils.isNotBlank(wxScriptTemplate.getTagIds())) {
List<String> list = Arrays.asList(wxScriptTemplate.getTagIds().split(","));
List<Integer> tagList = list.stream().map(Integer::parseInt).collect(Collectors.toList());
List<Integer> collect = userIdList.stream().map(Long::intValue).collect(Collectors.toList());
wxUserMemberService.batchAddMiniProgramTag(tagList, collect);
}
}
if (wxUserScriptReq.getIsCustom() == 1) {
// 自定义话术
if (StringUtils.isNotBlank(wxUserScriptReq.getTagIds())) {
List<String> list = Arrays.asList(wxUserScriptReq.getTagIds().split(","));
List<Integer> tagList = list.stream().map(Integer::parseInt).collect(Collectors.toList());
List<Integer> collect = userIdList.stream().map(Long::intValue).collect(Collectors.toList());
wxUserMemberService.batchAddMiniProgramTag(tagList, collect);
}
}
}
}

@ -42,3 +42,33 @@ export function delMember(id) {
method: 'delete'
})
}
export function selectUserCount() {
return request({
url: '/system/member/selectUserCount',
method: 'get',
})
}
export function getMiniProgramTags() {
return request({
url: '/system/tagInfo/getMiniProgramTags',
method: 'get',
})
}
export function getWecomTags() {
return request({
url: '/system/tagInfo/getWecomTags',
method: 'get',
})
}
export function getPurchaseChannel() {
return request({
url: '/system/channelInfo/getPurchaseChannel',
method: 'get',
})
}

@ -1,5 +1,10 @@
<template>
<div class="app-container">
<el-descriptions size="medium" >
<el-descriptions-item label="用户总数">{{count.userNum}}</el-descriptions-item>
<el-descriptions-item label="已注册用户">{{count.userRegisterNum}}</el-descriptions-item>
<el-descriptions-item label="已绑定仪器用户数">{{count.userDeviceNum}}</el-descriptions-item>
</el-descriptions>
<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" style="width: 50%">
@ -69,11 +74,56 @@
align="right">
</el-date-picker>
</el-form-item>
<el-form-item label="仪器数量" prop="credit">
<el-input-number v-model="queryParams.devicesNumStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.devicesNumEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<el-form-item label="积分范围" prop="credit">
<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 label="仪器绑定" prop="devicesTags">
<el-select v-model="queryParams.devicesTags" multiple placeholder="请选择">
<el-option
v-for="item in devicesTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="购买渠道" prop="purchaseChannel">
<el-select v-model="queryParams.purchaseChannel" multiple placeholder="请选择">
<el-option
v-for="item in purchaseChannel"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="企微标签" prop="wecomTags">
<el-select v-model="queryParams.wecomTags" multiple placeholder="请选择">
<el-option
v-for="item in miniProgramTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小程序标签" prop="miniProgramTags">
<el-select v-model="queryParams.miniProgramTags" multiple placeholder="请选择">
<el-option
v-for="item in wecomTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -282,12 +332,35 @@
</template>
<script>
import { listMember, getMember, delMember, addMember, updateMember } from "@/api/system/member";
import {
listMember,
getMember,
delMember,
addMember,
updateMember,
selectUserCount,
getMiniProgramTags,
getWecomTags,
getPurchaseChannel,
} from "@/api/system/member";
export default {
name: "Member",
data() {
return {
devicesTags: [{
value: '仪器标签1',
label: '仪器标签1'
}, {
value: '仪器标签2',
label: '仪器标签2'
}, {
value: '仪器标签3',
label: '仪器标签3'
}],
miniProgramTags: [],
wecomTags: [],
purchaseChannel: null,
//
loading: true,
//
@ -308,6 +381,11 @@ export default {
open: false,
//
dateRange: [],
count: {
userNum: 0,
userRegisterNum: 0,
userDeviceNum: 0
},
//
queryParams: {
pageNum: 1,
@ -315,6 +393,8 @@ export default {
nickname: null,
headimg: null,
username: null,
devicesNumStart: undefined,
devicesNumEnd: undefined,
creditStart: undefined,
creditEnd: undefined,
openid: null,
@ -341,6 +421,10 @@ export default {
loginTime: null,
status: null,
// createTime: [],
devicesTags: [], //
wecomTags:[], //
miniProgramTags: [], //
purchaseChannel: null, //
},
//
form: {},
@ -350,7 +434,12 @@ export default {
};
},
created() {
//
this.getUserCount();
//
this.getList();
//
this.getTags();
},
methods: {
/** 查询用户列表 */
@ -362,6 +451,27 @@ export default {
this.loading = false;
});
},
getUserCount() {
selectUserCount().then(Response => {
this.count.userNum = Response.data[0];
this.count.userRegisterNum = Response.data[1];
this.count.userDeviceNum = Response.data[2];
})
},
getTags() {
//
getMiniProgramTags().then(Response => {
this.miniProgramTags = Response.data
})
//
getWecomTags().then(Response => {
this.wecomTags = Response.data
})
//
getPurchaseChannel().then(Response => {
this.purchaseChannel = Response.data
})
},
//
cancel() {
this.open = false;

Loading…
Cancel
Save