From 8216e6fcbda87f036cfe7c0a65a9396d5a6b6b33 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 16 Feb 2023 18:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/basic/UdiRlSupController.java | 8 ++++ .../thrsys/ThrProductsController.java | 2 +- .../glxp/api/dao/thrsys/ThrProductsDao.java | 1 + .../service/thrsys/ThrProductsService.java | 2 + .../thrsys/impl/ThrProductsServiceImpl.java | 12 ++++++ .../mybatis/mapper/thrsys/ThrProductsDao.xml | 43 +++++++++++++++++++ 6 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java index d3d220be1..d338dd6d6 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java @@ -183,6 +183,14 @@ public class UdiRlSupController { if (StrUtil.isEmpty(udiInfoExportRequest.getUnitFk())) { return ResultVOUtils.error(500, "未选择供应商!"); } + //先判断产品是否存在 + CompanyProductRelevanceRequest filterUdiInfoRequest = new CompanyProductRelevanceRequest(); + filterUdiInfoRequest.setNameCode(udiInfoExportRequest.getNameCode()); + List udiRlSupResponses = udiRlSupService.filterUdiGp(filterUdiInfoRequest); + if(udiRlSupResponses.size()!=0){ + return ResultVOUtils.error(999,"产品已存在,请勿重复导入!"); + } + companyProductsRelService.insertCompanyProducts(udiInfoExportRequest); return ResultVOUtils.success("后台正在导入,请稍后刷新查看!"); } diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java index 815a4478c..21a16df37 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrProductsController.java @@ -173,7 +173,7 @@ public class ThrProductsController { if (null == thrProductsEntity) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); BeanUtils.copyProperties(thrProductsEntity,filterThrProductsRequest); - List thrProductsEntities = thrProductsService.filterThrProducts(filterThrProductsRequest); + List thrProductsEntities = thrProductsService.filterThrProducts1(filterThrProductsRequest); if(thrProductsEntities.size()==0){ thrProductsEntity.setUpdateUser(String.valueOf(customerService.getUserId())); thrProductsEntity.setCreateUser(String.valueOf(customerService.getUserId())); diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java b/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java index b7c38e09c..c28a80873 100644 --- a/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java @@ -21,6 +21,7 @@ public interface ThrProductsDao { List filterThrProducts(FilterThrProductsRequest filterThrProductsRequest); + List filterThrProducts1(FilterThrProductsRequest filterThrProductsRequest); List filterJoinThrProducts(FilterThrProductsRequest filterThrProductsRequest); diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java b/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java index c124f1a78..a422aa291 100644 --- a/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java +++ b/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java @@ -22,6 +22,8 @@ public interface ThrProductsService { List filterThrProducts(FilterThrProductsRequest filterThrProductsRequest); + List filterThrProducts1(FilterThrProductsRequest filterThrProductsRequest); + List filterJoinThrProducts(FilterThrProductsRequest filterThrProductsRequest); ThrProductsEntity selectById(String id); diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index 895a1a966..73c6bebc1 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -56,6 +56,18 @@ public class ThrProductsServiceImpl implements ThrProductsService { return data; } + public List filterThrProducts1(FilterThrProductsRequest filterThrProductsRequest) { + if (filterThrProductsRequest == null) { + return Collections.emptyList(); + } + if (filterThrProductsRequest.getPage() != null) { + int offset = (filterThrProductsRequest.getPage() - 1) * filterThrProductsRequest.getLimit(); + PageHelper.offsetPage(offset, filterThrProductsRequest.getLimit()); + } + List data = thrProductsDao.filterThrProducts1(filterThrProductsRequest); + return data; + } + @Override public List filterJoinThrProducts(FilterThrProductsRequest filterThrProductsRequest) { if (filterThrProductsRequest == null) { diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml index faf98827c..bdc13e045 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml @@ -46,6 +46,49 @@ +