|
@@ -26,7 +26,7 @@ namespace NB_IOT_UDP_HP_SCOKET.WWKJUtil
|
|
|
SqlDataReader dr;
|
|
|
//SqlConnection conn;
|
|
|
|
|
|
- sql = "SELECT TOP 1 SendCmdRecordID,MeterId,SendText,ParentId,SendStatic FROM WWKJ_RMRS_SendCmdRecord WHERE sendStatic in(0,3) AND (MeterId != -1 AND MeterId = " + info.meterId + ") AND (MeterId = -1 AND CmdID = '"+info.Address+"') ORDER BY SendCmdRecordID";//0 未发送 3 发送过单未全部发送成功
|
|
|
+ sql = "SELECT TOP 1 SendCmdRecordID,MeterId,SendText,ParentId,SendStatic FROM RMRS_SendCmdRecord WHERE sendStatic in(0,3) AND (MeterId != -1 AND MeterId = " + info.meterId + ") AND (MeterId = -1 AND CmdID = '"+info.Address+"') ORDER BY SendCmdRecordID";//0 未发送 3 发送过单未全部发送成功
|
|
|
arr = null;
|
|
|
try
|
|
|
{
|
|
@@ -86,7 +86,7 @@ namespace NB_IOT_UDP_HP_SCOKET.WWKJUtil
|
|
|
{
|
|
|
StringBuilder sb = new StringBuilder(220);
|
|
|
|
|
|
- sb.Append("UPDATE WWKJ_RMRS_SendCmdRecord set sendStatic = '");
|
|
|
+ sb.Append("UPDATE RMRS_SendCmdRecord set sendStatic = '");
|
|
|
sb.Append(sendState.ToString());
|
|
|
sb.Append("',SendTime=GETDATE() ");
|
|
|
if (!string.IsNullOrEmpty(returnCode)) {
|
|
@@ -97,12 +97,12 @@ namespace NB_IOT_UDP_HP_SCOKET.WWKJUtil
|
|
|
|
|
|
if (sendState == 3)
|
|
|
{
|
|
|
- sb.Append(" UPDATE WWKJ_RMRS_SendCmdRecord set sendStatic = 3, RecvTime = GETDATE() WHERE ParentId = ").Append(parentId);
|
|
|
+ sb.Append(" UPDATE RMRS_SendCmdRecord set sendStatic = 3, RecvTime = GETDATE() WHERE ParentId = ").Append(parentId);
|
|
|
}
|
|
|
|
|
|
if (sendState == 1)
|
|
|
{
|
|
|
- sb.Append(" UPDATE WWKJ_RMRS_SendCmdRecord set sendStatic = 1, RecvTime = GETDATE() WHERE ParentId = ").Append(parentId.ToString());
|
|
|
+ sb.Append(" UPDATE RMRS_SendCmdRecord set sendStatic = 1, RecvTime = GETDATE() WHERE ParentId = ").Append(parentId.ToString());
|
|
|
}
|
|
|
|
|
|
try
|
|
@@ -124,5 +124,27 @@ namespace NB_IOT_UDP_HP_SCOKET.WWKJUtil
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 通过表地址获取水表的id
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="meterAddr"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static int GetMeterIdByAddress(string meterAddr)
|
|
|
+ {
|
|
|
+ int num = 0;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string sql = "SELECT MeterID FROM RMRS_MeterInfo WHERE right('00000000000000' +[ElecAddress],14) = '" + meterAddr + "' ";
|
|
|
+ num = DBHelper.ScalarToInt(sql);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ LogUtil.WriteLog("GetMeterIdByAddress():" + ex.Message);
|
|
|
+ num = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return num;
|
|
|
+ }
|
|
|
}
|
|
|
}
|