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
ac3728dc
Commit
ac3728dc
authored
Aug 01, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.注册code空针bug
parent
3bd50aed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
23 deletions
+27
-23
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+27
-23
No files found.
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 @
ac3728dc
...
...
@@ -60,6 +60,7 @@ import org.springframework.util.StopWatch;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -345,22 +346,22 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Override
public
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
,
String
companyName
)
{
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
startPlatformTokenService
.
getToken
();
if
(!
ValidationUtil
.
isEmpty
(
companyName
))
{
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyName
(
companyName
);
if
(
result
.
getResult
()!=
null
)
{
throw
new
RuntimeException
(
"重复的公司名称"
);
}
}
if
(!
ValidationUtil
.
isEmpty
(
unitCode
))
{
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
unitCode
);
if
(
result
.
getResult
()!=
null
)
{
throw
new
RuntimeException
(
"重复的公司编码"
);
}
}
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
(
"重复的公司编码"
);
}
}
// 1.校验重复性
// RegUnitInfo regUnitInfo = this
// .getOne(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
...
...
@@ -368,15 +369,14 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// throw new RuntimeException("该单位已注册,请联系企业管理员!");
// }
// 2.组织返回数据
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
//2.1 工商信息查询
//2.1 工商信息查询
Map
<
String
,
Object
>
resultMap
=
accessFeignService
.
getData
(
unitCode
).
getResult
();
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
(
district
.
equals
(
"高新区"
)){
if
(
"高新区"
.
equals
(
district
)){
district
=
"雁塔区"
;
}
regUnitInfoDto
.
setCity
(
city
);
...
...
@@ -388,12 +388,15 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
regUnitInfoDto
.
setName
(
String
.
valueOf
(
resultMap
.
get
(
"unitName"
)));
regUnitInfoDto
.
setLegalPerson
(
String
.
valueOf
(
resultMap
.
get
(
"legalPeople"
)));
String
industryName
=
""
;
List
<
DataDictionary
>
dictionaries
=
this
.
initAllDataDictionaryList
();
Optional
<
DataDictionary
>
op
=
dictionaries
.
stream
().
filter
(
d
->
d
.
getCode
().
equals
(
String
.
valueOf
(
resultMap
.
get
(
"industryCode"
)))
&&
"HYXLDM"
.
equals
(
d
.
getType
())).
findFirst
();
if
(
op
.
isPresent
())
{
DataDictionary
dataDictionary
=
op
.
get
();
industryName
=
dataDictionary
.
getName
();
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
;
...
...
@@ -425,6 +428,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
List
<
BaseUnitLicence
>
unitLicences
=
baseUnitLicenceService
.
list
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>().
eq
(
BaseUnitLicence:
:
getUnitCode
,
unitCode
));
regUnitInfoDto
.
setUnitLicences
(
Bean
.
toModels
(
unitLicences
,
BaseUnitLicenceDto
.
class
));
return
regUnitInfoDto
;
}
...
...
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