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
8043834c
Commit
8043834c
authored
Mar 27, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register_test' into develop_tzs_register
parents
ab29a405
d6986cfa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
48 deletions
+32
-48
ElevatorController.java
...ot/module/elevator/biz/controller/ElevatorController.java
+2
-2
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+3
-2
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+6
-6
BaseEquipUsedCheckService.java
...module/jg/biz/service/impl/BaseEquipUsedCheckService.java
+16
-24
FillingUseRegisterResult.java
.../module/jg/biz/service/impl/FillingUseRegisterResult.java
+5
-14
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/controller/ElevatorController.java
View file @
8043834c
...
...
@@ -654,8 +654,8 @@ public class ElevatorController extends BaseController {
* @return 成功处理条数
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/v1/es/insert"
,
method
=
RequestMethod
.
GE
T
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"电梯信息放入es"
,
notes
=
"电梯信息放入es"
)
@RequestMapping
(
value
=
"/v1/es/insert"
,
method
=
RequestMethod
.
PU
T
)
@ApiOperation
(
httpMethod
=
"
PU
T"
,
value
=
"电梯信息放入es"
,
notes
=
"电梯信息放入es"
)
public
ResponseModel
<
String
>
esInsert
()
{
Long
total
=
iElevatorService
.
esInsert
();
return
ResponseHelper
.
buildResponse
(
"success insert: "
+
total
);
...
...
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 @
8043834c
...
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.dto.KeyValueDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.bo.JgBizCountDataBO
;
...
...
@@ -251,10 +252,10 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/**
* 查询指定设备,使用登记后,后续业务的数据
*
* @param
record 设备标识
* @param
equipTransferId 使用登记主表id
* @return 后续业务数量
*/
Integer
countBizNumAfterUseReg
(
@Param
(
"record"
)
String
recor
d
);
Long
countBizNumAfterUseReg
(
@Param
(
"equipTransferId"
)
String
equipTransferI
d
);
/**
* 车用气瓶-使用登记证编号全库唯一校验
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
8043834c
...
...
@@ -2477,7 +2477,7 @@
where record = #{record}
</if>
</update>
<select
id=
"countBizNumAfterUseReg"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countBizNumAfterUseReg"
resultType=
"java.lang.
Long
"
>
select
sum(inUseNumber)
from (
...
...
@@ -2488,7 +2488,7 @@
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id
= #{record}
and b.equ_id
in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
...
...
@@ -2498,7 +2498,7 @@
tzs_jg_change_registration_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id
= #{record}
and b.equ_id
in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
...
...
@@ -2508,7 +2508,7 @@
tzs_jg_change_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id
= #{record}
and b.equ_id
in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.status
<![CDATA[ <> ]]>
'使用单位待提交' and a.status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
...
...
@@ -2518,7 +2518,7 @@
tzs_jg_scrap_cancel_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id
= #{record}
and b.equ_id
in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
...
...
@@ -2533,7 +2533,7 @@
n.sequence_nbr = e.name_change_registration_id
and n.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and n.audit_status
<![CDATA[ <> ]]>
'已作废') ne
where
ne.record
= #{record}
ne.record
in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
)
</select>
...
...
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 @
8043834c
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
;
...
...
@@ -23,8 +21,6 @@ import java.util.stream.Collectors;
@Slf4j
public
abstract
class
BaseEquipUsedCheckService
implements
IEquipUsedCheck
{
@Autowired
CommonMapper
commonMapper
;
/**
* 并发校验(页面同时提交或者页面同时打开多个时,某些设备都是为使用状态)校验设备流程在用状态及更新不在用为再使用状态
...
...
@@ -44,26 +40,29 @@ 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
))
{
String
joinedEquipInUse
=
String
.
join
(
","
,
equipInUseList
);
log
.
error
(
"设备已被其他流程使用,不允许重复提交,设备ID:{},在流程中申请单:{}"
,
record
,
joinedEquipInUse
);
log
.
error
(
"设备已被其他流程使用,不允许重复提交,设备ID:{}"
,
record
);
throw
new
BadRequest
(
"设备已被其他流程使用,不允许重复提交,请联系管理员!"
);
}
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
}
equipListOfUsed
.
add
(
record
);
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
())).
set
(
equipListOfUsed
);
FlowingEquipRedisContext
.
setRedisKeyInfo
(
new
FlowingEquipRedisKeyDTO
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()),
Collections
.
singletonList
(
record
)));
setUsingData2Redis
(
record
,
companyCode
,
equipListOfUsed
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
}
private
void
setUsingData2Redis
(
String
record
,
String
companyCode
,
Set
<
String
>
equipListOfUsed
)
{
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
}
equipListOfUsed
.
add
(
record
);
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
())).
set
(
equipListOfUsed
);
FlowingEquipRedisContext
.
setRedisKeyInfo
(
new
FlowingEquipRedisKeyDTO
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()),
Collections
.
singletonList
(
record
)));
}
@Override
public
void
registrationRepeatUsedCheck
(
String
record
,
String
companyCode
)
{
RLock
lock
=
getRedisClient
().
getLock
(
this
.
getRepeatUsedCheckLockKey
(
companyCode
,
getApplyBizType
(),
record
));
...
...
@@ -76,20 +75,13 @@ 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
))
{
String
joinedEquipInUse
=
String
.
join
(
","
,
equipInUseList
);
log
.
error
(
"使用登记证已被其他流程使用,不允许重复提交,设备ID:{},在流程中申请单:{}"
,
record
,
joinedEquipInUse
);
log
.
error
(
"使用登记证已被其他流程使用,不允许重复提交,使用登记证ID:{}"
,
record
);
throw
new
BadRequest
(
"使用登记证已被其他流程使用,不允许重复提交,请联系管理员!"
);
}
if
(
equipListOfUsed
==
null
||
equipListOfUsed
.
isEmpty
())
{
equipListOfUsed
=
new
TreeSet
<>();
}
equipListOfUsed
.
add
(
record
);
getRedisClient
().
getBucket
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
())).
set
(
equipListOfUsed
);
FlowingEquipRedisContext
.
setRedisKeyInfo
(
new
FlowingEquipRedisKeyDTO
(
this
.
getFlowingEquipRedisKey
(
companyCode
,
getApplyBizType
()),
Collections
.
singletonList
(
record
)));
setUsingData2Redis
(
record
,
companyCode
,
equipListOfUsed
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
...
...
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/FillingUseRegisterResult.java
View file @
8043834c
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
...
...
@@ -41,23 +42,13 @@ public class FillingUseRegisterResult extends BaseUseRegisterResultData {
*/
private
void
fillingEditPermission
(
JSONObject
jsonObject
)
{
jsonObject
.
put
(
HAPPEN_AFTER_BIZ
,
false
);
List
<
JgUseRegistrationEq
>
useRegistrationEqs
=
getJgUseRegistrationEqService
().
list
(
new
LambdaQueryWrapper
<
JgUseRegistrationEq
>()
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
userRegisterId
)
.
select
(
JgUseRegistrationEq:
:
getEquId
,
BaseEntity:
:
getSequenceNbr
));
for
(
JgUseRegistrationEq
useRegistrationEq
:
useRegistrationEqs
)
{
Integer
useTimes
=
getCommonMapper
().
countBizNumAfterUseReg
(
useRegistrationEq
.
getEquId
());
if
(
useTimes
>
0
)
{
log
.
warn
(
"设备:{}做过后续业务, 此使用登记:{}不可再变更设备信息"
,
useRegistrationEq
.
getEquId
(),
userRegisterId
);
jsonObject
.
put
(
HAPPEN_AFTER_BIZ
,
true
);
break
;
}
Long
useTimes
=
getCommonMapper
().
countBizNumAfterUseReg
(
userRegisterId
+
""
);
if
(
useTimes
>
0
)
{
log
.
warn
(
"此使用登记:{},存在设备做过后续业务,不可再变更设备信息"
,
userRegisterId
);
jsonObject
.
put
(
HAPPEN_AFTER_BIZ
,
true
);
}
}
private
JgUseRegistrationEqServiceImpl
getJgUseRegistrationEqService
()
{
return
applicationContext
.
getBean
(
JgUseRegistrationEqServiceImpl
.
class
);
}
private
CommonMapper
getCommonMapper
()
{
return
applicationContext
.
getBean
(
CommonMapper
.
class
);
}
...
...
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