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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
192 additions
and
36 deletions
+192
-36
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
+57
-16
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
...
...
@@ -103,81 +103,81 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
@Override
public
void
run
(
ApplicationArguments
args
)
{
//
TODO 增加删除启动时, 完成时
//
流程最新的任务id缓存,流程执行时并发校验
// 使用登记数据初始化
List
<
JgUseRegistration
>
jgUseRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
ne
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgUseRegistration
>
jgUseRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
ne
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgUseRegistration:
:
getInstanceId
)
);
jgUseRegistrations
.
forEach
(
jgUseRegistration
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
useRegistrationService
.
buildInstanceRuntimeData
(
jgUseRegistration
));
});
// 安装告知数据初始化
List
<
JgInstallationNotice
>
jgInstallationNotices
=
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>().
ne
(
JgInstallationNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgInstallationNotice
>
jgInstallationNotices
=
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>().
ne
(
JgInstallationNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgInstallationNotice:
:
getInstanceId
)
);
jgInstallationNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
installationNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 维修告知数据初始化
List
<
JgMaintainNotice
>
jgMaintainNotices
=
jgMaintainNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgMaintainNotice
>().
ne
(
JgMaintainNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgMaintainNotice
>
jgMaintainNotices
=
jgMaintainNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgMaintainNotice
>().
ne
(
JgMaintainNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgMaintainNotice:
:
getInstanceId
)
);
jgMaintainNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgMaintainNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 改造告知数据初始化
List
<
JgReformNotice
>
jgReformNotices
=
jgReformNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgReformNotice
>().
ne
(
JgReformNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgReformNotice
>
jgReformNotices
=
jgReformNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgReformNotice
>().
ne
(
JgReformNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgReformNotice:
:
getInstanceId
)
);
jgReformNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgReformNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 移装告知数据初始化
List
<
JgTransferNotice
>
jgTransferNotices
=
jgTransferNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgTransferNotice
>().
ne
(
JgTransferNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgTransferNotice
>
jgTransferNotices
=
jgTransferNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgTransferNotice
>().
ne
(
JgTransferNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgTransferNotice:
:
getInstanceId
)
);
jgTransferNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgTransferNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 设备移交数据初始化
List
<
JgEquipTransfer
>
jgEquipTransfers
=
jgEquipTransferService
.
list
(
new
LambdaQueryWrapper
<
JgEquipTransfer
>().
ne
(
JgEquipTransfer:
:
getApplyStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgEquipTransfer
>
jgEquipTransfers
=
jgEquipTransferService
.
list
(
new
LambdaQueryWrapper
<
JgEquipTransfer
>().
ne
(
JgEquipTransfer:
:
getApplyStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgEquipTransfer:
:
getInstanceId
)
);
jgEquipTransfers
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgEquipTransferService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 移转变更登记数据初始化
List
<
JgChangeRegistrationTransfer
>
jgChangeRegistrationTransfers
=
changeRegistrationTransferService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationTransfer
>().
ne
(
JgChangeRegistrationTransfer:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationTransfer
>
jgChangeRegistrationTransfers
=
changeRegistrationTransferService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationTransfer
>().
ne
(
JgChangeRegistrationTransfer:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationTransfer:
:
getInstanceId
)
);
jgChangeRegistrationTransfers
.
forEach
(
jgChangeRegistrationTransfer
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgChangeRegistrationTransfer
.
getInstanceId
(),
changeRegistrationTransferService
.
buildInstanceRuntimeData
(
jgChangeRegistrationTransfer
));
});
// 改造变更登记数据初始化
List
<
JgChangeRegistrationReform
>
jgChangeRegistrationReforms
=
changeRegistrationReformService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationReform
>().
ne
(
JgChangeRegistrationReform:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationReform
>
jgChangeRegistrationReforms
=
changeRegistrationReformService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationReform
>().
ne
(
JgChangeRegistrationReform:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationReform:
:
getInstanceId
)
);
jgChangeRegistrationReforms
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
changeRegistrationReformService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 单位变更登记数据初始化
List
<
JgChangeRegistrationUnit
>
jgChangeRegistrationUnits
=
changeRegistrationUnitService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnit
>().
ne
(
JgChangeRegistrationUnit:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationUnit
>
jgChangeRegistrationUnits
=
changeRegistrationUnitService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnit
>().
ne
(
JgChangeRegistrationUnit:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationUnit:
:
getInstanceId
)
);
jgChangeRegistrationUnits
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
changeRegistrationUnitService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 启用停用登记数据初始化
List
<
JgEnableDisable
>
jgEnableDisables
=
jgEnableDisableService
.
list
(
new
LambdaQueryWrapper
<
JgEnableDisable
>().
ne
(
JgEnableDisable:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgEnableDisable
>
jgEnableDisables
=
jgEnableDisableService
.
list
(
new
LambdaQueryWrapper
<
JgEnableDisable
>().
ne
(
JgEnableDisable:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgEnableDisable:
:
getInstanceId
)
);
jgEnableDisables
.
forEach
(
jgEnableDisable
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgEnableDisable
.
getInstanceId
(),
jgEnableDisableService
.
buildInstanceRuntimeData
(
jgEnableDisable
));
});
// 维保备案登记数据初始化
List
<
JgMaintenanceContract
>
jgMaintenanceContracts
=
maintenanceContractService
.
list
(
new
LambdaQueryWrapper
<
JgMaintenanceContract
>().
ne
(
JgMaintenanceContract:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgMaintenanceContract
>
jgMaintenanceContracts
=
maintenanceContractService
.
list
(
new
LambdaQueryWrapper
<
JgMaintenanceContract
>().
ne
(
JgMaintenanceContract:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgMaintenanceContract:
:
getInstanceId
)
);
jgMaintenanceContracts
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
maintenanceContractService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
// 注销报废登记数据初始化
List
<
JgScrapCancel
>
jgScrapCancels
=
scrapCancelService
.
list
(
new
LambdaQueryWrapper
<
JgScrapCancel
>().
ne
(
JgScrapCancel:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgScrapCancel
>
jgScrapCancels
=
scrapCancelService
.
list
(
new
LambdaQueryWrapper
<
JgScrapCancel
>().
ne
(
JgScrapCancel:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgScrapCancel:
:
getInstanceId
)
);
jgScrapCancels
.
forEach
(
jgScrapCancel
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgScrapCancel
.
getInstanceId
(),
scrapCancelService
.
buildInstanceRuntimeData
(
jgScrapCancel
));
});
// 单位名称变更数据初始化
List
<
JgChangeRegistrationName
>
jgChangeRegistrationNames
=
changeRegistrationNameService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationName
>().
ne
(
JgChangeRegistrationName:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationName
>
jgChangeRegistrationNames
=
changeRegistrationNameService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationName
>().
ne
(
JgChangeRegistrationName:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationName:
:
getInstanceId
)
);
jgChangeRegistrationNames
.
forEach
(
registrationName
->
{
commonService
.
saveExecuteFlowData2Redis
(
registrationName
.
getInstanceId
(),
changeRegistrationNameService
.
buildInstanceRuntimeData
(
registrationName
));
});
...
...
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
...
...
@@ -448,6 +448,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
private
void
checkFactoryNumUnique
(
String
factoryNum
,
String
useUnitCreditCode
,
StringBuilder
result
)
{
// 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)
if
(
commonMapper
.
checkFactoryNumUnique
(
factoryNum
,
null
,
useUnitCreditCode
)
>
0
)
{
result
.
append
(
"出厂编号/产品编码在该企业中已存在!"
);
}
}
private
void
handleError
(
Exception
e
,
String
record
)
{
log
.
error
(
"处理异常: "
+
e
.
getMessage
(),
e
);
// 删除数据库数据和ES数据
...
...
@@ -2758,25 +2765,30 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Override
public
Object
importPressureData
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
EquipInfoCylinderExcelDto
>
aircraftList
=
new
ArrayList
<>();
List
<
String
>
errorList
=
new
ArrayList
<>();
// 临时错误列表,用于批量插入
List
<
String
>
innerCodeList
=
new
ArrayList
<>();
// 临时列表
List
<
String
>
codeList
=
new
ArrayList
<>();
List
<
String
>
factoryList
=
new
ArrayList
<>();
resultError
.
clear
();
useInnerCodeList
.
clear
();
equCodeList
.
clear
();
factoryNumList
.
clear
();
try
{
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
EquipInfoCylinderExcelDto
.
class
,
new
AnalysisEventListener
<
EquipInfoCylinderExcelDto
>()
{
// 每读取一行
就调用该方法
// 每读取一行
时调用
@Override
public
void
invoke
(
EquipInfoCylinderExcelDto
data
,
AnalysisContext
context
)
{
EquipInfoCylinderExcelDto
fireExperts
=
new
EquipInfoCylinderExcelDto
();
BeanUtils
.
copyProperties
(
data
,
fireExperts
);
resultError
.
add
(
checkExcelData
(
data
,
context
).
toString
());
aircraftList
.
add
(
fireExperts
);
useInnerCodeList
.
add
(
data
.
getUseInnerCode
());
equCodeList
.
add
(
data
.
getEquCode
());
factoryNumList
.
add
(
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
())
?
data
.
getFactoryNum
()
:
null
);
// 直接操作原数据,避免不必要的对象复制
errorList
.
add
(
checkExcelData
(
data
,
context
).
toString
());
aircraftList
.
add
(
data
);
// 直接加入原对象,而不是复制
innerCodeList
.
add
(
data
.
getUseInnerCode
());
codeList
.
add
(
data
.
getEquCode
());
factoryList
.
add
(
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
())
?
data
.
getFactoryNum
()
:
null
);
}
// 全部读取完成
就调用该方法
// 全部读取完成
后调用
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
if
(
CollectionUtils
.
isEmpty
(
aircraftList
))
{
...
...
@@ -2784,13 +2796,23 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
resultError
.
add
(
"你上传了一个空数据的Excel文档!"
);
throw
new
BadRequest
(
"你上传了一个空数据的Excel文档!"
);
}
// 批量添加,减少集合操作的次数
resultError
.
addAll
(
errorList
);
useInnerCodeList
.
addAll
(
innerCodeList
);
equCodeList
.
addAll
(
codeList
);
factoryNumList
.
addAll
(
factoryList
);
}
}).
headRowNumber
(
4
).
sheet
().
doRead
();
// 检查错误
if
(
resultError
.
stream
().
anyMatch
(
input
->
!
input
.
isEmpty
()))
{
throw
new
BadRequest
(
"上传失败!"
);
}
return
aircraftList
;
}
catch
(
Exception
e
)
{
// 处理并抛出所有错误
throw
new
Exception
(
resultError
.
stream
()
.
filter
(
s
->
!
s
.
isEmpty
())
.
collect
(
Collectors
.
joining
(
"<br/>"
)));
...
...
@@ -3059,11 +3081,20 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
put
(
"equDefineName"
,
equipInfoDto
.
getEquDefine
())
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
())
.
put
(
"chargingMedium"
,
data
.
getChargingMedium
())
.
put
(
"productName"
,
data
.
getProductName
())
.
put
(
"produceUnitName"
,
factoryInfo
.
getProduceUnitName
())
.
put
(
"produceDate"
,
esEquipmentDto
.
getPRODUCE_DATE
())
.
put
(
"nominalWorkingPressure"
,
data
.
getNominalWorkingPressure
())
.
put
(
"singleBottleVolume"
,
data
.
getSingleBottleVolume
())
.
put
(
"singleBottleVolume"
,
data
.
getSingleBottleVolume
())
.
put
(
"inspectDate"
,
data
.
getInspectDate
())
.
put
(
"equList"
,
equipInfoDto
.
getEquListCode
())
.
put
(
"equListName"
,
equipInfoDto
.
getEquList
())
.
put
(
"equDefine"
,
equipInfoDto
.
getEquDefineCode
())
.
put
(
"equDefineName"
,
equipInfoDto
.
getEquDefine
())
.
put
(
"equCategoryName"
,
equipInfoDto
.
getEquCategory
())
.
put
(
"manageType"
,
"unit"
)
.
put
(
"equCategory"
,
equipInfoDto
.
getEquCategoryCode
())
.
put
(
"record"
,
esEquipmentDto
.
getSEQUENCE_NBR
())
.
put
(
"nextInspectDate"
,
inspectionDetectionInfo
.
getNextInspectDate
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
...
...
@@ -3082,14 +3113,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
eq
(
JgUseRegistrationManage:
:
getIsDelete
,
0
)
.
eq
(
JgUseRegistrationManage:
:
getCertificateStatus
,
"已登记"
);
JgUseRegistrationManage
jgUseRegistrationManage
=
jgUseRegistrationManageService
.
getBaseMapper
().
selectOne
(
queryWrapper
);
// 使用登记信息
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
//历史增补
if
(!
ValidationUtil
.
isEmpty
(
jgUseRegistrationManage
))
{
jgUseRegistration
.
setIsAddEquip
(
"1"
);
if
(
jgUseRegistrationManage
.
getUseUnitCreditCode
().
equals
(
company
.
getCompanyCode
()))
{
jgUseRegistrationManage
.
setUseUnitName
(
company
.
getCompanyName
());
jgUseRegistrationManage
.
setReceiveOrgName
(
equipInfoDto
.
getReceiveOrgName
());
jgUseRegistrationManage
.
setAuditPassDate
(
new
Date
());
jgUseRegistrationManage
.
setRegDate
(
new
Date
());
jgUseRegistrationManage
.
setManageType
(
"unit"
);
jgUseRegistrationManage
.
setApplyNo
(
this
.
getApplicationNo
());
jgUseRegistrationManage
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
jgUseRegistrationManage
.
setReceiveCompanyCode
(
equipInfoDto
.
getReceiveOrgCode
());
...
...
@@ -3098,16 +3132,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
throw
new
BadRequest
(
"该使用登记证编号系统已存在,请核对使用登记证编号后,重新上传!"
);
}
}
else
{
jgUseRegistration
.
setIsAddEquip
(
"0"
);
jgUseRegistrationManage
=
this
.
saveRegistrationManage
(
equipInfoDto
,
company
);
}
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
jgUseRegistrationManage
,
changeRecordId
);
// 使用登记信息
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
jgUseRegistration
.
setRegDate
(
new
Date
());
jgUseRegistration
.
setReceiveCompanyCode
(
equipInfoDto
.
getReceiveOrgCode
());
jgUseRegistration
.
setReceiveOrgName
(
equipInfoDto
.
getReceiveOrgName
());
jgUseRegistration
.
setManageType
(
"unit"
);
jgUseRegistration
.
setCylinderCategory
(
registerInfoList
.
get
(
0
).
getCylinderCategory
());
jgUseRegistration
.
setReceiveCompanyOrgCode
(
commonService
.
getOneCompany
(
jgUseRegistration
.
getReceiveCompanyCode
()).
getOrgCode
());
//使用单位提交
jgUseRegistration
.
setUseUnitName
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
...
...
@@ -3128,6 +3163,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
JSONObject
objectHashMap
=
new
JSONObject
();
BeanUtil
.
beanToMap
(
jgUseRegistration
,
objectHashMap
,
false
,
false
);
objectHashMap
.
put
(
"equipmentLists"
,
equipmentLists
);
objectHashMap
.
put
(
"EQU_CATEGORY_CODE"
,
equipInfoDto
.
getEquCategoryCode
());
updateHistory
(
objectHashMap
,
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()));
}
...
...
@@ -3268,6 +3304,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
public
StringBuilder
checkExcelData
(
EquipInfoCylinderExcelDto
data
,
AnalysisContext
context
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
CompanyBo
company
=
reginParams
.
getCompany
();
StringBuilder
result
=
new
StringBuilder
();
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
int
rowIndex
=
readRowHolder
.
getRowIndex
()
+
1
;
...
...
@@ -3316,8 +3355,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
result
.
append
(
"出厂编号/产品编码不能重复;"
);
}
checkNotBlank
(
data
.
getCylinderCategory
(),
"气瓶分类不能为空;"
,
result
);
checkFactoryNumUnique
(
data
.
getFactoryNum
(),
company
.
getCompanyCode
(),
result
);
}
else
{
checkFactoryNumUniquenessForVehicleCylinder
(
data
.
getFactoryNum
(),
result
);
}
checkFactoryNumUniqueness
(
data
.
getFactoryNum
(),
null
,
result
);
checkNotBlank
(
data
.
getProduceDate
(),
"制造日期不能为空;"
,
result
);
Optional
.
ofNullable
(
data
.
getProduceDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"制造日期格式不正确;"
,
result
));
checkNotBlank
(
data
.
getInspectOrgName
(),
"检测机构名称不能为空;"
,
result
);
...
...
@@ -3361,7 +3402,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 检查上传Excel中的日期格式是否正确
private
void
checkDateFormatCorrect
(
String
date
,
String
errorMessage
,
StringBuilder
result
)
{
if
(!
date
.
matches
(
"\\d{4}-\\d{2}-\\d{2}"
))
{
if
(!
date
.
matches
(
"
(?!1905)
\\d{4}-\\d{2}-\\d{2}"
))
{
result
.
append
(
errorMessage
);
}
}
...
...
@@ -3380,9 +3421,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
private
void
checkFactoryNumUniqueness
(
String
factoryNum
,
String
sequenceNbr
,
StringBuilder
result
)
{
private
void
checkFactoryNumUniqueness
ForVehicleCylinder
(
String
factoryNum
,
StringBuilder
result
)
{
// 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)
if
(
commonService
.
checkFactoryNumUniquenessForVehicleCylinder
(
factoryNum
,
sequenceNbr
)
>
0
)
{
if
(
commonService
.
checkFactoryNumUniquenessForVehicleCylinder
(
factoryNum
,
null
)
>
0
)
{
result
.
append
(
"出厂编号/产品编码系统中已存在!"
);
}
}
...
...
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