diff --git a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java index e7d94370e..ed46d9ed9 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java @@ -41,6 +41,11 @@ public enum BasicExportTypeEnum { * 系统设置数据 */ SYS_SET_DATA("sys_set_data", "系统设置数据"), + +// +// NEW_ALL_ORDER("all_order", "出入库扫码单据"), +// ALL_BUS_ORDER("all_bus_order", "业务单据"), + ; private String key; diff --git a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java index d76edda4b..6a010dec7 100644 --- a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java +++ b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java @@ -58,8 +58,8 @@ public class SpGetHttpClient { return headers; } - public BaseResponse postData(BasicExportTypeEnum exportType, Object data) { - SyncUpLoadRequest build = SyncUpLoadRequest.builder().exportType(exportType).data(data).build(); + public BaseResponse postData(String taskId, BasicExportTypeEnum exportType, Object data) { + SyncUpLoadRequest build = SyncUpLoadRequest.builder().taskId(taskId).exportType(exportType).data(data).build(); String result = okHttpCli.doPostJson(getIpUrl() + "/sps/sync/upload/data", JSONUtil.toJsonStr(build), buildHeader()); return JSONObject.parseObject(result, new TypeReference>() { }); diff --git a/src/main/java/com/glxp/api/req/sync/SyncUpLoadRequest.java b/src/main/java/com/glxp/api/req/sync/SyncUpLoadRequest.java index 37baf9281..be40aa7c9 100644 --- a/src/main/java/com/glxp/api/req/sync/SyncUpLoadRequest.java +++ b/src/main/java/com/glxp/api/req/sync/SyncUpLoadRequest.java @@ -12,6 +12,7 @@ import lombok.NoArgsConstructor; @Builder public class SyncUpLoadRequest { + private String taskId; private BasicExportTypeEnum exportType; private Object data; diff --git a/src/main/java/com/glxp/api/service/sync/HeartService.java b/src/main/java/com/glxp/api/service/sync/HeartService.java index 957de3239..e2f6c2255 100644 --- a/src/main/java/com/glxp/api/service/sync/HeartService.java +++ b/src/main/java/com/glxp/api/service/sync/HeartService.java @@ -61,6 +61,8 @@ import java.io.IOException; import java.util.*; import java.util.function.Function; +import static com.glxp.api.constant.BasicProcessStatus.NEW_ALL_ORDER; + @Slf4j @Service @RequiredArgsConstructor @@ -123,7 +125,7 @@ public class HeartService { BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); orderStatusEntity.setId(CustomUtil.getId()); orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER); - orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); + orderStatusEntity.setType(NEW_ALL_ORDER); orderStatusEntity.setUpdateTime(new Date()); orderStatusEntity.setStartTime(new Date()); orderStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); @@ -135,7 +137,7 @@ public class HeartService { basicExportStatusTimeEntity.setLastUpdateTime(DateUtil.formatDate(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_SCAN_ORDER); spsSyncOrderResponse.setTaskId(basicExportStatusEntity1.getId()); - spsSyncOrderResponse.setType(BasicProcessStatus.NEW_ALL_ORDER); + spsSyncOrderResponse.setType(NEW_ALL_ORDER); BaseResponse baseResponse1 = spGetHttp.postAllOrder(spsSyncOrderResponse); if (baseResponse1.getCode() == 20000) { basicExportStatusEntity1.setStatus(2); @@ -862,7 +864,7 @@ public class HeartService { * @return */ private SpsSyncSysSettingResponse getSysSettingData(SyncDataSetEntity info, String taskId, Date now, Date syncTime) { - SpsSyncSysSettingResponse dataResponse = null; + SpsSyncSysSettingResponse dataResponse = null; Map syncTimeMap = new WeakHashMap<>(3); syncTimeMap.put("isNew", true); syncTimeMap.put("oldDate", syncTime); @@ -1041,7 +1043,7 @@ public class HeartService { if (data == null) { return; } - BaseResponse baseResponse = spGetHttp.postData(exportType, data); + BaseResponse baseResponse = spGetHttp.postData(taskId, exportType, data); if (baseResponse.getCode() != 20000) { status = BasicExportStatusEnum.FAILED.getCode(); } @@ -1254,13 +1256,13 @@ public class HeartService { //下载最近更新扫码单据--上级服务 @Transactional(propagation = Propagation.NESTED) public void dlAllOrder() { - BaseResponse> baseResponse = spGetHttp.getBasicStatus(BasicProcessStatus.NEW_ALL_ORDER + ""); + BaseResponse> baseResponse = spGetHttp.getBasicStatus(NEW_ALL_ORDER + ""); List pageSimpleResponse = baseResponse != null ? baseResponse.getData() : new ArrayList<>(); if (pageSimpleResponse != null) { List basicExportStatusEntities = pageSimpleResponse; if (basicExportStatusEntities != null && basicExportStatusEntities.size() > 0) { for (BasicExportStatusEntity basicExportStatusEntity : basicExportStatusEntities) { - String datas = spGetHttp.getBasicData(basicExportStatusEntity.getId(), BasicProcessStatus.NEW_ALL_ORDER); + String datas = spGetHttp.getBasicData(basicExportStatusEntity.getId(), NEW_ALL_ORDER); BaseResponse response = JSONObject.parseObject(datas, new TypeReference>() { }); if (response.getCode() == 20000 && response.getData() != null) { @@ -1273,7 +1275,7 @@ public class HeartService { basicDownloadStatusEntity.setStartTime(new Date()); basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER); basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中 - basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); + basicDownloadStatusEntity.setType(NEW_ALL_ORDER); basicDownloadStatusEntity.setScheduleType(1); basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity); StringBuffer remark = new StringBuffer();