diff --git a/src/main/java/com/glxp/api/service/collect/IoCollectOriginService.java b/src/main/java/com/glxp/api/service/collect/IoCollectOriginService.java index 2c4a81a38..337c51113 100644 --- a/src/main/java/com/glxp/api/service/collect/IoCollectOriginService.java +++ b/src/main/java/com/glxp/api/service/collect/IoCollectOriginService.java @@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusTypeConstant; import com.glxp.api.dao.basic.BasicProductsDao; import com.glxp.api.dao.basic.SysWorkplaceDocumentDao; import com.glxp.api.dao.basic.UdiRelevanceDao; @@ -145,19 +146,32 @@ public class IoCollectOriginService { for (IoCollectOrderBizOrigin entity : list) { IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); BeanUtil.copyProperties(entity, collectOrderBiz); - UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper().eq(UdiRelevanceEntity::getMainId, entity.getThrCode())); - if (basicUdirelEntity != null) { - collectOrderBiz.setRelId(basicUdirelEntity.getId()); - BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper().eq(BasicProductsEntity::getUuid, basicUdirelEntity.getUuid()).last("limit 1")); + + if (BusTypeConstant.QXCF001.getBusType().equals(collectOrderRequest.getBusType())){ + collectOrderBiz.setRelId(entity.getRelId()); + BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper().eq(BasicProductsEntity::getYbbm, entity.getYbbm()).last("limit 1")); if (StrUtil.isEmpty(basicProductsEntity.getNameCode())) { errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); } - } else { - errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); + collectOrderBiz.setTagStatus(1); + collectOrderBiz.setUnTagCount(0); + bizList.add(collectOrderBiz); + + }else { + UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper().eq(UdiRelevanceEntity::getMainId, entity.getThrCode())); + if (basicUdirelEntity != null) { + collectOrderBiz.setRelId(basicUdirelEntity.getId()); + BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper().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(";"); + } + collectOrderBiz.setTagStatus(1); + collectOrderBiz.setUnTagCount(0); + bizList.add(collectOrderBiz); } - collectOrderBiz.setTagStatus(1); - collectOrderBiz.setUnTagCount(0); - bizList.add(collectOrderBiz); } if (StrUtil.isNotEmpty(errorMsg)) { thrOrder.setTagStatus(4); diff --git a/src/main/java/com/glxp/api/service/collect/down/ThrOrderDownload.java b/src/main/java/com/glxp/api/service/collect/down/ThrOrderDownload.java index 444ddcc7c..cb6d647a3 100644 --- a/src/main/java/com/glxp/api/service/collect/down/ThrOrderDownload.java +++ b/src/main/java/com/glxp/api/service/collect/down/ThrOrderDownload.java @@ -6,6 +6,7 @@ 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.constant.BusTypeConstant; import com.glxp.api.dao.basic.BasicProductsDao; import com.glxp.api.dao.basic.UdiRelevanceDao; import com.glxp.api.entity.basic.BasicProductsEntity; @@ -102,20 +103,34 @@ public class ThrOrderDownload implements IDownload { for (IoCollectOrderBiz entity : thrOrder.getBizList()) { IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); BeanUtil.copyProperties(entity, collectOrderBiz); - UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper().eq(UdiRelevanceEntity::getMainId, entity.getThrCode()).last("limit 1")); - if (basicUdirelEntity != null) { - collectOrderBiz.setRelId(basicUdirelEntity.getId()); - BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper().eq(BasicProductsEntity::getUuid, basicUdirelEntity.getUuid()).last("limit 1")); - if (basicProductsEntity == null || StrUtil.isEmpty(basicProductsEntity.getNameCode())) { + + if (BusTypeConstant.QXCF001.getBusType().equals(collectOrderRequest.getBusType())){ + collectOrderBiz.setRelId(entity.getRelId()); + BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper().eq(BasicProductsEntity::getYbbm, entity.getYbbm()).last("limit 1")); + if (StrUtil.isEmpty(basicProductsEntity.getNameCode())) { errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); } - } else { - errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); + collectOrderBiz.setTagStatus(1); + collectOrderBiz.setUnTagCount(0); + bizList.add(collectOrderBiz); + + }else { + UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper().eq(UdiRelevanceEntity::getMainId, entity.getThrCode()).last("limit 1")); + if (basicUdirelEntity != null) { + collectOrderBiz.setRelId(basicUdirelEntity.getId()); + BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper().eq(BasicProductsEntity::getUuid, basicUdirelEntity.getUuid()).last("limit 1")); + if (basicProductsEntity == null || StrUtil.isEmpty(basicProductsEntity.getNameCode())) { + errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); + } + } else { + errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); + } + collectOrderBiz.setTagStatus(1); + collectOrderBiz.setUnTagCount(0); + bizList.add(collectOrderBiz); } - collectOrderBiz.setTagStatus(1); - collectOrderBiz.setUnTagCount(0); - bizList.add(collectOrderBiz); } + if (StrUtil.isNotBlank(errorMsg)) { ioCollectOrder.setTagStatus(4); } else