Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java
cert
schry 2 years ago
commit ba4f269e7c

@ -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();
}

@ -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;
}
}

@ -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<SupCompanyDao, SupCompanyE
List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest);
List<UserCompanyEntity> filterUserCompany(FilterUserCompanyRequest companyRequest);
UserCompanyEntity findById(Long id);
boolean modifyCompany(SupCompanyEntity companyEntity);
boolean insertCompany(SupCompanyEntity companyEntity);

@ -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<SupCompanyEntity> {
UserCompanyEntity findByid(Long id);
// SupCompanyEntity findCompanyByUnitFk(String unitFk);
// @Override
// public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
// FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest();
// filterSupCompanyRequest.setUnitIdFk(unitFk);
// List<SupCompanyEntity> companyEntities = supCompanyDao.filterCompany(filterSupCompanyRequest);
// if (companyEntities != null && companyEntities.size() > 0) {
// return companyEntities.get(0);
// }
// return null;
// }
List<UserCompanyEntity> filterUserCompany(FilterUserCompanyRequest companyRequest);
List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest);

@ -22,6 +22,15 @@ public class SupCompanyServiceImpl extends ServiceImpl<SupCompanyDao, SupCompany
@Resource
SupCompanyDao supCompanyDao;
@Override
public UserCompanyEntity findByid(Long id) {
return supCompanyDao.findById(id);
}
// @Override
// public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
// FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest();
@ -32,6 +41,8 @@ public class SupCompanyServiceImpl extends ServiceImpl<SupCompanyDao, SupCompany
// }
// return null;
// }
@Override
public List<UserCompanyEntity> filterUserCompany(FilterUserCompanyRequest companyRequest) {
if (companyRequest == null) {

@ -57,6 +57,15 @@
</if>
</where>
</select>
<select id="findById" parameterType="hashmap" resultType="com.glxp.api.entity.sup.UserCompanyEntity">
SELECT *
FROM user_company
<where>
id = #{id}
</where>
LIMIT 1
</select>
<select id="filterUserCompany" parameterType="com.glxp.api.req.purchase.FilterUserCompanyRequest"
resultType="com.glxp.api.entity.sup.UserCompanyEntity">
SELECT

@ -33,7 +33,7 @@
</select>
<select id="filterCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.sup.UserCertEntity">
select * from user_cert
select * from sup_cert
<where>
<if test="businessId != '' and businessId!=null">
and businessId = #{businessId}

Loading…
Cancel
Save