@ -97,7 +97,7 @@ namespace D7MqClient
logger . Debug ( $"执行语句1: {strSql.ToString()}" ) ;
if ( _count = = 1 & & UPDATESUBCOMPANY = = "1" )
{
var BsNo = GetBsNo ( dbcon , CUSTNO ) ;
var BsNo = GetBsNo ( dbcon , "CUSTNO='" + CUSTNO + "'" ) ;
var strSql3 = new StringBuilder ( ) ;
strSql3 . Append ( "exec ExeUpdateSubOpSeae '" + BsNo + "' " ) ;
SqlCommand cmd3 = new SqlCommand ( strSql3 . ToString ( ) , dbcon ) ;
@ -148,24 +148,48 @@ namespace D7MqClient
var strSql2 = new StringBuilder ( ) ;
strSql2 . Append ( "update op_seae set MBLNO='" + feeback . FeedbackData . MBLNO + "' where BSNO='" + BSNO + "' AND ISNULL(MBLNO,'')=''" ) ;
SqlCommand cmd2 = new SqlCommand ( strSql2 . ToString ( ) , dbcon ) ;
cmd2 . ExecuteNonQuery ( ) ;
var _count = cmd2 . ExecuteNonQuery ( ) ;
logger . Debug ( $"执行语句1: {strSql2.ToString()}" ) ;
if ( _count = = 1 & & UPDATESUBCOMPANY = = "1" )
{
var strSql3 = new StringBuilder ( ) ;
strSql3 . Append ( "exec ExeUpdateSubOpSeae '" + BSNO + "' " ) ;
SqlCommand cmd3 = new SqlCommand ( strSql3 . ToString ( ) , dbcon ) ;
cmd3 . ExecuteNonQuery ( ) ;
}
}
if ( ! string . IsNullOrEmpty ( CUSTNO ) )
{
var strSql = new StringBuilder ( ) ;
strSql . Append ( "update op_seae set MBLNO='" + feeback . FeedbackData . MBLNO + "' where (CUSTNO='" + CUSTNO + "' OR IRCODE='" + CUSTNO + "') AND (ISNULL(MBLNO,'')='' or MBLNO LIKE '%*') " ) ;
SqlCommand cmd = new SqlCommand ( strSql . ToString ( ) , dbcon ) ;
cmd . ExecuteNonQuery ( ) ;
var _count = cmd . ExecuteNonQuery ( ) ;
logger . Debug ( $"执行语句1: {strSql.ToString()}" ) ;
if ( _count = = 1 & & UPDATESUBCOMPANY = = "1" )
{
var BsNo = GetBsNo ( dbcon , "CUSTNO='" + CUSTNO + "'" ) ;
var strSql3 = new StringBuilder ( ) ;
strSql3 . Append ( "exec ExeUpdateSubOpSeae '" + BsNo + "' " ) ;
SqlCommand cmd3 = new SqlCommand ( strSql3 . ToString ( ) , dbcon ) ;
cmd3 . ExecuteNonQuery ( ) ;
}
}
if ( ! string . IsNullOrEmpty ( IRCODE ) )
{
var strSql = new StringBuilder ( ) ;
strSql . Append ( "update op_seae set MBLNO='" + feeback . FeedbackData . MBLNO + "' where IRCODE='" + IRCODE + "' AND (ISNULL(MBLNO,'')='' or MBLNO LIKE '%*') " ) ;
SqlCommand cmd = new SqlCommand ( strSql . ToString ( ) , dbcon ) ;
cmd . ExecuteNonQuery ( ) ;
var _count = cmd . ExecuteNonQuery ( ) ;
logger . Debug ( $"执行语句1: {strSql.ToString()}" ) ;
if ( _count = = 1 & & UPDATESUBCOMPANY = = "1" )
{
var BsNo = GetBsNo ( dbcon , "IRCODE='" + IRCODE + "'" ) ;
var strSql3 = new StringBuilder ( ) ;
strSql3 . Append ( "exec ExeUpdateSubOpSeae '" + BsNo + "' " ) ;
SqlCommand cmd3 = new SqlCommand ( strSql3 . ToString ( ) , dbcon ) ;
cmd3 . ExecuteNonQuery ( ) ;
}
}
}
else
@ -220,11 +244,11 @@ namespace D7MqClient
} ;
model . BasicConsume ( CompanyQueueName , true , consumer ) ;
}
static public string GetBsNo ( SqlConnection dbcon , string mblno )
static public string GetBsNo ( SqlConnection dbcon , string constr )
{
string bsno = "" ;
var strSql = new StringBuilder ( ) ;
strSql . Append ( "select BSNO from t_op_seae where CUSTNO='" + mblno + "'" ) ;
strSql . Append ( "select BSNO from t_op_seae where "+ constr ) ;
SqlDataAdapter adapter = new SqlDataAdapter ( strSql . ToString ( ) , dbcon ) ;
DataTable table = new DataTable ( ) ;
adapter . Fill ( table ) ;