|
|
|
@ -48,7 +48,7 @@ namespace djy.Service.Isf
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
var historyDto = DbBus.Get(DbList.AMSCenter).Select<ISF_MasterHistory>().Where(x => x.ISF_ID == item.GID).ToList();
|
|
|
|
|
var historyDto = DbBus.Get(DbList.AMSCenter).Select<ISF_MasterHistory>().Where(x => x.ISF_ID == item.GID).OrderByDescending(x => x.SendTime).ToList();
|
|
|
|
|
item.HistoryDto = historyDto;
|
|
|
|
|
var companylist = DbBus.Get(DbList.AMSCenter).Select<ISF_Company>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == item.GID).ToList();
|
|
|
|
|
item.companyList = companylist;
|
|
|
|
@ -609,31 +609,23 @@ namespace djy.Service.Isf
|
|
|
|
|
ISFReceipt retdto = Json.JsonToObject<ISFReceipt>(msg);
|
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<ISF_Master>().Where(x => x.GID == retdto.businessId).ToOne();
|
|
|
|
|
|
|
|
|
|
if (retdto.status == "SI")
|
|
|
|
|
if (retdto.status == "S1")
|
|
|
|
|
{
|
|
|
|
|
ISF_MasterHistory history = new ISF_MasterHistory();
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
history.ISF_ID = master.GID;
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
history.State = "匹配失败";
|
|
|
|
|
history.Type = "匹配失败";
|
|
|
|
|
history.State = "ISF和AMS匹配";
|
|
|
|
|
history.Type = "ISF和AMS匹配";
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
history.Remark = "您的明细单据" + retdto.businessId + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "匹配失败";
|
|
|
|
|
history.Remark = "您的明细单据" + retdto.businessId + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "ISF和AMS匹配";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
//if (master.NewNotice == "删除发送成功")
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Update<ISF_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<ISF_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<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "匹配失败", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "ISF和AMS匹配", ReportState = "匹配成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (retdto.status == "02")
|
|
|
|
@ -642,12 +634,12 @@ namespace djy.Service.Isf
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
history.ISF_ID = master.GID;
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
history.State = "删除成功";
|
|
|
|
|
history.Type = "删除成功";
|
|
|
|
|
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") + "海关已接受";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "ISF和AMS匹配成功", ReportState = "删单失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "海关已接受", ReportState = "接收成功" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
else if (retdto.status == "01")
|
|
|
|
|
{
|
|
|
|
@ -656,11 +648,11 @@ namespace djy.Service.Isf
|
|
|
|
|
history.ISF_ID = master.GID;
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
history.State = "海关拒绝";
|
|
|
|
|
history.Type = "删除成功";
|
|
|
|
|
history.Type = "海关拒绝";
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
history.Remark = "您的单据于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "海关拒绝";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "海关拒绝", ReportState = "删单失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "海关已拒绝", ReportState = "海关拒绝" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
else if (retdto.status == "SB" || retdto.status == "S2" || retdto.status == "S3" || retdto.status == "S4" || retdto.status == "S5" || retdto.status == "S6")
|
|
|
|
|
{
|
|
|
|
@ -671,9 +663,9 @@ namespace djy.Service.Isf
|
|
|
|
|
history.State = "未匹配AMS";
|
|
|
|
|
history.Type = "未匹配AMS";
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
history.Remark = "您的单据于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "海关拒绝";
|
|
|
|
|
history.Remark = "您的单据于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "未匹配AMS";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "未匹配AMS", ReportState = "删单失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<ISF_Master>().Set(w => new ISF_Master { MateState = retdto.status, NewNotice = "未匹配AMS", ReportState = "匹配失败" }).Where(w => w.GID == master.GID).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|