Commit c9ddd67b authored by tianyiming's avatar tianyiming

单位注册校验修改

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