From a14a26c04bc5863248b9a9d387610a143c3a4efd Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 27 九月 2024 08:51:34 +0800
Subject: [PATCH] 电路站点报告ing
---
system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java | 53 ++++++++++++++++++++++++++++-------------------------
1 files changed, 28 insertions(+), 25 deletions(-)
diff --git a/system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java b/system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java
index 4e345ea..855000f 100644
--- a/system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java
+++ b/system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java
@@ -1,44 +1,47 @@
package com.yuanchu.mom;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.yuanchu.mom.exception.ErrorException;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.el.lang.ExpressionBuilder;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.time.temporal.WeekFields;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
@SpringBootTest
class SystemRunApplicationTest {
@Test
- void contextLoads() {
- // 鑾峰彇褰撳墠鏃ユ湡
- LocalDate today = LocalDate.now();
-
- // 鑾峰彇鏈湀鐨勭涓�澶╁拰鏈�鍚庝竴澶�
- LocalDate firstDayOfMonth = today.with(TemporalAdjusters.firstDayOfMonth());
- LocalDate lastDayOfMonth = today.with(TemporalAdjusters.lastDayOfMonth());
-
- // 鑾峰彇鍛ㄥ瓧娈典俊鎭紙鏍规嵁鍖哄煙璁剧疆锛�
- WeekFields weekFields = WeekFields.of(Locale.getDefault());
-
- // 鑾峰彇鏈湀绗竴澶╃殑鍛ㄤ竴
- LocalDate startOfWeek = firstDayOfMonth.with(TemporalAdjusters.previousOrSame(weekFields.getFirstDayOfWeek()));
-
- // 閬嶅巻鏈湀鎵�鏈夊ぉ鏁帮紝鎵惧嚭姣忓懆鐨勭涓�澶╁拰鏈�鍚庝竴澶�
- LocalDate endOfWeek;
- while (startOfWeek.isBefore(firstDayOfMonth.plusMonths(1))) {
- endOfWeek = startOfWeek.plusDays(6);
- LocalDateTime startDateTime = LocalDateTime.of(startOfWeek, LocalTime.MIDNIGHT);
- LocalDateTime endDateTime = LocalDateTime.of(endOfWeek, LocalTime.MIDNIGHT);
-
- System.out.println("Week starts on " + startDateTime + " and ends on " + endDateTime);
-
- startOfWeek = startOfWeek.plusWeeks(1);
- }
+ void contextLoads() {
+ String str = "[[\"5\",\"5\",\"5\",\"5\"]]";
+ str = str.substring(1, str.length() - 1);
+ for (String s1 :str.split("\\],\\[")) {
+ String[] strings = Arrays.stream(s1.substring(1, str.length() - 1).split(","))
+ .map(s -> s.replace("\"", ""))
+ .toArray(String[]::new);
+ for (String string : strings) {
+ System.out.println(string);
+ }
+ }
}
+
+
}
--
Gitblit v1.9.3