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
07819707
Commit
07819707
authored
May 28, 2020
by
吴江
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_rule' into 'dev_upgrade'
Dev rule See merge request
!3
parents
da986cb9
871144df
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
184 additions
and
181 deletions
+184
-181
TimeLineController.java
...join/amos/fas/business/controller/TimeLineController.java
+183
-181
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+1
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/TimeLineController.java
View file @
07819707
//package com.yeejoin.amos.fas.business.controller;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
//
//
//import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import
com.yeejoin.amos.fas.business.service.impl.ContingencyInstanceImpl
;
//import com.yeejoin.amos.fas.business.service.intfc.IContingencyOriginalDataService;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyOriginalDataService
;
//import com.yeejoin.amos.fas.core.common.request.CommonRequest;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
//import com.yeejoin.amos.fas.core.util.CommonResponse;
import
com.yeejoin.amos.fas.core.common.request.CommonRequest
;
//import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
//import io.swagger.annotations.Api;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
import
io.swagger.annotations.Api
;
//import org.slf4j.Logger;
import
io.swagger.annotations.ApiOperation
;
//import org.slf4j.LoggerFactory;
import
io.swagger.annotations.ApiParam
;
//import org.springframework.beans.factory.annotation.Autowired;
import
org.slf4j.Logger
;
//import org.springframework.scheduling.annotation.Scheduled;
import
org.slf4j.LoggerFactory
;
//import org.springframework.util.CollectionUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
//import org.springframework.web.bind.annotation.*;
import
org.springframework.scheduling.annotation.Scheduled
;
//
import
org.springframework.util.CollectionUtils
;
//import java.util.HashMap;
import
org.springframework.web.bind.annotation.*
;
//import java.util.LinkedList;
//import java.util.List;
import
javax.xml.bind.ValidationEvent
;
//import java.util.Map;
import
java.util.*
;
//
//@RestController
@RestController
//@RequestMapping(value = "/api/timeline")
@RequestMapping
(
value
=
"/api/timeline"
)
//@Api(tags="时间轴")
@Api
(
tags
=
"时间轴"
)
//public class TimeLineController extends BaseController{
public
class
TimeLineController
extends
BaseController
{
//
// private static final Logger log = LoggerFactory.getLogger(TimeLineController.class);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
TimeLineController
.
class
);
//
@Autowired
// @Autowired
IContingencyInstance
iContingencyInstance
;
// IContingencyOriginalDataService iContingencyOriginalDataService;
//
@Autowired
// static LinkedList<Map<String,String >> fireQueue = new LinkedList<>();
IContingencyOriginalDataService
iContingencyOriginalDataService
;
//
//
static
LinkedList
<
Map
<
String
,
String
>>
fireQueue
=
new
LinkedList
<>();
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "GET",value = "根据批次号查询时间轴", notes = "根据批次号查询时间轴")
// @RequestMapping(value = "/{instanceNo}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
//@Authorization(ingore = true)
// public CommonResponse queryPoint(@PathVariable String instanceNo,@RequestParam("recordType") String recordType) throws Exception{
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据批次号查询时间轴"
,
notes
=
"根据批次号查询时间轴"
)
// return CommonResponseUtil.success();
@RequestMapping
(
value
=
"/{instanceNo}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
//// return CommonResponseUtil.success(iContingencyInstance.queryForTimeLine(instanceNo,recordType));
public
CommonResponse
queryPoint
(
@PathVariable
String
instanceNo
,
@RequestParam
(
"recordType"
)
String
recordType
)
throws
Exception
{
// }
//
return
CommonResponseUtil
.
success
(
iContingencyInstance
.
queryForTimeLine
(
instanceNo
,
recordType
));
//
}
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "PUT",value = "点击按钮", notes = "点击按钮")
// @RequestMapping(value = "/fire", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
//@Authorization(ingore = true)
// public CommonResponse fire(@RequestParam("batchNo") String batchNo,
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
// @RequestParam("stepCode") String stepCode,
@RequestMapping
(
value
=
"/fire"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
// @RequestParam("buttonCode") String buttonCode,
public
CommonResponse
fire
(
@RequestParam
(
"batchNo"
)
String
batchNo
,
// @RequestParam("confirm") String confirm,
@RequestParam
(
"stepCode"
)
String
stepCode
,
// @RequestParam("contingencyPlanId") String contingencyPlanId,
@RequestParam
(
"buttonCode"
)
String
buttonCode
,
// @RequestParam("stepState") String stepState) throws Exception{
@RequestParam
(
"confirm"
)
String
confirm
,
//
@RequestParam
(
"contingencyPlanId"
)
String
contingencyPlanId
,
//
@RequestParam
(
"stepState"
)
String
stepState
)
throws
Exception
{
// Map<String,String> map = new HashMap<>();
// map.put("batchNo",batchNo);
// map.put("stepCode",stepCode);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
// map.put("buttonCode",buttonCode);
map
.
put
(
"batchNo"
,
batchNo
);
// map.put("confirm",confirm);
map
.
put
(
"stepCode"
,
stepCode
);
// map.put("contingencyPlanId",contingencyPlanId);
map
.
put
(
"buttonCode"
,
buttonCode
);
// map.put("stepState",stepState);
map
.
put
(
"confirm"
,
confirm
);
// fireQueue.addLast(map);
map
.
put
(
"contingencyPlanId"
,
contingencyPlanId
);
//
map
.
put
(
"stepState"
,
stepState
);
// return CommonResponseUtil.success("SUCCESS");
fireQueue
.
addLast
(
map
);
// }
//
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
//
}
// @Scheduled(cron = "*/2 * * * * ?")
// private void runFireQueue() throws Exception
// {
@Scheduled
(
cron
=
"*/2 * * * * ?"
)
//
private
void
runFireQueue
()
throws
Exception
// if(fireQueue.size() == 0)
{
// return;
//
if
(
fireQueue
.
size
()
==
0
)
// Map<String,String> map = fireQueue.getFirst();
return
;
//
// String batchNo = map.get("batchNo");
Map
<
String
,
String
>
map
=
fireQueue
.
getFirst
();
// String stepCode = map.get("stepCode");
// String buttonCode = map.get("buttonCode");
String
batchNo
=
map
.
get
(
"batchNo"
);
// String confirm = map.get("confirm");
String
stepCode
=
map
.
get
(
"stepCode"
);
// String contingencyPlanId = map.get("contingencyPlanId");
String
buttonCode
=
map
.
get
(
"buttonCode"
);
// String stepState = map.get("stepState");
String
confirm
=
map
.
get
(
"confirm"
);
// try
String
contingencyPlanId
=
map
.
get
(
"contingencyPlanId"
);
// {
String
stepState
=
map
.
get
(
"stepState"
);
// log.info("fireQueue-size:"+fireQueue.size());
try
// log.info("stepCode:" + map.get("stepCode"));
{
// log.info("buttonCode:" + map.get("buttonCode"));
log
.
info
(
"fireQueue-size:"
+
fireQueue
.
size
());
// log.info("confirm:" + map.get("confirm"));
log
.
info
(
"stepCode:"
+
map
.
get
(
"stepCode"
));
// log.info("stepState:" + map.get("stepState"));
log
.
info
(
"buttonCode:"
+
map
.
get
(
"buttonCode"
));
//
log
.
info
(
"confirm:"
+
map
.
get
(
"confirm"
));
//// iContingencyInstance.setButtonExecuted(batchNo,contingencyPlanId,buttonCode,confirm);
log
.
info
(
"stepState:"
+
map
.
get
(
"stepState"
));
//// iContingencyInstance.fire(batchNo,stepCode,contingencyPlanId,buttonCode,confirm,stepState);
// }catch (Exception e)
iContingencyInstance
.
setButtonExecuted
(
batchNo
,
contingencyPlanId
,
buttonCode
,
confirm
);
// {
iContingencyInstance
.
fire
(
batchNo
,
stepCode
,
contingencyPlanId
,
buttonCode
,
confirm
,
stepState
);
// //iContingencyInstance.setButtonWait(batchNo,contingencyPlanId,confirm);
}
catch
(
Exception
e
)
// throw e;
{
// }finally {
//iContingencyInstance.setButtonWait(batchNo,contingencyPlanId,confirm);
// fireQueue.removeFirst();
throw
e
;
// }
}
finally
{
// }
fireQueue
.
removeFirst
();
//
}
//
}
//
//
//
//
//
//
//
// // @Authorization(ingore = true)
// @ApiOperation(httpMethod = "POST",value = "查询预案记录", notes = "查询预案记录")
// @RequestMapping(value = "/contingency/page", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// @Authorization(ingore = true)
// public CommonResponse contingencyRecord(
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"查询预案记录"
,
notes
=
"查询预案记录"
)
// @ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests,
@RequestMapping
(
value
=
"/contingency/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
// @ApiParam(value = "分页参数", required = true) CommonPageable commonPageable
public
CommonResponse
contingencyRecord
(
// ) {
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
// //CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
CommonPageable
commonPageable
//
)
{
// String contingencyName = null;
//CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
// String equipmentId = null;
// String createTime = null;
String
contingencyName
=
null
;
// if(!CollectionUtils.isEmpty(queryRequests))
String
equipmentId
=
null
;
// {
String
createTime
=
null
;
// for(CommonRequest request:queryRequests)
if
(!
CollectionUtils
.
isEmpty
(
queryRequests
))
// {
{
// if("contingencyName".equals(request.getName()))
for
(
CommonRequest
request:
queryRequests
)
// {
{
// contingencyName = String.valueOf(request.getValue());
if
(
"contingencyName"
.
equals
(
request
.
getName
()))
// }
{
// if("equipmentId".equals(request.getName()))
contingencyName
=
String
.
valueOf
(
request
.
getValue
());
// {
}
// equipmentId = String.valueOf(request.getValue());
if
(
"equipmentId"
.
equals
(
request
.
getName
()))
// }
{
// if("createTime".equals(request.getName()))
equipmentId
=
String
.
valueOf
(
request
.
getValue
());
// {
}
// createTime = String.valueOf(request.getValue());
if
(
"createTime"
.
equals
(
request
.
getName
()))
// }
{
// }
createTime
=
String
.
valueOf
(
request
.
getValue
());
// }
}
//
}
// return CommonResponseUtil.success(iContingencyOriginalDataService.queryForPage(contingencyName,equipmentId,createTime,commonPageable));
}
// }
//
return
CommonResponseUtil
.
success
(
iContingencyOriginalDataService
.
queryForPage
(
contingencyName
,
equipmentId
,
createTime
,
commonPageable
));
//
}
//
//
//
//
//
//
//
//
//
// String operate = "{" +
// " \"type\": \"button\"," +
// " \"operate\": [" +
String
operate
=
"{"
+
// " {" +
" \"type\": \"button\","
+
// " \"title\": \"确认着火\"," +
" \"operate\": ["
+
// " \"paramName\": \"batchNo\"," +
" {"
+
// " \"paramValue\": \"11\"," +
" \"title\": \"确认着火\","
+
// " \"requestUrl\": \"url\"," +
" \"paramName\": \"batchNo\","
+
// " \"icon\": \"querenzhuohuo\"," +
" \"paramValue\": \"11\","
+
// " \"confirm\": true," +
" \"requestUrl\": \"url\","
+
// " \"state\": \"executed\"" +
" \"icon\": \"querenzhuohuo\","
+
// " }," +
" \"confirm\": true,"
+
// " {" +
" \"state\": \"executed\""
+
// " \"title\": \"消除误报\"," +
" },"
+
// " \"paramName\": \"batchNo\"," +
" {"
+
// " \"paramValue\": \"11\"," +
" \"title\": \"消除误报\","
+
// " \"requestUrl\": \"url\"," +
" \"paramName\": \"batchNo\","
+
// " \"icon\": \"xiaochuwubao\"," +
" \"paramValue\": \"11\","
+
// " \"confirm\": true," +
" \"requestUrl\": \"url\","
+
// " \"state\": \"wait\"" +
" \"icon\": \"xiaochuwubao\","
+
// " }" +
" \"confirm\": true,"
+
// " ]" +
" \"state\": \"wait\""
+
// "}";
" }"
+
//
" ]"
+
//}
"}"
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
07819707
...
@@ -151,6 +151,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -151,6 +151,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
private
RuleTrigger
ruleTrigger
;
private
RuleTrigger
ruleTrigger
;
@Autowired
@Autowired
...
...
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