|
|
@ -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();
|
|
|
|