Commit b30449c7 by 杨林龙

1.21.0 优化推送激活时间代码逻辑

1 parent 3172b305
...@@ -48,7 +48,6 @@ public class SyncZhongLiDataComponent { ...@@ -48,7 +48,6 @@ public class SyncZhongLiDataComponent {
SyncInstallDataRequest syncInstallDataRequest = new SyncInstallDataRequest(); SyncInstallDataRequest syncInstallDataRequest = new SyncInstallDataRequest();
syncInstallDataRequest.setAppcode(workOrder.getPartnerOrderNo()); syncInstallDataRequest.setAppcode(workOrder.getPartnerOrderNo());
syncInstallDataRequest.setInstallationEndTime(DateUtil.formatDateTime(workOrder.getFinishedTime())); syncInstallDataRequest.setInstallationEndTime(DateUtil.formatDateTime(workOrder.getFinishedTime()));
log.info("syncInstallDataRequest:" + JSONUtil.toJsonStr(syncInstallDataRequest));
// 2023/6/1 请求仲利的接口 // 2023/6/1 请求仲利的接口
JSONObject headJson = new JSONObject(); JSONObject headJson = new JSONObject();
...@@ -56,8 +55,9 @@ public class SyncZhongLiDataComponent { ...@@ -56,8 +55,9 @@ public class SyncZhongLiDataComponent {
JSONObject bodyJson = new JSONObject(); JSONObject bodyJson = new JSONObject();
String syncInstallDataJsonStr = JSON.toJSONString(syncInstallDataRequest); String syncInstallDataJsonStr = JSON.toJSONString(syncInstallDataRequest);
log.info("syncInstallDataJsonStr==" + syncInstallDataJsonStr);
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
bodyJson.put("data", ZLUtils.parseDataByRSA(syncInstallDataJsonStr)); bodyJson.put("data", ZLUtils.parseDataByRSA(syncInstallDataRequest));
bodyJson.put("time", currentTime); bodyJson.put("time", currentTime);
bodyJson.put("sign", ZLUtils.getSign(syncInstallDataJsonStr, currentTime)); bodyJson.put("sign", ZLUtils.getSign(syncInstallDataJsonStr, currentTime));
......
...@@ -3,6 +3,9 @@ package cn.com.glsx.stdinterface.modules.component; ...@@ -3,6 +3,9 @@ package cn.com.glsx.stdinterface.modules.component;
import cn.com.glsx.Application; import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.modules.entity.WorkOrder; import cn.com.glsx.stdinterface.modules.entity.WorkOrder;
import cn.com.glsx.stdinterface.modules.mapper.WorkOrderMapper; 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 lombok.extern.slf4j.Slf4j;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -26,4 +29,24 @@ public class SyncZhongLiDataComponentTest { ...@@ -26,4 +29,24 @@ public class SyncZhongLiDataComponentTest {
WorkOrder workOrder = workOrderMapper.selectByOrderNo("2022121516000001"); WorkOrder workOrder = workOrderMapper.selectByOrderNo("2022121516000001");
syncZhongLiDataComponent.syncZhongLiInstallTime(workOrder); 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);
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!