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
93a23727
Commit
93a23727
authored
Jul 19, 2024
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
21052 改造变更登记校验设备是否在流程中
parent
7017d4f0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
21 deletions
+93
-21
JgChangeRegistrationReformMapper.java
...odule/jg/api/mapper/JgChangeRegistrationReformMapper.java
+3
-0
JgChangeRegistrationReformMapper.xml
...ain/resources/mapper/JgChangeRegistrationReformMapper.xml
+12
-1
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+4
-4
JgChangeRegistrationEquipUsedCheckImpl.java
.../service/impl/JgChangeRegistrationEquipUsedCheckImpl.java
+57
-0
JgChangeRegistrationReformServiceImpl.java
...z/service/impl/JgChangeRegistrationReformServiceImpl.java
+0
-0
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+17
-16
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/JgChangeRegistrationReformMapper.java
View file @
93a23727
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReform
;
...
...
@@ -40,4 +41,6 @@ public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeReg
String
getEquiplistNameByEquiplist
(
String
code
);
List
<
Map
<
String
,
Object
>>
getDetailById
(
@Param
(
"id"
)
Long
id
);
List
<
CompanyEquipCountDto
>
queryForFlowingEquipList
();
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationReformMapper.xml
View file @
93a23727
...
...
@@ -204,5 +204,16 @@
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
where ur.sequence_nbr = #{id}
</select>
<select
id=
"queryForFlowingEquipList"
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto"
>
select
a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_change_registration_reform a,
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.status not in('使用单位待提交','一级受理已驳回','使用单位已撤回','已作废','已完成')
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
93a23727
...
...
@@ -642,11 +642,11 @@
a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.status
<![CDATA[ <> ]]>
'使用单位待提交' and a.status
<![CDATA[ <> ]]>
'一级受理已驳回' and a.status
<![CDATA[ <> ]]>
'使用单位已撤回' and a.status
<![CDATA[ <> ]]>
'已作废')
a.sequence_nbr = b.equip_transfer_id
and a.status not in('使用单位待提交','一级受理已驳回','使用单位已撤回',
'已作废')
</select>
<select
id=
"getEquTypeByUseRegSeq"
resultType=
"java.util.Map"
>
select ur.sequence_nbr as sequenceNbr,
...
...
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/JgChangeRegistrationEquipUsedCheckImpl.java
0 → 100644
View file @
93a23727
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
*/
@Component
@Slf4j
public
class
JgChangeRegistrationEquipUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
RedissonClient
redissonClient
;
private
String
bizType
=
"changeRegistration"
;
private
JgChangeRegistrationReformMapper
mapper
;
public
JgChangeRegistrationEquipUsedCheckImpl
(
RedissonClient
redissonClient
,
JgChangeRegistrationReformMapper
mapper
)
{
this
.
redissonClient
=
redissonClient
;
this
.
mapper
=
mapper
;
}
@Override
public
RedissonClient
getRedisClient
()
{
return
redissonClient
;
}
@Override
public
String
getApplyBizType
()
{
return
bizType
;
}
@Override
public
void
init
()
{
// 初始化已经完成或者在流程中使用登记的设备数据
List
<
CompanyEquipCountDto
>
companyEquipCountDtos
=
mapper
.
queryForFlowingEquipList
();
companyEquipCountDtos
.
forEach
(
c
->
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
c
.
getCompanyCode
(),
bizType
));
rBucket
.
set
(
Arrays
.
stream
(
c
.
getRecords
().
split
(
","
)).
collect
(
Collectors
.
toSet
()));
});
}
}
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/JgChangeRegistrationReformServiceImpl.java
View file @
93a23727
This diff is collapsed.
Click to expand it.
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/JgUseRegistrationServiceImpl.java
View file @
93a23727
...
...
@@ -615,14 +615,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
void
rollBackForDelRedisData
()
{
FlowingEquipRedisContext
.
getContext
().
forEach
(
e
->
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
).
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
());
});
}
private
void
checkForRepeatUsedEquip
(
JSONObject
map
,
CompanyBo
company
)
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
// 流程中或已完成
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
equipRepeatUsedCheck
(
map
.
get
(
"equipId"
).
toString
(),
company
.
getCompanyCode
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
).
equipRepeatUsedCheck
(
map
.
get
(
"equipId"
).
toString
(),
company
.
getCompanyCode
());
}
}
...
...
@@ -630,11 +630,25 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
equList
.
forEach
(
equip
->
{
// 流程中或已完成
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
equipRepeatUsedCheck
(
equip
.
get
(
"record"
).
toString
(),
reginParams
.
getCompany
().
getCompanyCode
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
).
equipRepeatUsedCheck
(
equip
.
get
(
"record"
).
toString
(),
reginParams
.
getCompany
().
getCompanyCode
());
});
}
}
private
void
clearDataForCheckEquipRepeatUsed
(
JgUseRegistration
data
)
{
// 新查询原因 useRegistration 数据状态是旧的
JgUseRegistration
useRegistrationDb
=
this
.
getById
(
data
.
getSequenceNbr
());
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
data
.
getSequenceNbr
());
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
List
<
JgUseRegistrationEq
>
eqList
=
jgRelationEquipMapper
.
selectList
(
lambda
);
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
if
(
NOT_FLOWING_STATE
.
contains
(
useRegistrationDb
.
getStatus
()))
{
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
toList
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
data
.
getUseUnitCreditCode
());
}
}
/**
* 按单位办理
*
...
...
@@ -1535,19 +1549,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
private
void
clearDataForCheckEquipRepeatUsed
(
JgUseRegistration
useRegistration
)
{
// 新查询原因 useRegistration 数据状态是旧的
JgUseRegistration
useRegistrationDb
=
this
.
getById
(
useRegistration
.
getSequenceNbr
());
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
useRegistration
.
getSequenceNbr
());
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
List
<
JgUseRegistrationEq
>
eqList
=
jgRelationEquipMapper
.
selectList
(
lambda
);
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
if
(
NOT_FLOWING_STATE
.
contains
(
useRegistrationDb
.
getStatus
()))
{
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
toList
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
delDataForCheckEquipRepeatUsed
(
records
,
useRegistration
.
getUseUnitCreditCode
());
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteBatch
(
List
<
Long
>
ids
)
{
...
...
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