Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104
commit
4aa737d1a8
@ -0,0 +1,62 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.SiteInfoChannel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点与渠道关联Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-21
|
||||
*/
|
||||
public interface SiteInfoChannelMapper
|
||||
{
|
||||
/**
|
||||
* 查询站点与渠道关联
|
||||
*
|
||||
* @param id 站点与渠道关联主键
|
||||
* @return 站点与渠道关联
|
||||
*/
|
||||
public SiteInfoChannel selectSiteInfoChannelById(Long id);
|
||||
|
||||
/**
|
||||
* 查询站点与渠道关联列表
|
||||
*
|
||||
* @param siteInfoChannel 站点与渠道关联
|
||||
* @return 站点与渠道关联集合
|
||||
*/
|
||||
public List<SiteInfoChannel> selectSiteInfoChannelList(SiteInfoChannel siteInfoChannel);
|
||||
|
||||
/**
|
||||
* 新增站点与渠道关联
|
||||
*
|
||||
* @param siteInfoChannel 站点与渠道关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSiteInfoChannel(SiteInfoChannel siteInfoChannel);
|
||||
|
||||
/**
|
||||
* 修改站点与渠道关联
|
||||
*
|
||||
* @param siteInfoChannel 站点与渠道关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSiteInfoChannel(SiteInfoChannel siteInfoChannel);
|
||||
|
||||
/**
|
||||
* 删除站点与渠道关联
|
||||
*
|
||||
* @param id 站点与渠道关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoChannelById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除站点与渠道关联
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoChannelByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.SiteInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点管理Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
public interface SiteInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询站点管理
|
||||
*
|
||||
* @param id 站点管理主键
|
||||
* @return 站点管理
|
||||
*/
|
||||
public SiteInfo selectSiteInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询站点管理列表
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 站点管理集合
|
||||
*/
|
||||
public List<SiteInfo> selectSiteInfoList(SiteInfo siteInfo);
|
||||
|
||||
/**
|
||||
* 新增站点管理
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSiteInfo(SiteInfo siteInfo);
|
||||
|
||||
/**
|
||||
* 修改站点管理
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSiteInfo(SiteInfo siteInfo);
|
||||
|
||||
/**
|
||||
* 删除站点管理
|
||||
*
|
||||
* @param id 站点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除站点管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.entity.SiteInfoTag;
|
||||
|
||||
/**
|
||||
* 站点与标签关联Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-21
|
||||
*/
|
||||
public interface SiteInfoTagMapper
|
||||
{
|
||||
/**
|
||||
* 查询站点与标签关联
|
||||
*
|
||||
* @param id 站点与标签关联主键
|
||||
* @return 站点与标签关联
|
||||
*/
|
||||
public SiteInfoTag selectSiteInfoTagById(Long id);
|
||||
|
||||
/**
|
||||
* 查询站点与标签关联列表
|
||||
*
|
||||
* @param siteInfoTag 站点与标签关联
|
||||
* @return 站点与标签关联集合
|
||||
*/
|
||||
public List<SiteInfoTag> selectSiteInfoTagList(SiteInfoTag siteInfoTag);
|
||||
|
||||
/**
|
||||
* 新增站点与标签关联
|
||||
*
|
||||
* @param siteInfoTag 站点与标签关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSiteInfoTag(SiteInfoTag siteInfoTag);
|
||||
|
||||
/**
|
||||
* 修改站点与标签关联
|
||||
*
|
||||
* @param siteInfoTag 站点与标签关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSiteInfoTag(SiteInfoTag siteInfoTag);
|
||||
|
||||
/**
|
||||
* 删除站点与标签关联
|
||||
*
|
||||
* @param id 站点与标签关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoTagById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除站点与标签关联
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoTagByIds(Long[] ids);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除站点与标签关联
|
||||
*
|
||||
* @param id 站点与标签关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoTagBySiteId(Long id);
|
||||
}
|
||||
@ -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.SiteInfoChannelMapper">
|
||||
|
||||
<resultMap type="SiteInfoChannel" id="SiteInfoChannelResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
<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" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSiteInfoChannelVo">
|
||||
select id, site_id, channel_id, status, create_by, create_time, update_by, update_time, remark from site_info_channel
|
||||
</sql>
|
||||
|
||||
<select id="selectSiteInfoChannelList" parameterType="SiteInfoChannel" resultMap="SiteInfoChannelResult">
|
||||
<include refid="selectSiteInfoChannelVo"/>
|
||||
<where>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="channelId != null "> and channel_id = #{channelId}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSiteInfoChannelById" parameterType="Long" resultMap="SiteInfoChannelResult">
|
||||
<include refid="selectSiteInfoChannelVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSiteInfoChannel" parameterType="SiteInfoChannel" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into site_info_channel
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="channelId != null">channel_id,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="channelId != null">#{channelId},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSiteInfoChannel" parameterType="SiteInfoChannel">
|
||||
update site_info_channel
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="channelId != null">channel_id = #{channelId},</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>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSiteInfoChannelById" parameterType="Long">
|
||||
delete from site_info_channel where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSiteInfoChannelByIds" parameterType="String">
|
||||
delete from site_info_channel where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,235 @@
|
||||
<?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.SiteInfoMapper">
|
||||
|
||||
<resultMap type="SiteInfo" id="SiteInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteName" column="site_name" />
|
||||
<result property="fileUrl" column="file_url" />
|
||||
<result property="siteStartTime" column="site_start_time" />
|
||||
<result property="siteEndTime" column="site_end_time" />
|
||||
<result property="userRegisterStartTime" column="user_register_start_time" />
|
||||
<result property="userRegisterEndTime" column="user_register_end_time" />
|
||||
<result property="openType" column="open_type" />
|
||||
<result property="pushType" column="push_type" />
|
||||
<result property="pushNumber" column="push_number" />
|
||||
<result property="pushTimer" column="push_timer" />
|
||||
<result property="showWechatTag" column="show_wechat_tag" />
|
||||
<result property="showWechatTagId" column="show_wechat_tag_id" />
|
||||
<result property="showCompanyTag" column="show_company_tag" />
|
||||
<result property="showCompanyTagId" column="show_company_tag_id" />
|
||||
<result property="forbidWechatTag" column="forbid_wechat_tag" />
|
||||
<result property="forbidWechatTagId" column="forbid_wechat_tag_id" />
|
||||
<result property="forbidCompanyTag" column="forbid_company_tag" />
|
||||
<result property="forbidCompanyTagId" column="forbid_company_tag_id" />
|
||||
<result property="channelName" column="channel_name" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
<result property="machineName" column="machine_name" />
|
||||
<result property="machineId" column="machine_id" />
|
||||
<result property="userType" column="user_type" />
|
||||
<result property="operate" column="operate" />
|
||||
<result property="signNumber" column="sign_number" />
|
||||
<result property="orderNumber" column="order_number" />
|
||||
<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="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="selectSiteInfoVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectSiteInfoList" parameterType="SiteInfo" resultMap="SiteInfoResult">
|
||||
<include refid="selectSiteInfoVo"/>
|
||||
<where>
|
||||
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
<if test="siteStartTime != null "> and site_start_time = #{siteStartTime}</if>
|
||||
<if test="siteEndTime != null "> and site_end_time = #{siteEndTime}</if>
|
||||
<if test="userRegisterStartTime != null "> and user_register_start_time = #{userRegisterStartTime}</if>
|
||||
<if test="userRegisterEndTime != null "> and user_register_end_time = #{userRegisterEndTime}</if>
|
||||
<if test="openType != null "> and open_type = #{openType}</if>
|
||||
<if test="pushType != null "> and push_type = #{pushType}</if>
|
||||
<if test="pushNumber != null "> and push_number = #{pushNumber}</if>
|
||||
<if test="pushTimer != null and pushTimer != ''"> and push_timer = #{pushTimer}</if>
|
||||
<if test="showWechatTag != null and showWechatTag != ''"> and show_wechat_tag = #{showWechatTag}</if>
|
||||
<if test="showWechatTagId != null and showWechatTagId != ''"> and show_wechat_tag_id = #{showWechatTagId}</if>
|
||||
<if test="showCompanyTag != null and showCompanyTag != ''"> and show_company_tag = #{showCompanyTag}</if>
|
||||
<if test="showCompanyTagId != null and showCompanyTagId != ''"> and show_company_tag_id = #{showCompanyTagId}</if>
|
||||
<if test="forbidWechatTag != null and forbidWechatTag != ''"> and forbid_wechat_tag = #{forbidWechatTag}</if>
|
||||
<if test="forbidWechatTagId != null and forbidWechatTagId != ''"> and forbid_wechat_tag_id = #{forbidWechatTagId}</if>
|
||||
<if test="forbidCompanyTag != null and forbidCompanyTag != ''"> and forbid_company_tag = #{forbidCompanyTag}</if>
|
||||
<if test="forbidCompanyTagId != null and forbidCompanyTagId != ''"> and forbid_company_tag_id = #{forbidCompanyTagId}</if>
|
||||
<if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
|
||||
<if test="channelId != null and channelId != ''"> and channel_id = #{channelId}</if>
|
||||
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
|
||||
<if test="machineId != null and machineId != ''"> and machine_id = #{machineId}</if>
|
||||
<if test="userType != null "> and user_type = #{userType}</if>
|
||||
<if test="operate != null "> and operate = #{operate}</if>
|
||||
<if test="signNumber != null "> and sign_number = #{signNumber}</if>
|
||||
<if test="orderNumber != null "> and order_number = #{orderNumber}</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>
|
||||
</where>
|
||||
order by order_number desc ,create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSiteInfoById" parameterType="Long" resultMap="SiteInfoResult">
|
||||
<include refid="selectSiteInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSiteInfo" parameterType="SiteInfo">
|
||||
insert into site_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="siteName != null">site_name,</if>
|
||||
<if test="fileUrl != null">file_url,</if>
|
||||
<if test="siteStartTime != null">site_start_time,</if>
|
||||
<if test="siteEndTime != null">site_end_time,</if>
|
||||
<if test="userRegisterStartTime != null">user_register_start_time,</if>
|
||||
<if test="userRegisterEndTime != null">user_register_end_time,</if>
|
||||
<if test="openType != null">open_type,</if>
|
||||
<if test="pushType != null">push_type,</if>
|
||||
<if test="pushNumber != null">push_number,</if>
|
||||
<if test="pushTimer != null">push_timer,</if>
|
||||
<if test="showWechatTag != null">show_wechat_tag,</if>
|
||||
<if test="showWechatTagId != null">show_wechat_tag_id,</if>
|
||||
<if test="showCompanyTag != null">show_company_tag,</if>
|
||||
<if test="showCompanyTagId != null">show_company_tag_id,</if>
|
||||
<if test="forbidWechatTag != null">forbid_wechat_tag,</if>
|
||||
<if test="forbidWechatTagId != null">forbid_wechat_tag_id,</if>
|
||||
<if test="forbidCompanyTag != null">forbid_company_tag,</if>
|
||||
<if test="forbidCompanyTagId != null">forbid_company_tag_id,</if>
|
||||
<if test="channelName != null">channel_name,</if>
|
||||
<if test="channelId != null">channel_id,</if>
|
||||
<if test="machineName != null">machine_name,</if>
|
||||
<if test="machineId != null">machine_id,</if>
|
||||
<if test="userType != null">user_type,</if>
|
||||
<if test="operate != null">operate,</if>
|
||||
<if test="signNumber != null">sign_number,</if>
|
||||
<if test="orderNumber != null">order_number,</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="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="id != null">#{id},</if>
|
||||
<if test="siteName != null">#{siteName},</if>
|
||||
<if test="fileUrl != null">#{fileUrl},</if>
|
||||
<if test="siteStartTime != null">#{siteStartTime},</if>
|
||||
<if test="siteEndTime != null">#{siteEndTime},</if>
|
||||
<if test="userRegisterStartTime != null">#{userRegisterStartTime},</if>
|
||||
<if test="userRegisterEndTime != null">#{userRegisterEndTime},</if>
|
||||
<if test="openType != null">#{openType},</if>
|
||||
<if test="pushType != null">#{pushType},</if>
|
||||
<if test="pushNumber != null">#{pushNumber},</if>
|
||||
<if test="pushTimer != null">#{pushTimer},</if>
|
||||
<if test="showWechatTag != null">#{showWechatTag},</if>
|
||||
<if test="showWechatTagId != null">#{showWechatTagId},</if>
|
||||
<if test="showCompanyTag != null">#{showCompanyTag},</if>
|
||||
<if test="showCompanyTagId != null">#{showCompanyTagId},</if>
|
||||
<if test="forbidWechatTag != null">#{forbidWechatTag},</if>
|
||||
<if test="forbidWechatTagId != null">#{forbidWechatTagId},</if>
|
||||
<if test="forbidCompanyTag != null">#{forbidCompanyTag},</if>
|
||||
<if test="forbidCompanyTagId != null">#{forbidCompanyTagId},</if>
|
||||
<if test="channelName != null">#{channelName},</if>
|
||||
<if test="channelId != null">#{channelId},</if>
|
||||
<if test="machineName != null">#{machineName},</if>
|
||||
<if test="machineId != null">#{machineId},</if>
|
||||
<if test="userType != null">#{userType},</if>
|
||||
<if test="operate != null">#{operate},</if>
|
||||
<if test="signNumber != null">#{signNumber},</if>
|
||||
<if test="orderNumber != null">#{orderNumber},</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="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="updateSiteInfo" parameterType="SiteInfo">
|
||||
update site_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteName != null">site_name = #{siteName},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
<if test="siteStartTime != null">site_start_time = #{siteStartTime},</if>
|
||||
<if test="siteEndTime != null">site_end_time = #{siteEndTime},</if>
|
||||
<if test="userRegisterStartTime != null">user_register_start_time = #{userRegisterStartTime},</if>
|
||||
<if test="userRegisterEndTime != null">user_register_end_time = #{userRegisterEndTime},</if>
|
||||
<if test="openType != null">open_type = #{openType},</if>
|
||||
<if test="pushType != null">push_type = #{pushType},</if>
|
||||
<if test="pushNumber != null">push_number = #{pushNumber},</if>
|
||||
<if test="pushTimer != null">push_timer = #{pushTimer},</if>
|
||||
<if test="showWechatTag != null">show_wechat_tag = #{showWechatTag},</if>
|
||||
<if test="showWechatTagId != null">show_wechat_tag_id = #{showWechatTagId},</if>
|
||||
<if test="showCompanyTag != null">show_company_tag = #{showCompanyTag},</if>
|
||||
<if test="showCompanyTagId != null">show_company_tag_id = #{showCompanyTagId},</if>
|
||||
<if test="forbidWechatTag != null">forbid_wechat_tag = #{forbidWechatTag},</if>
|
||||
<if test="forbidWechatTagId != null">forbid_wechat_tag_id = #{forbidWechatTagId},</if>
|
||||
<if test="forbidCompanyTag != null">forbid_company_tag = #{forbidCompanyTag},</if>
|
||||
<if test="forbidCompanyTagId != null">forbid_company_tag_id = #{forbidCompanyTagId},</if>
|
||||
<if test="channelName != null">channel_name = #{channelName},</if>
|
||||
<if test="channelId != null">channel_id = #{channelId},</if>
|
||||
<if test="machineName != null">machine_name = #{machineName},</if>
|
||||
<if test="machineId != null">machine_id = #{machineId},</if>
|
||||
<if test="userType != null">user_type = #{userType},</if>
|
||||
<if test="operate != null">operate = #{operate},</if>
|
||||
<if test="signNumber != null">sign_number = #{signNumber},</if>
|
||||
<if test="orderNumber != null">order_number = #{orderNumber},</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="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="deleteSiteInfoById" parameterType="Long">
|
||||
delete from site_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSiteInfoByIds" parameterType="String">
|
||||
delete from site_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,91 @@
|
||||
<?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.SiteInfoTagMapper">
|
||||
|
||||
<resultMap type="SiteInfoTag" id="SiteInfoTagResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="tagId" column="tag_id" />
|
||||
<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" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSiteInfoTagVo">
|
||||
select id, site_id, tag_id, status, create_by, create_time, update_by, update_time, remark from site_info_tag
|
||||
</sql>
|
||||
|
||||
<select id="selectSiteInfoTagList" parameterType="SiteInfoTag" resultMap="SiteInfoTagResult">
|
||||
<include refid="selectSiteInfoTagVo"/>
|
||||
<where>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="tagId != null "> and tag_id = #{tagId}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSiteInfoTagById" parameterType="Long" resultMap="SiteInfoTagResult">
|
||||
<include refid="selectSiteInfoTagVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSiteInfoTag" parameterType="SiteInfoTag" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into site_info_tag
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="tagId != null">tag_id,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="tagId != null">#{tagId},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSiteInfoTag" parameterType="SiteInfoTag">
|
||||
update site_info_tag
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="tagId != null">tag_id = #{tagId},</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>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSiteInfoTagById" parameterType="Long">
|
||||
delete from site_info_tag where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSiteInfoTagByIds" parameterType="String">
|
||||
delete from site_info_tag where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSiteInfoTagBySiteId" parameterType="Long">
|
||||
delete from site_info_tag where site_id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,106 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.flossom.common.core.domain.entity.SiteInfo;
|
||||
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.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.flossom.system.service.ISiteInfoService;
|
||||
|
||||
/**
|
||||
* 站点管理Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/siteInfo")
|
||||
public class SiteInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISiteInfoService siteInfoService;
|
||||
|
||||
/**
|
||||
* 查询站点管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:siteInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SiteInfo siteInfo)
|
||||
{
|
||||
startPage();
|
||||
List<SiteInfo> list = siteInfoService.selectSiteInfoList(siteInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出站点管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:siteInfo:export")
|
||||
@Log(title = "站点管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SiteInfo siteInfo)
|
||||
{
|
||||
List<SiteInfo> list = siteInfoService.selectSiteInfoList(siteInfo);
|
||||
ExcelUtil<SiteInfo> util = new ExcelUtil<SiteInfo>(SiteInfo.class);
|
||||
util.exportExcel(response, list, "站点管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点管理详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:siteInfo:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(siteInfoService.selectSiteInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增站点管理
|
||||
*/
|
||||
@RequiresPermissions("system:siteInfo:add")
|
||||
@Log(title = "站点管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SiteInfo siteInfo)
|
||||
{
|
||||
return toAjax(siteInfoService.insertSiteInfo(siteInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改站点管理
|
||||
*/
|
||||
@RequiresPermissions("system:siteInfo:edit")
|
||||
@Log(title = "站点管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SiteInfo siteInfo)
|
||||
{
|
||||
return toAjax(siteInfoService.updateSiteInfo(siteInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除站点管理
|
||||
*/
|
||||
@RequiresPermissions("system:siteInfo:remove")
|
||||
@Log(title = "站点管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(siteInfoService.deleteSiteInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.SiteInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点管理Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
public interface ISiteInfoService
|
||||
{
|
||||
/**
|
||||
* 查询站点管理
|
||||
*
|
||||
* @param id 站点管理主键
|
||||
* @return 站点管理
|
||||
*/
|
||||
public SiteInfo selectSiteInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询站点管理列表
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 站点管理集合
|
||||
*/
|
||||
public List<SiteInfo> selectSiteInfoList(SiteInfo siteInfo);
|
||||
|
||||
/**
|
||||
* 新增站点管理
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSiteInfo(SiteInfo siteInfo);
|
||||
|
||||
/**
|
||||
* 修改站点管理
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSiteInfo(SiteInfo siteInfo);
|
||||
|
||||
/**
|
||||
* 批量删除站点管理
|
||||
*
|
||||
* @param ids 需要删除的站点管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除站点管理信息
|
||||
*
|
||||
* @param id 站点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,340 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.flossom.common.core.domain.entity.*;
|
||||
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 org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.ISiteInfoService;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 站点管理Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
@Service
|
||||
public class SiteInfoServiceImpl implements ISiteInfoService
|
||||
{
|
||||
@Autowired
|
||||
private SiteInfoMapper siteInfoMapper;
|
||||
@Autowired
|
||||
private SysTagMapper sysTagMapper;
|
||||
@Autowired
|
||||
private ActivityChannelInfoMapper activityChannelInfoMapper;
|
||||
@Autowired
|
||||
private SiteInfoTagMapper siteInfoTagMapper;
|
||||
@Autowired
|
||||
private SiteInfoChannelMapper siteInfoChannelMapper;
|
||||
/**
|
||||
* 查询站点管理
|
||||
*
|
||||
* @param id 站点管理主键
|
||||
* @return 站点管理
|
||||
*/
|
||||
@Override
|
||||
public SiteInfo selectSiteInfoById(Long id)
|
||||
{
|
||||
// 开始处理回显
|
||||
SiteInfo siteInfo = siteInfoMapper.selectSiteInfoById(id);
|
||||
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
if(Objects.nonNull(siteInfo.getSiteStartTime())) {
|
||||
siteInfo.getStartTime().add(sd.format(siteInfo.getSiteStartTime()));
|
||||
}
|
||||
if(Objects.nonNull(siteInfo.getSiteEndTime())) {
|
||||
siteInfo.getStartTime().add(sd.format(siteInfo.getSiteEndTime()));
|
||||
}
|
||||
if(Objects.nonNull(siteInfo.getUserRegisterStartTime())) {
|
||||
siteInfo.getRegisterTime().add(sd.format(siteInfo.getUserRegisterStartTime()));
|
||||
}
|
||||
if(Objects.nonNull(siteInfo.getUserRegisterEndTime())) {
|
||||
siteInfo.getRegisterTime().add(sd.format(siteInfo.getUserRegisterEndTime()));
|
||||
}
|
||||
// 处理推送时间
|
||||
if (StringUtils.isNotEmpty(siteInfo.getPushTimer())) {
|
||||
List<Long> pushTimerList = Arrays.asList(siteInfo.getPushTimer().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
siteInfo.setPushTimerArray(pushTimerList);
|
||||
}
|
||||
// 处理禁用企微标签数组
|
||||
if (StringUtils.isNotEmpty(siteInfo.getForbidCompanyTagId())) {
|
||||
List<Long> forbidCompanyList = Arrays.asList(siteInfo.getForbidCompanyTagId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
siteInfo.setForbidCompanyTagArray(forbidCompanyList);
|
||||
}
|
||||
// 处理禁用小程序标签数组
|
||||
if (StringUtils.isNotEmpty(siteInfo.getForbidWechatTagId())) {
|
||||
List<Long> forbidWechatList = Arrays.asList(siteInfo.getForbidWechatTagId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
siteInfo.setForbidWechatTagArray(forbidWechatList);
|
||||
}
|
||||
// 处理可见小程序标签数组
|
||||
if (StringUtils.isNotEmpty(siteInfo.getShowWechatTagId())) {
|
||||
List<Long> showWechatList = Arrays.asList(siteInfo.getShowWechatTagId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
siteInfo.setShowWechatTagArray(showWechatList);
|
||||
}
|
||||
// 处理可见企微标签数组
|
||||
if (StringUtils.isNotEmpty(siteInfo.getShowCompanyTagId())) {
|
||||
List<Long> showCompanyList = Arrays.asList(siteInfo.getShowCompanyTagId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
siteInfo.setShowCompanyTagArray(showCompanyList);
|
||||
}
|
||||
// 处理渠道展示
|
||||
if (StringUtils.isNotEmpty(siteInfo.getChannelId())) {
|
||||
List<Long> channelLisn = Arrays.asList(siteInfo.getChannelId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
siteInfo.setChannelArray(channelLisn);
|
||||
}
|
||||
|
||||
return siteInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询站点管理列表
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 站点管理
|
||||
*/
|
||||
@Override
|
||||
public List<SiteInfo> selectSiteInfoList(SiteInfo siteInfo)
|
||||
{
|
||||
return siteInfoMapper.selectSiteInfoList(siteInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增站点管理
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSiteInfo(SiteInfo siteInfo)
|
||||
{
|
||||
siteInfo.setCreateTime(DateUtils.getNowDate());
|
||||
siteInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
List<SysTag> showWechatTagNew = Lists.newArrayList();
|
||||
List<SysTag> showCompanyTagNew = Lists.newArrayList();
|
||||
List<SysTag> forbidWechatTagNew = Lists.newArrayList();
|
||||
List<SysTag> forbidCompanyTagNew = Lists.newArrayList();
|
||||
List<ActivityChannelInfo> channelListNew = Lists.newArrayList();
|
||||
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
|
||||
|
||||
// 开始保存关联关系
|
||||
int i = siteInfoMapper.insertSiteInfo(siteInfo);
|
||||
|
||||
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
// 新增、更新统一处理关联关系
|
||||
private void commonHandlerRelation(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew){
|
||||
// 保存可见小程序标签关联关系
|
||||
for (SysTag tag: showWechatTagNew) {
|
||||
SiteInfoTag infoTag = new SiteInfoTag();
|
||||
infoTag.setSiteId(siteInfo.getId());
|
||||
infoTag.setTagId(tag.getId());
|
||||
infoTag.setStatus(0l);
|
||||
infoTag.setCreateBy(SecurityUtils.getUsername());
|
||||
infoTag.setCreateTime(DateUtils.getNowDate());
|
||||
siteInfoTagMapper.insertSiteInfoTag(infoTag);
|
||||
}
|
||||
// 保存可见企微标签关联关系
|
||||
for (SysTag tag: showCompanyTagNew) {
|
||||
SiteInfoTag infoTag = new SiteInfoTag();
|
||||
infoTag.setSiteId(siteInfo.getId());
|
||||
infoTag.setTagId(tag.getId());
|
||||
infoTag.setStatus(0l);
|
||||
infoTag.setCreateBy(SecurityUtils.getUsername());
|
||||
infoTag.setCreateTime(DateUtils.getNowDate());
|
||||
siteInfoTagMapper.insertSiteInfoTag(infoTag);
|
||||
}
|
||||
// 保存禁用小程序关联关系
|
||||
for (SysTag tag: forbidWechatTagNew) {
|
||||
SiteInfoTag infoTag = new SiteInfoTag();
|
||||
infoTag.setSiteId(siteInfo.getId());
|
||||
infoTag.setTagId(tag.getId());
|
||||
infoTag.setStatus(1l);
|
||||
infoTag.setCreateBy(SecurityUtils.getUsername());
|
||||
infoTag.setCreateTime(DateUtils.getNowDate());
|
||||
siteInfoTagMapper.insertSiteInfoTag(infoTag);
|
||||
}
|
||||
// 保存禁用企微标签关联关系
|
||||
for (SysTag tag: forbidCompanyTagNew) {
|
||||
SiteInfoTag infoTag = new SiteInfoTag();
|
||||
infoTag.setSiteId(siteInfo.getId());
|
||||
infoTag.setTagId(tag.getId());
|
||||
infoTag.setStatus(1l);
|
||||
infoTag.setCreateBy(SecurityUtils.getUsername());
|
||||
infoTag.setCreateTime(DateUtils.getNowDate());
|
||||
siteInfoTagMapper.insertSiteInfoTag(infoTag);
|
||||
}
|
||||
// 保存渠道关联关系
|
||||
for (ActivityChannelInfo channel: channelListNew) {
|
||||
SiteInfoChannel channelInfo = new SiteInfoChannel();
|
||||
channelInfo.setSiteId(siteInfo.getId());
|
||||
channelInfo.setChannelId(channel.getId());
|
||||
channelInfo.setStatus(0l);
|
||||
channelInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
channelInfo.setCreateTime(DateUtils.getNowDate());
|
||||
siteInfoChannelMapper.insertSiteInfoChannel(channelInfo);
|
||||
}
|
||||
}
|
||||
// 新增、更新统一调用汇总
|
||||
private void commonHandler(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew){
|
||||
// 如果是自定义频次,则需要保存推送时间 周一到周日
|
||||
if (!CollectionUtils.isEmpty(siteInfo.getPushTimerArray())) {
|
||||
siteInfo.setPushTimer(StringUtils.join(siteInfo.getPushTimerArray(),","));
|
||||
}
|
||||
// 保存可见小程序标签
|
||||
if (!CollectionUtils.isEmpty(siteInfo.getShowWechatTagArray())) {
|
||||
List<Long> showWechatTagArray = siteInfo.getShowWechatTagArray();
|
||||
for(long tagId : showWechatTagArray) {
|
||||
SysTag sysTag = sysTagMapper.selectDeptById(tagId);
|
||||
if (Objects.nonNull(sysTag)) {
|
||||
showWechatTagNew.add(sysTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(showWechatTagNew)) {
|
||||
String tagNames = showWechatTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(","));
|
||||
siteInfo.setShowWechatTag(tagNames);
|
||||
List<Long> resultList = showWechatTagNew.stream().map(SysTag::getId).collect(Collectors.toList());
|
||||
String ids = StringUtils.join(resultList, ",");
|
||||
siteInfo.setShowWechatTagId(ids);
|
||||
}
|
||||
// 保存可见企微标签
|
||||
if (!CollectionUtils.isEmpty(siteInfo.getShowCompanyTagArray())) {
|
||||
List<Long> showCompanyTagArray = siteInfo.getShowCompanyTagArray();
|
||||
for(long tagId : showCompanyTagArray) {
|
||||
SysTag sysTag = sysTagMapper.selectDeptById(tagId);
|
||||
if (Objects.nonNull(sysTag)) {
|
||||
showCompanyTagNew.add(sysTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(showCompanyTagNew)) {
|
||||
String tagNames = showCompanyTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(","));
|
||||
siteInfo.setShowCompanyTag(tagNames);
|
||||
List<Long> resultList = showCompanyTagNew.stream().map(SysTag::getId).collect(Collectors.toList());
|
||||
String ids = StringUtils.join(resultList, ",");
|
||||
siteInfo.setShowCompanyTagId(ids);
|
||||
}
|
||||
// 保存禁用小程序标签
|
||||
if (!CollectionUtils.isEmpty(siteInfo.getForbidWechatTagArray())) {
|
||||
List<Long> forbidWechatTagArray = siteInfo.getForbidWechatTagArray();
|
||||
for(long tagId : forbidWechatTagArray) {
|
||||
SysTag sysTag = sysTagMapper.selectDeptById(tagId);
|
||||
if (Objects.nonNull(sysTag)) {
|
||||
forbidWechatTagNew.add(sysTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(forbidWechatTagNew)) {
|
||||
String tagNames = forbidWechatTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(","));
|
||||
siteInfo.setForbidWechatTag(tagNames);
|
||||
List<Long> resultList = forbidWechatTagNew.stream().map(SysTag::getId).collect(Collectors.toList());
|
||||
String ids = StringUtils.join(resultList, ",");
|
||||
siteInfo.setForbidWechatTagId(ids);
|
||||
}
|
||||
// 保存禁用企微标签
|
||||
if (!CollectionUtils.isEmpty(siteInfo.getForbidCompanyTagArray())) {
|
||||
List<Long> forbidCompanyTagArray = siteInfo.getForbidCompanyTagArray();
|
||||
for(long tagId : forbidCompanyTagArray) {
|
||||
SysTag sysTag = sysTagMapper.selectDeptById(tagId);
|
||||
if (Objects.nonNull(sysTag)) {
|
||||
forbidCompanyTagNew.add(sysTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(forbidCompanyTagNew)) {
|
||||
String tagNames = forbidCompanyTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(","));
|
||||
siteInfo.setForbidCompanyTag(tagNames);
|
||||
List<Long> resultList = forbidCompanyTagNew.stream().map(SysTag::getId).collect(Collectors.toList());
|
||||
String ids = StringUtils.join(resultList, ",");
|
||||
siteInfo.setForbidCompanyTagId(ids);
|
||||
}
|
||||
|
||||
// 保存渠道信息
|
||||
if (!CollectionUtils.isEmpty(siteInfo.getChannelArray())) {
|
||||
List<Long> channelArray = siteInfo.getChannelArray();
|
||||
for(long channelId : channelArray) {
|
||||
ActivityChannelInfo channelInfo = activityChannelInfoMapper.selectActivityChannelInfoById(channelId);
|
||||
if (Objects.nonNull(channelInfo)) {
|
||||
channelListNew.add(channelInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(channelListNew)) {
|
||||
String channelNames = channelListNew.stream().map(ActivityChannelInfo::getChannelName).collect(Collectors.joining(","));
|
||||
siteInfo.setChannelName(channelNames);
|
||||
List<Long> resultList = channelListNew.stream().map(ActivityChannelInfo::getId).collect(Collectors.toList());
|
||||
String ids = StringUtils.join(resultList, ",");
|
||||
siteInfo.setChannelId(ids);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改站点管理
|
||||
*
|
||||
* @param siteInfo 站点管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSiteInfo(SiteInfo siteInfo)
|
||||
{
|
||||
siteInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
siteInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
siteInfo.setForbidCompanyTag("");
|
||||
siteInfo.setForbidCompanyTagId("");
|
||||
siteInfo.setForbidWechatTag("");
|
||||
siteInfo.setForbidWechatTagId("");
|
||||
siteInfo.setChannelId("");
|
||||
siteInfo.setChannelName("");
|
||||
siteInfo.setShowWechatTagId("");
|
||||
siteInfo.setShowWechatTag("");
|
||||
siteInfo.setShowCompanyTagId("");
|
||||
siteInfo.setShowCompanyTag("");
|
||||
List<SysTag> showWechatTagNew = Lists.newArrayList();
|
||||
List<SysTag> showCompanyTagNew = Lists.newArrayList();
|
||||
List<SysTag> forbidWechatTagNew = Lists.newArrayList();
|
||||
List<SysTag> forbidCompanyTagNew = Lists.newArrayList();
|
||||
List<ActivityChannelInfo> channelListNew = Lists.newArrayList();
|
||||
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
|
||||
// 删除关联关系
|
||||
siteInfoTagMapper.deleteSiteInfoTagBySiteId(siteInfo.getId());
|
||||
|
||||
// 保存新的关联关系
|
||||
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
|
||||
return siteInfoMapper.updateSiteInfo(siteInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除站点管理
|
||||
*
|
||||
* @param ids 需要删除的站点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSiteInfoByIds(Long[] ids)
|
||||
{
|
||||
return siteInfoMapper.deleteSiteInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除站点管理信息
|
||||
*
|
||||
* @param id 站点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSiteInfoById(Long id)
|
||||
{
|
||||
return siteInfoMapper.deleteSiteInfoById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询站点管理列表
|
||||
export function listInfo(query) {
|
||||
return request({
|
||||
url: '/system/siteInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询站点管理详细
|
||||
export function getInfo(id) {
|
||||
return request({
|
||||
url: '/system/siteInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增站点管理
|
||||
export function addInfo(data) {
|
||||
return request({
|
||||
url: '/system/siteInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改站点管理
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/system/siteInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除站点管理
|
||||
export function delInfo(id) {
|
||||
return request({
|
||||
url: '/system/siteInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
Loading…
Reference in New Issue