@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq ;
using System.Linq ;
using System.Text ;
using System.Text ;
using System.Threading.Tasks ;
using System.Threading.Tasks ;
using Dapper ;
using System.Data ;
using System.Data ;
using System.Data.SqlClient ;
using System.Data.SqlClient ;
using Common ;
using Common ;
@ -34,9 +33,7 @@ namespace djy.Service.Ams
/// </summary>
/// </summary>
public class AmsService : ServBase , IAmsService
public class AmsService : ServBase , IAmsService
{
{
#region 查询列表
#region 查询列表
public TableData Load ( AMSQuery req , User user , UserAuthorityDto aut )
public TableData Load ( AMSQuery req , User user , UserAuthorityDto aut )
{
{
var result = new TableData ( ) ;
var result = new TableData ( ) ;
@ -125,8 +122,8 @@ namespace djy.Service.Ams
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . AM_ID = oid ;
history . AM_ID = oid ;
history . SendTime = DateTime . Now ; ///此处为删除时间
history . SendTime = DateTime . Now ; ///此处为删除时间
history . State = " 已 删除";
history . State = " 删除";
history . Type = " 删除 ";
history . Type = " 0 ";
history . Operator = user . SHOWNAME ;
history . Operator = user . SHOWNAME ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "删除了单据" ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "删除了单据" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
@ -202,8 +199,8 @@ namespace djy.Service.Ams
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . AM_ID = house . GID ;
history . AM_ID = house . GID ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = " 已 新增";
history . State = " 新增";
history . Type = " 新增 ";
history . Type = " 0 ";
history . Operator = user . SHOWNAME ;
history . Operator = user . SHOWNAME ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "创建了单据" ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "创建了单据" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
@ -271,8 +268,8 @@ namespace djy.Service.Ams
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . AM_ID = house . GID ;
history . AM_ID = house . GID ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = " 已 新增";
history . State = " 新增";
history . Type = " 新增 ";
history . Type = " 0 ";
history . Operator = user . SHOWNAME ;
history . Operator = user . SHOWNAME ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "创建了单据" ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "创建了单据" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
@ -346,15 +343,15 @@ namespace djy.Service.Ams
}
}
}
}
AMS_MasterHistory history = new AMS_MasterHistory ( ) ;
//AMS_MasterHistory history = new AMS_MasterHistory() ;
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
//history.GID = Guid.NewGuid().ToString("N") ;
history . AM_ID = item . GID ;
//history.AM_ID = item.GID ;
history . SendTime = DateTime . Now ;
//history.SendTime = DateTime.Now ;
history . State = "已修改" ;
//history.State = "修改" ;
history . Type = "修改" ;
//history.Type = "0" ;
history . Operator = user . SHOWNAME ;
//history.Operator = user.SHOWNAME ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "修改了单据" ;
//history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "修改了单据" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
//DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows() ;
}
}
else
else
{
{
@ -384,8 +381,8 @@ namespace djy.Service.Ams
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . AM_ID = house . GID ;
history . AM_ID = house . GID ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = " 已 新增";
history . State = " 新增";
history . Type = " 新增 ";
history . Type = " 0 ";
history . Operator = user . SHOWNAME ;
history . Operator = user . SHOWNAME ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "创建了单据" ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "创建了单据" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
@ -438,8 +435,7 @@ namespace djy.Service.Ams
if ( docType = = "AMSDOC" )
if ( docType = = "AMSDOC" )
{
{
hodto = DbBus . Get ( DbList . AMSCenter ) . Select < AMS_House > ( ) . Where ( x = > x . IsDel ! = true & & x . PID = = oid & & x . State = = "0" ) .
hodto = DbBus . Get ( DbList . AMSCenter ) . Select < AMS_House > ( ) . Where ( x = > x . IsDel ! = true & & x . PID = = oid & & x . State = = "0" ) . ToList < AMS_HouseDto > ( ) ;
ToList < AMS_HouseDto > ( ) ;
#region docContent 新增
#region docContent 新增
var cARRIERIDList = DbBus . Get ( DbList . Common ) . Select < MappingCarrier > ( ) . Where ( map = > map . Module = = "AMS" ) . ToList ( ) ;
var cARRIERIDList = DbBus . Get ( DbList . Common ) . Select < MappingCarrier > ( ) . Where ( map = > map . Module = = "AMS" ) . ToList ( ) ;
@ -477,7 +473,6 @@ namespace djy.Service.Ams
List < HouseBillInfoListItem > houseBillInfoListItems = new List < HouseBillInfoListItem > ( ) ;
List < HouseBillInfoListItem > houseBillInfoListItems = new List < HouseBillInfoListItem > ( ) ;
foreach ( var item in hodto )
foreach ( var item in hodto )
{
{
var getfinrs = fin . Expend ( new CustFee
var getfinrs = fin . Expend ( new CustFee
{
{
ETD = master . ETD ,
ETD = master . ETD ,
@ -617,12 +612,18 @@ namespace djy.Service.Ams
List < HouseBillInfoListItem > houseBillInfoListItems = new List < HouseBillInfoListItem > ( ) ;
List < HouseBillInfoListItem > houseBillInfoListItems = new List < HouseBillInfoListItem > ( ) ;
foreach ( var item in hodto )
foreach ( var item in hodto )
{
{
if ( docType = = "AMSAR" & & !( item . ReportState = = "删单 成功" | | item . MateState = = " 接收 失败") )
if ( docType = = "AMSAR" & & (item . NewNotice = = "删除发送 成功" | | item . MateState = = " 匹配 失败") )
{
{
req . Code = 201 ;
req . Code = 201 ;
req . Message = "当前状态不能重发!如有疑问,请联系相关客服!" ;
req . Message = "当前状态不能重发!如有疑问,请联系相关客服!" ;
return req ;
return req ;
}
}
if ( docType = = "AMSDOC" & & ( item . NewNotice = = "新增发送成功" ) )
{
req . Code = 201 ;
req . Message = "当前单据已经发送,不能再次发送!如有疑问,请联系相关客服!" ;
return req ;
}
if ( docType = = "AMSAR" )
if ( docType = = "AMSAR" )
@ -774,7 +775,7 @@ namespace djy.Service.Ams
return req ;
return req ;
}
}
if ( item . ReportState = = "删单 成功")
if ( item . NewNotice = = "删除发送 成功")
{
{
req . Code = 201 ;
req . Code = 201 ;
req . Message = "已删除单据不可以再次删除" ;
req . Message = "已删除单据不可以再次删除" ;
@ -851,26 +852,26 @@ namespace djy.Service.Ams
if ( docType = = "AMSDOC" )
if ( docType = = "AMSDOC" )
{
{
history . State = "新增发送失败" ;
history . State = "新增发送失败" ;
history . Type = " 接收失败 ";
history . Type = " 0 ";
}
}
else if ( docType = = "AMSAR" )
else if ( docType = = "AMSAR" )
{
{
history . State = "重发失败" ;
history . State = "重发失败" ;
history . Type = " 接收失败 ";
history . Type = " 0 ";
}
}
else if ( docType = = "AMSM" )
else if ( docType = = "AMSM" )
{
{
history . State = "修改发送失败" ;
history . State = "修改发送失败" ;
history . Type = " 修改失败 ";
history . Type = " 0 ";
}
}
else
else
{
{
history . State = "删除发送失败" ;
history . State = "删除发送失败" ;
history . Type = " 删单失败 ";
history . Type = " 0 ";
}
}
history . Operator = user . SHOWNAME ;
history . Operator = user . SHOWNAME ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "发送单据失败,失败原因:" + msg ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "发送单据失败,失败原因:" + msg + errorInfo ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
}
}
@ -884,25 +885,26 @@ namespace djy.Service.Ams
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . GID = Guid . NewGuid ( ) . ToString ( "N" ) ;
history . AM_ID = oid ;
history . AM_ID = oid ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . Type = "0" ;
if ( docType = = "AMSDOC" )
if ( docType = = "AMSDOC" )
{
{
history . State = "新增发送成功" ;
history . State = "新增发送成功" ;
history . Type = "接收成功" ;
}
}
else if ( docType = = "AMSAR" )
else if ( docType = = "AMSAR" )
{
{
history . State = "重发成功" ;
history . State = "重发成功" ;
history . Type = "接收成功" ;
}
}
else if ( docType = = "AMSM" )
else if ( docType = = "AMSM" )
{
{
history . State = "修改发送成功" ;
history . State = "修改发送成功" ;
history . Type = "修改成功" ;
}
}
else
else
{
{
history . State = "删除发送成功" ;
history . State = "删除发送成功" ;
history . Type = "删单成功" ;
}
}
history . Operator = user . SHOWNAME ;
history . Operator = user . SHOWNAME ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "发送了单据" ;
history . Remark = user . SHOWNAME + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "发送了单据" ;
@ -1050,33 +1052,33 @@ namespace djy.Service.Ams
history . AM_ID = retdto . businessId ;
history . AM_ID = retdto . businessId ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = "海关接收成功" ;
history . State = "海关接收成功" ;
history . Type = " 匹配成功 ";
history . Type = " 1 ";
history . Operator = "系统管理员" ;
history . Operator = "系统管理员" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "海关接收成功" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "海关接收成功" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
if ( house . NewNotice = = "删除发送成功" )
if ( house . NewNotice = = "删除发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关接收成功" , ReportState = "删单成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else if ( house . NewNotice = = "修改发送成功" )
else if ( house . NewNotice = = "修改发送成功" )
{
{
if ( house . MateState . Contains ( "3Z" ) )
if ( house . MateState . Contains ( "3Z" ) )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = "3Z," + retdto . status , NewNotice = "海关接收成功" , ReportState = "接收成功" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = "3Z," + retdto . status , NewNotice = "海关接收成功" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "海关接收成功" , ReportState = "接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "海关接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "海关接收成功" , ReportState = "接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "海关接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
@ -1094,32 +1096,32 @@ namespace djy.Service.Ams
history . AM_ID = retdto . businessId ;
history . AM_ID = retdto . businessId ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = "船司匹配成功" ;
history . State = "船司匹配成功" ;
history . Type = " 匹配成功 ";
history . Type = " 1 ";
history . Operator = "系统管理员" ;
history . Operator = "系统管理员" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "船司匹配成功" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "船司匹配成功" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
if ( house . NewNotice = = "删除发送成功" )
if ( house . NewNotice = = "删除发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "船司匹配成功" , ReportState = "删单成功" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "船司匹配成功" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else if ( house . NewNotice = = "修改发送成功" )
else if ( house . NewNotice = = "修改发送成功" )
{
{
if ( house . MateState . Contains ( "3Z" ) )
if ( house . MateState . Contains ( "3Z" ) )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = "3Z," + retdto . status , NewNotice = "船司匹配成功" , ReportState = "接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = "3Z," + retdto . status , NewNotice = "船司匹配成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "船司匹配成功" , ReportState = "接收成功" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "船司匹配成功" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "船司匹配成功" , ReportState = "接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "船司匹配成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
}
}
@ -1136,18 +1138,18 @@ namespace djy.Service.Ams
history . AM_ID = retdto . businessId ;
history . AM_ID = retdto . businessId ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = "ISF匹配成功" ;
history . State = "ISF匹配成功" ;
history . Type = " 匹配成功 ";
history . Type = " 1 ";
history . Operator = "系统管理员" ;
history . Operator = "系统管理员" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "ISF匹配成功" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "ISF匹配成功" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
if ( house . NewNotice = = "删除发送成功" )
if ( house . NewNotice = = "删除发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "ISF匹配成功" , ReportState = "删单成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "ISF匹配成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "ISF匹配成功" , ReportState = "接收成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = house . MateState + "," + retdto . status , NewNotice = "ISF匹配成功" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
}
}
@ -1160,7 +1162,7 @@ namespace djy.Service.Ams
history . AM_ID = retdto . businessId ;
history . AM_ID = retdto . businessId ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = "海关拒绝" ;
history . State = "海关拒绝" ;
history . Type = " 匹配失败 ";
history . Type = " 1 ";
history . Operator = "系统管理员" ;
history . Operator = "系统管理员" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "海关拒绝" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "海关拒绝" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
@ -1168,24 +1170,24 @@ namespace djy.Service.Ams
if ( house . NewNotice = = "删除发送成功" )
if ( house . NewNotice = = "删除发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" , ReportState = "删单失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
if ( house . NewNotice = = "修改发送成功" )
if ( house . NewNotice = = "修改发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" , ReportState = "修改失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
if ( house . NewNotice = = "重发发送成功" | | house . NewNotice = = "新增发送成功" )
if ( house . NewNotice = = "重发发送成功" | | house . NewNotice = = "新增发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" , ReportState = "接收失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" , ReportState = "接收失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "海关拒绝" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
}
}
@ -1196,7 +1198,7 @@ namespace djy.Service.Ams
history . AM_ID = retdto . businessId ;
history . AM_ID = retdto . businessId ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = "箱货信息不匹配" ;
history . State = "箱货信息不匹配" ;
history . Type = " 匹配失败 ";
history . Type = " 1 ";
history . Operator = "系统管理员" ;
history . Operator = "系统管理员" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "箱货信息不匹配" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "箱货信息不匹配" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
@ -1204,24 +1206,24 @@ namespace djy.Service.Ams
if ( house . NewNotice = = "删除发送成功" )
if ( house . NewNotice = = "删除发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" , ReportState = "删单失败" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" }) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
if ( house . NewNotice = = "修改发送成功" )
if ( house . NewNotice = = "修改发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" , ReportState = "修改失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
if ( house . NewNotice = = "重发发送成功" | | house . NewNotice = = "新增发送成功" )
if ( house . NewNotice = = "重发发送成功" | | house . NewNotice = = "新增发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" , ReportState = "接收失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" , ReportState = "接收失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "箱货信息不匹配" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
}
}
@ -1232,7 +1234,7 @@ namespace djy.Service.Ams
history . AM_ID = retdto . businessId ;
history . AM_ID = retdto . businessId ;
history . SendTime = DateTime . Now ;
history . SendTime = DateTime . Now ;
history . State = "匹配失败" ;
history . State = "匹配失败" ;
history . Type = " 匹配失败 ";
history . Type = " 1 ";
history . Operator = "系统管理员" ;
history . Operator = "系统管理员" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "匹配失败" ;
history . Remark = "您的单据" + house . HBLNo + "于" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "匹配失败" ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Insert ( history ) . ExecuteAffrows ( ) ;
@ -1240,24 +1242,24 @@ namespace djy.Service.Ams
if ( house . NewNotice = = "删除发送成功" )
if ( house . NewNotice = = "删除发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" , ReportState = "删单失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
if ( house . NewNotice = = "修改发送成功" )
if ( house . NewNotice = = "修改发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" , ReportState = "修改失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
if ( house . NewNotice = = "重发发送成功" | | house . NewNotice = = "新增发送成功" )
if ( house . NewNotice = = "重发发送成功" | | house . NewNotice = = "新增发送成功" )
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" , ReportState = "接收失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
else
else
{
{
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" , ReportState = "接收失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
DbBus . Get ( DbList . AMSCenter ) . Update < AMS_House > ( ) . Set ( w = > new AMS_House { MateState = retdto . status , NewNotice = "匹配失败" } ) . Where ( w = > w . GID = = retdto . businessId ) . ExecuteAffrows ( ) ;
}
}
}
}
@ -1689,7 +1691,6 @@ namespace djy.Service.Ams
}
}
# endregion
# endregion
#region 获取模板
#region 获取模板