由内向外同步

master
wj 2 years ago
parent 2bfc6a0b75
commit 729badbb04

@ -20,7 +20,7 @@ public enum BasicExportTypeEnum {
/**
*
*/
DOCUMENT_TYPE("document_type", "单据类型"),
DOCUMENT_TYPE_DATA("document_type_data", "单据类型"),
/**
*

@ -1,5 +1,7 @@
package com.glxp.api.entity.sync;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -9,10 +11,13 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("basic_export_status_time")
public class BasicExportStatusTimeEntity {
private Integer id;
@TableField("lastUpdateTime")
private String lastUpdateTime;
@TableField("`key`")
private String key;
private String remark;

@ -56,7 +56,7 @@ public class SpGetHttpClient {
public BaseResponse<String> postData(BasicExportTypeEnum exportType, Object data) {
SyncUpLoadRequest build = SyncUpLoadRequest.builder().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>>() {
});
}

@ -22,7 +22,6 @@ import com.glxp.api.entity.purchase.*;
import com.glxp.api.entity.sync.BasicDownloadStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusTimeEntity;
import com.glxp.api.entity.system.SyncDataBustypeEntity;
import com.glxp.api.entity.system.SyncDataSetEntity;
import com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity;
import com.glxp.api.http.sync.SpGetHttpClient;
@ -221,7 +220,7 @@ public class HeartService {
uploadData(exportType, taskId, x -> x.getOtherData(info, taskId, now, syncTime));
}
break;
case DOCUMENT_TYPE:
case DOCUMENT_TYPE_DATA:
if (needExec(info.getTypeBus(), info.getTypeScan(), info.getTypeThird())) {
uploadData(exportType, taskId, x -> x.getDocumentTypeData(info, taskId, now, syncTime));
}
@ -540,7 +539,7 @@ public class HeartService {
* @return
*/
private boolean needExec(int... set) {
return CollectionUtil.contains(Collections.singleton(set), 1);
return Arrays.stream(set).filter(i->i==1).findAny().isPresent();
}
public void uploadData(BasicExportTypeEnum exportType, String taskId, Function<HeartService, Object> dataMethod) {

@ -20,8 +20,8 @@ import javax.annotation.Resource;
import java.util.Arrays;
//@Component
//@EnableScheduling
@Component
@EnableScheduling
public class SyncHeartTask implements SchedulingConfigurer {
final Logger logger = LoggerFactory.getLogger(SyncHeartTask.class);

Loading…
Cancel
Save