|
|
@ -227,45 +227,139 @@ namespace djy.Service.Ams
|
|
|
|
master.LoadingPort = DbBus.Get(DbList.Common).Select<CodePortLoad>().Where(x => x.EdiCode == master.LoadingPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.LoadingPort = DbBus.Get(DbList.Common).Select<CodePortLoad>().Where(x => x.EdiCode == master.LoadingPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.LastNoUsPort = DbBus.Get(DbList.Common).Select<CodePort>().Where(x => x.Code == master.LastNoUsPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.LastNoUsPort = DbBus.Get(DbList.Common).Select<CodePort>().Where(x => x.Code == master.LastNoUsPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().SetSource(master).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().SetSource(master).ExecuteAffrows();
|
|
|
|
|
|
|
|
#region 注释掉原有编辑逻辑
|
|
|
|
|
|
|
|
//DbBus.Get(DbList.AMSCenter).Delete<AMS_House>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Delete<AMS_House>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
//DbBus.Get(DbList.AMSCenter).Delete<AMS_Cntrno>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Delete<AMS_Cntrno>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
foreach (var item in dto.HouseDto)
|
|
|
|
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "已修改";
|
|
|
|
|
|
|
|
history.Type = "修改";
|
|
|
|
|
|
|
|
history.Operator = user.SHOWNAME;
|
|
|
|
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "修改了单据";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dto.HouseDto != null && dto.HouseDto.Count() > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var item in dto.HouseDto)
|
|
|
|
var house = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(w => w.GID == item.GID).ToOne();
|
|
|
|
|
|
|
|
if (house != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AMS_House house = item.MapTo<AMS_House>();
|
|
|
|
house.HBLNo = item.HBLNo;
|
|
|
|
|
|
|
|
house.SHIPPERNAME = item.SHIPPERNAME;
|
|
|
|
|
|
|
|
house.SHIPPERADDR = item.SHIPPERADDR;
|
|
|
|
|
|
|
|
house.SHIPPERTEL = item.SHIPPERTEL;
|
|
|
|
|
|
|
|
house.CONSIGNEEName = item.CONSIGNEEName;
|
|
|
|
|
|
|
|
house.CONSIGNEEDADDR = item.CONSIGNEEDADDR;
|
|
|
|
|
|
|
|
house.CONSIGNEETEL = item.CONSIGNEETEL;
|
|
|
|
|
|
|
|
house.NOTIFYPARTYNAME = item.NOTIFYPARTYNAME;
|
|
|
|
|
|
|
|
house.NOTIFYPARTYADDR = item.NOTIFYPARTYADDR;
|
|
|
|
|
|
|
|
house.NOTIFYPARTYTEL = item.NOTIFYPARTYTEL;
|
|
|
|
|
|
|
|
house.SHIPPERCountry = item.SHIPPERCountry;
|
|
|
|
|
|
|
|
house.SHIPPERCountryCode = item.SHIPPERCountryCode;
|
|
|
|
|
|
|
|
house.SHIPPERCity = item.SHIPPERCity;
|
|
|
|
|
|
|
|
house.CONSIGNEECountry = item.CONSIGNEECountry;
|
|
|
|
|
|
|
|
house.CONSIGNEECountryCode = item.CONSIGNEECountryCode;
|
|
|
|
|
|
|
|
house.CONSIGNEECity = item.CONSIGNEECity;
|
|
|
|
|
|
|
|
house.NOTIFYPARTYCountry = item.NOTIFYPARTYCountry;
|
|
|
|
|
|
|
|
house.NOTIFYPARTYCountryCode = item.NOTIFYPARTYCountryCode;
|
|
|
|
|
|
|
|
house.NOTIFYPARTYCity = item.NOTIFYPARTYCity;
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().SetSource(house).ExecuteAffrows();
|
|
|
|
|
|
|
|
if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0) {
|
|
|
|
|
|
|
|
foreach (var it in item.CntrnoDto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var cntrno = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(w => w.GID == it.GID).ToOne();
|
|
|
|
|
|
|
|
if (cntrno != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cntrno.CNTRNO = it.CNTRNO;
|
|
|
|
|
|
|
|
cntrno.SEALNO = it.SEALNO;
|
|
|
|
|
|
|
|
cntrno.CTNALL = it.CTNALL;
|
|
|
|
|
|
|
|
cntrno.HSCode = it.HSCode;
|
|
|
|
|
|
|
|
cntrno.ProductName = it.ProductName;
|
|
|
|
|
|
|
|
cntrno.MARKS = it.MARKS;
|
|
|
|
|
|
|
|
cntrno.PKGS = it.PKGS;
|
|
|
|
|
|
|
|
cntrno.KINDPKGS = it.KINDPKGS;
|
|
|
|
|
|
|
|
cntrno.KGS = it.KGS;
|
|
|
|
|
|
|
|
cntrno.CBM = it.CBM;
|
|
|
|
|
|
|
|
cntrno.DUNNO = it.DUNNO;
|
|
|
|
|
|
|
|
cntrno.LINKMAN = it.LINKMAN;
|
|
|
|
|
|
|
|
cntrno.KINDPKGSCode= it.KINDPKGSCode;
|
|
|
|
|
|
|
|
cntrno.OriginCountry = it.OriginCountry;
|
|
|
|
|
|
|
|
cntrno.OriginCountryCode = it.OriginCountryCode;
|
|
|
|
|
|
|
|
cntrno.LINKMANTel = it.LINKMANTel;
|
|
|
|
|
|
|
|
cntrno.DangerGrade = it.DangerGrade;
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Cntrno>().SetSource(cntrno).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
|
|
|
|
cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
cntrno.PID = master.GID;
|
|
|
|
|
|
|
|
cntrno.HID = house.GID;
|
|
|
|
|
|
|
|
cntrno.IsDel = false;
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
house = item.MapTo<AMS_House>();
|
|
|
|
|
|
|
|
|
|
|
|
house.GID = Guid.NewGuid().ToString("N");
|
|
|
|
house.GID = Guid.NewGuid().ToString("N");
|
|
|
|
house.PID = master.GID;
|
|
|
|
house.PID = master.GID;
|
|
|
|
house.IsDel = false;
|
|
|
|
house.IsDel = false;
|
|
|
|
house.State = "0";
|
|
|
|
house.State = "0";
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(house).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(house).ExecuteAffrows();
|
|
|
|
if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0)
|
|
|
|
if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var it in item.CntrnoDto)
|
|
|
|
foreach (var it in item.CntrnoDto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AMS_Cntrno cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
AMS_Cntrno cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
|
|
|
|
|
|
|
|
cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
cntrno.PID = master.GID;
|
|
|
|
cntrno.PID = master.GID;
|
|
|
|
cntrno.HID = house.GID;
|
|
|
|
cntrno.HID = house.GID;
|
|
|
|
cntrno.IsDel = false;
|
|
|
|
cntrno.IsDel = false;
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "已修改";
|
|
|
|
|
|
|
|
history.Type = "修改";
|
|
|
|
|
|
|
|
history.Operator = user.SHOWNAME;
|
|
|
|
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "修改了单据";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
#region 注释掉原有编辑逻辑
|
|
|
|
|
|
|
|
//if (dto.HouseDto != null && dto.HouseDto.Count() > 0)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// foreach (var item in dto.HouseDto)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// AMS_House house = item.MapTo<AMS_House>();
|
|
|
|
|
|
|
|
// house.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
// house.PID = master.GID;
|
|
|
|
|
|
|
|
// house.IsDel = false;
|
|
|
|
|
|
|
|
// house.State = "0";
|
|
|
|
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Insert(house).ExecuteAffrows();
|
|
|
|
|
|
|
|
// if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// foreach (var it in item.CntrnoDto)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// AMS_Cntrno cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
|
|
|
|
// cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
// cntrno.PID = master.GID;
|
|
|
|
|
|
|
|
// cntrno.HID = house.GID;
|
|
|
|
|
|
|
|
// cntrno.IsDel = false;
|
|
|
|
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
guid = master.GID;
|
|
|
|
guid = master.GID;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return guid;
|
|
|
|
return guid;
|
|
|
@ -293,7 +387,8 @@ namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var docContent = "";
|
|
|
|
var docContent = "";
|
|
|
|
var fin = new FinanceService();
|
|
|
|
var fin = new FinanceService();
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => (x.IsDel == false || x.IsDel == null) && x.CompID == user.CompId && x.GID == oid).ToOne();
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x =>x.IsDel != true && x.CompID == user.CompId && x.GID == oid).ToOne();
|
|
|
|
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.PID == oid && x.State == "0").ToList<AMS_HouseDto>();
|
|
|
|
if (docType != "AMSD")
|
|
|
|
if (docType != "AMSD")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#region docContent 新增 重发 修改
|
|
|
|
#region docContent 新增 重发 修改
|
|
|
@ -304,29 +399,6 @@ namespace djy.Service.Ams
|
|
|
|
req.Message = "当前状态不能重发!如有疑问,请联系相关客服!";
|
|
|
|
req.Message = "当前状态不能重发!如有疑问,请联系相关客服!";
|
|
|
|
return req;
|
|
|
|
return req;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (docType == "AMSAR" || docType == "AMSDOC")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var getfinrs = fin.Expend(new CustFee
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SENDUSERID = user.GID,
|
|
|
|
|
|
|
|
LURURENID = user.GID,
|
|
|
|
|
|
|
|
CtnrCount = 1,
|
|
|
|
|
|
|
|
CtnrInfo = string.Empty,
|
|
|
|
|
|
|
|
BSTYPE = 15,
|
|
|
|
|
|
|
|
SENDTYPE = 0,
|
|
|
|
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
, 0);
|
|
|
|
|
|
|
|
if (!getfinrs.Status)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
req.Code = 201;
|
|
|
|
|
|
|
|
req.Message = getfinrs.Message;
|
|
|
|
|
|
|
|
return req;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
var portList = DbBus.Get(DbList.Common).Select<CodePort>().ToList();
|
|
|
|
var portList = DbBus.Get(DbList.Common).Select<CodePort>().ToList();
|
|
|
|
var containerTypeList = DbBus.Get(DbList.Common).Select<MappingCtn>().Where(map => map.Module == "AMS").ToList();
|
|
|
|
var containerTypeList = DbBus.Get(DbList.Common).Select<MappingCtn>().Where(map => map.Module == "AMS").ToList();
|
|
|
@ -351,10 +423,34 @@ namespace djy.Service.Ams
|
|
|
|
masterBillInfo.estimatedArrivalTime = Convert.ToDateTime(master.ETD).ToString("yyyy-MM-dd hh:mm:ss");
|
|
|
|
masterBillInfo.estimatedArrivalTime = Convert.ToDateTime(master.ETD).ToString("yyyy-MM-dd hh:mm:ss");
|
|
|
|
masterBillInfo.filingType = master.ShippingType;
|
|
|
|
masterBillInfo.filingType = master.ShippingType;
|
|
|
|
dto.masterBillInfo = masterBillInfo;
|
|
|
|
dto.masterBillInfo = masterBillInfo;
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == oid && x.State == "0").ToList<AMS_HouseDto>();
|
|
|
|
|
|
|
|
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" || docType == "AMSDOC")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var getfinrs = fin.Expend(new CustFee
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ETD=master.ETD,
|
|
|
|
|
|
|
|
VOYNO =master.VOYNO,
|
|
|
|
|
|
|
|
VESSEL =master.VESSEL,
|
|
|
|
|
|
|
|
HBLNO=item.HBLNo,
|
|
|
|
|
|
|
|
SENDUSERID = user.GID,
|
|
|
|
|
|
|
|
LURURENID = user.GID,
|
|
|
|
|
|
|
|
CtnrCount = 1,
|
|
|
|
|
|
|
|
CtnrInfo = string.Empty,
|
|
|
|
|
|
|
|
BSTYPE = 15,
|
|
|
|
|
|
|
|
SENDTYPE = 0,
|
|
|
|
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
, 0);
|
|
|
|
|
|
|
|
if (!getfinrs.Status)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
req.Code = 201;
|
|
|
|
|
|
|
|
req.Message = getfinrs.Message;
|
|
|
|
|
|
|
|
return req;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
HouseBillInfoListItem houseinfo = new HouseBillInfoListItem();
|
|
|
|
HouseBillInfoListItem houseinfo = new HouseBillInfoListItem();
|
|
|
|
houseinfo.businessId = item.GID;
|
|
|
|
houseinfo.businessId = item.GID;
|
|
|
|
houseinfo.shippingNo = null;
|
|
|
|
houseinfo.shippingNo = null;
|
|
|
@ -432,7 +528,7 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AMSDDto aMSDDto = new AMSDDto();
|
|
|
|
AMSDDto aMSDDto = new AMSDDto();
|
|
|
|
aMSDDto.fromdea = "n";
|
|
|
|
aMSDDto.fromdea = "n";
|
|
|
|
aMSDDto.ids = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == oid).ToList().Select(x => x.GID).ToList();
|
|
|
|
aMSDDto.ids = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel!=true && x.PID == oid).ToList().Select(x => x.GID).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
docContent = JsonConvert.SerializeObject(aMSDDto).ToBase64();
|
|
|
|
docContent = JsonConvert.SerializeObject(aMSDDto).ToBase64();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -512,7 +608,7 @@ namespace djy.Service.Ams
|
|
|
|
return req;
|
|
|
|
return req;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (code == "T" && result == "true")
|
|
|
|
if (code == "T" && result == "true")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
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 = oid;
|
|
|
|
history.AM_ID = oid;
|
|
|
@ -544,36 +640,51 @@ namespace djy.Service.Ams
|
|
|
|
|
|
|
|
|
|
|
|
if (docType == "AMSDOC")
|
|
|
|
if (docType == "AMSDOC")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var getfinrs = fin.Expend(new CustFee
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "新增发送成功" }).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
|
|
|
|
foreach (var item in hodto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SENDUSERID = user.GID,
|
|
|
|
var getfinrs = fin.Expend(new CustFee
|
|
|
|
LURURENID = user.GID,
|
|
|
|
{
|
|
|
|
CtnrCount = 1,
|
|
|
|
CARRIER=master.CARRIER,
|
|
|
|
CtnrInfo = string.Empty,
|
|
|
|
ETD = master.ETA,
|
|
|
|
BSTYPE = 15,
|
|
|
|
VOYNO = master.VOYNO,
|
|
|
|
SENDTYPE = 0,
|
|
|
|
VESSEL = master.VESSEL,
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
HBLNO = item.HBLNo,
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
SENDUSERID = user.GID,
|
|
|
|
|
|
|
|
LURURENID = user.GID,
|
|
|
|
|
|
|
|
CtnrCount = 1,
|
|
|
|
|
|
|
|
CtnrInfo = string.Empty,
|
|
|
|
|
|
|
|
BSTYPE = 15,
|
|
|
|
|
|
|
|
SENDTYPE = 0,
|
|
|
|
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
|
|
|
|
}, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
, 1);
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "新增发送成功" }).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (docType == "AMSAR")
|
|
|
|
else if (docType == "AMSAR")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var getfinrs = fin.Expend(new CustFee
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "重发发送成功" }).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
|
|
|
|
foreach (var item in hodto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SENDUSERID = user.GID,
|
|
|
|
var getfinrs = fin.Expend(new CustFee
|
|
|
|
LURURENID = user.GID,
|
|
|
|
{
|
|
|
|
CtnrCount = 1,
|
|
|
|
CARRIER = master.CARRIER,
|
|
|
|
CtnrInfo = string.Empty,
|
|
|
|
ETD = master.ETA,
|
|
|
|
BSTYPE = 15,
|
|
|
|
VOYNO = master.VOYNO,
|
|
|
|
SENDTYPE = 0,
|
|
|
|
VESSEL = master.VESSEL,
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
HBLNO = item.HBLNo,
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
SENDUSERID = user.GID,
|
|
|
|
|
|
|
|
LURURENID = user.GID,
|
|
|
|
|
|
|
|
CtnrCount = 1,
|
|
|
|
|
|
|
|
CtnrInfo = string.Empty,
|
|
|
|
|
|
|
|
BSTYPE = 15,
|
|
|
|
|
|
|
|
SENDTYPE = 0,
|
|
|
|
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
|
|
|
|
}, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
, 1);
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "重发发送成功" }).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (docType == "AMSM")
|
|
|
|
else if (docType == "AMSM")
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -584,6 +695,7 @@ namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "删除发送成功" }).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "删除发送成功" }).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
@ -615,36 +727,74 @@ namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var masterid = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.GID == retdto.businessId).ToList().Select(x => x.PID).FirstOrDefault();
|
|
|
|
var masterid = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.GID == retdto.businessId).ToList().Select(x => x.PID).FirstOrDefault();
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => x.GID == masterid).ToOne();
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => x.GID == masterid).ToOne();
|
|
|
|
if (retdto.status != "W1")
|
|
|
|
|
|
|
|
|
|
|
|
if (retdto.status == "W2")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
var houses = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State != "1").ToList();
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
if (houses != null && houses.Count == 0)
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "匹配失败";
|
|
|
|
|
|
|
|
history.Type = "匹配失败";
|
|
|
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
|
|
|
history.Remark = "您的明细单据" + retdto.businessId + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "匹配失败";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
if (master.NewNotice == "删除发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "匹配成功";
|
|
|
|
|
|
|
|
history.Type = "匹配成功";
|
|
|
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
|
|
|
history.Remark = "您的单据于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "海关接收成功";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
if (master.NewNotice == "删除发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "删单失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "海关接收成功", ReportState = "删单成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "修改失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "海关接收成功", ReportState = "修改成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "海关接收成功", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
var faillist = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State == "0").ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (retdto.status == "1Y")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
var houses = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State != "1").ToList();
|
|
|
|
|
|
|
|
if (houses != null && houses.Count == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "匹配成功";
|
|
|
|
|
|
|
|
history.Type = "匹配成功";
|
|
|
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
|
|
|
history.Remark = "您的单据于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "船司匹配成功";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
if (master.NewNotice == "删除发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "接收失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "船司匹配成功", ReportState = "删单成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "船司匹配成功", ReportState = "修改成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "船司匹配成功", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var faillist = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State == "0").ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (retdto.status == "W1")
|
|
|
|
else if (retdto.status == "3Z")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
var houses = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State != "1").ToList();
|
|
|
|
var houses = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State != "1").ToList();
|
|
|
@ -657,30 +807,117 @@ namespace djy.Service.Ams
|
|
|
|
history.State = "匹配成功";
|
|
|
|
history.State = "匹配成功";
|
|
|
|
history.Type = "匹配成功";
|
|
|
|
history.Type = "匹配成功";
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
history.Remark = "您的单据于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "匹配成功";
|
|
|
|
history.Remark = "您的单据于" + 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 (master.NewNotice == "删除发送成功")
|
|
|
|
if (master.NewNotice == "删除发送成功")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配成功", ReportState = "删单成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "ISF匹配成功", ReportState = "删单成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配成功", ReportState = "修改成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "ISF匹配成功", ReportState = "修改成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配成功", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "ISF匹配成功", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var faillist = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State == "0").ToList();
|
|
|
|
var faillist = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID && x.State == "0").ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (retdto.status == "W1")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "匹配失败";
|
|
|
|
|
|
|
|
history.Type = "匹配失败";
|
|
|
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
|
|
|
history.Remark = "您的明细单据" + retdto.businessId + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "海关拒绝";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
if (master.NewNotice == "删除发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "海关拒绝", ReportState = "删单失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "海关拒绝", ReportState = "修改失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "海关拒绝", ReportState = "接收失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (retdto.status == "2Z")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "匹配失败";
|
|
|
|
|
|
|
|
history.Type = "匹配失败";
|
|
|
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
|
|
|
history.Remark = "您的明细单据" + retdto.businessId + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "箱货信息不匹配";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
if (master.NewNotice == "删除发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "箱货信息不匹配", ReportState = "删单失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "箱货信息不匹配", ReportState = "修改失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "箱货信息不匹配", ReportState = "接收失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
|
|
|
history.State = "匹配失败";
|
|
|
|
|
|
|
|
history.Type = "匹配失败";
|
|
|
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
|
|
|
history.Remark = "您的明细单据" + retdto.businessId + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "失败";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
if (master.NewNotice == "删除发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "删单失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "修改发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "修改失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "接收失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
req.Code = 200;
|
|
|
|
req.Code = 201;
|
|
|
|
req.Message = "未收到参数";
|
|
|
|
req.Message = "未收到参数";
|
|
|
|
return req;
|
|
|
|
return req;
|
|
|
|
}
|
|
|
|
}
|
|
|
|