diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SysTag.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SysTag.java new file mode 100644 index 0000000..a33ae3f --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SysTag.java @@ -0,0 +1,213 @@ +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; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +/** + * 标签表 sys_dept + * + * @author flossom + */ +public class SysTag extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 标签ID */ + private Long id; + + /** 父标签ID */ + private Long parentId; + + /** 祖级列表 */ + private String ancestors; + + /** 标签名称 */ + private String tagName; + + /** 显示顺序 */ + private Integer orderNum; + + /** 负责人 */ + private String leader; + + /** 联系电话 */ + private String phone; + + /** 邮箱 */ + private String email; + + /** 标签状态:0正常,1停用 */ + private String status; + + /** 标签状态:1小程序标签,2企微标签 */ + private String type; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 父标签名称 */ + private String parentName; + + /** 子标签 */ + private List children = new ArrayList(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public String getAncestors() + { + return ancestors; + } + + public void setAncestors(String ancestors) + { + this.ancestors = ancestors; + } + + @NotBlank(message = "标签名称不能为空") + @Size(min = 0, max = 30, message = "标签名称长度不能超过30个字符") + public String getTagName() + { + return tagName; + } + + public void setTagName(String tagName) + { + this.tagName = tagName; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + public String getLeader() + { + return leader; + } + + public void setLeader(String leader) + { + this.leader = leader; + } + + @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") + public String getPhone() + { + return phone; + } + + public void setPhone(String phone) + { + this.phone = phone; + } + + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("parentId", getParentId()) + .append("ancestors", getAncestors()) + .append("tagName", getTagName()) + .append("orderNum", getOrderNum()) + .append("leader", getLeader()) + .append("phone", getPhone()) + .append("email", getEmail()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxUserIntegralLog.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxUserIntegralLog.java index 2b86622..1643d6f 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxUserIntegralLog.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxUserIntegralLog.java @@ -18,6 +18,10 @@ public class WxUserIntegralLog extends BaseEntity /** 主键ID */ private Long id; + /** 用户Id */ + @Excel(name = "用户Id") + private Long userId; + /** 用户昵称 */ @Excel(name = "用户昵称") private String userName; @@ -106,6 +110,14 @@ public class WxUserIntegralLog extends BaseEntity return remarkContent; } + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/TreeSelect.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/TreeSelect.java index 479a8a3..b7f6bd8 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/TreeSelect.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/vo/TreeSelect.java @@ -3,6 +3,7 @@ package com.flossom.common.core.domain.vo; import com.fasterxml.jackson.annotation.JsonInclude; import com.flossom.common.core.domain.entity.SysDept; import com.flossom.common.core.domain.entity.SysMenu; +import com.flossom.common.core.domain.entity.SysTag; import java.io.Serializable; import java.util.List; @@ -48,6 +49,12 @@ public class TreeSelect implements Serializable { this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); } + public TreeSelect(SysTag sysTag) { + this.id = sysTag.getId(); + this.label = sysTag.getTagName(); + this.children = sysTag.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + } + public Long getId() { return id; } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java new file mode 100644 index 0000000..c550488 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java @@ -0,0 +1,118 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.SysTag; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 标签管理 数据层 + * + * @author flossom + */ +public interface SysTagMapper { + /** + * 查询标签管理数据 + * + * @param tag 标签信息 + * @return 标签信息集合 + */ + public List selectDeptList(SysTag tag); + + /** + * 根据角色ID查询标签树信息 + * + * @param roleId 角色ID + * @param deptCheckStrictly 标签树选择项是否关联显示 + * @return 选中标签列表 + */ + public List selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); + + /** + * 根据标签ID查询信息 + * + * @param id 标签ID + * @return 标签信息 + */ + public SysTag selectDeptById(Long id); + + /** + * 根据ID查询所有子标签 + * + * @param id 标签ID + * @return 标签列表 + */ + public List selectChildrenDeptById(Long id); + + /** + * 根据ID查询所有子标签(正常状态) + * + * @param id 标签ID + * @return 子标签数 + */ + public int selectNormalChildrenDeptById(Long id); + + /** + * 是否存在子节点 + * + * @param id 标签ID + * @return 结果 + */ + public int hasChildByDeptId(Long id); + + /** + * 查询标签是否存在用户 + * + * @param id 标签ID + * @return 结果 + */ + public int checkDeptExistUser(Long id); + + /** + * 校验标签名称是否唯一 + * + * @param tagName 标签名称 + * @param parentId 父标签ID + * @return 结果 + */ + public SysTag checkDeptNameUnique(@Param("tagName") String tagName, @Param("parentId") Long parentId); + + /** + * 新增标签信息 + * + * @param tag 标签信息 + * @return 结果 + */ + public int insertDept(SysTag tag); + + /** + * 修改标签信息 + * + * @param tag 标签信息 + * @return 结果 + */ + public int updateDept(SysTag tag); + + /** + * 修改所在标签正常状态 + * + * @param deptIds 标签ID组 + */ + public void updateDeptStatusNormal(Long[] deptIds); + + /** + * 修改子元素关系 + * + * @param tags 子元素 + * @return 结果 + */ + public int updateDeptChildren(@Param("depts") List tags); + + /** + * 删除标签管理信息 + * + * @param id 标签ID + * @return 结果 + */ + public int deleteDeptById(Long id); +} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml new file mode 100644 index 0000000..440f047 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select d.id, d.parent_id, d.ancestors, d.tag_name, d.order_num, d.leader, d.phone, d.email, d.status, d.type, d.del_flag, d.create_by, d.create_time + from sys_tag d + + + + + + + + + + + + + + + + + + + + insert into sys_tag( + id, + parent_id, + tag_name, + ancestors, + order_num, + leader, + phone, + email, + status, + type, + create_by, + create_time + )values( + #{id}, + #{parentId}, + #{tagName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{type}, + #{createBy}, + sysdate() + ) + + + + update sys_tag + + parent_id = #{parentId}, + tag_name = #{tagName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where id = #{id} + + + + update sys_tag set ancestors = + + when #{item.id} then #{item.ancestors} + + where id in + + #{item.id} + + + + + update sys_tag set status = '0' where id in + + #{deptId} + + + + + update sys_tag set del_flag = '2' where id = #{id} + + + diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxSystemSettingMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxSystemSettingMapper.xml index ef9ac85..8c5a20e 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxSystemSettingMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxSystemSettingMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -24,24 +24,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into wx_system_setting - key, - value, + `key`, + `value`, instructions, picture_url, status, @@ -68,8 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update wx_system_setting - key = #{key}, - value = #{value}, + `key` = #{key}, + `value` = #{value}, instructions = #{instructions}, picture_url = #{pictureUrl}, status = #{status}, @@ -87,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wx_system_setting where id in + delete from wx_system_setting where id in #{id} @@ -103,4 +103,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by update_time desc limit 1 - \ No newline at end of file + diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserIntegralLogMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserIntegralLogMapper.xml index 125887b..ea059d6 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserIntegralLogMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxUserIntegralLogMapper.xml @@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -17,12 +18,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, user_name, user_phone, source, float_score, soure_id, remark_content, create_time, create_by from wx_user_integral_log + select id,user_id, user_name, user_phone, source, float_score, soure_id, remark_content, create_time, create_by from wx_user_integral_log