站点仪器关联关系以及消息模板仪器关联对接

master
elliott 2 years ago
parent 9c5072716a
commit 9d67a0d59d

@ -127,11 +127,11 @@ public class SiteInfo extends BaseEntity
/** 仪器名称 */ /** 仪器名称 */
@Excel(name = "仪器名称") @Excel(name = "仪器名称")
private String machineName; private String instrumentName;
/** 仪器ID */ /** 仪器ID */
@Excel(name = "仪器ID") @Excel(name = "仪器ID")
private String machineId; private String instrumentId;
private List<Long> machineArray = new ArrayList<Long>(); private List<Long> machineArray = new ArrayList<Long>();
private String handlerCompanyTagId; private String handlerCompanyTagId;
@ -382,24 +382,41 @@ public class SiteInfo extends BaseEntity
{ {
return channelId; return channelId;
} }
public void setMachineName(String machineName)
{ public String getInstrumentName() {
this.machineName = machineName; return instrumentName;
} }
public String getMachineName() public void setInstrumentName(String instrumentName) {
{ this.instrumentName = instrumentName;
return machineName;
} }
public void setMachineId(String machineId)
{ public String getInstrumentId() {
this.machineId = machineId; return instrumentId;
} }
public String getMachineId() public void setInstrumentId(String instrumentId) {
{ this.instrumentId = instrumentId;
return machineId;
} }
// public void setMachineName(String machineName)
// {
// this.machineName = machineName;
// }
//
// public String getMachineName()
// {
// return machineName;
// }
// public void setMachineId(String machineId)
// {
// this.machineId = machineId;
// }
//
// public String getMachineId()
// {
// return machineId;
// }
public void setUserType(Integer userType) public void setUserType(Integer userType)
{ {
this.userType = userType; this.userType = userType;
@ -651,8 +668,8 @@ public class SiteInfo extends BaseEntity
.append("forbidCompanyTagId", getForbidCompanyTagId()) .append("forbidCompanyTagId", getForbidCompanyTagId())
.append("channelName", getChannelName()) .append("channelName", getChannelName())
.append("channelId", getChannelId()) .append("channelId", getChannelId())
.append("machineName", getMachineName()) // .append("machineName", getMachineName())
.append("machineId", getMachineId()) // .append("machineId", getMachineId())
.append("userType", getUserType()) .append("userType", getUserType())
.append("operate", getOperate()) .append("operate", getOperate())
.append("signNumber", getSignNumber()) .append("signNumber", getSignNumber())

@ -0,0 +1,69 @@
package com.flossom.common.core.domain.entity;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* site_info_instrument
*
* @author flossom
* @date 2024-01-08
*/
public class SiteInfoInstrument extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 站点id */
@Excel(name = "站点id")
private Long siteId;
/** 仪器ID */
@Excel(name = "仪器ID")
private Long instrumentId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setSiteId(Long siteId)
{
this.siteId = siteId;
}
public Long getSiteId()
{
return siteId;
}
public void setInstrumentId(Long instrumentId)
{
this.instrumentId = instrumentId;
}
public Long getInstrumentId()
{
return instrumentId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("siteId", getSiteId())
.append("instrumentId", getInstrumentId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -28,11 +28,11 @@ public class WxScriptMessage extends BaseEntity
/** 仪器ID */ /** 仪器ID */
@Excel(name = "仪器ID") @Excel(name = "仪器ID")
private Long machineId; private Long instrumentId;
/** 仪器名字 */ /** 仪器名字 */
@Excel(name = "仪器名字") @Excel(name = "仪器名字")
private String machineName; private String instrumentName;
/** 消息内容 */ /** 消息内容 */
@Excel(name = "消息内容") @Excel(name = "消息内容")
@ -97,24 +97,23 @@ public class WxScriptMessage extends BaseEntity
{ {
return messageTitle; return messageTitle;
} }
public void setMachineId(Long machineId)
{ public Long getInstrumentId() {
this.machineId = machineId; return instrumentId;
} }
public Long getMachineId() public void setInstrumentId(Long instrumentId) {
{ this.instrumentId = instrumentId;
return machineId;
} }
public void setMachineName(String machineName)
{ public String getInstrumentName() {
this.machineName = machineName; return instrumentName;
} }
public String getMachineName() public void setInstrumentName(String instrumentName) {
{ this.instrumentName = instrumentName;
return machineName;
} }
public void setMessageContent(String messageContent) public void setMessageContent(String messageContent)
{ {
this.messageContent = messageContent; this.messageContent = messageContent;
@ -203,8 +202,6 @@ public class WxScriptMessage extends BaseEntity
.append("id", getId()) .append("id", getId())
.append("messageType", getMessageType()) .append("messageType", getMessageType())
.append("messageTitle", getMessageTitle()) .append("messageTitle", getMessageTitle())
.append("machineId", getMachineId())
.append("machineName", getMachineName())
.append("messageContent", getMessageContent()) .append("messageContent", getMessageContent())
.append("status", getStatus()) .append("status", getStatus())
.append("type", getType()) .append("type", getType())

@ -0,0 +1,62 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.SiteInfoInstrument;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2024-01-08
*/
public interface SiteInfoInstrumentMapper
{
/**
*
*
* @param id
* @return
*/
public SiteInfoInstrument selectSiteInfoInstrumentById(Long id);
/**
*
*
* @param siteInfoInstrument
* @return
*/
public List<SiteInfoInstrument> selectSiteInfoInstrumentList(SiteInfoInstrument siteInfoInstrument);
/**
*
*
* @param siteInfoInstrument
* @return
*/
public int insertSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument);
/**
*
*
* @param siteInfoInstrument
* @return
*/
public int updateSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument);
/**
*
*
* @param id
* @return
*/
public int deleteSiteInfoInstrumentById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSiteInfoInstrumentByIds(Long[] ids);
}

@ -0,0 +1,79 @@
<?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.SiteInfoInstrumentMapper">
<resultMap type="SiteInfoInstrument" id="SiteInfoInstrumentResult">
<result property="id" column="id" />
<result property="siteId" column="site_id" />
<result property="instrumentId" column="instrument_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="selectSiteInfoInstrumentVo">
select id, site_id, instrument_id, create_by, create_time, update_by, update_time from site_info_instrument
</sql>
<select id="selectSiteInfoInstrumentList" parameterType="SiteInfoInstrument" resultMap="SiteInfoInstrumentResult">
<include refid="selectSiteInfoInstrumentVo"/>
<where>
<if test="siteId != null "> and site_id = #{siteId}</if>
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
</where>
</select>
<select id="selectSiteInfoInstrumentById" parameterType="Long" resultMap="SiteInfoInstrumentResult">
<include refid="selectSiteInfoInstrumentVo"/>
where id = #{id}
</select>
<insert id="insertSiteInfoInstrument" parameterType="SiteInfoInstrument">
insert into site_info_instrument
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="siteId != null">site_id,</if>
<if test="instrumentId != null">instrument_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="siteId != null">#{siteId},</if>
<if test="instrumentId != null">#{instrumentId},</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="updateSiteInfoInstrument" parameterType="SiteInfoInstrument">
update site_info_instrument
<trim prefix="SET" suffixOverrides=",">
<if test="siteId != null">site_id = #{siteId},</if>
<if test="instrumentId != null">instrument_id = #{instrumentId},</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="deleteSiteInfoInstrumentById" parameterType="Long">
delete from site_info_instrument where id = #{id}
</delete>
<delete id="deleteSiteInfoInstrumentByIds" parameterType="String">
delete from site_info_instrument where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -31,8 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="forbidCompanyTagId" column="forbid_company_tag_id" /> <result property="forbidCompanyTagId" column="forbid_company_tag_id" />
<result property="channelName" column="channel_name" /> <result property="channelName" column="channel_name" />
<result property="channelId" column="channel_id" /> <result property="channelId" column="channel_id" />
<result property="machineName" column="machine_name" /> <result property="instrumentName" column="instrument_name" />
<result property="machineId" column="machine_id" /> <result property="instrumentId" column="instrument_id" />
<result property="userType" column="user_type" /> <result property="userType" column="user_type" />
<result property="operate" column="operate" /> <result property="operate" column="operate" />
<result property="signNumber" column="sign_number" /> <result property="signNumber" column="sign_number" />
@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSiteInfoVo"> <sql id="selectSiteInfoVo">
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 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, instrument_name, instrument_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> </sql>
<select id="selectSiteInfoList" parameterType="SiteInfo" resultMap="SiteInfoResult"> <select id="selectSiteInfoList" parameterType="SiteInfo" resultMap="SiteInfoResult">
@ -82,8 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidCompanyTagId != null and forbidCompanyTagId != ''"> and forbid_company_tag_id = #{forbidCompanyTagId}</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="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
<if test="channelId != null and channelId != ''"> and channel_id = #{channelId}</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="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
<if test="machineId != null and machineId != ''"> and machine_id = #{machineId}</if> <if test="instrumentId != null and instrumentId != ''"> and instrument_id = #{instrumentId}</if>
<if test="userType != null "> and user_type = #{userType}</if> <if test="userType != null "> and user_type = #{userType}</if>
<if test="operate != null "> and operate = #{operate}</if> <if test="operate != null "> and operate = #{operate}</if>
<if test="signNumber != null "> and sign_number = #{signNumber}</if> <if test="signNumber != null "> and sign_number = #{signNumber}</if>
@ -132,8 +132,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidCompanyTagId != null">forbid_company_tag_id,</if> <if test="forbidCompanyTagId != null">forbid_company_tag_id,</if>
<if test="channelName != null">channel_name,</if> <if test="channelName != null">channel_name,</if>
<if test="channelId != null">channel_id,</if> <if test="channelId != null">channel_id,</if>
<if test="machineName != null">machine_name,</if> <if test="instrumentName != null">instrument_name,</if>
<if test="machineId != null">machine_id,</if> <if test="instrumentId != null">instrument_id,</if>
<if test="userType != null">user_type,</if> <if test="userType != null">user_type,</if>
<if test="operate != null">operate,</if> <if test="operate != null">operate,</if>
<if test="signNumber != null">sign_number,</if> <if test="signNumber != null">sign_number,</if>
@ -176,8 +176,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidCompanyTagId != null">#{forbidCompanyTagId},</if> <if test="forbidCompanyTagId != null">#{forbidCompanyTagId},</if>
<if test="channelName != null">#{channelName},</if> <if test="channelName != null">#{channelName},</if>
<if test="channelId != null">#{channelId},</if> <if test="channelId != null">#{channelId},</if>
<if test="machineName != null">#{machineName},</if> <if test="instrumentName != null">#{instrumentName},</if>
<if test="machineId != null">#{machineId},</if> <if test="instrumentId != null">#{instrumentId},</if>
<if test="userType != null">#{userType},</if> <if test="userType != null">#{userType},</if>
<if test="operate != null">#{operate},</if> <if test="operate != null">#{operate},</if>
<if test="signNumber != null">#{signNumber},</if> <if test="signNumber != null">#{signNumber},</if>
@ -224,8 +224,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidCompanyTagId != null">forbid_company_tag_id = #{forbidCompanyTagId},</if> <if test="forbidCompanyTagId != null">forbid_company_tag_id = #{forbidCompanyTagId},</if>
<if test="channelName != null">channel_name = #{channelName},</if> <if test="channelName != null">channel_name = #{channelName},</if>
<if test="channelId != null">channel_id = #{channelId},</if> <if test="channelId != null">channel_id = #{channelId},</if>
<if test="machineName != null">machine_name = #{machineName},</if> <if test="instrumentName != null">instrument_name = #{instrumentName},</if>
<if test="machineId != null">machine_id = #{machineId},</if> <if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="userType != null">user_type = #{userType},</if> <if test="userType != null">user_type = #{userType},</if>
<if test="operate != null">operate = #{operate},</if> <if test="operate != null">operate = #{operate},</if>
<if test="signNumber != null">sign_number = #{signNumber},</if> <if test="signNumber != null">sign_number = #{signNumber},</if>

@ -8,8 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" /> <result property="id" column="id" />
<result property="messageType" column="message_type" /> <result property="messageType" column="message_type" />
<result property="messageTitle" column="message_title" /> <result property="messageTitle" column="message_title" />
<result property="machineId" column="machine_id" /> <result property="instrumentId" column="instrument_id" />
<result property="machineName" column="machine_name" /> <result property="instrumentName" column="instrument_name" />
<result property="messageContent" column="message_content" /> <result property="messageContent" column="message_content" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="type" column="type" /> <result property="type" column="type" />
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectWxScriptMessageVo"> <sql id="selectWxScriptMessageVo">
select id, message_type, message_title, machine_id, machine_name, message_content, status, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from wx_script_message select id, message_type, message_title, instrument_id, instrument_name, message_content, status, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from wx_script_message
</sql> </sql>
<select id="selectWxScriptMessageList" parameterType="WxScriptMessage" resultMap="WxScriptMessageResult"> <select id="selectWxScriptMessageList" parameterType="WxScriptMessage" resultMap="WxScriptMessageResult">
@ -34,8 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="messageType != null "> and message_type = #{messageType}</if> <if test="messageType != null "> and message_type = #{messageType}</if>
<if test="messageTitle != null and messageTitle != ''"> and message_title = #{messageTitle}</if> <if test="messageTitle != null and messageTitle != ''"> and message_title = #{messageTitle}</if>
<if test="machineId != null "> and machine_id = #{machineId}</if> <if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if> <if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if> <if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
<if test="type != null "> and type = #{type}</if> <if test="type != null "> and type = #{type}</if>
@ -60,8 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">id,</if> <if test="id != null">id,</if>
<if test="messageType != null">message_type,</if> <if test="messageType != null">message_type,</if>
<if test="messageTitle != null">message_title,</if> <if test="messageTitle != null">message_title,</if>
<if test="machineId != null">machine_id,</if> <if test="instrumentId != null">instrument_id,</if>
<if test="machineName != null">machine_name,</if> <if test="instrumentName != null">instrument_name,</if>
<if test="messageContent != null">message_content,</if> <if test="messageContent != null">message_content,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="type != null">type,</if> <if test="type != null">type,</if>
@ -80,8 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
<if test="messageType != null">#{messageType},</if> <if test="messageType != null">#{messageType},</if>
<if test="messageTitle != null">#{messageTitle},</if> <if test="messageTitle != null">#{messageTitle},</if>
<if test="machineId != null">#{machineId},</if> <if test="instrumentId != null">#{instrumentId},</if>
<if test="machineName != null">#{machineName},</if> <if test="instrumentName != null">#{instrumentName},</if>
<if test="messageContent != null">#{messageContent},</if> <if test="messageContent != null">#{messageContent},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="type != null">#{type},</if> <if test="type != null">#{type},</if>
@ -103,8 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="messageType != null">message_type = #{messageType},</if> <if test="messageType != null">message_type = #{messageType},</if>
<if test="messageTitle != null">message_title = #{messageTitle},</if> <if test="messageTitle != null">message_title = #{messageTitle},</if>
<if test="machineId != null">machine_id = #{machineId},</if> <if test="instrumentId != null">instrument_id = #{instrumentId},</if>
<if test="machineName != null">machine_name = #{machineName},</if> <if test="instrumentName != null">instrument_name = #{instrumentName},</if>
<if test="messageContent != null">message_content = #{messageContent},</if> <if test="messageContent != null">message_content = #{messageContent},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>

@ -0,0 +1,62 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.SiteInfoInstrument;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2024-01-08
*/
public interface ISiteInfoInstrumentService
{
/**
*
*
* @param id
* @return
*/
public SiteInfoInstrument selectSiteInfoInstrumentById(Long id);
/**
*
*
* @param siteInfoInstrument
* @return
*/
public List<SiteInfoInstrument> selectSiteInfoInstrumentList(SiteInfoInstrument siteInfoInstrument);
/**
*
*
* @param siteInfoInstrument
* @return
*/
public int insertSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument);
/**
*
*
* @param siteInfoInstrument
* @return
*/
public int updateSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument);
/**
*
*
* @param ids
* @return
*/
public int deleteSiteInfoInstrumentByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSiteInfoInstrumentById(Long id);
}

@ -0,0 +1,97 @@
package com.flossom.system.service.impl;
import java.util.List;
import com.flossom.common.core.domain.entity.SiteInfoInstrument;
import com.flossom.common.core.mapper.SiteInfoInstrumentMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.ISiteInfoInstrumentService;
/**
* Service
*
* @author flossom
* @date 2024-01-08
*/
@Service
public class SiteInfoInstrumentServiceImpl implements ISiteInfoInstrumentService
{
@Autowired
private SiteInfoInstrumentMapper siteInfoInstrumentMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SiteInfoInstrument selectSiteInfoInstrumentById(Long id)
{
return siteInfoInstrumentMapper.selectSiteInfoInstrumentById(id);
}
/**
*
*
* @param siteInfoInstrument
* @return
*/
@Override
public List<SiteInfoInstrument> selectSiteInfoInstrumentList(SiteInfoInstrument siteInfoInstrument)
{
return siteInfoInstrumentMapper.selectSiteInfoInstrumentList(siteInfoInstrument);
}
/**
*
*
* @param siteInfoInstrument
* @return
*/
@Override
public int insertSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument)
{
siteInfoInstrument.setCreateTime(DateUtils.getNowDate());
return siteInfoInstrumentMapper.insertSiteInfoInstrument(siteInfoInstrument);
}
/**
*
*
* @param siteInfoInstrument
* @return
*/
@Override
public int updateSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument)
{
siteInfoInstrument.setUpdateTime(DateUtils.getNowDate());
return siteInfoInstrumentMapper.updateSiteInfoInstrument(siteInfoInstrument);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSiteInfoInstrumentByIds(Long[] ids)
{
return siteInfoInstrumentMapper.deleteSiteInfoInstrumentByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSiteInfoInstrumentById(Long id)
{
return siteInfoInstrumentMapper.deleteSiteInfoInstrumentById(id);
}
}

@ -36,6 +36,10 @@ public class SiteInfoServiceImpl implements ISiteInfoService
private SiteInfoTagMapper siteInfoTagMapper; private SiteInfoTagMapper siteInfoTagMapper;
@Autowired @Autowired
private SiteInfoChannelMapper siteInfoChannelMapper; private SiteInfoChannelMapper siteInfoChannelMapper;
@Autowired
private WxInstrumentMapper wxInstrumentMapper;
@Autowired
private SiteInfoInstrumentMapper siteInfoInstrumentMapper;
/** /**
* *
* *
@ -87,10 +91,14 @@ public class SiteInfoServiceImpl implements ISiteInfoService
} }
// 处理渠道展示 // 处理渠道展示
if (StringUtils.isNotEmpty(siteInfo.getChannelId())) { if (StringUtils.isNotEmpty(siteInfo.getChannelId())) {
List<Long> channelLisn = Arrays.asList(siteInfo.getChannelId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList()); List<Long> channelList = Arrays.asList(siteInfo.getChannelId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
siteInfo.setChannelArray(channelLisn); siteInfo.setChannelArray(channelList);
}
// 处理仪器展示
if (StringUtils.isNotEmpty(siteInfo.getInstrumentId())) {
List<Long> instrumentList = Arrays.asList(siteInfo.getInstrumentId().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
siteInfo.setMachineArray(instrumentList);
} }
return siteInfo; return siteInfo;
} }
@ -124,18 +132,19 @@ public class SiteInfoServiceImpl implements ISiteInfoService
List<SysTag> handlerWechatTagNew = Lists.newArrayList(); List<SysTag> handlerWechatTagNew = Lists.newArrayList();
List<SysTag> handlerCompanyTagNew = Lists.newArrayList(); List<SysTag> handlerCompanyTagNew = Lists.newArrayList();
List<ActivityChannelInfo> channelListNew = Lists.newArrayList(); List<ActivityChannelInfo> channelListNew = Lists.newArrayList();
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); List<WxInstrument> wxInstrumentsListNew = Lists.newArrayList();
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew,wxInstrumentsListNew);
// 开始保存关联关系 // 开始保存关联关系
int i = siteInfoMapper.insertSiteInfo(siteInfo); int i = siteInfoMapper.insertSiteInfo(siteInfo);
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew,wxInstrumentsListNew);
return i; return i;
} }
// 新增、更新统一处理关联关系 // 新增、更新统一处理关联关系
private void commonHandlerRelation(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew,List<SysTag> handlerWechatTagNew,List<SysTag> handlerCompanyTagNew){ private void commonHandlerRelation(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew,List<SysTag> handlerWechatTagNew,List<SysTag> handlerCompanyTagNew, List<WxInstrument> wxInstrumentsListNew){
// 保存可见小程序标签关联关系 // 保存可见小程序标签关联关系
for (SysTag tag: showWechatTagNew) { for (SysTag tag: showWechatTagNew) {
SiteInfoTag infoTag = new SiteInfoTag(); SiteInfoTag infoTag = new SiteInfoTag();
@ -206,9 +215,18 @@ public class SiteInfoServiceImpl implements ISiteInfoService
infoTag.setCreateTime(DateUtils.getNowDate()); infoTag.setCreateTime(DateUtils.getNowDate());
siteInfoTagMapper.insertSiteInfoTag(infoTag); siteInfoTagMapper.insertSiteInfoTag(infoTag);
} }
// 保存仪器关联信息
for (WxInstrument wxInstrument: wxInstrumentsListNew) {
SiteInfoInstrument infoInstrument = new SiteInfoInstrument();
infoInstrument.setInstrumentId(wxInstrument.getId());
infoInstrument.setSiteId(siteInfo.getId());
infoInstrument.setCreateBy(SecurityUtils.getUsername());
infoInstrument.setCreateTime(DateUtils.getNowDate());
siteInfoInstrumentMapper.insertSiteInfoInstrument(infoInstrument);
}
} }
// 新增、更新统一调用汇总 // 新增、更新统一调用汇总
private void commonHandler(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew,List<SysTag> handlerWechatTagNew,List<SysTag> handlerCompanyTagNew){ private void commonHandler(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew,List<SysTag> handlerWechatTagNew,List<SysTag> handlerCompanyTagNew,List<WxInstrument> wxInstrumentsListNew){
// 如果是自定义频次,则需要保存推送时间 周一到周日 // 如果是自定义频次,则需要保存推送时间 周一到周日
if (!CollectionUtils.isEmpty(siteInfo.getPushTimerArray())) { if (!CollectionUtils.isEmpty(siteInfo.getPushTimerArray())) {
siteInfo.setPushTimer(StringUtils.join(siteInfo.getPushTimerArray(),",")); siteInfo.setPushTimer(StringUtils.join(siteInfo.getPushTimerArray(),","));
@ -336,6 +354,23 @@ public class SiteInfoServiceImpl implements ISiteInfoService
String ids = StringUtils.join(resultList, ","); String ids = StringUtils.join(resultList, ",");
siteInfo.setChannelId(ids); siteInfo.setChannelId(ids);
} }
// 保存仪器信息
if (!CollectionUtils.isEmpty(siteInfo.getMachineArray())) {
List<Long> machineArray = siteInfo.getMachineArray();
for(long instrumentId : machineArray) {
WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(instrumentId);
if (Objects.nonNull(wxInstrument)) {
wxInstrumentsListNew.add(wxInstrument);
}
}
}
if (!CollectionUtils.isEmpty(wxInstrumentsListNew)) {
String channelNames = wxInstrumentsListNew.stream().map(WxInstrument::getName).collect(Collectors.joining(","));
siteInfo.setInstrumentName(channelNames);
List<Long> resultList = wxInstrumentsListNew.stream().map(WxInstrument::getId).collect(Collectors.toList());
String ids = StringUtils.join(resultList, ",");
siteInfo.setInstrumentId(ids);
}
} }
/** /**
@ -359,6 +394,8 @@ public class SiteInfoServiceImpl implements ISiteInfoService
siteInfo.setShowWechatTag(""); siteInfo.setShowWechatTag("");
siteInfo.setShowCompanyTagId(""); siteInfo.setShowCompanyTagId("");
siteInfo.setShowCompanyTag(""); siteInfo.setShowCompanyTag("");
siteInfo.setInstrumentId("");
siteInfo.setInstrumentName("");
List<SysTag> showWechatTagNew = Lists.newArrayList(); List<SysTag> showWechatTagNew = Lists.newArrayList();
List<SysTag> showCompanyTagNew = Lists.newArrayList(); List<SysTag> showCompanyTagNew = Lists.newArrayList();
List<SysTag> forbidWechatTagNew = Lists.newArrayList(); List<SysTag> forbidWechatTagNew = Lists.newArrayList();
@ -366,12 +403,13 @@ public class SiteInfoServiceImpl implements ISiteInfoService
List<ActivityChannelInfo> channelListNew = Lists.newArrayList(); List<ActivityChannelInfo> channelListNew = Lists.newArrayList();
List<SysTag> handlerWechatTagNew = Lists.newArrayList(); List<SysTag> handlerWechatTagNew = Lists.newArrayList();
List<SysTag> handlerCompanyTagNew = Lists.newArrayList(); List<SysTag> handlerCompanyTagNew = Lists.newArrayList();
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); List<WxInstrument> wxInstrumentList = Lists.newArrayList();
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew,wxInstrumentList);
// 删除关联关系 // 删除关联关系
siteInfoTagMapper.deleteSiteInfoTagBySiteId(siteInfo.getId()); siteInfoTagMapper.deleteSiteInfoTagBySiteId(siteInfo.getId());
// 保存新的关联关系 // 保存新的关联关系
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew); this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew,wxInstrumentList);
return siteInfoMapper.updateSiteInfo(siteInfo); return siteInfoMapper.updateSiteInfo(siteInfo);
} }

@ -9,17 +9,17 @@
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
<!-- />--> <!-- />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item label="仪器ID" prop="machineId">--> <!-- <el-form-item label="仪器ID" prop="instrumentId">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.machineId"--> <!-- v-model="queryParams.instrumentId"-->
<!-- placeholder="请输入仪器ID"--> <!-- placeholder="请输入仪器ID"-->
<!-- clearable--> <!-- clearable-->
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
<!-- />--> <!-- />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <el-form-item label="仪器名字" prop="machineName">--> <!-- <el-form-item label="仪器名字" prop="instrumentName">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.machineName"--> <!-- v-model="queryParams.instrumentName"-->
<!-- placeholder="请输入仪器名字"--> <!-- placeholder="请输入仪器名字"-->
<!-- clearable--> <!-- clearable-->
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
@ -219,11 +219,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="仪器信息" prop="userType" v-if="form.messageType == 3"> <el-form-item label="仪器信息" prop="instrumentId" v-if="form.messageType == 3">
<el-select v-model="form.machineId"> <el-select v-model="form.instrumentId">
<el-option label="仪器1" :value="0" :key="0"></el-option> <!-- <el-option label="仪器1" :value="0" :key="0"></el-option>-->
<el-option label="仪器2" :value="1" :key="1"></el-option> <!-- <el-option label="仪器2" :value="1" :key="1"></el-option>-->
<el-option label="仪器3" :value="2" :key="2"></el-option> <!-- <el-option label="仪器3" :value="2" :key="2"></el-option>-->
<el-option
v-for="instrument in instrumentList"
:key="instrument.id"
:label="instrument.name"
:value="instrument.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -293,11 +299,14 @@
<script> <script>
import { listMessage, getMessage, delMessage, addMessage, updateMessage } from "@/api/system/scriptMessage"; import { listMessage, getMessage, delMessage, addMessage, updateMessage } from "@/api/system/scriptMessage";
import { listInstrument } from "@/api/system/instrument";
export default { export default {
name: "Message", name: "Message",
data() { data() {
return { return {
//
instrumentList: [],
// //
loading: true, loading: true,
// //
@ -322,8 +331,8 @@ export default {
pageSize: 10, pageSize: 10,
messageType: null, messageType: null,
messageTitle: null, messageTitle: null,
machineId: null, instrumentId: null,
machineName: null, instrumentName: null,
messageContent: null, messageContent: null,
status: null, status: null,
type: null, type: null,
@ -373,8 +382,15 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.queryInstrumentList();
}, },
methods: { methods: {
//
queryInstrumentList(){
listInstrument(this.queryParams).then(response => {
this.instrumentList = response.rows;
});
},
/** 查询消息模版列表 */ /** 查询消息模版列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -395,8 +411,8 @@ export default {
id: null, id: null,
messageType: null, messageType: null,
messageTitle: null, messageTitle: null,
machineId: null, instrumentId: null,
machineName: null, instrumentName: null,
messageContent: null, messageContent: null,
status: null, status: null,
type: null, type: null,

@ -29,16 +29,16 @@
<el-form-item label="开启时间" prop="siteStartTime"> <el-form-item label="开启时间" prop="siteStartTime">
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.siteStartTime" v-model="queryParams.siteStartTime"
type="date" type="datetime"
value-format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择开启开始时间"> placeholder="请选择开启开始时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="" prop="siteEndTime"> <el-form-item label="" prop="siteEndTime">
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.siteEndTime" v-model="queryParams.siteEndTime"
type="date" type="datetime"
value-format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择开启结束时间"> placeholder="请选择开启结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -304,16 +304,16 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span = "12"> <el-col :span = "12">
<el-form-item label="仪器" prop="channelId"> <el-form-item label="仪器" prop="channelId">
<el-select v-model="form.machineArray" multiple placeholder="请选择"> <el-select v-model="form.machineArray" multiple placeholder="请选择">
<el-option <el-option
v-for="item in channelList" v-for="instrument in instrumentList"
:key="item.id" :key="instrument.id"
:label="item.channelName" :label="instrument.name"
:value="item.id"> :value="instrument.id"
</el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -412,12 +412,15 @@ import {getToken} from "@/utils/auth";
import { tagTreeSelect } from "@/api/system/wechatTab"; import { tagTreeSelect } from "@/api/system/wechatTab";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listInstrument } from "@/api/system/instrument";
export default { export default {
name: "Info", name: "Info",
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
//
instrumentList:[],
// //
loading: true, loading: true,
// opearte // opearte
@ -467,7 +470,7 @@ export default {
siteEndTime: null, siteEndTime: null,
userRegisterStartTime: null, userRegisterStartTime: null,
userRegisterEndTime: null, userRegisterEndTime: null,
openType: null, openType: "",
pushType: null, pushType: null,
pushNumber: null, pushNumber: null,
pushTimer: null, pushTimer: null,
@ -484,7 +487,7 @@ export default {
machineName: null, machineName: null,
machineId: null, machineId: null,
userType: null, userType: null,
operate: null, operate: "",
signNumber: null, signNumber: null,
orderNumber: null, orderNumber: null,
type: null, type: null,
@ -503,10 +506,19 @@ export default {
}; };
}, },
created() { created() {
this.queryParams.siteStartTime = this.dateUtil(new Date(new Date().toLocaleDateString()));
this.queryParams.siteEndTime = this.dateUtil(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1));
this.getList(); this.getList();
this.getDeptTree(); this.getDeptTree();
this.queryInstrumentList();
}, },
methods: { methods: {
//
queryInstrumentList(){
listInstrument(this.queryParams).then(response => {
this.instrumentList = response.rows;
});
},
/** 查询站点管理列表 */ /** 查询站点管理列表 */
getList() { getList() {
this.form.fileUrl = 'http://127.0.0.1:9300/statics/2023/12/16/0c49191de1ed8f91b28d9c2b12556154_20231216154804A002.mp4' this.form.fileUrl = 'http://127.0.0.1:9300/statics/2023/12/16/0c49191de1ed8f91b28d9c2b12556154_20231216154804A002.mp4'
@ -520,6 +532,16 @@ export default {
this.channelList = response.rows; this.channelList = response.rows;
}); });
}, },
dateUtil(date){
//
const year = date.getFullYear().toString(); //
const months = (date.getMonth() + 1).toString().padStart(2, '0'); //
const day = date.getDate().toString().padStart(2, '0'); //
const hours = date.getHours().toString().padStart(2, '0'); //
const minutes = date.getMinutes().toString().padStart(2, '0'); //
const seconds = date.getSeconds().toString().padStart(2, '0');
return `${year}-${months}-${day} ${hours}:${minutes}:${seconds}`;
},
// //
cancel() { cancel() {
this.open = false; this.open = false;

@ -312,11 +312,11 @@
<el-form-item label="仪器" prop="channelId"> <el-form-item label="仪器" prop="channelId">
<el-select v-model="form.machineArray" multiple placeholder="请选择"> <el-select v-model="form.machineArray" multiple placeholder="请选择">
<el-option <el-option
v-for="item in channelList" v-for="instrument in instrumentList"
:key="item.id" :key="instrument.id"
:label="item.channelName" :label="instrument.name"
:value="item.id"> :value="instrument.id"
</el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -411,12 +411,15 @@ import {getToken} from "@/utils/auth";
import { tagTreeSelect } from "@/api/system/wechatTab"; import { tagTreeSelect } from "@/api/system/wechatTab";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listInstrument } from "@/api/system/instrument";
export default { export default {
name: "Info", name: "Info",
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
//
instrumentList:[],
// //
loading: true, loading: true,
// opearte // opearte
@ -480,8 +483,8 @@ export default {
forbidCompanyTagId: null, forbidCompanyTagId: null,
channelName: null, channelName: null,
channelId: null, channelId: null,
machineName: null, instrumentName: null,
machineId: null, instrumentId: null,
userType: null, userType: null,
operate: "", operate: "",
signNumber: null, signNumber: null,
@ -551,8 +554,15 @@ export default {
this.queryParams.siteEndTime = this.dateUtil(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1)); this.queryParams.siteEndTime = this.dateUtil(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1));
this.getList(); this.getList();
this.getDeptTree(); this.getDeptTree();
this.queryInstrumentList();
}, },
methods: { methods: {
//
queryInstrumentList(){
listInstrument(this.queryParams).then(response => {
this.instrumentList = response.rows;
});
},
/** 查询站点管理列表 */ /** 查询站点管理列表 */
getList() { getList() {
this.form.fileUrl = 'http://127.0.0.1:9300/statics/2023/12/16/0c49191de1ed8f91b28d9c2b12556154_20231216154804A002.mp4' this.form.fileUrl = 'http://127.0.0.1:9300/statics/2023/12/16/0c49191de1ed8f91b28d9c2b12556154_20231216154804A002.mp4'
@ -596,8 +606,8 @@ export default {
forbidCompanyTagId: null, forbidCompanyTagId: null,
channelName: null, channelName: null,
channelId: null, channelId: null,
machineName: null, instrumentName: null,
machineId: null, instrumentId: null,
userType: null, userType: null,
operate: null, operate: null,
signNumber: null, signNumber: null,

Loading…
Cancel
Save