Commit c9ddd67b authored by tianyiming's avatar tianyiming

单位注册校验修改

parent 2f8e3a67
......@@ -32,7 +32,7 @@ public interface IRegUnitInfoService {
* @param unitType 单位类型
* @return RegUnitInfoDto
*/
RegUnitInfoDto unitCheck(String unitCode, String unitType, String companyName);
RegUnitInfoDto unitCheck(String unitCode, String unitType, String companyName,String registerType, String cardType);
/**
* 单位类型列表字典
......
......@@ -115,12 +115,14 @@ public class RegUnitInfoController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "单位注册校验", notes = "单位注册校验")
public ResponseModel<RegUnitInfoDto> unitCheck(@PathVariable String unitCode,
@RequestParam String unitType,
@RequestParam String registerType,
@RequestParam(required = false) String cardType,
@RequestParam(required = false) String companyName) {
if (ValidationUtil.isEmpty(unitCode)) {
throw new BadRequest("单位编码不能为空");
throw new BadRequest("注册编码不能为空");
}
try {
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.unitCheck(unitCode, unitType, companyName);
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.unitCheck(unitCode, unitType, companyName,registerType,cardType);
return ResponseHelper.buildResponse(regUnitInfoDto);
} catch (Exception e) {
ResponseModel<RegUnitInfoDto> response = new ResponseModel<>();
......
......@@ -347,21 +347,20 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
@Override
public RegUnitInfoDto unitCheck(String unitCode, String unitType,String companyName) {
public RegUnitInfoDto unitCheck(String unitCode, String unitType,String companyName,String registerType, String cardType) {
RegUnitInfoDto regUnitInfoDto = new RegUnitInfoDto();
startPlatformTokenService.getToken();
if (!ValidationUtil.isEmpty(companyName)) {
FeignClientResult<CompanyModel> result =Privilege.companyClient.queryByCompanyName(companyName);
if(result.getResult()!=null)
{
throw new BadRequest("重复的公司名称");
}
}
// if (!ValidationUtil.isEmpty(companyName)) {
// FeignClientResult<CompanyModel> result = Privilege.companyClient.queryByCompanyName(companyName);
// if (result.getResult() != null) {
// throw new BadRequest("重复的公司名称");
// }
// }
if (!ValidationUtil.isEmpty(unitCode)) {
FeignClientResult<CompanyModel> result =Privilege.companyClient.queryByCompanyCode(unitCode);
if(result.getResult()!=null)
{
throw new BadRequest("重复的公司编码");
unitCode = ObjectUtils.isEmpty(cardType) ? unitCode : cardType + "_" + unitCode;
FeignClientResult<CompanyModel> result = Privilege.companyClient.queryByCompanyCode(unitCode);
if (result.getResult() != null) {
throw new BadRequest("重复的注册编码");
}
}
// 1.校验重复性
......@@ -371,6 +370,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// throw new RuntimeException("该单位已注册,请联系企业管理员!");
// }
// 2.组织返回数据
if(ObjectUtils.isEmpty(registerType)){
//2.1 工商信息查询
Map<String, Object> resultMap = accessFeignService.getData(unitCode).getResult();
if (resultMap == null){
......@@ -431,6 +431,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
} else {
regUnitInfoDto.setRegUnitIc(new RegUnitIcDto());
}
}
// 2.3 许可信息组装
List<BaseUnitLicence> unitLicences = baseUnitLicenceService
......
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