From 2884de554f0aaea329c9358ab183296f130202be Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Tue, 8 Oct 2024 14:40:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=95=E6=8D=AE=E4=B8=8B=E8=BD=BD-?= =?UTF-8?q?=E5=99=A8=E6=A2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collect/IoCollectOriginService.java | 32 ++++++++++++----- .../collect/down/ThrOrderDownload.java | 35 +++++++++++++------ 2 files changed, 48 insertions(+), 19 deletions(-) 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