Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datacollector
Overview
Overview
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
chenweisong
datacollector
Commits
170adf25
Commit
170adf25
authored
Apr 01, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
9e2b5d10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
123 additions
and
12 deletions
+123
-12
ExceptionHandlerConfig.java
...om/keymobile/rest/common/conf/ExceptionHandlerConfig.java
+1
-1
ApiError.java
...in/java/com/keymobile/rest/common/exception/ApiError.java
+57
-0
RestExceptionHandler.java
...keymobile/rest/common/exception/RestExceptionHandler.java
+35
-0
ExcelController.java
...n/java/com/keymobile/rest/controller/ExcelController.java
+0
-2
TaskController.java
...in/java/com/keymobile/rest/controller/TaskController.java
+0
-0
TaskConstant.java
.../com/keymobile/rest/controller/constant/TaskConstant.java
+22
-0
Activity.java
src/main/java/com/keymobile/rest/model/Activity.java
+1
-1
Process.java
src/main/java/com/keymobile/rest/model/Process.java
+3
-6
SimpleTask.java
src/main/java/com/keymobile/rest/vo/SimpleTask.java
+2
-0
application-test.yml
src/main/resources/application-test.yml
+2
-2
No files found.
src/main/java/com/keymobile/rest/common/conf/ExceptionHandlerConfig.java
View file @
170adf25
...
...
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
* @author :ws6049
* @date :2019/1/13 0:26
*/
@RestControllerAdvice
//
@RestControllerAdvice
public
class
ExceptionHandlerConfig
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ExceptionHandlerConfig
.
class
);
...
...
src/main/java/com/keymobile/rest/common/exception/ApiError.java
0 → 100644
View file @
170adf25
package
com
.
keymobile
.
rest
.
common
.
exception
;
import
com.fasterxml.jackson.annotation.JsonTypeInfo
;
import
org.springframework.http.HttpStatus
;
@JsonTypeInfo
(
include
=
JsonTypeInfo
.
As
.
WRAPPER_OBJECT
,
use
=
JsonTypeInfo
.
Id
.
NAME
,
property
=
"error"
,
visible
=
true
)
class
ApiError
{
private
HttpStatus
status
;
private
Long
timestamp
;
private
String
message
;
private
String
cnMessage
=
"网络异常"
;
private
ApiError
()
{
timestamp
=
System
.
currentTimeMillis
();
}
ApiError
(
HttpStatus
status
)
{
this
();
this
.
status
=
status
;
}
ApiError
(
HttpStatus
status
,
Throwable
ex
)
{
this
();
this
.
status
=
status
;
}
ApiError
(
HttpStatus
status
,
String
message
,
Throwable
ex
)
{
this
();
this
.
status
=
status
;
this
.
message
=
message
;
}
ApiError
(
HttpStatus
status
,
String
message
,
String
cnMessage
,
Throwable
ex
)
{
this
();
this
.
status
=
status
;
this
.
message
=
message
;
this
.
cnMessage
=
cnMessage
;
}
public
HttpStatus
getStatus
()
{
return
status
;
}
public
Long
getTimestamp
()
{
return
timestamp
;
}
public
String
getMessage
()
{
return
message
;
}
public
String
getCnMessage
()
{
return
cnMessage
;
}
}
\ No newline at end of file
src/main/java/com/keymobile/rest/common/exception/RestExceptionHandler.java
0 → 100644
View file @
170adf25
package
com
.
keymobile
.
rest
.
common
.
exception
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.context.request.WebRequest
;
import
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
INTERNAL_SERVER_ERROR
;
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
@ControllerAdvice
public
class
RestExceptionHandler
extends
ResponseEntityExceptionHandler
{
@ExceptionHandler
(
Exception
.
class
)
protected
ResponseEntity
<
Object
>
handlException
(
Exception
ex
,
WebRequest
request
)
{
ApiError
apiError
;
if
(
ex
instanceof
DataIntegrityViolationException
)
{
apiError
=
new
ApiError
(
INTERNAL_SERVER_ERROR
,
ex
.
getMessage
(),
"重复值"
,
ex
);
}
else
{
apiError
=
new
ApiError
(
INTERNAL_SERVER_ERROR
,
ex
.
getMessage
(),
ex
);
}
return
buildResponseEntity
(
apiError
);
}
private
ResponseEntity
<
Object
>
buildResponseEntity
(
ApiError
apiError
)
{
return
new
ResponseEntity
<>(
apiError
,
apiError
.
getStatus
());
}
}
\ No newline at end of file
src/main/java/com/keymobile/rest/controller/ExcelController.java
View file @
170adf25
...
...
@@ -5,7 +5,6 @@ import com.keymobile.rest.common.utils.DateUtil;
import
com.keymobile.rest.model.DataInfo
;
import
com.keymobile.rest.model.Mission
;
import
com.keymobile.rest.model.Template
;
import
com.keymobile.rest.model.User
;
import
com.keymobile.rest.service.DataInfoService
;
import
com.keymobile.rest.service.TemplateService
;
import
com.keymobile.rest.service.MissionService
;
...
...
@@ -20,7 +19,6 @@ import java.sql.Timestamp;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicInteger
;
@Api
(
tags
=
"模板 控制器"
,
description
=
"Excel Info"
)
@RestController
...
...
src/main/java/com/keymobile/rest/controller/TaskController.java
View file @
170adf25
This diff is collapsed.
Click to expand it.
src/main/java/com/keymobile/rest/controller/constant/TaskConstant.java
0 → 100644
View file @
170adf25
package
com
.
keymobile
.
rest
.
controller
.
constant
;
public
interface
TaskConstant
{
int
TASK_TYPE_PERSONAL
=
1
;
int
TASK_TYPE_GROUP
=
2
;
int
MISSION_TYPE_DATA_ENTER
=
1
;
int
MISSION_TYPE_DATA_AUDIT
=
2
;
int
MISSION_TYPE_MANAGER_AUDIT
=
3
;
int
MISSION_TYPE_DATA_BACK_FLOW
=
4
;
String
MISSION_LOW_CASE_KEY_DATA_ENTER
=
"dataenter"
;
String
MISSION_LOW_CASE_KEY__DATA_AUDIT
=
"dataaudit"
;
String
MISSION_LOW_CASE_KEY__MANAGER_AUDIT
=
"managerconfirm"
;
String
MISSION_LOW_CASE_KEY__DATA_BACK_FLOW
=
"databackflow"
;
String
MISSION_TEXT_DATA_ENTER
=
"填写补录数据"
;
String
MISSION_TEXT_DATA_AUDIT
=
"审核补录数据"
;
String
MISSION_TEXT_MANAGER_AUDIT
=
"负责人审核"
;
String
MISSION_TEXT_DATA_BACK_FLOW
=
"数据回流"
;
}
src/main/java/com/keymobile/rest/model/Activity.java
View file @
170adf25
...
...
@@ -51,7 +51,7 @@ public class Activity implements Serializable {
private
Timestamp
createAt
;
@Column
(
columnDefinition
=
(
"integer(2) comment '状态'"
))
private
Integer
status
;
private
Integer
status
=
1
;
/**
* 发送人
...
...
src/main/java/com/keymobile/rest/model/Process.java
View file @
170adf25
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
...
...
@@ -17,10 +18,6 @@ import java.util.List;
@Table
(
name
=
"t_process"
)
public
class
Process
implements
Serializable
{
public
static
int
STATUS_BEGIN
=
0
;
// 起始状态
public
static
int
STATUS_RECORDING
=
1
;
// 补录中
public
static
int
STATUS_AUDIT
=
2
;
// 审核中
public
static
int
STATUS_COMPLETED
=
3
;
// 已经完成
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
...
...
@@ -32,8 +29,8 @@ public class Process implements Serializable {
@Column
(
name
=
"process_id"
,
unique
=
true
,
columnDefinition
=
(
"varchar(100) comment '当前活动在跑进程 id'"
))
private
String
processId
;
@Column
(
nullable
=
false
,
columnDefinition
=
(
"integer(2) default 0 comment '进程状态'"
)
)
private
int
status
=
0
;
@Column
(
nullable
=
false
,
name
=
"start_at"
)
private
Timestamp
startAt
;
/**
* 该进程启动得所有子任务
...
...
src/main/java/com/keymobile/rest/vo/SimpleTask.java
View file @
170adf25
...
...
@@ -19,6 +19,8 @@ public class SimpleTask {
private
String
remark
;
private
Integer
status
;
private
Integer
type
;
private
Integer
freq
;
...
...
src/main/resources/application-test.yml
View file @
170adf25
...
...
@@ -40,8 +40,8 @@ spring:
max-file-size
:
20Mb
max-request-size
:
100Mb
redis
:
#
host: 192.168.0.192
host
:
127.0.0.1
host
:
192.168.0.192
#
host: 127.0.0.1
port
:
6379
session
:
store-type
:
redis
...
...
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