From 4e828380ad46ba4b2ae770a99fb3dfb932e17954 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Fri, 8 Jul 2022 17:18:21 +0800 Subject: [PATCH] 1 --- web/djy.Service/Ams/AmsService.cs | 421 ++++++++++++++---- .../FolderProfile1.pubxml.user | 2 +- 2 files changed, 330 insertions(+), 93 deletions(-) diff --git a/web/djy.Service/Ams/AmsService.cs b/web/djy.Service/Ams/AmsService.cs index 23aeaff..510afee 100644 --- a/web/djy.Service/Ams/AmsService.cs +++ b/web/djy.Service/Ams/AmsService.cs @@ -227,45 +227,139 @@ namespace djy.Service.Ams master.LoadingPort = DbBus.Get(DbList.Common).Select().Where(x => x.EdiCode == master.LoadingPortCode).ToList().Select(x => x.EnName).FirstOrDefault(); master.LastNoUsPort = DbBus.Get(DbList.Common).Select().Where(x => x.Code == master.LastNoUsPortCode).ToList().Select(x => x.EnName).FirstOrDefault(); DbBus.Get(DbList.AMSCenter).Update().SetSource(master).ExecuteAffrows(); + #region 注释掉原有编辑逻辑 + //DbBus.Get(DbList.AMSCenter).Delete().Where(w => w.PID == master.GID).ExecuteAffrows(); - DbBus.Get(DbList.AMSCenter).Delete().Where(w => w.PID == master.GID).ExecuteAffrows(); + //DbBus.Get(DbList.AMSCenter).Delete().Where(w => w.PID == master.GID).ExecuteAffrows(); + #endregion - DbBus.Get(DbList.AMSCenter).Delete().Where(w => w.PID == master.GID).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(); - - if (dto.HouseDto != null && dto.HouseDto.Count() > 0) + foreach (var item in dto.HouseDto) { - foreach (var item in dto.HouseDto) + var house = DbBus.Get(DbList.AMSCenter).Select().Where(w => w.GID == item.GID).ToOne(); + if (house != null) { - AMS_House house = item.MapTo(); + 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().SetSource(house).ExecuteAffrows(); + if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0) { + foreach (var it in item.CntrnoDto) + { + var cntrno = DbBus.Get(DbList.AMSCenter).Select().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().SetSource(cntrno).ExecuteAffrows(); + } + else { + cntrno = it.MapTo(); + 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(); + 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(); + cntrno.GID = Guid.NewGuid().ToString("N"); cntrno.PID = master.GID; cntrno.HID = house.GID; cntrno.IsDel = false; + 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(); + // 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(); + // 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; }); return guid; @@ -293,7 +387,8 @@ namespace djy.Service.Ams { var docContent = ""; var fin = new FinanceService(); - var master = DbBus.Get(DbList.AMSCenter).Select().Where(x => (x.IsDel == false || x.IsDel == null) && x.CompID == user.CompId && x.GID == oid).ToOne(); + var master = DbBus.Get(DbList.AMSCenter).Select().Where(x =>x.IsDel != true && x.CompID == user.CompId && x.GID == oid).ToOne(); + var hodto = DbBus.Get(DbList.AMSCenter).Select().Where(x => x.IsDel != true && x.PID == oid && x.State == "0").ToList(); if (docType != "AMSD") { #region docContent 新增 重发 修改 @@ -304,29 +399,6 @@ namespace djy.Service.Ams req.Message = "当前状态不能重发!如有疑问,请联系相关客服!"; 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().Where(map => map.Module == "AMS").ToList(); var portList = DbBus.Get(DbList.Common).Select().ToList(); var containerTypeList = DbBus.Get(DbList.Common).Select().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.filingType = master.ShippingType; dto.masterBillInfo = masterBillInfo; - var hodto = DbBus.Get(DbList.AMSCenter).Select().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == oid && x.State == "0").ToList(); List houseBillInfoListItems = new List(); 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(); houseinfo.businessId = item.GID; houseinfo.shippingNo = null; @@ -432,7 +528,7 @@ namespace djy.Service.Ams } AMSDDto aMSDDto = new AMSDDto(); aMSDDto.fromdea = "n"; - aMSDDto.ids = DbBus.Get(DbList.AMSCenter).Select().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == oid).ToList().Select(x => x.GID).ToList(); + aMSDDto.ids = DbBus.Get(DbList.AMSCenter).Select().Where(x => x.IsDel!=true && x.PID == oid).ToList().Select(x => x.GID).ToList(); docContent = JsonConvert.SerializeObject(aMSDDto).ToBase64(); } @@ -512,7 +608,7 @@ namespace djy.Service.Ams return req; } if (code == "T" && result == "true") - { + { AMS_MasterHistory history = new AMS_MasterHistory(); history.GID = Guid.NewGuid().ToString("N"); history.AM_ID = oid; @@ -544,36 +640,51 @@ namespace djy.Service.Ams if (docType == "AMSDOC") { - var getfinrs = fin.Expend(new CustFee + + DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "新增发送成功" }).Where(w => w.GID == oid).ExecuteAffrows(); + foreach (var item in hodto) { - SENDUSERID = user.GID, - LURURENID = user.GID, - CtnrCount = 1, - CtnrInfo = string.Empty, - BSTYPE = 15, - SENDTYPE = 0, - BSNO = oid.ToString(), - MBLNO = master.MBLNO.ToString(), + var getfinrs = fin.Expend(new CustFee + { + CARRIER=master.CARRIER, + ETD = master.ETA, + 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(), + }, 1); } - , 1); - DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "新增发送成功" }).Where(w => w.GID == oid).ExecuteAffrows(); } else if (docType == "AMSAR") { - var getfinrs = fin.Expend(new CustFee + + DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "重发发送成功" }).Where(w => w.GID == oid).ExecuteAffrows(); + foreach (var item in hodto) { - SENDUSERID = user.GID, - LURURENID = user.GID, - CtnrCount = 1, - CtnrInfo = string.Empty, - BSTYPE = 15, - SENDTYPE = 0, - BSNO = oid.ToString(), - MBLNO = master.MBLNO.ToString(), + var getfinrs = fin.Expend(new CustFee + { + CARRIER = master.CARRIER, + ETD = master.ETA, + 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(), + }, 1); } - , 1); - DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "重发发送成功" }).Where(w => w.GID == oid).ExecuteAffrows(); - } else if (docType == "AMSM") { @@ -584,6 +695,7 @@ namespace djy.Service.Ams { DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { ReportState = "已提交", NewNotice = "删除发送成功" }).Where(w => w.GID == oid).ExecuteAffrows(); } + } } #endregion @@ -615,36 +727,74 @@ namespace djy.Service.Ams { var masterid = DbBus.Get(DbList.AMSCenter).Select().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().Where(x => x.GID == masterid).ToOne(); - if (retdto.status != "W1") + + if (retdto.status == "W2") { - 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().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows(); - if (master.NewNotice == "删除发送成功") + DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows(); + var houses = DbBus.Get(DbList.AMSCenter).Select().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().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().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().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "修改失败" }).Where(w => w.GID == master.GID).ExecuteAffrows(); + DbBus.Get(DbList.AMSCenter).Update().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().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().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().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows(); + var houses = DbBus.Get(DbList.AMSCenter).Select().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().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "接收失败" }).Where(w => w.GID == master.GID).ExecuteAffrows(); - } + DbBus.Get(DbList.AMSCenter).Update().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().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().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "船司匹配成功", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows(); + } + } + var faillist = DbBus.Get(DbList.AMSCenter).Select().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().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows(); var houses = DbBus.Get(DbList.AMSCenter).Select().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.Type = "匹配成功"; 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(); if (master.NewNotice == "删除发送成功") { - DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配成功", ReportState = "删单成功" }).Where(w => w.GID == master.GID).ExecuteAffrows(); + DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "ISF匹配成功", ReportState = "删单成功" }).Where(w => w.GID == master.GID).ExecuteAffrows(); } if (master.NewNotice == "修改发送成功") { - DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配成功", ReportState = "修改成功" }).Where(w => w.GID == master.GID).ExecuteAffrows(); + DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "ISF匹配成功", ReportState = "修改成功" }).Where(w => w.GID == master.GID).ExecuteAffrows(); } if (master.NewNotice == "重发发送成功" || master.NewNotice == "新增发送成功") { - DbBus.Get(DbList.AMSCenter).Update().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配成功", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows(); + DbBus.Get(DbList.AMSCenter).Update().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().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().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows(); + if (master.NewNotice == "删除发送成功") + { + + DbBus.Get(DbList.AMSCenter).Update().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().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().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().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows(); + if (master.NewNotice == "删除发送成功") + { + + DbBus.Get(DbList.AMSCenter).Update().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().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().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().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows(); + if (master.NewNotice == "删除发送成功") + { + + DbBus.Get(DbList.AMSCenter).Update().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().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().Set(w => new AMS_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "接收失败" }).Where(w => w.GID == master.GID).ExecuteAffrows(); + } + + } } else { - req.Code = 200; + req.Code = 201; req.Message = "未收到参数"; return req; } diff --git a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user index 33ece09..76172ca 100644 --- a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user +++ b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -5,6 +5,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121. <_PublishTargetUrl>C:\Project\DJYAMS\djyweb_ams\web\djy.WebApi\bin\Release\net5.0\publish\ - True|2022-07-07T03:23:54.2426892Z;True|2022-07-05T16:20:17.0177653+08:00;True|2022-07-05T16:19:13.8760086+08:00;True|2022-07-05T11:23:47.7031600+08:00; + True|2022-07-08T09:01:30.6693134Z;True|2022-07-08T12:06:36.3838761+08:00;True|2022-07-07T16:23:24.9970320+08:00;True|2022-07-07T16:13:59.0482365+08:00;True|2022-07-07T11:23:54.2426892+08:00;True|2022-07-05T16:20:17.0177653+08:00;True|2022-07-05T16:19:13.8760086+08:00;True|2022-07-05T11:23:47.7031600+08:00; \ No newline at end of file