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
495d2f5a
Commit
495d2f5a
authored
Nov 24, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jyjc):检验检测业务管理
1.联调修改增加检索条件 2.增加锁对一个申请单据
parent
4cd028f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
15 deletions
+51
-15
JyjcBizManageServiceImpl.java
...odule/jyjc/biz/service/impl/JyjcBizManageServiceImpl.java
+51
-15
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/service/impl/JyjcBizManageServiceImpl.java
View file @
495d2f5a
...
@@ -66,6 +66,9 @@ public class JyjcBizManageServiceImpl {
...
@@ -66,6 +66,9 @@ public class JyjcBizManageServiceImpl {
queryWrapper
.
eq
(
JyjcOpeningApplication:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
queryWrapper
.
eq
(
JyjcOpeningApplication:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
queryWrapper
.
like
(
StringUtils
.
isNotEmpty
(
model
.
getUnitCodeName
()),
JyjcOpeningApplication:
:
getUnitCodeName
,
model
.
getUnitCodeName
());
queryWrapper
.
like
(
StringUtils
.
isNotEmpty
(
model
.
getUnitCodeName
()),
JyjcOpeningApplication:
:
getUnitCodeName
,
model
.
getUnitCodeName
());
queryWrapper
.
eq
(
StringUtils
.
isNotEmpty
(
model
.
getOpenBizType
()),
JyjcOpeningApplication:
:
getOpenBizType
,
model
.
getOpenBizType
());
queryWrapper
.
eq
(
StringUtils
.
isNotEmpty
(
model
.
getOpenBizType
()),
JyjcOpeningApplication:
:
getOpenBizType
,
model
.
getOpenBizType
());
if
(
StringUtils
.
isNotEmpty
(
model
.
getDetectionRegionName
()))
{
queryWrapper
.
and
(
wp
->
wp
.
like
(
JyjcOpeningApplication:
:
getDetectionRegion
,
model
.
getDetectionRegionName
()).
and
(
w
->
w
.
isNull
(
JyjcOpeningApplication:
:
getExclusionRegion
).
or
().
notLike
(
JyjcOpeningApplication:
:
getExclusionRegion
,
model
.
getDetectionRegionName
())));
}
queryWrapper
.
orderByDesc
(
BaseEntity:
:
getSequenceNbr
);
queryWrapper
.
orderByDesc
(
BaseEntity:
:
getSequenceNbr
);
IPage
<
JyjcOpeningApplication
>
res
=
openingApplicationService
.
page
(
pageApp
,
queryWrapper
);
IPage
<
JyjcOpeningApplication
>
res
=
openingApplicationService
.
page
(
pageApp
,
queryWrapper
);
Map
<
String
,
String
>
detectionRegionCodeNameMap
=
getDetectionRegionCodeNameMap
();
Map
<
String
,
String
>
detectionRegionCodeNameMap
=
getDetectionRegionCodeNameMap
();
...
@@ -75,8 +78,9 @@ public class JyjcBizManageServiceImpl {
...
@@ -75,8 +78,9 @@ public class JyjcBizManageServiceImpl {
setAreaStatusByIdentify
(
company
,
r
,
bizManageModel
);
setAreaStatusByIdentify
(
company
,
r
,
bizManageModel
);
bizManageModel
.
setCompanyCode
(
company
.
getCompanyCode
());
bizManageModel
.
setCompanyCode
(
company
.
getCompanyCode
());
bizManageModel
.
setOpenBizTypeName
(
Optional
.
of
(
OpenBizTypeEnumV2
.
getOneByCode
(
bizManageModel
.
getOpenBizType
())).
map
(
OpenBizTypeEnumV2:
:
getDescription
).
orElse
(
""
));
bizManageModel
.
setOpenBizTypeName
(
Optional
.
of
(
OpenBizTypeEnumV2
.
getOneByCode
(
bizManageModel
.
getOpenBizType
())).
map
(
OpenBizTypeEnumV2:
:
getDescription
).
orElse
(
""
));
bizManageModel
.
setDetectionRegionName
(
this
.
buildDetectionRegionName
(
detectionRegionCodeNameMap
,
r
.
getDetectionRegion
()));
// 真实开通区域,所有区域-排查区域
bizManageModel
.
setExclusionRegionName
(
this
.
buildDetectionRegionName
(
detectionRegionCodeNameMap
,
r
.
getExclusionRegion
()));
bizManageModel
.
setDetectionRegionName
(
this
.
buildRegionName
(
detectionRegionCodeNameMap
,
r
.
getDetectionRegion
().
stream
().
filter
(
d
->
!
Optional
.
ofNullable
(
r
.
getExclusionRegion
()).
orElse
(
new
ArrayList
<>()).
contains
(
d
)).
collect
(
Collectors
.
toList
())));
bizManageModel
.
setExclusionRegionName
(
this
.
buildRegionName
(
detectionRegionCodeNameMap
,
r
.
getExclusionRegion
()));
bizManageModel
.
setAgencyClassifyName
(
agencyClassifyNameCodeNameMap
.
getOrDefault
(
bizManageModel
.
getAgencyClassify
(),
""
));
bizManageModel
.
setAgencyClassifyName
(
agencyClassifyNameCodeNameMap
.
getOrDefault
(
bizManageModel
.
getAgencyClassify
(),
""
));
return
bizManageModel
;
return
bizManageModel
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -95,7 +99,7 @@ public class JyjcBizManageServiceImpl {
...
@@ -95,7 +99,7 @@ public class JyjcBizManageServiceImpl {
return
detectionRegions
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
return
detectionRegions
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
}
}
private
String
build
Detection
RegionName
(
Map
<
String
,
String
>
detectionRegionCodeNameMap
,
List
<
String
>
regionCodes
)
{
private
String
buildRegionName
(
Map
<
String
,
String
>
detectionRegionCodeNameMap
,
List
<
String
>
regionCodes
)
{
return
Optional
.
ofNullable
(
regionCodes
).
map
(
r
->
r
.
stream
().
map
(
detectionRegionCodeNameMap:
:
get
).
collect
(
Collectors
.
joining
(
","
))).
orElse
(
""
);
return
Optional
.
ofNullable
(
regionCodes
).
map
(
r
->
r
.
stream
().
map
(
detectionRegionCodeNameMap:
:
get
).
collect
(
Collectors
.
joining
(
","
))).
orElse
(
""
);
}
}
...
@@ -225,21 +229,53 @@ public class JyjcBizManageServiceImpl {
...
@@ -225,21 +229,53 @@ public class JyjcBizManageServiceImpl {
}
}
public
Boolean
expireDateEdit
(
String
appSeq
,
String
newExpiryDate
)
{
public
Boolean
expireDateEdit
(
String
appSeq
,
String
newExpiryDate
)
{
LambdaUpdateWrapper
<
JyjcOpeningApplication
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
log
.
info
(
"省局企业业务有效期调整权限, appSeq: {}, newExpiryDate: {}"
,
appSeq
,
newExpiryDate
);
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
appSeq
);
String
lockKey
=
"app:region:lock:"
+
appSeq
;
updateWrapper
.
set
(
JyjcOpeningApplication:
:
getExpiryDate
,
DateUtil
.
parseDate
(
newExpiryDate
));
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
openingApplicationService
.
update
(
updateWrapper
);
try
{
boolean
isLocked
=
lock
.
tryLock
(
0
,
180
,
TimeUnit
.
SECONDS
);
// 解决并发问题:解决并发问题:多个人同时操作一个单据
if
(!
isLocked
)
{
throw
new
BadRequest
(
"其他机构同时在操作该业务,请稍后重试!"
);
}
LambdaUpdateWrapper
<
JyjcOpeningApplication
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
appSeq
);
updateWrapper
.
set
(
JyjcOpeningApplication:
:
getExpiryDate
,
DateUtil
.
parseDate
(
newExpiryDate
));
openingApplicationService
.
update
(
updateWrapper
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"禁用企业区域失败:{}"
,
e
.
getMessage
(),
e
);
}
finally
{
if
(
lock
.
isLocked
()
&&
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
public
Boolean
detectionRegionEdit
(
String
appSeq
,
String
newDetectionRegion
)
{
public
Boolean
detectionRegionEdit
(
String
appSeq
,
String
newDetectionRegion
)
{
JyjcOpeningApplication
openingApplication
=
openingApplicationService
.
getById
(
appSeq
);
log
.
info
(
"省局企业区域调整权限, appSeq: {}, newDetectionRegion: {}"
,
appSeq
,
newDetectionRegion
);
openingApplication
.
setDetectionRegion
(
Arrays
.
stream
(
newDetectionRegion
.
split
(
","
)).
collect
(
Collectors
.
toList
()));
String
lockKey
=
"app:region:lock:"
+
appSeq
;
if
(
openingApplication
.
getExclusionRegion
()
!=
null
)
{
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
// 如果省局维护后的区域,去掉了一部分,则把市局停用区域字段也去掉
try
{
openingApplication
.
setExclusionRegion
(
openingApplication
.
getExclusionRegion
().
stream
().
filter
(
e
->
openingApplication
.
getDetectionRegion
().
contains
(
e
)).
collect
(
Collectors
.
toList
()));
boolean
isLocked
=
lock
.
tryLock
(
0
,
180
,
TimeUnit
.
SECONDS
);
// 解决并发问题:解决并发问题:多个人同时操作一个单据
if
(!
isLocked
)
{
throw
new
BadRequest
(
"其他机构同时在操作该业务,请稍后重试!"
);
}
JyjcOpeningApplication
openingApplication
=
openingApplicationService
.
getById
(
appSeq
);
openingApplication
.
setDetectionRegion
(
Arrays
.
stream
(
newDetectionRegion
.
split
(
","
)).
collect
(
Collectors
.
toList
()));
if
(
openingApplication
.
getExclusionRegion
()
!=
null
)
{
// 如果省局维护后的区域,去掉了一部分,则把市局停用区域字段也去掉
openingApplication
.
setExclusionRegion
(
openingApplication
.
getExclusionRegion
().
stream
().
filter
(
e
->
openingApplication
.
getDetectionRegion
().
contains
(
e
)).
collect
(
Collectors
.
toList
()));
}
openingApplicationService
.
saveOrUpdate
(
openingApplication
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"禁用企业区域失败:{}"
,
e
.
getMessage
(),
e
);
}
finally
{
if
(
lock
.
isLocked
()
&&
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
}
openingApplicationService
.
saveOrUpdate
(
openingApplication
);
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
...
@@ -262,6 +298,7 @@ public class JyjcBizManageServiceImpl {
...
@@ -262,6 +298,7 @@ public class JyjcBizManageServiceImpl {
res
.
put
(
"exclusionRegion"
,
openingApplication
.
getExclusionRegion
());
res
.
put
(
"exclusionRegion"
,
openingApplication
.
getExclusionRegion
());
res
.
put
(
"status"
,
openingApplication
.
getStatus
());
res
.
put
(
"status"
,
openingApplication
.
getStatus
());
res
.
put
(
"applicationSeq"
,
openingApplication
.
getApplicationSeq
());
res
.
put
(
"applicationSeq"
,
openingApplication
.
getApplicationSeq
());
res
.
put
(
"acceptDate"
,
openingApplication
.
getAcceptDate
());
return
res
;
return
res
;
}
}
...
@@ -275,13 +312,12 @@ public class JyjcBizManageServiceImpl {
...
@@ -275,13 +312,12 @@ public class JyjcBizManageServiceImpl {
baseUnitLicences
.
addAll
(
baseUnitLicenceOne
);
baseUnitLicences
.
addAll
(
baseUnitLicenceOne
);
}
}
});
});
List
<
Map
<
String
,
Object
>>
licences
=
baseUnitLicences
.
stream
().
map
(
e
->
{
return
baseUnitLicences
.
stream
().
map
(
e
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
BeanUtil
.
copyProperties
(
e
,
map
);
BeanUtil
.
copyProperties
(
e
,
map
);
map
.
put
(
"licenceState"
,
String
.
valueOf
(
e
.
getLicenceState
()));
map
.
put
(
"licenceState"
,
String
.
valueOf
(
e
.
getLicenceState
()));
map
.
put
(
"qualificationCertificateAttachment"
,
JSONObject
.
parseArray
(
e
.
getQualificationCertificateAttachment
()));
map
.
put
(
"qualificationCertificateAttachment"
,
JSONObject
.
parseArray
(
e
.
getQualificationCertificateAttachment
()));
return
map
;
return
map
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
licences
;
}
}
}
}
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