Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
6eb5eaef
Commit
6eb5eaef
authored
Aug 11, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码,关于acvtivty的设置
parent
e7579f09
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1757 additions
and
168 deletions
+1757
-168
RemoteWorkFlowService.java
.../amos/boot/biz/common/workflow/RemoteWorkFlowService.java
+318
-0
HttpUtil.java
...amos/boot/biz/common/workflow/business/util/HttpUtil.java
+582
-0
XJConstant.java
...n/amos/boot/biz/common/workflow/constants/XJConstant.java
+402
-0
WorkFlowUriEnum.java
.../amos/boot/biz/common/workflow/enums/WorkFlowUriEnum.java
+58
-0
YesOrNoEnum.java
...join/amos/boot/biz/common/workflow/enums/YesOrNoEnum.java
+56
-0
FailureAuditDto.java
...join/amos/boot/module/common/api/dto/FailureAuditDto.java
+8
-0
FailureMaintainDto.java
...n/amos/boot/module/common/api/dto/FailureMaintainDto.java
+3
-0
FailureAudit.java
...join/amos/boot/module/common/api/entity/FailureAudit.java
+5
-0
IFailureAuditService.java
.../boot/module/common/api/service/IFailureAuditService.java
+2
-1
FailureAuditController.java
.../module/common/biz/controller/FailureAuditController.java
+3
-0
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+41
-32
FailureMaintainController.java
...dule/common/biz/controller/FailureMaintainController.java
+14
-1
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+62
-49
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+193
-85
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+10
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/RemoteWorkFlowService.java
0 → 100644
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
workflow
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.workflow.business.util.HttpUtil
;
import
com.yeejoin.amos.boot.biz.common.workflow.constants.XJConstant
;
import
com.yeejoin.amos.boot.biz.common.workflow.enums.WorkFlowUriEnum
;
import
com.yeejoin.amos.boot.biz.common.workflow.enums.YesOrNoEnum
;
@Service
(
"remoteWorkFlowService"
)
public
class
RemoteWorkFlowService
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RemoteWorkFlowService
.
class
);
@Value
(
"${params.work.flow.address}"
)
private
String
address
;
@Value
(
"${params.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
private
String
buildUrl
(
String
address
,
WorkFlowUriEnum
workFlowUriEnum
,
Map
<
String
,
String
>
map
)
{
String
uri
=
workFlowUriEnum
.
getUri
();
String
params
=
workFlowUriEnum
.
getParams
();
if
(!
StringUtils
.
isEmpty
(
params
)
&&
map
!=
null
)
{
String
[]
paramsArr
=
params
.
split
(
","
);
for
(
String
param
:
paramsArr
)
{
uri
=
uri
.
replace
(
"{"
+
param
+
"}"
,
map
.
get
(
param
));
}
}
return
address
+
uri
;
}
private
JSONObject
handleResult
(
String
resultStr
)
{
if
(
resultStr
==
null
)
{
return
null
;
}
JSONObject
json
=
JSON
.
parseObject
(
resultStr
);
if
(
"200"
.
equals
(
json
.
getString
(
"code"
)))
{
return
json
;
}
return
null
;
}
public
JSONObject
start
(
String
businessKey
,
String
processDefinitionKey
)
{
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
启动流程
,
null
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
String
resultStr
=
HttpUtil
.
sendHttpPostJson
(
url
,
body
.
toJSONString
());
return
handleResult
(
resultStr
);
}
public
JSONObject
getChildNodeDetail
(
String
instanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"instanceId"
,
instanceId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
子节点信息
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
instanceId
+
"\r\n返回参数=======================>"
+
resultStr
);
return
handleResult
(
resultStr
);
}
public
JSONObject
start
(
Long
dangerId
,
String
businessKey
,
String
processDefinitionKey
)
{
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
启动流程
,
null
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONArray
variables
=
new
JSONArray
();
// JSONObject companyJson = new JSONObject();
// companyJson.put("name", "companyId");
// companyJson.put("value", companyId);
// JSONObject departmentJson = new JSONObject();
// departmentJson.put("name", "departmentId");
// departmentJson.put("value", departmentId);
JSONObject
dangerIdJson
=
new
JSONObject
();
// dangerIdJson.put("name", "dangerId");
dangerIdJson
.
put
(
"dangerId"
,
dangerId
);
// variables.add(companyJson);
// variables.add(departmentJson);
// variables.add(dangerIdJson);
// body.put("variables", variables);
// String requestBody = body.toJSONString();
body
.
put
(
"variables"
,
dangerIdJson
);
String
resultStr
=
HttpUtil
.
sendHttpPostJsonWithHeader
(
url
,
body
.
toJSONString
(),
headerMap
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
body
+
"\r\n返回参数=======================>"
+
resultStr
);
return
JSON
.
parseObject
(
resultStr
);
}
public
JSONObject
startWithAppKey
(
JSONObject
body
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
map
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
map
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
启动免登录流程
,
map
);
String
requestBody
=
body
.
toJSONString
();
String
resultStr
=
HttpUtil
.
sendHttpPostJson
(
url
,
requestBody
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
requestBody
+
"\r\n返回参数=======================>"
+
resultStr
);
return
handleResult
(
resultStr
);
}
public
JSONObject
startNew
(
Long
dangerId
,
String
businessKey
,
String
processDefinitionKey
)
{
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
合并启动流程
,
null
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONObject
dangerIdJson
=
new
JSONObject
();
dangerIdJson
.
put
(
"dangerId"
,
dangerId
);
body
.
put
(
"variables"
,
dangerIdJson
);
String
resultStr
=
HttpUtil
.
sendHttpPostJsonWithHeader
(
url
,
body
.
toJSONString
(),
headerMap
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
body
+
"\r\n返回参数=======================>"
+
resultStr
);
return
JSON
.
parseObject
(
resultStr
);
}
// public JSONObject stop(String processInstanceId, String deleteReason) {
// Map<String, String> map = Maps.newHashMap();
// map.put("deleteReason", deleteReason);
// map.put("processInstanceId", processInstanceId);
// String url = buildUrl(address, WorkFlowUriEnum.终止流程, map);
// String resultStr = HttpUtil.sendHttpDelete(url);
// JSONObject json = handleResult(resultStr);
// logger.info("\r\n终止流程请求路径=======================>" + url + "\r\n终止流程返回参数=======================>" + resultStr);
// return json;
// }
public
JSONObject
stop
(
String
processInstanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
// map.put("deleteReason", deleteReason);
map
.
put
(
"processInstanceId"
,
processInstanceId
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
终止流程
,
map
);
String
resultStr
=
HttpUtil
.
sendHttpDeleteWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
// public JSONObject excute(String taskId, String requestBody) {
// Map<String, String> map = Maps.newHashMap();
// map.put("taskId", taskId);
// String url = buildUrl(address, WorkFlowUriEnum.执行流程, map);
// String resultStr = HttpUtil.sendHttpPostJson(url, requestBody);
// JSONObject json = handleResult(resultStr);
// logger.info("\r\n执行任务请求路径=======================>" + url + "\r\n执行任务请求参数=======================>" + requestBody + "\r\n执行任务返回参数=======================>" + resultStr);
// return json;
// }
public
JSONObject
excute
(
String
taskId
,
String
requestBody
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"taskId"
,
taskId
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
执行流程
,
map
);
String
resultStr
=
HttpUtil
.
sendHttpPostJsonWithHeader
(
url
,
requestBody
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n请求参数=======================>"
+
requestBody
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
currentTask
(
String
instanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"processInstanceId"
,
instanceId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
当前节点
,
map
);
String
resultStr
=
HttpUtil
.
sendHttpGet
(
url
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n当前任务请求路径=======================>"
+
url
+
"\r\n当前任务返回参数=======================>"
+
resultStr
);
if
(
json
==
null
)
{
return
null
;
}
JSONArray
reviewContent
=
json
.
getJSONObject
(
"dataList"
).
getJSONArray
(
"content"
);
if
(
reviewContent
!=
null
&&
reviewContent
.
size
()
>
0
)
{
return
reviewContent
.
getJSONObject
(
0
);
}
return
null
;
}
public
JSONObject
allTasksInProcessInstanceId
(
String
instanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"processInstanceId"
,
instanceId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
工作流流水
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
if
(
json
==
null
)
{
return
null
;
}
JSONArray
allContent
=
json
.
getJSONArray
(
"dataList"
);
if
(
allContent
!=
null
&&
allContent
.
size
()
>
0
)
{
return
allContent
.
getJSONObject
(
allContent
.
size
()
-
1
);
}
return
null
;
}
public
JSONObject
pageTask
(
String
userId
,
Integer
BelongType
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
String
url
=
""
;
map
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
if
(
Integer
.
parseInt
(
YesOrNoEnum
.
YES
.
getCode
())==
BelongType
){
map
.
put
(
"userId"
,
userId
);
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
我的代办有
ID
,
map
);
}
else
{
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
我的代办
,
map
);
}
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
completedPageTask
(
String
userId
,
Integer
BelongType
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
String
url
=
""
;
map
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
if
(
Integer
.
parseInt
(
YesOrNoEnum
.
YES
.
getCode
())==
BelongType
){
map
.
put
(
"userId"
,
userId
);
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
已执行任务有
ID
,
map
);
}
else
{
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
已执行任务
,
map
);
}
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
queryTask
(
String
id
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"processInstanceId"
,
id
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
流程任务
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
queryTaskDetail
(
String
taskId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"taskId"
,
taskId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
流程详情
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
queryFinishTaskDetail
(
String
taskId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"taskId"
,
taskId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
所有已执行任务详情
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
public
JSONObject
queryFinishTaskDetailByInstanceId
(
String
InstanceId
)
{
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"processInstanceId"
,
InstanceId
);
String
url
=
buildUrl
(
address
,
WorkFlowUriEnum
.
所有已执行任务集合
,
map
);
Map
<
String
,
String
>
headerMap
=
Maps
.
newHashMap
();
headerMap
.
put
(
XJConstant
.
TOKEN_KEY
,
RequestContext
.
getToken
());
headerMap
.
put
(
XJConstant
.
PRODUCT
,
RequestContext
.
getProduct
());
headerMap
.
put
(
XJConstant
.
APPKEY
,
RequestContext
.
getAppKey
());
String
resultStr
=
HttpUtil
.
sendHttpGetWithHeader
(
url
,
headerMap
);
JSONObject
json
=
handleResult
(
resultStr
);
logger
.
info
(
"\r\n请求路径=======================>"
+
url
+
"\r\n返回参数=======================>"
+
resultStr
);
return
json
;
}
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/business/util/HttpUtil.java
0 → 100644
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
workflow
.
business
.
util
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpDelete
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.client.methods.HttpPut
;
import
org.apache.http.config.Registry
;
import
org.apache.http.config.RegistryBuilder
;
import
org.apache.http.conn.socket.ConnectionSocketFactory
;
import
org.apache.http.conn.socket.PlainConnectionSocketFactory
;
import
org.apache.http.conn.ssl.SSLConnectionSocketFactory
;
import
org.apache.http.conn.ssl.TrustSelfSignedStrategy
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.DefaultHttpRequestRetryHandler
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.apache.http.ssl.SSLContextBuilder
;
import
org.apache.http.util.EntityUtils
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.PrintWriter
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.Iterator
;
import
java.util.Map
;
public
class
HttpUtil
{
// utf-8字符编码
private
static
final
String
CHARSET_UTF_8
=
"utf-8"
;
// HTTP内容类型。
private
static
final
String
CONTENT_TYPE_TEXT_HTML
=
"text/xml"
;
// HTTP内容类型。相当于form表单的形式,提交数据
private
static
final
String
CONTENT_TYPE_FORM_URL
=
"application/x-www-form-urlencoded"
;
// HTTP内容类型。相当于form表单的形式,提交数据
private
static
final
String
CONTENT_TYPE_JSON_URL
=
"application/json;charset=utf-8"
;
// 连接管理器
private
static
PoolingHttpClientConnectionManager
pool
;
// 请求配置
private
static
RequestConfig
requestConfig
;
static
{
try
{
//System.out.println("初始化HttpClientTest~~~开始");
SSLContextBuilder
builder
=
new
SSLContextBuilder
();
builder
.
loadTrustMaterial
(
null
,
new
TrustSelfSignedStrategy
());
SSLConnectionSocketFactory
sslsf
=
new
SSLConnectionSocketFactory
(
builder
.
build
());
// 配置同时支持 HTTP 和 HTPPS
Registry
<
ConnectionSocketFactory
>
socketFactoryRegistry
=
RegistryBuilder
.<
ConnectionSocketFactory
>
create
().
register
(
"http"
,
PlainConnectionSocketFactory
.
getSocketFactory
()).
register
(
"https"
,
sslsf
).
build
();
// 初始化连接管理器
pool
=
new
PoolingHttpClientConnectionManager
(
socketFactoryRegistry
);
// 将最大连接数增加到200,实际项目最好从配置文件中读取这个值
pool
.
setMaxTotal
(
200
);
// 设置最大路由
pool
.
setDefaultMaxPerRoute
(
2
);
// 根据默认超时限制初始化requestConfig
int
socketTimeout
=
10000
;
int
connectTimeout
=
10000
;
int
connectionRequestTimeout
=
10000
;
requestConfig
=
RequestConfig
.
custom
().
setConnectionRequestTimeout
(
connectionRequestTimeout
).
setSocketTimeout
(
socketTimeout
).
setConnectTimeout
(
connectTimeout
).
build
();
//System.out.println("初始化HttpClientTest~~~结束");
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// 设置请求超时时间
requestConfig
=
RequestConfig
.
custom
().
setSocketTimeout
(
50000
).
setConnectTimeout
(
50000
)
.
setConnectionRequestTimeout
(
50000
).
build
();
}
private
static
CloseableHttpClient
getHttpClient
()
{
return
HttpClients
.
custom
()
// 设置连接池管理
.
setConnectionManager
(
pool
)
// 设置请求配置
.
setDefaultRequestConfig
(
requestConfig
)
// 设置重试次数
.
setRetryHandler
(
new
DefaultHttpRequestRetryHandler
(
0
,
false
))
.
build
();
}
/**
* 发送Post请求
*/
private
static
String
sendHttpPost
(
HttpPost
httpPost
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpPost
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpPost
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
()
||
HttpStatus
.
SC_CREATED
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送Post请求
*
* @param httpPut
* @return
*/
private
static
String
sendHttpPut
(
HttpPut
httpPut
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpPut
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpPut
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
()
||
HttpStatus
.
SC_CREATED
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送Post请求
*
* @param httpDelete
* @return
*/
private
static
String
sendHttpDelete
(
HttpDelete
httpDelete
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpDelete
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpDelete
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
()
||
HttpStatus
.
SC_CREATED
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送Get请求
*
* @param httpGet
* @return
*/
private
static
String
sendHttpGet
(
HttpGet
httpGet
)
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
// 响应内容
String
responseContent
=
null
;
try
{
// 创建默认的httpClient实例.
httpClient
=
getHttpClient
();
// 配置请求信息
httpGet
.
setConfig
(
requestConfig
);
// 执行请求
response
=
httpClient
.
execute
(
httpGet
);
// 得到响应实例
HttpEntity
entity
=
response
.
getEntity
();
// 可以获得响应头
// Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);
// for (Header header : headers) {
// System.out.println(header.getName());
// }
// 得到响应类型
// System.out.println(ContentType.getOrDefault(response.getEntity()).getMimeType());
// 判断响应状态
if
(
response
.
getStatusLine
().
getStatusCode
()
>=
300
)
{
throw
new
Exception
(
"HTTP Request is not success, Response code is "
+
response
.
getStatusLine
().
getStatusCode
());
}
if
(
HttpStatus
.
SC_OK
==
response
.
getStatusLine
().
getStatusCode
())
{
responseContent
=
EntityUtils
.
toString
(
entity
,
CHARSET_UTF_8
);
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
// 释放资源
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
responseContent
;
}
/**
* 发送 post请求
*
* @param httpUrl 地址
*/
public
static
String
sendHttpPost
(
String
httpUrl
)
{
// 创建httpPost
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 delete请求
*
* @param httpUrl 地址
*/
public
static
String
sendHttpDelete
(
String
httpUrl
)
{
// 创建httpPost
HttpDelete
httpDelete
=
new
HttpDelete
(
httpUrl
);
return
sendHttpDelete
(
httpDelete
);
}
/**
* 发送 post请求
*
* @param httpUrl 地址
*/
public
static
String
sendHttpPostWithHeader
(
String
httpUrl
,
Map
<
String
,
String
>
headerMap
)
{
// 创建httpPost
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpPost
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 get请求
*
* @param httpUrl
*/
public
static
String
sendHttpGet
(
String
httpUrl
)
{
// 创建get请求
HttpGet
httpGet
=
new
HttpGet
(
httpUrl
);
return
sendHttpGet
(
httpGet
);
}
/**
* 发送 delete请求带请求头
*/
public
static
String
sendHttpDeleteWithHeader
(
String
httpUrl
,
Map
<
String
,
String
>
headerMap
)
{
// 创建get请求
HttpDelete
httpDelete
=
new
HttpDelete
(
httpUrl
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpDelete
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
return
sendHttpDelete
(
httpDelete
);
}
/**
* 发送 get请求带请求头
*/
public
static
String
sendHttpGetWithHeader
(
String
httpUrl
,
Map
<
String
,
String
>
headerMap
)
{
// 创建get请求
HttpGet
httpGet
=
new
HttpGet
(
httpUrl
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpGet
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
return
sendHttpGet
(
httpGet
);
}
/**
* 发送 delete请求带请求头
*/
public
static
String
sendHttpDeleteJsonWithHeader
(
String
httpUrl
,
String
paramsJson
,
Map
<
String
,
String
>
headerMap
)
{
StringBuffer
content
=
new
StringBuffer
();
try
{
URL
url
=
new
URL
(
httpUrl
);
HttpURLConnection
connection
=
(
HttpURLConnection
)
url
.
openConnection
();
connection
.
setRequestMethod
(
"DELETE"
);
connection
.
setDoInput
(
true
);
connection
.
setDoOutput
(
true
);
connection
.
setRequestProperty
(
"Content-Type"
,
"application/json;charset=UTF-8"
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
connection
.
setRequestProperty
(
entry
.
getKey
(),
entry
.
getValue
());
}
PrintWriter
printWriter
=
new
PrintWriter
(
connection
.
getOutputStream
());
printWriter
.
write
(
paramsJson
);
printWriter
.
flush
();
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
connection
.
getInputStream
()));
String
line
;
while
((
line
=
br
.
readLine
())
!=
null
)
{
content
.
append
(
line
);
}
br
.
close
();
connection
.
disconnect
();
}
catch
(
Exception
e
)
{
}
return
content
.
toString
();
}
/**
* 发送 post请求
*
* @param httpUrl 地址
* @param params 参数(格式:key1=value1&key2=value2)
*/
public
static
String
sendHttpPost
(
String
httpUrl
,
String
params
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
// 设置参数
if
(
params
!=
null
&&
params
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
params
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_FORM_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 post请求
*
* @param maps 参数
*/
public
static
String
sendHttpPost
(
String
httpUrl
,
Map
<
String
,
String
>
maps
)
{
String
parem
=
convertStringParamter
(
maps
);
return
sendHttpPost
(
httpUrl
,
parem
);
}
/**
* 发送 post请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public
static
String
sendHttpPostJsonWithHeader
(
String
httpUrl
,
String
paramsJson
,
Map
<
String
,
String
>
headerMap
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpPost
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
// 设置参数
if
(
paramsJson
!=
null
&&
paramsJson
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsJson
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_JSON_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 put请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public
static
String
sendHttpPutJsonWithHeader
(
String
httpUrl
,
String
paramsJson
,
Map
<
String
,
String
>
headerMap
)
{
HttpPut
httpPost
=
new
HttpPut
(
httpUrl
);
// 创建HttpPut
try
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpPost
.
setHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
// 设置参数
if
(
paramsJson
!=
null
&&
paramsJson
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsJson
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_JSON_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPut
(
httpPost
);
}
/**
* 发送 post请求 发送json数据
*
* @param httpUrl 地址
* @param paramsJson 参数(格式 json)
*/
public
static
String
sendHttpPostJson
(
String
httpUrl
,
String
paramsJson
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
// 设置参数
if
(
paramsJson
!=
null
&&
paramsJson
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsJson
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_JSON_URL
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 发送 post请求 发送xml数据
*
* @param httpUrl 地址
* @param paramsXml 参数(格式 Xml)
*/
public
static
String
sendHttpPostXml
(
String
httpUrl
,
String
paramsXml
)
{
HttpPost
httpPost
=
new
HttpPost
(
httpUrl
);
// 创建httpPost
try
{
// 设置参数
if
(
paramsXml
!=
null
&&
paramsXml
.
trim
().
length
()
>
0
)
{
StringEntity
stringEntity
=
new
StringEntity
(
paramsXml
,
"UTF-8"
);
stringEntity
.
setContentType
(
CONTENT_TYPE_TEXT_HTML
);
httpPost
.
setEntity
(
stringEntity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sendHttpPost
(
httpPost
);
}
/**
* 将map集合的键值对转化成:key1=value1&key2=value2 的形式
*
* @param parameterMap 需要转化的键值对集合
* @return 字符串
*/
private
static
String
convertStringParamter
(
Map
parameterMap
)
{
StringBuffer
parameterBuffer
=
new
StringBuffer
();
if
(
parameterMap
!=
null
)
{
Iterator
iterator
=
parameterMap
.
keySet
().
iterator
();
String
key
=
null
;
String
value
=
null
;
while
(
iterator
.
hasNext
())
{
key
=
(
String
)
iterator
.
next
();
if
(
parameterMap
.
get
(
key
)
!=
null
)
{
value
=
(
String
)
parameterMap
.
get
(
key
);
}
else
{
value
=
""
;
}
parameterBuffer
.
append
(
key
).
append
(
"="
).
append
(
value
);
if
(
iterator
.
hasNext
())
{
parameterBuffer
.
append
(
"&"
);
}
}
}
return
parameterBuffer
.
toString
();
}
}
\ No newline at end of file
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/constants/XJConstant.java
0 → 100644
View file @
6eb5eaef
/**
*
*/
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
workflow
.
constants
;
import
org.slf4j.LoggerFactory
;
import
java.text.SimpleDateFormat
;
/**
* 常量
*/
public
class
XJConstant
{
public
static
final
String
ROOT_PATH
=
"F:/software/nginx-1.14.2/html/"
;
public
static
final
String
NGINX_ADDRESS
=
"172.16.3.77:8081/"
;
public
static
final
String
DEFAULT_RISKDESC
=
"默认"
;
public
static
final
String
JPUSH_USER_KEY
=
"BANK88"
;
public
static
final
String
CHECK_TYPE
=
"CHECK_TYPE"
;
public
static
final
String
DEPT_WF_MAP_DIC_CODE
=
"DEPT_WF_MAP"
;
/**
* 构造方法
*/
private
XJConstant
()
{
LoggerFactory
.
getLogger
(
this
.
getClass
()).
debug
(
XJConstant
.
CONSTRUCTOR
);
}
/**
* 网络服务ip
*/
public
static
final
String
NET_SERVER_HOST
=
"0.0.0.0"
;
/**
* 请求头key
*/
public
static
final
String
TOKEN_KEY
=
"token"
;
/**
* 请求头key
*/
public
static
final
String
PRODUCT
=
"product"
;
/**
* 请求头key
*/
public
static
final
String
APPKEY
=
"appKey"
;
/**
* 时间格式(yyyy-MM-dd HH:mm:ss)
*/
public
static
final
SimpleDateFormat
SIMPLEDATAFORMAT_YMDHMS
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
/**
* 构造方法字符串
*/
public
static
final
String
CONSTRUCTOR
=
"constructor..."
;
/**
* 轮询job最大线程数
*/
public
static
final
int
POLLING_JOB_THREAD_MAX_NUM
=
20
;
/**
* amos线程池数量
*/
public
static
final
int
AMOS_THREAD_NUM
=
20
;
/**
* 设备测试最大线程数
*/
public
static
final
int
TEST_EQUIPMENT_THREAD_MAX_NUM
=
5
;
/**
* 时间格式字符串:yyyy-MM-dd HH:mm:ss
*/
public
static
final
String
DATE_TIME_STR_YMDHMS
=
"yyyy-MM-dd HH:mm:ss"
;
/**
* bar
*/
public
static
final
String
BAR
=
"-"
;
/**
* Underline
*/
public
static
final
String
UNDERLINE
=
"_"
;
/**
* user
*/
public
static
final
String
USER
=
"user"
;
/**
* token
*/
public
static
final
String
TOKEN
=
"token"
;
/**
* loginType
*/
public
static
final
String
LOGIN_TYPE
=
"loginType"
;
/**
* subGraphId
*/
public
static
final
String
SUB_GRAPH_ID
=
"subGraphId"
;
public
static
final
String
ADMIN_ID
=
"1"
;
/**
* 帧报文异常
*/
public
static
final
String
FRAME_EXECPTION
=
"FRAME"
;
/**
* 性能指标
*/
public
static
final
String
METRIC
=
"METRIC"
;
/**
* 报文通道
*/
public
static
final
String
CHANNEL
=
"CHANNEL"
;
/**
* 设备状态(掉线)告警
*/
public
static
final
String
EQUIPMENT_STATUS
=
"EQUIPMENT_STATUS"
;
/**
* 设备连通性告警告警
*/
public
static
final
String
EQUIPMENT_CONNECTION
=
"EQUIPMENT_CONNECTION"
;
/**
* 通道注册
*/
public
static
final
String
REGISTER
=
"REGISTER"
;
/**
* 通道注销
*/
public
static
final
String
UNREGISTER
=
"UNREGISTER"
;
/**
* 报文正常
*/
public
static
final
String
NORMAL
=
"NORMAL"
;
/**
* 报文异常
*/
public
static
final
String
UNNORMAL
=
"UNNORMAL"
;
/**
* 告警socket类型
*/
public
static
final
String
ALARM_SOCKET
=
"ALARM_SOCKET"
;
/**
* 数据socket类型
*/
public
static
final
String
METRIC_SOCKET
=
"METRIC_SOCKET"
;
/**
* 数据socket类型
*/
public
static
final
String
MORPHIC_SOCKET
=
"MORPHIC_SOCKET"
;
/**
* false
*/
public
static
final
Boolean
FAIL_BOOLEAN_VALUE
=
Boolean
.
FALSE
;
/**
* 0
*/
public
static
final
Integer
ZERO_INT_VALUE
=
Integer
.
parseInt
(
"0"
);
/**
* -1
*/
public
static
final
Integer
FAIL_INT_VALUE
=
Integer
.
parseInt
(
"-1"
);
/**
* -1
*/
public
static
final
Long
FAIL_LONG_VALUE
=
Long
.
parseLong
(
"-1"
);
/**
* -1
*/
public
static
final
Short
FAIL_SHORT_VALUE
=
Short
.
parseShort
(
"-1"
);
/**
*
*/
public
static
final
Float
FAIL_FLOAT_VALUE
=
Float
.
parseFloat
(
"-1"
);
/**
* -1
*/
public
static
final
Double
FAIL_DOUBLE_VALUE
=
Double
.
parseDouble
(
"-1"
);
/**
* 空格
*/
public
static
final
Character
FAIL_CHARACTER_VALUE
=
Character
.
valueOf
(
' '
);
/**
* 失败
*/
public
static
final
int
FAILURE
=
0
;
/**
* 成功
*/
public
static
final
int
SUCCESS
=
1
;
/**
* 在线
*/
public
static
final
String
ONLINE
=
"在线"
;
/**
* 掉线
*/
public
static
final
String
OFFLINE
=
"掉线"
;
/**
* 通
*/
public
static
final
String
OPEN
=
"通"
;
/**
* 不通
*/
public
static
final
String
OFF
=
"不通"
;
/**
* ip
*/
public
static
final
String
IP
=
"ip"
;
/**
* #
*/
public
static
final
String
SHARP
=
"#"
;
/**
* TCP
*/
public
static
final
String
TCP
=
"TCP"
;
public
static
final
String
PIE_CHAR
=
"pieChar"
;
public
static
final
String
BAR_CHAR
=
"barChar"
;
public
static
final
String
HBAR_CHAR
=
"hbarChar"
;
public
static
final
String
LINE_CHAR
=
"lineChar"
;
public
static
final
String
DOUGHUNT_CHAR
=
"doughuntChar"
;
public
static
final
String
ROSE_CHAR
=
"roseChar"
;
public
static
final
String
AREA_CHAR
=
"areaChar"
;
public
static
final
String
DIMENSION
=
"dimension"
;
public
static
final
String
MEASURE
=
"measure"
;
/**
* xunjian
*/
public
static
final
String
TABLE_USERS
=
"Users"
;
public
static
final
String
EDIT_PWD
=
"editPassword"
;
public
static
final
String
EDIT_NOT_PWD
=
"editUsersInfo"
;
public
static
final
String
SAVE_USERS
=
"saveTableById"
;
public
static
final
String
SAVE_COM_USER
=
"saveComUserInfo"
;
public
static
final
String
EDIT_COM_USER
=
"editComUserInfo"
;
public
static
final
String
TABLE_CHECK
=
"Check"
;
public
static
final
String
TABLE_COM_USER
=
"companyUser"
;
public
static
final
int
FINISH_YES
=
2
;
public
static
final
int
FINISH_ING
=
1
;
public
static
final
int
FINISH_NO
=
0
;
public
static
final
String
SAVE_DEPART
=
"saveDepartMent"
;
public
static
final
String
EDIT_DEPART
=
"editsDepartMent"
;
public
static
final
String
TABLE_DEPART
=
"Group"
;
public
static
final
String
TABLE_ERROR
=
"Error"
;
//隐患表
public
static
final
String
SAVE_ERROR
=
"saveErrorByID"
;
//更新隐患表
public
static
final
int
XJ_ADMIN_ROLE
=
9
;
//巡检管理员角色ID
public
static
final
int
XJ_USER_ROLE
=
0
;
//巡检普通用户角色ID
public
static
final
int
TASK_STATUS_TIMEOUT
=
3
;
//已超时
public
static
final
int
TASK_STATUS_FINISH
=
2
;
//已结束
public
static
final
int
TASK_STATUS_DEAL
=
1
;
//进行中
public
static
final
int
TASK_STATUS_NO_START
=
0
;
//未开始
public
static
final
String
PLAN_TASK_DET_FINISH_NO
=
"0"
;
//任务明细状态:未完成
public
static
final
String
PLAN_TASK_DET_FINISH_YES
=
"1"
;
//任务明细状态:完成
public
static
final
String
PLAN_TASK_DET_FINISH_OUT
=
"2"
;
//任务明细状态:超时漏检
public
static
final
String
USER_DATA_ADMIN
=
"全部可见"
;
//用户数据可见范围
public
static
final
String
USER_DATA_DEPART
=
"部门可见"
;
//用户数据可见范围
public
static
final
String
USER_DATA_PERSON
=
"个人可见"
;
//用户数据可见范围
public
static
final
String
USER_ROLE_SUPERADMIN
=
"1"
;
//权限id-超级管理员
public
static
final
String
USER_ROLE_ADMIN
=
"2"
;
//权限id-管理员
public
static
final
String
USER_ROLE_DEPART
=
"3"
;
//权限id-部门管理
public
static
final
String
USER_ROLE_PERSON
=
"4"
;
//权限id-普通用户
public
static
final
String
ROLE_NAME_SUPERADMIN
=
"SUPERADMIN"
;
//数据权限-超级管理员
public
static
final
String
ROLE_NAME_ADMIN
=
"ADMIN"
;
//数据权限-超级管理员
public
static
final
String
ROLE_NAME_DEPTADMIN
=
"DEPTADMIN"
;
//数据权限-部门
public
static
final
String
ROLE_NAME_PERSON
=
"PERSONAL"
;
//数据权限-个人
public
static
final
String
ADMIN_FLAG
=
"2"
;
//权限标记
public
static
final
String
DEPART_FLAG
=
"1"
;
//权限标记
public
static
final
String
PERSON_FLAG
=
"0"
;
//权限标记
public
static
final
String
ADMIN_FLAG_NO
=
"0"
;
//标记 0-无关
public
static
final
String
ADMIN_FLAG_UP
=
"1"
;
//1-上级admin
public
static
final
String
ADMIN_FLAG_THIS
=
"2"
;
//2-本级admin
public
static
final
String
UNCLASSIFIED
=
"Unclassifed"
;
//巡检点未分类
public
static
final
String
ADMIN_ORG_CODE
=
"2"
;
public
static
final
String
CHECK_CHANGE_NO
=
"0"
;
//是否记为合格:否
public
static
final
String
CHECK_CHANGE_YES
=
"1"
;
//是否记为合格:是
public
static
final
String
SCHED_FLAG
=
"99"
;
//自动任务标记
public
static
final
String
REGEN_FLAG
=
"98"
;
//重做任务标记
public
static
final
String
FIX_DATE_NO
=
"0"
;
//不固定日期(区间)
public
static
final
String
FIX_DATE_YES
=
"1"
;
//固定日期
//计划类型
public
static
final
String
PLAN_TYPE_DAY
=
"1"
;
//日计划
public
static
final
String
PLAN_TYPE_WEEK
=
"2"
;
//周计划
public
static
final
String
PLAN_TYPE_MONTH
=
"3"
;
//月计划
public
static
final
String
PLAN_TYPE_YEAR
=
"4"
;
//年计划
//月类型
public
static
final
String
MONTH_TYPE_DAY
=
"1"
;
//第几天
public
static
final
String
MONTH_TYPE_AT
=
"2"
;
//在第几周的第几天
public
static
final
String
INTERVAL_UNIT_HOUR
=
"1"
;
//执行间隔小时
public
static
final
String
INTERVAL_UNIT_MINUTE
=
"2"
;
//执行间隔分钟
public
static
final
String
INTERVAL_UNIT_SECOND
=
"3"
;
//执行间隔秒
public
static
final
String
ZERO_TIME
=
"00:00:00"
;
//time
public
static
final
String
PLAN_STATUS_START
=
"0"
;
//计划状态:正常
public
static
final
String
PLAN_STATUS_STOP
=
"1"
;
//计划状态:已停用
public
static
final
int
PLAN_FIRST_STATUS_YES
=
0
;
//计划:初始状态
public
static
final
int
PLAN_FIRST_STATUS_NO
=
1
;
//计划:非初始状态
public
static
final
String
UPD_PLAN_GEN_DATE
=
"1"
;
//更新plan表日期
public
static
final
String
UPD_PLAN_STATUS
=
"2"
;
//更新plan表next_gen_status
public
static
final
int
DAY_RATE_ONE
=
0
;
//0-1次
public
static
final
int
DAY_RATE_MANY
=
1
;
//1-多次
public
static
final
int
IS_DETETE_NO
=
0
;
//未删除
public
static
final
int
IS_DETETE_YES
=
1
;
//删除
public
static
final
String
UPLOAD_ROOT_PATH
=
"upload"
;
public
static
final
String
INPUT_ITEM_TEXT
=
"文本"
;
public
static
final
String
INPUT_ITEM_NUMBER
=
"数字"
;
public
static
final
String
INPUT_ITEM_SELECT
=
"选择"
;
public
static
final
String
CHECK_TYPE_ALWAYS_OK
=
"始终合格"
;
public
static
final
String
CHECK_TYPE_ALWAYS_NO
=
"始终不合格"
;
public
static
final
String
CHECK_TYPE_NO_CONTEXT_OK
=
"无内容合格"
;
public
static
final
String
CHECK_TYPE_CONTEXT_OK
=
"有内容合格"
;
public
static
final
String
OK
=
"合格"
;
public
static
final
String
NO
=
"不合格"
;
public
static
final
String
YES
=
"是"
;
public
static
final
String
NOT
=
"否"
;
public
static
final
String
INPUT_ITEM_OK_SCORE
=
"OkScore"
;
public
static
final
String
INPUT_ITEM_NOT_SCORE
=
"NoScore"
;
public
static
final
String
POINT_OK_SCORE
=
"1"
;
public
static
final
String
POINT_NOT_SCORE
=
"0"
;
/**
* 任务是否发送消息状态
*/
public
static
final
String
TASK_WARN
=
"是"
;
public
static
final
String
TASK_NOT_WARN
=
"否"
;
/**
* 系统定时任务类型
*/
public
static
final
String
STATUS_MONITOR_START
=
"statusMonitorStart"
;
//状态监控是否开始
public
static
final
String
STATUS_MONITOR_END
=
"statusMonitorEnd"
;
//状态监控是否结束
public
static
final
String
PLAN_TASK_WARN_MSG_PUSH
=
"planTaskWarnMsgPush"
;
//计划即将开始消息提醒推送
public
static
final
String
PLAN_TASK_BEGIN_MSG_PUSH
=
"planTaskBeginMsgPush"
;
//计划已经开始消息提醒推送
public
static
final
String
PLAN_TASK_END_MSG_PUSH
=
"planTaskEndMsgPush"
;
//计划已经开始消息提醒推送
public
static
final
String
MESSAGE_PUSH
=
"messagePush"
;
//消息推送
public
static
final
int
IS_SENT
=
1
;
//已发送
public
static
final
int
NOT_SENT
=
0
;
//未发送
public
static
final
String
IS_FIXED_YES
=
"1"
;
//固定点
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/enums/WorkFlowUriEnum.java
0 → 100644
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
workflow
.
enums
;
public
enum
WorkFlowUriEnum
{
启动流程
(
"启动流程"
,
"/workflow/task/startTask"
,
""
),
流程详情
(
"流程详情"
,
"/workflow/task/{taskId}"
,
"taskId"
),
合并启动流程
(
"合并启动流程"
,
"/workflow/task/startProcess"
,
""
),
所有已执行任务详情
(
"所有已执行任务详情"
,
"/workflow/activitiHistory/task/detail/{taskId}"
,
"taskId"
),
流程任务
(
"流程任务"
,
"/workflow/task?processInstanceId={processInstanceId}"
,
"processInstanceId"
),
我的代办
(
"我的代办"
,
"/workflow/task/all-list?processDefinitionKey={processDefinitionKey}"
,
"processDefinitionKey"
),
我的代办有
ID
(
"我的代办有ID"
,
"/workflow/task/all-list?processDefinitionKey={processDefinitionKey}&userId={userId}"
,
"processDefinitionKey,userId"
),
已执行任务
(
"已执行任务"
,
"/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}"
,
"processDefinitionKey"
),
已执行任务有
ID
(
"已执行任务有ID"
,
"/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}"
,
"processDefinitionKey,userId"
),
启动免登录流程
(
"启动免登录流程"
,
"/processes/{appKey}"
,
"appKey"
),
当前节点
(
"当前节点"
,
"/wf/taskstodo?processInstanceId={processInstanceId}"
,
"processInstanceId"
),
执行流程
(
"执行流程"
,
"/workflow/task/pickupAndCompleteTask/{taskId}"
,
"taskId"
),
终止流程
(
"终止流程"
,
"/wf/processes/{processInstanceId}?deleteReason={deleteReason}"
,
"processInstanceId,deleteReason"
),
当前子节点
(
"当前子节点"
,
"/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}"
,
"processInstanceId,taskDefinitionKey"
),
工作流流水
(
"工作流流水"
,
"/wf/processes/{processInstanceId}/tasks"
,
"processInstanceId"
),
子节点信息
(
"子节点信息"
,
"/workflow/task/list/all/{instanceId}"
,
"instanceId"
),
所有已执行任务集合
(
"所有已执行任务集合"
,
"/workflow/activitiHistory/tasks/{processInstanceId}"
,
"processInstanceId"
);
private
String
desc
;
private
String
uri
;
private
String
params
;
WorkFlowUriEnum
(
String
desc
,
String
uri
,
String
params
)
{
this
.
desc
=
desc
;
this
.
uri
=
uri
;
this
.
params
=
params
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
String
getUri
()
{
return
uri
;
}
public
void
setUri
(
String
uri
)
{
this
.
uri
=
uri
;
}
public
String
getParams
()
{
return
params
;
}
public
void
setParams
(
String
params
)
{
this
.
params
=
params
;
}
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/enums/YesOrNoEnum.java
0 → 100644
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
workflow
.
enums
;
/**
* 是否枚举
* @author WJK
*
*/
public
enum
YesOrNoEnum
{
NO
(
"否"
,
"0"
),
YES
(
"是"
,
"1"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
private
YesOrNoEnum
(
String
name
,
String
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
static
YesOrNoEnum
getEnum
(
String
code
)
{
YesOrNoEnum
jPushTypeEnum
=
null
;
for
(
YesOrNoEnum
type:
YesOrNoEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
jPushTypeEnum
=
type
;
break
;
}
}
return
jPushTypeEnum
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FailureAuditDto.java
View file @
6eb5eaef
...
@@ -25,6 +25,9 @@ public class FailureAuditDto extends BaseDto {
...
@@ -25,6 +25,9 @@ public class FailureAuditDto extends BaseDto {
@ApiModelProperty
(
value
=
"审核部门"
)
@ApiModelProperty
(
value
=
"审核部门"
)
private
String
auditDepartment
;
private
String
auditDepartment
;
@ApiModelProperty
(
value
=
"审核部门"
)
private
Long
auditDepartmentId
;
@ApiModelProperty
(
value
=
"审核时间"
)
@ApiModelProperty
(
value
=
"审核时间"
)
private
Date
auditTime
;
private
Date
auditTime
;
...
@@ -37,5 +40,10 @@ public class FailureAuditDto extends BaseDto {
...
@@ -37,5 +40,10 @@ public class FailureAuditDto extends BaseDto {
@ApiModelProperty
(
value
=
"设备故障报修单id"
)
@ApiModelProperty
(
value
=
"设备故障报修单id"
)
private
Long
faultId
;
private
Long
faultId
;
@ApiModelProperty
(
value
=
"审核结果条件判断,0同意,1拒绝,2驳回"
)
private
String
condition
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FailureMaintainDto.java
View file @
6eb5eaef
...
@@ -51,5 +51,8 @@ public class FailureMaintainDto extends BaseDto {
...
@@ -51,5 +51,8 @@ public class FailureMaintainDto extends BaseDto {
@ApiModelProperty
(
value
=
"附件"
)
@ApiModelProperty
(
value
=
"附件"
)
private
List
<
SourceFile
>
attachment
;
private
List
<
SourceFile
>
attachment
;
@ApiModelProperty
(
value
=
"审核结果条件判断,0同意,1拒绝,2驳回"
)
private
String
condition
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureAudit.java
View file @
6eb5eaef
...
@@ -34,6 +34,9 @@ public class FailureAudit extends BaseEntity {
...
@@ -34,6 +34,9 @@ public class FailureAudit extends BaseEntity {
*/
*/
@TableField
(
"audit_department"
)
@TableField
(
"audit_department"
)
private
String
auditDepartment
;
private
String
auditDepartment
;
@TableField
(
"audit_department_id"
)
private
Long
auditDepartmentId
;
/**
/**
* 审核时间
* 审核时间
...
@@ -52,5 +55,7 @@ public class FailureAudit extends BaseEntity {
...
@@ -52,5 +55,7 @@ public class FailureAudit extends BaseEntity {
*/
*/
@TableField
(
"fault_id"
)
@TableField
(
"fault_id"
)
private
Long
faultId
;
private
Long
faultId
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IFailureAuditService.java
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureAudit
;
/**
/**
* 接口类
* 接口类
...
@@ -8,5 +9,5 @@ package com.yeejoin.amos.boot.module.common.api.service;
...
@@ -8,5 +9,5 @@ package com.yeejoin.amos.boot.module.common.api.service;
* @date 2021-08-04
* @date 2021-08-04
*/
*/
public
interface
IFailureAuditService
{
public
interface
IFailureAuditService
{
public
FailureAudit
findByFaultId
(
Long
faultId
)
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureAuditController.java
View file @
6eb5eaef
...
@@ -86,4 +86,7 @@ public class FailureAuditController extends BaseController {
...
@@ -86,4 +86,7 @@ public class FailureAuditController extends BaseController {
public
ResponseModel
<
List
<
FailureAuditDto
>>
selectForList
()
{
public
ResponseModel
<
List
<
FailureAuditDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryForFailureAuditList
());
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryForFailureAuditList
());
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureDetailsController.java
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
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
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureDetailsServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureDetailsServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
/*import com.yeejoin.amos.patrol.business.util.CommonResponse;
/*import com.yeejoin.amos.patrol.business.util.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;*/
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;*/
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
/**
*
*
...
@@ -44,29 +53,29 @@ public class FailureDetailsController extends BaseController {
...
@@ -44,29 +53,29 @@ public class FailureDetailsController extends BaseController {
*
*
* @return
* @return
*/
*/
/*
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
CommonResponse
save(@RequestBody FailureDetailsDto model) {
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureDetailsDto
model
)
{
*/
/* model = failureDetailsServiceImpl.savemodel(model
);
Object
result
=
failureDetailsServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()
);
return ResponseHelper.buildResponse(
model);*//*
return
ResponseHelper
.
buildResponse
(
result
);
CommonResponse commonResponse = new CommonResponse();
//
CommonResponse commonResponse = new CommonResponse();
try {
//
try {
AgencyUserModel user = getUserInfo();
//
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
//
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
//
return CommonResponseUtil.failure("用户session过期");
}
//
}
return failureDetailsServiceImpl.savemodel(model);
//
return failureDetailsServiceImpl.savemodel(model);
} catch (Exception e) {
//
} catch (Exception e) {
logger.error("", e.getMessage());
//
logger.error("", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
//
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
//
}
}
}
*/
/**
/**
* 根据sequenceNbr更新
* 根据sequenceNbr更新
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureMaintainController.java
View file @
6eb5eaef
...
@@ -118,5 +118,18 @@ public class FailureMaintainController extends BaseController {
...
@@ -118,5 +118,18 @@ public class FailureMaintainController extends BaseController {
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryForFailureMaintainList
());
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryForFailureMaintainList
());
}
}
/**
* 查询历史流程审核信息记录
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备故障报修单详情-报修日志"
,
notes
=
"设备故障报修单详情-报修日志"
)
@GetMapping
(
value
=
"/getProcessHistory/{sequenceNbr}"
)
public
ResponseModel
<
List
<
Object
>>
getProcessHistory
(
@PathVariable
Long
sequenceNbr
)
{
if
(
sequenceNbr
==
null
)
{
return
ResponseHelper
.
buildResponse
(
null
);
}
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
getProcessHistoryList
(
sequenceNbr
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureAuditServiceImpl.java
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
...
@@ -9,13 +17,6 @@ import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
...
@@ -9,13 +17,6 @@ import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureAuditMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureAuditMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
/**
/**
* 服务实现类
* 服务实现类
*
*
...
@@ -23,53 +24,64 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
...
@@ -23,53 +24,64 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
* @date 2021-08-04
* @date 2021-08-04
*/
*/
@Service
@Service
public
class
FailureAuditServiceImpl
extends
BaseService
<
FailureAuditDto
,
FailureAudit
,
FailureAuditMapper
>
implements
IFailureAuditService
{
public
class
FailureAuditServiceImpl
extends
BaseService
<
FailureAuditDto
,
FailureAudit
,
FailureAuditMapper
>
@Autowired
implements
IFailureAuditService
{
FailureDetailsServiceImpl
failureDetailsService
;
@Autowired
/* @Autowired
FailureDetailsServiceImpl
failureDetailsService
;
RemoteWorkFlowService remoteWorkFlowService;*/
// @Autowired
// RemoteWorkFlowService remoteWorkFlowService;
/**
/**
* 分页查询
* 分页查询
*/
*/
public
Page
<
FailureAuditDto
>
queryForFailureAuditPage
(
Page
<
FailureAuditDto
>
page
)
{
public
Page
<
FailureAuditDto
>
queryForFailureAuditPage
(
Page
<
FailureAuditDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
return
this
.
queryForPage
(
page
,
null
,
false
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
public
List
<
FailureAuditDto
>
queryForFailureAuditList
()
{
public
List
<
FailureAuditDto
>
queryForFailureAuditList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
/**
/**
* 发起审核
* 发起审核
*/
*/
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
)
{
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
)
{
// remoteWorkFlowService.currentTask();
// remoteWorkFlowService.currentTask();
this
.
createWithModel
(
model
);
this
.
createWithModel
(
model
);
Integer
auditResult
=
model
.
getAuditResult
();
Integer
auditResult
=
model
.
getAuditResult
();
if
(
auditResult
.
equals
(
AuditResultEnum
.
AGREE
.
getCode
()))
{
if
(
auditResult
.
equals
(
AuditResultEnum
.
AGREE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
());
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
());
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
.
getCode
());
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
.
getCode
());
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
());
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
());
}
}
return
model
;
return
model
;
}
}
/**
/**
* 修改故障保修单任务状态
* 修改故障保修单任务状态
*/
*/
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
Integer
status
)
{
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
Integer
status
)
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
status
);
failureDetailsDto
.
setCurrentStatus
(
status
);
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
return
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
return
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
}
}
public
FailureAudit
findByFaultId
(
Long
faultId
)
{
LambdaQueryWrapper
<
FailureAudit
>
wrapper
=
new
LambdaQueryWrapper
<
FailureAudit
>();
wrapper
.
eq
(
FailureAudit:
:
getIsDelete
,
false
);
wrapper
.
eq
(
FailureAudit:
:
getFaultId
,
faultId
);
wrapper
.
orderByAsc
(
FailureAudit:
:
getAuditTime
);
wrapper
.
last
(
"LIMIT 1"
);
return
this
.
baseMapper
.
selectOne
(
wrapper
);
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureDetailsServiceImpl.java
View file @
6eb5eaef
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.workflow.RemoteWorkFlowService
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureAudit
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService
;
/**
/**
...
@@ -23,88 +38,180 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
...
@@ -23,88 +38,180 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
* @date 2021-08-04
* @date 2021-08-04
*/
*/
@Service
@Service
public
class
FailureDetailsServiceImpl
extends
BaseService
<
FailureDetailsDto
,
FailureDetails
,
FailureDetailsMapper
>
implements
IFailureDetailsService
{
public
class
FailureDetailsServiceImpl
extends
BaseService
<
FailureDetailsDto
,
FailureDetails
,
FailureDetailsMapper
>
implements
IFailureDetailsService
{
@Autowired
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
SourceFileServiceImpl
sourceFileServiceImpl
;
// @Autowired
@Autowired
// RemoteWorkFlowService remoteWorkFlowService;
RemoteWorkFlowService
remoteWorkFlowService
;
//
// @Value("${failure.work.flow.processDefinitionKey}")
@Value
(
"${failure.work.flow.processDefinitionKey}"
)
// private String processDefinitionKey;
private
String
processDefinitionKey
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
@Autowired
IFailureAuditService
failureAuditService
;
/**
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
* 分页查询
*/
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
public
Page
<
FailureDetailsDto
>
queryForFailureDetailsPage
(
Page
<
FailureDetailsDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
/**
}
* 分页查询
*/
/**
public
Page
<
FailureDetailsDto
>
queryForFailureDetailsPage
(
Page
<
FailureDetailsDto
>
page
)
{
* 列表查询 示例
return
this
.
queryForPage
(
page
,
null
,
false
);
*/
}
public
List
<
FailureDetailsDto
>
queryForFailureDetailsList
()
{
return
this
.
queryForList
(
""
,
false
);
/**
}
* 列表查询 示例
*/
/**
public
List
<
FailureDetailsDto
>
queryForFailureDetailsList
()
{
* 根据状态查询
return
this
.
queryForList
(
""
,
false
);
*/
}
public
List
<
FailureDetails
>
queryForFailureDetailsList
(
Long
currentStatus
)
{
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
/**
queryWrapper
.
eq
(
"current_status"
,
currentStatus
).
orderByDesc
(
"submission_time"
);
* 根据状态查询
return
baseMapper
.
selectList
(
queryWrapper
);
*/
public
List
<
FailureDetails
>
queryForFailureDetailsList
(
Long
currentStatus
)
{
}
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"current_status"
,
currentStatus
).
orderByDesc
(
"submission_time"
);
/**
return
baseMapper
.
selectList
(
queryWrapper
);
* 发起故障保修单
*/
}
// public Object savemodel(FailureDetailsDto failureDetailsDto) {
// String businessKey = buildOrderNo();
/**
// JSONObject jsonObject = remoteWorkFlowService.start( businessKey, processDefinitionKey);
* 发起故障保修单
// if (jsonObject == null) {
*/
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@Transactional
// // return CommonResponseUtil.failure("启动流程失败");
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
{
// }
String
businessKey
=
buildOrderNo
();
// JSONObject instance = jsonObject.getJSONObject("data");
JSONObject
jsonObject
=
remoteWorkFlowService
.
startNew
(
null
,
businessKey
,
processDefinitionKey
);
// if(instance==null){
if
(
jsonObject
==
null
)
{
// //return CommonResponseUtil.failure("无提交隐患权限");
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
// }
// return CommonResponseUtil.failure("启动流程失败");
// failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_AUDIT.getCode());
}
// //拿到流程id
JSONObject
instance
=
jsonObject
.
getJSONObject
(
"data"
);
// failureDetailsDto.setProcessId(instance.getString("processInstanceId"));
if
(
instance
==
null
)
{
// FailureDetailsDto model =null;
// return CommonResponseUtil.failure("无提交隐患权限");
// try {
}
// sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(), failureDetailsDto.getAttachment());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
// model = this.createWithModel(failureDetailsDto);
// 拿到流程processId
// } catch (Exception e) {
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
// logger.info("添加故障维修信息到数据库失败");
FailureDetailsDto
model
=
null
;
// // return CommonResponseUtil.failure("添加失败");
try
{
// }
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
// if(ObjectUtils.isNotEmpty(model)) {
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
// JSONObject teskObject = remoteWorkFlowService.currentTask(instance.getString("processInstanceId"));
failureDetailsDto
.
getAttachment
());
// if(ObjectUtils.isNotEmpty(teskObject)) {
}
// JSONObject taskDetail = teskObject.getJSONObject("data");
model
=
this
.
createWithModel
(
failureDetailsDto
);
// String taskId = taskDetail.getString("id");
}
catch
(
Exception
e
)
{
// remoteWorkFlowService.excute(taskId, null);
logger
.
info
(
"添加故障维修信息到数据库失败"
);
// }
return
false
;
// }
// return CommonResponseUtil.failure("添加失败");
// return model;
}
// }
if
(
ObjectUtils
.
isNotEmpty
(
model
))
{
// public static String buildOrderNo() {
excuteTask
(
false
,
model
.
getSequenceNbr
(),
instance
.
getString
(
"id"
),
userInfo
,
null
);
// SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
}
// String newDate = sdf.format(new Date());
return
true
;
// String result = "";
}
// Random random = new Random();
// for (int i = 0; i < 3; i++) {
public
boolean
excuteTask
(
boolean
falg
,
Long
sequenceNbr
,
String
procressId
,
ReginParams
userInfo
,
// result += random.nextInt(10);
String
condition
)
{
// }
// return newDate + result;
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
// }
// 获取送达部门的ID
Integer
failureEquipmentId
=
failureDetailsDto
.
getFailureEquipmentId
();
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
auditDepartmentId
=
null
;
if
(
falg
==
true
)
{
FailureAudit
failureAudit
=
failureAuditService
.
findByFaultId
(
sequenceNbr
);
auditDepartmentId
=
failureAudit
.
getAuditDepartmentId
();
}
else
{
auditDepartmentId
=
seq
;
}
Map
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
condition
);
JSONObject
teskObject
=
remoteWorkFlowService
.
getChildNodeDetail
(
procressId
);
try
{
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
contains
(
EMERGENCY_COMMAND
)
&&
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
String
taskId
=
detail
.
getString
(
"id"
);
remoteWorkFlowService
.
excute
(
taskId
,
conditionMap
.
toString
());
break
;
}
else
{
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
String
taskId
=
detail
.
getString
(
"id"
);
remoteWorkFlowService
.
excute
(
taskId
,
conditionMap
.
toString
());
break
;
}
}
}
}
}
catch
(
Exception
e
)
{
return
false
;
}
return
true
;
}
public
boolean
checkExcuteTaskAuth
(
boolean
falg
,
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
auditDepartmentId
=
null
;
if
(
falg
==
true
)
{
FailureAudit
failureAudit
=
failureAuditService
.
findByFaultId
(
sequenceNbr
);
auditDepartmentId
=
failureAudit
.
getAuditDepartmentId
();
}
else
{
auditDepartmentId
=
seq
;
}
return
checkExcuteTaskAuth
(
auditDepartmentId
,
sequenceNbr
,
userInfo
);
}
public
boolean
checkExcuteTaskAuth
(
Long
auditDepartmentId
,
Long
sequenceNbr
,
ReginParams
userInfo
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
// 获取送达部门的ID
Integer
failureEquipmentId
=
failureDetailsDto
.
getFailureEquipmentId
();
FailureAudit
failureAudit
=
failureAuditService
.
findByFaultId
(
sequenceNbr
);
//获取上一级操作部门的Id
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
JSONObject
teskObject
=
remoteWorkFlowService
.
getChildNodeDetail
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
contains
(
EMERGENCY_COMMAND
)
&&
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
return
true
;
}
else
{
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
return
true
;
}
}
}
}
return
false
;
}
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
String
processId
=
failureDetailsDto
.
getProcessId
();
JSONObject
historyObject
=
remoteWorkFlowService
.
queryFinishTaskDetailByInstanceId
(
processId
);
return
logger
;
}
public
static
String
buildOrderNo
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
String
newDate
=
sdf
.
format
(
new
Date
());
String
result
=
""
;
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
result
+=
random
.
nextInt
(
10
);
}
return
newDate
+
result
;
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureMaintainServiceImpl.java
View file @
6eb5eaef
...
@@ -73,4 +73,13 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -73,4 +73,13 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
}
}
return
failureMaintainDto
;
return
failureMaintainDto
;
}
}
/**
* 查询当前故障报修单的流程的审批历史节点
* @param sequenceNbr
* @return
*/
public
List
<
Object
>
getProcessHistoryList
(
Long
sequenceNbr
)
{
// TODO Auto-generated method stub
return
null
;
}
}
}
\ 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