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

master
382696293@qq.com 2 years ago
commit 1c7e1b4da9

@ -1,5 +1,6 @@
package com.flossom.common.core.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -10,6 +11,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -26,16 +28,18 @@ public class SysTag extends BaseEntity
/** 父标签ID */
private Long parentId;
/** 父标签名称 */
@Excel(name = "一级标签名称")
private String parentName;
/** 祖级列表 */
private String ancestors;
/** 标签名称 */
@Excel(name = "标签名称")
@Excel(name = "二级标签名称")
private String tagName;
/** 显示顺序 */
@Excel(name = "排序顺序")
private Integer orderNum;
/** 负责人 */
@ -47,18 +51,25 @@ public class SysTag extends BaseEntity
/** 邮箱 */
private String email;
/** 标签状态:1小程序标签,2企微标签 */
@Excel(name = "标签类型")
private String type;
/** 标签状态:0正常,1停用 */
@Excel(name = "标签状态:0正常,1停用")
// @Excel(name = "标签状态:0正常,1停用")
private String status;
/** 标签状态:1小程序标签,2企微标签 */
private String type;
@Excel(name = "标签添加时间")
private String addTime;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
/** 父标签名称 */
private String parentName;
@Excel(name = "标签人数")
private Integer tagUsers;
/** 子标签 */
private List<SysTag> children = new ArrayList<SysTag>();
@ -194,6 +205,22 @@ public class SysTag extends BaseEntity
this.type = type;
}
public String getAddTime() {
return addTime;
}
public void setAddTime(String addTime) {
this.addTime = addTime;
}
public Integer getTagUsers() {
return tagUsers;
}
public void setTagUsers(Integer tagUsers) {
this.tagUsers = tagUsers;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="tagName" column="tag_name" />
<result property="parentName" column="parent_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="phone" column="phone" />
@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDeptVo">
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
select d.id,d.parent_name, 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
</sql>
@ -102,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into sys_tag(
<if test="id != null and id != 0">id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="parentName != null">parent_name,</if>
<if test="tagName != null and tagName != ''">tag_name,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null">order_num,</if>
@ -115,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)values(
<if test="id != null and id != 0">#{id},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="parentName != null">#{parentName},</if>
<if test="tagName != null and tagName != ''">#{tagName},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null">#{orderNum},</if>
@ -132,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_tag
<set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="parentName != null">parent_name = #{parentName},</if>
<if test="tagName != null and tagName != ''">tag_name = #{tagName},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>

@ -5,6 +5,9 @@ import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.SysFiringInfo;
import com.flossom.common.core.domain.entity.SysDept;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxUserTag;
import com.flossom.common.core.enums.TagTypeStatus;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.core.utils.StringUtils;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
@ -39,6 +42,8 @@ public class SysTagController extends BaseController {
private IWxUserTagService wxUserTagService;
@Autowired
private IWxScriptTagService wxScriptTagService;
@Autowired
private IWxUserTagService userTagService;
/**
*
*/
@ -165,8 +170,31 @@ public class SysTagController extends BaseController {
@PostMapping("/export")
public void export(HttpServletResponse response, SysTag tag)
{
String sheetName = "";
String s = DateUtils.dateTimeNow("yyyyMMddHHmmss");
if (TagTypeStatus.MINI_PROGRAM.getCode().toString().equals(tag.getType())) {
sheetName += "小程序标签数据"+ s ;
} else {
sheetName += "企微标签数据"+ s ;
}
List<SysTag> list = tagService.selectDeptList(tag);
for (SysTag sysTag: list) {
if (TagTypeStatus.MINI_PROGRAM.getCode().toString().equals(sysTag.getType())) {
sysTag.setType("小程序标签");
} else {
sysTag.setType("企微标签");
}
if (0 == sysTag.getParentId()) {
sysTag.setParentName(sysTag.getTagName());
sysTag.setTagName("");
}
sysTag.setAddTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sysTag.getCreateTime()));
WxUserTag userTag = new WxUserTag();
userTag.setTagId(sysTag.getId());
List<WxUserTag> wxUserTags = userTagService.selectWxUserTagList(userTag);
sysTag.setTagUsers(wxUserTags.size());
}
ExcelUtil<SysTag> util = new ExcelUtil<SysTag>(SysTag.class);
util.exportExcel(response, list, "标签信息数据");
util.exportExcel(response, list, sheetName);
}
}

@ -204,6 +204,8 @@ public class SysTagServiceImpl implements ISysTagService {
if (Objects.isNull(info)) {
tag.setAncestors("0");
tag.setParentId(0l);
} else {
tag.setParentName(info.getTagName());
}
return tagMapper.insertDept(tag);
@ -225,6 +227,7 @@ public class SysTagServiceImpl implements ISysTagService {
tag.setAncestors(newAncestors);
updateDeptChildren(tag.getId(), newAncestors, oldAncestors);
}
tag.setParentName(newParentDept.getTagName());
int result = tagMapper.updateDept(tag);
if (UserConstants.DEPT_NORMAL.equals(tag.getStatus()) && StringUtils.isNotEmpty(tag.getAncestors())
&& !StringUtils.equals("0", tag.getAncestors())) {

@ -495,6 +495,7 @@ public class SysUserServiceImpl implements ISysUserService
String password = configService.selectConfigByKey("sys.user.initPassword");
for (SysUser user : userList)
{
user.setUserId(null);
try
{
// 验证是否存在这个用户
@ -542,7 +543,12 @@ public class SysUserServiceImpl implements ISysUserService
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
if (StringUtils.isNotEmpty(successMsg.toString()) && !"null".equals(successMsg.toString())) {
return successMsg.toString();
} else {
return failureMsg.toString();
}
}
}

@ -1,13 +1,22 @@
package com.flossom.system.service.impl;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxScriptTag;
import com.flossom.common.core.domain.entity.WxScriptTemplate;
import com.flossom.common.core.mapper.SysTagMapper;
import com.flossom.common.core.mapper.WxScriptTagMapper;
import com.flossom.common.core.mapper.WxScriptTemplateMapper;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.core.utils.StringUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxScriptTagService;
import org.springframework.util.CollectionUtils;
/**
* Service
@ -20,6 +29,10 @@ public class WxScriptTagServiceImpl implements IWxScriptTagService
{
@Autowired
private WxScriptTagMapper wxScriptTagMapper;
@Autowired
private WxScriptTemplateMapper wxScriptTemplateMapper;
@Autowired
private SysTagMapper sysTagMapper;
/**
*
@ -97,6 +110,47 @@ public class WxScriptTagServiceImpl implements IWxScriptTagService
@Override
public int deleteWxScriptTagByTagId(Long tagId) {
// 先找出来,符合的所有标签
WxScriptTag tag = new WxScriptTag();
tag.setTagId(tagId);
List<WxScriptTag> wxScriptTags = wxScriptTagMapper.selectWxScriptTagList(tag);
// 开始组装新的数据以及更新源数据
if (!CollectionUtils.isEmpty(wxScriptTags)) {
for (WxScriptTag wxScriptTag: wxScriptTags) {
Long scriptId = wxScriptTag.getScriptId();
// 话术模板
WxScriptTemplate wxScriptTemplate = wxScriptTemplateMapper.selectWxScriptTemplateById(scriptId);
if (Objects.nonNull(wxScriptTemplate)) {
WxScriptTag tagsVO = new WxScriptTag();
tagsVO.setScriptId(scriptId);
// 反查得到所有的标签
List<WxScriptTag> wxScriptTotalTags = wxScriptTagMapper.selectWxScriptTagList(tagsVO);
// 过滤删除的标签
if (!CollectionUtils.isEmpty(wxScriptTotalTags)) {
// 获取过滤后的标签的信息
List<WxScriptTag> collectList = wxScriptTotalTags.stream().filter(x -> !String.valueOf(x.getTagId()).equals(String.valueOf(tagId))).collect(Collectors.toList());
List<SysTag> createSysTagList = Lists.newArrayList();
if (!CollectionUtils.isEmpty(collectList)) {
for (WxScriptTag scriptTag : collectList) {
SysTag sysTag = sysTagMapper.selectDeptById(scriptTag.getTagId());
if (Objects.nonNull(sysTag)) {
createSysTagList.add(sysTag);
}
}
}
if (!CollectionUtils.isEmpty(createSysTagList)) {
String tagNames = createSysTagList.stream().map(SysTag::getTagName).collect(Collectors.joining(","));
wxScriptTemplate.setTagNames(tagNames);
List<Long> resultList = createSysTagList.stream().map(SysTag::getId).collect(Collectors.toList());
String ids = StringUtils.join(resultList, ",");
wxScriptTemplate.setTagIds(ids);
wxScriptTemplateMapper.updateWxScriptTemplate(wxScriptTemplate);
}
}
}
}
}
return wxScriptTagMapper.deleteWxScriptTagByTagId(tagId);
}
}

@ -345,7 +345,7 @@ export default {
handleExport() {
this.download('system/tagInfo/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}, `企微标签数据_${new Date().getTime()}.xlsx`)
}
}
};

@ -598,8 +598,8 @@ export default {
handleExport() {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
}, `角色数据_${new Date().getTime()}.xlsx`)
}
}
};
</script>
</script>

@ -290,7 +290,7 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button @click="reset"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
@ -369,7 +369,7 @@ export default {
{ required: true, message: "跳转参数不能为空", trigger: "blur" }
],
redirectUrl: [
{ required: true, message: "页面链接不能为空", trigger: "blur" }
{ required: true, message: "小程序页面不能为空", trigger: "blur" }
],
videoNo: [
{ required: true, message: "视频号ID不能为空", trigger: "blur" }

@ -175,8 +175,8 @@
</el-form-item>
</el-col>
<el-col :span="24" v-if="form.parentId != 0 && form.type == 4" label-width="90px">
<el-form-item label="页面链接" prop="redirectUrl">
<el-input v-model="form.redirectUrl" placeholder="请输入页面链接" />
<el-form-item label="小程序页面" prop="redirectUrl">
<el-input v-model="form.redirectUrl" placeholder="请输入小程序页面" />
</el-form-item>
</el-col>
<el-col :span="24" v-if="form.parentId != 0 && form.type == 5 || form.type == 6">
@ -265,7 +265,7 @@ export default {
{ required: true, message: "小程序appid不能为空", trigger: "blur" }
],
redirectUrl: [
{ required: true, message: "跳转URL不能为空", trigger: "blur" }
{ required: true, message: "小程序页面不能为空", trigger: "blur" }
],
videoNo: [
{ required: true, message: "视频号ID不能为空", trigger: "blur" }

@ -398,7 +398,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button @click="reset"> </el-button>
</div>
</el-dialog>
</div>
@ -615,10 +615,10 @@ export default {
channelId: null,
machineName: null,
machineId: null,
userType: null,
userType: 2,
operate: null,
signNumber: null,
orderNumber: null,
orderNumber: 1000,
type: null,
link: null,
linkParams: null,
@ -653,7 +653,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = "添加站点管理";
this.title = "添加轮播图";
this.form.orderNumber = 1000;
this.form.userType = 2;
},

@ -398,7 +398,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button @click="reset"> </el-button>
</div>
</el-dialog>
</div>
@ -611,7 +611,7 @@ export default {
userType: null,
operate: null,
signNumber: null,
orderNumber: null,
orderNumber: 1000,
type: null,
link: null,
linkParams: null,

@ -637,7 +637,7 @@ export default {
handleExport() {
this.download('system/user/export', {
...this.queryParams
}, `user_${new Date().getTime()}.xlsx`)
}, `用户数据_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
@ -647,7 +647,7 @@ export default {
/** 下载模板操作 */
importTemplate() {
this.download('system/user/importTemplate', {
}, `user_template_${new Date().getTime()}.xlsx`)
}, `用户管理模版_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
@ -667,4 +667,4 @@ export default {
}
}
};
</script>
</script>

@ -284,6 +284,11 @@ export default {
listDeptExcludeChild(row.id).then(response => {
this.deptOptions = this.handleTree(response.data, "id");
});
if (row.parentId == 0) {
this.showParent = 1;
} else {
this.showParent = 0;
}
},
/** 提交按钮 */
submitForm: function() {
@ -334,7 +339,7 @@ export default {
handleExport() {
this.download('system/tagInfo/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}, `小程序标签数据_${new Date().getTime()}.xlsx`)
}
}
};

Loading…
Cancel
Save