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
6eda483f
Commit
6eda483f
authored
Nov 20, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):设备走过登记,再次登记时提示语需要更新
parent
02d3c60c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
158 additions
and
3 deletions
+158
-3
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+7
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+137
-0
BaseEquipUsedCheckService.java
...module/jg/biz/service/impl/BaseEquipUsedCheckService.java
+14
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
View file @
6eda483f
...
...
@@ -183,5 +183,12 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
Page
<
Map
<
String
,
Object
>>
countBizFinishedNumForDPListDQJY
(
@Param
(
"page"
)
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamForDetailDto
);
Page
<
Map
<
String
,
Object
>>
countBizFinishedNumForDPListBGDJ
(
@Param
(
"page"
)
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamForDetailDto
);
Page
<
Map
<
String
,
Object
>>
countBizFinishedNumForDPListZXBX
(
@Param
(
"page"
)
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamForDetailDto
);
/**
* 当前设备在流程中的申请单号
* @param record 设备id
* @return 申请单号
*/
List
<
String
>
findEquipInUseService
(
@Param
(
"record"
)
String
record
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
6eda483f
...
...
@@ -279,6 +279,143 @@
and (a.status
<![CDATA[ <> ]]>
'使用单位待提交' and a.status
<![CDATA[ <> ]]>
'一级受理已驳回' and a.status
<![CDATA[ <> ]]>
'使用单位已撤回' and a.status
<![CDATA[ <> ]]>
'已作废')
)
</select>
<select
id=
"findEquipInUseService"
resultType=
"java.lang.String"
>
select
apply_no
from (
select
apply_no
from
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and ( a.status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_change_registration_reform a,
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and ( a.audit_status
<![CDATA[ <> ]]>
'已作废' OR a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_change_registration_transfer a,
tzs_jg_change_registration_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废' OR a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_change_registration_unit a,
tzs_jg_change_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_enable_disable a,
tzs_jg_enable_disable_eq b
where
a.sequence_nbr = b.enable_disable_apply_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废' OR a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_installation_notice a,
tzs_jg_installation_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617' or a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
from
tzs_jg_maintain_notice a,
tzs_jg_maintain_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617' or a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
from
tzs_jg_maintenance_contract a,
tzs_jg_maintenance_contract_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_reform_notice a,
tzs_jg_reform_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617' or a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
from
tzs_jg_scrap_cancel a,
tzs_jg_scrap_cancel_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_transfer_notice a,
tzs_jg_transfer_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617' or a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
from
tzs_jg_vehicle_information a,
tzs_jg_vehicle_information_eq b
where
a.sequence_nbr = b.vehicle_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_change_vehicle_registration_unit a,
tzs_jg_change_vehicle_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
)
</select>
<select
id=
"refreshTheDetailsDataOfCompletedUsageRegistration"
resultType=
"java.lang.String"
>
SELECT sequence_nbr
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/BaseEquipUsedCheckService.java
View file @
6eda483f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FlowingEquipRedisKeyDTO
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -22,6 +23,8 @@ import java.util.stream.Collectors;
@Slf4j
public
abstract
class
BaseEquipUsedCheckService
implements
IEquipUsedCheck
{
@Autowired
CommonMapper
commonMapper
;
/**
* 并发校验(页面同时提交或者页面同时打开多个时,某些设备都是为使用状态)校验设备流程在用状态及更新不在用为再使用状态
...
...
@@ -40,8 +43,12 @@ public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck {
}
RBucket
<
Set
<
String
>>
RBucket
=
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()));
Set
<
String
>
equipListOfUsed
=
RBucket
.
get
();
// 查询当前设备在流程中的申请单号列表
List
<
String
>
equipInUseList
=
commonMapper
.
findEquipInUseService
(
record
);
if
(
equipListOfUsed
!=
null
&&
equipListOfUsed
.
contains
(
record
))
{
throw
new
BadRequest
(
"设备已被其他流程使用,不允许重复提交!"
);
String
joinedEquipInUse
=
String
.
join
(
","
,
equipInUseList
);
log
.
error
(
"设备已被其他流程使用,不允许重复提交,设备ID:{},在流程中申请单:{}"
,
record
,
joinedEquipInUse
);
throw
new
BadRequest
(
"设备已被其他流程使用,不允许重复提交!,设备ID: "
+
record
+
" ,在流程中申请单:"
+
joinedEquipInUse
+
",请联系管理员!"
);
}
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
...
...
@@ -68,8 +75,12 @@ public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck {
}
RBucket
<
Set
<
String
>>
RBucket
=
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()));
Set
<
String
>
equipListOfUsed
=
RBucket
.
get
();
// 查询当前设备在用的申请单号列表
List
<
String
>
equipInUseList
=
commonMapper
.
findEquipInUseService
(
record
);
if
(
equipListOfUsed
!=
null
&&
equipListOfUsed
.
contains
(
record
))
{
throw
new
BadRequest
(
"使用登记证已被其他流程使用,不允许重复提交!"
);
String
joinedEquipInUse
=
String
.
join
(
","
,
equipInUseList
);
log
.
error
(
"使用登记证已被其他流程使用,不允许重复提交,设备ID:{},在流程中申请单:{}"
,
record
,
joinedEquipInUse
);
throw
new
BadRequest
(
"使用登记证已被其他流程使用,不允许重复提交!,设备ID: "
+
record
+
" ,在流程中申请单:"
+
joinedEquipInUse
+
",请联系管理员!"
);
}
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
...
...
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