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
6f97a1ea
Commit
6f97a1ea
authored
Sep 23, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_bugfix' into develop_tzs_register
parents
2d4f8393
ddaf61c9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
135 additions
and
20 deletions
+135
-20
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+10
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+14
-0
ApplicationRunnerImpl.java
...n/amos/boot/module/jg/biz/init/ApplicationRunnerImpl.java
+14
-14
ICompensateFlowDataOfRedis.java
...oot/module/jg/biz/service/ICompensateFlowDataOfRedis.java
+31
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+0
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+23
-1
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+43
-5
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 @
6f97a1ea
...
...
@@ -123,6 +123,16 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
Integer
checkFactoryNumUniquenessForVehicleCylinder
(
String
factoryNum
,
String
sequenceNbr
);
/**
* 查询出厂编码是否重复
* @param factoryNum 出厂编码
* @param sequenceNbr id
* @return Integer
*/
Integer
checkFactoryNumUnique
(
@Param
(
"factoryNum"
)
String
factoryNum
,
@Param
(
"sequenceNbr"
)
String
sequenceNbr
,
@Param
(
"useUnitCreditCode"
)
String
useUnitCreditCode
);
/**
* 使用登记证编号全库唯一校验
* @param useRegistrationCode
* @return
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
6f97a1ea
...
...
@@ -903,6 +903,20 @@
</if>
</select>
<select
id=
"checkFactoryNumUnique"
resultType=
"java.lang.Integer"
>
SELECT
count(1)
FROM
"idx_biz_jg_factory_info" ibjfi
JOIN idx_biz_jg_register_info ibjri ON ibjfi."RECORD" = ibjri."RECORD"
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjri."RECORD" = ibjui."RECORD"
WHERE
ibjri."EQU_LIST" = '2000'
AND ibjri."EQU_CATEGORY" = '2300'
AND ibjfi."FACTORY_NUM" = #{factoryNum}
AND ibjui."USE_UNIT_CREDIT_CODE" = #{useUnitCreditCode}
</select>
<select
id=
"useRegistrationCertificateAccountUnique"
resultType=
"java.lang.Integer"
>
SELECT COUNT( 1 )
FROM idx_biz_jg_register_info jri
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/init/ApplicationRunnerImpl.java
View file @
6f97a1ea
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/ICompensateFlowDataOfRedis.java
0 → 100644
View file @
6f97a1ea
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
;
/**
* @author Administrator
* redis 数据补偿
*/
public
interface
ICompensateFlowDataOfRedis
<
T
>
{
/**
* 补偿redis数据
* @param t 参数
*/
default
void
doCompensate
(
T
t
)
{
if
(
beforeCheck
(
t
))
{
compensate
(
t
);
}
}
/**
* 补偿前校验
* @param t 参数
* @return 是否检验通过
*/
boolean
beforeCheck
(
T
t
);
/**
* 补偿实现
* @param t 参数
*/
void
compensate
(
T
t
);
}
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
6f97a1ea
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/JgInstallationNoticeServiceImpl.java
View file @
6f97a1ea
...
...
@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent;
import
com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
...
...
@@ -98,7 +99,7 @@ import static com.alibaba.fastjson.JSON.parseArray;
*/
@Service
@Slf4j
public
class
JgInstallationNoticeServiceImpl
extends
BaseService
<
JgInstallationNoticeDto
,
JgInstallationNotice
,
JgInstallationNoticeMapper
>
implements
IJgInstallationNoticeService
{
public
class
JgInstallationNoticeServiceImpl
extends
BaseService
<
JgInstallationNoticeDto
,
JgInstallationNotice
,
JgInstallationNoticeMapper
>
implements
IJgInstallationNoticeService
,
ICompensateFlowDataOfRedis
<
JgInstallationNotice
>
{
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"installationNotificationNew"
;
...
...
@@ -211,6 +212,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if
(
Objects
.
isNull
(
notice
))
{
return
null
;
}
// 流程数据补偿 防止redis缓存数据存在与数据库不一致问题
this
.
doCompensate
(
notice
);
Map
<
String
,
Object
>
installationInfo
=
BeanUtil
.
beanToMap
(
notice
,
false
,
true
);
installationInfo
.
put
(
"province"
,
notice
.
getProvince
()
+
"_"
+
notice
.
getProvinceName
());
...
...
@@ -312,6 +315,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
private
void
compensateFlowDataOfRedis
(
JgInstallationNotice
notice
)
{
if
(
notice
.
getInstanceId
()
!=
null
&&
!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()))
&&!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getCode
()))){
commonService
.
saveExecuteFlowData2Redis
(
notice
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
notice
));
}
}
private
List
<
Map
<
String
,
Object
>>
getEquipListMaps
(
Iterable
<
ESEquipmentCategoryDto
>
equips
)
{
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
equips
.
forEach
(
equip
->
{
...
...
@@ -1726,4 +1736,15 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgInstallationNoticeEqService
.
updateBatchById
(
jgInstallationNoticeEqs
);
return
Boolean
.
TRUE
;
}
@Override
public
boolean
beforeCheck
(
JgInstallationNotice
notice
)
{
return
notice
.
getInstanceId
()
!=
null
&&
!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()))
&&!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getCode
()));
}
@Override
public
void
compensate
(
JgInstallationNotice
notice
)
{
commonService
.
saveExecuteFlowData2Redis
(
notice
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
notice
));
}
}
\ No newline at end of file
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 @
6f97a1ea
...
...
@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.ymt.api.common.StringUtil
;
...
...
@@ -107,7 +108,7 @@ import static java.util.stream.Collectors.toList;
*/
@Service
@Slf4j
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
{
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
,
ICompensateFlowDataOfRedis
<
JgUseRegistration
>
{
private
static
final
String
DEFINITION_KEY
=
"useRegistration"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
);
...
...
@@ -204,6 +205,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
@Autowired
private
IdxBizJgConstructionInfoMapper
constructionInfoMapper
;
@Autowired
private
SuperviseInfoMapper
superviseInfoMapper
;
/**
* @param auditPassDate 通过时间
...
...
@@ -1685,6 +1688,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public
Map
<
String
,
Object
>
getDetail
(
String
record
,
Long
sequenceNbr
)
{
if
(!
ObjectUtils
.
isEmpty
(
sequenceNbr
))
{
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
this
.
doCompensate
(
jgUseRegistration
);
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
...
...
@@ -2423,16 +2427,40 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgUseRegistration
.
setNextExecuteUserIds
(
""
);
jgUseRegistration
.
setPromoter
(
""
);
this
.
updateById
(
jgUseRegistration
);
// 2.更新关联的业务
processElseDataByStatus
(
oldStatus
,
jgUseRegistration
);
List
<
JgUseRegistrationEq
>
eqList
=
getJgUseRegistrationEqs
(
jgUseRegistration
);
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
//判断是否为批量导入数据,作废后删除设备信息
if
(
"1"
.
equals
(
jgUseRegistration
.
getRegType
())
&&
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())){
// 构建设备删除的 DTO 列表
List
<
ESEquipmentCategoryDto
>
esDtoList
=
records
.
stream
().
map
(
v
->
{
ESEquipmentCategoryDto
esDto
=
new
ESEquipmentCategoryDto
();
esDto
.
setSEQUENCE_NBR
(
v
);
return
esDto
;
}).
collect
(
Collectors
.
toList
());
//删除涉及的19张表的数据
superviseInfoMapper
.
deleteDataAll
(
records
);
//删除es中的数据
esEquipmentCategory
.
deleteAll
(
esDtoList
);
}
else
{
// 处理非批量导入数据,更新关联业务状态
processElseDataByStatus
(
oldStatus
,
jgUseRegistration
);
// 注册事务提交后的操作
registerAfterCommitTask
(
records
);
}
return
jgUseRegistration
;
}
/**
* 注册事务提交后的同步操作
*/
private
void
registerAfterCommitTask
(
List
<
String
>
records
)
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
eventPublisher
.
publish
(
new
CancellationEvent
(
this
,
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
Collectors
.
toList
())));
// 发布作废事件
eventPublisher
.
publish
(
new
CancellationEvent
(
this
,
records
));
}
});
return
jgUseRegistration
;
}
private
void
clearUseInfoOfEquip
(
JgUseRegistration
jgUseRegistration
)
{
...
...
@@ -3360,4 +3388,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
true
;
}
@Override
public
boolean
beforeCheck
(
JgUseRegistration
jgUseRegistration
)
{
return
jgUseRegistration
.
getInstanceId
()
!=
null
&&
!
jgUseRegistration
.
getStatus
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
&&
!
jgUseRegistration
.
getStatus
().
equals
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getName
());
}
@Override
public
void
compensate
(
JgUseRegistration
jgUseRegistration
)
{
commonService
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
}
}
\ No newline at end of file
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