注册审核

cert
schry 2 years ago
parent fb990da67f
commit 567c8cf994

@ -96,7 +96,7 @@ public class SupManufacturerController {
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/sup/manufacturer/getCompanyList")
public BaseResponse getCompanyList(FilterSupManufacturerRequest filterSupManufacturerRequest) {
public BaseResponse directToCptGetCompanyList(FilterSupManufacturerRequest filterSupManufacturerRequest) {
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
PageInfo<SupManufacturerEntity> pageInfo = new PageInfo<>(companyEntities);
PageSimpleResponse<SupManufacturerEntity> pageSimpleResponse = new PageSimpleResponse<>();
@ -105,6 +105,17 @@ public class SupManufacturerController {
return ResultVOUtils.success(pageSimpleResponse);
}
// @AuthRuleAnnotation("")
// @GetMapping("/sup/manufacturer/getCompanyList")
// public BaseResponse getCompanyList(FilterSupManufacturerRequest filterSupManufacturerRequest) {
// List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompany(filterSupManufacturerRequest);
// PageInfo<SupManufacturerEntity> pageInfo = new PageInfo<>(companyEntities);
// PageSimpleResponse<SupManufacturerEntity> pageSimpleResponse = new PageSimpleResponse<>();
// pageSimpleResponse.setTotal(pageInfo.getTotal());
// pageSimpleResponse.setList(companyEntities);
// return ResultVOUtils.success(pageSimpleResponse);
// }
@AuthRuleAnnotation("")
@GetMapping("/directToCpt/sup/manufacturer/getCompanyBySup")
public BaseResponse getCompanyBySup(FilterSupManufacturerRequest filterSupManufacturerRequest) {
@ -221,8 +232,8 @@ public class SupManufacturerController {
@Log(title = "资质证书", businessType = BusinessType.INSERT)
public BaseResponse directToCptAddCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) {
//String customerId = getCustomerId();
//supManufacturerEntity.setCustomerId(customerId);
String customerId = getCustomerId();
supManufacturerEntity.setCustomerId(customerId);
//判断用户名和社会信用代码不能重复
FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest();
filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName());
@ -419,6 +430,111 @@ public class SupManufacturerController {
}
}
@AuthRuleAnnotation("")
@PostMapping("/directToCpt/sup/manufacturer/modifyCompany")
@Log(title = "资质证书", businessType = BusinessType.UPDATE)
public BaseResponse directToCptModifyCompany(@RequestBody SupManufacturerEntity supManufacturerEntity) {
if (StrUtil.isEmpty(supManufacturerEntity.getManufacturerId()) || StrUtil.isEmpty(supManufacturerEntity.getCustomerId())) {
return ResultVOUtils.error(500, "参数错误!");
}
if (supManufacturerEntity.getId() == 0) {//新增
//判断用户名和社会信用代码不能重复
FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest();
filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName());
filterSupManufacturerRequest.setCustomerId(getCustomerId());
List<SupManufacturerEntity> companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
if (companyEntities.size() > 0) {
return ResultVOUtils.error(999, "企业名称不能重复!");
}
filterSupManufacturerRequest = new FilterSupManufacturerRequest();
filterSupManufacturerRequest.setCustomerId(getCustomerId());
filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode());
companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
if (companyEntities.size() > 0) {
return ResultVOUtils.error(999, "统一社会信用代码不能重复!");
}
}
//提交审核
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
//判断是否上级供应商是否审核通过
SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId());
if (supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_UN || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_REJECT
|| supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT || supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_REJECT) {
return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!");
}
//验证证书是否齐全
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_MANUFACTURER);
filterCertSetsRequest.setNeed(0);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId());
//判断存在有草稿的未提交的就不能通过
for (SupCertEntity obj : supCertEntityList) {
if (obj.getAuditStatus() == 0.) {
return ResultVOUtils.error(999, "资质证书存在草稿不能提交!");
}
}
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
while (iterable.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable.next();
if ((supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
(
supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
(supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 1
&& supManufacturerEntity.getCompanyType().equals("1"))
||
(supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 3
&& supManufacturerEntity.getCompanyType().equals("1"))) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable.remove();
break;
}
}
}
} else {
iterable.remove();
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
errMsg = errMsg + "," + supCertSetEntity.getName();
}
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
}
}
supManufacturerEntity.setUpdateTime(new Date());
SupManufacturerEntity originEntity = supManufacturerService.findManufacturer(supManufacturerEntity.getManufacturerId());
boolean b = supManufacturerService.modifyCompany(supManufacturerEntity);
//修改证书对应的供应商ID生产企业ID
supCertService.updateManufacturerId(originEntity.getCustomerId(), supManufacturerEntity.getCustomerId(), originEntity.getManufacturerId(), supManufacturerEntity.getManufacturerId());
if (b) {
return ResultVOUtils.success("修改成功");
} else {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/sup/manufacturer/audit")

@ -13,6 +13,7 @@ import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.SM2;
import cn.hutool.crypto.symmetric.AES;
import com.github.pagehelper.PageInfo;
import com.glxp.api.entity.purchase.SupCompanyEntity;
import com.glxp.api.entity.sup.*;
import com.glxp.api.req.auth.MobileCaptchaRequest;
import com.glxp.api.req.auth.UserRegisterFilterRequest;
@ -21,6 +22,7 @@ import com.glxp.api.req.purchase.certRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.registComPerResponse;
import com.glxp.api.service.purchase.IEmailService;
import com.glxp.api.service.purchase.SupCompanyService;
import com.glxp.api.service.sup.*;
import com.glxp.api.service.trace.RabbitPushService;
import com.glxp.api.service.trace.RabbitQueueService;
@ -69,9 +71,10 @@ public class UserRegisterController extends BaseController {
private UserCheckService userCheckService;
@Resource
private UserCertSetService userCertSetService;
@Resource
private IEmailService iEmailService;
@Resource
private SupCompanyService supCompanyService;
@ApiOperation(value = "获取校验码", response = loginmobileRequest.class)
@PostMapping("/admin/auth/register/getCheckcode")
@ -159,6 +162,7 @@ public class UserRegisterController extends BaseController {
UserCompanyEntity userCompanyEntity = new UserCompanyEntity();
// UserPersonEntity userPersonEntity = new UserPersonEntity();
userCompanyEntity.setId(IdUtil.getSnowflakeNextId());
userCompanyEntity.setCheckStatus(0 + "");
userCompanyEntity.setRegisterTime(new Date());
@ -257,6 +261,7 @@ public class UserRegisterController extends BaseController {
UserRegisterEntity userRegisterEntity = new UserRegisterEntity();
UserCompanyEntity userCompanyEntity = new UserCompanyEntity();
UserCheckEntity userCheckEntity = new UserCheckEntity();
SupCompanyEntity supCompanyEntity = new SupCompanyEntity();
// UserCertSetEntity userCertSetEntity = new UserCertSetEntity();
if ("isPass".equals(registComPerResponse.getIsPass())) {
//审核通过
@ -317,6 +322,15 @@ public class UserRegisterController extends BaseController {
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()));
supCompanyEntity.setCreditNum(company.getCreditNum());
supCompanyEntity.setBussinessStatus(Integer.valueOf(company.getBussinessStatus()));
supCompanyEntity.setCreateTime(company.getRegisterTime());
supCompanyEntity.setAuditStatus(Integer.valueOf(company.getCheckStatus()));
supCompanyService.insertCompany(supCompanyEntity);
// userCertSetService.insert(userCertSetEntity);
return ResultVOUtils.success();
}

@ -10,7 +10,7 @@ import java.util.Date;
/**
* <p>
*
*
* </p>
*
* @author

@ -32,4 +32,6 @@ public interface SupCompanyService extends IService<SupCompanyEntity> {
boolean insertCompany(SupCompanyEntity companyEntity);
boolean deleteCompany(String customerId);
boolean update(SupCompanyEntity supCompanyEntity);
}

@ -157,4 +157,9 @@ public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
public boolean deleteCompany(String customerId) {
return supCompanyDao.deleteCompany(customerId);
}
@Override
public boolean update(SupCompanyEntity supCompanyEntity) {
return supCompanyDao.updateById(supCompanyEntity)>0;
}
}

@ -70,6 +70,55 @@
</where>
</select>
<select id="getCompany2" parameterType="com.glxp.api.req.purchase.FilterSupManufacturerRequest"
resultType="com.glxp.api.entity.purchase.SupManufacturerEntity">
SELECT sup_manufacturer.* ,user_company.companyName as supName
FROM sup_manufacturer
left join user_company on sup_manufacturer.customerId = user_company.id
<where>
<if test="id != null and id != '' and type==null">
and id = #{id}
</if>
<if test="manufacturerId != null and manufacturerId != ''">
and manufacturerId = #{manufacturerId}
</if>
<if test="companyName != null and companyName != ''">
and sup_manufacturer.companyName like concat('%',#{companyName},'%')
</if>
<if test="creditCode != null and creditCode != ''">
and creditCode like concat('%',#{creditCode},'%')
</if>
<if test="placeArea != null and placeArea != ''">
and placeArea like concat('%',#{placeArea},'%')
</if>
<if test="customerId != null and customerId != ''">
and sup_manufacturer.customerId = #{customerId}
</if>
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=21 and auditStatus !=22">
and sup_manufacturer.auditStatus = #{auditStatus}
</if>
<if test="auditStatus ==20">
and (sup_manufacturer.auditStatus = 0 or sup_manufacturer.auditStatus=5 or
sup_manufacturer.auditStatus=2)
</if>
<if test="auditStatus ==21">
and <![CDATA[ sup_manufacturer.auditStatus <> 0 ]]>
</if>
<if test="auditStatus ==22">
and (sup_manufacturer.auditStatus = 1 or sup_manufacturer.auditStatus=4 )
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(sup_manufacturer.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="type != null">
and id != #{id}
</if>
</where>
</select>
<update id="modifyCompany" parameterType="com.glxp.api.entity.purchase.SupManufacturerEntity">
UPDATE sup_manufacturer
@ -158,4 +207,4 @@
</where>
</select>
</mapper>
</mapper>

Loading…
Cancel
Save