|
|
|
@ -62,12 +62,21 @@ namespace djy.Service.Ams
|
|
|
|
|
.WhereIf(hou != null, x => hou.Contains(x.GID))
|
|
|
|
|
.WhereIf(req.BDate != null, x => x.CreateTime >= req.BDate)
|
|
|
|
|
.WhereIf(req.EDate != null, x => x.CreateTime <= req.EDate).OrderByDescending(x => x.CreateTime);
|
|
|
|
|
|
|
|
|
|
var SASCCODEList = DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.ParaCode == "AMSSASCCODE").ToList();
|
|
|
|
|
var list = dto.Page(req.Page, req.Limit).ToList<AMSDto>();
|
|
|
|
|
if (list != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
var SASCCODE = SASCCODEList.Where(x => x.CompId == item.CompID).FirstOrDefault();
|
|
|
|
|
if (SASCCODE != null)
|
|
|
|
|
{
|
|
|
|
|
item.SASCCODE = SASCCODE.ItemCode;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.SASCCODE = "NIAV";
|
|
|
|
|
}
|
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.PID == item.GID)
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(req.Hid), x => x.GID == req.Hid)
|
|
|
|
|
.WhereIf(req.HBLNo != null, x => x.HBLNo.Contains(req.HBLNo.Trim()))
|
|
|
|
@ -78,7 +87,6 @@ namespace djy.Service.Ams
|
|
|
|
|
item.HouseDto = hodto;
|
|
|
|
|
if (hodto != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
foreach (var it in hodto)
|
|
|
|
|
{
|
|
|
|
|
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => x.IsDel != true && x.HID == it.GID).ToList();
|
|
|
|
@ -89,8 +97,6 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
count += hodto.Count();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList();
|
|
|
|
|
if (req.ReportState == "0")
|
|
|
|
@ -423,6 +429,7 @@ namespace djy.Service.Ams
|
|
|
|
|
var url = DbBus.Get(DbList.djydb).Select<ParamSet>().Where(x => x.PARAMNAME == "AMSURL").ToOne();
|
|
|
|
|
var method = DbBus.Get(DbList.djydb).Select<ParamSet>().Where(x => x.PARAMNAME == "AMSMethod").ToOne();
|
|
|
|
|
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
var AMSRequestDEA = DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.CompId == user.CompId && x.ParaCode == "AMSRequestDEA").First();
|
|
|
|
|
foreach (string oid in id)
|
|
|
|
|
{
|
|
|
|
|
if (oid != "")
|
|
|
|
@ -457,8 +464,15 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
masterBillInfo.voyage = master.VOYNO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (AMSRequestDEA != null)
|
|
|
|
|
{
|
|
|
|
|
masterBillInfo.requesterDea = AMSRequestDEA.ItemCode;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
|
@ -597,7 +611,15 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (AMSRequestDEA != null)
|
|
|
|
|
{
|
|
|
|
|
masterBillInfo.requesterDea = AMSRequestDEA.ItemCode;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
|
@ -1227,42 +1249,42 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
history.AM_ID = retdto.businessId;
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
history.State = "匹配失败";
|
|
|
|
|
history.Type = "1";
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
history.Remark = "您的单据" + house.HBLNo + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "匹配失败";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
// AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
// history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
// history.AM_ID = retdto.businessId;
|
|
|
|
|
// history.SendTime = DateTime.Now;
|
|
|
|
|
// history.State = "匹配失败";
|
|
|
|
|
// history.Type = "1";
|
|
|
|
|
// history.Operator = "系统管理员";
|
|
|
|
|
// history.Remark = "您的单据" + house.HBLNo + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "匹配失败";
|
|
|
|
|
// 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 = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (house.NewNotice == "修改发送成功")
|
|
|
|
|
{
|
|
|
|
|
// 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 == "修改发送成功")
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
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 == "重发发送成功" || house.NewNotice == "新增发送成功")
|
|
|
|
|
{
|
|
|
|
|
// 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 == "重发发送成功" || house.NewNotice == "新增发送成功")
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).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
|
|
|
|
@ -1313,7 +1335,8 @@ namespace djy.Service.Ams
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodeCountry>().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim()) || x.CnName.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCNEN
|
|
|
|
|
{
|
|
|
|
|
Code = x.Code,
|
|
|
|
@ -1416,7 +1439,8 @@ namespace djy.Service.Ams
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodePort>().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCodeValue
|
|
|
|
|
{
|
|
|
|
@ -1465,7 +1489,8 @@ namespace djy.Service.Ams
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodeVessel>().WhereIf(strlink != "", x => x.Name.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCodeValue
|
|
|
|
|
{
|
|
|
|
|
Code = x.Name,
|
|
|
|
@ -1733,6 +1758,21 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<company_new_param_value> GetSASCCODE(User user)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var List = await DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.CompId == user.CompId && x.ParaCode == "AMSSASCCODE").FirstAsync();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|