代码完善

cert
1178634255 2 years ago
parent ceee3e35d2
commit 2fcae8d05f

@ -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;
@ -236,6 +237,7 @@ public class SupManufacturerController {
public BaseResponse directToCptAddCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) {
String customerId = getCustomerId();
// String customerId = getCustomerId();
supManufacturerEntity.setCustomerId(customerId);
//判断用户名和社会信用代码不能重复
FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest();
@ -256,6 +258,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, "所属配送企业资质未通过审核,暂时无法提交!");
@ -643,15 +647,24 @@ public class SupManufacturerController {
}
// public String getCustomerId() {
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
// if (attributes == null) {
// throw new JsonException(ResultEnum.NOT_NETWORK);
// }
// HttpServletRequest request = attributes.getRequest();
// String userId = request.getHeader("ADMIN_ID");
// AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
// return authAdmin.getCustomerId() + "";
// }
public String getCustomerId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String userId = request.getHeader("ADMIN_ID");
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
return authAdmin.getCustomerId() + "";
String companyId = request.getHeader("companyId");
return companyId;
}
public String getCompanyId() {
@ -663,4 +676,5 @@ public class SupManufacturerController {
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