AMS/AmsController.cs

master
wet 2 years ago
parent ec842cbb91
commit 58fd91b96e

@ -1610,6 +1610,11 @@
日志库
</summary>
</member>
<member name="F:Common.DjyService.DbList.Common">
<summary>
Common库
</summary>
</member>
<member name="T:Common.DjyService.DbContext">
<summary>
数据库操作类
@ -6270,6 +6275,11 @@
操作消息【当Status不为 200时显示详细的错误信息】
</summary>
</member>
<member name="P:Common.Utilities.Response.data">
<summary>
返回data
</summary>
</member>
<member name="P:Common.Utilities.Response.Code">
<summary>
操作状态码200为正常

@ -118,7 +118,7 @@ namespace Common.DjyService
var count = 0;
try
{
LogsList.ForEach(x=> { x.Init();x.SysCode = "djypaas"; });
LogsList.ForEach(x=> { x.Init();x.SysCode = "AMS"; });
count = DbBus.Get(DbList.Logsdb).Insert(LogsList).ExecuteAffrows();
}
catch { }

@ -53,5 +53,8 @@ namespace djy.Paas.IService
Task<Response> SendDE(string Gid, string userid, string docType);
Response SaveReceipt(AMSReturnDto retdto);
}
}

@ -137,5 +137,8 @@ namespace djy.Model.Ams
/// 通知人城市
/// </summary>
public string NOTIFYPARTYCity { get; set; }
public string State { get; set; }
}
}

@ -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
}
}

@ -236,14 +236,11 @@ namespace djy_AmsApi.Controllers
}
return result;
}
#endregion
#region 第三方接口
[HttpGet("Send")]
public async Task<Response> Send(string ids,string docType)
{
@ -255,21 +252,17 @@ namespace djy_AmsApi.Controllers
// result.Message = "登录过期,请重新登录!";
// return result;
//}
try
{
var result= ser.SendDE(ids, "d85fd590-d9f6-4410-93a1-f6fac77b606e", docType);
req.Code = result.Result.Code;
req.Message = result.Result.Message;
return req;
}
catch (Exception ex)
{
req.Code = 500;
req.Message = ex.InnerException?.Message ?? ex.Message;
return req;
}
req.Code = result.Result.Code;
req.Message = result.Result.Message;
return req;
}
[AllowAnonymous]
[HttpPost("Receipt")]
public Response SaveReceipt(AMSReturnDto retdto,string Key=null)
{
return ser.SaveReceipt(retdto);
}
#endregion

File diff suppressed because one or more lines are too long

@ -61,7 +61,7 @@
"Index": 100,
"DataType": 1,
"Status": 0,
"ConnString": "Data Source =172.31.85.154,1433; Initial Catalog=djy_logs; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true"
"ConnString": "Data Source =123.234.225.158,28000; Initial Catalog=TestDjyLogs; Persist Security Info=True; User ID =test; Password=test123;pooling=true"
}

Loading…
Cancel
Save