数据同步问题相关修改

dev2.0
anthonywj 2 years ago
parent 99bacc3a0e
commit c4769a2a93

@ -49,7 +49,7 @@ public class HdSchemaExecutor implements ApplicationRunner {
String sql = IoUtil.readUtf8(inputStream); String sql = IoUtil.readUtf8(inputStream);
try { try {
//判断版本表是否存在 //判断版本表是否存在
int count = hdCommonDao.selectTableExist("hd_version"); int count = hdCommonDao.selectTableExist("sys_db_version");
if (count == 0) { if (count == 0) {
hdCommonDao.updateSql(sql); hdCommonDao.updateSql(sql);
} }

@ -11,6 +11,7 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.*; import com.glxp.api.constant.*;
import com.glxp.api.controller.sync.SpsSyncWebSocket; import com.glxp.api.controller.sync.SpsSyncWebSocket;
import com.glxp.api.constant.Constant;
import com.glxp.api.dao.basic.BasicProductsDao; import com.glxp.api.dao.basic.BasicProductsDao;
import com.glxp.api.entity.basic.*; import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.inout.*; import com.glxp.api.entity.inout.*;
@ -37,12 +38,10 @@ import com.glxp.api.service.inv.DeviceInspectTaskDetailService;
import com.glxp.api.service.inv.DeviceInspectTaskService; import com.glxp.api.service.inv.DeviceInspectTaskService;
import com.glxp.api.service.purchase.*; import com.glxp.api.service.purchase.*;
import com.glxp.api.service.thrsys.IThrBusTypeOriginService; import com.glxp.api.service.thrsys.IThrBusTypeOriginService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.*;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.JsonUtils;
import com.glxp.api.util.RedisUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -101,6 +100,7 @@ public class SpsSyncDownloadService {
log.info("创建单据同步任务"); log.info("创建单据同步任务");
//自动创建要求被下载已完成单据任务. //自动创建要求被下载已完成单据任务.
// 1.判断是否同步任务已存在 // 1.判断是否同步任务已存在
Date curTime = new Date();
BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class)
.eq(BasicExportStatusEntity::getType, NEW_ALL_ORDER) .eq(BasicExportStatusEntity::getType, NEW_ALL_ORDER)
.orderByDesc(BasicExportStatusEntity::getStartTime) .orderByDesc(BasicExportStatusEntity::getStartTime)
@ -108,8 +108,8 @@ public class SpsSyncDownloadService {
); );
//首次任务or上次任务结束 //首次任务or上次任务结束
if (basicExportStatusEntity1 == null || BasicExportStatusEnum.COMPLETED.getCode().equals(basicExportStatusEntity1.getStatus())) { if (basicExportStatusEntity1 == null || IntUtil.value(BasicExportStatusEnum.COMPLETED.getCode()) == IntUtil.value(basicExportStatusEntity1.getStatus())) {
log.info("no2:" + basicExportStatusEntity1.getStatus() + "---" + BasicExportStatusEnum.COMPLETED.getCode());
SpsSyncDataRequest spsSyncDataRequest = getRequest(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER); SpsSyncDataRequest spsSyncDataRequest = getRequest(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER);
if (lastUpdateTime != null) if (lastUpdateTime != null)
spsSyncDataRequest.setLastUpdateTime(DateUtil.formatDateTime(lastUpdateTime)); spsSyncDataRequest.setLastUpdateTime(DateUtil.formatDateTime(lastUpdateTime));
@ -124,7 +124,7 @@ public class SpsSyncDownloadService {
orderStatusEntity.setType(NEW_ALL_ORDER); orderStatusEntity.setType(NEW_ALL_ORDER);
orderStatusEntity.setUpdateTime(new Date()); orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStatus(BasicExportStatusEnum.WAIT_SYNC.getCode()); orderStatusEntity.setStatus(BasicExportStatusEnum.WAIT_SYNC.getCode());
orderStatusEntity.setStartTime(new Date()); orderStatusEntity.setStartTime(curTime);
orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
if (lastUpdateTime != null) { if (lastUpdateTime != null) {

@ -16,7 +16,7 @@ import java.util.List;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class BasicExportServiceImpl extends ServiceImpl<BasicExportDao,BasicExportStatusEntity> implements BasicExportService { public class BasicExportServiceImpl extends ServiceImpl<BasicExportDao, BasicExportStatusEntity> implements BasicExportService {
@Resource @Resource
BasicExportDao basicExportDao; BasicExportDao basicExportDao;
@ -67,6 +67,6 @@ public class BasicExportServiceImpl extends ServiceImpl<BasicExportDao,BasicExpo
@Override @Override
public BasicExportStatusEntity findLast(String idDatas) { public BasicExportStatusEntity findLast(String idDatas) {
return null; return basicExportDao.findLast(idDatas);
} }
} }

Loading…
Cancel
Save