test
This commit is contained in:
parent
b60463cc0b
commit
c54a58b45b
@ -21,6 +21,9 @@ dependencies {
|
||||
implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre'
|
||||
// https://mvnrepository.com/artifact/commons-collections/commons-collections
|
||||
implementation group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
|
||||
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
|
||||
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
|
||||
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
78
src/main/java/ConfigRelationResVo.java
Normal file
78
src/main/java/ConfigRelationResVo.java
Normal file
@ -0,0 +1,78 @@
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 配置关联表
|
||||
*
|
||||
* @Author: dujl
|
||||
* @Email: dujl
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ConfigRelationResVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联类型 10店铺/20仓库 int4
|
||||
*/
|
||||
private Integer relationType;
|
||||
|
||||
/**
|
||||
* 配置id int8
|
||||
*/
|
||||
private Long configId;
|
||||
|
||||
/**
|
||||
* 关联编码 int8
|
||||
*/
|
||||
private String relationCode;
|
||||
|
||||
/**
|
||||
* 名称 varchar
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编码 varchar
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 类型 int4
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 密钥key varchar
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
* 密钥 varchar
|
||||
*/
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 路径 varchar
|
||||
*/
|
||||
private String serverUrl;
|
||||
|
||||
/**
|
||||
* 货主编码 varchar
|
||||
*/
|
||||
private String customerId;
|
||||
/**
|
||||
* 接口路径 varchar
|
||||
*/
|
||||
private String methodServerUrl;
|
||||
|
||||
/**
|
||||
* 业务数据隔离字段 int8
|
||||
*/
|
||||
private Long bg;
|
||||
}
|
||||
26
src/main/java/Party.java
Normal file
26
src/main/java/Party.java
Normal file
@ -0,0 +1,26 @@
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* todo Created with IntelliJ IDEA
|
||||
*
|
||||
* @author luming
|
||||
* @email: lu.lm@bitsun-inc.com
|
||||
* @date 2021/12/23 19:02
|
||||
*/
|
||||
public class Party {
|
||||
public static void main(String[] args) {
|
||||
String path = ClassLoader.getSystemClassLoader().getResource("party.json").getPath();
|
||||
String s = Main.readToString(path);
|
||||
List<ConfigRelationResVo> list = JSON.parseArray(s, ConfigRelationResVo.class);
|
||||
// Map<String, String> collect = list.stream().collect(Collectors.toMap(ConfigRelationResVo::getRelationCode, ConfigRelationResVo::getName));
|
||||
Map<String, String> collect = list.stream().collect(Collectors.toMap(ConfigRelationResVo::getRelationCode, l -> l.getName()));
|
||||
Map<String, ConfigRelationResVo> stringConfigRelationResVoImmutableMap = Maps.uniqueIndex(list, ConfigRelationResVo::getRelationCode);
|
||||
System.out.println("1");
|
||||
}
|
||||
}
|
||||
71
src/main/java/Test.java
Normal file
71
src/main/java/Test.java
Normal file
@ -0,0 +1,71 @@
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeFormatterBuilder;
|
||||
import java.time.temporal.ChronoField;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* todo Created with IntelliJ IDEA
|
||||
*
|
||||
* @author luming
|
||||
* @email: lu.lm@bitsun-inc.com
|
||||
* @date 2021/12/14 15:15
|
||||
*/
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
LocalDate now = LocalDate.now().plusMonths(-1);
|
||||
System.out.println("现在时间="+ now);
|
||||
String format1 = DateTimeFormatter.ofPattern("yyyy-MM").format(now);
|
||||
System.out.println("上个月="+format1);
|
||||
LocalDate month = LocalDate.now().plusMonths(-1);
|
||||
String lastMonth = DateTimeFormatter.ofPattern("yyyy-MM").format(month);
|
||||
System.out.println("上个月="+lastMonth);
|
||||
|
||||
LocalDate date = parseString2Date("2021-12");
|
||||
LocalDate firstDay = date.with(TemporalAdjusters.firstDayOfMonth());
|
||||
LocalDate lastDay = date.with(TemporalAdjusters.lastDayOfMonth());
|
||||
|
||||
System.out.println(date);
|
||||
System.out.println(firstDay);
|
||||
System.out.println(lastDay);
|
||||
|
||||
LocalDateTime localDateTime = firstDay.atStartOfDay();
|
||||
System.out.println(localDateTime);
|
||||
LocalDateTime localDateTime1 = lastDay.plusDays(1).atStartOfDay();
|
||||
System.out.println(localDateTime1);
|
||||
|
||||
BigDecimal bigDecimal = new BigDecimal(0);
|
||||
System.out.println(bigDecimal);
|
||||
bigDecimal.add(BigDecimal.TEN);
|
||||
bigDecimal.add(BigDecimal.ONE);
|
||||
System.out.println(bigDecimal.add(BigDecimal.TEN).add(BigDecimal.ONE));
|
||||
System.out.println(firstDay.until(lastDay, ChronoUnit.DAYS) + 1);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
String format = dateTimeFormatter.format(lastDay);
|
||||
System.out.println(format);
|
||||
|
||||
List<StringBuilder> noticeList = new ArrayList<>();
|
||||
|
||||
noticeList.add(new StringBuilder("123"));
|
||||
noticeList.add(new StringBuilder("123"));
|
||||
noticeList.add(new StringBuilder("123"));
|
||||
noticeList.add(new StringBuilder("123"));
|
||||
System.out.println(noticeList);
|
||||
System.out.println(StringUtils);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static LocalDate parseString2Date(String timeStr) {
|
||||
|
||||
DateTimeFormatter DATEFORMATTER = new DateTimeFormatterBuilder().append(DateTimeFormatter.ofPattern("yyyy-MM"))
|
||||
.parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
|
||||
.toFormatter();
|
||||
return LocalDate.parse(timeStr, DATEFORMATTER);
|
||||
}
|
||||
}
|
||||
12
src/main/java/aaa.java
Normal file
12
src/main/java/aaa.java
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* todo Created with IntelliJ IDEA
|
||||
*
|
||||
* @author luming
|
||||
* @email: lu.lm@bitsun-inc.com
|
||||
* @date 2021/7/14 10:34
|
||||
*/
|
||||
public interface aaa {
|
||||
default void a(){
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
2
src/main/resources/nacos.yaml
Normal file
2
src/main/resources/nacos.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
version: "3"
|
||||
services:
|
||||
Loading…
Reference in New Issue
Block a user