bug修复

master
anthonywj 2 years ago
parent 4318495bac
commit 655ecb508c

@ -41,6 +41,11 @@ public enum BasicExportTypeEnum {
* *
*/ */
SYS_SET_DATA("sys_set_data", "系统设置数据"), SYS_SET_DATA("sys_set_data", "系统设置数据"),
//
// NEW_ALL_ORDER("all_order", "出入库扫码单据"),
// ALL_BUS_ORDER("all_bus_order", "业务单据"),
; ;
private String key; private String key;

@ -58,8 +58,8 @@ public class SpGetHttpClient {
return headers; return headers;
} }
public BaseResponse<String> postData(BasicExportTypeEnum exportType, Object data) { public BaseResponse<String> postData(String taskId, BasicExportTypeEnum exportType, Object data) {
SyncUpLoadRequest build = SyncUpLoadRequest.builder().exportType(exportType).data(data).build(); SyncUpLoadRequest build = SyncUpLoadRequest.builder().taskId(taskId).exportType(exportType).data(data).build();
String result = okHttpCli.doPostJson(getIpUrl() + "/sps/sync/upload/data", JSONUtil.toJsonStr(build), buildHeader()); String result = okHttpCli.doPostJson(getIpUrl() + "/sps/sync/upload/data", JSONUtil.toJsonStr(build), buildHeader());
return JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() { return JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
}); });

@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
@Builder @Builder
public class SyncUpLoadRequest { public class SyncUpLoadRequest {
private String taskId;
private BasicExportTypeEnum exportType; private BasicExportTypeEnum exportType;
private Object data; private Object data;

@ -61,6 +61,8 @@ import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import static com.glxp.api.constant.BasicProcessStatus.NEW_ALL_ORDER;
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@ -123,7 +125,7 @@ public class HeartService {
BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity();
orderStatusEntity.setId(CustomUtil.getId()); orderStatusEntity.setId(CustomUtil.getId());
orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER); orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER);
orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); orderStatusEntity.setType(NEW_ALL_ORDER);
orderStatusEntity.setUpdateTime(new Date()); orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStartTime(new Date()); orderStatusEntity.setStartTime(new Date());
orderStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); 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.setLastUpdateTime(DateUtil.formatDate(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_SCAN_ORDER); basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_SCAN_ORDER);
spsSyncOrderResponse.setTaskId(basicExportStatusEntity1.getId()); spsSyncOrderResponse.setTaskId(basicExportStatusEntity1.getId());
spsSyncOrderResponse.setType(BasicProcessStatus.NEW_ALL_ORDER); spsSyncOrderResponse.setType(NEW_ALL_ORDER);
BaseResponse<String> baseResponse1 = spGetHttp.postAllOrder(spsSyncOrderResponse); BaseResponse<String> baseResponse1 = spGetHttp.postAllOrder(spsSyncOrderResponse);
if (baseResponse1.getCode() == 20000) { if (baseResponse1.getCode() == 20000) {
basicExportStatusEntity1.setStatus(2); basicExportStatusEntity1.setStatus(2);
@ -862,7 +864,7 @@ public class HeartService {
* @return * @return
*/ */
private SpsSyncSysSettingResponse getSysSettingData(SyncDataSetEntity info, String taskId, Date now, Date syncTime) { private SpsSyncSysSettingResponse getSysSettingData(SyncDataSetEntity info, String taskId, Date now, Date syncTime) {
SpsSyncSysSettingResponse dataResponse = null; SpsSyncSysSettingResponse dataResponse = null;
Map<String, Object> syncTimeMap = new WeakHashMap<>(3); Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true); syncTimeMap.put("isNew", true);
syncTimeMap.put("oldDate", syncTime); syncTimeMap.put("oldDate", syncTime);
@ -1041,7 +1043,7 @@ public class HeartService {
if (data == null) { if (data == null) {
return; return;
} }
BaseResponse<String> baseResponse = spGetHttp.postData(exportType, data); BaseResponse<String> baseResponse = spGetHttp.postData(taskId, exportType, data);
if (baseResponse.getCode() != 20000) { if (baseResponse.getCode() != 20000) {
status = BasicExportStatusEnum.FAILED.getCode(); status = BasicExportStatusEnum.FAILED.getCode();
} }
@ -1254,13 +1256,13 @@ public class HeartService {
//下载最近更新扫码单据--上级服务 //下载最近更新扫码单据--上级服务
@Transactional(propagation = Propagation.NESTED) @Transactional(propagation = Propagation.NESTED)
public void dlAllOrder() { public void dlAllOrder() {
BaseResponse<List<BasicExportStatusEntity>> baseResponse = spGetHttp.getBasicStatus(BasicProcessStatus.NEW_ALL_ORDER + ""); BaseResponse<List<BasicExportStatusEntity>> baseResponse = spGetHttp.getBasicStatus(NEW_ALL_ORDER + "");
List<BasicExportStatusEntity> pageSimpleResponse = baseResponse != null ? baseResponse.getData() : new ArrayList<>(); List<BasicExportStatusEntity> pageSimpleResponse = baseResponse != null ? baseResponse.getData() : new ArrayList<>();
if (pageSimpleResponse != null) { if (pageSimpleResponse != null) {
List<BasicExportStatusEntity> basicExportStatusEntities = pageSimpleResponse; List<BasicExportStatusEntity> basicExportStatusEntities = pageSimpleResponse;
if (basicExportStatusEntities != null && basicExportStatusEntities.size() > 0) { if (basicExportStatusEntities != null && basicExportStatusEntities.size() > 0) {
for (BasicExportStatusEntity basicExportStatusEntity : basicExportStatusEntities) { for (BasicExportStatusEntity basicExportStatusEntity : basicExportStatusEntities) {
String datas = spGetHttp.getBasicData(basicExportStatusEntity.getId(), BasicProcessStatus.NEW_ALL_ORDER); String datas = spGetHttp.getBasicData(basicExportStatusEntity.getId(), NEW_ALL_ORDER);
BaseResponse<String> response = JSONObject.parseObject(datas, new TypeReference<BaseResponse<String>>() { BaseResponse<String> response = JSONObject.parseObject(datas, new TypeReference<BaseResponse<String>>() {
}); });
if (response.getCode() == 20000 && response.getData() != null) { if (response.getCode() == 20000 && response.getData() != null) {
@ -1273,7 +1275,7 @@ public class HeartService {
basicDownloadStatusEntity.setStartTime(new Date()); basicDownloadStatusEntity.setStartTime(new Date());
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER); basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER);
basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中 basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中
basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); basicDownloadStatusEntity.setType(NEW_ALL_ORDER);
basicDownloadStatusEntity.setScheduleType(1); basicDownloadStatusEntity.setScheduleType(1);
basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity); basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity);
StringBuffer remark = new StringBuffer(); StringBuffer remark = new StringBuffer();

Loading…
Cancel
Save