|
@@ -76,6 +76,14 @@ public class MtCompanyAttestationServiceImpl extends ServiceImpl<MtCompanyAttest
|
|
|
@Transactional
|
|
|
public RestResponse applyAudit(CompanyAttestationRequest companyAttestationRequest) {
|
|
|
UserInfo userInfo = userInfoService.getByUserId(companyAttestationRequest.getUserId());
|
|
|
+ MaintenanceCompany maintenanceCompany = maintenanceCompanyService.getById(companyAttestationRequest.getMtCompanyId());
|
|
|
+ if (maintenanceCompany == null) {
|
|
|
+ return RestResponse.fail(ApiConstants.RESULT_ERROR, "团队不存在不能发起认证");
|
|
|
+ }
|
|
|
+ //判断发起认证的人是否是团队创建者
|
|
|
+ if (!companyAttestationRequest.getUserId().equals(maintenanceCompany.getCreatorId())) {
|
|
|
+ return RestResponse.fail(ApiConstants.RESULT_ERROR, "当前用户不是团队管理者无法发起认证");
|
|
|
+ }
|
|
|
MtCompanyAttestation mtCompanyAttestation = new MtCompanyAttestation(companyAttestationRequest);
|
|
|
if (mtCompanyAttestation.getId() != null) {
|
|
|
//如果用户是重新认证,获取认证对象
|
|
@@ -96,12 +104,7 @@ public class MtCompanyAttestationServiceImpl extends ServiceImpl<MtCompanyAttest
|
|
|
mtCompanyAttestation.setCreateUser(userInfo.getName());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- //获取公司信息,将公司信息设置为审核中状态
|
|
|
- MaintenanceCompany maintenanceCompany = maintenanceCompanyService.getById(companyAttestationRequest.getMtCompanyId());
|
|
|
- if (maintenanceCompany == null) {
|
|
|
- return RestResponse.fail(ApiConstants.RESULT_ERROR, "团队不存在不能发起认证");
|
|
|
- }
|
|
|
+ //将公司信息设置为审核中状态
|
|
|
maintenanceCompany.setIsCertificated(ApiConstants.CompanyConstants.MAINTENANCE_WAIT_CERTIFICATE);
|
|
|
//设置公司审核信息为审核中
|
|
|
mtCompanyAttestation.setIsCertificated(ApiConstants.CompanyConstants.MAINTENANCE_WAIT_CERTIFICATE);
|