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
ccaea804
Commit
ccaea804
authored
Jun 19, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.检验检测报检规则3.0版本
parent
ddb50201
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
RuleActionHandler.java
...n/amos/boot/module/jyjc/biz/action/RuleActionHandler.java
+25
-16
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/action/RuleActionHandler.java
View file @
ccaea804
...
...
@@ -128,27 +128,16 @@ public class RuleActionHandler {
return
tzBaseUnitLicences
;
}
public
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitList
(
List
<
TzBaseUnitLicence
>
unitLicenceList
,
Boolean
isMatchArea
,
String
record
,
String
openBizType
)
{
// 是否进行属地过滤
String
areaCode
=
isMatchArea
?
this
.
getArea
(
record
)
:
""
;
// 所有符合单位的code
List
<
String
>
unitCodes
=
unitLicenceList
.
stream
().
map
(
TzBaseUnitLicence:
:
getUnitCode
).
collect
(
Collectors
.
toList
());
// 按照资质 + areaCode,进行设备单位的筛选
List
<
TzBaseEnterpriseInfoDto
>
matchEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
unitCodes
,
areaCode
,
openBizType
);
if
(
matchEnterpriseInfos
.
isEmpty
())
{
log
.
info
(
"按照资质、区域未匹配到对应的单位、按照地市未匹配到单位,将返回全部单位"
);
return
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
null
,
null
,
openBizType
);
}
return
matchEnterpriseInfos
;
}
private
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitListForNoAccept
(
List
<
TzBaseUnitLicence
>
unitLicenceList
,
Boolean
isMatchArea
,
String
record
,
String
openBizType
,
String
defaultInspectionCode
,
String
legalInspectionCodes
,
String
inspectionCompanyType
)
{
// 是否进行属地过滤
String
areaCode
=
isMatchArea
?
this
.
getArea
(
record
)
:
""
;
// 所有符合单位的code
List
<
String
>
unitCodes
=
unitLicenceList
.
stream
().
map
(
TzBaseUnitLicence:
:
getUnitCode
).
collect
(
Collectors
.
toList
());
List
<
TzBaseEnterpriseInfoDto
>
matchEnterpriseInfos
=
new
ArrayList
<>();
// 按照资质 + areaCode,进行设备单位的筛选
List
<
TzBaseEnterpriseInfoDto
>
matchEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
unitCodes
,
areaCode
,
openBizType
);
if
(
unitCodes
.
size
()
>
0
)
{
matchEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
unitCodes
,
areaCode
,
openBizType
);
}
// 第三方时需要去掉法定机构
if
(
inspectionCompanyType
.
equals
(
InspectionCompanyType
.
THIRD
.
getCode
()))
{
log
.
info
(
"第三方检验机构开始匹配"
);
...
...
@@ -180,8 +169,11 @@ public class RuleActionHandler {
.
collect
(
Collectors
.
toList
());
// 将法定机构和符合资质要求的机构取交集
List
<
String
>
legalUnitCodes
=
Arrays
.
stream
(
legalInspectionCodes
.
split
(
","
)).
filter
(
unitCodes:
:
contains
).
collect
(
Collectors
.
toList
());
List
<
TzBaseEnterpriseInfoDto
>
matchEnterpriseInfos
=
new
ArrayList
<>();
// 按照资质 + areaCode,进行设备单位的筛选
List
<
TzBaseEnterpriseInfoDto
>
matchEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
legalUnitCodes
,
areaCode
,
openBizType
);
if
(
legalUnitCodes
.
size
()
>
0
)
{
matchEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
legalUnitCodes
,
areaCode
,
openBizType
);
}
// 未匹配到法定机构时,返回指定的默认的法定机构
if
(
matchEnterpriseInfos
.
isEmpty
())
{
log
.
info
(
"按照资质、区域未匹配到法定检验机构"
);
...
...
@@ -221,5 +213,22 @@ public class RuleActionHandler {
throw
e
;
}
}
public
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitList
(
List
<
TzBaseUnitLicence
>
unitLicenceList
,
Boolean
isMatchArea
,
String
record
,
String
openBizType
)
{
// 是否进行属地过滤
String
areaCode
=
isMatchArea
?
this
.
getArea
(
record
)
:
""
;
// 所有符合单位的code
List
<
String
>
unitCodes
=
unitLicenceList
.
stream
().
map
(
TzBaseUnitLicence:
:
getUnitCode
).
collect
(
Collectors
.
toList
());
List
<
TzBaseEnterpriseInfoDto
>
matchEnterpriseInfos
=
new
ArrayList
<>();
// 按照资质 + areaCode,进行设备单位的筛选
if
(
unitCodes
.
size
()
>
0
)
{
matchEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
unitCodes
,
areaCode
,
openBizType
);
}
if
(
matchEnterpriseInfos
.
isEmpty
())
{
log
.
info
(
"按照资质、区域未匹配到对应的单位、按照地市未匹配到单位,将返回全部单位"
);
return
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
null
,
null
,
openBizType
);
}
return
matchEnterpriseInfos
;
}
}
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