|
|
@ -21,6 +21,7 @@ using System.Security.Cryptography;
|
|
|
|
using System.Text.Encodings.Web;
|
|
|
|
using System.Text.Encodings.Web;
|
|
|
|
using Common.Tools;
|
|
|
|
using Common.Tools;
|
|
|
|
using System.Web;
|
|
|
|
using System.Web;
|
|
|
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace djy.Service.Ams
|
|
|
|
namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -89,8 +90,9 @@ namespace djy.Service.Ams
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SaveInfo(AMSDto dto, string userid)
|
|
|
|
public string SaveInfo(AMSDto dto, string userid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
string guid="";
|
|
|
|
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
|
|
|
|
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
|
|
|
|
if (dto.GID.IsNull())
|
|
|
|
if (dto.GID.IsNull())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -141,7 +143,10 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guid = master.GID;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return guid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -183,7 +188,9 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
guid = master.GID;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return guid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -363,9 +370,36 @@ namespace djy.Service.Ams
|
|
|
|
jobj.ToString().ToBase64(), method.PARAMVALUE, DateTime.Now.ToString("yyyyMMdd") + GenerateRandomNo(),
|
|
|
|
jobj.ToString().ToBase64(), method.PARAMVALUE, DateTime.Now.ToString("yyyyMMdd") + GenerateRandomNo(),
|
|
|
|
AMSAccount.PARAMVALUE, HttpUtility.UrlEncode(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Encoding.UTF8),
|
|
|
|
AMSAccount.PARAMVALUE, HttpUtility.UrlEncode(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Encoding.UTF8),
|
|
|
|
sign, jobj.ToString().Length);
|
|
|
|
sign, jobj.ToString().Length);
|
|
|
|
await HttpHelp.Post(json, url.PARAMVALUE, PsotType.Urlencoded);
|
|
|
|
string gethtml = await HttpHelp.Post(json, url.PARAMVALUE, PsotType.Urlencoded);
|
|
|
|
|
|
|
|
if (gethtml!=null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
JObject rlt = JObject.Parse(gethtml);
|
|
|
|
|
|
|
|
var code= rlt.GetValue("code").ToString();
|
|
|
|
|
|
|
|
if (code=="F") {
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = oid;
|
|
|
|
|
|
|
|
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 (code == "T")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
history.AM_ID = oid;
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|