mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
添加解压排单结果数据单元测试
This commit is contained in:
+25
-8
@@ -23,6 +23,7 @@ import org.springframework.web.client.RestTemplate;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.zip.Inflater;
|
import java.util.zip.Inflater;
|
||||||
|
|
||||||
@@ -44,14 +45,22 @@ public class ZlibTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void get() throws UnsupportedEncodingException {
|
void getOrderBoxBlock() throws UnsupportedEncodingException {
|
||||||
/*String source = "xxxxxxxxx";
|
List<OrderBoxBlock> list = jdbcTemplate.query("select * from order_box_block limit 10", new BeanPropertyRowMapper<OrderBoxBlock>(OrderBoxBlock.class));
|
||||||
byte[] compress = ZLibUtils.compress(source.getBytes());
|
for (OrderBoxBlock bean : list) {
|
||||||
System.out.println(compress.length);*/
|
|
||||||
List<Bean> list = jdbcTemplate.query("select * from order_box_block limit 10", new BeanPropertyRowMapper<Bean>(Bean.class));
|
|
||||||
for (Bean bean : list) {
|
|
||||||
if (!Objects.isNull(bean.Data)) {
|
if (!Objects.isNull(bean.Data)) {
|
||||||
System.out.println(new String(ZLibUtils.decompress(new ByteArrayInputStream(Base64.getDecoder().decode(bean.Data))), "utf-8"));
|
System.out.println(new String(ZLibUtils.decompress(bean.Data)));
|
||||||
|
System.err.println("------------------------------------------");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getOrderBlockPlanResult() throws UnsupportedEncodingException {
|
||||||
|
List<OrderBlockPlanResult> list = jdbcTemplate.query("select * from order_block_plan_result limit 1", new BeanPropertyRowMapper<OrderBlockPlanResult>(OrderBlockPlanResult.class));
|
||||||
|
for (OrderBlockPlanResult bean : list) {
|
||||||
|
if (!Objects.isNull(bean.PlaceData)) {
|
||||||
|
System.out.println(new String(ZLibUtils.decompress(bean.PlaceData)));
|
||||||
System.err.println("------------------------------------------");
|
System.err.println("------------------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,7 +113,7 @@ public class ZlibTest {
|
|||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Bean {
|
public static class OrderBoxBlock {
|
||||||
long BoxID;
|
long BoxID;
|
||||||
long ShardKey;
|
long ShardKey;
|
||||||
long OrderNo;
|
long OrderNo;
|
||||||
@@ -112,6 +121,14 @@ public class ZlibTest {
|
|||||||
long CompanyID;
|
long CompanyID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class OrderBlockPlanResult {
|
||||||
|
long ID;
|
||||||
|
LocalDateTime SaveTime;
|
||||||
|
byte[] PlaceData;
|
||||||
|
long CompanyID;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getRes() throws IOException {
|
void getRes() throws IOException {
|
||||||
//创建url路径
|
//创建url路径
|
||||||
|
|||||||
+3637
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user