Browse Source

111

Lishi
xxe 2 years ago
parent
commit
81f65e3bf0
4 changed files with 17 additions and 13 deletions
  1. +1
    -1
      HKCardManager/InstitutionalEntry.cs
  2. +1
    -1
      HKCardManager/UserPages/InstitutionalEntryPage.cs
  3. +13
    -11
      HKLib/Interfaces/HKLibHelper.cs
  4. +2
    -0
      HKLib/Logic/ServiceHandler.cs

+ 1
- 1
HKCardManager/InstitutionalEntry.cs View File

@@ -45,7 +45,7 @@ namespace HKCardManager
}
else
{
this.Invoke(() => { label2.Text = "添加失败,请重试"; });
this.Invoke(() => { label2.Text = "添加失败,请重试,请检查机构是否存在"; });
}
});



+ 1
- 1
HKCardManager/UserPages/InstitutionalEntryPage.cs View File

@@ -40,7 +40,7 @@ namespace HKCardManager.UserPages
MessageLogNotify.GetInstance.Show($"【{name}】 机构添加成功");
}
else
MessageLogNotify.GetInstance.ShowError($"【{name}】 机构添加失败,请重试");
MessageLogNotify.GetInstance.ShowError($"【{name}】 机构添加失败,请重试,请检查机构是否存在");

});
}


+ 13
- 11
HKLib/Interfaces/HKLibHelper.cs View File

@@ -41,7 +41,7 @@ namespace HKLib.Interfaces
var res = data.ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool();
if (res)
{
ServiceQueryPush.QueryPush.PushMQ(input, "TimeChanged", MQEnum.Push);
ServiceQueryPush.QueryPush.PushMQAsync(input, "TimeChanged", MQEnum.Push);
return res;
}
return false;
@@ -99,12 +99,13 @@ namespace HKLib.Interfaces
/// <param name="keyword"></param>
public static List<UserListDto> GetUserList(string keyword)
{
return IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}api/one-card/staff-list";
t.ReqType = MultiType.POST;
t.JsonParam = (new { realName = keyword }).ToJson();
}).Build().RunStringFirst().ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<UserListDto>>();
var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}api/one-card/staff-list";
t.ReqType = MultiType.POST;
t.JsonParam = (new { realName = keyword }).ToJson();
}).Build().RunStringFirst();
return data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<UserListDto>>();
}
/// <summary>
/// 添加用户并绑卡
@@ -126,11 +127,12 @@ namespace HKLib.Interfaces
/// <returns></returns>
public static bool DisableUser(string userName)
{
List<string> a = new List<string>() { userName };
return IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}api/one-card/mmenber-card";
t.NodePath = $"{Configer.SaasRoute}api/one-card/del-staff";
t.ReqType = MultiType.POST;
t.JsonParam = (new { realName = userName }).ToJson();
t.JsonParam = a.ToJson();
}).Build().RunStringFirst().ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool();
}
/// <summary>
@@ -152,7 +154,7 @@ namespace HKLib.Interfaces
/// <param name="input"></param>
public static bool CardStutasChange(CardStutasDto input)
{
input.CardNo = GetUserList(input.keywrod).FirstOrDefault(t => t.Name.Equals(input.keywrod)).Cards.FirstOrDefault(t => t.State == 1).CardNum;
input.CardNo = GetUserList(input.keywrod).FirstOrDefault(t => t.Name.Equals(input.keywrod)).Cards.FirstOrDefault().CardNum;

var x = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t =>
{
@@ -162,7 +164,7 @@ namespace HKLib.Interfaces
}).Build().RunStringFirst().ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool();
if (x)
{
ServiceQueryPush.QueryPush.PushMQ(input, "CardStutasChanged", MQEnum.Top);
ServiceQueryPush.QueryPush.PushMQAsync(input, "CardStutasChanged", MQEnum.Top);
return x;
}
return false;


+ 2
- 0
HKLib/Logic/ServiceHandler.cs View File

@@ -12,6 +12,8 @@ namespace HKLib.Logic
#region 机构类
public static bool AddOrg(string Name)
{
var check = DbContext.Context.Queryable<OrgTable>().First(t => t.Name == Name);
if (check != null) return false;
var SiD = HKLibHelper.SetOrg(Name);
return DbContext.Context.Insertable(new OrgTable
{


Loading…
Cancel
Save