|
|
@@ -1,6 +1,7 @@
|
|
|
package org.jeecg.modules.quartz.job;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -26,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
@@ -236,13 +238,12 @@ public class OrTeachingJobService {
|
|
|
* @Param
|
|
|
* @return
|
|
|
**/
|
|
|
- @Scheduled(fixedDelay = 7200000)
|
|
|
+ @Scheduled(fixedDelay = 30000)
|
|
|
// @Scheduled(cron = "0 0 23 * * ?")
|
|
|
public void synchronousDoorOpeningAndClosingRecords(){
|
|
|
try {
|
|
|
List<DoorRecordDTO> allRecords = fetchAllDoorRecords();
|
|
|
- allRecords.forEach(data -> {
|
|
|
-// log.info("提取数据: {}", data);
|
|
|
+ for (DoorRecordDTO data : allRecords) {
|
|
|
if(null == appGmtInfoMapper.selectOne(Wrappers.<AppGmtInfo>lambdaQuery().eq(AppGmtInfo::getOriginId, data.getOriginId()).last("LIMIT 1"))){
|
|
|
String siteId = appDeviceMapper.selectOne(Wrappers.<AppDevice>lambdaQuery()
|
|
|
.eq(AppDevice::getDeviceSerial, data.getDeviceSerial().split("-")[0])).getSiteId();
|
|
|
@@ -259,9 +260,15 @@ public class OrTeachingJobService {
|
|
|
.setUpdateTime(new Date())
|
|
|
.setDeviceSerialNo(data.getDeviceSerial()));
|
|
|
//查询相关日期学校子订单
|
|
|
- Date date = DateUtils.str2Date(data.getGmtCreate(), new SimpleDateFormat("yyyy-MM-dd"));
|
|
|
+ // 定义格式化模板
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ // 格式化输出
|
|
|
+ Date date = DateUtils.str2Date(data.getGmtCreate(), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ String formattedDate = sdf.format(date);
|
|
|
+
|
|
|
List<AppOrderProInfo> orderProInfoList = appOrderProInfoService.list(Wrappers.lambdaQuery(AppOrderProInfo.class)
|
|
|
- .eq(AppOrderProInfo::getUseDateStr, date)
|
|
|
+ .eq(AppOrderProInfo::getUseDateStr, formattedDate)
|
|
|
.eq(AppOrderProInfo::getFamilyUserId, data.getEmployeeNo())
|
|
|
.eq(AppOrderProInfo::getSiteId, siteId)
|
|
|
.eq(AppOrderProInfo::getType, CommonConstant.ORDER_PRO_INFO_TYPE_0)
|
|
|
@@ -275,7 +282,11 @@ public class OrTeachingJobService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+// allRecords.forEach(data -> {
|
|
|
+//// log.info("提取数据: {}", data);
|
|
|
+//
|
|
|
+// });
|
|
|
} catch (Exception e) {
|
|
|
log.error("处理门禁记录失败", e);
|
|
|
}
|