Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
c129ad90
提交
c129ad90
authored
3月 02, 2020
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增job
上级
c00cc5c0
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
41 个修改的文件
包含
1244 行增加
和
1414 行删除
+1244
-1414
CommentController.java
.../zjty/tynotes/job/basic/controller/CommentController.java
+60
-60
ScController.java
...a/com/zjty/tynotes/job/basic/controller/ScController.java
+67
-0
WorkController.java
...com/zjty/tynotes/job/basic/controller/WorkController.java
+62
-60
ScoreCoefficient.java
...y/tynotes/job/basic/entity/database/ScoreCoefficient.java
+64
-0
Work.java
...java/com/zjty/tynotes/job/basic/entity/database/Work.java
+49
-25
UpdateCrew.java
...com/zjty/tynotes/job/basic/entity/request/UpdateCrew.java
+31
-0
WorkVo.java
...va/com/zjty/tynotes/job/basic/entity/response/WorkVo.java
+2
-17
CommentRepository.java
.../zjty/tynotes/job/basic/repository/CommentRepository.java
+1
-2
ScoreCoefficientRepository.java
...otes/job/basic/repository/ScoreCoefficientRepository.java
+10
-0
CommentService.java
...va/com/zjty/tynotes/job/basic/service/CommentService.java
+74
-74
ScoreCoefficientService.java
...ty/tynotes/job/basic/service/ScoreCoefficientService.java
+45
-0
TransHelper.java
.../java/com/zjty/tynotes/job/basic/service/TransHelper.java
+35
-35
WorkService.java
.../java/com/zjty/tynotes/job/basic/service/WorkService.java
+33
-1
CommentServiceImpl.java
...ty/tynotes/job/basic/service/impl/CommentServiceImpl.java
+131
-131
ScoreCoefficientServiceImpl.java
...s/job/basic/service/impl/ScoreCoefficientServiceImpl.java
+66
-0
TransHelperImpl.java
.../zjty/tynotes/job/basic/service/impl/TransHelperImpl.java
+120
-120
WorkServiceImpl.java
.../zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
+32
-0
AlterTaskService.java
...m/zjty/tynotes/job/business/service/AlterTaskService.java
+0
-16
NoteMessageService.java
...zjty/tynotes/job/business/service/NoteMessageService.java
+0
-48
AlterTaskStatusImpl.java
...ynotes/job/business/service/impl/AlterTaskStatusImpl.java
+0
-54
NoteMessageServiceImpl.java
...tes/job/business/service/impl/NoteMessageServiceImpl.java
+0
-76
Action.java
...job/src/main/java/com/zjty/tynotes/job/common/Action.java
+24
-11
WorkStatus.java
...java/com/zjty/tynotes/job/common/constant/WorkStatus.java
+21
-3
WorkAttribution.java
...om/zjty/tynotes/job/common/exception/WorkAttribution.java
+30
-0
Read1Controller.java
...m/zjty/tynotes/job/status/controller/Read1Controller.java
+29
-46
TaskController.java
...om/zjty/tynotes/job/status/controller/TaskController.java
+0
-116
EsListSum.java
...in/java/com/zjty/tynotes/job/status/entity/EsListSum.java
+9
-24
Personnel.java
...in/java/com/zjty/tynotes/job/status/entity/Personnel.java
+4
-0
RedisPersonalWork.java
...com/zjty/tynotes/job/status/entity/RedisPersonalWork.java
+67
-0
RoleSum.java
...main/java/com/zjty/tynotes/job/status/entity/RoleSum.java
+22
-12
EventService.java
...ava/com/zjty/tynotes/job/status/service/EventService.java
+0
-89
InternalService.java
.../com/zjty/tynotes/job/status/service/InternalService.java
+4
-0
Take.java
...c/main/java/com/zjty/tynotes/job/status/service/Take.java
+0
-38
WorkShowSeeService.java
...m/zjty/tynotes/job/status/service/WorkShowSeeService.java
+27
-36
WorkShowService.java
.../com/zjty/tynotes/job/status/service/WorkShowService.java
+34
-0
BusinessTreeManagementImpl.java
...s/job/status/service/impl/BusinessTreeManagementImpl.java
+47
-78
EventServiceImpl.java
...jty/tynotes/job/status/service/impl/EventServiceImpl.java
+0
-0
InternalServiceImpl.java
.../tynotes/job/status/service/impl/InternalServiceImpl.java
+4
-0
PrivateServiceImpl.java
...y/tynotes/job/status/service/impl/PrivateServiceImpl.java
+0
-242
WorkShowSeeServiceImpl.java
...notes/job/status/service/impl/WorkShowSeeServiceImpl.java
+40
-0
WorkShowServiceImpl.java
.../tynotes/job/status/service/impl/WorkShowServiceImpl.java
+0
-0
没有找到文件。
notes-job/src/main/java/com/zjty/tynotes/job/basic/controller/CommentController.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
controller
;
import
com.zjty.tynotes.job.basic.entity.database.Comment
;
import
com.zjty.tynotes.job.basic.entity.response.JobResponse
;
import
com.zjty.tynotes.job.basic.service.CommentService
;
import
com.zjty.tynotes.job.status.service.BusinessTreeManagement
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
static
org
.
springframework
.
http
.
ResponseEntity
.
ok
;
/**
* <p>Description : ty-note-backend
* <p>Date : 2019/4/28 10:28
* <p>@author : C
*/
@AutoDocument
@Api
(
tags
=
"工作记录相关接口"
,
description
=
"工作记录模块"
)
@RestController
@RequestMapping
(
"/job/comment"
)
public
class
CommentController
{
private
final
CommentService
commentService
;
@Autowired
private
BusinessTreeManagement
businessTreeManagement
;
@Autowired
public
CommentController
(
CommentService
commentService
)
{
this
.
commentService
=
commentService
;
}
@PostMapping
(
value
=
"/{workId}"
)
@ApiOperation
(
value
=
"新增留言并将其添加到所属工作中."
,
notes
=
"新增不可在数据中附带id.需要在路径中指定所属工作的id.成功时返回新增数据保存的id."
)
public
ResponseEntity
<
JobResponse
>
add
(
@RequestBody
Comment
comment
,
@PathVariable
String
workId
)
{
String
saveId
=
commentService
.
add
(
comment
,
workId
);
businessTreeManagement
.
saveAction
(
comment
.
getCommentator
(),
workId
,
7
,
new
Date
(),
""
);
return
ok
(
new
JobResponse
(
saveId
));
}
@PutMapping
()
@ApiOperation
(
value
=
"修改留言."
,
notes
=
"修改必须在数据中附带id."
)
public
ResponseEntity
<
JobResponse
>
modify
(
@RequestBody
Comment
comment
)
{
String
saveId
=
commentService
.
modify
(
comment
);
return
ok
(
new
JobResponse
(
saveId
));
}
@DeleteMapping
(
"/{commentId}"
)
@ApiOperation
(
value
=
"根据id删除留言."
)
public
ResponseEntity
<
JobResponse
>
delete
(
@PathVariable
String
commentId
)
{
return
ok
(
new
JobResponse
(
commentId
));
}
}
//
package com.zjty.tynotes.job.basic.controller;
//
//
import com.zjty.tynotes.job.basic.entity.database.Comment;
//
import com.zjty.tynotes.job.basic.entity.response.JobResponse;
//
import com.zjty.tynotes.job.basic.service.CommentService;
//
import com.zjty.tynotes.job.status.service.BusinessTreeManagement;
//
import com.zjty.tynotes.misc.config.AutoDocument;
//
import io.swagger.annotations.Api;
//
import io.swagger.annotations.ApiOperation;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.http.ResponseEntity;
//
import org.springframework.web.bind.annotation.*;
//
//
import java.util.Date;
//
//
import static org.springframework.http.ResponseEntity.ok;
//
/
//
**
//
* <p>Description : ty-note-backend
//
* <p>Date : 2019/4/28 10:28
//
* <p>@author : C
//
*/
//
@AutoDocument
//
@Api(tags = "工作记录相关接口", description = "工作记录模块")
//
@RestController
//
@RequestMapping("/job/comment")
//
public class CommentController {
//
//
private final
//
CommentService commentService;
//
//
@Autowired
//
private BusinessTreeManagement businessTreeManagement;
//
//
@Autowired
//
public CommentController(CommentService commentService) {
//
this.commentService = commentService;
//
}
//
//
@PostMapping(value = "/{workId}")
//
@ApiOperation(value = "新增留言并将其添加到所属工作中.", notes = "新增不可在数据中附带id.需要在路径中指定所属工作的id.成功时返回新增数据保存的id.")
//
public ResponseEntity<JobResponse> add(@RequestBody Comment comment, @PathVariable String workId) {
//
String saveId = commentService.add(comment, workId);
//
businessTreeManagement.saveAction(comment.getCommentator(),workId,7,new Date(),"");
//
return ok(new JobResponse(saveId));
//
}
//
//
@PutMapping()
//
@ApiOperation(value = "修改留言.", notes = "修改必须在数据中附带id.")
//
public ResponseEntity<JobResponse> modify(@RequestBody Comment comment) {
//
String saveId = commentService.modify(comment);
//
return ok(new JobResponse(saveId));
//
}
//
//
@DeleteMapping("/{commentId}")
//
@ApiOperation(value = "根据id删除留言.")
//
public ResponseEntity<JobResponse> delete(@PathVariable String commentId) {
//
return ok(new JobResponse(commentId));
//
}
//
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/controller/ScController.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
controller
;
import
com.zjty.tynotes.job.basic.entity.database.ScoreCoefficient
;
import
com.zjty.tynotes.job.basic.entity.response.JobResponse
;
import
com.zjty.tynotes.job.basic.service.ScoreCoefficientService
;
import
com.zjty.tynotes.job.common.Action
;
import
com.zjty.tynotes.job.status.service.BusinessTreeManagement
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
static
org
.
springframework
.
http
.
ResponseEntity
.
ok
;
/**
* <p>Description : ty-note-backend
* <p>Date : 2019/5/5 10:08
* <p>@author : C
*/
@AutoDocument
@Api
(
tags
=
"工作记录相关接口"
,
description
=
"工作记录模块"
)
@RestController
@RequestMapping
(
"/job/sc"
)
public
class
ScController
{
private
final
ScoreCoefficientService
scoreCoefficientService
;
@Autowired
BusinessTreeManagement
businessTreeManagement
;
@Autowired
public
ScController
(
ScoreCoefficientService
scoreCoefficientService
)
{
this
.
scoreCoefficientService
=
scoreCoefficientService
;
}
@PostMapping
(
"/"
)
@ApiOperation
(
value
=
"新增考评信息."
,
notes
=
"新增不可在数据中附带id.成功时返回新增数据保存的id."
)
public
ResponseEntity
<
JobResponse
>
add
(
@RequestBody
ScoreCoefficient
scoreCoefficient
,
@RequestParam
String
userId
)
{
String
saveId
=
scoreCoefficientService
.
add
(
scoreCoefficient
);
businessTreeManagement
.
saveAction
(
userId
,
scoreCoefficient
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
""
);
return
ok
(
new
JobResponse
(
saveId
));
}
@PutMapping
()
@ApiOperation
(
value
=
"考评信息修改."
,
notes
=
"修改必须在数据中附带id."
)
public
ResponseEntity
<
JobResponse
>
modify
(
@RequestBody
ScoreCoefficient
scoreCoefficient
,
@RequestParam
String
userId
)
{
String
saveId
=
scoreCoefficientService
.
modify
(
scoreCoefficient
);
businessTreeManagement
.
saveAction
(
userId
,
scoreCoefficient
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
""
);
return
ok
(
new
JobResponse
(
saveId
));
}
@GetMapping
(
"/{workId}"
)
@ApiOperation
(
value
=
"考评信息."
,
notes
=
"修改必须在数据中附带id."
)
public
ResponseEntity
<
ScoreCoefficient
>
findSc
(
@PathVariable
String
workId
)
{
return
ok
(
scoreCoefficientService
.
findById
(
workId
));
}
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/controller/WorkController.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
controller
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.request.U
serRo
;
import
com.zjty.tynotes.job.basic.entity.request.U
pdateCrew
;
import
com.zjty.tynotes.job.basic.entity.request.WorkRo
;
import
com.zjty.tynotes.job.basic.entity.response.JobResponse
;
import
com.zjty.tynotes.job.basic.entity.response.WorkVo
;
import
com.zjty.tynotes.job.basic.service.TransHelper
;
import
com.zjty.tynotes.job.basic.service.WorkService
;
import
com.zjty.tynotes.job.business.service.AlterTaskService
;
import
com.zjty.tynotes.job.business.service.NoteMessageService
;
...
...
@@ -42,8 +40,6 @@ public class WorkController {
private
final
WorkService
workService
;
private
final
TransHelper
transHelper
;
private
final
NoteMessageService
noteMessageService
;
...
...
@@ -54,26 +50,18 @@ public class WorkController {
private
BusinessTreeManagement
businessTreeManagement
;
@Autowired
public
WorkController
(
WorkService
workService
,
TransHelper
transHelper
,
NoteMessageService
noteMessageService
)
{
public
WorkController
(
WorkService
workService
,
NoteMessageService
noteMessageService
)
{
this
.
workService
=
workService
;
this
.
transHelper
=
transHelper
;
this
.
noteMessageService
=
noteMessageService
;
}
@GetMapping
(
value
=
"/"
)
@ApiOperation
(
value
=
"查询所有工作."
)
public
ResponseEntity
<
List
<
WorkVo
>>
findAll
()
{
List
<
WorkVo
>
workVoList
=
workService
.
findAll
().
stream
()
.
map
(
transHelper:
:
transToVo
)
.
collect
(
Collectors
.
toList
());
return
ok
(
workVoList
);
}
@GetMapping
(
value
=
"/{workId}"
)
@ApiOperation
(
value
=
"根据id查询工作."
,
notes
=
"在路径中指定要查询的工作id."
)
public
ResponseEntity
<
Work
Vo
>
findById
(
@PathVariable
String
workId
)
{
WorkVo
workVo
=
transHelper
.
transToVo
(
workService
.
findById
(
workId
));
return
ok
(
workVo
);
public
ResponseEntity
<
Work
>
findById
(
@PathVariable
String
workId
)
{
return
ok
(
workService
.
findById
(
workId
)
);
}
...
...
@@ -85,9 +73,8 @@ public class WorkController {
String
remarks
=
workRo
.
getRemarks
();
Work
work
=
workRo
.
getWork
();
String
workId
=
workService
.
add
(
work
);
Boolean
isFormal
=
work
.
getIsFormal
();
if
(
nonNull
(
isFormal
)
&&
isFormal
)
{
noteMessageService
.
saveNoteMessage
(
userId
,
workId
,
PUBLISH_WORK
,
remarks
);
if
(
work
.
getStatus
().
equals
(
"ongoing"
))
{
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
PUBLISH_WORK
,
new
Date
(),
remarks
);
}
return
ok
(
new
JobResponse
(
workId
));
}
...
...
@@ -100,45 +87,76 @@ public class WorkController {
Work
newWork
=
workRo
.
getWork
();
Work
oldWork
=
workService
.
findById
(
newWork
.
getId
());
String
workId
=
workService
.
modify
(
newWork
);
noteMessageService
.
saveNoteMessage
(
userId
,
workId
,
newWork
,
oldWork
,
remarks
);
//
noteMessageService.saveNoteMessage(userId, workId, newWork, oldWork, remarks);
return
ok
(
new
JobResponse
(
workId
));
}
@GetMapping
(
value
=
"/draft/{userId}"
)
@ApiOperation
(
value
=
"根据当前用户id查询其拥有的草稿."
)
public
ResponseEntity
<
List
<
WorkVo
>>
add
(
@PathVariable
String
userId
)
{
return
ok
(
workService
.
findAll
().
stream
()
.
filter
(
work1
->
!
work1
.
getIsFormal
())
.
filter
(
work
->
work
.
getPublisher
().
equals
(
userId
))
.
map
(
transHelper:
:
transToVo
)
.
collect
(
Collectors
.
toList
()));
@PutMapping
(
value
=
"/delete"
)
@ApiOperation
(
value
=
"根据id删除工作."
,
notes
=
"本次删除选择是否要把个人工作量以及任务工作量纳入统计中."
)
public
ResponseEntity
<
JobResponse
>
delete
(
@RequestParam
String
workId
,
@RequestParam
int
personalWorkload
,
@RequestParam
String
userId
,
@RequestParam
int
workloadCount
,
@RequestParam
String
msg
)
{
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
DELETE_WORK
,
new
Date
(),
msg
);
workService
.
deleteWork
(
workId
,
personalWorkload
,
workloadCount
);
return
ok
(
new
JobResponse
(
workId
));
}
@DeleteMapping
(
value
=
"/{workId}"
)
@ApiOperation
(
value
=
"根据id删除工作."
,
notes
=
"在路径中指定要删除的工作id."
)
public
ResponseEntity
<
JobResponse
>
delete
(
@PathVariable
String
workId
)
{
workService
.
delete
(
workId
);
@PutMapping
(
value
=
"/"
)
@ApiOperation
(
value
=
"修改任务的组员."
,
notes
=
"修改任务的组员."
)
public
ResponseEntity
<
JobResponse
>
update
(
@RequestBody
UpdateCrew
updateCrew
)
{
businessTreeManagement
.
saveAction
(
updateCrew
.
getUserid
(),
updateCrew
.
getWorkId
(),
Action
.
UPDATE_WORK_CREW
,
new
Date
(),
updateCrew
.
getMsg
());
workService
.
updateWorkCrew
(
updateCrew
.
getWorkId
(),
updateCrew
.
getUsers
());
return
ok
(
new
JobResponse
(
updateCrew
.
getWorkId
()));
}
@PutMapping
(
value
=
"/"
)
@ApiOperation
(
value
=
"修改任务的工作量、考评系数."
)
public
ResponseEntity
<
JobResponse
>
updateWorkload
(
@RequestParam
String
workId
,
@RequestParam
String
userId
,
@RequestParam
int
workCoefficient
,
@RequestParam
int
workload
,
@RequestParam
String
msg
)
{
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
UPDATE_WORKLOAD
,
new
Date
(),
msg
);
workService
.
updateWorkload
(
workId
,
workload
,
workCoefficient
);
return
ok
(
new
JobResponse
(
workId
));
}
@PutMapping
(
value
=
"/status"
)
@ApiOperation
(
value
=
"修改工作状态"
)
public
ResponseEntity
alterTaskStatus
(
@RequestParam
String
tas
kId
,
public
ResponseEntity
alterTaskStatus
(
@RequestParam
String
wor
kId
,
@RequestParam
String
userId
,
@RequestParam
String
status
,
@RequestParam
String
msg
)
{
switch
(
status
)
{
case
"underway"
:
alterTaskService
.
alterTaskStatus
(
taskId
,
status
);
businessTreeManagement
.
saveAction
(
userId
,
taskId
,
Action
.
BACK_WORK
,
new
Date
(),
msg
);
case
"ongoing"
:
Work
work
=
workService
.
findById
(
workId
);
workService
.
alterTaskStatus
(
workId
,
status
);
if
(
work
.
getExecutor
().
equals
(
userId
)){
//撤回
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
COMMIT_BACK_WORK
,
new
Date
(),
msg
);
}
else
{
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
BACK_WORK
,
new
Date
(),
msg
);
//审核不通过
}
break
;
case
"finished"
:
alterTaskService
.
alterTaskStatus
(
taskId
,
status
);
businessTreeManagement
.
saveAction
(
userId
,
taskId
,
Action
.
FINISH_WORK
,
new
Date
(),
msg
);
case
"audit"
:
//执行者提交
workService
.
alterTaskStatus
(
workId
,
status
);
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
COMMIT_WORK
,
new
Date
(),
msg
);
break
;
case
"committed"
:
alterTaskService
.
alterTaskStatus
(
taskId
,
status
);
businessTreeManagement
.
saveAction
(
userId
,
taskId
,
Action
.
COMMIT_WORK
,
new
Date
(),
msg
);
case
"review"
:
//审核通过
workService
.
alterTaskStatus
(
workId
,
status
);
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
FINISH_WORK
,
new
Date
(),
msg
);
break
;
default
:
log
.
warn
(
"[job] 修改任务状态传入的参数有误,传入值为:{}"
,
status
);
...
...
@@ -147,23 +165,7 @@ public class WorkController {
return
ok
(
"success"
);
}
@PostMapping
(
value
=
"/updateChecker"
)
@ApiOperation
(
value
=
"修改审核者"
)
public
ResponseEntity
updateChecker
(
@RequestBody
UserRo
userRo
)
{
alterTaskService
.
updateChecker
(
userRo
);
businessTreeManagement
.
saveAction
(
userRo
.
getOperatorId
(),
userRo
.
getWorkId
(),
Action
.
ALTER_CHECKER
,
new
Date
(),
""
);
return
ok
(
"success"
);
}
@PostMapping
(
value
=
"/updateFlower"
)
@ApiOperation
(
value
=
"修改关注者"
)
public
ResponseEntity
updateFlower
(
@RequestBody
UserRo
userRo
)
{
alterTaskService
.
updateFlower
(
userRo
);
businessTreeManagement
.
saveAction
(
userRo
.
getOperatorId
(),
userRo
.
getWorkId
(),
Action
.
ALTER_FOLLOWER
,
new
Date
(),
""
);
return
ok
(
"success"
);
}
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/database/ScoreCoefficient.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
entity
.
database
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"评分"
,
description
=
"评分对象"
)
public
class
ScoreCoefficient
{
/**
* 编号
*/
@ApiModelProperty
(
value
=
"编号"
,
example
=
"id"
)
private
String
id
;
/**
* 任务id
*/
@ApiModelProperty
(
value
=
"任务id"
,
example
=
"任务id"
)
private
String
wordId
;
/**
* 自评分
*/
@ApiModelProperty
(
value
=
"自评分"
,
example
=
"score1"
)
private
String
score1
;
/**
* 自评评语
*/
@ApiModelProperty
(
value
=
"自评评语"
,
example
=
"comments1"
)
private
String
comments1
;
/**
* 发布者评价
*/
@ApiModelProperty
(
value
=
"发布者评价"
,
example
=
"score2"
)
private
String
score2
;
/**
* 发布者评语
*/
@ApiModelProperty
(
value
=
"发布者评语"
,
example
=
"comments2"
)
private
String
comments2
;
/**
* 最终评价
* 发布者的直接上级或更上级
*/
@ApiModelProperty
(
value
=
"最终评价"
,
example
=
"score3"
)
private
String
score3
;
/**
* 最终评语
*/
@ApiModelProperty
(
value
=
"最终评语"
,
example
=
"comments3"
)
private
String
comments3
;
/**
* 最终工作量
*/
@ApiModelProperty
(
value
=
"最终工作量"
,
example
=
"endWorkLoad"
)
private
int
endWorkLoad
;
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/database/Work.java
浏览文件 @
c129ad90
...
...
@@ -32,6 +32,13 @@ public class Work {
@Id
@ApiModelProperty
(
value
=
"id.若新增数据则不可附带id.更新已有数据则必须附带id."
,
example
=
"id"
,
notes
=
"若新增数据则不可附带id.更新已有数据则必须附带id"
)
private
String
id
;
/**
* 上级任务id
*/
@Id
@ApiModelProperty
(
value
=
"上级任务id"
,
example
=
"superiorId"
)
private
String
superiorId
;
/**
* 标题
*/
...
...
@@ -44,6 +51,20 @@ public class Work {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
* 任务开始时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
stateTime
;
/**
* 任务结束时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
endTime
;
/**
* 预计完成时间
*/
...
...
@@ -67,20 +88,15 @@ public class Work {
* 执行者id
*/
@NotNull
@ApiModelProperty
(
value
=
"
执行者的用户
id."
,
example
=
"id"
)
@ApiModelProperty
(
value
=
"
组长
id."
,
example
=
"id"
)
private
String
executor
;
/**
* 审核者id集合
*/
@NotNull
@ApiModelProperty
(
value
=
"审核者的用户id集合."
,
example
=
"[\"id\",\"id\"]"
)
private
List
<
String
>
checker
;
/**
* 关注者id集合
* 组员id集合
*/
@NotNull
@ApiModelProperty
(
value
=
"
关注者的用户
id集合."
,
example
=
"[\"id\",\"id\"]"
)
private
List
<
String
>
follower
;
@ApiModelProperty
(
value
=
"
组原
id集合."
,
example
=
"[\"id\",\"id\"]"
)
private
List
<
String
>
crewList
;
/**
* 附件id
...
...
@@ -89,12 +105,6 @@ public class Work {
@ApiModelProperty
(
value
=
"附件的id集合."
,
example
=
"[\"id\",\"id\"]"
)
private
List
<
String
>
attachment
;
/**
* 留言id
*/
@NotNull
@ApiModelProperty
(
value
=
"留言的id集合."
,
example
=
"[\"id\",\"id\"]"
)
private
List
<
String
>
comment
;
/*工作内容*/
/**
...
...
@@ -105,25 +115,39 @@ public class Work {
@ApiModelProperty
(
value
=
"内容"
,
example
=
"内容..............."
,
notes
=
"内容字数有上限3000个字,上限可设置."
)
private
String
content
;
/**
* 是否为正式的
* 正式的是在工作簿页面上显示的
* 非正式的是不在工作簿页面上显示的 目前就是草稿
* <p>
* 申请任务时只能指定审核者和关注者
* 申请的任务转正后发布者为审核者 执行者为申请者
* 工作量
*/
@NotNull
@ApiModelProperty
(
value
=
"
是否为正式的.正式的是在工作簿页面上显示的.非正式的目前就是草稿."
,
example
=
"true
"
)
private
Boolean
isFormal
;
@ApiModelProperty
(
value
=
"
工作量"
,
example
=
"30
"
)
private
int
workload
;
/**
* 工作状态
* 目前有:
进行中、已提交、已完结
* 目前有:
未发布、进行中、待审核、待考评
*/
@NotEmpty
@NotNull
@ApiModelProperty
(
value
=
"状态.进行中:underway、已提交:committed、已完结:finished"
,
example
=
"finished"
)
private
String
status
;
/**
* 考评系数
*/
@NotNull
@ApiModelProperty
(
value
=
"考评系数"
,
example
=
"0.8"
)
private
int
workCoefficient
;
/**
* 是否记录个人工作量
*/
private
int
pWorkload
=
1
;
/**
* 是否记录任务工作量
*/
private
int
workloadCount
=
1
;
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/request/UpdateCrew.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
entity
.
request
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@AutoDocument
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"修改任务组员"
,
description
=
"修改任务组员请求数据对象"
)
public
class
UpdateCrew
{
@ApiModelProperty
(
value
=
"操作人id"
,
example
=
"userid"
)
private
String
userid
;
@ApiModelProperty
(
value
=
"任务id"
,
example
=
"workId"
)
private
String
workId
;
@ApiModelProperty
(
value
=
"组员id"
,
example
=
"users"
)
private
List
<
String
>
users
;
@ApiModelProperty
(
value
=
"说明"
,
example
=
"msg"
)
private
String
msg
;
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/response/WorkVo.java
浏览文件 @
c129ad90
...
...
@@ -90,13 +90,7 @@ public class WorkVo {
@ApiModelProperty
(
value
=
"附件.该任务中的附件,分3种类型:初始附件、工作附件、交流附件,由Attachment模型中的type属性区分附件类型."
)
private
List
<
Attachment
>
attachment
;
/**
* 留言
*
* @see CommentVo
*/
@ApiModelProperty
(
value
=
"留言"
)
private
List
<
CommentVo
>
comment
;
/*工作内容*/
/**
...
...
@@ -105,16 +99,7 @@ public class WorkVo {
*/
@ApiModelProperty
(
value
=
"内容"
,
example
=
"若是内容过多,将显示滚动条,同时,内容字数有上限3000个字,上限可设置,若是内容超出,请附件。"
)
private
String
content
;
/**
* 是否为正式的
* 正式的是在工作簿页面上显示的
* 非正式的是不在工作簿页面上显示的 目前就是草稿
* <p>
* 申请任务时只能指定审核者和关注者
* 申请的任务转正后发布者为审核者 执行者为申请者
*/
@ApiModelProperty
(
value
=
"是否为正式.正式的是在工作簿页面上显示的;非正式的是草稿."
,
example
=
"true"
,
notes
=
"正式的是在工作簿页面上显示的;非正式的是草稿"
)
private
Boolean
isFormal
;
/**
* Job状态
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/repository/CommentRepository.java
浏览文件 @
c129ad90
...
...
@@ -6,8 +6,7 @@ import org.springframework.stereotype.Repository;
/**
* <p>Description : note
* <p>Date : 2019/4/25 11:28
* <p>@author : C
* <p>@author : zjm
*/
@Repository
public
interface
CommentRepository
extends
MongoRepository
<
Comment
,
String
>
{
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/repository/ScoreCoefficientRepository.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
repository
;
import
com.zjty.tynotes.job.basic.entity.database.ScoreCoefficient
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
ScoreCoefficientRepository
extends
MongoRepository
<
ScoreCoefficient
,
String
>
{
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/CommentService.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
;
import
com.zjty.tynotes.job.basic.entity.database.Comment
;
import
com.zjty.tynotes.job.basic.service.impl.CommentServiceImpl
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* <p>Description : note
* <p>Date : 2019/4/23 14:43
* <p>@author : C
* 实现类见↓
*
* @see
CommentServiceImpl
*/
@Service
public
interface
CommentService
{
/**
* 新增Comment
* 不可附带id
*
* @param comment Comment对象
* @return 新增对象的id
*/
String
add
(
Comment
comment
);
/**
* 根据workId新增Comment并与所属Work建立关系
* 不可附带id
*
* @param comment Comment对象
* @param workId 所属工作Id
* @return Comment对象的id
*/
String
add
(
Comment
comment
,
String
workId
);
/**
* 修改Comment
* 必须附带id
*
* @param comment Comment对象
* @return 更新对象的id
*/
String
modify
(
Comment
comment
);
/**
* 查询所有
*
* @return 对象集合
*/
List
<
Comment
>
findAll
();
/**
* 根据id集合查询所有
*
* @param ids id集合
* @return 对象集合
*/
List
<
Comment
>
findAll
(
List
<
String
>
ids
);
/**
* 根据id删除
*
* @param id 指定id
*/
void
delete
(
String
id
);
/**
* 删除所有数据
*/
void
deleteAll
();
}
//
package com.zjty.tynotes.job.basic.service;
//
//
import com.zjty.tynotes.job.basic.entity.database.Comment;
//
import com.zjty.tynotes.job.basic.service.impl.CommentServiceImpl;
//
import org.springframework.stereotype.Service;
//
//
import java.util.List;
//
/
//
**
//
* <p>Description : note
//
* <p>Date : 2019/4/23 14:43
//
* <p>@author : C
//
* 实现类见↓
//
*
// * @see //
CommentServiceImpl
//
*/
//
@Service
//
public interface CommentService {
//
//
/**
//
* 新增Comment
//
* 不可附带id
//
*
//
* @param comment Comment对象
//
* @return 新增对象的id
//
*/
//
String add(Comment comment);
//
//
/**
//
* 根据workId新增Comment并与所属Work建立关系
//
* 不可附带id
//
*
//
* @param comment Comment对象
//
* @param workId 所属工作Id
//
* @return Comment对象的id
//
*/
//
String add(Comment comment, String workId);
//
//
/**
//
* 修改Comment
//
* 必须附带id
//
*
//
* @param comment Comment对象
//
* @return 更新对象的id
//
*/
//
String modify(Comment comment);
//
//
/**
//
* 查询所有
//
*
//
* @return 对象集合
//
*/
//
List<Comment> findAll();
//
//
/**
//
* 根据id集合查询所有
//
*
//
* @param ids id集合
//
* @return 对象集合
//
*/
//
List<Comment> findAll(List<String> ids);
//
//
/**
//
* 根据id删除
//
*
//
* @param id 指定id
//
*/
//
void delete(String id);
//
//
/**
//
* 删除所有数据
//
*/
//
void deleteAll();
//
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/ScoreCoefficientService.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
;
import
com.zjty.tynotes.job.basic.entity.database.ScoreCoefficient
;
public
interface
ScoreCoefficientService
{
/**
* 新增工作
* 不可附带id
* 判断上级任务id是否存在,存在者减去这次任务设置的分数
* @param scoreCoefficient 考评对象
* @return 新增对象的id
*/
String
add
(
ScoreCoefficient
scoreCoefficient
);
/**
* 修改工作
* 必须附带id
*
* @param scoreCoefficient 考评对象
* @return 更新对象的id
*/
String
modify
(
ScoreCoefficient
scoreCoefficient
);
/**
* 指定id的Work是否存在
*
* @param Id 指定id
* @return 是否存在
*/
Boolean
idExists
(
String
Id
);
/**
* 查找指定id的Work
*
* @param id 指定id
* @return ScoreCoefficient 对象
*/
ScoreCoefficient
findById
(
String
id
);
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/TransHelper.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.response.WorkVo
;
import
com.zjty.tynotes.job.basic.service.impl.TransHelperImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>Description : note
* <p>Date : 2019/4/23 11:33
* <p>@author : C
* 实现类见↓
*
* @see TransHelperImpl
*/
@Service
public
interface
TransHelper
{
/**
* 把DataBase类型对象转换成Vo类型对象(DataBase类型用于存储 Vo类型用于跟前端交互)
*
* @param work Work对象
* @return WorkVo对象
*/
WorkVo
transToVo
(
Work
work
);
/**
* 把Vo类型对象转换成DataBase类型对象(DataBase类型用于存储 Vo类型用于跟前端交互)
*
* @param workVo WorkVo对象
* @return Work
*/
Work
transToDataBase
(
WorkVo
workVo
);
}
//
package com.zjty.tynotes.job.basic.service;
//
//
import com.zjty.tynotes.job.basic.entity.database.Work;
//
import com.zjty.tynotes.job.basic.entity.response.WorkVo;
//
import com.zjty.tynotes.job.basic.service.impl.TransHelperImpl;
//
import org.springframework.stereotype.Service;
//
/
//
**
//
* <p>Description : note
//
* <p>Date : 2019/4/23 11:33
//
* <p>@author : C
//
* 实现类见↓
//
*
//
* @see TransHelperImpl
//
*/
//
@Service
//
public interface TransHelper {
//
//
/**
//
* 把DataBase类型对象转换成Vo类型对象(DataBase类型用于存储 Vo类型用于跟前端交互)
//
*
//
* @param work Work对象
//
* @return WorkVo对象
//
*/
//
WorkVo transToVo(Work work);
//
//
/**
//
* 把Vo类型对象转换成DataBase类型对象(DataBase类型用于存储 Vo类型用于跟前端交互)
//
*
//
* @param workVo WorkVo对象
//
* @return Work
//
*/
//
Work transToDataBase(WorkVo workVo);
//
//
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/WorkService.java
浏览文件 @
c129ad90
...
...
@@ -21,7 +21,7 @@ public interface WorkService {
/**
* 新增工作
* 不可附带id
*
*
判断上级任务id是否存在,存在者减去这次任务设置的分数
* @param work Work对象
* @return 新增对象的id
*/
...
...
@@ -79,6 +79,38 @@ public interface WorkService {
*/
void
deleteAll
();
/**
* 修改任务的状态
* @param taskId 任务id
* @param status 要修改的状态
*/
void
alterTaskStatus
(
String
taskId
,
String
status
);
/**
* 逻辑删除任务
* @param taskId 任务id
* @param personalWorkload 是否记录个人工作量 默认记录1 0 为不记录
* @param workloadCount 是否记录任务总工作量
*/
void
deleteWork
(
String
taskId
,
int
personalWorkload
,
int
workloadCount
);
/**
* 修改任务 组员
* @param taskId 任务id
*
* @param crews 组员名单
*/
void
updateWorkCrew
(
String
taskId
,
List
<
String
>
crews
);
/**
* 修改任务 组员
* @param taskId 任务id
*
* @param workload 工作量
* @param workCoefficient 考评系数 只能修改0.1-0.2
*/
void
updateWorkload
(
String
taskId
,
int
workload
,
int
workCoefficient
);
// /**
// * 查看正在进行中的任务
// */
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/CommentServiceImpl.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
com.zjty.tynotes.job.basic.entity.database.Comment
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.repository.CommentRepository
;
import
com.zjty.tynotes.job.basic.service.CommentService
;
import
com.zjty.tynotes.job.basic.service.WorkService
;
import
com.zjty.tynotes.job.common.exception.BadRequestException
;
import
com.zjty.tynotes.job.common.exception.NotFoundException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
static
java
.
util
.
Objects
.
isNull
;
import
static
java
.
util
.
Objects
.
nonNull
;
/**
* <p>Description : note
* <p>Date : 2019/4/24 14:25
* <p>@author : C
* 接口定义说明见↓
*
* @see CommentService
*/
@Slf4j
@Service
public
class
CommentServiceImpl
implements
CommentService
{
private
final
CommentRepository
commentRepository
;
private
final
WorkService
workService
;
@Autowired
public
CommentServiceImpl
(
CommentRepository
commentRepository
,
WorkService
workService
)
{
this
.
commentRepository
=
commentRepository
;
this
.
workService
=
workService
;
}
@Override
public
String
add
(
Comment
comment
)
{
//新增数据不可附带id
Boolean
idMustNull
=
isNull
(
comment
.
getId
());
if
(
idMustNull
)
{
//更新时间
comment
.
setCreateTime
(
new
Date
());
comment
.
setUpdateTime
(
new
Date
());
String
saveId
=
commentRepository
.
save
(
comment
).
getId
();
log
.
info
(
String
.
format
(
"[job] 新增了id为 %s 的数据."
,
saveId
));
return
saveId
;
}
else
{
String
msg
=
"[job] 新增数据不可附带id."
;
log
.
error
(
msg
);
throw
new
BadRequestException
(
msg
);
}
}
@Override
public
String
add
(
Comment
comment
,
String
workId
)
{
Boolean
idMustNull
=
isNull
(
comment
.
getId
());
if
(
idMustNull
)
{
Boolean
workMustExist
=
workService
.
idExists
(
workId
);
if
(
workMustExist
)
{
String
saveId
=
commentRepository
.
save
(
comment
).
getId
();
Work
work
=
workService
.
findById
(
workId
);
if
(
isNull
(
work
.
getComment
()))
{
work
.
setComment
(
Lists
.
newArrayList
());
}
work
.
getComment
().
add
(
saveId
);
workService
.
modify
(
work
);
log
.
info
(
String
.
format
(
"[job] id为 %s 的留言已添加到id为 %s 的所属工作中."
,
saveId
,
workId
));
return
saveId
;
}
else
{
String
msg
=
"[job] 指定id的所属工作不存在."
;
log
.
error
(
msg
);
throw
new
NotFoundException
(
msg
);
}
}
else
{
String
msg
=
"[job] 新增数据不可附带id."
;
log
.
error
(
msg
);
throw
new
BadRequestException
(
msg
);
}
}
@Override
public
String
modify
(
Comment
comment
)
{
Boolean
idMustExist
=
nonNull
(
comment
.
getId
());
if
(
idMustExist
)
{
if
(
commentRepository
.
existsById
(
comment
.
getId
()))
{
comment
.
setUpdateTime
(
new
Date
());
String
modifyId
=
commentRepository
.
save
(
comment
).
getId
();
log
.
info
(
String
.
format
(
"[job] 修改了id为 %s 的数据."
,
modifyId
));
return
modifyId
;
}
else
{
String
msg
=
"[job] 指定id的数据不存在."
;
log
.
error
(
msg
);
throw
new
NotFoundException
(
msg
);
}
}
else
{
String
msg
=
"[job] 修改必须在数据中附带id."
;
log
.
error
(
msg
);
throw
new
BadRequestException
(
msg
);
}
}
@Override
public
List
<
Comment
>
findAll
()
{
return
commentRepository
.
findAll
();
}
@Override
public
List
<
Comment
>
findAll
(
List
<
String
>
ids
)
{
return
Lists
.
newArrayList
(
commentRepository
.
findAllById
(
ids
));
}
@Override
public
void
delete
(
String
id
)
{
}
@Override
public
void
deleteAll
()
{
commentRepository
.
deleteAll
();
}
}
//
package com.zjty.tynotes.job.basic.service.impl;
//
//
import com.google.common.collect.Lists;
//
import com.zjty.tynotes.job.basic.entity.database.Comment;
//
import com.zjty.tynotes.job.basic.entity.database.Work;
//
import com.zjty.tynotes.job.basic.repository.CommentRepository;
//
import com.zjty.tynotes.job.basic.service.CommentService;
//
import com.zjty.tynotes.job.basic.service.WorkService;
//
import com.zjty.tynotes.job.common.exception.BadRequestException;
//
import com.zjty.tynotes.job.common.exception.NotFoundException;
//
import lombok.extern.slf4j.Slf4j;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.stereotype.Service;
//
//
import java.util.Date;
//
import java.util.List;
//
//
import static java.util.Objects.isNull;
//
import static java.util.Objects.nonNull;
//
/
//
**
//
* <p>Description : note
//
* <p>Date : 2019/4/24 14:25
//
* <p>@author : C
//
* 接口定义说明见↓
//
*
//
* @see CommentService
//
*/
//
@Slf4j
//
@Service
//
public class CommentServiceImpl implements CommentService {
//
//
private final
//
CommentRepository commentRepository;
//
//
private final
//
WorkService workService;
//
//
@Autowired
//
public CommentServiceImpl(CommentRepository commentRepository, WorkService workService) {
//
this.commentRepository = commentRepository;
//
this.workService = workService;
//
}
//
//
@Override
//
public String add(Comment comment) {
//
//新增数据不可附带id
//
Boolean idMustNull = isNull(comment.getId());
//
if (idMustNull) {
//
//更新时间
//
comment.setCreateTime(new Date());
//
comment.setUpdateTime(new Date());
//
String saveId = commentRepository.save(comment).getId();
//
log.info(String.format("[job] 新增了id为 %s 的数据.", saveId));
//
return saveId;
//
} else {
//
String msg = "[job] 新增数据不可附带id.";
//
log.error(msg);
//
throw new BadRequestException(msg);
//
}
//
//
}
//
//
@Override
//
public String add(Comment comment, String workId) {
//
Boolean idMustNull = isNull(comment.getId());
//
if (idMustNull) {
//
Boolean workMustExist = workService.idExists(workId);
//
if (workMustExist) {
//
String saveId = commentRepository.save(comment).getId();
//
Work work = workService.findById(workId);
//
if (isNull(work.getComment())) {
//
work.setComment(Lists.newArrayList());
//
}
//
work.getComment().add(saveId);
//
workService.modify(work);
//
log.info(String.format("[job] id为 %s 的留言已添加到id为 %s 的所属工作中.", saveId, workId));
//
return saveId;
//
} else {
//
String msg = "[job] 指定id的所属工作不存在.";
//
log.error(msg);
//
throw new NotFoundException(msg);
//
}
//
} else {
//
String msg = "[job] 新增数据不可附带id.";
//
log.error(msg);
//
throw new BadRequestException(msg);
//
}
//
}
//
//
@Override
//
public String modify(Comment comment) {
//
Boolean idMustExist = nonNull(comment.getId());
//
if (idMustExist) {
//
if (commentRepository.existsById(comment.getId())) {
//
comment.setUpdateTime(new Date());
//
String modifyId = commentRepository.save(comment).getId();
//
log.info(String.format("[job] 修改了id为 %s 的数据.", modifyId));
//
return modifyId;
//
} else {
//
String msg = "[job] 指定id的数据不存在.";
//
log.error(msg);
//
throw new NotFoundException(msg);
//
}
//
} else {
//
String msg = "[job] 修改必须在数据中附带id.";
//
log.error(msg);
//
throw new BadRequestException(msg);
//
}
//
}
//
//
@Override
//
public List<Comment> findAll() {
//
return commentRepository.findAll();
//
}
//
//
@Override
//
public List<Comment> findAll(List<String> ids) {
//
return Lists.newArrayList(commentRepository.findAllById(ids));
//
}
//
//
@Override
//
public void delete(String id) {
//
//
}
//
//
@Override
//
public void deleteAll() {
//
commentRepository.deleteAll();
//
}
//
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/ScoreCoefficientServiceImpl.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
.
impl
;
import
com.zjty.tynotes.job.basic.entity.database.ScoreCoefficient
;
import
com.zjty.tynotes.job.basic.repository.ScoreCoefficientRepository
;
import
com.zjty.tynotes.job.basic.repository.WorkRepository
;
import
com.zjty.tynotes.job.basic.service.ScoreCoefficientService
;
import
com.zjty.tynotes.job.common.exception.BadRequestException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Optional
;
import
static
java
.
util
.
Objects
.
isNull
;
import
static
java
.
util
.
Objects
.
nonNull
;
@Service
@Slf4j
public
class
ScoreCoefficientServiceImpl
implements
ScoreCoefficientService
{
private
final
ScoreCoefficientRepository
scoreCoefficientRepository
;
@Autowired
public
ScoreCoefficientServiceImpl
(
ScoreCoefficientRepository
scoreCoefficientRepository
)
{
this
.
scoreCoefficientRepository
=
scoreCoefficientRepository
;
}
@Override
public
String
add
(
ScoreCoefficient
scoreCoefficient
)
{
Boolean
idIsNull
=
isNull
(
scoreCoefficient
.
getId
());
if
(
idIsNull
){
String
id
=
scoreCoefficientRepository
.
save
(
scoreCoefficient
).
getId
();
log
.
info
(
"[job] 任务{},考评添加成功,id为 {} "
,
scoreCoefficient
.
getWordId
(),
id
);
return
id
;
}
else
{
String
msg
=
"[job] 任务"
+
scoreCoefficient
.
getWordId
()+
",新增考评数据不能带id."
;
log
.
error
(
msg
);
throw
new
BadRequestException
(
msg
);
}
}
@Override
public
String
modify
(
ScoreCoefficient
scoreCoefficient
)
{
Boolean
idMustExist
=
(
nonNull
(
scoreCoefficient
.
getId
()))
&&
(
scoreCoefficientRepository
.
existsById
(
scoreCoefficient
.
getId
()));
if
(
idMustExist
)
{
String
modifyId
=
scoreCoefficientRepository
.
save
(
scoreCoefficient
).
getId
();
log
.
info
(
String
.
format
(
"[job] 更新了任务id为 %s 的考评数据id为 %s ."
,
scoreCoefficient
.
getWordId
(),
modifyId
));
return
modifyId
;
}
else
{
String
msg
=
"[job] 更新数据必须指定id且指定id的数据存在."
;
log
.
error
(
msg
);
throw
new
BadRequestException
(
msg
);
}
}
@Override
public
Boolean
idExists
(
String
Id
)
{
return
scoreCoefficientRepository
.
existsById
(
Id
);
}
@Override
public
ScoreCoefficient
findById
(
String
id
)
{
Optional
<
ScoreCoefficient
>
scoreOptional
=
scoreCoefficientRepository
.
findById
(
id
);
return
scoreOptional
.
orElseThrow
(()
->
new
BadRequestException
(
String
.
format
(
"[job] 考评id为 %s 的数据不存在."
,
id
)));
}
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/TransHelperImpl.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
.
impl
;
import
com.zjty.tynotes.job.basic.entity.database.Attachment
;
import
com.zjty.tynotes.job.basic.entity.database.Comment
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.response.CommentVo
;
import
com.zjty.tynotes.job.basic.entity.response.WorkVo
;
import
com.zjty.tynotes.job.basic.service.AttachmentService
;
import
com.zjty.tynotes.job.basic.service.CommentService
;
import
com.zjty.tynotes.job.basic.service.TransHelper
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>Description : note
* <p>Date : 2019/4/24 17:05
* <p>@author : C
*/
@Service
@Slf4j
public
class
TransHelperImpl
implements
TransHelper
{
private
final
IUserService
userService
;
private
final
AttachmentService
attachmentService
;
private
final
CommentService
commentService
;
@Autowired
public
TransHelperImpl
(
IUserService
userService
,
AttachmentService
attachmentService
,
CommentService
commentService
)
{
this
.
userService
=
userService
;
this
.
attachmentService
=
attachmentService
;
this
.
commentService
=
commentService
;
}
@Override
public
WorkVo
transToVo
(
Work
work
)
{
User
publisher
=
userService
.
findUserById
(
work
.
getPublisher
());
User
executor
=
userService
.
findUserById
(
work
.
getExecutor
());
List
<
User
>
checkerList
=
userService
.
findUserByIds
(
work
.
getChecker
());
List
<
User
>
followerList
=
userService
.
findUserByIds
(
work
.
getFollower
());
List
<
Attachment
>
attachmentList
=
attachmentService
.
findAll
(
work
.
getAttachment
());
List
<
Comment
>
commentList
=
commentService
.
findAll
(
work
.
getComment
());
List
<
CommentVo
>
commentVoList
=
commentList
.
stream
().
map
(
this
::
toCommentVo
).
collect
(
Collectors
.
toList
());
return
new
WorkVo
(
work
.
getId
(),
work
.
getTitle
(),
work
.
getCreateTime
(),
work
.
getCompleteTime
(),
work
.
getUpdateTime
(),
publisher
,
executor
,
checkerList
,
followerList
,
attachmentList
,
commentVoList
,
work
.
getContent
(),
work
.
getIsFormal
(),
work
.
getStatus
()
);
}
@Override
public
Work
transToDataBase
(
WorkVo
workVo
)
{
return
new
Work
(
workVo
.
getId
(),
workVo
.
getTitle
(),
workVo
.
getCreateTime
(),
workVo
.
getCompleteTime
(),
workVo
.
getUpdateTime
(),
workVo
.
getPublisher
().
getId
(),
workVo
.
getExecutor
().
getId
(),
getUserIds
(
workVo
.
getChecker
()),
getUserIds
(
workVo
.
getFollower
()),
getAttachmentIds
(
workVo
.
getAttachment
()),
getCommentIds
(
workVo
.
getComment
()),
workVo
.
getContent
(),
workVo
.
getIsFormal
(),
workVo
.
getStatus
()
);
}
private
List
<
String
>
getUserIds
(
List
<
User
>
userList
)
{
return
userList
.
stream
()
.
map
(
User:
:
getId
)
.
collect
(
Collectors
.
toList
());
}
private
List
<
String
>
getAttachmentIds
(
List
<
Attachment
>
attachmentList
)
{
return
attachmentList
.
stream
()
.
map
(
Attachment:
:
getId
)
.
collect
(
Collectors
.
toList
());
}
private
List
<
String
>
getCommentIds
(
List
<
CommentVo
>
commentVoList
)
{
return
commentVoList
.
stream
()
.
map
(
CommentVo:
:
getId
)
.
collect
(
Collectors
.
toList
());
}
private
CommentVo
toCommentVo
(
Comment
comment
)
{
return
new
CommentVo
(
comment
.
getId
(),
userService
.
findUserById
(
comment
.
getCommentator
()),
comment
.
getCreateTime
(),
comment
.
getUpdateTime
(),
comment
.
getContent
()
);
}
}
//
package com.zjty.tynotes.job.basic.service.impl;
//
//
import com.zjty.tynotes.job.basic.entity.database.Attachment;
//
import com.zjty.tynotes.job.basic.entity.database.Comment;
//
import com.zjty.tynotes.job.basic.entity.database.Work;
//
import com.zjty.tynotes.job.basic.entity.response.CommentVo;
//
import com.zjty.tynotes.job.basic.entity.response.WorkVo;
//
import com.zjty.tynotes.job.basic.service.AttachmentService;
//
import com.zjty.tynotes.job.basic.service.CommentService;
//
import com.zjty.tynotes.job.basic.service.TransHelper;
//
import com.zjty.tynotes.pas.entity.User;
//
import com.zjty.tynotes.pas.service.IUserService;
//
import lombok.extern.slf4j.Slf4j;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.stereotype.Service;
//
//
import java.util.List;
//
import java.util.stream.Collectors;
//
/
//
**
//
* <p>Description : note
//
* <p>Date : 2019/4/24 17:05
//
* <p>@author : C
//
*/
//
@Service
//
@Slf4j
//
public class TransHelperImpl implements TransHelper {
//
//
private final
//
IUserService userService;
//
//
private final
//
AttachmentService attachmentService;
//
//
private final
//
CommentService commentService;
//
//
@Autowired
//
public TransHelperImpl(IUserService userService, AttachmentService attachmentService, CommentService commentService) {
//
this.userService = userService;
//
this.attachmentService = attachmentService;
//
this.commentService = commentService;
//
}
//
//
@Override
//
public WorkVo transToVo(Work work) {
//
User publisher = userService.findUserById(work.getPublisher());
//
User executor = userService.findUserById(work.getExecutor());
//
List<User> checkerList = userService.findUserByIds(work.getChecker());
//
List<User> followerList = userService.findUserByIds(work.getFollower());
//
List<Attachment> attachmentList = attachmentService.findAll(work.getAttachment());
//
List<Comment> commentList = commentService.findAll(work.getComment());
//
List<CommentVo> commentVoList = commentList.stream().map(this::toCommentVo).collect(Collectors.toList());
//
return new WorkVo(
//
work.getId(),
//
work.getTitle(),
//
work.getCreateTime(),
//
work.getCompleteTime(),
//
work.getUpdateTime(),
//
publisher,
//
executor,
//
checkerList,
//
followerList,
//
attachmentList,
//
commentVoList,
//
work.getContent(),
//
work.getIsFormal(),
//
work.getStatus()
//
);
//
}
//
//
@Override
//
public Work transToDataBase(WorkVo workVo) {
//
return new Work(
//
workVo.getId(),
//
workVo.getTitle(),
//
workVo.getCreateTime(),
//
workVo.getCompleteTime(),
//
workVo.getUpdateTime(),
//
workVo.getPublisher().getId(),
//
workVo.getExecutor().getId(),
//
getUserIds(workVo.getChecker()),
//
getUserIds(workVo.getFollower()),
//
getAttachmentIds(workVo.getAttachment()),
//
getCommentIds(workVo.getComment()),
//
workVo.getContent(),
//
workVo.getIsFormal(),
//
workVo.getStatus()
//
);
//
}
//
//
private List<String> getUserIds(List<User> userList) {
//
return userList.stream()
//
.map(User::getId)
//
.collect(Collectors.toList());
//
}
//
//
private List<String> getAttachmentIds(List<Attachment> attachmentList) {
//
return attachmentList.stream()
//
.map(Attachment::getId)
//
.collect(Collectors.toList());
//
}
//
//
private List<String> getCommentIds(List<CommentVo> commentVoList) {
//
return commentVoList.stream()
//
.map(CommentVo::getId)
//
.collect(Collectors.toList());
//
}
//
//
//
private CommentVo toCommentVo(Comment comment) {
//
return new CommentVo(
//
comment.getId(),
//
userService.findUserById(comment.getCommentator()),
//
comment.getCreateTime(),
//
comment.getUpdateTime(),
//
comment.getContent()
//
);
//
}
//
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
浏览文件 @
c129ad90
...
...
@@ -106,6 +106,38 @@ public class WorkServiceImpl implements WorkService {
public
void
deleteAll
()
{
}
@Override
public
void
alterTaskStatus
(
String
taskId
,
String
status
)
{
Work
ob
=
workRepository
.
findById
(
taskId
).
get
();
ob
.
setStatus
(
status
);
workRepository
.
save
(
ob
);
}
@Override
public
void
deleteWork
(
String
taskId
,
int
personalWorkload
,
int
workloadCount
)
{
Work
ob
=
workRepository
.
findById
(
taskId
).
get
();
ob
.
setPWorkload
(
personalWorkload
);
ob
.
setWorkloadCount
(
workloadCount
);
workRepository
.
save
(
ob
);
}
@Override
public
void
updateWorkCrew
(
String
taskId
,
List
<
String
>
crews
)
{
Work
ob
=
workRepository
.
findById
(
taskId
).
get
();
ob
.
setCrewList
(
crews
);
workRepository
.
save
(
ob
);
}
@Override
public
void
updateWorkload
(
String
taskId
,
int
workload
,
int
workCoefficient
)
{
Work
ob
=
workRepository
.
findById
(
taskId
).
get
();
ob
.
setWorkload
(
workload
);
ob
.
setWorkCoefficient
(
workCoefficient
);
workRepository
.
save
(
ob
);
}
// @Override
// public List<Work> selectTimeWork() {
//// LocalDateTime minTime = LocalDateTime.now().with(LocalTime.MIN).atZone(ZoneOffset.ofHours(8)).ge;
...
...
notes-job/src/main/java/com/zjty/tynotes/job/business/service/AlterTaskService.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
business
.
service
;
import
com.zjty.tynotes.job.basic.entity.request.UserRo
;
/**
* @author LJJ cnljj1995@gmail.com
* on 2019-05-22
*/
public
interface
AlterTaskService
{
void
alterTaskStatus
(
String
taskId
,
String
status
);
void
updateFlower
(
UserRo
userRo
);
void
updateChecker
(
UserRo
userRo
);
}
notes-job/src/main/java/com/zjty/tynotes/job/business/service/NoteMessageService.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
business
.
service
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.business.service.impl.NoteMessageServiceImpl
;
import
com.zjty.tynotes.job.common.Action
;
import
org.springframework.stereotype.Service
;
/**
* <p>Description : ty-note-backend
* <p>Date : 2019/5/13 10:25
* <p>@author : C
* 接口实现见
*
* @see NoteMessageServiceImpl
*/
@Service
public
interface
NoteMessageService
{
/**
* 发生使工作变化的相关操作时(新增、修改)
* 需要记录下来
* 保存操作记录(已知操作编号的情况下)
*
* @param userId 执行该次操作的用户的id
* @param workId 该次操作涉及的工作的id
* @param action 操作编号
* @param remarks 备注内容
* 操作编号详细见↓
* @see Action
*/
void
saveNoteMessage
(
String
userId
,
String
workId
,
Integer
action
,
String
remarks
);
/**
* 同上
* 保存操作记录(未知操作编号的情况下)
* (先对比新旧Work对象 判断出操作编号 再保存)
*
* @param userId 执行该次操作的用户的id
* @param workId 该次操作涉及的工作的id
* @param newWork 操作后的Work对象
* @param oldWork 原Work对象
* @param remarks 备注内容
* 操作编号详细见↓
* @see Action
*/
void
saveNoteMessage
(
String
userId
,
String
workId
,
Work
newWork
,
Work
oldWork
,
String
remarks
);
}
notes-job/src/main/java/com/zjty/tynotes/job/business/service/impl/AlterTaskStatusImpl.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
business
.
service
.
impl
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.request.UserRo
;
import
com.zjty.tynotes.job.basic.repository.WorkRepository
;
import
com.zjty.tynotes.job.business.service.AlterTaskService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Service
;
import
javax.management.Query
;
import
java.util.Optional
;
/**
* @author LJJ cnljj1995@gmail.com
* on 2019-05-22
*/
@Service
public
class
AlterTaskStatusImpl
implements
AlterTaskService
{
@Autowired
private
WorkRepository
workRepository
;
@Override
public
void
alterTaskStatus
(
String
taskId
,
String
status
)
{
Work
ob
=
workRepository
.
findById
(
taskId
).
get
();
ob
.
setStatus
(
status
);
workRepository
.
save
(
ob
);
}
@Override
public
void
updateFlower
(
UserRo
userRo
)
{
Work
ob
=
workRepository
.
findById
(
userRo
.
getWorkId
()).
get
();
ob
.
setFollower
(
userRo
.
getUsers
());
workRepository
.
save
(
ob
);
}
@Override
public
void
updateChecker
(
UserRo
userRo
)
{
Work
ob
=
workRepository
.
findById
(
userRo
.
getWorkId
()).
get
();
ob
.
setChecker
(
userRo
.
getUsers
());
workRepository
.
save
(
ob
);
}
}
notes-job/src/main/java/com/zjty/tynotes/job/business/service/impl/NoteMessageServiceImpl.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
business
.
service
.
impl
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.business.service.NoteMessageService
;
import
com.zjty.tynotes.job.common.constant.WorkStatus
;
import
com.zjty.tynotes.job.status.service.BusinessTreeManagement
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Objects
;
import
static
com
.
zjty
.
tynotes
.
job
.
common
.
Action
.*;
import
static
com
.
zjty
.
tynotes
.
job
.
common
.
constant
.
WorkStatus
.
COMMITTED
;
import
static
com
.
zjty
.
tynotes
.
job
.
common
.
constant
.
WorkStatus
.
FINISHED
;
import
static
com
.
zjty
.
tynotes
.
job
.
common
.
constant
.
WorkStatus
.
UNDERWAY
;
/**
* <p>Description : ty-note-backend
* <p>Date : 2019/5/13 13:37
* <p>@author : C
* 接口定义见
*
* @see NoteMessageService
*/
@Service
public
class
NoteMessageServiceImpl
implements
NoteMessageService
{
private
final
BusinessTreeManagement
businessTreeManagement
;
@Autowired
public
NoteMessageServiceImpl
(
BusinessTreeManagement
businessTreeManagement
)
{
this
.
businessTreeManagement
=
businessTreeManagement
;
}
@Override
public
void
saveNoteMessage
(
String
userId
,
String
workId
,
Integer
action
,
String
remarks
)
{
Boolean
remarksRequired
=
action
.
equals
(
COMMIT_WORK
)
||
action
.
equals
(
BACK_WORK
)
||
action
.
equals
(
FINISH_WORK
);
Boolean
remarksExist
=
Objects
.
nonNull
(
remarks
);
if
(
remarksRequired
&&
remarksExist
)
{
businessTreeManagement
.
saveAction
(
userId
,
workId
,
action
,
new
Date
(),
remarks
);
}
else
{
businessTreeManagement
.
saveAction
(
userId
,
workId
,
action
,
new
Date
(),
""
);
}
}
@Override
public
void
saveNoteMessage
(
String
userId
,
String
workId
,
Work
newWork
,
Work
oldWork
,
String
remarks
)
{
Integer
action
=
0
;
Boolean
publishWork
=
Objects
.
equals
(
oldWork
.
getIsFormal
(),
false
)
&&
Objects
.
equals
(
newWork
.
getIsFormal
(),
true
);
Boolean
commitWork
=
Objects
.
equals
(
oldWork
.
getStatus
(),
UNDERWAY
)
&&
Objects
.
equals
(
newWork
.
getStatus
(),
WorkStatus
.
COMMITTED
);
Boolean
backWork
=
Objects
.
equals
(
oldWork
.
getStatus
(),
COMMITTED
)
&&
Objects
.
equals
(
newWork
.
getStatus
(),
UNDERWAY
);
Boolean
finishWork
=
Objects
.
equals
(
oldWork
.
getStatus
(),
COMMITTED
)
&&
Objects
.
equals
(
newWork
.
getStatus
(),
FINISHED
);
Boolean
alterChecker
=
!
Objects
.
equals
(
oldWork
.
getChecker
(),
newWork
.
getChecker
());
Boolean
alterFollower
=
!
Objects
.
equals
(
oldWork
.
getFollower
(),
newWork
.
getFollower
());
Boolean
comment
=
!
Objects
.
equals
(
oldWork
.
getComment
(),
newWork
.
getComment
());
if
(
publishWork
)
{
action
=
PUBLISH_WORK
;
}
else
if
(
commitWork
)
{
action
=
COMMIT_WORK
;
}
else
if
(
backWork
)
{
action
=
BACK_WORK
;
}
else
if
(
finishWork
)
{
action
=
FINISH_WORK
;
}
else
if
(
alterChecker
)
{
action
=
ALTER_CHECKER
;
}
else
if
(
alterFollower
)
{
action
=
ALTER_FOLLOWER
;
}
else
if
(
comment
)
{
action
=
COMMENT
;
}
saveNoteMessage
(
userId
,
workId
,
action
,
remarks
);
}
}
notes-job/src/main/java/com/zjty/tynotes/job/common/Action.java
浏览文件 @
c129ad90
...
...
@@ -7,7 +7,7 @@ package com.zjty.tynotes.job.common;
public
interface
Action
{
/**
*
发布
者发布工作
* 者发布工作
*/
int
PUBLISH_WORK
=
1
;
...
...
@@ -17,27 +17,40 @@ public interface Action {
int
COMMIT_WORK
=
2
;
/**
*
审核者退
回工作
*
执行者撤
回工作
*/
int
BACK_WORK
=
3
;
int
COMMIT_
BACK_WORK
=
3
;
/**
* 审核者
完结
工作
* 审核者
审核不通过
工作
*/
int
FINISH
_WORK
=
4
;
int
BACK
_WORK
=
4
;
/**
*
修改审核者
*
审核者审核通过工作
*/
int
ALTER_CHECKER
=
5
;
int
FINISH_WORK
=
5
;
/**
*
修改关注者
*
删除工作
*/
int
ALTER_FOLLOWER
=
6
;
int
DELETE_WORK
=
6
;
/**
* 修改 任务组员
*/
int
UPDATE_WORK_CREW
=
7
;
/**
* 修改 工作量 以及考评系数
*/
int
UPDATE_WORKLOAD
=
8
;
/**
*
留言
*
考评任务
*/
int
COMMENT
=
7
;
int
APPRAISAL_WORD
=
9
;
}
notes-job/src/main/java/com/zjty/tynotes/job/common/constant/WorkStatus.java
浏览文件 @
c129ad90
...
...
@@ -8,19 +8,37 @@ package com.zjty.tynotes.job.common.constant;
*/
public
final
class
WorkStatus
{
/**
* 未发布
*/
public
static
final
String
UNPUBLISHED
=
"unpublished"
;
/**
* 进行中
*/
public
static
final
String
UNDERWAY
=
"underway"
;
public
static
final
String
ONGOING
=
"ongoing"
;
/**
* 待审核
*/
public
static
final
String
AUDIT
=
"audit"
;
/**
*
已提交
*
待考评
*/
public
static
final
String
COMMITTED
=
"committed"
;
public
static
final
String
REVIEW
=
"review"
;
/**
* 已完结
*/
public
static
final
String
FINISHED
=
"finished"
;
/**
* 已删除
*/
public
static
final
String
DELETE
=
"delete"
;
}
notes-job/src/main/java/com/zjty/tynotes/job/common/exception/WorkAttribution.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
common
.
exception
;
/**
* @author LJJ cnljj1995@gmail.com
* on 2019-05-09
*/
public
interface
WorkAttribution
{
/**
* 我的任务
*/
int
ME_WORK
=
1
;
/**
* 我接收的任务
*/
int
ME_RECEIVE_WORK
=
2
;
/**
* 我分解的任务
*/
int
ME_RESOLVE_WORK
=
3
;
/**
* 我发布的任务
*/
int
ME_RELEASE_WORK
=
4
;
}
notes-job/src/main/java/com/zjty/tynotes/job/status/controller/ReadController.java
→
notes-job/src/main/java/com/zjty/tynotes/job/status/controller/Read
1
Controller.java
浏览文件 @
c129ad90
...
...
@@ -2,9 +2,10 @@ package com.zjty.tynotes.job.status.controller;
import
com.zjty.tynotes.job.status.entity.BouncedMessage
;
import
com.zjty.tynotes.job.status.entity.EsListSum
;
import
com.zjty.tynotes.job.status.entity.EventTitle
;
import
com.zjty.tynotes.job.status.service.EventService
;
import
com.zjty.tynotes.job.status.service.PrivateService
;
import
com.zjty.tynotes.job.status.service.WorkShowSeeService
;
import
com.zjty.tynotes.job.status.service.WorkShowService
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -18,7 +19,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* @author zjm
...
...
@@ -27,18 +27,18 @@ import java.util.List;
@RestController
@RequestMapping
(
"/read"
)
@Api
(
tags
=
"阅读页面接口"
,
value
=
"阅读页面数据"
)
public
class
ReadController
{
public
class
Read
1
Controller
{
@Autowired
EventService
event
Service
;
WorkShowSeeService
workShowSee
Service
;
@Autowired
PrivateService
private
Service
;
WorkShowService
workShow
Service
;
/**
*阅读页面
待审核
列表
*阅读页面
我的任务
列表
* @param page 页码 默认1
* @param size 每页显示条数 默认10
* @param id 人员id
*/
@PostMapping
(
"/select
Commission
"
)
@PostMapping
(
"/select
MeWork
"
)
@ApiOperation
(
value
=
"获取阅读页面待审核列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"人员id"
,
dataType
=
"string"
,
paramType
=
"query"
,
required
=
true
),
...
...
@@ -46,8 +46,8 @@ public class ReadController {
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页显示条数"
,
dataType
=
"int"
,
paramType
=
"query"
,
example
=
"10"
)
})
public
ResponseEntity
<
EsListSum
>
selectCommission
(
@RequestParam
(
value
=
"id"
)
String
id
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
){
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
){
int
pageSize
;
if
(
page
==
0
){
...
...
@@ -56,16 +56,16 @@ public class ReadController {
pageSize
=
page
-
1
;
}
return
ResponseEntity
.
ok
(
privateService
.
selectCommission
(
id
,
pageSize
,
size
));
return
ResponseEntity
.
ok
(
workShowSeeService
.
selectMeWork
(
id
,
pageSize
,
size
));
}
/**
*阅读页面
已提交
列表
*阅读页面
我接收的任务
列表
* @param page 页码 默认1
* @param size 每页显示条数 默认10
* @param id 人员id
*/
@PostMapping
(
"/select
Submit
"
)
@PostMapping
(
"/select
MeReceiv
"
)
@ApiOperation
(
value
=
"获取阅读页面已提交列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"人员id"
,
dataType
=
"string"
,
paramType
=
"query"
,
required
=
true
),
...
...
@@ -83,23 +83,23 @@ public class ReadController {
pageSize
=
page
-
1
;
}
return
ResponseEntity
.
ok
(
privateService
.
selectSubmit
(
id
,
pageSize
,
size
));
return
ResponseEntity
.
ok
(
workShowSeeService
.
selectMeReceiveWork
(
id
,
pageSize
,
size
));
}
/**
*阅读页面
其他
列表
*阅读页面
我的分解任务
列表
* @param page 页码 默认1
* @param size 每页显示条数 默认10
* @param id 人员id
*/
@PostMapping
(
"/select
Other
"
)
@ApiOperation
(
value
=
"
获取阅读页面其他
列表"
)
@PostMapping
(
"/select
MeResolve
"
)
@ApiOperation
(
value
=
"
阅读页面我的分解任务
列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"人员id"
,
dataType
=
"string"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
"query"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页显示条数"
,
dataType
=
"int"
,
paramType
=
"query"
,
example
=
"10"
)
})
public
ResponseEntity
<
EsListSum
>
select
Other
(
@RequestParam
(
value
=
"id"
)
String
id
,
public
ResponseEntity
<
EsListSum
>
select
MeResolveWork
(
@RequestParam
(
value
=
"id"
)
String
id
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
){
...
...
@@ -109,25 +109,25 @@ public class ReadController {
}
else
{
pageSize
=
page
-
1
;
}
return
ResponseEntity
.
ok
(
privateService
.
selectOther
(
id
,
pageSize
,
size
));
return
ResponseEntity
.
ok
(
workShowSeeService
.
selectMeResolveWork
(
id
,
pageSize
,
size
));
}
/**
*阅读页面
收藏
列表
*阅读页面
我发布的任务
列表
* @param page 页码 默认1
* @param size 每页显示条数 默认10
* @param id 人员id
*/
@PostMapping
(
"/select
Collection
"
)
@ApiOperation
(
value
=
"
获取阅读页面收藏
列表"
)
@PostMapping
(
"/select
MeRelease
"
)
@ApiOperation
(
value
=
"
阅读页面我发布的任务
列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"人员id"
,
dataType
=
"string"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
"query"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页显示条数"
,
dataType
=
"int"
,
paramType
=
"query"
,
example
=
"10"
)
})
public
ResponseEntity
<
EsListSum
>
select
Collection
(
@RequestParam
(
value
=
"id"
)
String
id
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
){
public
ResponseEntity
<
EsListSum
>
select
MeReleaseWork
(
@RequestParam
(
value
=
"id"
)
String
id
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
){
int
pageSize
;
if
(
page
==
0
){
...
...
@@ -135,7 +135,7 @@ public class ReadController {
}
else
{
pageSize
=
page
-
1
;
}
return
ResponseEntity
.
ok
(
privateService
.
selectCollection
(
id
,
pageSize
,
size
));
return
ResponseEntity
.
ok
(
workShowSeeService
.
selectMeReleaseWork
(
id
,
pageSize
,
size
));
}
/**
...
...
@@ -163,28 +163,11 @@ public class ReadController {
}
else
{
pageSize
=
page
-
1
;
}
return
ResponseEntity
.
ok
(
privat
eService
.
titleSelect
(
id
,
pageSize
,
size
,
title
));
return
ResponseEntity
.
ok
(
workShowSe
eService
.
titleSelect
(
id
,
pageSize
,
size
,
title
));
}
/**
*阅读页设置收藏
* @param eventId 事件id
* @param id 人员id
*/
@ApiOperation
(
value
=
"事件置顶"
)
@PostMapping
(
"/collection"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"人员id"
,
dataType
=
"String"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件id"
,
dataType
=
"String"
,
paramType
=
"query"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"collection"
,
value
=
"是否收藏"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
,
example
=
"1"
)
})
public
ResponseEntity
<
BouncedMessage
>
collection
(
@RequestParam
(
value
=
"id"
)
String
id
,
@RequestParam
(
value
=
"eventId"
)
String
eventId
,
@RequestParam
(
value
=
"collection"
)
int
collection
){
return
ResponseEntity
.
ok
(
eventService
.
placedCollection
(
eventId
,
id
,
collection
));
}
/**
* 查看事件的时候
...
...
@@ -205,7 +188,7 @@ public class ReadController {
@RequestParam
(
value
=
"eventId"
)
String
eventId
,
@RequestParam
(
value
=
"readState"
)
int
readState
){
event
Service
.
readsStatus
(
id
,
eventId
,
readState
);
workShow
Service
.
readsStatus
(
id
,
eventId
,
readState
);
HashMap
map
=
new
HashMap
(
10
);
map
.
put
(
"msg"
,
"事件状态修改成功"
);
return
ResponseEntity
.
ok
(
map
);
...
...
@@ -220,7 +203,7 @@ public class ReadController {
public
ResponseEntity
loginFirstOneManualPush
(
@RequestParam
(
value
=
"id"
)
String
id
){
privat
eService
.
loginFirstOneManualPush
(
id
);
workShowSe
eService
.
loginFirstOneManualPush
(
id
);
return
ResponseEntity
.
ok
().
build
();
}
...
...
notes-job/src/main/java/com/zjty/tynotes/job/status/controller/TaskController.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
status
.
controller
;
import
com.zjty.tynotes.job.common.constant.WorkStatus
;
import
com.zjty.tynotes.job.status.service.EventService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
/**
* @author zjm
*/
@RequestMapping
(
"/read"
)
@RestController
@Slf4j
public
class
TaskController
{
@Autowired
EventService
eventService
;
@GetMapping
(
"/task/{id}/{id1}/{id2}/{id3}"
)
public
void
task
(
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
"id1"
)
String
id1
,
@PathVariable
(
"id2"
)
String
id2
,
@PathVariable
(
"id3"
)
String
id3
){
log
.
info
(
"开始"
);
Map
<
Integer
,
List
<
String
>>
map
=
new
HashMap
<>();
List
<
String
>
s
=
new
ArrayList
<>();
List
<
String
>
f1
=
new
ArrayList
<>();
f1
.
add
(
id
);
List
<
String
>
z
=
new
ArrayList
<>();
z
.
add
(
id1
);
s
.
add
(
id2
);
List
<
String
>
g
=
new
ArrayList
<>();
g
.
add
(
id3
);
map
.
put
(
1
,
s
);
map
.
put
(
0
,
g
);
Map
<
String
,
List
<
String
>>
map1
=
new
HashMap
<>();
map1
.
put
(
"inspector"
,
s
);
map1
.
put
(
"viewer"
,
g
);
map1
.
put
(
"executor"
,
z
);
map1
.
put
(
"publisher"
,
f1
);
eventService
.
saveTakePushEvent
(
"test1"
,
"第一次"
,
id
,
id1
,
map
,
new
Date
(),
WorkStatus
.
UNDERWAY
,
map1
,
"添加新的事件"
);
eventService
.
saveTakePushEvent
(
"test2"
,
"第2次"
,
id
,
id1
,
map
,
new
Date
(),
WorkStatus
.
UNDERWAY
,
map1
,
"添加新的事件"
);
eventService
.
saveTakePushEvent
(
"test3"
,
"第3次"
,
id
,
id1
,
map
,
new
Date
(),
WorkStatus
.
UNDERWAY
,
map1
,
"添加新的事件"
);
eventService
.
saveTakePushEvent
(
"test4"
,
"第4次"
,
id
,
id1
,
map
,
new
Date
(),
WorkStatus
.
UNDERWAY
,
map1
,
"添加新的事件"
);
}
@GetMapping
(
"/task1"
)
public
void
task1
(){
eventService
.
readsStatus
(
"z"
,
"test1"
,
1
);
eventService
.
readsStatus
(
"z"
,
"test2"
,
1
);
eventService
.
readsStatus
(
"f"
,
"test1"
,
1
);
eventService
.
readsStatus
(
"f"
,
"test2"
,
1
);
}
@GetMapping
(
"/task2"
)
public
void
task2
(){
Set
<
String
>
s
=
new
HashSet
<>();
s
.
add
(
"s1"
);
s
.
add
(
"s2"
);
s
.
add
(
"g1"
);
s
.
add
(
"g2"
);
s
.
add
(
"z"
);
eventService
.
addMessage
(
"f"
,
"test1"
,
s
,
new
Date
(),
1
,
"f对test1时间留言"
);
eventService
.
addMessage
(
"f"
,
"test2"
,
s
,
new
Date
(),
1
,
"f对test2时间留言"
);
}
@GetMapping
(
"/task3"
)
public
void
task3
(){
Set
<
String
>
s
=
new
HashSet
<>();
s
.
add
(
"s1"
);
s
.
add
(
"s2"
);
s
.
add
(
"g1"
);
s
.
add
(
"g2"
);
s
.
add
(
"z"
);
eventService
.
upDateStateEvent
(
"test1"
,
"f"
,
s
,
new
Date
(),
WorkStatus
.
UNDERWAY
,
"f修改了事件状态"
);
eventService
.
upDateStateEvent
(
"test2"
,
"f"
,
s
,
new
Date
(),
WorkStatus
.
UNDERWAY
,
"f修改了事件状态"
);
}
@GetMapping
(
"/task4"
)
public
void
task4
(){
List
<
String
>
s
=
new
ArrayList
<>();
List
<
String
>
f1
=
new
ArrayList
<>();
f1
.
add
(
"f"
);
List
<
String
>
z
=
new
ArrayList
<>();
z
.
add
(
"z"
);
s
.
add
(
"s1"
);
s
.
add
(
"s3"
);
List
<
String
>
g
=
new
ArrayList
<>();
g
.
add
(
"g1"
);
g
.
add
(
"g3"
);
Map
<
String
,
List
<
String
>>
map1
=
new
HashMap
<>();
map1
.
put
(
"inspector"
,
s
);
map1
.
put
(
"viewer"
,
g
);
map1
.
put
(
"executor"
,
z
);
map1
.
put
(
"publisher"
,
f1
);
Set
<
String
>
s1
=
new
HashSet
<>();
s1
.
add
(
"s1"
);
s1
.
add
(
"s2"
);
s1
.
add
(
"g1"
);
s1
.
add
(
"g2"
);
s1
.
add
(
"z"
);
eventService
.
addFollowersEvent
(
"f"
,
"test1"
,
s1
,
"第一次"
,
new
Date
(),
1
,
WorkStatus
.
UNDERWAY
,
map1
,
"修改事件"
);
//eventService.addFollowersEvent("test2","第2次",new Date(),1,"q",0,1);
}
}
notes-job/src/main/java/com/zjty/tynotes/job/status/entity/EsListSum.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
entity
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
...
...
@@ -9,33 +13,14 @@ import java.util.List;
* @author zjm
*/
@ApiModel
(
value
=
"EsListSum对象"
,
description
=
"提供数据列表和总数"
)
@AutoDocument
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
EsListSum
{
@ApiModelProperty
(
value
=
"总数"
,
name
=
"count"
,
example
=
"0L"
)
private
Long
count
;
@ApiModelProperty
(
value
=
"数据列表"
,
name
=
"eventTitles"
)
private
List
<
EventTitle
>
eventTitles
;
private
List
<
RedisPersonalWork
>
eventTitles
;
public
EsListSum
(
Long
count
,
List
<
EventTitle
>
eventTitles
)
{
this
.
count
=
count
;
this
.
eventTitles
=
eventTitles
;
}
public
EsListSum
()
{
}
public
Long
getCount
()
{
return
count
;
}
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
public
List
<
EventTitle
>
getEventTitles
()
{
return
eventTitles
;
}
public
void
setEventTitles
(
List
<
EventTitle
>
eventTitles
)
{
this
.
eventTitles
=
eventTitles
;
}
}
notes-job/src/main/java/com/zjty/tynotes/job/status/entity/Personnel.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
entity
;
public
class
Personnel
{
}
notes-job/src/main/java/com/zjty/tynotes/job/status/entity/RedisPersonalWork.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
entity
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@AutoDocument
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
""
)
public
class
RedisPersonalWork
{
/**
* 任务id
*/
@ApiModelProperty
(
value
=
"任务id"
,
name
=
"workId"
,
example
=
"3y8735217537c"
)
private
String
workId
;
/**
*任务标题
*/
@ApiModelProperty
(
value
=
"任务标题"
,
name
=
"title"
,
example
=
"xxx"
)
private
String
title
;
/**
* 任务状态
*/
@ApiModelProperty
(
value
=
"任务状态"
,
name
=
"status"
,
example
=
"进行中"
)
private
String
status
;
/**
* 发布者
*/
@ApiModelProperty
(
value
=
"发布者"
,
name
=
"release"
,
example
=
"xx"
)
private
String
release
;
/**
* 执行者
*/
@ApiModelProperty
(
value
=
"执行者"
,
name
=
"executor"
,
example
=
"xxx"
)
private
String
executor
;
/**
* 已读未读
*/
@ApiModelProperty
(
value
=
"是否已读(0已读,1未读)"
,
name
=
"readState"
,
example
=
"1"
)
private
int
readState
;
/**
* 任务所属位置 我的任务 我接受的任务
*/
@ApiModelProperty
(
value
=
"任务所属位置"
,
name
=
"workAttribution"
,
example
=
"1"
)
private
int
workAttribution
;
/**
* 最近的操作
*/
@ApiModelProperty
(
value
=
"最近一次的操作"
,
name
=
"latestNews"
,
example
=
"root留言"
)
private
String
latestNews
;
/**
* 上级任务id
*/
@ApiModelProperty
(
value
=
"上级任务id"
,
name
=
"superiorId"
,
example
=
"root留言"
)
private
String
superiorId
;
}
notes-job/src/main/java/com/zjty/tynotes/job/status/entity/RoleSum.java
浏览文件 @
c129ad90
...
...
@@ -13,34 +13,44 @@ import lombok.NoArgsConstructor;
public
class
RoleSum
{
/**
*
代办
是否有未读 0 否 1有
*
我的任务
是否有未读 0 否 1有
*/
private
int
commission
Unread
;
private
int
meWork
Unread
;
/**
*
代办
条数
*
我的任务
条数
*/
private
int
commission
Count
;
private
int
meWork
Count
;
/**
*
提交
是否有未读 0 否 1有
*
我接收的任务
是否有未读 0 否 1有
*/
private
int
submit
Unread
;
private
int
meReceive
Unread
;
/**
*
提交
条数
*
我接收的任务
条数
*/
private
int
submit
Count
;
private
int
meReceive
Count
;
/**
*
其他
是否有未读 0 否 1有
*
我分解的任务
是否有未读 0 否 1有
*/
private
int
other
Unread
;
private
int
meResolve
Unread
;
/**
*
其他
条数
*
我分解的任务
条数
*/
private
int
otherCount
;
private
int
meResolveCount
;
/**
* 我发布的任务 是否有未读 0 否 1有
*/
private
int
meReleaseUnread
;
/**
* 我发布的任务 条数
*/
private
int
meReleaseCount
;
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/EventService.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
import
com.zjty.tynotes.job.status.entity.BouncedMessage
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @author zjm
*/
public
interface
EventService
{
/**
* 添加数据到redis(分别安人员id来进行) ->取出数据->推送数据
* @param eventId 事件id
* @param eventTitle 事件标题
* @param id 发布者
* @param map 3种角色的id集合
* @param updateTime 更新时间
* @param state 事件状态
* @param executorId 执行人id
* @param mapName 执行人名称
* @param latestNews 对任务的操作
*
*/
void
saveTakePushEvent
(
String
eventId
,
String
eventTitle
,
String
id
,
String
executorId
,
Map
<
Integer
,
List
<
String
>>
map
,
Date
updateTime
,
String
state
,
Map
<
String
,
List
<
String
>>
mapName
,
String
latestNews
);
/**
*新留言
* @param id 留言人的Id
* @param eventId 事件id
* @param ids 推送人员的id(相关人员id)
* @param updateTime 更新时间
* @param messageCount 留言条数
* @param latestNews 对任务的操作
*/
void
addMessage
(
String
id
,
String
eventId
,
Set
<
String
>
ids
,
Date
updateTime
,
int
messageCount
,
String
latestNews
);
/**
* 更新事件的状态
* @param eventId 事件id
* @param id 操作者id
* @param ids 推送人员的id(相关人员id)
* @param updateTime 更新时间
* @param state 事件状态
* @param latestNews 对任务的操作
*/
void
upDateStateEvent
(
String
eventId
,
String
id
,
Set
<
String
>
ids
,
Date
updateTime
,
String
state
,
String
latestNews
);
/**
* 添加审核 - 关注者
* @param operationId 操作者id
* @param eventId 事件id
* @param ids 事件相关人员id
* @param eventTitle 事件标题
* @param updateTime 更新时间
* @param messageCount 留言条数
* @param state 事件的状态
* @param mapName 执行人名称
* @param latestNews 最近的一次对任务的操作
*/
void
addFollowersEvent
(
String
operationId
,
String
eventId
,
Set
<
String
>
ids
,
String
eventTitle
,
Date
updateTime
,
int
messageCount
,
String
state
,
Map
<
String
,
List
<
String
>>
mapName
,
String
latestNews
);
/**
* 设置收藏 和取消收藏
* @param eventId 事件id
* @param id 人员id
* @param collection 是否收藏
* @return 操作状态
*/
BouncedMessage
placedCollection
(
String
eventId
,
String
id
,
int
collection
);
/**
* 查看事件的时候
* @param id 人员id
* @param eventId 事件id
* @param readState 是否阅读过 判读是否阅读过 否修改 阅读状态
*/
void
readsStatus
(
String
id
,
String
eventId
,
int
readState
);
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/InternalService.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
public
interface
InternalService
{
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/Take.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
import
com.zjty.tynotes.job.common.constant.WorkStatus
;
import
com.zjty.tynotes.job.status.entity.RoleSum
;
import
com.zjty.tynotes.job.status.utils.JacksonUtil
;
import
com.zjty.tynotes.sms.service.MessageTemplateService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
java.util.*
;
/**
* @author zjm
*/
@Service
@Slf4j
public
class
Take
{
@Autowired
MessageTemplateService
messageTemplateService
;
@Autowired
EventService
eventService
;
// @Scheduled(cron = "40 * * * * ? ")
public
void
task
(){
Random
random
=
new
Random
();
RoleSum
roleSum
=
new
RoleSum
(
random
.
ints
(
0
,
2
).
findFirst
().
getAsInt
(),
random
.
ints
(
1
,
10
).
findFirst
().
getAsInt
(),
random
.
ints
(
0
,
2
).
findFirst
().
getAsInt
(),
random
.
ints
(
1
,
10
).
findFirst
().
getAsInt
(),
random
.
ints
(
0
,
2
).
findFirst
().
getAsInt
(),
random
.
ints
(
1
,
10
).
findFirst
().
getAsInt
());
messageTemplateService
.
beingPushed
(
"root"
,
"/topic/event"
,
JacksonUtil
.
toJSon
(
roleSum
));
}
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/
Privat
eService.java
→
notes-job/src/main/java/com/zjty/tynotes/job/status/service/
WorkShowSe
eService.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
import
com.zjty.tynotes.job.status.entity.EsListSum
;
import
com.zjty.tynotes.job.status.entity.EventTitle
;
import
java.util.List
;
/**
* @author zjm
*/
public
interface
PrivateService
{
public
interface
WorkShowSeeService
{
/**
* 代办事件查询
*
* @param id 人员id
* @param page 页码
* @param size 每页显示的条数
* @return 事件对象集合
* 根据人员id查看我的任务列表
* @param id
* @param page
* @param size
* @return
*/
EsListSum
selectCommission
(
String
id
,
int
page
,
int
size
);
EsListSum
selectMeWork
(
String
id
,
int
page
,
int
size
);
/**
* 已提交事件查询
*
* @param id 人员id
* @param page 页码
* @param size 每页显示的条数
* @return 事件对象集合
* 根据人员id查看我接收的任务列表
* @param id
* @param page
* @param size
* @return
*/
EsListSum
selectSubmit
(
String
id
,
int
page
,
int
size
);
EsListSum
selectMeReceiveWork
(
String
id
,
int
page
,
int
size
);
/**
* 其他事件查询
*
* @param id 人员id
* @param page 页码
* @param size 每页显示的条数
* @return 事件对象集合
*根据人员id查看我分解的任务列表
* @param id
* @param page
* @param size
* @return
*/
EsListSum
selectOther
(
String
id
,
int
page
,
int
size
);
EsListSum
selectMeResolveWork
(
String
id
,
int
page
,
int
size
);
/**
* 收藏事件
*
* @param id 人员id
* @param page 页码
* @param size 每页显示的条数
* @return 给前端对象集合 和条数
*根据人员id查看我发布的任务列表
* @param id
* @param page
* @param size
* @return
*/
EsListSum
select
Collection
(
String
id
,
int
page
,
int
size
);
EsListSum
select
MeReleaseWork
(
String
id
,
int
page
,
int
size
);
/**
* 标题查询
...
...
@@ -67,4 +57,5 @@ public interface PrivateService {
* @param id 人员id
*/
void
loginFirstOneManualPush
(
String
id
);
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/WorkShowService.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
java.util.List
;
public
interface
WorkShowService
{
/**
* 任务新增 操作人 最近一次操作 看到人员id work 对象
*/
void
saveTakePushWork
(
String
executorId
,
String
latestNews
,
List
<
String
>
userIds
,
Work
work
);
/**
* 修改任务 操作人 最近一次操作 看到人员id
*/
void
updateWorkStatus
(
String
executorId
,
String
latestNews
,
List
<
String
>
userIds
,
String
status
,
String
workId
);
/**
* 修改任务 常用
* @param executorId 操作人id
* @param latestNews 最近操作
* @param userIds 所有人员集合
* @param workId 任务id
*/
void
upDateWork
(
String
executorId
,
String
latestNews
,
List
<
String
>
userIds
,
String
workId
);
/**
* 查看事件的时候
* @param id 人员id
* @param eventId 事件id
* @param readState 是否阅读过 判读是否阅读过 否修改 阅读状态
*/
void
readsStatus
(
String
id
,
String
eventId
,
int
readState
);
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/BusinessTreeManagementImpl.java
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
.
impl
;
import
com.zjty.tynotes.job.basic.entity.database.ScoreCoefficient
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.repository.ScoreCoefficientRepository
;
import
com.zjty.tynotes.job.basic.service.WorkService
;
import
com.zjty.tynotes.job.status.entity.ActionHistory
;
import
com.zjty.tynotes.job.status.entity.NoteResource
;
...
...
@@ -12,6 +14,7 @@ import com.zjty.tynotes.pas.service.impl.UserServiceImpl;
import
com.zjty.tynotes.search.subject.service.EsUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
...
...
@@ -33,6 +36,9 @@ public class BusinessTreeManagementImpl implements BusinessTreeManagement {
@Autowired
private
IUserService
iUserService
;
@Autowired
ScoreCoefficientRepository
scoreCoefficientRepository
;
@Autowired
private
ActionHistoryRepository
actionHistoryRepository
;
...
...
@@ -49,25 +55,8 @@ public class BusinessTreeManagementImpl implements BusinessTreeManagement {
Work
work
=
workService
.
findById
(
noteResource
.
getTaskId
());
String
status
=
work
.
getStatus
();
String
name
=
iUserService
.
findUserById
(
noteResource
.
getId
()).
getUsername
();
List
<
String
>
publisher
=
new
ArrayList
<>();
publisher
.
add
(
work
.
getPublisher
());
List
<
String
>
executor
=
new
ArrayList
<>();
executor
.
add
(
work
.
getExecutor
());
String
name
=
iUserService
.
findUserById
(
noteResource
.
getId
()).
getName
();
Map
<
String
,
List
<
String
>>
nameMap
=
new
HashMap
<>(
4
);
nameMap
.
put
(
"publisher"
,
publisher
);
nameMap
.
put
(
"executor"
,
executor
);
nameMap
.
put
(
"inspector"
,
work
.
getChecker
());
nameMap
.
put
(
"viewer"
,
work
.
getFollower
());
Set
<
String
>
setRs
=
new
HashSet
<>();
setRs
.
add
(
work
.
getPublisher
());
setRs
.
add
(
work
.
getExecutor
());
setRs
.
addAll
(
work
.
getFollower
());
setRs
.
addAll
(
work
.
getChecker
());
setRs
.
remove
(
noteResource
.
getId
());
ActionHistory
actionHistory
=
new
ActionHistory
();
...
...
@@ -77,106 +66,86 @@ public class BusinessTreeManagementImpl implements BusinessTreeManagement {
actionHistory
.
setTaskId
(
noteResource
.
getTaskId
());
// * 1 -> 执行人发布任务
// * 2 -> 执行人提交任务
// * 3 -> 审核人退回已提交任务
// * 4 -> 审核人完结任务
// * 5 -> 修改审核人
// * 6 -> 修改关注人
// * 7 -> 对事件留言
int
UPDATE_WORKLOAD
=
8
;
// * 1 -> 发布者发布任务
// * 2 -> 执行者提交任务
// * 3 -> 执行者撤回工作
// * 4 -> 审核审核不通过任务驳回
// * 5 -> 审核者审核通过
// * 6 -> 删除工作
// * 7 -> 修改 任务组员
// * 8 -> 修改 工作量 以及考评系数
switch
(
noteResource
.
getAction
())
{
case
1
:
Map
<
Integer
,
List
<
String
>>
map
=
new
HashMap
<>(
2
);
map
.
put
(
1
,
work
.
getChecker
());
map
.
put
(
0
,
work
.
getFollower
());
eventService
.
saveTakePushEvent
(
work
.
getId
(),
work
.
getTitle
(),
work
.
getPublisher
(),
work
.
getExecutor
(),
map
,
work
.
getUpdateTime
(),
status
,
nameMap
,
name
+
"新建了任务"
);
actionHistory
.
setActionMsg
(
name
+
"新建了任务"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}新建任务,执行人id是{}"
,
name
,
work
.
getPublisher
());
break
;
case
2
:
eventService
.
upDateStateEvent
(
work
.
getId
(),
noteResource
.
getId
(),
setRs
,
work
.
getUpdateTime
()
,
status
,
name
+
"提交了任务"
);
actionHistory
.
setActionMsg
(
name
+
"提交了任务"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}提交了任务"
,
name
);
break
;
case
3
:
eventService
.
upDateStateEvent
(
work
.
getId
(),
noteResource
.
getId
(),
setRs
,
noteResource
.
getDate
(),
status
,
name
+
"退回了提交事件"
);
actionHistory
.
setActionMsg
(
name
+
"退回了提交事件"
);
actionHistory
.
setActionMsg
(
name
+
"撤回了任务"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}退回了任务"
,
name
);
break
;
case
4
:
eventService
.
upDateStateEvent
(
work
.
getId
(),
noteResource
.
getId
(),
setRs
,
noteResource
.
getDate
(),
status
,
name
+
"完结了任务"
);
actionHistory
.
setActionMsg
(
name
+
"完结了任务"
);
actionHistory
.
setActionMsg
(
name
+
"审核任务不通过"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}完结了任务"
,
name
);
break
;
case
5
:
eventService
.
addFollowersEvent
(
noteResource
.
getId
(),
work
.
getId
(),
setRs
,
work
.
getTitle
(),
noteResource
.
getDate
(),
work
.
getComment
().
size
(),
status
,
nameMap
,
name
+
"修改了审核人"
);
actionHistory
.
setActionMsg
(
name
+
"修改了审核人"
);
actionHistory
.
setActionMsg
(
name
+
"审核任务通过"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}修改了审核人"
,
name
);
break
;
case
6
:
eventService
.
addFollowersEvent
(
noteResource
.
getId
(),
work
.
getId
(),
setRs
,
work
.
getTitle
(),
noteResource
.
getDate
(),
work
.
getComment
().
size
(),
status
,
nameMap
,
name
+
"修改了关注人"
);
actionHistory
.
setActionMsg
(
name
+
"修改了关注人"
);
actionHistory
.
setActionMsg
(
name
+
"删除任务"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}修改了关注者"
,
name
);
break
;
case
7
:
eventService
.
addMessage
(
noteResource
.
getId
(),
work
.
getId
(),
setRs
,
noteResource
.
getDate
(),
work
.
getComment
().
size
(),
name
+
"对任务留言了"
);
actionHistory
.
setActionMsg
(
name
+
"
对任务留言了
"
);
actionHistory
.
setActionMsg
(
name
+
"修改了任务的组员"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}对任务留言了"
,
name
);
break
;
case
8
:
actionHistory
.
setActionMsg
(
name
+
"
修改了任务的工作量和考评系数
"
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}对任务留言了"
,
name
);
break
;
case
9
:
ScoreCoefficient
scoreCoefficient
=
scoreCoefficientRepository
.
findById
(
noteResource
.
getTaskId
()).
get
();
String
actionMsg
=
""
;
if
(
scoreCoefficient
.
getScore1
()!=
null
){
actionMsg
=
name
+
"对任务进行了自我评价"
;
}
else
if
(
scoreCoefficient
.
getScore2
()!=
null
){
actionMsg
=
name
+
"对任务进行了发布者评价"
;
}
else
if
(
scoreCoefficient
.
getScore3
()!=
null
){
actionMsg
=
name
+
"对任务进行了最终评价"
;
}
actionHistory
.
setActionMsg
(
actionMsg
);
actionHistoryRepository
.
save
(
actionHistory
);
log
.
info
(
"[TREE] {}对任务评价了"
,
name
);
break
;
default
:
log
.
warn
(
"[es] 状态处理模块传入参数有误"
);
break
;
...
...
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/EventServiceImpl.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
差异被折叠。
点击展开。
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/InternalServiceImpl.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
.
impl
;
public
class
InternalServiceImpl
{
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/PrivateServiceImpl.java
deleted
100644 → 0
浏览文件 @
c00cc5c0
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
.
impl
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.zjty.tynotes.job.common.Constants
;
import
com.zjty.tynotes.job.common.constant.WorkStatus
;
import
com.zjty.tynotes.job.status.entity.EsListSum
;
import
com.zjty.tynotes.job.status.entity.EventTitle
;
import
com.zjty.tynotes.job.status.entity.RoleSum
;
import
com.zjty.tynotes.job.status.service.PrivateService
;
import
com.zjty.tynotes.job.status.utils.JacksonUtil
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
com.zjty.tynotes.search.subject.entity.CollectionRs
;
import
com.zjty.tynotes.search.subject.entity.EsSearchArg
;
import
com.zjty.tynotes.search.subject.service.EsUtil
;
import
com.zjty.tynotes.sms.service.MessageTemplateService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author zjm
*/
@Service
@Slf4j
public
class
PrivateServiceImpl
implements
PrivateService
{
@Autowired
EsUtil
esUtil
;
@Autowired
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Autowired
MessageTemplateService
messageTemplateService
;
@Autowired
IUserService
iUserService
;
@Override
public
EsListSum
selectCommission
(
String
id
,
int
page
,
int
size
)
{
CollectionRs
collection
=
esUtil
.
getPresentTask
(
id
,
new
EsSearchArg
.
Builder
().
page
(
page
).
size
(
size
).
build
());
List
<
Object
>
objectList
=
redisTemplate
.
opsForList
().
range
(
Constants
.
REDIS_EVENT
+
id
,
0
,-
1
);
assert
objectList
!=
null
;
List
<
EventTitle
>
list
=
redisToEs
(
objectList
,
collection
.
getSource
());
list
.
sort
(
Comparator
.
comparing
(
EventTitle:
:
getUpdateTime
).
reversed
());
return
new
EsListSum
(
collection
.
getTotal
(),
list
);
// JacksonUtil.readValue(s, new TypeReference<List<EventTitle>>() {
// });
}
@Override
public
EsListSum
selectSubmit
(
String
id
,
int
page
,
int
size
)
{
List
<
Object
>
objectList
=
redisTemplate
.
opsForList
().
range
(
Constants
.
REDIS_EVENT
+
id
,
0
,-
1
);
CollectionRs
collection
=
esUtil
.
getApplyTask
(
id
,
new
EsSearchArg
.
Builder
().
page
(
page
).
size
(
size
).
build
());
assert
objectList
!=
null
;
List
<
EventTitle
>
list
=
redisToEs
(
objectList
,
collection
.
getSource
());
list
.
sort
(
Comparator
.
comparing
(
EventTitle:
:
getUpdateTime
).
reversed
());
return
new
EsListSum
(
collection
.
getTotal
(),
list
);
}
@Override
public
EsListSum
selectOther
(
String
id
,
int
page
,
int
size
)
{
List
<
Object
>
objectList
=
redisTemplate
.
opsForList
().
range
(
Constants
.
REDIS_EVENT
+
id
,
0
,-
1
);
CollectionRs
collection
=
esUtil
.
getContactTask
(
id
,
new
EsSearchArg
.
Builder
().
page
(
page
).
size
(
size
).
build
());
assert
objectList
!=
null
;
List
<
EventTitle
>
list
=
redisToEs
(
objectList
,
collection
.
getSource
());
list
.
sort
(
Comparator
.
comparing
(
EventTitle:
:
getUpdateTime
).
reversed
());
return
new
EsListSum
(
collection
.
getTotal
(),
list
);
}
@Override
public
EsListSum
selectCollection
(
String
id
,
int
page
,
int
size
)
{
CollectionRs
collection
=
esUtil
.
getCollection
(
id
,
page
,
size
);
String
s
=
JacksonUtil
.
toJSon
(
collection
.
getSource
());
List
<
EventTitle
>
eventTitles
=
JacksonUtil
.
readValue
(
s
,
new
TypeReference
<
List
<
EventTitle
>>()
{
});
assert
eventTitles
!=
null
;
eventTitles
.
sort
(
Comparator
.
comparing
(
EventTitle:
:
getUpdateTime
).
reversed
());
return
new
EsListSum
(
collection
.
getTotal
(),
eventTitles
);
}
@Override
public
EsListSum
titleSelect
(
String
id
,
int
page
,
int
size
,
String
title
)
{
CollectionRs
collection
=
esUtil
.
getTaskByTitle
(
id
,
title
,
page
,
size
);
String
s
=
JacksonUtil
.
toJSon
(
collection
.
getSource
());
List
<
EventTitle
>
eventTitles
=
JacksonUtil
.
readValue
(
s
,
new
TypeReference
<
List
<
EventTitle
>>()
{
});
assert
eventTitles
!=
null
;
eventTitles
.
sort
(
Comparator
.
comparing
(
EventTitle:
:
getUpdateTime
).
reversed
());
return
new
EsListSum
(
collection
.
getTotal
(),
eventTitles
);
}
@Override
public
void
loginFirstOneManualPush
(
String
id
)
{
log
.
info
(
"redis :{}"
,
Constants
.
REDIS_EVENT
);
List
<
Object
>
list
=
redisTemplate
.
opsForList
().
range
(
Constants
.
REDIS_EVENT
+
id
,
0
,-
1
);
assert
list
!=
null
;
RoleSum
roleSum
=
statisticalRoleCount
(
list
);
String
receive
=
iUserService
.
findUserById
(
id
).
getUsername
();
log
.
info
(
"{}调用了id查询的接口"
,
receive
);
if
(
receive
!=
null
)
{
messageTemplateService
.
beingPushed
(
receive
,
"/topic/note"
,
JacksonUtil
.
toJSon
(
roleSum
));
}
else
{
log
.
info
(
"{}数据库查询不到,请尝试"
,
id
);
}
}
private
List
<
EventTitle
>
redisToEs
(
List
<
Object
>
objectList
,
List
<
Map
<
String
,
Object
>>
esList
){
List
<
EventTitle
>
eventTitles
=
new
ArrayList
<>();
for
(
Object
obj:
objectList
){
EventTitle
eventTitle
=(
EventTitle
)
obj
;
for
(
Map
<
String
,
Object
>
map:
esList
){
if
(
eventTitle
.
getId
().
equals
(
map
.
get
(
"id"
))){
eventTitles
.
add
(
eventTitle
);
}
}
}
return
eventTitles
;
}
private
RoleSum
statisticalRoleCount
(
List
<
Object
>
list
){
int
role1
=
0
,
role2
=
0
,
role3
=
0
;
int
unread1
=
0
,
unread2
=
0
,
unread3
=
0
;
for
(
Object
object:
list
)
{
EventTitle
eventTitle
=
(
EventTitle
)
object
;
switch
(
eventTitle
.
getIdentity
())
{
case
1
:
switch
(
eventTitle
.
getState
()){
case
WorkStatus
.
UNDERWAY
:
if
(
eventTitle
.
getRelease
()==
2
){
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
role3
=
role3
+
1
;
}
if
(
eventTitle
.
getReadState
()==
1
){
unread1
=
1
;
}
role1
=
role1
+
1
;
break
;
case
WorkStatus
.
COMMITTED
:
if
(
eventTitle
.
getRelease
()==
2
){
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
role3
=
role3
+
1
;
}
if
(
eventTitle
.
getReadState
()==
1
){
unread2
=
1
;
}
role2
=
role2
+
1
;
break
;
default
:
}
break
;
case
2
:
switch
(
eventTitle
.
getState
()){
case
WorkStatus
.
UNDERWAY
:
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
role3
=
role3
+
1
;
break
;
case
WorkStatus
.
COMMITTED
:
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
role3
=
role3
+
1
;
break
;
default
:
}
break
;
case
3
:
switch
(
eventTitle
.
getState
()){
case
WorkStatus
.
UNDERWAY
:
if
(
eventTitle
.
getRelease
()==
1
){
role3
=
role3
+
1
;
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
}
else
{
if
(
eventTitle
.
getReadState
()
==
1
)
{
unread3
=
1
;
}
role3
=
role3
+
1
;
}
break
;
case
WorkStatus
.
COMMITTED
:
if
(
eventTitle
.
getRelease
()==
1
){
role3
=
role3
+
1
;
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
}
if
(
eventTitle
.
getReadState
()==
1
){
unread1
=
1
;
}
role1
=
role1
+
1
;
break
;
default
:
}
break
;
case
4
:
switch
(
eventTitle
.
getState
()){
case
WorkStatus
.
UNDERWAY
:
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
role3
=
role3
+
1
;
break
;
case
WorkStatus
.
COMMITTED
:
if
(
eventTitle
.
getReadState
()==
1
){
unread3
=
1
;
}
role3
=
role3
+
1
;
break
;
default
:
}
break
;
default
:
}
}
return
new
RoleSum
(
unread1
,
role1
,
unread2
,
role2
,
unread3
,
role3
);
}
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/WorkShowSeeServiceImpl.java
0 → 100644
浏览文件 @
c129ad90
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
.
impl
;
import
com.zjty.tynotes.job.status.entity.EsListSum
;
import
com.zjty.tynotes.job.status.service.WorkShowSeeService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
@Service
@Slf4j
public
class
WorkShowSeeServiceImpl
implements
WorkShowSeeService
{
@Override
public
EsListSum
selectMeWork
(
String
id
,
int
page
,
int
size
)
{
return
null
;
}
@Override
public
EsListSum
selectMeReceiveWork
(
String
id
,
int
page
,
int
size
)
{
return
null
;
}
@Override
public
EsListSum
selectMeResolveWork
(
String
id
,
int
page
,
int
size
)
{
return
null
;
}
@Override
public
EsListSum
selectMeReleaseWork
(
String
id
,
int
page
,
int
size
)
{
return
null
;
}
@Override
public
EsListSum
titleSelect
(
String
id
,
int
page
,
int
size
,
String
title
)
{
return
null
;
}
@Override
public
void
loginFirstOneManualPush
(
String
id
)
{
}
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/WorkShowServiceImpl.java
0 → 100644
浏览文件 @
c129ad90
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论