From 6fc18f6a92059609a77a4a1ec49a75ace6c516ce Mon Sep 17 00:00:00 2001 From: 1178634255 <1178634255@qq.com> Date: Tue, 4 Jul 2023 11:42:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/SupCertController.java | 26 +++++++------- .../sup/UserRegisterController.java | 5 +-- .../com/glxp/api/dao/purchase/SupCertDao.java | 4 ++- .../api/service/purchase/SupCertService.java | 4 ++- .../purchase/impl/SupCertServiceImpl.java | 13 +++++++ .../mybatis/mapper/purchase/SupCertDao.xml | 36 ++++++++++++++++++- .../mybatis/mapper/sup/UserCertMapper.xml | 2 +- 7 files changed, 71 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 6e74f50..b7e3acc 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -79,19 +79,19 @@ public class SupCertController { @Resource private SystemPDFModuleService systemPDFModuleService; -// @GetMapping("/sup/company/cert/filterList") -// public BaseResponse filterCompanyCert(certRequest certRequest, BindingResult bindingResult) { -// if (bindingResult.hasErrors()) { -// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); -// } -// List userCertEntities = supCertService.selectBybId(certRequest); -// PageInfo pageInfo; -// pageInfo = new PageInfo<>(userCertEntities); -// PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); -// pageSimpleResponse.setTotal(pageInfo.getTotal()); -// pageSimpleResponse.setList(userCertEntities); -// return ResultVOUtils.success(pageSimpleResponse); -// } + @GetMapping("/sup/company/cert/filterList") + public BaseResponse filterCompanyCert(certRequest certRequest, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List supCertEntities = supCertService.selectBybId(certRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(supCertEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(supCertEntities); + return ResultVOUtils.success(pageSimpleResponse); + } @AuthRuleAnnotation("") diff --git a/src/main/java/com/glxp/api/controller/sup/UserRegisterController.java b/src/main/java/com/glxp/api/controller/sup/UserRegisterController.java index b5c760a..b73abaf 100644 --- a/src/main/java/com/glxp/api/controller/sup/UserRegisterController.java +++ b/src/main/java/com/glxp/api/controller/sup/UserRegisterController.java @@ -311,19 +311,20 @@ public class UserRegisterController extends BaseController { userCheckEntity.setResultExplain(registComPerResponse.getReason()); } userCheckEntity.setCreateTime(new Date()); - + UserCompanyEntity company = userCompanyService.getById(registComPerResponse.getUcId()); userRegisterEntity.setId(Long.valueOf(registComPerResponse.getId())); userRegisterEntity.setCheckStatus(registComPerResponse.getCheckStatus()); userCompanyEntity.setId(Long.valueOf(registComPerResponse.getUcId())); userCompanyEntity.setCustomerId(registComPerResponse.getUcId()); userCompanyEntity.setCheckStatus(registComPerResponse.getCheckStatus()); userCompanyEntity.setReason(registComPerResponse.getReason()); + userCompanyEntity.setAuditStatus(Integer.valueOf(company.getCheckStatus())); String queueName = "fanout_" + userCompanyEntity.getId() + ""; rabbitQueueService.createQueue(queueName); userRegisterService.updateById(userRegisterEntity); userCompanyService.updateById(userCompanyEntity); userCheckService.insert(userCheckEntity); - UserCompanyEntity company = userCompanyService.getById(registComPerResponse.getUcId()); + supCompanyEntity.setCustomerId(String.valueOf(company.getId())); supCompanyEntity.setCompanyName(company.getCompanyName()); supCompanyEntity.setAuditStatus(Integer.valueOf(userCompanyEntity.getCheckStatus())); 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 8889bcc..987457a 100644 --- a/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java +++ b/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java @@ -4,7 +4,9 @@ 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.entity.sup.UserCertEntity; import com.glxp.api.req.purchase.FilterSupCertRequest; +import com.glxp.api.req.purchase.certRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -13,7 +15,7 @@ import java.util.List; @Mapper public interface SupCertDao extends BaseMapperPlus { - + List filterCert(certRequest certRequest); List filterCompanyCert(FilterSupCertRequest filterSupCertRequest); List filterUserCompanyCert(FilterSupCertRequest filterSupCertRequest); 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 1ef15c1..96a28cd 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCertService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCertService.java @@ -5,13 +5,15 @@ package com.glxp.api.service.purchase; import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.entity.sup.UserCertEntity; import com.glxp.api.req.purchase.FilterSupCertRequest; +import com.glxp.api.req.purchase.certRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; import java.util.List; public interface SupCertService extends IService { - + List selectBybId(certRequest certRequest); List filterCompanyCert(FilterSupCertRequest filterSupCertRequest); List filterUserCompanyCert(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 d560281..1fd1113 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 @@ -6,7 +6,9 @@ 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.entity.sup.UserCertEntity; import com.glxp.api.req.purchase.FilterSupCertRequest; +import com.glxp.api.req.purchase.certRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; import com.glxp.api.service.purchase.SupCertService; import org.springframework.stereotype.Service; @@ -22,7 +24,18 @@ public class SupCertServiceImpl extends ServiceImpl i @Resource SupCertDao supCertDao; + @Override + public List selectBybId(certRequest certRequest) { + if (certRequest == null) { + return Collections.emptyList(); + } + if (certRequest.getPage() != null) { + int offset = (certRequest.getPage() - 1) * certRequest.getLimit(); + PageHelper.offsetPage(offset, certRequest.getLimit()); + } + return supCertDao.filterCert(certRequest); + } @Override public List filterCompanyCert(FilterSupCertRequest filterSupCertRequest) { if (filterSupCertRequest == null) { diff --git a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml index e24ddc8..8b4f77c 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml @@ -2,10 +2,44 @@ +