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
2cb81c97
Commit
2cb81c97
authored
May 06, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Plain Diff
冲突
parents
60155ad9
baec1ff4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
346 additions
and
188 deletions
+346
-188
DataRefreshTypeEum.java
...com/yeejoin/amos/fas/common/enums/DataRefreshTypeEum.java
+44
-0
View3dRefreshAreaEum.java
...m/yeejoin/amos/fas/common/enums/View3dRefreshAreaEum.java
+43
-8
SafetyIndexChangeLog.java
...com/yeejoin/amos/fas/dao/entity/SafetyIndexChangeLog.java
+17
-24
DataRefreshController.java
...n/amos/fas/business/controller/DataRefreshController.java
+34
-0
ExcelController.java
...yeejoin/amos/fas/business/controller/ExcelController.java
+1
-3
RiskModelController.java
...oin/amos/fas/business/controller/RiskModelController.java
+1
-2
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+18
-5
DataRefreshServiceImpl.java
...mos/fas/business/service/impl/DataRefreshServiceImpl.java
+58
-0
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+47
-86
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+34
-51
IDataRefreshService.java
.../amos/fas/business/service/intfc/IDataRefreshService.java
+23
-0
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+4
-2
Config.java
...ice/src/main/java/com/yeejoin/amos/fas/config/Config.java
+2
-1
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+1
-1
application-docker.properties
...SysStart/src/main/resources/application-docker.properties
+1
-1
application-test.properties
...toSysStart/src/main/resources/application-test.properties
+1
-1
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+3
-3
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+14
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/DataRefreshTypeEum.java
0 → 100644
View file @
2cb81c97
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
/**
* @author suhg
*/
public
enum
DataRefreshTypeEum
{
/**
* 数据刷新触发原因
*/
dateChange
(
"日切"
,
"dateChange"
),
rpn
(
"rpn变化"
,
"rpn"
),
alarm
(
"设备报警"
,
"alarm"
),
monitor
(
"监测数据"
,
"monitor"
),
planTask
(
"检查任务"
,
"planTask"
),
check
(
"巡检"
,
"check"
),
trouble
(
"设备故障"
,
"trouble"
),
dutyChange
(
"值班信息"
,
"dutyChange"
);
private
String
code
;
private
String
name
;
DataRefreshTypeEum
(
String
code
,
String
name
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/View3dRefreshAreaEum.java
View file @
2cb81c97
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* @author suhg
* @author suhg
*/
*/
public
enum
View3dRefreshAreaEum
{
public
enum
View3dRefreshAreaEum
{
/**
/**
* 3d页面数据区域
* 3d页面数据区域
(triggerBy枚举定义见DataRefreshTypeEum.java)
*/
*/
all
(
"全部区域"
,
"all"
),
all
(
"全部区域"
,
"all"
,
"dateChange"
),
today_safety_index
(
"今日安全指数"
,
"today_safety_index"
),
today_safety_index
(
"今日安全指数"
,
"today_safety_index"
,
"rpn,check,trouble"
),
fire_safety
(
"消防安全执行"
,
"fire_safety"
),
fire_safety
(
"消防安全执行"
,
"fire_safety"
,
"alarm,rpn,check,trouble"
),
week_safety_index
(
"一周安全指数趋势"
,
"week_safety_index"
),
monitor_data
(
"设备状态检测数据"
,
"monitor_data"
,
"monitor"
),
today_check_status
(
"今日巡检情况"
,
"today_check_status"
),
error_status
(
"异常区域"
,
"error_status"
,
"rpn,trouble"
),
today_duty
(
"今日值班"
,
"today_duty"
);
week_safety_index
(
"一周安全指数趋势"
,
"week_safety_index"
,
"rpn"
),
today_check_status
(
"今日巡检情况"
,
"today_check_status"
,
"planTask,check"
),
today_duty
(
"今日值班"
,
"today_duty"
,
"dutyChange"
);
private
String
code
;
private
String
code
;
private
String
name
;
private
String
name
;
View3dRefreshAreaEum
(
String
name
,
String
code
){
private
String
triggerBy
;
View3dRefreshAreaEum
(
String
name
,
String
code
,
String
triggerBy
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
code
=
code
;
this
.
code
=
code
;
this
.
triggerBy
=
triggerBy
;
}
}
public
String
getCode
()
{
public
String
getCode
()
{
...
@@ -40,4 +48,31 @@ public enum View3dRefreshAreaEum {
...
@@ -40,4 +48,31 @@ public enum View3dRefreshAreaEum {
public
void
setName
(
String
name
)
{
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
}
}
public
String
getTriggerBy
()
{
return
triggerBy
;
}
public
void
setTriggerBy
(
String
triggerBy
)
{
this
.
triggerBy
=
triggerBy
;
}
public
static
List
<
View3dRefreshAreaEum
>
getEumListByTrigger
(
String
trigger
)
{
List
<
View3dRefreshAreaEum
>
eumList
=
new
ArrayList
<>();
for
(
View3dRefreshAreaEum
eum
:
View3dRefreshAreaEum
.
values
())
{
if
(
eum
.
getTriggerBy
().
contains
(
trigger
))
{
eumList
.
add
(
eum
);
}
}
return
eumList
;
}
public
static
View3dRefreshAreaEum
getEumByCode
(
String
code
)
{
for
(
View3dRefreshAreaEum
eum
:
View3dRefreshAreaEum
.
values
())
{
if
(
code
.
equals
(
eum
.
getCode
()))
{
return
eum
;
}
}
return
null
;
}
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/SafetyIndexChangeLog.java
View file @
2cb81c97
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Lob
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
/**
* The persistent class for the fire_car database table.
* 安全指数日流水
*
*/
*/
@Entity
@Entity
@Table
(
name
=
"f_safety_index_change_log"
)
@Table
(
name
=
"f_safety_index_change_log"
)
@NamedQuery
(
name
=
"SafetyIndexChangeLog.findAll"
,
query
=
"SELECT s FROM SafetyIndexChangeLog s"
)
@NamedQuery
(
name
=
"SafetyIndexChangeLog.findAll"
,
query
=
"SELECT s FROM SafetyIndexChangeLog s"
)
public
class
SafetyIndexChangeLog
implements
Serializable
{
public
class
SafetyIndexChangeLog
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
/**
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
* 安全指数
@Column
(
name
=
"ID"
,
nullable
=
false
,
unique
=
true
)
*/
private
Long
id
;
@Column
(
name
=
"safety_index"
)
@Column
(
name
=
"safety_index"
)
private
BigDecimal
safetyIndex
;
private
BigDecimal
safetyIndex
;
/**
* 流水日期
*/
@Column
(
name
=
"collect_date"
)
@Column
(
name
=
"collect_date"
)
private
Date
collectDate
;
private
Date
collectDate
;
/**
* 机构
*/
@Column
(
name
=
"org_code"
)
@Column
(
name
=
"org_code"
)
private
String
orgCode
;
private
String
orgCode
;
/**
* 备注
*/
@Column
(
name
=
"remark"
)
@Column
(
name
=
"remark"
)
private
String
remark
;
private
String
remark
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
BigDecimal
getSafetyIndex
()
{
public
BigDecimal
getSafetyIndex
()
{
return
safetyIndex
;
return
safetyIndex
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/DataRefreshController.java
0 → 100644
View file @
2cb81c97
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService
;
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.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author suhg
*/
@RestController
@RequestMapping
(
"/api/data"
)
@Api
(
tags
=
"三维屏数据刷新api"
)
public
class
DataRefreshController
{
@Autowired
private
IDataRefreshService
dataRefreshService
;
/**
* 全景监控执行数据刷新
* @return success
*/
@ApiOperation
(
value
=
"全景监控执行数据刷新"
,
notes
=
"check-巡检记录,planTask-执行数据"
)
@GetMapping
(
value
=
"refresh/{dataType}"
)
public
CommonResponse
checkDataRefresh
(
@PathVariable
String
dataType
){
dataRefreshService
.
refreshViewData
(
dataType
);
return
CommonResponseUtil
.
success
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ExcelController.java
View file @
2cb81c97
...
@@ -8,7 +8,6 @@ import com.yeejoin.amos.fas.business.service.intfc.IExcelService;
...
@@ -8,7 +8,6 @@ import com.yeejoin.amos.fas.business.service.intfc.IExcelService;
import
com.yeejoin.amos.fas.business.util.FileHelper
;
import
com.yeejoin.amos.fas.business.util.FileHelper
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.FileUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -19,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
...
@@ -19,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -72,7 +70,7 @@ public class ExcelController extends BaseController {
...
@@ -72,7 +70,7 @@ public class ExcelController extends BaseController {
@ApiOperation
(
value
=
"导出数据"
,
notes
=
"导出数据"
)
@ApiOperation
(
value
=
"导出数据"
,
notes
=
"导出数据"
)
@PostMapping
(
value
=
"/export"
)
@PostMapping
(
value
=
"/export"
)
//@Authorization(ingore = true)
//@Authorization(ingore = true)
public
void
export
(
HttpServletResponse
response
,
public
void
export
(
HttpServletResponse
response
,
@ApiParam
(
value
=
"data:导出数据;model:导出模板"
,
required
=
true
)
@RequestParam
String
exportType
,
@ApiParam
(
value
=
"data:导出数据;model:导出模板"
,
required
=
true
)
@RequestParam
String
exportType
,
@ApiParam
(
value
=
"point:监测点;equipment:设备"
,
required
=
true
)
@RequestParam
String
modelName
,
@ApiParam
(
value
=
"point:监测点;equipment:设备"
,
required
=
true
)
@RequestParam
String
modelName
,
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskModelController.java
View file @
2cb81c97
...
@@ -14,7 +14,6 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
...
@@ -14,7 +14,6 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -33,7 +32,7 @@ import java.util.List;
...
@@ -33,7 +32,7 @@ import java.util.List;
@Api
(
tags
=
"风险模型api"
)
@Api
(
tags
=
"风险模型api"
)
public
class
RiskModelController
extends
BaseController
{
public
class
RiskModelController
extends
BaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
Risk
Lev
elController
.
class
);
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
Risk
Mod
elController
.
class
);
@Autowired
@Autowired
private
IRiskSourceService
riskSourceService
;
private
IRiskSourceService
riskSourceService
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
2cb81c97
...
@@ -49,6 +49,7 @@ public class View3dController extends BaseController {
...
@@ -49,6 +49,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getRegionTree
()
{
public
CommonResponse
getRegionTree
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"10"
;
orgCode
=
"10"
;
String
channelType
=
this
.
getChannelType
();
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionTree
(
channelType
,
orgCode
));
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionTree
(
channelType
,
orgCode
));
...
@@ -59,6 +60,7 @@ public class View3dController extends BaseController {
...
@@ -59,6 +60,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getRegionDetail
(
@PathVariable
(
"riskSourceId"
)
Long
riskSourceId
)
{
public
CommonResponse
getRegionDetail
(
@PathVariable
(
"riskSourceId"
)
Long
riskSourceId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"10"
;
orgCode
=
"10"
;
String
channelType
=
this
.
getChannelType
();
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceId
,
orgCode
,
channelType
));
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceId
,
orgCode
,
channelType
));
...
@@ -87,6 +89,7 @@ public class View3dController extends BaseController {
...
@@ -87,6 +89,7 @@ public class View3dController extends BaseController {
if
(
ResourceTypeDefEnum
.
containsTypeCode
(
type
))
{
if
(
ResourceTypeDefEnum
.
containsTypeCode
(
type
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"10"
;
orgCode
=
"10"
;
String
channelType
=
this
.
getChannelType
();
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
,
channelType
));
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
,
channelType
));
...
@@ -99,6 +102,7 @@ public class View3dController extends BaseController {
...
@@ -99,6 +102,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getPointDetail
(
String
type
,
Long
pointId
)
{
public
CommonResponse
getPointDetail
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
));
return
CommonResponseUtil
.
success
(
view3dService
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
));
}
}
...
@@ -108,6 +112,7 @@ public class View3dController extends BaseController {
...
@@ -108,6 +112,7 @@ public class View3dController extends BaseController {
public
CommonResponse
safetyIndexWeek
(
String
type
,
Long
pointId
)
{
public
CommonResponse
safetyIndexWeek
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"10"
;
orgCode
=
"10"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexWeek
(
orgCode
));
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexWeek
(
orgCode
));
}
}
...
@@ -117,6 +122,7 @@ public class View3dController extends BaseController {
...
@@ -117,6 +122,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getSafetyIndexInfoByDate
(
@RequestParam
(
name
=
"date"
,
required
=
false
)
String
date
){
public
CommonResponse
getSafetyIndexInfoByDate
(
@RequestParam
(
name
=
"date"
,
required
=
false
)
String
date
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexInfoByDate
(
orgCode
,
date
));
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexInfoByDate
(
orgCode
,
date
));
}
}
...
@@ -152,6 +158,7 @@ public class View3dController extends BaseController {
...
@@ -152,6 +158,7 @@ public class View3dController extends BaseController {
public
CommonResponse
getSafetyExecuteListTop5
(
@PathVariable
(
"type"
)
String
type
){
public
CommonResponse
getSafetyExecuteListTop5
(
@PathVariable
(
"type"
)
String
type
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyExecuteListTop5
(
type
,
orgCode
));
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyExecuteListTop5
(
type
,
orgCode
));
}
}
...
@@ -187,6 +194,7 @@ public class View3dController extends BaseController {
...
@@ -187,6 +194,7 @@ public class View3dController extends BaseController {
public
CommonResponse
initViewNode
(
String
type
){
public
CommonResponse
initViewNode
(
String
type
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
initViewErrorNode
(
type
,
orgCode
));
return
CommonResponseUtil
.
success
(
view3dService
.
initViewErrorNode
(
type
,
orgCode
));
}
}
...
@@ -200,11 +208,16 @@ public class View3dController extends BaseController {
...
@@ -200,11 +208,16 @@ public class View3dController extends BaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
get3dPointsByModel
(
orgCode
,
model
));
return
CommonResponseUtil
.
success
(
view3dService
.
get3dPointsByModel
(
orgCode
,
model
));
}
}
@Scheduled
(
cron
=
"${param.safetyIndexchange.cron}"
)
@Scheduled
(
cron
=
"${param.safetyIndexChange.cron}"
)
@ApiOperation
(
value
=
"更新安全指数"
,
notes
=
"更新安全指数"
)
public
CommonResponse
safetyIndexLog
(){
@GetMapping
(
value
=
"safetyIndex/refresh"
)
view3dService
.
safetyIndexLogGenJob
(
null
);
public
CommonResponse
safetyIndexRefresh
(){
return
CommonResponseUtil
.
success
();
view3dService
.
safetyIndexRefresh
();
}
@ApiOperation
(
value
=
"安全指数日流生成"
,
notes
=
"安全指数日流生成定时任务"
)
@GetMapping
(
value
=
"safetyIndex/schJobTest"
)
public
CommonResponse
safetyIndexLog
(
@ApiParam
(
value
=
"格式:yyyy-MM-dd"
)
@RequestParam
String
runData
){
view3dService
.
safetyIndexLogGenJob
(
runData
);
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/DataRefreshServiceImpl.java
0 → 100644
View file @
2cb81c97
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer
;
import
com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 数据刷新
*/
@Service
(
"dataRefreshService"
)
public
class
DataRefreshServiceImpl
implements
IDataRefreshService
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
DataRefreshServiceImpl
.
class
);
@Autowired
private
RemoteWebSocketServer
remoteWebSocketServer
;
@Override
public
void
refreshViewData
(
String
dataType
)
{
/*
* check 巡检数据刷新(影响区域:消防安全执行、今日巡检)
* planTask 执行数据刷新(影响区域:今日巡检)
*/
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
List
<
View3dRefreshAreaEum
>
notifyAreaList
=
View3dRefreshAreaEum
.
getEumListByTrigger
(
dataType
);
notifyAreaList
.
forEach
(
eum
->{
param
.
clear
();
param
.
put
(
"refreshType"
,
eum
.
getCode
());
this
.
notifyDataRefresh
(
param
);
});
}
@Override
public
void
sendRefreshDataWithArea
(
String
areaType
,
Map
content
)
{
Map
<
String
,
Object
>
sendData
=
new
HashMap
<>(
2
);
sendData
.
put
(
"refreshType"
,
areaType
);
sendData
.
put
(
"content"
,
content
);
this
.
notifyDataRefresh
(
sendData
);
}
private
void
notifyDataRefresh
(
Map
<
String
,
Object
>
param
)
{
try
{
remoteWebSocketServer
.
sendMessage
(
"3dViewMessage"
,
JSON
.
toJSONString
(
param
));
}
catch
(
Exception
e
)
{
log
.
error
(
"通知前端数据刷新失败-->"
+
JSON
.
toJSONString
(
param
));
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
2cb81c97
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
2cb81c97
...
@@ -33,44 +33,35 @@ import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
...
@@ -33,44 +33,35 @@ import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.View3dMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.View3dMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireCarDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireStationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao
;
import
com.yeejoin.amos.fas.business.dao.repository.ISafetyIndexChangeLogDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao
;
import
com.yeejoin.amos.fas.business.feign.IDutyModeServer
;
import
com.yeejoin.amos.fas.business.feign.IDutyModeServer
;
import
com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer
;
import
com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer
;
import
com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.vo.ErrorContentVo
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo
;
import
com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo
;
import
com.yeejoin.amos.fas.business.vo.View3dNodeVo
;
import
com.yeejoin.amos.fas.common.enums.CheckStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanTaskDetailStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum
;
import
com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum
;
import
com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.common.enums.*
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
import
com.yeejoin.amos.fas.core.common.response.Node3DVoResponse
;
import
com.yeejoin.amos.fas.core.common.response.Node3DVoResponse
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.dao.entity.FireCar
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.FireStation
;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.fas.dao.entity.SafetyIndexChangeLog
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* @author DELL
* @author DELL
...
@@ -109,6 +100,9 @@ public class View3dServiceImpl implements IView3dService {
...
@@ -109,6 +100,9 @@ public class View3dServiceImpl implements IView3dService {
@Value
(
"${param.system.online.date}"
)
@Value
(
"${param.system.online.date}"
)
private
String
onLineDate
;
private
String
onLineDate
;
@Autowired
private
IDataRefreshService
iDataRefreshService
;
@Override
@Override
...
@@ -538,38 +532,26 @@ public class View3dServiceImpl implements IView3dService {
...
@@ -538,38 +532,26 @@ public class View3dServiceImpl implements IView3dService {
}
}
@Override
@Override
public
void
safetyIndexRefresh
()
{
public
void
safetyIndexLogGenJob
(
String
runData
)
{
try
{
Date
collectDate
=
StringUtil
.
isNotEmpty
(
runData
)
?
DateUtil
.
formatDate
(
runData
,
DateUtil
.
DATE_DEFAULT_FORMAT
)
:
DateUtil
.
getDayBefore
(
new
Date
());
List
<
RiskSource
>
riskSources
=
iRiskSourceDao
.
findByParentId
(
0
l
);
//1.安全指数流水生成
List
<
SafetyIndexChangeLog
>
sageTyIndexs
=
new
ArrayList
<>();
try
{
sageTyIndexs
=
riskSources
.
stream
().
map
(
riskSource
->
{
List
<
RiskSource
>
riskSources
=
iRiskSourceDao
.
findByParentId
(
0L
);
List
<
SafetyIndexChangeLog
>
safetyIndexChangeLogs
=
new
ArrayList
<>();
safetyIndexChangeLogs
=
riskSources
.
stream
().
map
(
riskSource
->
{
SafetyIndexChangeLog
safetyIndexChangeLog
=
new
SafetyIndexChangeLog
();
SafetyIndexChangeLog
safetyIndexChangeLog
=
new
SafetyIndexChangeLog
();
safetyIndexChangeLog
.
setOrgCode
(
riskSource
.
getOrgCode
());
safetyIndexChangeLog
.
setOrgCode
(
riskSource
.
getOrgCode
());
double
changeRpnToSafetyIndex
=
this
.
changeRpnToSafetyIndex
(
riskSource
.
getRpn
());
double
changeRpnToSafetyIndex
=
this
.
changeRpnToSafetyIndex
(
riskSource
.
getRpn
());
safetyIndexChangeLog
.
setSafetyIndex
(
BigDecimal
.
valueOf
(
changeRpnToSafetyIndex
));
safetyIndexChangeLog
.
setSafetyIndex
(
BigDecimal
.
valueOf
(
changeRpnToSafetyIndex
));
safetyIndexChangeLog
.
setCollectDate
(
new
Date
()
);
safetyIndexChangeLog
.
setCollectDate
(
collectDate
);
return
safetyIndexChangeLog
;
return
safetyIndexChangeLog
;
}).
collect
(
Collectors
.
toList
());;
}).
collect
(
Collectors
.
toList
());;
iSafetyIndexChangeLogDao
.
saveAll
(
sageTyIndexs
);
iSafetyIndexChangeLogDao
.
saveAll
(
safetyIndexChangeLogs
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"更新失败: "
+
e
.
getMessage
());
log
.
error
(
"安全指数流水生成失败: "
+
e
.
getMessage
());
e
.
printStackTrace
();
}
this
.
sendRefreshDate
();
}
//推送刷新数据消息
private
void
sendRefreshDate
()
{
HashMap
<
String
,
String
>
message
=
new
HashMap
<>();
message
.
put
(
"refreshType"
,
View3dRefreshAreaEum
.
all
.
getCode
());
try
{
remoteWebSocketServer
.
sendMessage
(
"refreshDate"
,
JSON
.
toJSONString
(
message
));
}
catch
(
Exception
e
)
{
log
.
error
(
"推送消息失败!!!"
);
e
.
printStackTrace
();
}
}
//2.通知日切进行数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
dateChange
.
getCode
());
}
}
@Override
@Override
...
@@ -586,3 +568,4 @@ public class View3dServiceImpl implements IView3dService {
...
@@ -586,3 +568,4 @@ public class View3dServiceImpl implements IView3dService {
return
CommonResponseUtil
.
success
(
result
);
return
CommonResponseUtil
.
success
(
result
);
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IDataRefreshService.java
0 → 100644
View file @
2cb81c97
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
java.util.Map
;
/**
* @author suhg
*/
public
interface
IDataRefreshService
{
/**
* 数据刷新
* @param dataType 触发数据类型
*/
void
refreshViewData
(
String
dataType
);
/**
* 推送刷新数据
* @param areaType 刷新区域
* @param content 数据对象
*/
void
sendRefreshDataWithArea
(
String
areaType
,
Map
content
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
2cb81c97
...
@@ -130,11 +130,13 @@ public interface IView3dService {
...
@@ -130,11 +130,13 @@ public interface IView3dService {
CommonResponse
get3dPointsByModel
(
String
orgCode
,
String
model
);
CommonResponse
get3dPointsByModel
(
String
orgCode
,
String
model
);
/**
/**
* 刷新安全指数
* 安全指数流水生成
* @param runData 日切日期
*/
*/
void
safetyIndex
Refresh
(
);
void
safetyIndex
LogGenJob
(
String
runData
);
List
<
Node3DVoResponse
>
find3dViewDataByType
(
String
type
);
List
<
Node3DVoResponse
>
find3dViewDataByType
(
String
type
);
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
);
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/Config.java
View file @
2cb81c97
package
com
.
yeejoin
.
amos
.
fas
.
config
;
package
com
.
yeejoin
.
amos
.
fas
.
config
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.annotation.EnableCaching
;
...
@@ -89,7 +90,7 @@ public class Config {
...
@@ -89,7 +90,7 @@ public class Config {
factory
.
setPort
(
port
);
factory
.
setPort
(
port
);
factory
.
setTimeout
(
timeout
);
factory
.
setTimeout
(
timeout
);
factory
.
setDatabase
(
database
);
factory
.
setDatabase
(
database
);
factory
.
setPassword
(
password
);
factory
.
setPassword
(
StringUtil
.
isNotEmpty
(
password
)
?
password
:
null
);
return
factory
;
return
factory
;
}
}
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
2cb81c97
...
@@ -12,7 +12,7 @@ eureka.client.healthcheck.enabled = true
...
@@ -12,7 +12,7 @@ eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry
=
true
eureka.client.fetchRegistry
=
true
#DB properties:
#DB properties:
spring.datasource.url
=
jdbc:mysql://47.103.14.66:3306/91-safety-business?
serverTimezone=UTC&&useSSL=false&&allowMultiQueries=true&serverTimezone=GMT
&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://47.103.14.66:3306/91-safety-business?
allowMultiQueries=true&serverTimezone=GMT%2B8
&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.password
=
root_123
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-docker.properties
View file @
2cb81c97
...
@@ -12,7 +12,7 @@ eureka.client.healthcheck.enabled = true
...
@@ -12,7 +12,7 @@ eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry
=
true
eureka.client.fetchRegistry
=
true
#DB properties:
#DB properties:
spring.datasource.url
=
jdbc:mysql://amos-mysql:3306/yeejoin_safety_business?
serverTimezone=UTC&&useSSL=false&&allowMultiQueries=true&serverTimezone=GMT
&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://amos-mysql:3306/yeejoin_safety_business?
allowMultiQueries=true&serverTimezone=GMT%2B8
&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
yeejoin_1234
spring.datasource.password
=
yeejoin_1234
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-test.properties
View file @
2cb81c97
...
@@ -12,7 +12,7 @@ eureka.client.healthcheck.enabled = true
...
@@ -12,7 +12,7 @@ eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry
=
true
eureka.client.fetchRegistry
=
true
#DB properties:
#DB properties:
spring.datasource.url
=
jdbc:mysql://47.103.14.66:3306/91-safety-business?
serverTimezone=UTC&&useSSL=false&&allowMultiQueries=true&serverTimezone=GMT
&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://47.103.14.66:3306/91-safety-business?
allowMultiQueries=true&serverTimezone=GMT%2B8
&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.password
=
root_123
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
2cb81c97
spring.application.name
=
AMOS-FIREAUTOSYS
spring.application.name
=
AMOS-FIREAUTOSYS
-SUHG
server.port
=
8083
server.port
=
8083
...
@@ -44,7 +44,7 @@ spring.http.multipart.MaxRequestSize = 50480000
...
@@ -44,7 +44,7 @@ spring.http.multipart.MaxRequestSize = 50480000
windows.img.path
=
D:
\\
windows.img.path
=
D:
\\
linux.img.path
=
/
linux.img.path
=
/
#
dutyMode.fegin.name
=
AMOSDUTYMODE
param.safetyIndex
c
hange.cron
=
0 0 2 * * ?
param.safetyIndex
C
hange.cron
=
0 0 2 * * ?
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
2cb81c97
...
@@ -182,6 +182,7 @@
...
@@ -182,6 +182,7 @@
<column
name=
"type"
/>
<column
name=
"type"
/>
</createIndex>
</createIndex>
</changeSet>
</changeSet>
<changeSet
author=
"shanqiyun"
id=
"1588067351000-1"
>
<changeSet
author=
"shanqiyun"
id=
"1588067351000-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<preConditions
onFail=
"MARK_RAN"
>
...
@@ -192,6 +193,18 @@
...
@@ -192,6 +193,18 @@
<comment>
f_risk_source add column route_path
</comment>
<comment>
f_risk_source add column route_path
</comment>
<sql>
<sql>
alter table f_risk_source add column `route_path` varchar(2000) DEFAULT NULL COMMENT '路径坐标' after `position3d`;
alter table f_risk_source add column `route_path` varchar(2000) DEFAULT NULL COMMENT '路径坐标' after `position3d`;
</sql>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1588140925893-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_safety_index_change_log"
columnName=
"create_date"
/>
</not>
</preConditions>
<comment>
f_safety_index_change_log add column create_date
</comment>
<sql>
alter table `f_safety_index_change_log` add column `create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间';
</sql>
</sql>
</changeSet>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment