Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
e5e55dca
Commit
e5e55dca
authored
Mar 25, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交报告漏洞代码
parent
aa932249
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
611 additions
and
717 deletions
+611
-717
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+3
-3
RiskSituationAction.java
...yeejoin/amos/fas/business/action/RiskSituationAction.java
+4
-3
SimpleTipAction.java
...com/yeejoin/amos/fas/business/action/SimpleTipAction.java
+2
-1
ReflectUtil.java
...om/yeejoin/amos/fas/business/action/util/ReflectUtil.java
+5
-2
BaseController.java
.../yeejoin/amos/fas/business/controller/BaseController.java
+2
-5
FireRectificationController.java
.../fas/business/controller/FireRectificationController.java
+68
-68
FireRectificationMapper.java
...amos/fas/business/dao/mapper/FireRectificationMapper.java
+40
-40
FireRectificationServiceImpl.java
...s/business/service/impl/FireRectificationServiceImpl.java
+232
-232
FireRectificationService.java
.../fas/business/service/intfc/FireRectificationService.java
+46
-46
FileUtils.java
...in/java/com/yeejoin/amos/fas/business/util/FileUtils.java
+0
-154
LogFilter.java
.../src/main/java/com/yeejoin/amos/fas/config/LogFilter.java
+39
-0
AmosThreadPool.java
.../com/yeejoin/amos/fas/core/threadpool/AmosThreadPool.java
+6
-4
FileUtil.java
...rc/main/java/com/yeejoin/amos/fas/core/util/FileUtil.java
+1
-1
ResponseUtils.java
...in/java/com/yeejoin/amos/fas/core/util/ResponseUtils.java
+1
-1
WordConverterUtils.java
...va/com/yeejoin/amos/fas/core/util/WordConverterUtils.java
+3
-0
BaseQuerySpecification.java
...join/amos/fas/core/util/query/BaseQuerySpecification.java
+2
-2
dbTemplate_fire_rectification.xml
...ain/resources/db/mapper/dbTemplate_fire_rectification.xml
+156
-155
logback.xml
YeeAmosFireAutoSysStart/src/main/resources/logback.xml
+1
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
e5e55dca
...
...
@@ -228,7 +228,7 @@ public class ContingencyAction implements CustomerAction {
try
{
constructor
=
Class
.
forName
(
PACKAGEURL
+
result
.
getClass
().
getSimpleName
()
+
"Message"
).
getConstructor
(
ActionResult
.
class
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
(
Locale
.
ENGLISH
)))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
contingency
,
result
.
toJson
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
log
.
info
(
String
.
format
(
"mqtt[%s]:【 %s 】"
,
topic
,
toipResponse
.
toJsonStr
()));
...
...
@@ -252,7 +252,7 @@ public class ContingencyAction implements CustomerAction {
}
}
}
else
if
(
"websocket"
.
equals
(
pushType
.
toLowerCase
()))
{
}
else
if
(
"websocket"
.
equals
(
pushType
.
toLowerCase
(
Locale
.
ENGLISH
)))
{
action
.
execute
(
msgType
,
contingency
);
}
...
...
@@ -862,7 +862,7 @@ public class ContingencyAction implements CustomerAction {
try
{
constructor
=
Class
.
forName
(
PACKAGEURL
+
result
.
getClass
().
getSimpleName
()
+
"Message"
).
getConstructor
(
ActionResult
.
class
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
(
Locale
.
ENGLISH
)))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
null
,
result
.
toJson
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
log
.
info
(
String
.
format
(
"mqtt[%s]:【 %s 】"
,
topic
,
toipResponse
.
toJsonStr
()));
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/RiskSituationAction.java
View file @
e5e55dca
...
...
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
import
java.lang.reflect.Constructor
;
import
java.util.HashMap
;
import
java.util.Locale
;
import
java.util.Map
;
/**
*
...
...
@@ -68,7 +69,7 @@ public class RiskSituationAction implements CustomerAction
.
getConstructor
(
ActionResult
.
class
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
String
msgType
=
"bubbleTip"
;
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
(
Locale
.
ENGLISH
)))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
bizobj
,
result
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"rule"
);
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
...
...
@@ -102,7 +103,7 @@ public class RiskSituationAction implements CustomerAction
.
getConstructor
(
ActionResult
.
class
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
String
msgType
=
"changeColor"
;
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
(
Locale
.
ENGLISH
)))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
bizobj
,
result
);
webMqttComponent
.
publish
(
""
,
toipResponse
.
toJsonStr
());
}
else
{
...
...
@@ -136,7 +137,7 @@ public class RiskSituationAction implements CustomerAction
.
getConstructor
(
ActionResult
.
class
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
String
msgType
=
"message"
;
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
(
Locale
.
ENGLISH
)))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
bizobj
,
result
);
webMqttComponent
.
publish
(
""
,
toipResponse
.
toJsonStr
());
}
else
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/SimpleTipAction.java
View file @
e5e55dca
...
...
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
import
java.lang.reflect.Constructor
;
import
java.util.HashMap
;
import
java.util.Locale
;
import
java.util.Map
;
/**
...
...
@@ -68,7 +69,7 @@ public class SimpleTipAction implements CustomerAction
.
getConstructor
(
ActionResult
.
class
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
String
msgType
=
"message"
;
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
(
Locale
.
ENGLISH
)))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
bizobj
,
result
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"rule"
);
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/util/ReflectUtil.java
View file @
e5e55dca
...
...
@@ -10,6 +10,7 @@ import java.util.List;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.ReflectionUtils
;
/**
*
...
...
@@ -70,7 +71,8 @@ public class ReflectUtil
Field
field
=
clazz
.
getDeclaredField
(
fname
);
// 获取定义的类属性
if
(!
Modifier
.
isPublic
(
field
.
getModifiers
()))
{
// 设置非共有类属性权限
field
.
setAccessible
(
true
);
// field.setAccessible(true);
ReflectionUtils
.
makeAccessible
(
field
);
}
field
.
set
(
target
,
fvalue
);
// 设置类属性值
...
...
@@ -130,7 +132,8 @@ public class ReflectUtil
Field
field
=
clazz
.
getDeclaredField
(
fname
);
// 获取定义的类属性
if
(!
Modifier
.
isPublic
(
field
.
getModifiers
()))
{
// 设置非共有类属性权限
field
.
setAccessible
(
true
);
// field.setAccessible(true);
ReflectionUtils
.
makeAccessible
(
field
);
}
return
field
.
get
(
target
);
// 返回类属性值
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/BaseController.java
View file @
e5e55dca
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.Cookie
;
...
...
@@ -269,7 +266,7 @@ public class BaseController {
criteria
.
setPropertyName
(
query
.
getName
());
String
column
=
criteria
.
getPropertyName
();
if
(!(
query
.
getValue
()
instanceof
Collection
<?>)
&&
column
.
substring
(
column
.
length
()-
2
,
column
.
length
()).
toUpperCase
().
equals
(
"ID"
))
{
&&
column
.
substring
(
column
.
length
()-
2
,
column
.
length
()).
toUpperCase
(
Locale
.
ENGLISH
).
equals
(
"ID"
))
{
criteria
.
setValue
(
Long
.
valueOf
(
query
.
getValue
().
toString
()));
}
else
{
criteria
.
setValue
(
query
.
getValue
());
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireRectificationController.java
View file @
e5e55dca
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.bo.FireParamBo
;
import
com.yeejoin.amos.fas.business.service.intfc.FireRectificationService
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* 安全执行-消防整改 控制器
*
* @author 郑嘉伟
*/
@RestController
@RequestMapping
(
value
=
"/api/fireRectification"
)
@Api
(
tags
=
"消防整改"
)
public
class
FireRectificationController
extends
BaseController
{
@Autowired
private
FireRectificationService
fireRectificationService
;
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"按条件查询消防整改列表信息"
,
notes
=
"按条件查询消防整改列表信息"
)
@GetMapping
(
value
=
"/list"
)
public
CommonResponse
queryFireList
(
@RequestParam
(
value
=
"nameLike"
)
String
nameLike
,
@RequestParam
(
value
=
"sDate"
)
String
sDate
,
@RequestParam
(
value
=
"eDate"
)
String
eDate
,
@RequestParam
(
value
=
"states"
)
int
states
,
@RequestParam
(
value
=
"pageNum"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
)
int
pageSize
)
{
return
CommonResponseUtil
.
success
(
fireRectificationService
.
queryFiresAndCount
(
nameLike
,
sDate
,
eDate
,
states
,
pageNum
,
pageSize
));
}
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单个单据详细数据"
,
notes
=
"获取单个单据详细数据"
)
@GetMapping
(
value
=
"/getMoreData"
)
public
CommonResponse
seleteOne
(
@RequestParam
(
value
=
"billNo"
)
String
billNo
){
return
CommonResponseUtil
.
success
(
fireRectificationService
.
selectOneById
(
billNo
));
}
@Permission
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"下载附件"
,
notes
=
"下载附件"
)
@PostMapping
(
value
=
"/downLoad"
)
public
void
downLoad
(
@RequestBody
List
<
String
>
path
,
HttpServletResponse
response
){
fireRectificationService
.
downLoadFilesByUrll
(
path
.
get
(
0
),
response
);
}
@Permission
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改表单数据"
,
notes
=
"修改表单数据"
)
@PostMapping
(
value
=
"/update"
)
public
CommonResponse
update
(
@RequestBody
FireParamBo
paramBo
){
return
CommonResponseUtil
.
success
(
fireRectificationService
.
updateByid
(
paramBo
));
}
}
//
package com.yeejoin.amos.fas.business.controller;
//
//
import com.yeejoin.amos.fas.business.bo.FireParamBo;
//
import com.yeejoin.amos.fas.business.service.intfc.FireRectificationService;
//
import com.yeejoin.amos.fas.config.Permission;
//
import com.yeejoin.amos.fas.core.util.CommonResponse;
//
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
//
import io.swagger.annotations.Api;
//
import io.swagger.annotations.ApiOperation;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.web.bind.annotation.GetMapping;
//
import org.springframework.web.bind.annotation.PostMapping;
//
import org.springframework.web.bind.annotation.RequestBody;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
import org.springframework.web.bind.annotation.RequestParam;
//
import org.springframework.web.bind.annotation.RestController;
//
//
import javax.servlet.http.HttpServletResponse;
//
import java.util.List;
//
//
/
//
**
//
* 安全执行-消防整改 控制器
//
*
//
* @author 郑嘉伟
//
*/
//
@RestController
//
@RequestMapping(value = "/api/fireRectification")
//
@Api(tags = "消防整改")
//
public class FireRectificationController extends BaseController {
//
//
@Autowired
//
private FireRectificationService fireRectificationService;
//
//
@Permission
//
@ApiOperation(httpMethod = "GET", value = "按条件查询消防整改列表信息", notes = "按条件查询消防整改列表信息")
//
@GetMapping(value = "/list")
//
public CommonResponse queryFireList(
//
@RequestParam(value = "nameLike") String nameLike,
//
@RequestParam(value = "sDate") String sDate,
//
@RequestParam(value = "eDate") String eDate,
//
@RequestParam(value = "states") int states,
//
@RequestParam(value = "pageNum") int pageNum,
//
@RequestParam(value = "pageSize") int pageSize) {
//
return CommonResponseUtil.success(fireRectificationService.queryFiresAndCount(nameLike,sDate,eDate,states,pageNum,pageSize));
//
}
//
//
@Permission
//
@ApiOperation(httpMethod = "GET", value = "获取单个单据详细数据", notes = "获取单个单据详细数据")
//
@GetMapping(value = "/getMoreData")
//
public CommonResponse seleteOne(@RequestParam(value = "billNo") String billNo){
//
return CommonResponseUtil.success(fireRectificationService.selectOneById(billNo));
//
}
//
//
@Permission
//
@ApiOperation(httpMethod = "POST", value = "下载附件", notes = "下载附件")
//
@PostMapping(value = "/downLoad")
//
public void downLoad(@RequestBody List<String> path, HttpServletResponse response){
//
fireRectificationService.downLoadFilesByUrll(path.get(0),response);
//
}
//
//
@Permission
//
@ApiOperation(httpMethod = "POST", value = "修改表单数据", notes = "修改表单数据")
//
@PostMapping(value = "/update")
//
public CommonResponse update(@RequestBody FireParamBo paramBo){
//
return CommonResponseUtil.success(fireRectificationService.updateByid(paramBo));
//
}
//
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireRectificationMapper.java
View file @
e5e55dca
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.fas.business.bo.FireInfoBo
;
import
com.yeejoin.amos.fas.business.bo.FireMoreDataBo
;
import
com.yeejoin.amos.fas.business.bo.FireRectificationBo
;
import
java.util.List
;
import
java.util.Map
;
public
interface
FireRectificationMapper
extends
BaseMapper
{
/**
* 查询当前页数据和数量
* @param param
* @return
*/
List
<
FireRectificationBo
>
queryFiresAndCount
(
Map
<
String
,
Object
>
param
);
long
countQueryFireList
(
Map
<
String
,
Object
>
param
);
/**
* 查询详细信息
* @param billNo
* @return
*/
FireRectificationBo
selectOneForBase
(
String
billNo
);
List
<
FireMoreDataBo
>
selectOneForEmergency
(
String
billNo
);
List
<
FireMoreDataBo
>
selectOneForDanger
(
String
billNo
);
List
<
FireMoreDataBo
>
selectOneForHidden
(
String
billNo
);
FireInfoBo
selectOneForfire
(
String
billNo
,
int
id
);
/**
* 修改单据及其相关信息
* @param param
* @return
*/
int
updateBill
(
Map
<
String
,
String
>
param
);
int
updateWarnning
(
FireMoreDataBo
param
);
int
updateHidden
(
FireMoreDataBo
param
);
int
updateDanger
(
FireMoreDataBo
param
);
}
//
package com.yeejoin.amos.fas.business.dao.mapper;
//
//
import com.yeejoin.amos.fas.business.bo.FireInfoBo;
//
import com.yeejoin.amos.fas.business.bo.FireMoreDataBo;
//
import com.yeejoin.amos.fas.business.bo.FireRectificationBo;
//
//
import java.util.List;
//
import java.util.Map;
//
//
public interface FireRectificationMapper extends BaseMapper{
//
/**
//
* 查询当前页数据和数量
//
* @param param
//
* @return
//
*/
//
List<FireRectificationBo> queryFiresAndCount(Map<String,Object> param);
//
long countQueryFireList(Map<String,Object> param);
//
//
/**
//
* 查询详细信息
//
* @param billNo
//
* @return
//
*/
//
FireRectificationBo selectOneForBase(String billNo);
//
List<FireMoreDataBo> selectOneForEmergency(String billNo);
//
List<FireMoreDataBo> selectOneForDanger(String billNo);
//
List<FireMoreDataBo> selectOneForHidden (String billNo);
//
FireInfoBo selectOneForfire(String billNo, int id);
//
//
/**
//
* 修改单据及其相关信息
//
* @param param
//
* @return
//
*/
//
int updateBill(Map<String,String > param);
//
int updateWarnning(FireMoreDataBo param);
//
int updateHidden(FireMoreDataBo param);
//
int updateDanger(FireMoreDataBo param);
//
//
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireRectificationServiceImpl.java
View file @
e5e55dca
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.fas.business.bo.FireInfoBo
;
import
com.yeejoin.amos.fas.business.bo.FireMoreDataBo
;
import
com.yeejoin.amos.fas.business.bo.FireParamBo
;
import
com.yeejoin.amos.fas.business.bo.FireRectificationBo
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireRectificationMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.FireRectificationService
;
import
com.yeejoin.amos.fas.business.util.FileUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"fireRectificationService"
)
public
class
FireRectificationServiceImpl
implements
FireRectificationService
{
@Autowired
FireRectificationMapper
fireRectificationMapper
;
/**
* 文件服务器地址
*/
@Value
(
"${file.downLoad.url}"
)
private
String
ipUrl
;
/**
* 根据条件查询对应单据
* @param nameLike 单据模糊查询
* @param sDate 起始日
* @param eDate 终止日
* @param states 状态
* @param pageNum 页码
* @param pageSize
* @return
*/
@Override
public
Map
<
String
,
Object
>
queryFiresAndCount
(
String
nameLike
,
String
sDate
,
String
eDate
,
int
states
,
int
pageNum
,
int
pageSize
)
{
if
(
nameLike
.
trim
().
equals
(
""
)){
nameLike
=
null
;
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
int
spage
=
(
pageNum
-
1
)*
pageSize
;
map
.
put
(
"nameLike"
,
nameLike
);
map
.
put
(
"sDate"
,
sDate
);
map
.
put
(
"eDate"
,
eDate
);
map
.
put
(
"states"
,
states
);
map
.
put
(
"spage"
,
spage
);
map
.
put
(
"pageSize"
,
pageSize
);
List
<
FireRectificationBo
>
fireRectificationBos
=
fireRectificationMapper
.
queryFiresAndCount
(
map
);
long
countFires
=
fireRectificationMapper
.
countQueryFireList
(
map
);
map
.
clear
();
map
.
put
(
"fireRectificationBos"
,
fireRectificationBos
);
map
.
put
(
"countFires"
,
countFires
);
return
map
;
}
/**
* 查询详细单据信息
* @param billNo
* @return
*/
@Override
public
Map
<
String
,
Object
>
selectOneById
(
String
billNo
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
();
FireRectificationBo
base
=
fireRectificationMapper
.
selectOneForBase
(
billNo
);
List
<
FireMoreDataBo
>
warnnings
=
fireRectificationMapper
.
selectOneForEmergency
(
billNo
);
List
<
FireMoreDataBo
>
danger
=
fireRectificationMapper
.
selectOneForDanger
(
billNo
);
List
<
FireMoreDataBo
>
hidden
=
fireRectificationMapper
.
selectOneForHidden
(
billNo
);
List
<
FireInfoBo
>
files
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
4
;
i
++){
files
.
add
(
fireRectificationMapper
.
selectOneForfire
(
billNo
,
i
));
}
Map
<
String
,
Object
>
backResult
=
makeFIreString
(
files
);
result
.
put
(
"base"
,
base
);
result
.
put
(
"warnnings"
,
warnnings
);
result
.
put
(
"danger"
,
danger
);
result
.
put
(
"hidden"
,
hidden
);
result
.
put
(
"fires"
,
backResult
.
get
(
"fires"
));
result
.
put
(
"backResult"
,
backResult
.
get
(
"backResult"
));
return
result
;
}
/**
* 下载文件
* @param path
* @param response
*/
@Override
public
void
downLoadFilesByUrll
(
String
path
,
HttpServletResponse
response
)
{
List
<
String
>
list
=
Arrays
.
asList
(
path
.
split
(
","
));
try
{
FileUtils
.
downloadZIP
(
response
,
list
,
ipUrl
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
/**
* 修改单据相关信息
* @param paramBo
* @return
*/
@Override
public
Map
<
String
,
String
>
updateByid
(
FireParamBo
paramBo
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"billNo"
,
paramBo
.
getBillNo
());
map
.
put
(
"backResult"
,
paramBo
.
getBackResult
());
map
.
put
(
"refResult"
,
paramBo
.
getRefResult
());
try
{
if
(
isDataEmpty
(
paramBo
.
getBillNo
(),
null
)
||
isDataEmpty
(
paramBo
.
getBackResult
(),
null
)
||
isDataEmpty
(
paramBo
.
getRefResult
(),
null
)
){
fireRectificationMapper
.
updateBill
(
map
);
}
if
(
isDataEmpty
(
null
,
paramBo
.
getWarnningData
())){
for
(
FireMoreDataBo
bo
:
paramBo
.
getWarnningData
())
{
fireRectificationMapper
.
updateWarnning
(
bo
);
}
}
if
(
isDataEmpty
(
null
,
paramBo
.
getHiddenData
())){
for
(
FireMoreDataBo
bo
:
paramBo
.
getHiddenData
())
{
fireRectificationMapper
.
updateHidden
(
bo
);
}
}
if
(
isDataEmpty
(
null
,
paramBo
.
getDangerData
())){
for
(
FireMoreDataBo
bo
:
paramBo
.
getDangerData
())
{
fireRectificationMapper
.
updateDanger
(
bo
);
}
}
map
.
clear
();
}
catch
(
Exception
e
)
{
map
.
put
(
"result"
,
"数据保存失败"
);
map
.
put
(
"message"
,
"error"
);
return
map
;
}
map
.
put
(
"result"
,
"数据保存成功"
);
map
.
put
(
"message"
,
"success"
);
return
map
;
}
/**
* 判空
* @param data
* @param list
* @return
*/
public
boolean
isDataEmpty
(
String
data
,
List
<
FireMoreDataBo
>
list
)
{
if
(
data
!=
null
){
return
!(
""
).
equals
(
data
);
}
return
list
!=
null
&&
list
.
size
()
!=
0
;
}
/**
* 生成返回拼接评价
* @param files
* @return
*/
public
Map
<
String
,
Object
>
makeFIreString
(
List
<
FireInfoBo
>
files
){
Map
<
String
,
Object
>
result
=
new
HashMap
();
Map
<
String
,
Object
>
newfires
=
new
HashMap
();
String
backResult
=
",需加强"
;
FireInfoBo
fire1
=
files
.
get
(
0
);
FireInfoBo
fire2
=
files
.
get
(
1
);
FireInfoBo
fire3
=
files
.
get
(
2
);
FireInfoBo
fire4
=
files
.
get
(
3
);
if
(
fire1
==
null
){
fire1
=
new
FireInfoBo
(
0
,
0
);
}
if
(
fire2
==
null
){
fire2
=
new
FireInfoBo
(
0
,
0
);
}
if
(
fire3
==
null
){
fire3
=
new
FireInfoBo
(
0
,
0
);
}
if
(
fire4
==
null
){
fire4
=
new
FireInfoBo
(
0
,
0
);
}
newfires
.
put
(
"fire1rel"
,
fire1
.
getRealNum
());
newfires
.
put
(
"fire1thr"
,
fire1
.
getThreshold
());
newfires
.
put
(
"fire2rel"
,
fire2
.
getRealNum
());
newfires
.
put
(
"fire2thr"
,
fire2
.
getThreshold
());
newfires
.
put
(
"fire3rel"
,
fire3
.
getRealNum
());
newfires
.
put
(
"fire3thr"
,
fire3
.
getThreshold
());
newfires
.
put
(
"fire4rel"
,
fire4
.
getRealNum
());
newfires
.
put
(
"fire4thr"
,
fire4
.
getThreshold
());
if
(
fire1
.
getRealNum
()<
fire1
.
getThreshold
()
&&
fire1
.
getRealNum
()!=
fire1
.
getThreshold
()){
backResult
=
backResult
+
"消防应急预案"
;
}
if
(
fire2
.
getRealNum
()<
fire2
.
getThreshold
()
&&
fire2
.
getRealNum
()!=
fire2
.
getThreshold
()){
if
(!
backResult
.
equals
(
",需加强"
)){
backResult
=
backResult
+
","
;
}
backResult
=
backResult
+
"消防安全教育培训"
;
}
if
(
fire3
.
getRealNum
()<
fire3
.
getThreshold
()
&&
fire3
.
getRealNum
()!=
fire3
.
getThreshold
()){
if
(!
backResult
.
equals
(
",需加强"
)){
backResult
=
backResult
+
","
;
}
backResult
=
backResult
+
"消防日常训练"
;
}
if
(
fire4
.
getRealNum
()<
fire4
.
getThreshold
()
&&
fire4
.
getRealNum
()!=
fire4
.
getThreshold
()){
if
(!
backResult
.
equals
(
",需加强"
)){
backResult
=
backResult
+
","
;
}
backResult
=
backResult
+
"消防器材保养"
;
}
if
(
backResult
.
equals
(
",需加强"
)){
backResult
=
"。"
;
}
else
{
backResult
=
backResult
+
"工作。"
;
}
result
.
put
(
"fires"
,
newfires
);
result
.
put
(
"backResult"
,
backResult
);
return
result
;
}
}
//
package com.yeejoin.amos.fas.business.service.impl;
//
//
import com.yeejoin.amos.fas.business.bo.FireInfoBo;
//
import com.yeejoin.amos.fas.business.bo.FireMoreDataBo;
//
import com.yeejoin.amos.fas.business.bo.FireParamBo;
//
import com.yeejoin.amos.fas.business.bo.FireRectificationBo;
//
import com.yeejoin.amos.fas.business.dao.mapper.FireRectificationMapper;
//
import com.yeejoin.amos.fas.business.service.intfc.FireRectificationService;
//
import com.yeejoin.amos.fas.business.util.FileUtils;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.beans.factory.annotation.Value;
//
import org.springframework.stereotype.Service;
//
//
import javax.servlet.http.HttpServletResponse;
//
import java.io.IOException;
//
import java.util.ArrayList;
//
import java.util.Arrays;
//
import java.util.HashMap;
//
import java.util.List;
//
import java.util.Map;
//
//
@Service("fireRectificationService")
//
public class FireRectificationServiceImpl implements FireRectificationService {
//
@Autowired
//
FireRectificationMapper fireRectificationMapper;
//
//
/**
//
* 文件服务器地址
//
*/
//
@Value("${file.downLoad.url}")
//
private String ipUrl;
//
//
/**
//
* 根据条件查询对应单据
//
* @param nameLike 单据模糊查询
//
* @param sDate 起始日
//
* @param eDate 终止日
//
* @param states 状态
//
* @param pageNum 页码
//
* @param pageSize
//
* @return
//
*/
//
@Override
//
public Map<String, Object> queryFiresAndCount(String nameLike, String sDate, String eDate, int states, int pageNum,int pageSize) {
//
if(nameLike.trim().equals("")){
//
nameLike = null;
//
}
//
Map<String, Object> map = new HashMap<>();
//
int spage = (pageNum-1)*pageSize;
//
map.put("nameLike",nameLike);
//
map.put("sDate",sDate);
//
map.put("eDate",eDate);
//
map.put("states",states);
//
map.put("spage",spage);
//
map.put("pageSize",pageSize);
//
List<FireRectificationBo> fireRectificationBos = fireRectificationMapper.queryFiresAndCount(map);
//
long countFires = fireRectificationMapper.countQueryFireList(map);
//
map.clear();
//
map.put("fireRectificationBos",fireRectificationBos);
//
map.put("countFires",countFires);
//
return map;
//
}
//
//
/**
//
* 查询详细单据信息
//
* @param billNo
//
* @return
//
*/
//
@Override
//
public Map<String, Object> selectOneById(String billNo) {
//
Map<String ,Object> result = new HashMap();
//
FireRectificationBo base = fireRectificationMapper.selectOneForBase(billNo);
//
List<FireMoreDataBo> warnnings = fireRectificationMapper.selectOneForEmergency(billNo);
//
List<FireMoreDataBo> danger = fireRectificationMapper.selectOneForDanger(billNo);
//
List<FireMoreDataBo> hidden = fireRectificationMapper.selectOneForHidden(billNo);
//
List<FireInfoBo> files = new ArrayList<>();
//
for (int i=0;i<4;i++){
//
files.add(fireRectificationMapper.selectOneForfire(billNo,i));
//
}
//
Map<String ,Object> backResult = makeFIreString(files);
//
result.put("base", base);
//
result.put("warnnings", warnnings);
//
result.put("danger", danger);
//
result.put("hidden", hidden);
//
result.put("fires", backResult.get("fires"));
//
result.put("backResult", backResult.get("backResult"));
//
return result;
//
}
//
//
/**
//
* 下载文件
//
* @param path
//
* @param response
//
*/
//
@Override
//
public void downLoadFilesByUrll(String path, HttpServletResponse response) {
//
List<String> list = Arrays.asList(path.split(","));
//
try {
//
FileUtils.downloadZIP(response,list,ipUrl);
//
} catch (IOException e) {
//
e.printStackTrace();
//
}
//
}
//
//
/**
//
* 修改单据相关信息
//
* @param paramBo
//
* @return
//
*/
//
@Override
//
public Map<String, String> updateByid(FireParamBo paramBo) {
//
Map<String, String> map = new HashMap<>();
//
map.put("billNo",paramBo.getBillNo());
//
map.put("backResult",paramBo.getBackResult());
//
map.put("refResult",paramBo.getRefResult());
//
try {
//
if(isDataEmpty(paramBo.getBillNo(),null) ||
//
isDataEmpty(paramBo.getBackResult(),null) ||
//
isDataEmpty(paramBo.getRefResult(),null)
//
){
//
fireRectificationMapper.updateBill(map);
//
}
//
if (isDataEmpty(null,paramBo.getWarnningData())){
//
for (FireMoreDataBo bo : paramBo.getWarnningData()) {
//
fireRectificationMapper.updateWarnning(bo);
//
}
//
}
//
if (isDataEmpty(null,paramBo.getHiddenData())){
//
for (FireMoreDataBo bo : paramBo.getHiddenData()) {
//
fireRectificationMapper.updateHidden(bo);
//
}
//
}
//
if (isDataEmpty(null,paramBo.getDangerData())){
//
for (FireMoreDataBo bo : paramBo.getDangerData()) {
//
fireRectificationMapper.updateDanger(bo);
//
}
//
}
//
map.clear();
//
}catch (Exception e) {
//
map.put("result","数据保存失败");
//
map.put("message","error");
//
return map;
//
}
//
map.put("result","数据保存成功");
//
map.put("message","success");
//
return map;
//
}
//
//
/**
//
* 判空
//
* @param data
//
* @param list
//
* @return
//
*/
//
public boolean isDataEmpty (String data,List<FireMoreDataBo> list) {
//
if (data != null){
//
return !("").equals(data);
//
}
//
return list != null && list.size() != 0;
//
}
//
//
/**
//
* 生成返回拼接评价
//
* @param files
//
* @return
//
*/
//
public Map<String ,Object> makeFIreString( List<FireInfoBo> files){
//
Map<String ,Object> result = new HashMap();
//
Map<String ,Object> newfires = new HashMap();
//
//
String backResult = ",需加强";
//
//
FireInfoBo fire1= files.get(0);
//
FireInfoBo fire2= files.get(1);
//
FireInfoBo fire3= files.get(2);
//
FireInfoBo fire4= files.get(3);
//
if (fire1 == null){
//
fire1 = new FireInfoBo(0,0);
//
}
//
if (fire2 == null){
//
fire2 = new FireInfoBo(0,0);
//
}
//
if (fire3 == null){
//
fire3 = new FireInfoBo(0,0);
//
}
//
if (fire4 == null){
//
fire4 = new FireInfoBo(0,0);
//
}
//
newfires.put("fire1rel",fire1.getRealNum());
//
newfires.put("fire1thr",fire1.getThreshold());
//
//
newfires.put("fire2rel",fire2.getRealNum());
//
newfires.put("fire2thr",fire2.getThreshold());
//
//
newfires.put("fire3rel",fire3.getRealNum());
//
newfires.put("fire3thr",fire3.getThreshold());
//
//
newfires.put("fire4rel",fire4.getRealNum());
//
newfires.put("fire4thr",fire4.getThreshold());
//
//
if (fire1.getRealNum()<fire1.getThreshold() && fire1.getRealNum()!=fire1.getThreshold()){
//
backResult = backResult+"消防应急预案";
//
}
//
if (fire2.getRealNum()<fire2.getThreshold() && fire2.getRealNum()!=fire2.getThreshold()){
//
if(!backResult.equals(",需加强")){
//
backResult = backResult+",";
//
}
//
backResult = backResult+"消防安全教育培训";
//
}
//
if (fire3.getRealNum()<fire3.getThreshold() && fire3.getRealNum()!=fire3.getThreshold()){
//
if(!backResult.equals(",需加强")){
//
backResult = backResult+",";
//
}
//
backResult = backResult+"消防日常训练";
//
}
//
if ( fire4.getRealNum()<fire4.getThreshold() && fire4.getRealNum()!=fire4.getThreshold()){
//
if(!backResult.equals(",需加强")){
//
backResult = backResult+",";
//
}
//
backResult = backResult+"消防器材保养";
//
}
//
if (backResult.equals(",需加强")){
//
backResult = "。";
//
}else {
//
backResult = backResult+"工作。";
//
}
//
//
result.put("fires", newfires);
//
result.put("backResult", backResult);
//
return result;
//
}
//
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/FireRectificationService.java
View file @
e5e55dca
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.bo.FireParamBo
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Map
;
/**
* 安全监管-单据管理 服务类
*
* @author 郑嘉伟
*/
public
interface
FireRectificationService
{
/**
* 按条件查询消防整改列表信息
* @param nameLike 单据模糊查询
* @param sDate 起始日
* @param eDate 终止日
* @param states 状态
* @param pageNum 页码
* @return
*/
Map
<
String
,
Object
>
queryFiresAndCount
(
String
nameLike
,
String
sDate
,
String
eDate
,
int
states
,
int
pageNum
,
int
pageSize
);
/**
* 查询详细单据信息
* @param billNo
* @return
*/
Map
<
String
,
Object
>
selectOneById
(
String
billNo
);
/**
* 下载文件
* @param path
* @param response
*/
void
downLoadFilesByUrll
(
String
path
,
HttpServletResponse
response
);
/**
* 修改单据相关信息
* @param paramBo
* @return
*/
Map
<
String
,
String
>
updateByid
(
FireParamBo
paramBo
);
}
//
package com.yeejoin.amos.fas.business.service.intfc;
//
//
import com.yeejoin.amos.fas.business.bo.FireParamBo;
//
//
import javax.servlet.http.HttpServletResponse;
//
import java.util.Map;
//
/
//
**
//
* 安全监管-单据管理 服务类
//
*
//
* @author 郑嘉伟
//
*/
//
public interface FireRectificationService {
//
//
/**
//
* 按条件查询消防整改列表信息
//
* @param nameLike 单据模糊查询
//
* @param sDate 起始日
//
* @param eDate 终止日
//
* @param states 状态
//
* @param pageNum 页码
//
* @return
//
*/
//
Map<String, Object> queryFiresAndCount(String nameLike, String sDate, String eDate, int states, int pageNum ,int pageSize);
//
//
/**
//
* 查询详细单据信息
//
* @param billNo
//
* @return
//
*/
//
Map<String ,Object> selectOneById(String billNo);
//
//
/**
//
* 下载文件
//
* @param path
//
* @param response
//
*/
//
void downLoadFilesByUrll(String path, HttpServletResponse response );
//
//
/**
//
* 修改单据相关信息
//
* @param paramBo
//
* @return
//
*/
//
Map<String, String> updateByid(FireParamBo paramBo);
//
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/FileUtils.java
deleted
100644 → 0
View file @
aa932249
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.List
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
/**
* 文件下载 工具类
*
* @author 郑嘉伟
* @since 2020-08-05
*/
public
class
FileUtils
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
FileUtils
.
class
);
/**
* 获取压缩好zip——>设置消息头——>输出
* @param response
* @param list
* @param ipUrl
* @throws IOException
*/
public
static
void
downloadZIP
(
HttpServletResponse
response
,
List
<
String
>
list
,
String
ipUrl
)
throws
IOException
{
//构建zip
String
zipname
=
"单据相关附件.zip"
;
String
zippath
=
fileToZip
(
list
,
zipname
,
ipUrl
);
OutputStream
out
=
null
;
BufferedInputStream
br
=
null
;
try
{
String
fileName
=
new
String
(
zipname
.
getBytes
(
"UTF-8"
),
"iso-8859-1"
);
br
=
new
BufferedInputStream
(
new
FileInputStream
(
zippath
));
byte
[]
buf
=
new
byte
[
1024
];
int
len
=
0
;
response
.
reset
();
response
.
setHeader
(
"Content-Type"
,
"application/octet-stream;charset=utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
fileName
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"access_token"
);
response
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
);
response
.
setContentType
(
"application/zip"
);
out
=
response
.
getOutputStream
();
while
((
len
=
br
.
read
(
buf
))
>
0
)
{
out
.
write
(
buf
,
0
,
len
);
out
.
flush
();
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
finally
{
br
.
close
();
out
.
close
();
}
}
/**
* 通过文件服务器——>获取流——>输出——>压缩
*
* @param list
* @param fileName
* @return
*/
public
static
String
fileToZip
(
List
<
String
>
list
,
String
fileName
,
String
ipUrl
)
{
InputStream
fis
=
null
;
BufferedInputStream
bis
=
null
;
FileOutputStream
fos
=
null
;
ZipOutputStream
zos
=
null
;
// 临时目录
String
path
=
System
.
getProperty
(
"java.io.tmpdir"
)
+
fileName
;
try
{
File
zipFile
=
new
File
(
path
);
zipFile
.
deleteOnExit
();
zipFile
.
createNewFile
();
fos
=
new
FileOutputStream
(
zipFile
);
zos
=
new
ZipOutputStream
(
new
BufferedOutputStream
(
fos
));
byte
[]
bufs
=
new
byte
[
1024
*
10
];
for
(
String
a
:
list
)
{
fis
=
getInputStreamFromURL
(
ipUrl
+
a
);
String
subFileName
=
new
File
(
ipUrl
+
a
).
getName
();
//创建ZIP实体,并添加进压缩包
ZipEntry
zipEntry
=
new
ZipEntry
(
subFileName
);
zos
.
putNextEntry
(
zipEntry
);
bis
=
new
BufferedInputStream
(
fis
,
1024
*
10
);
int
read
=
0
;
while
((
read
=
bis
.
read
(
bufs
,
0
,
1024
*
10
))
!=
-
1
)
{
zos
.
write
(
bufs
,
0
,
read
);
}
}
System
.
out
.
println
(
"压缩成功"
);
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
if
(
null
!=
bis
)
{
bis
.
close
();
}
if
(
null
!=
zos
)
{
zos
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
e
);
}
}
return
path
;
}
/**
* 从URL中读取图片,转换成流形式.
*
* @param destUrl
* @return
*/
public
static
InputStream
getInputStreamFromURL
(
String
destUrl
)
{
HttpURLConnection
httpUrl
=
null
;
URL
url
=
null
;
InputStream
in
=
null
;
try
{
url
=
new
URL
(
destUrl
);
httpUrl
=
(
HttpURLConnection
)
url
.
openConnection
();
httpUrl
.
connect
();
in
=
httpUrl
.
getInputStream
();
return
in
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/LogFilter.java
0 → 100644
View file @
e5e55dca
package
com
.
yeejoin
.
amos
.
fas
.
config
;
import
ch.qos.logback.classic.pattern.ClassicConverter
;
import
ch.qos.logback.classic.spi.ILoggingEvent
;
import
java.text.Normalizer
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* @author keyong
* @title: LogFilter
* <pre>
* @description: TODO
* </pre>
* @date 2024/3/25 15:04
*/
public
class
LogFilter
extends
ClassicConverter
{
private
static
final
List
<
String
>
LOG_VALID_LIST
=
Arrays
.
asList
(
"%0d"
,
"%0a"
,
"%0A"
,
"%0D"
,
"\r"
,
"\n"
);
@Override
public
String
convert
(
ILoggingEvent
event
)
{
if
(
event
.
getLoggerName
().
startsWith
(
"com.yeejoin"
))
{
//根据package启用规则
return
validLog
(
event
.
getFormattedMessage
());
}
else
{
return
event
.
getFormattedMessage
();
}
}
public
static
String
validLog
(
String
logs
)
{
String
normalize
=
Normalizer
.
normalize
(
logs
,
Normalizer
.
Form
.
NFKC
);
for
(
String
str
:
LOG_VALID_LIST
)
{
normalize
=
normalize
.
replace
(
str
,
""
);
}
return
normalize
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/threadpool/AmosThreadPool.java
View file @
e5e55dca
...
...
@@ -18,6 +18,8 @@ public class AmosThreadPool {
*/
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosThreadPool
.
class
);
private
static
volatile
AmosThreadPool
amosThreadPool
=
null
;
/**
* 单例
*/
...
...
@@ -34,14 +36,14 @@ public class AmosThreadPool {
* @return
*/
public
static
AmosThreadPool
getInstance
()
{
if
(
instance
==
null
)
{
if
(
amosThreadPool
==
null
)
{
synchronized
(
AmosThreadPool
.
class
)
{
if
(
instance
==
null
)
{
instance
=
new
AmosThreadPool
();
if
(
amosThreadPool
==
null
)
{
amosThreadPool
=
new
AmosThreadPool
();
}
}
}
return
instance
;
return
amosThreadPool
;
}
static
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/FileUtil.java
View file @
e5e55dca
...
...
@@ -78,7 +78,7 @@ public class FileUtil {
fileName
=
new
Date
().
getTime
()
+
"_"
+
name
;
// 获取文件的后缀名
String
suffixName
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
)).
toLowerCase
();
// 例如:.jpg
String
suffixName
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
)).
toLowerCase
(
Locale
.
ENGLISH
);
// 例如:.jpg
// 文件上传后的路径
String
filePath
=
getFilePath
(
suffixName
);
// 1.images 2.musics 3.videos
// 4.docs
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/ResponseUtils.java
View file @
e5e55dca
...
...
@@ -168,7 +168,7 @@ public final class ResponseUtils {
public
static
Object
getGetMethod
(
Object
ob
,
String
name
)
throws
Exception
{
Method
[]
m
=
ob
.
getClass
().
getMethods
();
for
(
int
i
=
0
;
i
<
m
.
length
;
i
++){
if
((
"get"
+
name
).
toLowerCase
().
equals
(
m
[
i
].
getName
().
toLowerCas
e
())){
if
((
"get"
+
name
).
equalsIgnoreCase
(
m
[
i
].
getNam
e
())){
return
m
[
i
].
invoke
(
ob
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/WordConverterUtils.java
View file @
e5e55dca
...
...
@@ -6,6 +6,7 @@ import org.apache.poi.xwpf.converter.xhtml.XHTMLConverter;
import
org.apache.poi.xwpf.converter.xhtml.XHTMLOptions
;
import
org.apache.poi.xwpf.usermodel.XWPFDocument
;
import
javax.xml.XMLConstants
;
import
javax.xml.parsers.DocumentBuilderFactory
;
import
javax.xml.transform.OutputKeys
;
import
javax.xml.transform.Transformer
;
...
...
@@ -104,6 +105,7 @@ public class WordConverterUtils {
DOMSource
domSource
=
new
DOMSource
(
htmlDocument
);
StreamResult
streamResult
=
new
StreamResult
(
targetFile
);
TransformerFactory
tf
=
TransformerFactory
.
newInstance
();
tf
.
setFeature
(
XMLConstants
.
FEATURE_SECURE_PROCESSING
,
true
);
Transformer
serializer
=
tf
.
newTransformer
();
serializer
.
setOutputProperty
(
OutputKeys
.
ENCODING
,
"utf-8"
);
serializer
.
setOutputProperty
(
OutputKeys
.
INDENT
,
"yes"
);
...
...
@@ -150,6 +152,7 @@ public class WordConverterUtils {
StringWriter
stringWriter
=
new
StringWriter
();
StreamResult
streamResult
=
new
StreamResult
(
stringWriter
);
TransformerFactory
tf
=
TransformerFactory
.
newInstance
();
tf
.
setFeature
(
XMLConstants
.
FEATURE_SECURE_PROCESSING
,
true
);
Transformer
serializer
=
tf
.
newTransformer
();
serializer
.
setOutputProperty
(
OutputKeys
.
ENCODING
,
"utf-8"
);
serializer
.
setOutputProperty
(
OutputKeys
.
INDENT
,
"yes"
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/query/BaseQuerySpecification.java
View file @
e5e55dca
...
...
@@ -77,11 +77,11 @@ public class BaseQuerySpecification<T> implements Specification<T> {
List
<
Order
>
orders
=
new
ArrayList
<>();
orderbys
.
keySet
().
forEach
(
key
->
{
if
(
key
.
toLowerCase
().
equals
(
"asc"
)
&&
!
orderbys
.
get
(
key
).
isEmpty
())
{
if
(
"asc"
.
equalsIgnoreCase
(
key
)
&&
!
orderbys
.
get
(
key
).
isEmpty
())
{
orderbys
.
get
(
key
).
forEach
(
propertyName
->
{
orders
.
add
(
builder
.
asc
(
root
.
get
(
propertyName
)));
});
}
else
if
(
key
.
toLowerCase
().
equals
(
"desc"
)
&&
!
orderbys
.
get
(
key
).
isEmpty
())
{
}
else
if
(
"desc"
.
equalsIgnoreCase
(
key
)
&&
!
orderbys
.
get
(
key
).
isEmpty
())
{
orderbys
.
get
(
key
).
forEach
(
propertyName
->
{
orders
.
add
(
builder
.
desc
(
root
.
get
(
propertyName
)));
});
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_rectification.xml
View file @
e5e55dca
...
...
@@ -2,161 +2,161 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.FireRectificationMapper"
>
<select
id=
"queryFiresAndCount"
resultType=
"com.yeejoin.amos.fas.business.bo.FireRectificationBo"
>
SELECT * FROM (
SELECT
BILL_NO AS billno,
STATION_SEQ AS stationNum,
STATION_NAME AS stationName,
( SELECT COUNT(1) FROM ELEC_BILLS_ALARM_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS warnning,
( SELECT COUNT(1) FROM ELEC_BILLS_RISK_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR) AS danger,
( SELECT COUNT(1) FROM ELEC_BILLS_DANGER_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS hiddenTrouble,
( SELECT COUNT(1) FROM ELEC_BILLS_FIRE_SAFETY_CONTROL WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS adminOfFire,
SAFETY_CHARGE_PERSON AS chargePerson,
SAFETY_PERSON_PHONE AS chargePersonTel,
date_format(REQUIREMENT_DATE,'%Y / %m / %d') AS completionDate,
REQUIREMENT_DATE,
date_format(ACTUAL_FINISH_DATE,'%Y / %m / %d') AS reCompletionDate,
STATUS AS statuscode,
if(STATUS=1,'未处理','已完成') AS status
FROM
ELEC_BILLS_BASIC_INFO EBD
where STATUS = 1 or STATUS = 2
ORDER BY REQUIREMENT_DATE) BDATA
where 1=1
<if
test=
"nameLike != null "
>
and billno like CONCAT('%',#{nameLike},'%')
</if
>
<if
test=
"sDate != 'null' and sDate != '1970-1-1' "
>
and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')
</if
>
<if
test=
"eDate != 'null' and eDate != '1970-1-1' "
>
and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')
</if
>
<if
test=
"states != 0 "
>
and statuscode = #{states}
</if
>
LIMIT #{spage},#{pageSize}
</select
>
<select
id=
"countQueryFireList"
resultType=
"long"
>
SELECT COUNT(1) FROM (
SELECT
BILL_NO AS billno,
REQUIREMENT_DATE,
STATUS
FROM
ELEC_BILLS_BASIC_INFO EBD
where STATUS = 1 or STATUS = 2
ORDER BY REQUIREMENT_DATE) BDATA
where 1=1
<if
test=
"nameLike != null "
>
and billno like CONCAT('%',#{nameLike},'%')
</if
>
<if
test=
"sDate != 'null' and sDate != '1970-1-1' "
>
and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')
</if
>
<if
test=
"eDate != 'null' and eDate != '1970-1-1' "
>
and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')
</if
>
<if
test=
"states != 0 "
>
and STATUS = #{states}
</if
>
</select
>
<select
id=
"selectOneForBase"
resultType=
"com.yeejoin.amos.fas.business.bo.FireRectificationBo"
>
select
BILL_NO AS billNo,
STATION_NAME AS stationName,
DISTRIBUTION_USER_NAME AS disUser,
DISTRIBUTION_DATE AS disDate,
STATION_CHARGE_PERSON AS stationUser,
CHARGE_PERSON_PHONE AS stationUserTel,
SAFETY_CHARGE_PERSON AS safeUser,
SAFETY_PERSON_PHONE AS safeUserTel,
REQUIREMENT_DATE AS reqDate,
if(ACTUAL_FINISH_DATE is null, date_format(sysdate(),'%Y-%m-%d') ,ACTUAL_FINISH_DATE) AS finishDate,
REFORM_RESULT AS refResult,
VIEWS_AND_SUGGESTIONS AS viewsAndSuggestions,
FEEDBACK_RESULT AS backResult,
STATUS AS status
from
elec_bills_basic_info EBD
where BILL_NO = #{billNo}
</select
>
<select
id=
"selectOneForEmergency"
resultType=
"com.yeejoin.amos.fas.business.bo.FireMoreDataBo"
>
select
SEQUENCE_NBR as req,
FIRE_EQUIPMENT_NAME AS name,
ALARM_DESC AS persent,
HANDLE_STATE AS doneResult,
FILE_PATH as filePath
from
elec_bills_alarm_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select
>
<select
id=
"selectOneForDanger"
resultType=
"com.yeejoin.amos.fas.business.bo.FireMoreDataBo"
>
select
SEQUENCE_NBR as req,
LEVEL_NAME AS lvl,
POINT_NAME AS persent,
RISK_FACTOR_NAME AS affect,
FEEDBACK AS backResult
from
elec_bills_risk_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select
>
<select
id=
"selectOneForHidden"
resultType=
"com.yeejoin.amos.fas.business.bo.FireMoreDataBo"
>
select
SEQUENCE_NBR as req,
if(DANGER_LEVEL=1,'一般隐患','重大隐患') AS lvl,
DANGER_NAME AS persent,
INPUT_ITEM_NAME AS affect,
HANDLE_STATE AS doneResult,
FILE_PATH as filePath
from
elec_bills_danger_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select
>
<select
id=
"selectOneForfire"
resultType=
"com.yeejoin.amos.fas.business.bo.FireInfoBo"
>
select
TYPE AS type,
ACTUAL_NUMBER AS realNum,
THRESHOLD AS threshold
from
elec_bills_fire_safety_control
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
and type =${id}
</select
>
<update
id=
"updateBill"
>
UPDATE
ELEC_BILLS_BASIC_INFO
SET STATUS = 2,
REFORM_RESULT =#{refResult} ,
FEEDBACK_RESULT =#{backResult}
where BILL_NO = #{billNo}
</update
>
<update
id=
"updateWarnning"
>
UPDATE
ELEC_BILLS_ALARM_INFO
SET
HANDLE_STATE =#{doneResult} ,
FILE_PATH =#{filePath}
where SEQUENCE_NBR = #{req}
</update
>
<update
id=
"updateHidden"
>
UPDATE
ELEC_BILLS_DANGER_INFO
SET
HANDLE_STATE =#{doneResult} ,
FILE_PATH =#{filePath}
where SEQUENCE_NBR = #{req}
<!-- <select id="queryFiresAndCount" resultType="com.yeejoin.amos.fas.business.bo.FireRectificationBo">--
>
<!-- SELECT * FROM (-->
<!-- SELECT-->
<!-- BILL_NO AS billno,-->
<!-- STATION_SEQ AS stationNum,-->
<!-- STATION_NAME AS stationName,-->
<!-- ( SELECT COUNT(1) FROM ELEC_BILLS_ALARM_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS warnning,-->
<!-- ( SELECT COUNT(1) FROM ELEC_BILLS_RISK_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR) AS danger,-->
<!-- ( SELECT COUNT(1) FROM ELEC_BILLS_DANGER_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS hiddenTrouble,-->
<!-- ( SELECT COUNT(1) FROM ELEC_BILLS_FIRE_SAFETY_CONTROL WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS adminOfFire,-->
<!-- SAFETY_CHARGE_PERSON AS chargePerson,-->
<!-- SAFETY_PERSON_PHONE AS chargePersonTel,-->
<!-- date_format(REQUIREMENT_DATE,'%Y / %m / %d') AS completionDate,-->
<!-- REQUIREMENT_DATE,-->
<!-- date_format(ACTUAL_FINISH_DATE,'%Y / %m / %d') AS reCompletionDate,-->
<!-- STATUS AS statuscode,-->
<!-- if(STATUS=1,'未处理','已完成') AS status-->
<!-- FROM-->
<!-- ELEC_BILLS_BASIC_INFO EBD-->
<!-- where STATUS = 1 or STATUS = 2-->
<!-- ORDER BY REQUIREMENT_DATE) BDATA-->
<!-- where 1=1-->
<!-- <if test="nameLike != null ">--
>
<!-- and billno like CONCAT('%',#{nameLike},'%')-->
<!-- </if>--
>
<!-- <if test="sDate != 'null' and sDate != '1970-1-1' ">--
>
<!-- and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')-->
<!-- </if>--
>
<!-- <if test="eDate != 'null' and eDate != '1970-1-1' ">--
>
<!-- and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')-->
<!-- </if>--
>
<!-- <if test="states != 0 ">--
>
<!-- and statuscode = #{states}-->
<!-- </if>--
>
<!-- LIMIT #{spage},#{pageSize}-->
<!-- </select>--
>
<!-- <select id="countQueryFireList" resultType="long">--
>
<!-- SELECT COUNT(1) FROM (-->
<!-- SELECT-->
<!-- BILL_NO AS billno,-->
<!-- REQUIREMENT_DATE,-->
<!-- STATUS-->
<!-- FROM-->
<!-- ELEC_BILLS_BASIC_INFO EBD-->
<!-- where STATUS = 1 or STATUS = 2-->
<!-- ORDER BY REQUIREMENT_DATE) BDATA-->
<!-- where 1=1-->
<!-- <if test="nameLike != null ">--
>
<!-- and billno like CONCAT('%',#{nameLike},'%')-->
<!-- </if>--
>
<!-- <if test="sDate != 'null' and sDate != '1970-1-1' ">--
>
<!-- and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')-->
<!-- </if>--
>
<!-- <if test="eDate != 'null' and eDate != '1970-1-1' ">--
>
<!-- and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')-->
<!-- </if>--
>
<!-- <if test="states != 0 ">--
>
<!-- and STATUS = #{states}-->
<!-- </if>--
>
<!-- </select>--
>
<!-- <select id="selectOneForBase" resultType="com.yeejoin.amos.fas.business.bo.FireRectificationBo">--
>
<!-- select-->
<!-- BILL_NO AS billNo,-->
<!-- STATION_NAME AS stationName,-->
<!-- DISTRIBUTION_USER_NAME AS disUser,-->
<!-- DISTRIBUTION_DATE AS disDate,-->
<!-- STATION_CHARGE_PERSON AS stationUser,-->
<!-- CHARGE_PERSON_PHONE AS stationUserTel,-->
<!-- SAFETY_CHARGE_PERSON AS safeUser,-->
<!-- SAFETY_PERSON_PHONE AS safeUserTel,-->
<!-- REQUIREMENT_DATE AS reqDate,-->
<!-- if(ACTUAL_FINISH_DATE is null, date_format(sysdate(),'%Y-%m-%d') ,ACTUAL_FINISH_DATE) AS finishDate,-->
<!-- REFORM_RESULT AS refResult,-->
<!-- VIEWS_AND_SUGGESTIONS AS viewsAndSuggestions,-->
<!-- FEEDBACK_RESULT AS backResult,-->
<!-- STATUS AS status-->
<!-- from-->
<!-- elec_bills_basic_info EBD-->
<!-- where BILL_NO = #{billNo}-->
<!-- </select>--
>
<!-- <select id="selectOneForEmergency" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">--
>
<!-- select-->
<!-- SEQUENCE_NBR as req,-->
<!-- FIRE_EQUIPMENT_NAME AS name,-->
<!-- ALARM_DESC AS persent,-->
<!-- HANDLE_STATE AS doneResult,-->
<!-- FILE_PATH as filePath-->
<!-- from-->
<!-- elec_bills_alarm_info-->
<!-- where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})-->
<!-- </select>--
>
<!-- <select id="selectOneForDanger" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">--
>
<!-- select-->
<!-- SEQUENCE_NBR as req,-->
<!-- LEVEL_NAME AS lvl,-->
<!-- POINT_NAME AS persent,-->
<!-- RISK_FACTOR_NAME AS affect,-->
<!-- FEEDBACK AS backResult-->
<!-- from-->
<!-- elec_bills_risk_info-->
<!-- where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})-->
<!-- </select>--
>
<!-- <select id="selectOneForHidden" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">--
>
<!-- select-->
<!-- SEQUENCE_NBR as req,-->
<!-- if(DANGER_LEVEL=1,'一般隐患','重大隐患') AS lvl,-->
<!-- DANGER_NAME AS persent,-->
<!-- INPUT_ITEM_NAME AS affect,-->
<!-- HANDLE_STATE AS doneResult,-->
<!-- FILE_PATH as filePath-->
<!-- from-->
<!-- elec_bills_danger_info-->
<!-- where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})-->
<!-- </select>--
>
<!-- <select id="selectOneForfire" resultType="com.yeejoin.amos.fas.business.bo.FireInfoBo">--
>
<!-- select-->
<!-- TYPE AS type,-->
<!-- ACTUAL_NUMBER AS realNum,-->
<!-- THRESHOLD AS threshold-->
<!-- from-->
<!-- elec_bills_fire_safety_control-->
<!-- where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})-->
<!-- and type =${id}-->
<!-- </select>--
>
<!-- <update id="updateBill">--
>
<!-- UPDATE-->
<!-- ELEC_BILLS_BASIC_INFO-->
<!-- SET STATUS = 2,-->
<!-- REFORM_RESULT =#{refResult} ,-->
<!-- FEEDBACK_RESULT =#{backResult}-->
<!-- where BILL_NO = #{billNo}-->
<!-- </update>--
>
<!-- <update id="updateWarnning">--
>
<!-- UPDATE-->
<!-- ELEC_BILLS_ALARM_INFO-->
<!-- SET-->
<!-- HANDLE_STATE =#{doneResult} ,-->
<!-- FILE_PATH =#{filePath}-->
<!-- where SEQUENCE_NBR = #{req}-->
<!-- </update>--
>
<!-- <update id="updateHidden">--
>
<!-- UPDATE-->
<!-- ELEC_BILLS_DANGER_INFO-->
<!-- SET-->
<!-- HANDLE_STATE =#{doneResult} ,-->
<!-- FILE_PATH =#{filePath}-->
<!-- where SEQUENCE_NBR = #{req}-->
</update
>
<update
id=
"updateDanger"
>
UPDATE
ELEC_BILLS_RISK_INFO
SET
FEEDBACK =#{backResult}
where SEQUENCE_NBR = #{req}
<!-- </update>--
>
<!-- <update id="updateDanger">--
>
<!-- UPDATE-->
<!-- ELEC_BILLS_RISK_INFO-->
<!-- SET-->
<!-- FEEDBACK =#{backResult}-->
<!-- where SEQUENCE_NBR = #{req}-->
</update
>
<!-- </update>--
>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/logback.xml
View file @
e5e55dca
...
...
@@ -2,6 +2,7 @@
<configuration
debug=
"false"
>
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property
name=
"LOG_HOME"
value=
"log"
/>
<conversionRule
conversionWord=
"msg"
converterClass=
"com.yeejoin.amos.fas.config.LogFilter"
/>
<!-- 按照每天生成日志文件 -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
...
...
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