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
08d3fbd3
Commit
08d3fbd3
authored
Nov 29, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改特种设备问题
parent
83ef4276
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
96 additions
and
30 deletions
+96
-30
TzsJgMapper.java
.../yeejoin/amos/boot/module/tzs/api/mapper/TzsJgMapper.java
+3
-1
TzsJgMapper.xml
...-module-tzs-api/src/main/resources/mapper/TzsJgMapper.xml
+15
-12
WarningMsgAction.java
...oin/amos/boot/module/tzs/biz/action/WarningMsgAction.java
+17
-2
MsgLogController.java
...amos/boot/module/tzs/biz/controller/MsgLogController.java
+1
-5
MsgLogServiceImpl.java
...s/boot/module/tzs/biz/service/impl/MsgLogServiceImpl.java
+1
-0
TzsJgServiceImpl.java
...os/boot/module/tzs/biz/service/impl/TzsJgServiceImpl.java
+32
-10
ScheduleService.java
...boot/module/tzs/flc/biz/service/impl/ScheduleService.java
+27
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/TzsJgMapper.java
View file @
08d3fbd3
...
...
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.annotations.DataAuth
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.TzsJgBasicInfoDto
;
import
java.util.Set
;
public
interface
TzsJgMapper
{
@DataAuth
(
interfacePath
=
"equipment"
)
IPage
<
TzsJgBasicInfoDto
>
page
(
Page
<
TzsJgBasicInfoDto
>
page
,
TzsJgBasicInfoDto
tzsJgBasicInfoDto
);
IPage
<
TzsJgBasicInfoDto
>
page
(
Page
<
TzsJgBasicInfoDto
>
page
,
TzsJgBasicInfoDto
tzsJgBasicInfoDto
,
Set
<
String
>
categoryCodes
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/TzsJgMapper.xml
View file @
08d3fbd3
...
...
@@ -14,13 +14,14 @@
use1.estate_unit_name,
registration.equ_code,
registration.equ_category,
registration.equ_define,
ec.`name` AS equ_define,
registration.equ_define AS equ_define_code,
other.code96333,
registration.use_org_code,
produce.factory_num,
CONCAT(use1.province,'/',use1.city,'/',use1.county)AS area,
use1.address
FROM tz_jg_use_info use1
FROM tz_jg_use_info use1
LEFT JOIN
tz_jg_supervise_info supervise ON use1.sequence_code =
supervise.sequence_code
...
...
@@ -37,7 +38,19 @@
LEFT JOIN
tz_jg_produce_info produce ON produce.sequence_code =
supervise.sequence_code
LEFT JOIN tz_equipment_category ec ON ec.`code` = registration.equ_define
<where>
<if
test=
"categoryCodes != null and categoryCodes.size>0"
>
and ( registration.equ_define in
<foreach
collection=
"categoryCodes"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
or registration.equ_category in
<foreach
collection=
"categoryCodes"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)
</if>
<if
test=
"tzsJgBasicInfoDto.orgBranchCode!=null and tzsJgBasicInfoDto.orgBranchCode!='' "
>
AND supervise.org_branch_code LIKE
...
...
@@ -69,16 +82,6 @@
CONCAT('%',#{tzsJgBasicInfoDto.equCode},'%')
</if>
<if
test=
"tzsJgBasicInfoDto.equCategory!=null and tzsJgBasicInfoDto.equCategory!='' "
>
AND registration.equ_category LIKE
CONCAT('%',#{tzsJgBasicInfoDto.equCategory},'%')
</if>
<if
test=
"tzsJgBasicInfoDto.equDefine!=null and tzsJgBasicInfoDto.equDefine!='' "
>
AND registration.equ_define LIKE
CONCAT('%',#{tzsJgBasicInfoDto.equDefine},'%')
</if>
<if
test=
"tzsJgBasicInfoDto.code96333!=null and tzsJgBasicInfoDto.code96333!='' "
>
AND other.code96333 LIKE
CONCAT('%',#{tzsJgBasicInfoDto.code96333},'%')
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/action/WarningMsgAction.java
View file @
08d3fbd3
...
...
@@ -4,12 +4,15 @@ import java.io.UnsupportedEncodingException;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WarningMsgDto
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.WarningEnum
;
import
liquibase.pro.packaged.L
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -31,6 +34,7 @@ import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatServiceImpl;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.CylinderInfoServiceImpl
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleMethod
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
@Component
@RuleActionBean
(
beanLabel
=
"预警消息"
)
...
...
@@ -57,12 +61,23 @@ public class WarningMsgAction{
public
void
sendWebMessageTip
(
Object
bizobj
,
String
level
,
String
orgUserName
,
String
phone
,
String
text
)
{
WarningMsgDto
warningMsgDto
=
(
WarningMsgDto
)
bizobj
;
List
<
MsgLog
>
msgLogList
=
msgLogServiceImpl
.
list
(
new
LambdaQueryWrapper
<
MsgLog
>().
eq
(
MsgLog:
:
getRelationCode
,
warningMsgDto
.
getCode
()).
eq
(
MsgLog
::
getMsgTypeName
,
WarningEnum
.
getEumByLevel
(
level
).
getName
()).
eq
(
MsgLog:
:
getIsDelete
,
false
));
if
(!
ValidationUtil
.
isEmpty
(
msgLogList
)){
logger
.
info
(
"气瓶唯一标识码为 "
+
warningMsgDto
.
getCode
()+
" 的气瓶已有数据!"
);
return
;
}
//更新气瓶等级
// logger.info("更新气瓶等级:"+level);
// logger.info("预警区间:"+warningMsgDto.getNum());
// cylinderInfoServiceImpl.updateEarlyWarningLevel(warningMsgDto.getCylSeq(), level);
//增加消息日志数据
MsgLog
msgLog
=
new
MsgLog
();
MsgLog
msgLog
=
msgLogServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
MsgLog
>().
eq
(
MsgLog:
:
getRelationCode
,
warningMsgDto
.
getCode
()).
eq
(
MsgLog:
:
getIsDelete
,
false
));
if
(
ValidationUtil
.
isEmpty
(
msgLog
)){
msgLog
=
new
MsgLog
();
}
msgLog
.
setRelationCode
(
warningMsgDto
.
getCode
());
msgLog
.
setMsgType
(
WarningEnum
.
getEumByLevel
(
level
).
getCode
());
msgLog
.
setMsgTypeName
(
WarningEnum
.
getEumByLevel
(
level
).
getName
());
...
...
@@ -74,7 +89,7 @@ public class WarningMsgAction{
msgLog
.
setTerminalType
(
"WEB"
);
msgLog
.
setSendTime
(
new
Date
());
msgLog
.
setRecDate
(
new
Date
());
msgLogServiceImpl
.
save
(
msgLog
);
msgLogServiceImpl
.
save
OrUpdate
(
msgLog
);
logger
.
info
(
"增加消息日志数据:"
+
msgLog
.
toString
());
//发送web消息
try
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/MsgLogController.java
View file @
08d3fbd3
...
...
@@ -153,11 +153,7 @@ public class MsgLogController extends BaseController {
Page
<
MsgLogDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
Page
<
MsgLogDto
>
msgLogDtoPage
=
msgLogServiceImpl
.
queryForMsgLogByTerminalTypePage
(
page
,
terminalType
,
isRead
,
sendTimeStart
,
sendTimeEnd
,
msgType
,
body
);
List
<
MsgLogDto
>
records
=
msgLogDtoPage
.
getRecords
(
);
List
<
MsgLogDto
>
collect
=
records
.
stream
(
).
sorted
(
Comparator
.
comparing
(
MsgLogDto:
:
getSendTime
,
Comparator
.
nullsLast
(
Comparator
.
reverseOrder
(
)))).
collect
(
Collectors
.
toList
(
));
msgLogDtoPage
.
setRecords
(
collect
);
return
ResponseHelper
.
buildResponse
(
msgLogDtoPage
);
return
ResponseHelper
.
buildResponse
(
msgLogServiceImpl
.
queryForMsgLogByTerminalTypePage
(
page
,
terminalType
,
isRead
,
sendTimeStart
,
sendTimeEnd
,
msgType
,
body
));
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/MsgLogServiceImpl.java
View file @
08d3fbd3
...
...
@@ -106,6 +106,7 @@ public class MsgLogServiceImpl extends BaseService<MsgLogDto, MsgLog, MsgLogMapp
wrapper
.
le
(
StringUtils
.
hasText
(
sendTimeEnd
),
MsgLog:
:
getSendTime
,
sendTimeEnd
);
wrapper
.
eq
(
StringUtils
.
hasText
(
msgType
),
MsgLog:
:
getMsgType
,
msgType
);
wrapper
.
eq
(
MsgLog:
:
getIsDelete
,
0
);
wrapper
.
orderByDesc
(
MsgLog:
:
getSendTime
);
wrapper
.
like
(
StringUtils
.
hasText
(
body
),
MsgLog:
:
getBody
,
body
);
page
(
msgLogPage
,
wrapper
);
LinkedList
<
MsgLogDto
>
msgLogDtos
=
new
LinkedList
<>();
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzsJgServiceImpl.java
View file @
08d3fbd3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.*
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -56,6 +55,7 @@ import com.yeejoin.amos.boot.module.tzs.api.service.ITzsJgUseInfoService;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
@Service
public
class
TzsJgServiceImpl
implements
ITzsJgService
{
...
...
@@ -109,6 +109,7 @@ public class TzsJgServiceImpl implements ITzsJgService {
@Override
public
IPage
<
TzsJgBasicInfoDto
>
page
(
PageParam
pageParam
,
TzsJgBasicInfoDto
tzsJgBasicInfoDto
)
{
Set
<
String
>
categoryCodes
=
new
HashSet
<>();
if
(
tzsJgBasicInfoDto
.
getSuperviseKey
()
!=
null
)
{
FeignClientResult
<
CompanyModel
>
result
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
tzsJgBasicInfoDto
.
getSuperviseKey
()));
...
...
@@ -116,17 +117,38 @@ public class TzsJgServiceImpl implements ITzsJgService {
tzsJgBasicInfoDto
.
setOrgBranchCode
(
result
.
getResult
().
getOrgCode
());
}
}
if
(
tzsJgBasicInfoDto
.
getEquCategory
()
!=
null
)
{
EquipmentCategory
equipmentCategory
=
equipmentCategoryServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
EquipmentCategory
>().
eq
(
EquipmentCategory:
:
getId
,
tzsJgBasicInfoDto
.
getEquCategory
()));
if
(
equipmentCategory
!=
null
)
{
tzsJgBasicInfoDto
.
setEquCategory
(
equipmentCategory
.
getCode
().
toString
().
replaceAll
(
"0+$"
,
""
));
}
if
(
tzsJgBasicInfoDto
.
getEquDefine
()
!=
null
)
{
// EquipmentCategory equipmentCategory = equipmentCategoryServiceImpl
// .getOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getId,
// tzsJgBasicInfoDto.getEquCategory()));
// if (equipmentCategory != null) {
// tzsJgBasicInfoDto.setEquCategory(equipmentCategory.getCode().toString().replaceAll("0+$", ""));
getCategoryCodes
(
tzsJgBasicInfoDto
.
getEquDefine
(),
categoryCodes
);
// }
}
Page
<
TzsJgBasicInfoDto
>
page
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
return
tzsJgMapper
.
page
(
page
,
tzsJgBasicInfoDto
);
tzsJgMapper
.
page
(
page
,
tzsJgBasicInfoDto
,
categoryCodes
);
for
(
TzsJgBasicInfoDto
basicInfoDto:
page
.
getRecords
()){
if
(
ValidationUtil
.
isEmpty
(
basicInfoDto
.
getEquDefine
())){
LambdaQueryWrapper
<
EquipmentCategory
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
EquipmentCategory
::
getCode
,
basicInfoDto
.
getEquCategory
());
basicInfoDto
.
setEquDefine
(
equipmentCategoryServiceImpl
.
getOne
(
wrapper
).
getName
());
}
}
return
page
;
}
public
Set
<
String
>
getCategoryCodes
(
String
id
,
Set
<
String
>
categoryCodes
){
categoryCodes
.
add
(
equipmentCategoryServiceImpl
.
getById
(
id
).
getCode
());
LambdaQueryWrapper
<
EquipmentCategory
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
EquipmentCategory
::
getParentId
,
id
);
List
<
EquipmentCategory
>
equipmentCategoryList
=
equipmentCategoryServiceImpl
.
list
(
wrapper
);
Iterator
<
EquipmentCategory
>
iterator
=
equipmentCategoryList
.
iterator
();
while
(
iterator
.
hasNext
())
{
getCategoryCodes
(
String
.
valueOf
(
iterator
.
next
().
getId
()),
categoryCodes
);
}
return
null
;
}
@Override
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/ScheduleService.java
View file @
08d3fbd3
...
...
@@ -9,11 +9,13 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import
com.yeejoin.amos.boot.module.tzs.api.dto.LicScheduleDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WarningMsgDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquScheduleDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseUnitLicence
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsJgRegistrationInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EarlyWarningLevelEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.WarningTypeEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.ScheduleMapper
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.MsgLogServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzBaseUnitLicenceServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsJgRegistrationInfoServiceImpl
;
...
...
@@ -33,8 +35,10 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* @author Zhang Yingbin
...
...
@@ -47,6 +51,9 @@ public class ScheduleService {
private
ScheduleMapper
scheduleMapper
;
@Autowired
MsgLogServiceImpl
msgLogServiceImpl
;
@Autowired
TzsAuthServiceImpl
tzsAuthService
;
@Autowired
...
...
@@ -140,6 +147,25 @@ public class ScheduleService {
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"超期预警时间调用规则完成"
);
}
//检查msgLog中的消息,若下次检验日期已延续 则更新消息状态
List
<
MsgLog
>
msgLogList
=
msgLogServiceImpl
.
list
(
new
LambdaQueryWrapper
<
MsgLog
>().
eq
(
MsgLog:
:
getIsDelete
,
false
));
Date
now
=
new
Date
();
for
(
MsgLog
msgLog:
msgLogList
){
msgLog
.
getRelationCode
();
try
{
CylinderInfoDto
cylinderInfoDto
=
this
.
getCylDetail
(
msgLog
.
getRelationCode
());
int
interval
=
DateUtils
.
dateBetweenIncludeToday
(
now
,
cylinderInfoDto
.
getNextInspectionDate
())
-
1
;
if
(
interval
>
30
){
msgLog
.
setIsDelete
(
true
);
msgLog
.
setMsgTypeName
(
"已延期"
);
msgLogServiceImpl
.
updateById
(
msgLog
);
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
}
/**
...
...
@@ -193,6 +219,7 @@ public class ScheduleService {
}
String
[]
test
=
new
String
[]{};
this
.
rulePublish
(
warningMsgDto
,
cylPackageId
);
System
.
out
.
println
(
"----------------------------------tzs服务调用了规则--------------------------------------"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用气瓶规则失败!:{},{}"
,
JSON
.
toJSONString
(
cylinderInfoDto
),
e
);
}
...
...
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