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
188135de
Commit
188135de
authored
Sep 03, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refeat(jyjc): 报检规则4.0开发
1.报检规则接口 2.3库类型数据变动消息处理器调整为观察者模式并调整流水
parent
9f86b7c3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
242 additions
and
70 deletions
+242
-70
JyjcInspectionApplicationDto.java
...mos/boot/biz/common/dto/JyjcInspectionApplicationDto.java
+6
-0
TzsDataRefreshMessageDto.java
.../boot/module/common/api/dto/TzsDataRefreshMessageDto.java
+9
-1
TzsDataRefreshMessage.java
.../boot/module/common/api/entity/TzsDataRefreshMessage.java
+17
-0
JyAgencyClassifyEnum.java
...os/boot/module/common/api/enums/JyAgencyClassifyEnum.java
+25
-0
IDataRefreshDispatch.java
.../boot/module/common/api/service/IDataRefreshDispatch.java
+1
-1
DataRefreshDispatcher.java
...le/common/biz/refresh/dispatch/DataRefreshDispatcher.java
+29
-20
RefreshHandlerFactory.java
...ule/common/biz/refresh/factory/RefreshHandlerFactory.java
+4
-10
DataRefreshListener.java
...dule/common/biz/refresh/listener/DataRefreshListener.java
+12
-8
JyjcInspectionApplication.java
...oot/module/jyjc/api/entity/JyjcInspectionApplication.java
+11
-0
InspectionCompanyType.java
...mos/boot/module/jyjc/api/enums/InspectionCompanyType.java
+3
-2
OpenBizTypeEnumV2.java
...in/amos/boot/module/jyjc/api/enums/OpenBizTypeEnumV2.java
+3
-3
JyjcOpeningApplicationMapper.java
.../module/jyjc/api/mapper/JyjcOpeningApplicationMapper.java
+14
-0
InspectionEquipInfoModel.java
.../boot/module/jyjc/api/model/InspectionEquipInfoModel.java
+4
-1
JyjcInspectionApplicationModel.java
...module/jyjc/api/model/JyjcInspectionApplicationModel.java
+7
-0
JyjcOpeningApplicationMapper.xml
...rc/main/resources/mapper/JyjcOpeningApplicationMapper.xml
+30
-0
RuleActionHandler.java
...n/amos/boot/module/jyjc/biz/action/RuleActionHandler.java
+0
-0
EnableRuleDataPreparationService.java
.../event/rule/service/EnableRuleDataPreparationService.java
+27
-7
InspectionEquipInfo.java
...n/amos/boot/module/jyjc/biz/rule/InspectionEquipInfo.java
+6
-0
JyjcOpeningApplicationServiceImpl.java
...c/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
+1
-1
TzBaseEnterpriseInfoMapper.java
...oot/module/ymt/api/mapper/TzBaseEnterpriseInfoMapper.java
+7
-0
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+26
-16
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/dto/JyjcInspectionApplicationDto.java
View file @
188135de
...
...
@@ -177,6 +177,12 @@ public class JyjcInspectionApplicationDto extends BaseModel {
@ApiModelProperty
(
value
=
"区县"
)
private
String
county
;
@ApiModelProperty
(
value
=
"电梯检测的维保单位(电梯检测批量报检使用)"
)
private
String
maintenanceUnitCode
;
@ApiModelProperty
(
value
=
"设备分类,大型游乐设施使用"
)
private
String
equipTag1
;
public
String
getProcessInstanceId
()
{
return
this
.
instanceId
!=
null
?
this
.
instanceId
:
this
.
processInstanceId
;
}
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/TzsDataRefreshMessageDto.java
View file @
188135de
...
...
@@ -17,7 +17,6 @@ public class TzsDataRefreshMessageDto extends BaseDto {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"业务数据ID"
)
private
String
dataId
;
...
...
@@ -33,4 +32,13 @@ public class TzsDataRefreshMessageDto extends BaseDto {
@ApiModelProperty
(
value
=
"错误描述"
)
private
String
errorMsg
;
@ApiModelProperty
(
value
=
"成功处理的处理器类名"
)
private
String
successDistributionHandler
;
@ApiModelProperty
(
value
=
"总分发次数"
)
private
Integer
distributions
;
@ApiModelProperty
(
value
=
"分发失败次数"
)
private
Integer
failedDistributions
;
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/TzsDataRefreshMessage.java
View file @
188135de
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
...
...
@@ -51,4 +52,20 @@ public class TzsDataRefreshMessage extends BaseEntity {
*/
@TableField
(
"error_msg"
)
private
String
errorMsg
;
/**
* 分发次数
*/
@TableField
(
"distributions"
)
private
Integer
distributions
;
/**
* 分发失败次数
*/
@TableField
(
"failed_distributions"
)
private
Integer
failedDistributions
;
@ApiModelProperty
(
value
=
"成功处理的处理器类名"
)
@TableField
(
"success_distribution_handler"
)
private
String
successDistributionHandler
;
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/JyAgencyClassifyEnum.java
0 → 100644
View file @
188135de
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@AllArgsConstructor
@Getter
public
enum
JyAgencyClassifyEnum
{
/**
* 机构分类
*/
ZJJG
(
"自检机构(丙类)"
,
"JYJGFL_ZJJG"
),
SBGY
(
"省内公益机构"
,
"JYJGFL_SBGY"
),
SBDSF
(
"省内第三方机构"
,
"JYJGFL_SBDSF"
),
SWGY
(
"省外公益机构"
,
"JYJGFL_SWGY"
),
SWDSF
(
"省外第三方机构"
,
"JYJGFL_SWDSF"
);
private
final
String
name
;
private
final
String
code
;
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDataRefreshDispatch.java
View file @
188135de
...
...
@@ -6,5 +6,5 @@ import java.util.List;
public
interface
IDataRefreshDispatch
{
void
doDispatch
(
String
dataType
,
List
<
TzsDataRefreshMessage
>
messages
);
void
doDispatch
(
List
<
IDataRefreshHandler
>
dataRefreshHandlers
,
List
<
TzsDataRefreshMessage
>
messages
);
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/refresh/dispatch/DataRefreshDispatcher.java
View file @
188135de
...
...
@@ -3,11 +3,10 @@ package com.yeejoin.amos.boot.module.common.biz.refresh.dispatch;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsDataRefreshMessage
;
import
com.yeejoin.amos.boot.module.common.api.service.IDataRefreshDispatch
;
import
com.yeejoin.amos.boot.module.common.api.service.IDataRefreshHandler
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.factory.RefreshHandlerFactory
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.TzsDataRefreshMessageServiceImpl
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
...
...
@@ -19,35 +18,45 @@ import java.util.List;
@Slf4j
public
class
DataRefreshDispatcher
implements
IDataRefreshDispatch
{
private
final
RefreshHandlerFactory
refreshHandlerFactory
;
private
final
TzsDataRefreshMessageServiceImpl
refreshMessageService
;
@Override
@Async
public
void
doDispatch
(
String
dataType
,
List
<
TzsDataRefreshMessage
>
messages
)
{
IDataRefreshHandler
dataRefreshHandler
=
refreshHandlerFactory
.
getRefreshHandler
(
dataType
);
messages
.
forEach
(
message
->
{
try
{
dataRefreshHandler
.
doRefresh
(
message
);
markRefreshSuccess
(
message
);
}
catch
(
Exception
e
)
{
log
.
error
(
"三库数据刷新执行失败,消息内容:{}, 错误日志:{}"
,
message
,
e
.
getMessage
(),
e
);
message
.
setErrorMsg
(
e
.
getMessage
());
markRefreshFailure
(
message
);
}
public
void
doDispatch
(
List
<
IDataRefreshHandler
>
dataRefreshHandlers
,
List
<
TzsDataRefreshMessage
>
messages
)
{
int
total
=
dataRefreshHandlers
.
size
();
dataRefreshHandlers
.
forEach
(
dataRefreshHandler
->
{
messages
.
forEach
(
message
->
{
try
{
message
.
setDistributions
(
total
);
dataRefreshHandler
.
doRefresh
(
message
);
markRefreshSuccess
(
message
,
dataRefreshHandler
);
}
catch
(
Exception
e
)
{
log
.
error
(
"企业、设备、人员,总线分发处理变更数据失败,消息内容:{}, 错误日志:{}"
,
message
,
e
.
getMessage
(),
e
);
markRefreshFailure
(
message
,
dataRefreshHandler
,
e
);
}
});
});
}
private
void
markRefreshSuccess
(
TzsDataRefreshMessage
message
)
{
updateMessageStatus
(
message
,
Constants
.
REFRESH_STATUS_SUCCESS
);
private
static
String
buildErrorMsg
(
IDataRefreshHandler
dataRefreshHandler
,
TzsDataRefreshMessage
message
,
Exception
e
)
{
return
StringUtils
.
isEmpty
(
message
.
getErrorMsg
())
?
dataRefreshHandler
.
getClass
().
getSimpleName
()
+
"@"
+
e
.
getMessage
()
:
message
.
getErrorMsg
()
+
";"
+
dataRefreshHandler
.
getClass
().
getSimpleName
()
+
"@"
+
e
.
getMessage
();
}
private
void
markRefreshFailure
(
TzsDataRefreshMessage
message
)
{
updateMessageStatus
(
message
,
Constants
.
REFRESH_STATUS_FAILURE
);
private
void
markRefreshSuccess
(
TzsDataRefreshMessage
message
,
IDataRefreshHandler
dataRefreshHandler
)
{
message
.
setSuccessDistributionHandler
(
message
.
getSuccessDistributionHandler
()
==
null
?
dataRefreshHandler
.
getClass
().
getSimpleName
()
:
message
.
getSuccessDistributionHandler
()
+
";"
+
dataRefreshHandler
.
getClass
().
getSimpleName
());
updateMessageStatus
(
message
);
}
private
void
updateMessageStatus
(
TzsDataRefreshMessage
message
,
Integer
status
)
{
message
.
setStatus
(
status
);
private
void
markRefreshFailure
(
TzsDataRefreshMessage
message
,
IDataRefreshHandler
dataRefreshHandler
,
Exception
e
)
{
message
.
setErrorMsg
(
buildErrorMsg
(
dataRefreshHandler
,
message
,
e
));
message
.
setFailedDistributions
(
message
.
getFailedDistributions
()
==
null
?
1
:
message
.
getFailedDistributions
()
+
1
);
updateMessageStatus
(
message
);
}
private
void
updateMessageStatus
(
TzsDataRefreshMessage
message
)
{
message
.
setRecDate
(
new
Date
());
refreshMessageService
.
saveOrUpdate
(
message
);
}
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/refresh/factory/RefreshHandlerFactory.java
View file @
188135de
...
...
@@ -8,24 +8,18 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
@Component
@RequiredArgsConstructor
public
class
RefreshHandlerFactory
{
private
final
List
<
IDataRefreshHandler
>
handlers
;
private
final
Map
<
String
,
IDataRefreshHandler
>
handlerMap
=
new
ConcurrentHashMap
<>();
private
final
Map
<
String
,
List
<
IDataRefreshHandler
>
>
handlerMap
=
new
ConcurrentHashMap
<>();
public
IDataRefreshHandler
getRefreshHandler
(
String
dataType
)
{
return
handlerMap
.
computeIfAbsent
(
dataType
,
(
k
)
->
{
for
(
IDataRefreshHandler
handler
:
handlers
)
{
if
(
handler
.
supportType
().
equals
(
dataType
))
{
return
handler
;
}
}
throw
new
BadRequest
(
"not found refresh handler for "
+
dataType
);
});
public
List
<
IDataRefreshHandler
>
getRefreshHandler
(
String
dataType
)
{
return
handlerMap
.
computeIfAbsent
(
dataType
,
(
k
)
->
handlers
.
stream
().
filter
(
handler
->
handler
.
supportType
().
equals
(
dataType
)).
collect
(
Collectors
.
toList
()));
}
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/refresh/listener/DataRefreshListener.java
View file @
188135de
...
...
@@ -3,12 +3,13 @@ package com.yeejoin.amos.boot.module.common.biz.refresh.listener;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsDataRefreshMessage
;
import
com.yeejoin.amos.boot.module.common.api.service.IDataRefreshDispatch
;
import
com.yeejoin.amos.boot.module.common.api.service.IDataRefreshHandler
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.factory.RefreshHandlerFactory
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.TzsDataRefreshMessageServiceImpl
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
...
...
@@ -18,7 +19,6 @@ import javax.annotation.PostConstruct;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
...
...
@@ -38,8 +38,9 @@ public class DataRefreshListener {
private
ExecutorService
executorService
;
@Autowired
private
Optional
<
IDataRefreshDispatch
>
dataRefreshService
;
private
final
IDataRefreshDispatch
dataRefreshService
;
private
final
RefreshHandlerFactory
refreshHandlerFactory
;
private
final
TzsDataRefreshMessageServiceImpl
tzsDataRefreshMessageService
;
...
...
@@ -69,10 +70,13 @@ public class DataRefreshListener {
private
void
processEvent
(
DataRefreshEvent
event
)
{
// 1.记录 message
List
<
TzsDataRefreshMessage
>
messages
=
createMsg
(
event
);
// 2.调用更新处理-异步
dataRefreshService
.
ifPresent
(
service
->
service
.
doDispatch
(
event
.
getDataType
(),
messages
));
List
<
IDataRefreshHandler
>
handlers
=
refreshHandlerFactory
.
getRefreshHandler
(
event
.
getDataType
());
if
(!
handlers
.
isEmpty
())
{
// 1.记录 message
List
<
TzsDataRefreshMessage
>
messages
=
createMsg
(
event
);
// 2.调用更新处理-异步
dataRefreshService
.
doDispatch
(
handlers
,
messages
);
}
}
public
List
<
TzsDataRefreshMessage
>
createMsg
(
DataRefreshEvent
event
)
{
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/entity/JyjcInspectionApplication.java
View file @
188135de
...
...
@@ -269,4 +269,15 @@ public class JyjcInspectionApplication extends BaseEntity {
@TableField
(
"plan_inspection_date"
)
private
LocalDate
planInspectionDate
;
/**
* 电梯检测的维保单位(电梯检测批量报检使用)
*/
@TableField
(
value
=
"maintenance_unit_code"
)
private
String
maintenanceUnitCode
;
/**
* 设备分类,大型游乐设施使用
*/
@TableField
(
value
=
"equip_tag1"
)
private
String
equipTag1
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/enums/InspectionCompanyType.java
View file @
188135de
...
...
@@ -15,8 +15,9 @@ public enum InspectionCompanyType {
*/
LEGAL
(
"legal"
,
"法定"
),
THIRD
(
"third"
,
"第3方"
),
DESIGNATED
(
"designated"
,
"定向单位"
),
ALL
(
"all"
,
"全部机构"
);
private
String
code
;
private
String
name
;
private
final
String
code
;
private
final
String
name
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/enums/OpenBizTypeEnumV2.java
View file @
188135de
...
...
@@ -21,12 +21,12 @@ public enum OpenBizTypeEnumV2 {
private
String
code
;
private
String
unitType
;
private
final
String
unitType
;
private
String
description
;
private
final
String
description
;
private
OpenBizTypeEnumV2
(
String
code
,
String
unitType
,
String
description
)
{
OpenBizTypeEnumV2
(
String
code
,
String
unitType
,
String
description
)
{
this
.
code
=
code
;
this
.
unitType
=
unitType
;
this
.
description
=
description
;
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcOpeningApplicationMapper.java
View file @
188135de
...
...
@@ -43,4 +43,18 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
List
<
InspectionCompanyPublicityDto
>
queryInspectionOrgListForBiz
();
List
<
JyjcOpeningApplicationVo
>
queryJyjcOpeningApplicationListByIds
(
List
<
String
>
ids
);
/**
* 查询指定机构分类的单位code列表集合
* @param agencyClassifies 机构分类
* @return 单位code列表集合
*/
List
<
String
>
selectUnitCodeListByAgencyClassify
(
@Param
(
"agencyClassifies"
)
List
<
String
>
agencyClassifies
);
/**
* 查询电梯检测的自检机构
* @param appSeq 申请表主键
* @return 发起单位自检机构 + 维保单位
*/
List
<
String
>
selectSelfDetectionUnitList
(
@Param
(
"appSeq"
)
Long
appSeq
);
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/model/InspectionEquipInfoModel.java
View file @
188135de
...
...
@@ -38,9 +38,12 @@ public class InspectionEquipInfoModel implements Serializable {
@ApiModelProperty
(
value
=
"区县"
)
private
String
county
;
@ApiModelProperty
(
value
=
"主题
,
无需上送,由topic解析出来"
)
@ApiModelProperty
(
value
=
"主题
,
无需上送,由topic解析出来"
)
private
String
componentKey
;
@ApiModelProperty
(
value
=
"申请报检单位信用代码"
)
private
String
unitCode
;
@ApiModelProperty
(
value
=
"设备分类,大型游乐设施使用"
)
private
String
equipTag1
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/model/JyjcInspectionApplicationModel.java
View file @
188135de
...
...
@@ -205,6 +205,13 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty
(
value
=
"装置id"
)
private
String
projectContraptionId
;
@ApiModelProperty
(
value
=
"电梯检测的维保单位(电梯检测批量报检使用)"
)
private
String
maintenanceUnitCode
;
@ApiModelProperty
(
value
=
"设备分类,大型游乐设施使用"
)
private
String
equipTag1
;
public
String
getProcessInstanceId
()
{
return
this
.
instanceId
!=
null
?
this
.
instanceId
:
this
.
processInstanceId
;
}
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcOpeningApplicationMapper.xml
View file @
188135de
...
...
@@ -131,4 +131,34 @@
#{id}
</foreach>
</select>
<select
id=
"selectUnitCodeListByAgencyClassify"
resultType=
"java.lang.String"
>
SELECT
distinct unit_code
FROM "tz_jyjc_opening_application"
where
status = '已完成'
and agencyClassify in
<foreach
collection=
"agencyClassifies"
separator=
","
open=
"("
close=
")"
item=
"agencyClassify"
>
#{agencyClassify}
</foreach>
</select>
<select
id=
"selectSelfDetectionUnitList"
resultType=
"java.lang.String"
>
SELECT
unit_code
from
tz_jyjc_opening_application
where
unit_code = (SELECT application_unit_code FROM "tz_jyjc_inspection_application" where sequence_nbr = #{appSeq})
and status = '已完成'
and open_biz_type = 'jc-sydw'
union all
SELECT
unit_code
from
tz_jyjc_opening_application
where
unit_code = (SELECT maintenance_unit_code FROM "tz_jyjc_inspection_application" where sequence_nbr = #{appSeq})
and status = '已完成'
and open_biz_type = 'jc-agw'
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/action/RuleActionHandler.java
View file @
188135de
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/event/rule/service/EnableRuleDataPreparationService.java
View file @
188135de
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jyjc.biz.event.rule.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationNoAcceptLog
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.JYJCTypeEnum
;
...
...
@@ -16,8 +17,10 @@ import com.yeejoin.amos.boot.module.jyjc.biz.rule.InspectionEquipInfo;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.RuleCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -25,10 +28,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
...
...
@@ -62,9 +62,21 @@ public class EnableRuleDataPreparationService {
private
final
IdxBizJgProjectContraptionMapper
jgProjectContraptionMapper
;
private
final
TzBaseEnterpriseInfoMapper
baseEnterpriseInfoMapper
;
@Value
(
"${rule.data.preparation.thread.number:2}"
)
private
int
threadNumber
;
/**
* 压力类设备种类
*/
private
static
final
List
<
String
>
PRESSURE_EQU_LIST
=
Arrays
.
asList
(
"8000"
,
"1000"
,
"2000"
);
/**
* 需要技术参数匹配报检的设备类别-目的提高执行速度
*/
private
static
final
List
<
String
>
NEED_TECH_PARAM_EQU_CATEGORY
=
Arrays
.
asList
(
"1100"
,
"2100"
);
public
void
onApplicationEvent
(
InspectionOrgRefreshEvent
event
)
{
int
queueIndex
=
Math
.
abs
(
event
.
getInspectionEquipInfoModel
().
getRecord
().
hashCode
())
%
threadNumber
;
...
...
@@ -122,10 +134,15 @@ public class EnableRuleDataPreparationService {
inspectionEquipInfo
.
setEquCategory
(
equipInfoModel
.
getEquCategory
());
inspectionEquipInfo
.
setEquList
(
equipInfoModel
.
getEquList
());
inspectionEquipInfo
.
setEquDefine
(
equipInfoModel
.
getEquDefine
());
inspectionEquipInfo
.
setTechParams
(
this
.
getTechParams
(
registrationInfo
));
inspectionEquipInfo
.
setTechParams
(
this
.
getTechParams
(
registrationInfo
,
equipInfoModel
));
// 是否球罐 0 1 转 boolean
inspectionEquipInfo
.
setIsBallValve
(!
"0"
.
equals
(
registrationInfo
.
getWhetherSphericalTank
()));
}
if
(
PRESSURE_EQU_LIST
.
contains
(
equipInfoModel
.
getEquList
()))
{
String
useCode
=
equipInfoModel
.
getUnitCode
();
TzBaseEnterpriseInfo
enterpriseInfo
=
baseEnterpriseInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzBaseEnterpriseInfo
>().
eq
(
TzBaseEnterpriseInfo:
:
getUseCode
,
useCode
).
select
(
BaseEntity:
:
getSequenceNbr
,
TzBaseEnterpriseInfo:
:
getRegulatoryLabels
));
inspectionEquipInfo
.
setManageLevel
(
enterpriseInfo
.
getRegulatoryLabels
());
}
inspectionEquipInfo
.
setAreaCode
(
ruleCommonService
.
getArea
(
equipInfoModel
.
getCity
(),
equipInfoModel
.
getCounty
()));
inspectionEquipInfo
.
setDistrictOrCountyCode
(
equipInfoModel
.
getCounty
());
inspectionEquipInfo
.
setComponentKey
(
equipInfoModel
.
getComponentKey
());
...
...
@@ -149,8 +166,11 @@ public class EnableRuleDataPreparationService {
}
private
Map
<
String
,
Object
>
getTechParams
(
RegistrationInfo
registrationInfo
)
{
return
applicationPushEventListener
.
populateEquipInfoWithTechParams
(
registrationInfo
.
getEquList
(),
registrationInfo
.
getRecord
());
private
Map
<
String
,
Object
>
getTechParams
(
RegistrationInfo
registrationInfo
,
InspectionEquipInfoModel
equipInfoModel
)
{
if
(
NEED_TECH_PARAM_EQU_CATEGORY
.
contains
(
equipInfoModel
.
getEquCategory
()))
{
return
applicationPushEventListener
.
populateEquipInfoWithTechParams
(
registrationInfo
.
getEquList
(),
registrationInfo
.
getRecord
());
}
return
new
HashMap
<>();
}
private
String
buildRequestType
(
InspectionEquipInfoModel
equipInfoModel
,
JyjcInspectionApplicationNoAcceptLog
jyjcInspectionApplicationNoAcceptLog
)
{
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/rule/InspectionEquipInfo.java
View file @
188135de
...
...
@@ -63,4 +63,10 @@ public class InspectionEquipInfo implements Serializable {
@ApiModelProperty
(
value
=
"申请表主键"
)
private
String
appSeq
;
@ApiModelProperty
(
value
=
"企业管控级别,承压类使用"
)
private
String
manageLevel
;
@ApiModelProperty
(
value
=
"设备分类,大型游乐设施使用"
)
private
String
equipTag1
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
View file @
188135de
...
...
@@ -1243,7 +1243,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
Set
<
String
>
unitCodes
=
unitLicenceList
.
stream
().
map
(
TzBaseUnitLicence:
:
getUnitCode
).
collect
(
Collectors
.
toSet
());
List
<
TzBaseEnterpriseInfoDto
>
matchEnterpriseInfos
=
new
ArrayList
<>();
// 按照资质 + areaCode,进行设备单位的筛选
if
(
unitCodes
.
size
()
>
0
)
{
if
(
!
unitCodes
.
isEmpty
()
)
{
matchEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
getInspectionUnitListByCode
(
new
ArrayList
<>(
unitCodes
),
areaCode
,
openBizType
);
}
if
(
matchEnterpriseInfos
.
isEmpty
())
{
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/TzBaseEnterpriseInfoMapper.java
View file @
188135de
...
...
@@ -108,4 +108,11 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
List
<
Map
<
String
,
String
>>
getEnterInfoWithExport
(
@Param
(
"ids"
)
List
<
String
>
ids
);
/**
* 按照不带证件类型的的单位code,重新单位-检验检测业务专用
* @param list 单位code
* @return 单位列表
*/
List
<
TzBaseEnterpriseInfoDto
>
queryInspectionUnitListByUseUnitCode
(
List
<
String
>
list
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
188135de
...
...
@@ -266,27 +266,29 @@
</if>
group by info.use_code
</select>
<select
id=
"getInspectionUnitListByCode"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto"
>
<sql
id=
"unit-list-info"
>
SELECT
info.sequence_nbr,
info.use_code,
info.use_
unit_code as use_
code,
info.use_unit,
concat(info.use
_code,'_',info.use_unit) as useCodeAndName
concat(info.use_unit
_code,'_',info.use_unit) as useCodeAndName
FROM
tz_base_enterprise_info info
INNER JOIN tz_jyjc_opening_application tjoa ON info.use_code = tjoa.unit_code
AND tjoa.status = '已完成'
and tjoa.open_biz_type = #{openBizType}
<if
test=
"list !=null and list.size()>0"
>
AND info.use_code in
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"city != null and city != ''"
>
and tjoa.detection_region like concat('%',#{city},'%')
</if>
</sql>
<select
id=
"getInspectionUnitListByCode"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto"
>
<include
refid=
"unit-list-info"
/>
INNER JOIN tz_jyjc_opening_application tjoa ON info.use_code = tjoa.unit_code
AND tjoa.status = '已完成'
and tjoa.open_biz_type = #{openBizType}
<if
test=
"list !=null and list.size()>0"
>
AND info.use_code in
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"city != null and city != ''"
>
and tjoa.detection_region like concat('%',#{city},'%')
</if>
</select>
<select
id=
"selectBySeq"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo"
>
select * from tz_base_enterprise_info where sequence_nbr = #{sequenceNbr}
...
...
@@ -388,4 +390,12 @@
</if>
</where>
</select>
<select
id=
"queryInspectionUnitListByUseUnitCode"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto"
>
<include
refid=
"unit-list-info"
/>
where
info.use_code in
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</select>
</mapper>
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