From 99506e1f400e691127782bbf8878ee44c0d8d350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B3=BD=E8=85=BE?= <1178634255@qq.com> Date: Fri, 4 Aug 2023 18:20:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=89=A9=E8=B5=84=E8=B5=84=E8=B4=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E--=E6=96=B0=E5=A2=9E=E9=85=8D=E9=80=81?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E8=B5=84=E8=B4=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/SupProductController.java | 47 ++++++++++--------- .../glxp/api/dao/purchase/SupProductDao.java | 2 +- .../service/purchase/SupProductService.java | 2 +- .../purchase/impl/SupProductServiceImpl.java | 5 +- .../mybatis/mapper/purchase/SupProductDao.xml | 13 ++++- 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java index 7ed9805c..c3be3e50 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java @@ -140,6 +140,9 @@ public class SupProductController { return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!"); } } + int i = supProductService.findProduct(supProductEntity); + System.out.println(i); + if (i == 0) { supProductEntity.setCreateTime(new Date()); supProductEntity.setUpdateTime(new Date()); supProductEntity.setId(IdUtil.getSnowflakeNextId()); @@ -148,6 +151,8 @@ public class SupProductController { return ResultVOUtils.success("添加成功"); } else { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + }} else { + return ResultVOUtils.error(ResultEnum.DATA_REPEAT); } } @@ -158,27 +163,27 @@ public class SupProductController { UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectUdiId(Long.valueOf(selectProductBindRequest.getRelIdFk())); SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory(), selectProductBindRequest.getManufacturerId()); - if (supProductEntity != null) { - return ResultVOUtils.error(500, "该产品资质已存在,请勿重复添加!"); - } else { - supProductEntity = new SupProductEntity(); - BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity); - supProductEntity.setProductId(selectProductBindRequest.getProductId()); - supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh()); - supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + ""); - supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc()); - supProductEntity.setProductType(udiRelevanceResponse.getQxlb()); - supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm()); - supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc()); - supProductEntity.setSpecification(udiRelevanceResponse.getGgxh()); - supProductEntity.setCreateTime(new Date()); - supProductEntity.setUpdateTime(new Date()); - supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId()); - supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId()); - supProductEntity.setHchzsb(udiRelevanceResponse.getCplb()); - supProductEntity.setCompanyName(selectProductBindRequest.getCompanyName()); - supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus()); - } +// if (supProductEntity != null) { +// return ResultVOUtils.error(500, "该产品资质已存在,请勿重复添加!"); +// } else { + supProductEntity = new SupProductEntity(); + BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity); + supProductEntity.setProductId(selectProductBindRequest.getProductId()); + supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh()); + supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + ""); + supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc()); + supProductEntity.setProductType(udiRelevanceResponse.getQxlb()); + supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm()); + supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc()); + supProductEntity.setSpecification(udiRelevanceResponse.getGgxh()); + supProductEntity.setCreateTime(new Date()); + supProductEntity.setUpdateTime(new Date()); + supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId()); + supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId()); + supProductEntity.setHchzsb(udiRelevanceResponse.getCplb()); + supProductEntity.setCompanyName(selectProductBindRequest.getCompanyName()); + supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus()); +// } return ResultVOUtils.success(supProductEntity); diff --git a/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java b/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java index d62b9cfc..4a62ef0a 100644 --- a/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java +++ b/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java @@ -16,7 +16,7 @@ import java.util.List; public interface SupProductDao extends BaseMapperPlus { SupProductEntity findRegistration(Long id); - + int findProduct(SupProductEntity supProductEntity); SupProductEntity findRegistrationByName(String recordProductName); List getRegistration(FilterPoductRequest filterPoductRequest); diff --git a/src/main/java/com/glxp/api/service/purchase/SupProductService.java b/src/main/java/com/glxp/api/service/purchase/SupProductService.java index 02cb4ef8..d39ba59e 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupProductService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupProductService.java @@ -35,7 +35,7 @@ public interface SupProductService extends IService { boolean modifyRegistration(SupProductEntity supProductEntity); boolean insertRegistration(SupProductEntity supProductEntity); - + int findProduct(SupProductEntity supProductEntity); boolean deleteById(@Param("id") String id); boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId); diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java index e16d2736..42f6e6e1 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java @@ -147,7 +147,10 @@ public class SupProductServiceImpl extends ServiceImpl 0 ? true : false; } - + @Override + public int findProduct(SupProductEntity supProductEntity) { + return supProductDao.findProduct(supProductEntity); + } @Override public boolean deleteById(String id) { return supProductDao.deleteById(id); diff --git a/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml b/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml index b6457c82..5c9c70f0 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml @@ -377,7 +377,18 @@ #{hchzsb}, #{relIdFk}, #{manufactory}, #{allowNoBatch}, #{allowNoExpire}, #{allowNoProduct}, #{allowNoSerial}) - + DELETE FROM sup_product From 625249dea03d2eddbfee792709406f29da24e8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=87?= <2433098676@qq.com> Date: Thu, 10 Aug 2023 18:18:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E8=AF=81=E4=BB=B6=E5=A4=87=E6=A1=88=E5=8F=B7=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=B5=84=E8=B4=A8=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoOrderDetailBizController.java | 7 ++++--- .../com/glxp/api/dao/purchase/SupCertDao.java | 3 +++ .../api/req/inout/AddBizProductReqeust.java | 1 + .../api/service/purchase/SupCertService.java | 3 +++ .../purchase/impl/SupCertServiceImpl.java | 5 +++++ .../mybatis/mapper/basic/UdiRelevanceDao.xml | 4 +++- .../mybatis/mapper/purchase/SupCertDao.xml | 19 +++++++++++++++++++ 7 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 442ad766..42dcb718 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -169,14 +169,15 @@ public class IoOrderDetailBizController extends BaseController { BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); if (bussinessTypeEntity.getCheckCertExpire() == 2 && udiRelevanceResponse.isNeedCert()) { SupProductEntity supProductEntity = supProductService.findExitByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory()); - if (supProductEntity != null && (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS || supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS)) { - List supCertEntities = supCertService.findByProductId(supProductEntity.getProductId()); +// List supCertEntities = supCertService.findByProductId(supProductEntity.getProductId()); + addBizProductReqeust.setProductId(supProductEntity.getProductId()); + List supCertEntities = supCertService.findByzczbhhzbapzbh(addBizProductReqeust); if (CollUtil.isNotEmpty(supCertEntities)) { Date curDate = new Date(); for (SupCertEntity supCertEntity : supCertEntities) { if (supCertEntity.getExpireDate() != null && supCertEntity.getExpireDate().compareTo(curDate) < 0) { - return ResultVOUtils.error(500, "产品资质证书已过期!"); + return ResultVOUtils.error(500, "该注册备案号所属产品资质证书已过期!"); } } } diff --git a/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java b/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java index 0672ddb3..e28d72e8 100644 --- a/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java +++ b/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java @@ -4,6 +4,7 @@ package com.glxp.api.dao.purchase; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.req.inout.AddBizProductReqeust; import com.glxp.api.req.purchase.FilterSupCertRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; import org.apache.ibatis.annotations.Mapper; @@ -23,6 +24,8 @@ public interface SupCertDao extends BaseMapperPlus selectCompanyCert(FilterSupCertRequest filterSupCertRequest); + List findByzczbhhzbapzbh(AddBizProductReqeust addBizProductReqeust); + boolean updateCompanyCert(SupCertEntity supCertEntity); boolean insertCompanyCert(SupCertEntity supCertEntity); diff --git a/src/main/java/com/glxp/api/req/inout/AddBizProductReqeust.java b/src/main/java/com/glxp/api/req/inout/AddBizProductReqeust.java index af2d1112..56401804 100644 --- a/src/main/java/com/glxp/api/req/inout/AddBizProductReqeust.java +++ b/src/main/java/com/glxp/api/req/inout/AddBizProductReqeust.java @@ -13,6 +13,7 @@ public class AddBizProductReqeust { //单选添加 private Long relId; private String zczbhhzbapzbh; + private String productId; private String supId; private String batchNo; private String productDate; diff --git a/src/main/java/com/glxp/api/service/purchase/SupCertService.java b/src/main/java/com/glxp/api/service/purchase/SupCertService.java index 13b90e76..1f127d63 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCertService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCertService.java @@ -3,6 +3,7 @@ package com.glxp.api.service.purchase; import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.req.inout.AddBizProductReqeust; import com.glxp.api.req.purchase.FilterSupCertRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; @@ -22,6 +23,8 @@ public interface SupCertService extends IService { List findByProductId(String productId); + List findByzczbhhzbapzbh(AddBizProductReqeust addBizProductReqeust); + List selectCompanyCert(FilterSupCertRequest filterSupCertRequest); diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java index 85b145f8..46d27b65 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java @@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.dao.purchase.SupCertDao; import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.req.inout.AddBizProductReqeust; import com.glxp.api.req.purchase.FilterSupCertRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; import com.glxp.api.service.purchase.SupCertService; @@ -111,6 +112,10 @@ public class SupCertServiceImpl extends ServiceImpl i return supCertDao.selectList(new QueryWrapper().eq("productIdFk", productId)); } + @Override + public List findByzczbhhzbapzbh(AddBizProductReqeust addBizProductReqeust) { + return supCertDao.findByzczbhhzbapzbh(addBizProductReqeust); + } @Override public boolean updateCompanyCert(SupCertEntity supCertEntity) { diff --git a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index 79c51809..8697deb2 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -1255,7 +1255,9 @@ ON basic_products.uuid = basic_udirel.uuid left join company_product_relevance on basic_udirel.id = company_product_relevance.udiRlIdFk - left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId + left JOIN basic_corp + on basic_corp.erpId = company_product_relevance.customerId + AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%') diff --git a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml index 3c09c06d..966ebbaf 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml @@ -50,6 +50,25 @@ + +