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
312d8463
Commit
312d8463
authored
Apr 03, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
816140a4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
89 deletions
+18
-89
ExcelController.java
...n/java/com/keymobile/rest/controller/ExcelController.java
+8
-8
DataInfoDao.java
src/main/java/com/keymobile/rest/dao/DataInfoDao.java
+2
-0
Activity.java
src/main/java/com/keymobile/rest/model/Activity.java
+0
-7
DataInfo.java
src/main/java/com/keymobile/rest/model/DataInfo.java
+3
-3
Mission.java
src/main/java/com/keymobile/rest/model/Mission.java
+0
-65
Process.java
src/main/java/com/keymobile/rest/model/Process.java
+1
-1
DataInfoService.java
...main/java/com/keymobile/rest/service/DataInfoService.java
+4
-4
ProcessTest.java
src/test/java/com/keymobile/ProcessTest.java
+0
-1
No files found.
src/main/java/com/keymobile/rest/controller/ExcelController.java
View file @
312d8463
...
@@ -40,7 +40,6 @@ public class ExcelController {
...
@@ -40,7 +40,6 @@ public class ExcelController {
@Autowired
@Autowired
private
RuntimeService
runtimeService
;
private
RuntimeService
runtimeService
;
@ApiOperation
(
value
=
"当前补录任务填写补录"
)
@ApiOperation
(
value
=
"当前补录任务填写补录"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
required
=
true
,
value
=
"补录任务id"
,
dataType
=
"string"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"taskId"
,
required
=
true
,
value
=
"补录任务id"
,
dataType
=
"string"
,
paramType
=
"query"
),
...
@@ -64,7 +63,6 @@ public class ExcelController {
...
@@ -64,7 +63,6 @@ public class ExcelController {
DataInfo
dataInfo
=
new
DataInfo
();
DataInfo
dataInfo
=
new
DataInfo
();
dataInfo
.
setCreateAt
(
DateUtil
.
getTimestamp
());
dataInfo
.
setCreateAt
(
DateUtil
.
getTimestamp
());
dataInfo
.
setTemplate
(
template
);
dataInfo
.
setTemplate
(
template
);
dataInfo
.
setTaskId
(
taskId
);
dataInfo
.
setUserId
(
user
.
getId
());
dataInfo
.
setUserId
(
user
.
getId
());
dataInfo
.
setProcess
(
process
);
dataInfo
.
setProcess
(
process
);
dataInfo
.
setData
(
dataStr
);
dataInfo
.
setData
(
dataStr
);
...
@@ -108,17 +106,19 @@ public class ExcelController {
...
@@ -108,17 +106,19 @@ public class ExcelController {
}
}
}
}
taskService
.
complete
(
task
.
getId
(),
vars
);
taskService
.
complete
(
task
.
getId
(),
vars
);
return
"成功"
;
return
"成功"
;
}
}
@ApiOperation
(
value
=
"传excelId过来,获取用户填写的数据"
)
@ApiOperation
(
value
=
"传excelId过来,获取用户填写的数据"
)
@ApiImplicitParams
(
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"excelId"
,
required
=
true
,
value
=
"当前模板id"
,
dataType
=
"long"
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"excelId"
,
required
=
true
,
value
=
"当前模板id"
,
dataType
=
"long"
,
paramType
=
"path"
),
)
@ApiImplicitParam
(
name
=
"processId"
,
required
=
true
,
value
=
"当前任务的processId"
,
dataType
=
"string"
,
paramType
=
"query"
)
})
@GetMapping
(
value
=
"/excel/getData/{excelId}"
)
@GetMapping
(
value
=
"/excel/getData/{excelId}"
)
public
Object
getRecordData
(
@PathVariable
long
excelId
)
{
public
Object
getRecordData
(
String
processId
,
@PathVariable
long
excelId
)
{
return
"成功"
;
DataInfo
info
=
dataInfoService
.
findByProcessProcessIdAndTemplateId
(
processId
,
excelId
);
CommonValidator
.
notNull
(
info
,
"数据不存在"
);
return
info
;
}
}
}
}
src/main/java/com/keymobile/rest/dao/DataInfoDao.java
View file @
312d8463
...
@@ -5,4 +5,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
...
@@ -5,4 +5,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
public
interface
DataInfoDao
extends
JpaRepository
<
DataInfo
,
Long
>
{
public
interface
DataInfoDao
extends
JpaRepository
<
DataInfo
,
Long
>
{
DataInfo
findByProcessProcessIdAndTemplateId
(
String
processId
,
long
templateId
);
}
}
src/main/java/com/keymobile/rest/model/Activity.java
View file @
312d8463
...
@@ -74,11 +74,4 @@ public class Activity implements Serializable {
...
@@ -74,11 +74,4 @@ public class Activity implements Serializable {
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
mappedBy
=
"activity"
)
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
mappedBy
=
"activity"
)
@JsonIgnore
@JsonIgnore
private
List
<
Process
>
processList
;
private
List
<
Process
>
processList
;
/**
* 该活动跑过得所有任务
*/
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
mappedBy
=
"activity"
)
@JsonIgnore
private
List
<
Mission
>
missionList
;
}
}
src/main/java/com/keymobile/rest/model/DataInfo.java
View file @
312d8463
package
com
.
keymobile
.
rest
.
model
;
package
com
.
keymobile
.
rest
.
model
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -23,15 +24,14 @@ public class DataInfo implements Serializable {
...
@@ -23,15 +24,14 @@ public class DataInfo implements Serializable {
private
String
data
;
private
String
data
;
@Column
(
nullable
=
false
,
name
=
"create_at"
)
@Column
(
nullable
=
false
,
name
=
"create_at"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Timestamp
createAt
;
private
Timestamp
createAt
;
@Column
(
nullable
=
false
,
columnDefinition
=
(
"bigint(22) comment '补录人员id'"
))
@Column
(
nullable
=
false
,
columnDefinition
=
(
"bigint(22) comment '补录人员id'"
))
private
Long
userId
;
private
Long
userId
;
@Column
(
nullable
=
false
,
columnDefinition
=
(
"bigint(22) comment 'task id'"
))
private
String
taskId
;
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@JsonIgnore
private
Process
process
;
private
Process
process
;
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
...
...
src/main/java/com/keymobile/rest/model/Mission.java
deleted
100644 → 0
View file @
816140a4
package
com
.
keymobile
.
rest
.
model
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
/**
* 任务流水
*/
@Data
@Entity
@Table
(
name
=
"t_mission"
)
public
class
Mission
implements
Serializable
{
public
static
int
TYPE_RECORD
=
1
;
public
static
int
TYPE_AUDIT
=
2
;
public
static
int
STATUS_BEGIN
=
1
;
public
static
int
STATUS_COMPLETED
=
2
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
long
id
;
@Column
(
name
=
"create_at"
,
nullable
=
false
,
columnDefinition
=
(
"DATETIME COMMENT '创建时间'"
))
private
Timestamp
createAt
;
@Column
(
nullable
=
false
,
columnDefinition
=
(
"integer(2) default 1 COMMENT '类型'"
))
private
int
type
;
@Column
(
columnDefinition
=
(
"varchar(20) COMMENT '当前activiti任务id'"
))
private
String
taskId
;
/**
* 操作人员id
*/
@Column
(
columnDefinition
=
(
"bigint(20) COMMENT '当前用户id'"
))
private
long
userId
;
@Column
(
nullable
=
false
,
columnDefinition
=
(
"integer(2) default 1 COMMENT '状态'"
))
private
int
status
;
/**
* 补录模板
*/
@OneToOne
private
Template
template
;
/**
* 补录数据
*/
@OneToOne
(
fetch
=
FetchType
.
EAGER
)
private
DataInfo
dataInfo
;
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@JsonIgnore
private
Process
process
;
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@JsonIgnore
private
Activity
activity
;
}
src/main/java/com/keymobile/rest/model/Process.java
View file @
312d8463
...
@@ -37,7 +37,7 @@ public class Process implements Serializable {
...
@@ -37,7 +37,7 @@ public class Process implements Serializable {
*/
*/
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
mappedBy
=
"process"
)
@OneToMany
(
fetch
=
FetchType
.
LAZY
,
mappedBy
=
"process"
)
@JsonIgnore
@JsonIgnore
private
List
<
Mission
>
mission
List
;
private
List
<
DataInfo
>
dataInfo
List
;
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@JsonIgnore
@JsonIgnore
...
...
src/main/java/com/keymobile/rest/service/DataInfoService.java
View file @
312d8463
...
@@ -12,12 +12,12 @@ public class DataInfoService {
...
@@ -12,12 +12,12 @@ public class DataInfoService {
@Autowired
@Autowired
private
DataInfoDao
dataInfoDao
;
private
DataInfoDao
dataInfoDao
;
public
DataInfo
findById
(
long
id
)
{
return
dataInfoDao
.
findById
(
id
).
get
();
}
public
DataInfo
save
(
DataInfo
dataInfo
)
{
public
DataInfo
save
(
DataInfo
dataInfo
)
{
dataInfoDao
.
save
(
dataInfo
);
dataInfoDao
.
save
(
dataInfo
);
return
dataInfo
;
return
dataInfo
;
}
}
public
DataInfo
findByProcessProcessIdAndTemplateId
(
String
processId
,
long
templateId
)
{
return
dataInfoDao
.
findByProcessProcessIdAndTemplateId
(
processId
,
templateId
);
}
}
}
src/test/java/com/keymobile/ProcessTest.java
View file @
312d8463
...
@@ -11,7 +11,6 @@ import org.activiti.engine.runtime.ProcessInstance;
...
@@ -11,7 +11,6 @@ import org.activiti.engine.runtime.ProcessInstance;
import
org.activiti.engine.task.IdentityLink
;
import
org.activiti.engine.task.IdentityLink
;
import
org.activiti.engine.task.Task
;
import
org.activiti.engine.task.Task
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
...
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