|
|
|
@ -57,7 +57,7 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
BaseResponse<PageSimpleResponse<IoCollectOrder>> baseResponse = erpBasicClient.getThrOrders(filterThrOrderRequest);
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
List<IoCollectOrder> list = baseResponse.getData().getList();
|
|
|
|
|
if (list == null){
|
|
|
|
|
if (list == null) {
|
|
|
|
|
return ResultVOUtils.error(500, "未查到此业务单据");
|
|
|
|
|
}
|
|
|
|
|
// TODO: 2024/9/11 2024/9/11 添加一张中间表(io_collect_order_origin)原始表做为转换
|
|
|
|
@ -107,12 +107,24 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
|
|
|
|
|
BeanUtil.copyProperties(entity, collectOrderBiz);
|
|
|
|
|
|
|
|
|
|
if (BusTypeConstant.QXCF001.getBusType().equals(collectOrderRequest.getBusType())){
|
|
|
|
|
if (BusTypeConstant.QXCF001.getBusType().equals(collectOrderRequest.getBusType())) {
|
|
|
|
|
collectOrderBiz.setRelId(entity.getRelId());
|
|
|
|
|
|
|
|
|
|
if(StrUtil.isNotEmpty(entity.getCheckCode())){
|
|
|
|
|
basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().like(BasicProductsEntity::getYbbm,entity.getCheckCode()));
|
|
|
|
|
}else{
|
|
|
|
|
if (StrUtil.isNotEmpty(entity.getCheckCode())) {
|
|
|
|
|
// 1. 先查询完全匹配的情况
|
|
|
|
|
LambdaQueryWrapper<BasicProductsEntity> exactMatchWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
exactMatchWrapper.eq(BasicProductsEntity::getYbbm, entity.getCheckCode());
|
|
|
|
|
List<BasicProductsEntity> exactMatches = basicProductsDao.selectList(exactMatchWrapper);
|
|
|
|
|
if (exactMatches.isEmpty()) {
|
|
|
|
|
// 2. 如果没有完全匹配,则查询前20位匹配的情况
|
|
|
|
|
LambdaQueryWrapper<BasicProductsEntity> prefixMatchWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
prefixMatchWrapper.apply("LEFT(ybbm, 20) = LEFT({0}, 20)", entity.getCheckCode());
|
|
|
|
|
exactMatches = basicProductsDao.selectList(prefixMatchWrapper);
|
|
|
|
|
}
|
|
|
|
|
if (exactMatches.isEmpty()) {
|
|
|
|
|
errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().eq(BasicProductsEntity::getYbbm, entity.getYbbm()).last("limit 1"));
|
|
|
|
|
if (basicProductsEntity == null || StrUtil.isEmpty(basicProductsEntity.getNameCode())) {
|
|
|
|
|
errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";");
|
|
|
|
@ -123,7 +135,7 @@ public class ThrOrderDownload implements IDownload {
|
|
|
|
|
collectOrderBiz.setUnTagCount(0);
|
|
|
|
|
bizList.add(collectOrderBiz);
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper<UdiRelevanceEntity>().eq(UdiRelevanceEntity::getMainId, entity.getThrCode()).last("limit 1"));
|
|
|
|
|
if (basicUdirelEntity != null) {
|
|
|
|
|
collectOrderBiz.setRelId(basicUdirelEntity.getId());
|
|
|
|
|