SyncZhongLiDataComponentTest.java
2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package cn.com.glsx.stdinterface.modules.component;
import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.modules.entity.WorkOrder;
import cn.com.glsx.stdinterface.modules.mapper.WorkOrderMapper;
import cn.com.glsx.stdinterface.modules.model.SyncInstallDataRequest;
import cn.com.glsx.stdinterface.modules.util.zlgj.ZLUtils;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class SyncZhongLiDataComponentTest {
@Autowired
private SyncZhongLiDataComponent syncZhongLiDataComponent;
@Autowired
private WorkOrderMapper workOrderMapper;
@Test
public void syncZhongLiInstallTime() {
WorkOrder workOrder = workOrderMapper.selectByOrderNo("2022121516000001");
syncZhongLiDataComponent.syncZhongLiInstallTime(workOrder);
}
@Test
public void test01() {
SyncInstallDataRequest syncInstallDataRequest = new SyncInstallDataRequest();
syncInstallDataRequest.setAppcode("2022121516000001");
syncInstallDataRequest.setInstallationEndTime("2022-12-15 16:40:31");
long currentTime = 1688106964842L;
String sign01 = ZLUtils.getSign(JSON.toJSONString(syncInstallDataRequest), currentTime);
System.out.println("sign01= " + sign01);
String data = JSON.toJSONString(syncInstallDataRequest);
System.out.println("data = " + data);
String sign02 = ZLUtils.getSign(data, currentTime);
System.out.println("sign02 = " + sign02);
String a = "{\"appcode\":\"2022121516000001\",\"installationEndTime\":\"2022-12-15 16:40:31\"}";
String sign03 = ZLUtils.getSign(a, currentTime);
System.out.println("sign03 = " + sign03);
}
}