Commit 07d3b589 by guojuxing

联合商户授权校验联合商户服务状态

parent d1efc2d5
......@@ -129,6 +129,14 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
@Override
@Transactional(rollbackFor = Exception.class)
public ServiceResponse<Void> authResource(@Validated UnionEnterpriseAuthResDTO dto) {
TabEnterprise tabEnterprise = enterpriseService.getEnterpriseById(dto.getUnionEnterpriseId());
if (tabEnterprise.getServiceStatus() == 0) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "联合商户无服务");
}
if (tabEnterprise.getServiceStatus() == 2) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "联合商户已停用");
}
TabSysUnionEnterpriseAuth old = checkExistUnionEnterprise(dto.getOwnEnterpriseId(), dto.getUnionEnterpriseId());
//授权数据
UnionEnterpriseAuthDTO data = EntityUtil.changeEntityNew(UnionEnterpriseAuthDTO.class, dto);
......@@ -161,8 +169,6 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
//
checkResourceDealing((old.getUnionEnterpriseAuthId()));
TabEnterprise tabEnterprise = enterpriseService.getEnterpriseById(dto.getUnionEnterpriseId());
saveRefer(old.getUnionEnterpriseAuthId(), tabEnterprise.getEnterpriseName(), resourceGroupId);
unionEnterpriseAuthService.update(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment