自动扣费修改

master
wanghaomei 2 years ago
parent dda7659f67
commit 2b4f449f32

3
.gitignore vendored

@ -24,3 +24,6 @@ bin-release/
/djy.Paas.IService/.vs /djy.Paas.IService/.vs
/djyweb_djyPaasApi/publish /djyweb_djyPaasApi/publish
/djyweb_djyPaasApi/userdata /djyweb_djyPaasApi/userdata
/djyweb_djyPaasApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
/djyweb_djyPaasApi/Properties/PublishProfiles/FolderProfile.pubxml.user
/djyweb_djyPaasApi/DJY_SYHT.csproj.user

@ -2223,15 +2223,13 @@ namespace djy.Paas.Service
var cfgAutoCompId = DjyTools.GetConfigKey("baoguanAutoBindCompanyFeeCompId"); var cfgAutoCompId = DjyTools.GetConfigKey("baoguanAutoBindCompanyFeeCompId");
var cfgDingtalk = DjyTools.GetConfigKey("baoguanDingtalkNotify"); var cfgDingtalk = DjyTools.GetConfigKey("baoguanDingtalkNotify");
_LogsAdd($"报关自动扣费,公司参数:{cfgAutoCompId}", "胜云航通客服消息", null); _LogsAdd($"报关自动扣费,公司参数:{cfgAutoCompId}", "胜云航通自动扣费", null);
_LogsAdd($"报关自动扣费,钉钉:{cfgDingtalk}", "胜云航通客服消息", null); _LogsAdd($"报关自动扣费,钉钉:{cfgDingtalk}", "胜云航通自动扣费", null);
if (!string.IsNullOrEmpty(cfgAutoCompId)) if (!string.IsNullOrEmpty(cfgAutoCompId))
{
try
{ {
var arr = cfgAutoCompId.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); var arr = cfgAutoCompId.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
_LogsAdd($"报关自动扣费,待处理公司:{arr.Length}", "胜云航通客服消息", null); _LogsAdd($"报关自动扣费,待处理公司:{arr.Length}", "胜云航通自动扣费", null);
foreach (var compid in arr) foreach (var compid in arr)
{ {
var guidComp = Guid.Parse(compid); var guidComp = Guid.Parse(compid);
@ -2243,7 +2241,9 @@ namespace djy.Paas.Service
&& (x.stateCode == "14" || x.stateCode == "15" || x.stateCode == "18"))//14海关放行15已结关18准予入港 && (x.stateCode == "14" || x.stateCode == "15" || x.stateCode == "18"))//14海关放行15已结关18准予入港
.ToList(); .ToList();
_LogsAdd($"处理{compid}的报关自动扣费,共发现{orderList.Count}票", "胜云航通客服消息", null);
_LogsAdd($"处理{guidComp}的报关自动扣费,共发现{orderList.Count}票", "胜云航通自动扣费", null);
foreach (var ord in orderList) foreach (var ord in orderList)
{ {
@ -2256,8 +2256,16 @@ namespace djy.Paas.Service
{ {
//推送钉钉消息给客服 //推送钉钉消息给客服
var content = $"公司{ord.ClientName}未找到"; var content = $"公司{ord.ClientName}未找到";
_LogsAdd(content, "胜云航通客服消息", null); _LogsAdd(content, "胜云航通自动扣费", null);
var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通客服消息", YsPsotType.Json).Result; var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通自动扣费", YsPsotType.Json).Result;
//设置状态
DbBus.Get(DbList.djypublicedb).Update<tb_BaoGuanOrderList>()
.Where(x => x.Gid == ord.Gid)
.Set(x => x.StaCustFee, "FAIL")
.Set(x => x.TimeCustFee, DateTime.Now)
.ExecuteAffrows();
continue; continue;
} }
@ -2271,8 +2279,16 @@ namespace djy.Paas.Service
{ {
//推送钉钉消息给客服 //推送钉钉消息给客服
var content = $"公司{ord.ClientName}没有钱包"; var content = $"公司{ord.ClientName}没有钱包";
_LogsAdd(content, "胜云航通客服消息", null); _LogsAdd(content, "胜云航通自动扣费", null);
var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通客服消息", YsPsotType.Json).Result; var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通自动扣费", YsPsotType.Json).Result;
//设置状态
DbBus.Get(DbList.djypublicedb).Update<tb_BaoGuanOrderList>()
.Where(x => x.Gid == ord.Gid)
.Set(x => x.StaCustFee, "FAIL")
.Set(x => x.TimeCustFee, DateTime.Now)
.ExecuteAffrows();
continue; continue;
} }
@ -2287,7 +2303,15 @@ namespace djy.Paas.Service
{ {
//推送钉钉消息给客服 //推送钉钉消息给客服
var content = $"公司{ord.ClientName}的报关单价未设置"; var content = $"公司{ord.ClientName}的报关单价未设置";
var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通客服消息", YsPsotType.Json).Result; var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通自动扣费", YsPsotType.Json).Result;
//设置状态
DbBus.Get(DbList.djypublicedb).Update<tb_BaoGuanOrderList>()
.Where(x => x.Gid == ord.Gid)
.Set(x => x.StaCustFee, "FAIL")
.Set(x => x.TimeCustFee, DateTime.Now)
.ExecuteAffrows();
continue; continue;
} }
@ -2297,7 +2321,15 @@ namespace djy.Paas.Service
{ {
//推送钉钉消息给客服 //推送钉钉消息给客服
var content = $"公司{ord.ClientName}的余额不足"; var content = $"公司{ord.ClientName}的余额不足";
var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通客服消息", YsPsotType.Json).Result; var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通自动扣费", YsPsotType.Json).Result;
//设置状态
DbBus.Get(DbList.djypublicedb).Update<tb_BaoGuanOrderList>()
.Where(x => x.Gid == ord.Gid)
.Set(x => x.StaCustFee, "FAIL")
.Set(x => x.TimeCustFee, DateTime.Now)
.ExecuteAffrows();
continue; continue;
} }
@ -2327,20 +2359,22 @@ namespace djy.Paas.Service
} }
else else
{ {
//设置状态
DbBus.Get(DbList.djypublicedb).Update<tb_BaoGuanOrderList>()
.Where(x => x.Gid == ord.Gid)
.Set(x => x.StaCustFee, "FAIL")
.Set(x => x.TimeCustFee, DateTime.Now)
.ExecuteAffrows();
//推送钉钉消息给客服 //推送钉钉消息给客服
var content = $"公司{ord.ClientName}报关扣费失败:{getfinrs.Message}"; var content = $"公司{ord.ClientName}报关扣费失败:{getfinrs.Message}";
var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通客服消息", YsPsotType.Json).Result; var gethtml = DjyTools.PostOnLogs(new { text = new { content = $"【未扣费提醒】\r\n{content}\r\n----报关消息通知" }, msgtype = "text" }, cfgDingtalk, "胜云航通自动扣费", YsPsotType.Json).Result;
} }
} }
} }
} }
catch (Exception ex)
{
_LogsAdd(ex.Message, "胜云航通自动扣费", new { ex.StackTrace });
}
}
} }
#endregion #endregion
} }

@ -116,7 +116,7 @@ namespace djy.Paas.Service
var count = 0; var count = 0;
try try
{ {
LogsList.ForEach(x=> { x.Init();x.SysCode = "djypaas"; }); LogsList.ForEach(x=> { x.Init();x.SysCode = "djy_syht"; });
count = DbBus.Get(DbList.Logsdb).Insert(LogsList).ExecuteAffrows(); count = DbBus.Get(DbList.Logsdb).Insert(LogsList).ExecuteAffrows();
} }
catch { } catch { }

Loading…
Cancel
Save