Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
1b2003ac
Commit
1b2003ac
authored
Oct 22, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.企业、事业注册增加信用代码唯一性检验
parent
3e736972
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
198 additions
and
124 deletions
+198
-124
IRegUnitInfoService.java
.../boot/module/tcm/flc/api/service/IRegUnitInfoService.java
+24
-8
RegUnitInfoController.java
.../module/tcm/flc/biz/controller/RegUnitInfoController.java
+54
-7
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+120
-109
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/api/service/IRegUnitInfoService.java
View file @
1b2003ac
...
...
@@ -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
);
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/controller/RegUnitInfoController.java
View file @
1b2003ac
...
...
@@ -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
,
cardTyp
e
);
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
regBeforeCheckForCause
(
unitCode
,
isNationwid
e
);
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
()
{
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
1b2003ac
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
flc
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.IdcardUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -450,115 +451,6 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
@Override
public
RegUnitInfoDto
unitCheck
(
String
unitCode
,
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
(
"6600"
.
equals
(
cardType
))
{
boolean
b
=
IdcardUtil
.
isValidCard
(
unitCode
);
if
(!
b
)
{
throw
new
BadRequest
(
"非法的证件号码"
);
}
}
if
(!
ValidationUtil
.
isEmpty
(
unitCode
))
{
unitCode
=
ObjectUtils
.
isEmpty
(
cardType
)
?
unitCode
:
cardType
+
"_"
+
unitCode
;
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
unitCode
);
if
(
result
.
getResult
()
!=
null
)
{
throw
new
BadRequest
(!
ObjectUtils
.
isEmpty
(
cardType
)
?
"重复的证件号码"
:
"重复的注册编码"
);
}
}
// 1.校验重复性
// RegUnitInfo regUnitInfo = this
// .getOne(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
// if (regUnitInfo != null) {
// throw new RuntimeException("该单位已注册,请联系企业管理员!");
// }
// 2.组织返回数据
if
(
ObjectUtils
.
isEmpty
(
registerType
))
{
//2.1 工商信息查询
Map
<
String
,
Object
>
resultMap
=
accessFeignService
.
getData
(
unitCode
).
getResult
();
if
(
resultMap
==
null
)
{
throw
new
BadRequest
(
"工商信息接口查询失败,请稍后再试!"
);
}
if
(
ObjectUtils
.
isEmpty
(
resultMap
))
{
throw
new
BadRequest
(
"未查询到企业信息,请核对!"
);
}
if
(!
ValidationUtil
.
isEmpty
(
resultMap
))
{
// 2.2 工商信息组装
String
area
=
String
.
valueOf
(
resultMap
.
get
(
"area"
));
String
city
=
area
.
substring
(
0
,
area
.
indexOf
(
"市"
)
+
1
);
String
district
=
area
.
substring
(
city
.
length
());
if
(
"高新区"
.
equals
(
district
))
{
district
=
"雁塔区"
;
}
regUnitInfoDto
.
setCity
(
city
);
regUnitInfoDto
.
setDistrict
(
district
);
regUnitInfoDto
.
setStree
(
String
.
valueOf
(
resultMap
.
get
(
"street"
)));
regUnitInfoDto
.
setCommunity
(
String
.
valueOf
(
resultMap
.
get
(
"community"
)));
regUnitInfoDto
.
setAddress
(
String
.
valueOf
(
resultMap
.
get
(
"address"
)));
regUnitInfoDto
.
setUnitCode
(
String
.
valueOf
(
resultMap
.
get
(
"creditCode"
)));
regUnitInfoDto
.
setName
(
String
.
valueOf
(
resultMap
.
get
(
"unitName"
)));
regUnitInfoDto
.
setLegalPerson
(
String
.
valueOf
(
resultMap
.
get
(
"legalPeople"
)));
String
industryName
=
""
;
if
(
ObjectUtils
.
isNotEmpty
(
resultMap
.
get
(
"industryCode"
)))
{
List
<
DataDictionary
>
dictionaries
=
this
.
initAllDataDictionaryList
();
Optional
<
DataDictionary
>
op
=
dictionaries
.
stream
().
filter
(
d
->
d
.
getCode
()
!=
null
&&
d
.
getType
()
!=
null
&&
d
.
getCode
().
equals
(
String
.
valueOf
(
resultMap
.
get
(
"industryCode"
)))
&&
"HYXLDM"
.
equals
(
d
.
getType
())).
findFirst
();
if
(
op
.
isPresent
())
{
DataDictionary
dataDictionary
=
op
.
get
();
industryName
=
dataDictionary
.
getName
();
}
}
String
approveDate
=
String
.
valueOf
(
resultMap
.
get
(
"approval_time"
));
approveDate
=
approveDate
.
contains
(
"年"
)
?
approveDate
.
replace
(
"年"
,
"-"
)
:
approveDate
;
approveDate
=
approveDate
.
contains
(
"月"
)
?
approveDate
.
replace
(
"月"
,
"-"
)
:
approveDate
;
approveDate
=
approveDate
.
contains
(
"日"
)
?
approveDate
.
replace
(
"日"
,
"-"
)
:
approveDate
;
RegUnitIcDto
regUnitIcDto
=
new
RegUnitIcDto
();
regUnitIcDto
.
setUnitCode
(
regUnitInfoDto
.
getUnitCode
());
try
{
regUnitIcDto
.
setApprovedDate
(
DateUtils
.
dateParse
(
approveDate
,
"yyyy-MM-dd"
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
regUnitIcDto
.
setUnitName
(
regUnitInfoDto
.
getName
());
regUnitIcDto
.
setRegisteredOrgan
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
)));
regUnitIcDto
.
setBusinessState
(
String
.
valueOf
(
resultMap
.
get
(
"operating_status"
)));
regUnitIcDto
.
setProvince
(
"陕西省"
);
regUnitIcDto
.
setCity
(
regUnitInfoDto
.
getCity
());
regUnitIcDto
.
setDistrict
(
regUnitInfoDto
.
getDistrict
());
regUnitIcDto
.
setStree
(
regUnitInfoDto
.
getStree
());
regUnitIcDto
.
setCommunity
(
regUnitInfoDto
.
getCommunity
());
regUnitIcDto
.
setAddress
(
regUnitInfoDto
.
getAddress
());
regUnitIcDto
.
setLegalPerson
(
regUnitInfoDto
.
getLegalPerson
());
regUnitIcDto
.
setIndustryName
(
industryName
);
regUnitInfoDto
.
setRegUnitIc
(
regUnitIcDto
);
}
else
{
regUnitInfoDto
.
setRegUnitIc
(
new
RegUnitIcDto
());
}
}
else
if
(
"6598"
.
equals
(
registerType
))
{
TzsBaseInstitution
regUnitMessage
=
tzsBaseInstitutionMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsBaseInstitution
>().
eq
(
TzsBaseInstitution:
:
getUseCode
,
unitCode
));
TzsBaseInstitutionDto
institutionDto
=
new
TzsBaseInstitutionDto
();
if
(!
ObjectUtils
.
isEmpty
(
regUnitMessage
))
{
BeanUtils
.
copyProperties
(
regUnitMessage
,
institutionDto
);
}
regUnitInfoDto
.
setRegUnitMessage
(
institutionDto
);
}
// 2.3 许可信息组装
List
<
BaseUnitLicence
>
unitLicences
=
baseUnitLicenceService
.
list
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>().
eq
(
BaseUnitLicence:
:
getUnitCode
,
unitCode
));
regUnitInfoDto
.
setUnitLicences
(
Bean
.
toModels
(
unitLicences
,
BaseUnitLicenceDto
.
class
));
return
regUnitInfoDto
;
}
@Override
public
List
<
DataDictionary
>
getUnitTypeList
()
{
return
this
.
setAndGetUnitTypeList
();
}
...
...
@@ -1131,8 +1023,126 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
@Override
public
RegUnitInfoDto
regBeforeCheckForEnterprises
(
String
unitCode
,
Boolean
isNationwide
)
{
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
startPlatformTokenService
.
getToken
();
// 1.唯一性检验
checkForReg
(
unitCode
);
// 2.省内注册时,查询工商信息
if
(!
isNationwide
)
{
//2.1 工商信息查询
Map
<
String
,
Object
>
resultMap
=
accessFeignService
.
getData
(
unitCode
).
getResult
();
if
(
resultMap
==
null
)
{
throw
new
BadRequest
(
"工商信息接口查询失败,请稍后再试!"
);
}
if
(
ObjectUtils
.
isEmpty
(
resultMap
))
{
throw
new
BadRequest
(
"未查询到企业信息,请核对!"
);
}
if
(!
ValidationUtil
.
isEmpty
(
resultMap
))
{
// 2.2 工商信息组装
String
area
=
String
.
valueOf
(
resultMap
.
get
(
"area"
));
String
city
=
area
.
substring
(
0
,
area
.
indexOf
(
"市"
)
+
1
);
String
district
=
area
.
substring
(
city
.
length
());
if
(
"高新区"
.
equals
(
district
))
{
district
=
"雁塔区"
;
}
regUnitInfoDto
.
setCity
(
city
);
regUnitInfoDto
.
setDistrict
(
district
);
regUnitInfoDto
.
setStree
(
String
.
valueOf
(
resultMap
.
get
(
"street"
)));
regUnitInfoDto
.
setCommunity
(
String
.
valueOf
(
resultMap
.
get
(
"community"
)));
regUnitInfoDto
.
setAddress
(
String
.
valueOf
(
resultMap
.
get
(
"address"
)));
regUnitInfoDto
.
setUnitCode
(
String
.
valueOf
(
resultMap
.
get
(
"creditCode"
)));
regUnitInfoDto
.
setName
(
String
.
valueOf
(
resultMap
.
get
(
"unitName"
)));
regUnitInfoDto
.
setLegalPerson
(
String
.
valueOf
(
resultMap
.
get
(
"legalPeople"
)));
String
industryName
=
""
;
if
(
ObjectUtils
.
isNotEmpty
(
resultMap
.
get
(
"industryCode"
)))
{
List
<
DataDictionary
>
dictionaries
=
this
.
initAllDataDictionaryList
();
Optional
<
DataDictionary
>
op
=
dictionaries
.
stream
().
filter
(
d
->
d
.
getCode
()
!=
null
&&
d
.
getType
()
!=
null
&&
d
.
getCode
().
equals
(
String
.
valueOf
(
resultMap
.
get
(
"industryCode"
)))
&&
"HYXLDM"
.
equals
(
d
.
getType
())).
findFirst
();
if
(
op
.
isPresent
())
{
DataDictionary
dataDictionary
=
op
.
get
();
industryName
=
dataDictionary
.
getName
();
}
}
String
approveDate
=
String
.
valueOf
(
resultMap
.
get
(
"approval_time"
));
approveDate
=
approveDate
.
contains
(
"年"
)
?
approveDate
.
replace
(
"年"
,
"-"
)
:
approveDate
;
approveDate
=
approveDate
.
contains
(
"月"
)
?
approveDate
.
replace
(
"月"
,
"-"
)
:
approveDate
;
approveDate
=
approveDate
.
contains
(
"日"
)
?
approveDate
.
replace
(
"日"
,
"-"
)
:
approveDate
;
RegUnitIcDto
regUnitIcDto
=
new
RegUnitIcDto
();
regUnitIcDto
.
setUnitCode
(
regUnitInfoDto
.
getUnitCode
());
regUnitIcDto
.
setApprovedDate
(
DateUtil
.
parse
(
approveDate
,
"yyyy-MM-dd"
));
regUnitIcDto
.
setUnitName
(
regUnitInfoDto
.
getName
());
regUnitIcDto
.
setRegisteredOrgan
(
String
.
valueOf
(
resultMap
.
get
(
"registration_authority"
)));
regUnitIcDto
.
setBusinessState
(
String
.
valueOf
(
resultMap
.
get
(
"operating_status"
)));
regUnitIcDto
.
setProvince
(
"陕西省"
);
regUnitIcDto
.
setCity
(
regUnitInfoDto
.
getCity
());
regUnitIcDto
.
setDistrict
(
regUnitInfoDto
.
getDistrict
());
regUnitIcDto
.
setStree
(
regUnitInfoDto
.
getStree
());
regUnitIcDto
.
setCommunity
(
regUnitInfoDto
.
getCommunity
());
regUnitIcDto
.
setAddress
(
regUnitInfoDto
.
getAddress
());
regUnitIcDto
.
setLegalPerson
(
regUnitInfoDto
.
getLegalPerson
());
regUnitIcDto
.
setIndustryName
(
industryName
);
regUnitInfoDto
.
setRegUnitIc
(
regUnitIcDto
);
}
else
{
regUnitInfoDto
.
setRegUnitIc
(
new
RegUnitIcDto
());
}
}
// 3 许可信息组装
List
<
BaseUnitLicence
>
unitLicences
=
baseUnitLicenceService
.
list
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>().
eq
(
BaseUnitLicence:
:
getUnitCode
,
unitCode
));
regUnitInfoDto
.
setUnitLicences
(
Bean
.
toModels
(
unitLicences
,
BaseUnitLicenceDto
.
class
));
return
regUnitInfoDto
;
}
@Override
public
List
<
DataDictionary
>
getXkItemList
(
String
type
)
{
List
<
DataDictionary
>
dictionaries
=
this
.
initAllDataDictionaryList
();
return
dictionaries
.
stream
().
parallel
().
filter
(
d
->
(
"XK-"
+
type
).
equals
(
d
.
getExtend
())).
collect
(
Collectors
.
toList
());
}
@Override
public
RegUnitInfoDto
regBeforeCheckForCause
(
String
unitCode
,
Boolean
isNationwide
)
{
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
// 1.唯一性检验
startPlatformTokenService
.
getToken
();
checkForReg
(
unitCode
);
// 2.省内时数据组装
if
(!
isNationwide
)
{
TzsBaseInstitution
regUnitMessage
=
tzsBaseInstitutionMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsBaseInstitution
>().
eq
(
TzsBaseInstitution:
:
getUseCode
,
unitCode
));
TzsBaseInstitutionDto
institutionDto
=
new
TzsBaseInstitutionDto
();
if
(!
ObjectUtils
.
isEmpty
(
regUnitMessage
))
{
BeanUtils
.
copyProperties
(
regUnitMessage
,
institutionDto
);
}
regUnitInfoDto
.
setRegUnitMessage
(
institutionDto
);
}
// 3.许可信息组装
List
<
BaseUnitLicence
>
unitLicences
=
baseUnitLicenceService
.
list
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>().
eq
(
BaseUnitLicence:
:
getUnitCode
,
unitCode
));
regUnitInfoDto
.
setUnitLicences
(
Bean
.
toModels
(
unitLicences
,
BaseUnitLicenceDto
.
class
));
return
regUnitInfoDto
;
}
private
void
checkForReg
(
String
unitCode
)
{
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
unitCode
);
if
(
result
.
getResult
()
!=
null
)
{
throw
new
BadRequest
(
"重复的注册编码"
);
}
}
@Override
public
RegUnitInfoDto
regBeforeCheckForPerson
(
String
unitCode
,
String
cardType
)
{
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
startPlatformTokenService
.
getToken
();
if
(
"6600"
.
equals
(
cardType
))
{
boolean
b
=
IdcardUtil
.
isValidCard
(
unitCode
);
if
(!
b
)
{
throw
new
BadRequest
(
"非法的证件号码"
);
}
}
unitCode
=
cardType
+
"_"
+
unitCode
;
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
unitCode
);
if
(
result
.
getResult
()
!=
null
)
{
throw
new
BadRequest
(
"重复的证件号码!"
);
}
return
regUnitInfoDto
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment