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
aa9d7eb9
Commit
aa9d7eb9
authored
Oct 11, 2022
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改注册逻辑
parent
49ff0532
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
22 deletions
+36
-22
TzsAuthServiceImpl.java
.../boot/module/tzs/biz/service/impl/TzsAuthServiceImpl.java
+7
-3
RegUnitInfoController.java
.../module/tzs/flc/biz/controller/RegUnitInfoController.java
+1
-12
RegUnitInfoServiceImpl.java
...dule/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+28
-7
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzsAuthServiceImpl.java
View file @
aa9d7eb9
...
...
@@ -54,6 +54,9 @@ public class TzsAuthServiceImpl implements TzsAuthService {
*/
@Value
(
"${redis.cache.failure.time}"
)
private
Long
redisRegionTimeSecond
;
@Autowired
private
StartPlatformTokenService
startPlatformTokenService
;
@Override
...
...
@@ -75,7 +78,8 @@ public class TzsAuthServiceImpl implements TzsAuthService {
@Override
public
List
<
RegionModel
>
getUserReginTree
()
{
List
<
String
>
regionList
=
this
.
getUserRegionCode
();
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
//AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
startPlatformTokenService
.
getToken
();
List
<
RegionModel
>
tree
=
(
List
<
RegionModel
>)
Systemctl
.
regionClient
.
queryForTree
(
null
).
getResult
();
// 循环list 将List 封装为 省市区 SET
Set
<
String
>
city
=
new
HashSet
<>();
...
...
@@ -128,8 +132,8 @@ public class TzsAuthServiceImpl implements TzsAuthService {
for
(
Map
.
Entry
<
String
,
RegionModel
>
entries
:
tempCityMap
.
entrySet
())
{
newCity
.
add
(
entries
.
getValue
());
}
start
.
setChildren
(
newCity
);
newTree
.
add
(
start
);
//
start.setChildren(newCity);
newTree
.
add
All
(
newCity
);
return
newTree
;
}
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/RegUnitInfoController.java
View file @
aa9d7eb9
...
...
@@ -66,9 +66,6 @@ public class RegUnitInfoController extends BaseController {
@Value
(
"${flc.sms.timeout:600}"
)
private
int
timeout
;
@Autowired
StartPlatformTokenService
startPlatformTokenService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
...
...
@@ -99,16 +96,8 @@ public class RegUnitInfoController extends BaseController {
@RequestParam
String
companyName
)
{
if
(
ValidationUtil
.
isEmpty
(
unitCode
))
{
throw
new
BadRequest
(
"单位编码不能为空"
);
}
if
(!
ValidationUtil
.
isEmpty
(
companyName
))
{
startPlatformTokenService
.
getToken
();
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyName
(
companyName
);
if
(
result
.
getResult
()!=
null
)
{
throw
new
BadRequest
(
"重复的公司名称"
);
}
}
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
unitCheck
(
unitCode
,
unitType
);
RegUnitInfoDto
regUnitInfoDto
=
iRegUnitInfoService
.
unitCheck
(
unitCode
,
unitType
,
companyName
);
return
ResponseHelper
.
buildResponse
(
regUnitInfoDto
);
}
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
aa9d7eb9
...
...
@@ -40,6 +40,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto;
import
com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzBaseEnterpriseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto
;
...
...
@@ -87,7 +88,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Autowired
AccessFeignService
accessFeignService
;
@Autowired
StartPlatformTokenService
startPlatformTokenService
;
/**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232
*/
...
...
@@ -218,13 +221,31 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
@Override
public
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
)
{
public
RegUnitInfoDto
unitCheck
(
String
unitCode
,
String
unitType
,
String
companyName
)
{
if
(!
ValidationUtil
.
isEmpty
(
companyName
))
{
startPlatformTokenService
.
getToken
();
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyName
(
companyName
);
if
(
result
.
getResult
()!=
null
)
{
throw
new
BadRequest
(
"重复的公司名称"
);
}
}
if
(!
ValidationUtil
.
isEmpty
(
unitCode
))
{
startPlatformTokenService
.
getToken
();
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
unitCode
);
if
(
result
.
getResult
()!=
null
)
{
throw
new
RuntimeException
(
"重复的公司编码"
);
}
}
// 1.校验重复性
RegUnitInfo
regUnitInfo
=
this
.
getOne
(
new
LambdaQueryWrapper
<
RegUnitInfo
>().
eq
(
RegUnitInfo:
:
getUnitCode
,
unitCode
));
if
(
regUnitInfo
!=
null
)
{
throw
new
RuntimeException
(
"该单位已注册,请联系企业管理员!"
);
}
//
RegUnitInfo regUnitInfo = this
//
.getOne(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
//
if (regUnitInfo != null) {
//
throw new RuntimeException("该单位已注册,请联系企业管理员!");
//
}
// 2.组织返回数据
RegUnitInfoDto
regUnitInfoDto
=
new
RegUnitInfoDto
();
if
(
USE_UNIT_TYPE_CODE
.
equals
(
unitType
)
||
PRODUCT_UNIT_TYPE_CODE
.
equals
(
unitType
)
||
FILLING_UNIT_TYPE_CODE
.
equals
(
unitType
))
{
...
...
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