|
@@ -69,14 +69,7 @@ public class InsExcelTaskAsyncServiceImpl extends ServiceImpl<InsExcelTaskAsyncM
|
|
|
insExcelTaskEntity.setCreateTime(LocalDateTime.now());
|
|
insExcelTaskEntity.setCreateTime(LocalDateTime.now());
|
|
|
insExcelTaskEntity.setCreatedAt(LocalDateTime.now());
|
|
insExcelTaskEntity.setCreatedAt(LocalDateTime.now());
|
|
|
insExcelTaskEntity.setType("1");
|
|
insExcelTaskEntity.setType("1");
|
|
|
- // 定义时间格式的常量
|
|
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
- // 构建开始时间
|
|
|
|
|
- LocalDateTime startTime = LocalDateTime.parse(beginDate + " 00:00:00", formatter);
|
|
|
|
|
- insExcelTaskEntity.setStartTime(startTime);
|
|
|
|
|
- // 构建结束时间
|
|
|
|
|
- LocalDateTime endTime = LocalDateTime.parse(endDate + " " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")), formatter);
|
|
|
|
|
- insExcelTaskEntity.setEndTime(endTime);
|
|
|
|
|
|
|
+ this.constructionDate(beginDate,endDate,insExcelTaskEntity);
|
|
|
|
|
|
|
|
baseMapper.insert(insExcelTaskEntity);
|
|
baseMapper.insert(insExcelTaskEntity);
|
|
|
|
|
|
|
@@ -117,6 +110,45 @@ public class InsExcelTaskAsyncServiceImpl extends ServiceImpl<InsExcelTaskAsyncM
|
|
|
baseMapper.updateById(insExcelTaskEntity1);
|
|
baseMapper.updateById(insExcelTaskEntity1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param beginDate
|
|
|
|
|
+ * @param endDate
|
|
|
|
|
+ * @param insExcelTaskEntity
|
|
|
|
|
+ * 添加查询时间 如果是当前日期 则时分秒取当前时分秒 如果不是则在结束日期 + 23:59:59
|
|
|
|
|
+ */
|
|
|
|
|
+ private void constructionDate(String beginDate, String endDate, InsExcelTaskEntity insExcelTaskEntity) {
|
|
|
|
|
+ String[] parts = beginDate.split(" ");
|
|
|
|
|
+ beginDate = parts[0];
|
|
|
|
|
+
|
|
|
|
|
+ String[] parts1 = endDate.split(" ");
|
|
|
|
|
+ endDate = parts1[0];
|
|
|
|
|
+
|
|
|
|
|
+ // 定义时间格式的常量
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+
|
|
|
|
|
+ // 构建开始时间
|
|
|
|
|
+ LocalDateTime startTime = LocalDateTime.parse(beginDate + " 00:00:00", formatter);
|
|
|
|
|
+
|
|
|
|
|
+ // 这里的 insExcelTaskEntity 假设为某个对象,用于存储时间信息,这里仅作示例
|
|
|
|
|
+ insExcelTaskEntity.setStartTime(startTime);
|
|
|
|
|
+
|
|
|
|
|
+ // 结束时间与当前日期做比较
|
|
|
|
|
+ Date currentDate = new Date();
|
|
|
|
|
+ // 创建 SimpleDateFormat 对象,用于格式化日期
|
|
|
|
|
+ SimpleDateFormat formatterYyyyMMM = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ String formattedDate = formatterYyyyMMM.format(currentDate);
|
|
|
|
|
+ if (endDate.equals(formattedDate)) {
|
|
|
|
|
+ // 构建结束时间
|
|
|
|
|
+ LocalDateTime endTime = LocalDateTime.parse(endDate + " " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")), formatter);
|
|
|
|
|
+ insExcelTaskEntity.setEndTime(endTime);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ endDate = endDate + " 23:59:59";
|
|
|
|
|
+ // 使用指定的日期时间格式解析 endDate
|
|
|
|
|
+ insExcelTaskEntity.setEndTime(LocalDateTime.parse(endDate, formatter));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Async
|
|
@Async
|
|
|
public void importasyncBigOrder(List<BigOrderUploadDto> list,String userId,String beginDate,String endDate) {
|
|
public void importasyncBigOrder(List<BigOrderUploadDto> list,String userId,String beginDate,String endDate) {
|
|
@@ -128,15 +160,7 @@ public class InsExcelTaskAsyncServiceImpl extends ServiceImpl<InsExcelTaskAsyncM
|
|
|
insExcelTaskEntity.setUserId(userId);
|
|
insExcelTaskEntity.setUserId(userId);
|
|
|
insExcelTaskEntity.setCreateTime(LocalDateTime.now());
|
|
insExcelTaskEntity.setCreateTime(LocalDateTime.now());
|
|
|
insExcelTaskEntity.setCreatedAt(LocalDateTime.now());
|
|
insExcelTaskEntity.setCreatedAt(LocalDateTime.now());
|
|
|
- // 定义时间格式的常量
|
|
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
- // 构建开始时间
|
|
|
|
|
- LocalDateTime startTime = LocalDateTime.parse(beginDate + " 00:00:00", formatter);
|
|
|
|
|
- insExcelTaskEntity.setStartTime(startTime);
|
|
|
|
|
- // 构建结束时间
|
|
|
|
|
- LocalDateTime endTime = LocalDateTime.parse(endDate + " " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")), formatter);
|
|
|
|
|
- insExcelTaskEntity.setEndTime(endTime);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.constructionDate(beginDate,endDate,insExcelTaskEntity);
|
|
|
insExcelTaskEntity.setType("0");
|
|
insExcelTaskEntity.setType("0");
|
|
|
baseMapper.insert(insExcelTaskEntity);
|
|
baseMapper.insert(insExcelTaskEntity);
|
|
|
|
|
|