Re急:钉钉考勤机打卡原始数据接口
有,服务器端开发 List<Att> listatt = attHelper.getatt(accessToken, name, start_date, end_date);
public static List<Att> getatt(String accessToken, String userid,
String workDateFrom, String workDateTo)
{
String url = Env.OAPI_HOST + "/attendance/list?" +
"access_token=" + accessToken;
BsonDocument args = new BsonDocument();
args["userid"] = @"[""" + userid + @"""]";
args["workDateFrom"] = workDateFrom;
args["workDateTo"] = workDateTo;
//BsonDocument response = HttpHelper.httpPost(url, args);
string strjosn = HttpHelper.httpPostjosn(url, args);
JObject json1 = (JObject)JsonConvert.DeserializeObject(strjosn);
JArray array = (JArray)json1["recordresult"];
List<Att> user = new List<Att>();
try
{
foreach (var jObject in array)
{
Att _Tmp_Data = new Att();
//赋值属性
_Tmp_Data.baseCheckTime = long.Parse(jObject["baseCheckTime"].ToString());//获取字符串中id值
_Tmp_Data.checkType = jObject["checkType"].ToString();//获取字符串中checkType值
_Tmp_Data.corpId = jObject["corpId"].ToString();//获取字符串中corpId值
_Tmp_Data.groupId = jObject["groupId"].ToString();//获取字符串中groupId值
_Tmp_Data.id = long.Parse(jObject["id"].ToString());//获取字符串中id值
_Tmp_Data.locationResult = jObject["locationResult"].ToString();//获取字符串中locationResult值
_Tmp_Data.planId = long.Parse(jObject["planId"].ToString());//获取字符串中planId值
//_Tmp_Data.recordId = jObject["recordId"].ToString();//获取字符串中recordId值
_Tmp_Data.timeResult = jObject["timeResult"].ToString();//获取字符串中timeResult值
_Tmp_Data.userCheckTime = long.Parse(jObject["userCheckTime"].ToString());//获取字符串中userCheckTime值
_Tmp_Data.userId = jObject["userId"].ToString();//获取字符串中userCheckTime值
_Tmp_Data.workDate = long.Parse(jObject["workDate"].ToString());//获取字符串中userCheckTime值
user.Add(_Tmp_Data);
}
}
catch (Exception)
{
throw;
}
return user;
}