Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
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
zhangkb
indicators
Commits
ac1957cf
Commit
ac1957cf
authored
Sep 21, 2020
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息信息添加任务id和类别(完成驳回时生产消息)
parent
6a533192
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
0 deletions
+74
-0
NoticeInfoCtrl.java
...om/keymobile/indicators/api/hytobacco/NoticeInfoCtrl.java
+16
-0
Constants.java
...ain/java/com/keymobile/indicators/constant/Constants.java
+9
-0
NoticeInfo.java
...ava/com/keymobile/indicators/model/entity/NoticeInfo.java
+10
-0
TaskServiceImpl.java
...le/indicators/service/dataenter/impl/TaskServiceImpl.java
+39
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/NoticeInfoCtrl.java
View file @
ac1957cf
...
@@ -32,6 +32,8 @@ public class NoticeInfoCtrl {
...
@@ -32,6 +32,8 @@ public class NoticeInfoCtrl {
@ApiParam
(
"每页条数"
)
@RequestParam
(
"pageSize"
)
int
pageSize
)
{
@ApiParam
(
"每页条数"
)
@RequestParam
(
"pageSize"
)
int
pageSize
)
{
PageRequest
request
=
PageRequest
.
of
(
pageNo
,
pageSize
);
PageRequest
request
=
PageRequest
.
of
(
pageNo
,
pageSize
);
List
<
NoticeInfo
>
list
=
new
ArrayList
<>();
List
<
NoticeInfo
>
list
=
new
ArrayList
<>();
String
currentUserId
=
SystemUserUtil
.
getCurrentUserId
();
System
.
out
.
println
(
currentUserId
);
long
total
=
noticeInfoService
.
findByPageCount
(
keyword
,
null
,
SystemUserUtil
.
getCurrentUserId
());
long
total
=
noticeInfoService
.
findByPageCount
(
keyword
,
null
,
SystemUserUtil
.
getCurrentUserId
());
if
(
total
>
0
)
{
if
(
total
>
0
)
{
list
=
noticeInfoService
.
findByPage
(
keyword
,
null
,
SystemUserUtil
.
getCurrentUserId
(),
request
.
getOffset
(),
pageSize
);
list
=
noticeInfoService
.
findByPage
(
keyword
,
null
,
SystemUserUtil
.
getCurrentUserId
(),
request
.
getOffset
(),
pageSize
);
...
@@ -68,4 +70,18 @@ public class NoticeInfoCtrl {
...
@@ -68,4 +70,18 @@ public class NoticeInfoCtrl {
}
}
return
Result
.
genOkResult
();
return
Result
.
genOkResult
();
}
}
@ApiOperation
(
"创建消息"
)
@PostMapping
(
"createNotice"
)
public
Result
createNotice
(
@RequestBody
NoticeInfo
noticeInfo
){
noticeInfoService
.
insertNotice
(
noticeInfo
);
return
Result
.
genOkResult
();
}
@ApiOperation
(
"批量创建消息(异步)"
)
@PostMapping
(
"batchCreateNotice"
)
public
Result
batchCreateNotice
(
@RequestBody
List
<
NoticeInfo
>
noticeInfos
){
noticeInfoService
.
createNotices
(
noticeInfos
);
return
Result
.
genOkResult
();
}
}
}
src/main/java/com/keymobile/indicators/constant/Constants.java
View file @
ac1957cf
...
@@ -107,6 +107,15 @@ public class Constants {
...
@@ -107,6 +107,15 @@ public class Constants {
/**
/**
* 消息类别-数据填报
*/
public
static
final
int
NOTICEINFO_DATA_ENTER
=
1
;
/**
* 消息类别-数据审核
*/
public
static
final
int
NOTICEINFO_DATA_AUDIT
=
2
;
/**
* 数据项数据来源- excel填报-1
* 数据项数据来源- excel填报-1
*/
*/
public
static
final
int
INPUT_EXCEL
=
1
;
public
static
final
int
INPUT_EXCEL
=
1
;
...
...
src/main/java/com/keymobile/indicators/model/entity/NoticeInfo.java
View file @
ac1957cf
...
@@ -27,4 +27,14 @@ public class NoticeInfo extends BaseModel {
...
@@ -27,4 +27,14 @@ public class NoticeInfo extends BaseModel {
@ApiModelProperty
(
"通知标题"
)
@ApiModelProperty
(
"通知标题"
)
private
String
toUserId
;
private
String
toUserId
;
@ApiModelProperty
(
"任务id"
)
private
String
taskId
;
@ApiModelProperty
(
"消息类别 1)数据填报2)数据审核"
)
private
Integer
noticeClass
;
@ApiModelProperty
(
"跳转路径"
)
private
String
url
;
}
}
src/main/java/com/keymobile/indicators/service/dataenter/impl/TaskServiceImpl.java
View file @
ac1957cf
...
@@ -327,7 +327,12 @@ public class TaskServiceImpl implements TaskService {
...
@@ -327,7 +327,12 @@ public class TaskServiceImpl implements TaskService {
noticeInfo
.
setState
(
Constants
.
DATA_STATE_A
);
noticeInfo
.
setState
(
Constants
.
DATA_STATE_A
);
noticeInfo
.
setUpdater
(
user
);
noticeInfo
.
setUpdater
(
user
);
noticeInfo
.
setUpdateTime
(
now
);
noticeInfo
.
setUpdateTime
(
now
);
//跳转到审核
noticeInfo
.
setTaskId
(
taskId
);
noticeInfo
.
setNoticeClass
(
Constants
.
NOTICEINFO_DATA_AUDIT
);
noticeInfos
.
add
(
noticeInfo
);
noticeInfos
.
add
(
noticeInfo
);
}
}
}
}
if
(
found
)
{
if
(
found
)
{
...
@@ -398,6 +403,34 @@ public class TaskServiceImpl implements TaskService {
...
@@ -398,6 +403,34 @@ public class TaskServiceImpl implements TaskService {
taskAuditRecordMapper
.
insert
(
auditRecord
);
taskAuditRecordMapper
.
insert
(
auditRecord
);
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"{} {}任务:{}Id:{},ruleId:{}, ruleLevel:{}"
,
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"{} {}任务:{}Id:{},ruleId:{}, ruleLevel:{}"
,
auditUser
,
recordType
,
task
.
getRuleName
(),
task
.
getId
(),
task
.
getRuleId
(),
task
.
getRuleLevel
());
auditUser
,
recordType
,
task
.
getRuleName
(),
task
.
getId
(),
task
.
getRuleId
(),
task
.
getRuleLevel
());
if
(
status
==
Constants
.
APPLY_STATE_DRAFT
){
String
user
=
SystemUserUtil
.
getCurrentUser
();
String
enterUserStr
=
task
.
getEnterUsers
();
if
(
StringUtils
.
isNotBlank
(
enterUserStr
)){
List
<
NoticeInfo
>
noticeInfos
=
new
ArrayList
<>();
String
[]
enterUsers
=
enterUserStr
.
split
(
Constants
.
SEP_COMMA
);
//enterUserStr = ,42, 所以要忽略数组前后值
for
(
int
i
=
1
;
i
<
enterUsers
.
length
-
1
;
i
++){
NoticeInfo
noticeInfo
=
new
NoticeInfo
();
noticeInfo
.
setTaskId
(
task
.
getId
());
noticeInfo
.
setNoticeClass
(
Constants
.
NOTICEINFO_DATA_ENTER
);
noticeInfo
.
setCreateTime
(
now
);
noticeInfo
.
setCreator
(
user
);
noticeInfo
.
setDetail
(
task
.
getRuleName
()
+
"-任务已经被"
+
auditUser
+
"驳回"
);
noticeInfo
.
setTitle
(
"你有被驳回的任务:"
+
task
.
getRuleName
()
);
noticeInfo
.
setToUserId
(
enterUsers
[
i
]);
noticeInfo
.
setIsRead
(
false
);
noticeInfo
.
setState
(
Constants
.
DATA_STATE_A
);
noticeInfo
.
setUpdater
(
user
);
noticeInfo
.
setUpdateTime
(
now
);
noticeInfos
.
add
(
noticeInfo
);
}
noticeInfoService
.
createNotices
(
noticeInfos
);
}
}
}
}
/**
/**
...
@@ -729,6 +762,12 @@ public class TaskServiceImpl implements TaskService {
...
@@ -729,6 +762,12 @@ public class TaskServiceImpl implements TaskService {
noticeInfo
.
setState
(
Constants
.
DATA_STATE_A
);
noticeInfo
.
setState
(
Constants
.
DATA_STATE_A
);
noticeInfo
.
setUpdater
(
user
);
noticeInfo
.
setUpdater
(
user
);
noticeInfo
.
setUpdateTime
(
now
);
noticeInfo
.
setUpdateTime
(
now
);
//提供跳转到填报路径
noticeInfo
.
setTaskId
(
task
.
getId
());
noticeInfo
.
setNoticeClass
(
Constants
.
NOTICEINFO_DATA_ENTER
);
noticeInfos
.
add
(
noticeInfo
);
noticeInfos
.
add
(
noticeInfo
);
}
}
task
.
setEnterUsers
(
userIds
.
toString
());
task
.
setEnterUsers
(
userIds
.
toString
());
...
...
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