|
|
|
@ -6,7 +6,9 @@ import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.dao.basic.BasicProductsDao;
|
|
|
|
|
import com.glxp.api.dao.basic.UdiRelevanceDao;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicProductsEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectOrder;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectOrderBiz;
|
|
|
|
@ -47,18 +49,19 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
filterThrOrderRequest.setBusType(collectOrderRequest.getBusType());
|
|
|
|
|
filterThrOrderRequest.setWorkPlaceCode(collectOrderRequest.getWorkPlaceCode());
|
|
|
|
|
filterThrOrderRequest.setFromType(collectOrderRequest.getFromType());
|
|
|
|
|
while (true){
|
|
|
|
|
while (true) {
|
|
|
|
|
filterThrOrderRequest.setPage(page);
|
|
|
|
|
BaseResponse<PageSimpleResponse<IoCollectOrder>> baseResponse = erpBasicClient.getThrOrders(filterThrOrderRequest);
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
List<IoCollectOrder> list = baseResponse.getData().getList();
|
|
|
|
|
collectOrderService.importPrescribe(list,collectOrderRequest.getBusType());
|
|
|
|
|
// TODO: 2024/9/11 2024/9/11 添加一张中间表(io_collect_order_origin)原始表做为转换
|
|
|
|
|
importThrOrder(list, collectOrderRequest);
|
|
|
|
|
if ((list.size() >= limit && !baseResponse.getData().getTotal().equals(-666)) || IntUtil.value(baseResponse.getData().getTotal()) == -555) {
|
|
|
|
|
page++;
|
|
|
|
|
} else {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "下载第三方系统产品信息异常");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -68,6 +71,8 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
// }
|
|
|
|
|
@Resource
|
|
|
|
|
UdiRelevanceDao udiRelevanceDao;
|
|
|
|
|
@Resource
|
|
|
|
|
BasicProductsDao basicProductsDao;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下载至单据
|
|
|
|
@ -97,6 +102,10 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper<UdiRelevanceEntity>().eq(UdiRelevanceEntity::getMainId, entity.getThrCode()));
|
|
|
|
|
if (basicUdirelEntity != null) {
|
|
|
|
|
collectOrderBiz.setRelId(basicUdirelEntity.getId());
|
|
|
|
|
BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().eq(BasicProductsEntity::getUuid, basicUdirelEntity.getUuid()).last("limit 1"));
|
|
|
|
|
if (StrUtil.isEmpty(basicProductsEntity.getNameCode())) {
|
|
|
|
|
errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";");
|
|
|
|
|
}
|
|
|
|
@ -111,6 +120,9 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
ioCollectOrder.setBizList(bizList);
|
|
|
|
|
ioCollectOrderList.add(ioCollectOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
collectOrderService.importPrescribe(ioCollectOrderList, collectOrderRequest.getBusType());
|
|
|
|
|
return ResultVOUtils.success("下载成功");
|
|
|
|
|
}
|
|
|
|
|