|
|
@ -27,6 +27,7 @@ namespace D7MqClient
|
|
|
|
private static string COMPANYID = ConfigurationManager.AppSettings["COMPANYID"];
|
|
|
|
private static string COMPANYID = ConfigurationManager.AppSettings["COMPANYID"];
|
|
|
|
private static string MQURL = ConfigurationManager.AppSettings["DJYMQURL"];
|
|
|
|
private static string MQURL = ConfigurationManager.AppSettings["DJYMQURL"];
|
|
|
|
private static string connStr = ConfigurationManager.AppSettings["ConnectionString"];
|
|
|
|
private static string connStr = ConfigurationManager.AppSettings["ConnectionString"];
|
|
|
|
|
|
|
|
private static string DSVER = ConfigurationManager.AppSettings["DONGSHENGVER"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private const string ExchangeName = "booking";
|
|
|
|
private const string ExchangeName = "booking";
|
|
|
@ -56,24 +57,55 @@ namespace D7MqClient
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//回写数据
|
|
|
|
//回写数据
|
|
|
|
var feeback = JsonConvert.DeserializeAnonymousType(strBody, new { FeedbackType = string.Empty, FeedbackData = new { MBLNO = string.Empty, BSNO = string.Empty, IRCode = string.Empty } });
|
|
|
|
var feeback = JsonConvert.DeserializeAnonymousType(strBody, new { FeedbackType = string.Empty, FeedbackData = new { MBLNO = string.Empty, BSNO = string.Empty, IRCode = string.Empty, CSRCode = string.Empty, FF = string.Empty } });
|
|
|
|
|
|
|
|
|
|
|
|
using (SqlConnection dbcon = new SqlConnection(connStr))
|
|
|
|
using (SqlConnection dbcon = new SqlConnection(connStr))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dbcon.Open();
|
|
|
|
dbcon.Open();
|
|
|
|
if (feeback.FeedbackType == "IRCode") {
|
|
|
|
if (feeback.FeedbackType == "IRCode"|| feeback.FeedbackType == "CSRCode") {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var IRCODE = "";
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.IRCode)) IRCODE = feeback.FeedbackData.IRCode;
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.CSRCode)) IRCODE = feeback.FeedbackData.CSRCode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (DSVER == "7")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var CUSTNO = "";
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.BSNO)) CUSTNO = feeback.FeedbackData.BSNO;
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.FF)) CUSTNO = feeback.FeedbackData.FF;
|
|
|
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
|
|
|
strSql.Append("update op_seae set IRCODE='" + IRCODE + "' where CUSTNO='" + CUSTNO + "' AND ISNULL(IRCODE,'')=''");
|
|
|
|
|
|
|
|
SqlCommand cmd = new SqlCommand(strSql.ToString(), dbcon);
|
|
|
|
|
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.BSNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.BSNO) && !string.IsNullOrEmpty(feeback.FeedbackData.IRCode)) {
|
|
|
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
strSql.Append("update t_op_seae set IRCODE='"+ feeback.FeedbackData.IRCode + "' where 业务编号='" + feeback.FeedbackData.BSNO + "'");
|
|
|
|
strSql.Append("update t_op_seae set IRCODE='" + IRCODE + "' where 业务编号='" + feeback.FeedbackData.BSNO + "'");
|
|
|
|
SqlCommand cmd = new SqlCommand(strSql.ToString(), dbcon);
|
|
|
|
SqlCommand cmd = new SqlCommand(strSql.ToString(), dbcon);
|
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (feeback.FeedbackType == "MBLNO")
|
|
|
|
else if (feeback.FeedbackType == "MBLNO")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.BSNO) && !string.IsNullOrEmpty(feeback.FeedbackData.MBLNO))
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.BSNO) && !string.IsNullOrEmpty(feeback.FeedbackData.MBLNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (DSVER == "7")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var CUSTNO = "";
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.BSNO)) CUSTNO = feeback.FeedbackData.BSNO;
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(feeback.FeedbackData.FF)) CUSTNO = feeback.FeedbackData.FF;
|
|
|
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
|
|
|
strSql.Append("update op_seae set MBLNO='" + feeback.FeedbackData.MBLNO + "' where CUSTNO='" + CUSTNO + "' AND ISNULL(MBLNO,'')='' ");
|
|
|
|
|
|
|
|
SqlCommand cmd = new SqlCommand(strSql.ToString(), dbcon);
|
|
|
|
|
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
strSql.Append("update t_op_seae set 主提单号='" + feeback.FeedbackData.MBLNO + "' where 业务编号='" + feeback.FeedbackData.BSNO + "' AND ISNULL(主提单号,'')='' ");
|
|
|
|
strSql.Append("update t_op_seae set 主提单号='" + feeback.FeedbackData.MBLNO + "' where 业务编号='" + feeback.FeedbackData.BSNO + "' AND ISNULL(主提单号,'')='' ");
|
|
|
@ -81,6 +113,7 @@ namespace D7MqClient
|
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|