乐企他用 修改

main
dengyu 3 weeks ago
parent 571d591b39
commit 4b4d95158c

@ -51,7 +51,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
private string _REDCODE = string.Empty;//冲红时填写的对应蓝票票代码红票必填不满12位请左补0
private string _REDNUM = string.Empty;//冲红时填写的对应蓝票票号码红票必填不满8位请左补0
private string _PUSHMODE = "0";//推送方式:-1,不推送;0,邮箱;1,手机(默认);2,邮箱、手机 80002
private string _PUSHMODE = "-1";//推送方式:-1,不推送;0,邮箱;1,手机(默认);2,邮箱、手机 80002
private string _PUSHMOBILE = string.Empty;//购方手机(开票成功会短信提醒购方,不受推送方式影响)
private string _PUSHEMAIL = string.Empty;//推送邮箱pushMode为0或2时此项为必填
private string _INVOICELINE = "p";
@ -3126,7 +3126,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
BasicDataRefDAL.SaveLog(strJson, "", "乐企他用蓝票", "发出");
result = BasicDataRefDAL.SendToDJY("", strJson, SendUser.USERID, "", "东胜乐企他用_蓝票", USERKEY, USERSECRET);
result = BasicDataRefDAL.SendToLQTY("", strJson, SendUser.USERID, "", "东胜乐企他用_蓝票", USERKEY, USERSECRET);
if (result.Success && result.Data != null)
{
@ -3172,7 +3172,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
strJson = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(sendobject);
result = BasicDataRefDAL.SendToDJY("", strJson, SendUser.USERID, "", "东胜乐企他用_冲红", USERKEY, USERSECRET);
result = BasicDataRefDAL.SendToLQTY("", strJson, SendUser.USERID, "", "东胜乐企他用_冲红", USERKEY, USERSECRET);
return result;
}
@ -3194,7 +3194,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
//
result = BasicDataRefDAL.SendToDJY("", strJson, SendUser.USERID, "", "东胜乐企他用_读取", USERKEY, USERSECRET);
result = BasicDataRefDAL.SendToLQTY("", strJson, SendUser.USERID, "", "东胜乐企他用_读取", USERKEY, USERSECRET);
if (result.Data == null)
{

@ -7544,6 +7544,101 @@ namespace DSWeb.Areas.CommMng.DAL
return result;
}
public static DBResult SendToLQTY(string APIUrl, string strJson, string USERID, string APINAME = "", string APIDETAILNAME = "", string USERKEY = "", string USERSECRET = "")
{
var result = new DBResult();
try
{
var cdc = new CommonDataContext();
T_ALL_DA T_ALL_DA = new T_ALL_DA();
var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='LQTYAPIURL'");
var headers = new NameValueCollection();
if (!string.IsNullOrEmpty(DJYURL.PARAMVALUE))
{
// /Booking/CancelBooking
//string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + APIUrl, strJson);
//
if (!string.IsNullOrWhiteSpace(USERKEY) && !string.IsNullOrWhiteSpace(USERSECRET))
{
headers["USER_KEY"] = USERKEY;
headers["USER_SECRET"] = USERSECRET;
}
else
{
if (!string.IsNullOrWhiteSpace(APINAME))
{
var accCfg = MsSysThirdPartyAccountDAL.MakeSureField(APINAME, USERID);
//枚举类型96050 维护api地址。有时一个业务有多个api但是使用同一组userkey和secret
//因此如果通过 apiname=第三方账号密码设置中的类型 找不到内容
//则通过枚举类型96050当中enumvalueid=apiname 查找 enumvaluename(在这里存放apiurl)
if (accCfg.Success)
{
var accCfgInfo = (SysThirdPartyAccount)accCfg.Data;
headers["USER_KEY"] = accCfgInfo.ACCOUNT;
headers["USER_SECRET"] = accCfgInfo.ACCOUNTPSW;
var enumValue = cdc.tSysEnumValue.Where(x => x.EnumTypeID == 96020 && x.EnumValueName == APINAME).ToList();
if (enumValue != null && enumValue.Count > 0)
{
APIUrl = enumValue[0].EnumValueName_2;
}
}
else
{
result.SetErrorInfo($"[{APINAME}]没有设置第三方账号;");
return result;
}
}
//headers["USER_KEY"] = "0c635164b5b140828d156f178c86113c";
//headers["USER_SECRET"] = "7d23ef98894358e261996f46fb7d63aa8428a3d558cb21ed116f88c77642ba781c361c94cb1a8031";
}
var apiurlList = cdc.tSysEnumValue.Where(x => x.EnumTypeID == 96050).ToList();
if (apiurlList != null && apiurlList.Count > 0 && apiurlList.Exists(x => x.EnumValueID == APIDETAILNAME))
{
APIUrl = apiurlList.First(x => x.EnumValueID == APIDETAILNAME).EnumValueName;
}
BasicDataRefDAL.SaveLog(DJYURL.PARAMVALUE + APIUrl + "////" + strJson, $"{APINAME};{APIDETAILNAME}", "大简云接口调用", "发送");
var rtn = DSWeb.Areas.MvcShipping.Comm.WebRequestHelper.DoPost_JSON_Header(DJYURL.PARAMVALUE + APIUrl, strJson, 30000, headers);
BasicDataRefDAL.SaveLog(rtn, $"{APINAME};{APIDETAILNAME}", "大简云接口调用", "返回");
result.OK("同步完成", rtn);
}
else
{
MsSysParamSetDAL.SaveSysParamValue("LQTYAPIURL", "乐企他用接口服务地址", "http://47.105.115.105:26650");
//MsSysParamSetDAL.SaveSysParamValue("DJYAPIURL", "大简云接口服务地址", "http://47.105.115.105:26650");
}
}
catch (Exception e)
{
result.SetErrorInfo(e.Message);
SaveLog(JsonConvert.Serialize(e), "", "SendToDJY", "错误");
}
return result;
}
public static void CheckWebconfig(string itemname, ref DBResult result)
{
var item = ConfigurationManager.AppSettings[itemname];

@ -117,6 +117,8 @@ namespace DSWeb.Areas.SysMng.DAL.SysUser
data.isUseSystem = Convert.ToString(reader["isUseSystem"]);
data.isDisable = Convert.ToString(reader["isDisable"]);
data.IDCARD = Convert.ToString(reader["IDCARD"]);
#endregion
headList.Add(data); //把data的数据加入List对象
}

Loading…
Cancel
Save