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 9a1cb40..6e74f50 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -16,6 +16,7 @@ import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.purchase.*; import com.glxp.api.entity.sup.UserCertEntity; import com.glxp.api.entity.sup.UserCertSetEntity; +import com.glxp.api.entity.sup.UserCompanyEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.exception.JsonException; @@ -189,9 +190,11 @@ public class SupCertController { @PostMapping("/directToCpt/sup/info/selectAllCert") @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse selectAllCert(@RequestBody PostSelCertRequest postSelCertRequest) { + String customerId = null; + if (StrUtil.isEmpty(postSelCertRequest.getCustomerId())) - customerId = getCustomerId(); + customerId = getCompanyId(); else { customerId = postSelCertRequest.getCustomerId(); } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java index bb90e0c..695a227 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java @@ -17,6 +17,7 @@ import com.glxp.api.entity.purchase.SupCertEntity; import com.glxp.api.entity.purchase.SupCertSetEntity; import com.glxp.api.entity.purchase.SupCompanyEntity; import com.glxp.api.entity.purchase.SupManufacturerEntity; +import com.glxp.api.entity.sup.UserCompanyEntity; import com.glxp.api.exception.JsonException; import com.glxp.api.req.basic.FilterUdiRelRequest; import com.glxp.api.req.purchase.FilterCertSetsRequest; @@ -256,6 +257,8 @@ public class SupManufacturerController { if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { //判断是否上级供应商是否审核通过 SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId()); + System.out.println(supCompanyEntity.toString()); + System.out.println(supCompanyEntity.getAuditStatus()+"zhi"); if (supCompanyEntity.getAuditStatus() == null || supCompanyEntity.getAuditStatus() != ConstantStatus.AUDIT_PASS ) { return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!"); @@ -653,7 +656,6 @@ public class SupManufacturerController { // AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId)); // return authAdmin.getCustomerId() + ""; // } - public String getCustomerId() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) { @@ -664,13 +666,14 @@ public class SupManufacturerController { return companyId; } -// public String getCompanyId() { -// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); -// if (attributes == null) { -// throw new JsonException(ResultEnum.NOT_NETWORK); -// } -// HttpServletRequest request = attributes.getRequest(); -// String companyId = request.getHeader("companyId"); -// return companyId; -// } + public String getCompanyId() { + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + if (attributes == null) { + throw new JsonException(ResultEnum.NOT_NETWORK); + } + HttpServletRequest request = attributes.getRequest(); + String companyId = request.getHeader("companyId"); + return companyId; + } + } diff --git a/src/main/java/com/glxp/api/dao/purchase/SupCompanyDao.java b/src/main/java/com/glxp/api/dao/purchase/SupCompanyDao.java index 3ae496a..a5ae0a1 100644 --- a/src/main/java/com/glxp/api/dao/purchase/SupCompanyDao.java +++ b/src/main/java/com/glxp/api/dao/purchase/SupCompanyDao.java @@ -2,6 +2,7 @@ package com.glxp.api.dao.purchase; import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.purchase.SupCertEntity; import com.glxp.api.entity.purchase.SupCompanyEntity; import com.glxp.api.entity.sup.UserCompanyEntity; @@ -26,7 +27,7 @@ public interface SupCompanyDao extends BaseMapperPlus filterCompany(FilterSupCompanyRequest companyRequest); List filterUserCompany(FilterUserCompanyRequest companyRequest); - + UserCompanyEntity findById(Long id); boolean modifyCompany(SupCompanyEntity companyEntity); boolean insertCompany(SupCompanyEntity companyEntity); diff --git a/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java b/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java index cca04f4..7111c60 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCompanyService.java @@ -3,6 +3,7 @@ package com.glxp.api.service.purchase; import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.purchase.SupCompanyEntity; import com.glxp.api.entity.sup.UserCompanyEntity; import com.glxp.api.req.purchase.FilterSupCompanyRequest; @@ -11,9 +12,21 @@ import com.glxp.api.req.purchase.FilterUserCompanyRequest; import java.util.List; public interface SupCompanyService extends IService { - + UserCompanyEntity findByid(Long id); // SupCompanyEntity findCompanyByUnitFk(String unitFk); + // @Override +// public SupCompanyEntity findCompanyByUnitFk(String unitFk) { +// FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest(); +// filterSupCompanyRequest.setUnitIdFk(unitFk); +// List companyEntities = supCompanyDao.filterCompany(filterSupCompanyRequest); +// if (companyEntities != null && companyEntities.size() > 0) { +// return companyEntities.get(0); +// } +// return null; +// } + + List filterUserCompany(FilterUserCompanyRequest companyRequest); List filterCompany(FilterSupCompanyRequest companyRequest); diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java index 559e334..a4c7167 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupCompanyServiceImpl.java @@ -22,6 +22,15 @@ public class SupCompanyServiceImpl extends ServiceImpl filterUserCompany(FilterUserCompanyRequest companyRequest) { if (companyRequest == null) { diff --git a/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml index 4cd0595..5d1146c 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCompanyDao.xml @@ -57,6 +57,15 @@ + +