手动打卡

This commit is contained in:
2026-01-26 17:59:07 +08:00
parent a5a8b130e5
commit 065a7de588
5 changed files with 82 additions and 43 deletions
+29 -13
View File
@@ -17,10 +17,18 @@ namespace BLL.Common
public static string getToken()
{
string data = "client_id=" + ClientId + "&client_secret=" + ClientSecret + "&grant_type=client_credentials&scope=app";
string result = Post(YunMouUrl + "oauth/token", data, "application/x-www-form-urlencoded", "");
var j2 = JsonConvert.DeserializeObject<dynamic>(result);
return j2.access_token;
try
{
string data = "client_id=" + ClientId + "&client_secret=" + ClientSecret + "&grant_type=client_credentials&scope=app";
string result = Post(YunMouUrl + "oauth/token", data, "application/x-www-form-urlencoded", "");
var j2 = JsonConvert.DeserializeObject<dynamic>(result);
return j2.access_token;
}
catch (Exception e)
{
}
return "";
}
/// <summary>
@@ -393,14 +401,17 @@ namespace BLL.Common
/// <returns></returns>
public static string addConsumer(string access_token)
{
string result = Post(YunMouUrl + "api/v1/mq/consumer/group1", "", "application/json;charset=UTF-8", access_token);
var j2 = JsonConvert.DeserializeObject<dynamic>(result);
if (j2.code == "200")
return j2.data.consumerId;
else
try
{
return "";
string result = Post(YunMouUrl + "api/v1/mq/consumer/group1", "", "application/json;charset=UTF-8", access_token);
var j2 = JsonConvert.DeserializeObject<dynamic>(result);
if (j2.code == "200")
return j2.data.consumerId;
}
catch (Exception e) { }
return "";
}
/// <summary>
/// 提交偏移量
@@ -423,9 +434,14 @@ namespace BLL.Common
/// <returns></returns>
public static string consumerMessage(string consumerId, string access_token)
{
string data = "consumerId=" + consumerId + "&autoCommit=true";
string result = Post(YunMouUrl + "api/v1/mq/consumer/messages", data, "application/x-www-form-urlencoded", access_token);
return result;
try
{
string data = "consumerId=" + consumerId + "&autoCommit=true";
string result = Post(YunMouUrl + "api/v1/mq/consumer/messages", data, "application/x-www-form-urlencoded", access_token);
return result;
}
catch (Exception e) { }
return "";
}
/// <summary>
@@ -142,13 +142,13 @@ namespace BLL
};
Model.SitePerson_Person getPerson = new Model.SitePerson_Person();
if (!string.IsNullOrEmpty(personInOut.PersonId))
if (!string.IsNullOrEmpty(personInOut.IdentityCard))
{
getPerson = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(personInOut.ProjectId, personInOut.PersonId);
getPerson = SitePerson_PersonService.GetSitePersonByProjectIdIdentityCard(personInOut.ProjectId, personInOut.IdentityCard);
}
if (getPerson == null || string.IsNullOrEmpty(getPerson.PersonId))
{
getPerson = SitePerson_PersonService.GetSitePersonByProjectIdIdentityCard(personInOut.ProjectId, personInOut.IdentityCard);
getPerson = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(personInOut.ProjectId, personInOut.PersonId);
}
if (getPerson != null && !string.IsNullOrEmpty(getPerson.PersonId))
{
+11 -1
View File
@@ -1,4 +1,5 @@
using BLL.Common;
using Model;
using Newtonsoft.Json;
using System;
using System.Linq;
@@ -322,7 +323,16 @@ namespace BLL
AmEndTime1 = AmEndTime1.Add(-time1);
PmEndTime1 = PmEndTime1.Add(-time1);
var personModel = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == model.IdentityCard && x.ProjectId == model.ProjectId);
SitePerson_Person personModel = null;
if (!string.IsNullOrEmpty(model.PersonId))
{
personModel = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == model.PersonId && x.ProjectId == model.ProjectId);
model.IdentityCard = personModel.IdentityCard;
}
else
{
personModel = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == model.IdentityCard && x.ProjectId == model.ProjectId);
}
if (personModel != null)
{
//状态:0上午上班 1上午下班 2下午上班 3下午下班