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
181926e9
Commit
181926e9
authored
Jun 21, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.报检规则增加不予处理
parent
ccaea804
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
30 deletions
+81
-30
RuleActionHandler.java
...n/amos/boot/module/jyjc/biz/action/RuleActionHandler.java
+0
-0
InspectionOrgRefreshListener.java
...odule/jyjc/biz/listener/InspectionOrgRefreshListener.java
+24
-28
InspectionEquipInfo.java
...n/amos/boot/module/jyjc/biz/rule/InspectionEquipInfo.java
+3
-0
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+11
-2
RuleCommonServiceImpl.java
...t/module/jyjc/biz/service/impl/RuleCommonServiceImpl.java
+43
-0
No files found.
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 @
181926e9
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/listener/InspectionOrgRefreshListener.java
View file @
181926e9
...
@@ -13,10 +13,10 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.InspectionEquipInfoModel;
...
@@ -13,10 +13,10 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.InspectionEquipInfoModel;
import
com.yeejoin.amos.boot.module.jyjc.biz.event.listener.InspectionApplicationPushEventListener
;
import
com.yeejoin.amos.boot.module.jyjc.biz.event.listener.InspectionApplicationPushEventListener
;
import
com.yeejoin.amos.boot.module.jyjc.biz.listener.message.BizMessage
;
import
com.yeejoin.amos.boot.module.jyjc.biz.listener.message.BizMessage
;
import
com.yeejoin.amos.boot.module.jyjc.biz.rule.InspectionEquipInfo
;
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.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.feign.rule.Rule
;
import
com.yeejoin.amos.feign.rule.Rule
;
import
com.yeejoin.amos.feign.rule.model.FactBaseModel
;
import
com.yeejoin.amos.feign.rule.model.FactBaseModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -53,12 +53,13 @@ public class InspectionOrgRefreshListener extends EmqxListener {
...
@@ -53,12 +53,13 @@ public class InspectionOrgRefreshListener extends EmqxListener {
@Value
(
"${inspection.rule.project-name:报检规则}"
)
@Value
(
"${inspection.rule.project-name:报检规则}"
)
private
String
ruleName
;
private
String
ruleName
;
@Autowired
@Autowired
private
EmqKeeper
emqKeeper
;
private
EmqKeeper
emqKeeper
;
@Autowired
private
RuleTrigger
ruleTrigger
;
@Autowired
@Autowired
private
AmosRequestContext
amosRequestContext
;
private
AmosRequestContext
amosRequestContext
;
@Autowired
@Autowired
private
RegistrationInfoMapper
registrationInfoMapper
;
private
RegistrationInfoMapper
registrationInfoMapper
;
...
@@ -74,13 +75,14 @@ public class InspectionOrgRefreshListener extends EmqxListener {
...
@@ -74,13 +75,14 @@ public class InspectionOrgRefreshListener extends EmqxListener {
@Autowired
@Autowired
Sequence
sequence
;
Sequence
sequence
;
@Autowired
private
static
final
int
REPEAT_TIME
=
2
;
private
static
final
int
repeatTime
=
2
;
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Autowired
RuleCommonServiceImpl
ruleCommonService
;
@Override
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
if
(
log
.
isInfoEnabled
())
{
if
(
log
.
isInfoEnabled
())
{
...
@@ -105,10 +107,10 @@ public class InspectionOrgRefreshListener extends EmqxListener {
...
@@ -105,10 +107,10 @@ public class InspectionOrgRefreshListener extends EmqxListener {
BizMessage
bizMessage
=
BLOCKING_QUEUE
.
take
();
BizMessage
bizMessage
=
BLOCKING_QUEUE
.
take
();
// 解决前端组件在属性变化时重复发送两次问题
// 解决前端组件在属性变化时重复发送两次问题
if
(!
redisUtils
.
hasKey
(
bizMessage
.
getTopic
()))
{
if
(!
redisUtils
.
hasKey
(
bizMessage
.
getTopic
()))
{
redisUtils
.
set
(
bizMessage
.
getTopic
(),
true
,
repeatTime
);
redisUtils
.
set
(
bizMessage
.
getTopic
(),
true
,
REPEAT_TIME
);
processBizMessage
(
bizMessage
);
processBizMessage
(
bizMessage
);
}
else
{
}
else
{
log
.
warn
(
"消息在{}秒内重复,"
,
repeatTime
);
log
.
warn
(
"消息在{}秒内重复,"
,
REPEAT_TIME
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"数据处理失败"
,
e
);
log
.
error
(
"数据处理失败"
,
e
);
...
@@ -133,21 +135,31 @@ public class InspectionOrgRefreshListener extends EmqxListener {
...
@@ -133,21 +135,31 @@ public class InspectionOrgRefreshListener extends EmqxListener {
inspectionEquipInfo
.
setRecord
(
equipInfoModel
.
getRecord
());
inspectionEquipInfo
.
setRecord
(
equipInfoModel
.
getRecord
());
inspectionEquipInfo
.
setBizType
(
getCategoryByType
(
JYJCTypeEnum
.
of
(
inspectionEquipInfo
.
getInspectionType
())));
inspectionEquipInfo
.
setBizType
(
getCategoryByType
(
JYJCTypeEnum
.
of
(
inspectionEquipInfo
.
getInspectionType
())));
inspectionEquipInfo
.
setUuid
(
sequence
.
nextId
()
+
""
);
inspectionEquipInfo
.
setUuid
(
sequence
.
nextId
()
+
""
);
inspectionEquipInfo
.
setRequestType
(
this
.
buildRequestType
(
equipInfoModel
));
inspectionEquipInfo
.
setTechParams
(
this
.
getTechParams
(
registrationInfo
));
inspectionEquipInfo
.
setTechParams
(
this
.
getTechParams
(
registrationInfo
));
inspectionEquipInfo
.
setAreaCode
(
ruleCommonService
.
getArea
(
equipInfoModel
.
getRecord
()));
JyjcInspectionApplicationNoAcceptLog
jyjcInspectionApplicationNoAcceptLog
=
getLastNoAcceptLog
(
equipInfoModel
);
inspectionEquipInfo
.
setRequestType
(
this
.
buildRequestType
(
equipInfoModel
,
jyjcInspectionApplicationNoAcceptLog
));
inspectionEquipInfo
.
setLastNoAcceptInspectionCode
(
this
.
buildLastNoAcceptInspectionCode
(
jyjcInspectionApplicationNoAcceptLog
));
touchRuleWithApi
(
inspectionEquipInfo
);
touchRuleWithApi
(
inspectionEquipInfo
);
}
}
private
String
buildLastNoAcceptInspectionCode
(
JyjcInspectionApplicationNoAcceptLog
jyjcInspectionApplicationNoAcceptLog
)
{
if
(
jyjcInspectionApplicationNoAcceptLog
!=
null
)
{
return
jyjcInspectionApplicationNoAcceptLog
.
getInspectionUnitCode
();
}
return
""
;
}
private
Map
<
String
,
Object
>
getTechParams
(
RegistrationInfo
registrationInfo
)
{
private
Map
<
String
,
Object
>
getTechParams
(
RegistrationInfo
registrationInfo
)
{
return
applicationPushEventListener
.
populateEquipInfoWithTechParams
(
registrationInfo
.
getEquList
(),
registrationInfo
.
getRecord
());
return
applicationPushEventListener
.
populateEquipInfoWithTechParams
(
registrationInfo
.
getEquList
(),
registrationInfo
.
getRecord
());
}
}
private
String
buildRequestType
(
InspectionEquipInfoModel
equipInfoModel
)
{
private
String
buildRequestType
(
InspectionEquipInfoModel
equipInfoModel
,
JyjcInspectionApplicationNoAcceptLog
jyjcInspectionApplicationNoAcceptLog
)
{
// 工作台发起申请
// 工作台发起申请
if
(
StringUtils
.
isEmpty
(
equipInfoModel
.
getAppSeq
()))
{
if
(
StringUtils
.
isEmpty
(
equipInfoModel
.
getAppSeq
()))
{
return
RequestTypeEnum
.
FIRST_REQUEST
.
getCode
();
return
RequestTypeEnum
.
FIRST_REQUEST
.
getCode
();
}
}
JyjcInspectionApplicationNoAcceptLog
jyjcInspectionApplicationNoAcceptLog
=
getLastNoAcceptLog
(
equipInfoModel
);
// 没有不予受理请求记录
// 没有不予受理请求记录
if
(
jyjcInspectionApplicationNoAcceptLog
==
null
)
{
if
(
jyjcInspectionApplicationNoAcceptLog
==
null
)
{
return
RequestTypeEnum
.
FIRST_REQUEST
.
getCode
();
return
RequestTypeEnum
.
FIRST_REQUEST
.
getCode
();
...
@@ -159,7 +171,7 @@ public class InspectionOrgRefreshListener extends EmqxListener {
...
@@ -159,7 +171,7 @@ public class InspectionOrgRefreshListener extends EmqxListener {
private
JyjcInspectionApplicationNoAcceptLog
getLastNoAcceptLog
(
InspectionEquipInfoModel
equipInfoModel
)
{
private
JyjcInspectionApplicationNoAcceptLog
getLastNoAcceptLog
(
InspectionEquipInfoModel
equipInfoModel
)
{
LambdaQueryWrapper
<
JyjcInspectionApplicationNoAcceptLog
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
JyjcInspectionApplicationNoAcceptLog
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
JyjcInspectionApplicationNoAcceptLog:
:
getApplicationSeq
,
equipInfoModel
.
getAppSeq
());
wrapper
.
eq
(
JyjcInspectionApplicationNoAcceptLog:
:
getApplicationSeq
,
equipInfoModel
.
getAppSeq
());
wrapper
.
orderByDesc
(
JyjcInspectionApplicationNoAcceptLog:
:
get
NoAccept
Date
);
wrapper
.
orderByDesc
(
JyjcInspectionApplicationNoAcceptLog:
:
get
Rec
Date
);
wrapper
.
last
(
"limit 1"
);
wrapper
.
last
(
"limit 1"
);
wrapper
.
select
(
JyjcInspectionApplicationNoAcceptLog:
:
getApplicationSeq
,
JyjcInspectionApplicationNoAcceptLog:
:
getInspectionUnitCode
);
wrapper
.
select
(
JyjcInspectionApplicationNoAcceptLog:
:
getApplicationSeq
,
JyjcInspectionApplicationNoAcceptLog:
:
getInspectionUnitCode
);
return
inspectionApplicationNoAcceptLogMapper
.
selectOne
(
wrapper
);
return
inspectionApplicationNoAcceptLogMapper
.
selectOne
(
wrapper
);
...
@@ -172,22 +184,6 @@ public class InspectionOrgRefreshListener extends EmqxListener {
...
@@ -172,22 +184,6 @@ public class InspectionOrgRefreshListener extends EmqxListener {
.
eq
(
RegistrationInfo:
:
getRecord
,
record
));
.
eq
(
RegistrationInfo:
:
getRecord
,
record
));
}
}
private
void
touchRuleWithMsg
(
InspectionEquipInfo
inspectionEquipInfo
)
{
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"发送规则的消息对象:{}"
,
toJSONString
(
inspectionEquipInfo
));
}
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
RequestContext
.
setAppKey
(
amosRequestContext
.
getAppKey
());
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
// 2.调用规则
try
{
ruleTrigger
.
publish
(
inspectionEquipInfo
,
ruleName
+
"/"
+
inspectionEquipInfo
.
getBizType
(),
null
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用规则触发获取报检规则失败"
,
e
);
}
}
private
void
touchRuleWithApi
(
InspectionEquipInfo
inspectionEquipInfo
)
{
private
void
touchRuleWithApi
(
InspectionEquipInfo
inspectionEquipInfo
)
{
if
(
log
.
isInfoEnabled
())
{
if
(
log
.
isInfoEnabled
())
{
log
.
info
(
"发送规则的消息对象:{}"
,
toJSONString
(
inspectionEquipInfo
));
log
.
info
(
"发送规则的消息对象:{}"
,
toJSONString
(
inspectionEquipInfo
));
...
...
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 @
181926e9
...
@@ -51,4 +51,7 @@ public class InspectionEquipInfo implements Serializable {
...
@@ -51,4 +51,7 @@ public class InspectionEquipInfo implements Serializable {
@ApiModelProperty
(
value
=
"最近不受理检验机构code"
)
@ApiModelProperty
(
value
=
"最近不受理检验机构code"
)
private
String
lastNoAcceptInspectionCode
;
private
String
lastNoAcceptInspectionCode
;
@ApiModelProperty
(
value
=
"所在区域"
)
private
String
areaCode
;
}
}
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/JyjcInspectionApplicationServiceImpl.java
View file @
181926e9
...
@@ -177,6 +177,12 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -177,6 +177,12 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
private
static
final
String
SUMMIT_TYPE
=
"0"
;
private
static
final
String
SUMMIT_TYPE
=
"0"
;
/**
* 省特检院等特殊公司code
*/
@Value
(
"${shanxi.tjy.code:126100004352004822}"
)
private
String
shanxiCompanyCode
;
@Autowired
@Autowired
RestHighLevelClient
restHighLevelClient
;
RestHighLevelClient
restHighLevelClient
;
...
@@ -565,6 +571,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -565,6 +571,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
public
Map
<
String
,
Object
>
selectBySeq
(
Long
sequenceNbr
)
{
public
Map
<
String
,
Object
>
selectBySeq
(
Long
sequenceNbr
)
{
JyjcInspectionApplicationModel
model
=
this
.
getBaseMapper
().
selectDataBySeq
(
sequenceNbr
);
JyjcInspectionApplicationModel
model
=
this
.
getBaseMapper
().
selectDataBySeq
(
sequenceNbr
);
int
times
=
noAcceptLogService
.
count
(
new
LambdaQueryWrapper
<
JyjcInspectionApplicationNoAcceptLog
>().
eq
(
JyjcInspectionApplicationNoAcceptLog:
:
getApplicationSeq
,
sequenceNbr
).
eq
(
JyjcInspectionApplicationNoAcceptLog:
:
getInspectionUnitCode
,
shanxiCompanyCode
));
Map
<
String
,
Object
>
map
=
BeanUtil
.
beanToMap
(
model
);
Map
<
String
,
Object
>
map
=
BeanUtil
.
beanToMap
(
model
);
List
<
Map
<
String
,
Object
>>
dataByApplicationSeq
=
jyjcInspectionApplicationAttachmentService
.
getBaseMapper
().
getDataByApplicationSeq
(
sequenceNbr
);
List
<
Map
<
String
,
Object
>>
dataByApplicationSeq
=
jyjcInspectionApplicationAttachmentService
.
getBaseMapper
().
getDataByApplicationSeq
(
sequenceNbr
);
Map
<
String
,
Object
>
attMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
attMap
=
new
HashMap
<>();
...
@@ -599,6 +606,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -599,6 +606,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
map
.
put
(
"equip"
,
arrayList
);
map
.
put
(
"equip"
,
arrayList
);
}
}
map
.
putAll
(
attMap
);
map
.
putAll
(
attMap
);
// 陕西特检验院不予首次的次数
map
.
put
(
"sytjybyslcs"
,
times
);
this
.
setPlanData
(
sequenceNbr
,
map
);
this
.
setPlanData
(
sequenceNbr
,
map
);
return
map
;
return
map
;
}
}
...
@@ -869,7 +878,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -869,7 +878,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
task
.
setTaskId
(
taskId
);
task
.
setTaskId
(
taskId
);
task
.
setComment
(
params
.
getOrDefault
(
"comments"
,
""
).
toString
());
task
.
setComment
(
params
.
getOrDefault
(
"comments"
,
""
).
toString
());
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
"
1
"
);
map
.
put
(
"approvalStatus"
,
"
8
"
);
task
.
setVariable
(
map
);
task
.
setVariable
(
map
);
//执行流程
//执行流程
task
.
setNextExecuteUserCompanyCode
(
model
.
getInspectionUnitCode
());
task
.
setNextExecuteUserCompanyCode
(
model
.
getInspectionUnitCode
());
...
@@ -1063,7 +1072,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -1063,7 +1072,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
TaskModelDto
modelDto
=
new
TaskModelDto
();
TaskModelDto
modelDto
=
new
TaskModelDto
();
BeanUtil
.
copyProperties
(
taskV2Model
,
modelDto
);
BeanUtil
.
copyProperties
(
taskV2Model
,
modelDto
);
modelDto
.
setNextExecuteUser
(
model
.
getNextExecuteIds
());
modelDto
.
setNextExecuteUser
(
model
.
getNextExecuteIds
());
if
(
model
.
getStatus
().
equals
(
FlowStatusEnum
.
REJECTED
.
getCode
()
+
""
)
||
model
.
getStatus
().
equals
(
FlowStatusEnum
.
NO_ACCEPT
.
getCode
()
+
""
)
)
{
if
(
model
.
getStatus
().
equals
(
FlowStatusEnum
.
REJECTED
.
getCode
()
+
""
))
{
modelDto
.
setPageType
(
"edit"
);
modelDto
.
setPageType
(
"edit"
);
}
}
TaskMessageDto
obj
=
new
TaskMessageDto
();
TaskMessageDto
obj
=
new
TaskMessageDto
();
...
...
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/RuleCommonServiceImpl.java
0 → 100644
View file @
181926e9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
/**
* @author Administrator
*/
@Component
public
class
RuleCommonServiceImpl
{
private
UseInfoMapper
useInfoMapper
;
/**
* 特殊独立的区县
*/
private
static
final
String
[]
EXCLUSION_CITY_REGIONS
=
{
"610403"
,
"610581"
};
public
RuleCommonServiceImpl
(
UseInfoMapper
useInfoMapper
)
{
this
.
useInfoMapper
=
useInfoMapper
;
}
public
String
getArea
(
String
record
)
{
UseInfo
equipUseInfo
=
useInfoMapper
.
selectOne
(
Wrappers
.<
UseInfo
>
lambdaQuery
().
select
(
UseInfo:
:
getCity
,
UseInfo:
:
getCounty
).
eq
(
UseInfo:
:
getRecord
,
record
));
if
(
equipUseInfo
==
null
)
{
return
""
;
}
// 特殊地区特殊处理,目前有韩城、杨凌,原因行政区划上是有层级的,但是业务办理时,他们与所在地市是同级别的
if
(
StringUtils
.
isEmpty
(
equipUseInfo
.
getCity
())
||
StringUtils
.
isEmpty
(
equipUseInfo
.
getCounty
()))
{
return
""
;
}
if
(
Arrays
.
asList
(
EXCLUSION_CITY_REGIONS
).
contains
(
equipUseInfo
.
getCounty
()))
{
return
equipUseInfo
.
getCounty
();
}
return
equipUseInfo
.
getCity
();
}
}
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