diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SiteInfo.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SiteInfo.java index 0ef0697..4edda78 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SiteInfo.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SiteInfo.java @@ -23,7 +23,9 @@ public class SiteInfo extends BaseEntity /** 站点管理ID */ private Long id; - + /** 类型 1-弹窗列表 2-轮播列表 */ + @Excel(name = "类型 1-弹窗列表 2-轮播列表 ") + private Integer siteType; /** 站点名称 */ @Excel(name = "站点名称") private String siteName; @@ -132,6 +134,20 @@ public class SiteInfo extends BaseEntity private String machineId; private List machineArray = new ArrayList(); + private String handlerCompanyTagId; + + private List handlerCompanyTagArray = new ArrayList(); + /** 获取企微标签 */ + @Excel(name = "获取企微标签") + private String handlerCompanyTag; + + @Excel(name = "获取小程序标签") + private String handlerWechatTag; + + /** 获取小程序标签ID */ + private String handlerWechatTagId; + + private List handlerWechatTagArray = new ArrayList(); /** 用户类型 0-全部 1-游客 2-会员 */ @Excel(name = "用户类型 0-全部 1-游客 2-会员") @@ -556,6 +572,62 @@ public class SiteInfo extends BaseEntity this.machineArray = machineArray; } + public Integer getSiteType() { + return siteType; + } + + public void setSiteType(Integer siteType) { + this.siteType = siteType; + } + + public String getHandlerCompanyTagId() { + return handlerCompanyTagId; + } + + public void setHandlerCompanyTagId(String handlerCompanyTagId) { + this.handlerCompanyTagId = handlerCompanyTagId; + } + + public List getHandlerCompanyTagArray() { + return handlerCompanyTagArray; + } + + public void setHandlerCompanyTagArray(List handlerCompanyTagArray) { + this.handlerCompanyTagArray = handlerCompanyTagArray; + } + + public String getHandlerWechatTagId() { + return handlerWechatTagId; + } + + public void setHandlerWechatTagId(String handlerWechatTagId) { + this.handlerWechatTagId = handlerWechatTagId; + } + + public List getHandlerWechatTagArray() { + return handlerWechatTagArray; + } + + public void setHandlerWechatTagArray(List handlerWechatTagArray) { + this.handlerWechatTagArray = handlerWechatTagArray; + } + + public String getHandlerCompanyTag() { + return handlerCompanyTag; + } + + public void setHandlerCompanyTag(String handlerCompanyTag) { + this.handlerCompanyTag = handlerCompanyTag; + } + + public String getHandlerWechatTag() { + return handlerWechatTag; + } + + public void setHandlerWechatTag(String handlerWechatTag) { + this.handlerWechatTag = handlerWechatTag; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml index a976e70..3ee5691 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml @@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -23,6 +24,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + @@ -46,12 +51,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, site_name, file_url, site_start_time, site_end_time, user_register_start_time, user_register_end_time, open_type, push_type, push_number, push_timer, show_wechat_tag, show_wechat_tag_id, show_company_tag, show_company_tag_id, forbid_wechat_tag, forbid_wechat_tag_id, forbid_company_tag, forbid_company_tag_id, channel_name, channel_id, machine_name, machine_id, user_type, operate, sign_number, order_number, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from site_info + select id, site_type, site_name, file_url, site_start_time, site_end_time, user_register_start_time, user_register_end_time, open_type, push_type, push_number, push_timer, show_wechat_tag, show_wechat_tag_id, show_company_tag, show_company_tag_id, forbid_wechat_tag, forbid_wechat_tag_id, forbid_company_tag, handler_company_tag, handler_company_tag_id, handler_wechat_tag_id, handler_wechat_tag, forbid_company_tag_id, channel_name, channel_id, machine_name, machine_id, user_type, operate, sign_number, order_number, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from site_info - + insert into site_info - id, + site_type, site_name, file_url, site_start_time, @@ -115,6 +125,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" forbid_wechat_tag, forbid_wechat_tag_id, forbid_company_tag, + handler_company_tag, + handler_company_tag_id, + handler_wechat_tag_id, + handler_wechat_tag, forbid_company_tag_id, channel_name, channel_id, @@ -137,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, - #{id}, + #{siteType}, #{siteName}, #{fileUrl}, #{siteStartTime}, @@ -155,6 +169,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{forbidWechatTag}, #{forbidWechatTagId}, #{forbidCompanyTag}, + #{handlerCompanyTag}, + #{handlerCompanyTagId}, + #{handlerWechatTagId}, + #{handlerWechatTag}, #{forbidCompanyTagId}, #{channelName}, #{channelId}, @@ -181,6 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update site_info + site_type = #{siteType}, site_name = #{siteName}, file_url = #{fileUrl}, site_start_time = #{siteStartTime}, @@ -198,6 +217,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" forbid_wechat_tag = #{forbidWechatTag}, forbid_wechat_tag_id = #{forbidWechatTagId}, forbid_company_tag = #{forbidCompanyTag}, + handler_company_tag = #{handlerCompanyTag}, + handler_company_tag_id = #{handlerCompanyTagId}, + handler_wechat_tag_id = #{handlerWechatTagId}, + handler_wechat_tag = #{handlerWechatTag}, forbid_company_tag_id = #{forbidCompanyTagId}, channel_name = #{channelName}, channel_id = #{channelId}, diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java index 9db512f..038e682 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SiteInfoServiceImpl.java @@ -121,19 +121,21 @@ public class SiteInfoServiceImpl implements ISiteInfoService List showCompanyTagNew = Lists.newArrayList(); List forbidWechatTagNew = Lists.newArrayList(); List forbidCompanyTagNew = Lists.newArrayList(); + List handlerWechatTagNew = Lists.newArrayList(); + List handlerCompanyTagNew = Lists.newArrayList(); List channelListNew = Lists.newArrayList(); - this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew); + this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); // 开始保存关联关系 int i = siteInfoMapper.insertSiteInfo(siteInfo); - this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew); + this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); return i; } // 新增、更新统一处理关联关系 - private void commonHandlerRelation(SiteInfo siteInfo,List showWechatTagNew,List showCompanyTagNew,List forbidWechatTagNew,List forbidCompanyTagNew,List channelListNew){ + private void commonHandlerRelation(SiteInfo siteInfo,List showWechatTagNew,List showCompanyTagNew,List forbidWechatTagNew,List forbidCompanyTagNew,List channelListNew,List handlerWechatTagNew,List handlerCompanyTagNew){ // 保存可见小程序标签关联关系 for (SysTag tag: showWechatTagNew) { SiteInfoTag infoTag = new SiteInfoTag(); @@ -184,9 +186,29 @@ public class SiteInfoServiceImpl implements ISiteInfoService channelInfo.setCreateTime(DateUtils.getNowDate()); siteInfoChannelMapper.insertSiteInfoChannel(channelInfo); } + // 保存获得小程序关联关系 + for (SysTag tag: handlerWechatTagNew) { + SiteInfoTag infoTag = new SiteInfoTag(); + infoTag.setSiteId(siteInfo.getId()); + infoTag.setTagId(tag.getId()); + infoTag.setStatus(2l); + infoTag.setCreateBy(SecurityUtils.getUsername()); + infoTag.setCreateTime(DateUtils.getNowDate()); + siteInfoTagMapper.insertSiteInfoTag(infoTag); + } + // 保存获得企微标签关联关系 + for (SysTag tag: handlerCompanyTagNew) { + SiteInfoTag infoTag = new SiteInfoTag(); + infoTag.setSiteId(siteInfo.getId()); + infoTag.setTagId(tag.getId()); + infoTag.setStatus(2l); + infoTag.setCreateBy(SecurityUtils.getUsername()); + infoTag.setCreateTime(DateUtils.getNowDate()); + siteInfoTagMapper.insertSiteInfoTag(infoTag); + } } // 新增、更新统一调用汇总 - private void commonHandler(SiteInfo siteInfo,List showWechatTagNew,List showCompanyTagNew,List forbidWechatTagNew,List forbidCompanyTagNew,List channelListNew){ + private void commonHandler(SiteInfo siteInfo,List showWechatTagNew,List showCompanyTagNew,List forbidWechatTagNew,List forbidCompanyTagNew,List channelListNew,List handlerWechatTagNew,List handlerCompanyTagNew){ // 如果是自定义频次,则需要保存推送时间 周一到周日 if (!CollectionUtils.isEmpty(siteInfo.getPushTimerArray())) { siteInfo.setPushTimer(StringUtils.join(siteInfo.getPushTimerArray(),",")); @@ -260,6 +282,43 @@ public class SiteInfoServiceImpl implements ISiteInfoService siteInfo.setForbidCompanyTagId(ids); } + // 保存获得企微标签 + if (!CollectionUtils.isEmpty(siteInfo.getHandlerCompanyTagArray())) { + List handlerCompanyTagArray = siteInfo.getHandlerCompanyTagArray(); + for(long tagId : handlerCompanyTagArray) { + SysTag sysTag = sysTagMapper.selectDeptById(tagId); + if (Objects.nonNull(sysTag)) { + handlerCompanyTagNew.add(sysTag); + } + } + } + if (!CollectionUtils.isEmpty(handlerCompanyTagNew)) { + String tagNames = handlerCompanyTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(",")); + siteInfo.setHandlerCompanyTag(tagNames); + List resultList = handlerCompanyTagNew.stream().map(SysTag::getId).collect(Collectors.toList()); + String ids = StringUtils.join(resultList, ","); + siteInfo.setHandlerCompanyTagId(ids); + } + + // 保存获得小程序标签 + if (!CollectionUtils.isEmpty(siteInfo.getHandlerWechatTagArray())) { + List handlerWechatTagArray = siteInfo.getHandlerWechatTagArray(); + for(long tagId : handlerWechatTagArray) { + SysTag sysTag = sysTagMapper.selectDeptById(tagId); + if (Objects.nonNull(sysTag)) { + handlerWechatTagNew.add(sysTag); + } + } + } + if (!CollectionUtils.isEmpty(handlerWechatTagNew)) { + String tagNames = handlerWechatTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(",")); + siteInfo.setHandlerWechatTag(tagNames); + List resultList = handlerWechatTagNew.stream().map(SysTag::getId).collect(Collectors.toList()); + String ids = StringUtils.join(resultList, ","); + siteInfo.setHandlerWechatTagId(ids); + } + + // 保存渠道信息 if (!CollectionUtils.isEmpty(siteInfo.getChannelArray())) { List channelArray = siteInfo.getChannelArray(); @@ -305,12 +364,14 @@ public class SiteInfoServiceImpl implements ISiteInfoService List forbidWechatTagNew = Lists.newArrayList(); List forbidCompanyTagNew = Lists.newArrayList(); List channelListNew = Lists.newArrayList(); - this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew); + List handlerWechatTagNew = Lists.newArrayList(); + List handlerCompanyTagNew = Lists.newArrayList(); + this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); // 删除关联关系 siteInfoTagMapper.deleteSiteInfoTagBySiteId(siteInfo.getId()); // 保存新的关联关系 - this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew); + this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); return siteInfoMapper.updateSiteInfo(siteInfo); } diff --git a/flossom-ui/src/views/system/siteCarouselInfo/index.vue b/flossom-ui/src/views/system/siteCarouselInfo/index.vue new file mode 100644 index 0000000..e91987d --- /dev/null +++ b/flossom-ui/src/views/system/siteCarouselInfo/index.vue @@ -0,0 +1,706 @@ + + + diff --git a/flossom-ui/src/views/system/siteInfo/index.vue b/flossom-ui/src/views/system/siteInfo/index.vue index f096902..d79c851 100644 --- a/flossom-ui/src/views/system/siteInfo/index.vue +++ b/flossom-ui/src/views/system/siteInfo/index.vue @@ -148,7 +148,7 @@ size="mini" type="text" icon="el-icon-edit" - @click="handleUpdate(scope.row)" + @click="handleUpdate(scope.row, 'edit')" v-hasPermi="['system:siteInfo:edit']" >修改 删除 + 复制 - + @@ -405,6 +412,8 @@ export default { return { // 遮罩层 loading: true, + // opearte + operate: 'copy', // 选中数组 ids: [], // 非单个禁用 @@ -443,6 +452,7 @@ export default { queryParams: { pageNum: 1, pageSize: 10, + siteType: 1, siteName: null, fileUrl: null, siteStartTime: null, @@ -511,6 +521,7 @@ export default { reset() { this.form = { id: null, + siteType: null, siteName: null, fileUrl: null, siteStartTime: null, @@ -574,7 +585,8 @@ export default { this.title = "添加站点管理"; }, /** 修改按钮操作 */ - handleUpdate(row) { + handleUpdate(row, operate) { + this.operate = operate; this.reset(); const id = row.id || this.ids getInfo(id).then(response => { @@ -623,15 +635,19 @@ export default { } else { this.form.operate = 2; } + this.form.siteType = 1; this.form.startTime = []; this.form.registerTime = []; - if (this.form.id != null) { + if (this.form.id != null && this.operate == 'edit') { updateInfo(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { + if (this.operate == 'copy'){ + this.form.id = null; + } addInfo(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false;