天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
2.6 KiB

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace QM.Exchange.Adapters.MiddleDB
{
public class MiddleDBAdapter
{
/// <summary>
/// 数据表名
/// </summary>
private string _tableName { get; set; }
/// <summary>
/// 主键字段名
/// </summary>
private string PkColumnName = "ID_KEY";
/// <summary>
/// 读取标志字段
/// </summary>
private string ReadFlagColumn = "R_FLAG";
/// <summary>
/// 过期时间(小时)
/// </summary>
private int OverdueTime = 12;
public MiddleDBAdapter(string tableName)
{
_tableName = tableName;
}
/// <summary>
/// 监控数据变化
/// </summary>
public void Monitor()
{
//监控是否有未读数据
//向业务系统推送数据
}
/// <summary>
/// 推送数据
/// </summary>
public void PushData()
{
//获取未读数据
//生成消息ID
//向消息表写入数据+消息ID
//向消息队列发送消息ID
//标记已读
}
/// <summary>
/// 获取未读数据
/// </summary>
/// <returns></returns>
public DataTable GetData()
{
return null;
}
/// <summary>
/// 向消息化数据表写入数据
/// </summary>
/// <param name="table"></param>
public void WriteMqTable(DataTable table)
{
//将未读数据写入T_IO_MQDATA
}
/// <summary>
/// 向消息队列发送消息ID
/// </summary>
public void SendMq(string msgID)
{
string topicID = "";
//通过接口表与主题关联获取消息主题
//向消息队列发送消息ID
using (QMBDP.ActiveMQClient.MQProducer producer = new QMBDP.ActiveMQClient.MQProducer(topicID))
{
producer.SendTextMessage(msgID);
}
}
/// <summary>
/// 将未读数据标记为已读
/// </summary>
/// <param name="table"></param>
public void SignRead(DataTable table)
{
}
/// <summary>
/// 删除过期的已读数据
/// </summary>
public void DeleteHistory()
{
}
}
}