Commit 1b2003ac authored by suhuiguang's avatar suhuiguang

1.企业、事业注册增加信用代码唯一性检验

parent 3e736972
......@@ -25,14 +25,6 @@ public interface IRegUnitInfoService {
*/
RegUnitInfoDto registerUnit(RegUnitInfoDto model);
/**
* 单位校验
* @param unitCode 单位唯一编号
* @return RegUnitInfoDto
*/
RegUnitInfoDto unitCheck(String unitCode, String companyName,String registerType, String cardType);
/**
* 单位类型列表字典
* @return List<DataDictionary>
......@@ -84,4 +76,28 @@ public interface IRegUnitInfoService {
List<DataDictionary> getDictionaryListByType(String type) throws Exception;
List<DataDictionary> getXkItemList(String type);
/**
* 企业类型单位注册检验
* @param unitCode 单位code
* @param isNationwide 是否省外
* @return RegUnitInfoDto
*/
RegUnitInfoDto regBeforeCheckForEnterprises(String unitCode, Boolean isNationwide);
/**
* 事业单位类型注册检验
* @param unitCode 单位code
* @param isNationwide 是否省外
* @return RegUnitInfoDto
*/
RegUnitInfoDto regBeforeCheckForCause(String unitCode, Boolean isNationwide);
/**
* 个人类型注册检验
* @param unitCode 单位code
* @param cardType 证件类型
* @return RegUnitInfoDto
*/
RegUnitInfoDto regBeforeCheckForPerson(String unitCode, String cardType);
}
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -110,18 +111,40 @@ public class RegUnitInfoController extends BaseController {
return ResponseHelper.buildResponse(iRegUnitInfoService.adminInfo(unitCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/enterprises/{unitCode}/check")
@ApiOperation(httpMethod = "GET", value = "企业单位注册校验", notes = "企业单位注册校验")
public ResponseModel<RegUnitInfoDto> regBeforeCheckForEnterprises(@PathVariable String unitCode,
@ApiParam(value = "是否省外") @RequestParam Boolean isNationwide) {
if (ValidationUtil.isEmpty(unitCode)) {
throw new BadRequest("注册编码不能为空");
}
try {
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.regBeforeCheckForEnterprises(unitCode, isNationwide);
return ResponseHelper.buildResponse(regUnitInfoDto);
} catch (Exception e) {
ResponseModel<RegUnitInfoDto> response = new ResponseModel<>();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
response.setResult(null);
response.setDevMessage(e.getMessage());
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setTraceId(RequestContext.getTraceId());
response.setPath(request.getServletPath());
return response;
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/{unitCode}/check")
@ApiOperation(httpMethod = "GET", value = "单位注册校验", notes = "单位注册校验")
public ResponseModel<RegUnitInfoDto> unitCheck(@PathVariable String unitCode,
@RequestParam(required = false) String registerType,
@RequestParam(required = false) String cardType,
@RequestParam(required = false) String companyName) {
@GetMapping(value = "/cause/{unitCode}/check")
@ApiOperation(httpMethod = "GET", value = "事业单位注册校验", notes = "事业单位注册校验")
public ResponseModel<RegUnitInfoDto> regBeforeCheckForCause(@PathVariable String unitCode,
@ApiParam(value = "是否省外") @RequestParam Boolean isNationwide) {
if (ValidationUtil.isEmpty(unitCode)) {
throw new BadRequest("注册编码不能为空");
}
try {
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.unitCheck(unitCode, companyName,registerType,cardType);
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.regBeforeCheckForCause(unitCode, isNationwide);
return ResponseHelper.buildResponse(regUnitInfoDto);
} catch (Exception e) {
ResponseModel<RegUnitInfoDto> response = new ResponseModel<>();
......@@ -136,6 +159,30 @@ public class RegUnitInfoController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/person/{unitCode}/check")
@ApiOperation(httpMethod = "GET", value = "个人注册校验", notes = "个人注册校验")
public ResponseModel<RegUnitInfoDto> regBeforeCheckForPerson(@PathVariable String unitCode,
@RequestParam(required = false) String cardType) {
if (ValidationUtil.isEmpty(unitCode)) {
throw new BadRequest("注册编码不能为空");
}
try {
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.regBeforeCheckForPerson(unitCode, cardType);
return ResponseHelper.buildResponse(regUnitInfoDto);
} catch (Exception e) {
ResponseModel<RegUnitInfoDto> response = new ResponseModel<>();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
response.setResult(null);
response.setDevMessage(e.getMessage());
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setTraceId(RequestContext.getTraceId());
response.setPath(request.getServletPath());
return response;
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/unit-type/list")
@ApiOperation(httpMethod = "GET", value = "单位类型列表", notes = "单位类型列表")
public ResponseModel<List<DataDictionary>> unitTypeList() {
......
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