Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104
commit
958bc6e88e
@ -0,0 +1,69 @@
|
||||
package com.flossom.common.core.domain.req;
|
||||
|
||||
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 微信用户积分操作对象
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-14
|
||||
*/
|
||||
public class WxUserIntegralVm {
|
||||
|
||||
/**
|
||||
* 1-增加 2-减少
|
||||
*/
|
||||
@NotBlank(message = "请选择积分操作类型")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 浮动分数
|
||||
*/
|
||||
@NotNull(message = "积分变动值不能为空")
|
||||
@Range(min = 0, max = 10000, message = "请正确输入积分变动值")
|
||||
private Long floatScore;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@NotBlank(message = "请输入积分操作说明")
|
||||
private String remarkContent;
|
||||
|
||||
public WxUserIntegralVm() {
|
||||
}
|
||||
|
||||
public WxUserIntegralVm(String source, Long floatScore, String remarkContent) {
|
||||
this.source = source;
|
||||
this.floatScore = floatScore;
|
||||
this.remarkContent = remarkContent;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Long getFloatScore() {
|
||||
return floatScore;
|
||||
}
|
||||
|
||||
public void setFloatScore(Long floatScore) {
|
||||
this.floatScore = floatScore;
|
||||
}
|
||||
|
||||
public String getRemarkContent() {
|
||||
return remarkContent;
|
||||
}
|
||||
|
||||
public void setRemarkContent(String remarkContent) {
|
||||
this.remarkContent = remarkContent;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.flossom.common.core.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 积分操作类型
|
||||
*
|
||||
* @author flossom
|
||||
*/
|
||||
public enum IntegralChangeTypeEnum {
|
||||
INCREASE("1", "增加"), REDUCE("2", "减少");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
IntegralChangeTypeEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public static Boolean isIntegralChangType(String code) {
|
||||
for (IntegralChangeTypeEnum typeEnum : IntegralChangeTypeEnum.values()) {
|
||||
if (typeEnum.getCode().equals(code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
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);
|
||||
|
||||
void deleteBatch(@Param("tagIdList") List<Integer> tagIdList, @Param("userIdList") List<Integer> userIdList);
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
<?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>
|
||||
|
||||
<delete id="deleteBatch">
|
||||
DELETE
|
||||
FROM
|
||||
wx_user_tag
|
||||
WHERE
|
||||
tag_id IN
|
||||
<foreach item="tagId" collection="tagIdList" open="(" separator="," close=")">
|
||||
#{tagId}
|
||||
</foreach>
|
||||
AND user_id IN
|
||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -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);
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue