|
|
|
@ -12,6 +12,8 @@ import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.BasicProcessStatus;
|
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.api.dao.basic.*;
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeLostMapper;
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeRelMapper;
|
|
|
|
|
import com.glxp.api.dao.purchase.*;
|
|
|
|
|
import com.glxp.api.entity.basic.ProductInfoEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiCompanyEntity;
|
|
|
|
@ -534,6 +536,34 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从UDI自助平台拉取其他数据
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void pullOtherData() {
|
|
|
|
|
String data = spGetHttp.pullOtherData();
|
|
|
|
|
cn.hutool.json.JSONObject obj = JSONUtil.parseObj(data);
|
|
|
|
|
SpsSyncOtherDataResponse bean = obj.get("data", SpsSyncOtherDataResponse.class);
|
|
|
|
|
this.insertOtherData(bean);
|
|
|
|
|
String taskId = bean.getTaskId();
|
|
|
|
|
if (StrUtil.isNotBlank(taskId)) {
|
|
|
|
|
//插入下载记录
|
|
|
|
|
BasicDownloadStatusEntity basicDownloadStatusEntity = new BasicDownloadStatusEntity();
|
|
|
|
|
basicDownloadStatusEntity.setId(CustomUtil.getId());
|
|
|
|
|
basicDownloadStatusEntity.setTaskId(taskId);
|
|
|
|
|
basicDownloadStatusEntity.setStartTime(new Date());
|
|
|
|
|
basicDownloadStatusEntity.setUpdateTime(new Date());
|
|
|
|
|
basicDownloadStatusEntity.setEndTime(new Date());
|
|
|
|
|
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_OTHER_DATA);
|
|
|
|
|
basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS); //下载完成
|
|
|
|
|
basicDownloadStatusEntity.setType(BasicProcessStatus.OTHER_DATA);
|
|
|
|
|
basicDownloadStatusEntity.setScheduleType(1);
|
|
|
|
|
basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity);
|
|
|
|
|
//通知自助平台任务已完成
|
|
|
|
|
spGetHttp.finishTask(taskId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置嵌套事物
|
|
|
|
|
*
|
|
|
|
@ -573,6 +603,24 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private final IoCodeLostMapper ioCodeLostMapper;
|
|
|
|
|
private final IoCodeRelMapper ioCodeRelMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置嵌套事物
|
|
|
|
|
*
|
|
|
|
|
* @param bean
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(propagation = Propagation.NESTED)
|
|
|
|
|
public void insertOtherData(SpsSyncOtherDataResponse bean) {
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getIoCodeLostList())) {
|
|
|
|
|
ioCodeLostMapper.insertOrUpdateBatch(bean.getIoCodeLostList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getIoCodeRelList())) {
|
|
|
|
|
ioCodeRelMapper.insertOrUpdateBatch(bean.getIoCodeRelList());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void insetOrderDb(SpsSyncOrderResponse syncDataResponse, IoOrderEntity orderEntity) {
|
|
|
|
|
//更新码详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
|
|
|
|
|