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 1bcfe52..9676de8 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -93,7 +93,19 @@ public class SupCertController { pageSimpleResponse.setList(userCertEntities); return ResultVOUtils.success(pageSimpleResponse); } - + @GetMapping("sup/company/cert/filterZcList") + public BaseResponse filterZcCert(certRequest certRequest , BindingResult bindingResult){ + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List userCertEntities = userCertService.selectByzcId(certRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(userCertEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(userCertEntities); + return ResultVOUtils.success(pageSimpleResponse); + } @AuthRuleAnnotation("") @GetMapping("/sup/company/cert/filter") public BaseResponse filterUserCompanyCert(FilterSupCertRequest filterSupCertRequest, 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 1a880f4..8889bcc 100644 --- a/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java +++ b/src/main/java/com/glxp/api/dao/purchase/SupCertDao.java @@ -16,7 +16,7 @@ public interface SupCertDao extends BaseMapperPlus filterCompanyCert(FilterSupCertRequest filterSupCertRequest); - + List filterUserCompanyCert(FilterSupCertRequest filterSupCertRequest); SupCertEntity findCompanyCertByName(String name); List getCompanyCert(FilterSupCertRequest filterSupCertRequest); diff --git a/src/main/java/com/glxp/api/dao/sup/UserCertMapper.java b/src/main/java/com/glxp/api/dao/sup/UserCertMapper.java index 6c2af4a..8bc97d6 100644 --- a/src/main/java/com/glxp/api/dao/sup/UserCertMapper.java +++ b/src/main/java/com/glxp/api/dao/sup/UserCertMapper.java @@ -16,4 +16,5 @@ public interface UserCertMapper extends BaseMapper { List selectByRegisterId(@Param("registerId") String registerId); List filterCompanyCert(certRequest certRequest); + List filterZcCert(certRequest certRequest); } diff --git a/src/main/java/com/glxp/api/req/purchase/FilterSupCertRequest.java b/src/main/java/com/glxp/api/req/purchase/FilterSupCertRequest.java index f4d3a28..db5758a 100644 --- a/src/main/java/com/glxp/api/req/purchase/FilterSupCertRequest.java +++ b/src/main/java/com/glxp/api/req/purchase/FilterSupCertRequest.java @@ -8,6 +8,7 @@ import lombok.Data; public class FilterSupCertRequest extends ListPageRequest { private String code; + private String businessId; private String customerId; private String name; private String manufacturerIdFk; 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 ec2c80c..1ef15c1 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCertService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCertService.java @@ -13,6 +13,7 @@ import java.util.List; public interface SupCertService extends IService { List filterCompanyCert(FilterSupCertRequest filterSupCertRequest); + List filterUserCompanyCert(FilterSupCertRequest filterSupCertRequest); SupCertEntity findCompanyCertByName(String name); 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 c695186..d560281 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 @@ -34,6 +34,18 @@ public class SupCertServiceImpl extends ServiceImpl i } return supCertDao.filterCompanyCert(filterSupCertRequest); } + @Override + public List filterUserCompanyCert(FilterSupCertRequest filterSupCertRequest) { + if (filterSupCertRequest == null) { + return Collections.emptyList(); + } + if (filterSupCertRequest.getPage() != null) { + int offset = (filterSupCertRequest.getPage() - 1) * filterSupCertRequest.getLimit(); + PageHelper.offsetPage(offset, filterSupCertRequest.getLimit()); + } + return supCertDao.filterUserCompanyCert(filterSupCertRequest); + } + @Override public List selectCompanyCert(FilterSupCertRequest filterSupCertRequest) { diff --git a/src/main/java/com/glxp/api/service/sup/UserCertService.java b/src/main/java/com/glxp/api/service/sup/UserCertService.java index 628ec48..bfc0048 100644 --- a/src/main/java/com/glxp/api/service/sup/UserCertService.java +++ b/src/main/java/com/glxp/api/service/sup/UserCertService.java @@ -11,6 +11,7 @@ public interface UserCertService extends IService{ List selectByRegisterId(String registerId); List selectBybId(certRequest certRequest); + List selectByzcId(certRequest certRequest); boolean insertCert(UserCertEntity userCert); diff --git a/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java b/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java index b3afe25..13d6193 100644 --- a/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java +++ b/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java @@ -24,6 +24,18 @@ public class UserCertServiceImpl extends ServiceImpl selectByzcId(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 userCertDao.filterZcCert(certRequest); + } @Override public List selectBybId(certRequest certRequest) { diff --git a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml index 3c09c06..66084aa 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml @@ -36,6 +36,18 @@ ORDER BY id DESC + + SELECT * - FROM sup_company + FROM user_company where customerId = #{CustomerId} @@ -164,7 +164,7 @@ - UPDATE sup_company + UPDATE user_company companyName=#{companyName}, bussinessStatus=#{bussinessStatus}, diff --git a/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml b/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml index 5fbcfd1..dfc865a 100644 --- a/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml +++ b/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml @@ -63,4 +63,16 @@ ORDER BY id DESC + +