generated from dxfeng/secondev-chapanda-feishu
企微对接
This commit is contained in:
parent
00b817587c
commit
ef302b04e7
|
|
@ -535,18 +535,19 @@ public class WrittenResultsServiceImpl extends Service implements WrittenResults
|
|||
if ((!CollectionUtils.isEmpty(signSet)) && signSet.contains(keyTemp)) {
|
||||
continue;
|
||||
}
|
||||
List list = new ArrayList();
|
||||
list.add(ygId);
|
||||
list.add("1");
|
||||
list.add(rq);
|
||||
list.add(sj);
|
||||
list.add("1");
|
||||
list.add(fromType);
|
||||
list.add(addr);
|
||||
list.add(rq);
|
||||
insertList.add(list);
|
||||
needFormatSet.add(ygId + "_" + rq);
|
||||
if ((!CollectionUtils.isEmpty(sbdzMap)) && deviceSn != null && deviceSn != "" && sbdzMap.containsKey(deviceSn.toString())) {
|
||||
List list = new ArrayList();
|
||||
list.add(ygId);
|
||||
list.add("1");
|
||||
list.add(rq);
|
||||
list.add(sj);
|
||||
list.add("1");
|
||||
list.add(fromType);
|
||||
list.add(addr);
|
||||
list.add(rq);
|
||||
insertList.add(list);
|
||||
needFormatSet.add(ygId + "_" + rq);
|
||||
|
||||
mesMap.put(userId + "#" + rq + "#" + sj + "#" + ygName, addr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
String signDate = rs.getString("signDate");
|
||||
String signTime = rs.getString("signTime");
|
||||
String signFrom = rs.getString("signFrom");
|
||||
if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(signDate) || StringUtils.isEmpty(signTime) ||StringUtils.isEmpty(signFrom)) {
|
||||
if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(signDate) || StringUtils.isEmpty(signTime) || StringUtils.isEmpty(signFrom)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +136,8 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
// getMiddleTableData(previousDateStr, currentDateStr, ghAndIdMap, signSet);
|
||||
|
||||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
Type type = new TypeToken<Map<String, Object>>() {
|
||||
}.getType();
|
||||
// 获取token,先考虑从缓存表中取
|
||||
String jmhmw = null;
|
||||
String sxsj = null;
|
||||
|
|
@ -177,7 +178,7 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
Object expiresIn = tokenMap.get("expires_in");
|
||||
int expiresInStr = 0;
|
||||
if (expiresIn != null && expiresIn != "") {
|
||||
expiresInStr = ((Double)expiresIn).intValue();
|
||||
expiresInStr = ((Double) expiresIn).intValue();
|
||||
}
|
||||
accessToken = accessTokenObj.toString();
|
||||
long sxsjLong = timestampNow + Long.parseLong(String.valueOf(expiresInStr));
|
||||
|
|
@ -212,7 +213,7 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
Object expiresIn = tokenMap.get("expires_in");
|
||||
int expiresInStr = 0;
|
||||
if (expiresIn != null && expiresIn != "") {
|
||||
expiresInStr = ((Double)expiresIn).intValue();
|
||||
expiresInStr = ((Double) expiresIn).intValue();
|
||||
}
|
||||
accessToken = accessTokenObj.toString();
|
||||
long sxsjLong = timestampNow + Long.parseLong(String.valueOf(expiresInStr));
|
||||
|
|
@ -315,7 +316,7 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
baseBean.writeLog("SyncQwCardDataCron checkindataObj null.");
|
||||
continue;
|
||||
}
|
||||
List<Map<String, Object>> checkinDataMapLIst = (List<Map<String, Object>>)checkindataObj;
|
||||
List<Map<String, Object>> checkinDataMapLIst = (List<Map<String, Object>>) checkindataObj;
|
||||
for (Map<String, Object> checkinDataMap : checkinDataMapLIst) {
|
||||
Object userId = checkinDataMap.get("userid");
|
||||
Object checkinTime = checkinDataMap.get("checkin_time");
|
||||
|
|
@ -340,7 +341,7 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
addr = deviceSn.toString();
|
||||
}
|
||||
}
|
||||
Instant instant = Instant.ofEpochSecond(Long.parseLong(String.valueOf(((Double)checkinTime).intValue())));
|
||||
Instant instant = Instant.ofEpochSecond(Long.parseLong(String.valueOf(((Double) checkinTime).intValue())));
|
||||
// 2. 指定时区(例如:上海时区)
|
||||
ZonedDateTime zonedDateTimeA = instant.atZone(ZoneId.of("Asia/Shanghai"));
|
||||
// 4. 转为字符串
|
||||
|
|
@ -353,18 +354,19 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
if ((!CollectionUtils.isEmpty(signSet)) && signSet.contains(keyTemp)) {
|
||||
continue;
|
||||
}
|
||||
List list = new ArrayList();
|
||||
list.add(yg);
|
||||
list.add("1");
|
||||
list.add(rq);
|
||||
list.add(sj);
|
||||
list.add("1");
|
||||
list.add(fromType);
|
||||
list.add(addr);
|
||||
list.add(rq);
|
||||
insertList.add(list);
|
||||
needFormatSet.add(yg + "_" + rq);
|
||||
if ((!CollectionUtils.isEmpty(sbdzMap)) && deviceSn != null && deviceSn != "" && sbdzMap.containsKey(deviceSn.toString())) {
|
||||
List list = new ArrayList();
|
||||
list.add(yg);
|
||||
list.add("1");
|
||||
list.add(rq);
|
||||
list.add(sj);
|
||||
list.add("1");
|
||||
list.add(fromType);
|
||||
list.add(addr);
|
||||
list.add(rq);
|
||||
insertList.add(list);
|
||||
needFormatSet.add(yg + "_" + rq);
|
||||
|
||||
mesMap.put(userId + "#" + rq + "#" + sj + "#" + ygName, addr);
|
||||
}
|
||||
}
|
||||
|
|
@ -399,7 +401,7 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
baseBean.writeLog("SyncQwCardDataCron end.");
|
||||
}
|
||||
|
||||
public void getMiddleTableData(String ksrq, String jsrq, Map<String, String> ghAndIdMap, Set<String> signSet) {
|
||||
public void getMiddleTableData(String ksrq, String jsrq, Map<String, String> ghAndIdMap, Set<String> signSet) {
|
||||
baseBean.writeLog("getMiddleTableData start:" + ksrq + "、" + jsrq);
|
||||
RecordSet rs = new RecordSet();
|
||||
try {
|
||||
|
|
@ -485,7 +487,8 @@ public class SyncQwCardDataCron extends BaseCronJob {
|
|||
}
|
||||
|
||||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
Type type = new TypeToken<Map<String, Object>>() {
|
||||
}.getType();
|
||||
|
||||
String tokenUrl = RecruitConstant.QW_TOKEN_URL + "?corpid=" + RecruitConstant.QW_CORPID + "&corpsecret=" + RecruitConstant.QW_MES_CORPSECRET;
|
||||
HttpGet httpGet = new HttpGet(tokenUrl);
|
||||
|
|
|
|||
Loading…
Reference in New Issue