|
|
|
@ -109,8 +109,6 @@ namespace djy.Service.Ams
|
|
|
|
|
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
|
|
|
|
|
if (dto.GID.IsNull())
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Transaction(() =>
|
|
|
|
|
{
|
|
|
|
|
AMS_Master master = dto.MapTo<AMS_Master>();
|
|
|
|
@ -141,6 +139,7 @@ namespace djy.Service.Ams
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
@ -172,7 +171,7 @@ namespace djy.Service.Ams
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
history.AM_ID = master.GID;
|
|
|
|
|
history.SendTime = DateTime.Now;///
|
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
|
history.State = "已修改";
|
|
|
|
|
history.Type = "修改";
|
|
|
|
|
history.Operator = user.SHOWNAME;
|
|
|
|
@ -186,6 +185,7 @@ namespace djy.Service.Ams
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
@ -217,7 +217,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Code = x.Code,
|
|
|
|
|
Value = x.EnName,
|
|
|
|
|
}).ToList();
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -235,7 +235,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Code = cc.Code,
|
|
|
|
|
Value = cc.EnName,
|
|
|
|
|
});
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -252,7 +252,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Code = cc.Code,
|
|
|
|
|
Value = cc.Name,
|
|
|
|
|
});
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -269,7 +269,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Code = cc.Code,
|
|
|
|
|
Value = cc.Name,
|
|
|
|
|
});
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -286,7 +286,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Code = x.Code,
|
|
|
|
|
Grade = x.Grade,
|
|
|
|
|
}).ToList();
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -304,7 +304,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Code = x.Code,
|
|
|
|
|
Value = x.EnName,
|
|
|
|
|
}).ToList();
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -323,7 +323,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Code = x.Name,
|
|
|
|
|
Value = x.Name,
|
|
|
|
|
}).ToList();
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
@ -433,9 +433,6 @@ namespace djy.Service.Ams
|
|
|
|
|
insertList.dangerMemo = "";
|
|
|
|
|
insertList.ignite = "";
|
|
|
|
|
list.Add(insertList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CtnInfo.insertList = list;
|
|
|
|
|
houseinfo.ctnInfo = CtnInfo;
|
|
|
|
|
houseBillInfoListItems.Add(houseinfo);
|
|
|
|
@ -452,8 +449,6 @@ namespace djy.Service.Ams
|
|
|
|
|
aMSDoc.port = "Ningbo";
|
|
|
|
|
aMSDoc.masterBillInfo = dto;
|
|
|
|
|
docContent = JsonConvert.SerializeObject(aMSDoc).ToBase64();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -496,8 +491,11 @@ namespace djy.Service.Ams
|
|
|
|
|
dic.Add("sign", sign);
|
|
|
|
|
dic.Add("docLength", docContent.ToString().Length.ToString());
|
|
|
|
|
#region 接口调用
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用发送:{dic}");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用地址:{url.PARAMVALUE}");
|
|
|
|
|
string gethtml = await HttpHelp.Post(dic, url.PARAMVALUE, PsotType.Urlencoded);
|
|
|
|
|
if (gethtml!=null)
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用返回:{gethtml}");
|
|
|
|
|
if (gethtml!=null)
|
|
|
|
|
{
|
|
|
|
|
JObject rlt = JObject.Parse(gethtml);
|
|
|
|
|
var code= rlt.GetValue("code").ToString();
|
|
|
|
@ -565,8 +563,6 @@ namespace djy.Service.Ams
|
|
|
|
|
if (docType == "AMSDOC")
|
|
|
|
|
{
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已申报", NewNotice="新增发送成功"}).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (docType == "AMSAR")
|
|
|
|
|
{
|
|
|
|
@ -603,6 +599,8 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
req.Code = 500;
|
|
|
|
|
req.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS_SendDE接口:{req.Message }");
|
|
|
|
|
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -611,6 +609,27 @@ namespace djy.Service.Ams
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Response SaveReceipt(AMSReturnDto retdto)
|
|
|
|
|
{
|
|
|
|
|
Response req = new Response();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_LogsAdd("SaveReceipt", "post", $"AMS接口推送:{JsonConvert.SerializeObject(retdto)}");
|
|
|
|
|
return req;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
req.Code = 500;
|
|
|
|
|
req.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS_SaveReceipt接口:{req.Message }");
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据日期生成14位随机数
|
|
|
|
@ -623,6 +642,8 @@ namespace djy.Service.Ams
|
|
|
|
|
Random _rdm = new Random();
|
|
|
|
|
return DateTime.Now.ToString("yyyyMMdd")+_rdm.Next(_min, _max).ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|