Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
c6b09091
提交
c6b09091
authored
3月 31, 2020
作者:
gongwenjie
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git.yfzx.zjtys.com.cn:zjm/notes2.0
上级
b3058210
298d3de0
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
302 行增加
和
22 行删除
+302
-22
AttachmentController.java
...ty/tynotes/job/basic/controller/AttachmentController.java
+1
-0
WorkVo.java
...va/com/zjty/tynotes/job/basic/entity/response/WorkVo.java
+6
-0
PriviceService.java
...va/com/zjty/tynotes/job/basic/service/PriviceService.java
+12
-0
WorkService.java
.../java/com/zjty/tynotes/job/basic/service/WorkService.java
+2
-0
ConversionServiceImpl.java
...tynotes/job/basic/service/impl/ConversionServiceImpl.java
+55
-22
PriviceServiceImpl.java
...ty/tynotes/job/basic/service/impl/PriviceServiceImpl.java
+32
-0
WorkServiceImpl.java
.../zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
+1
-0
RepairService.java
...va/com/zjty/tynotes/job/status/service/RepairService.java
+5
-0
RepairServiceImpl.java
...ty/tynotes/job/status/service/impl/RepairServiceImpl.java
+185
-0
application-simc.properties
notes-union/src/main/resources/application-simc.properties
+3
-0
没有找到文件。
notes-job/src/main/java/com/zjty/tynotes/job/basic/controller/AttachmentController.java
浏览文件 @
c6b09091
...
@@ -47,6 +47,7 @@ public class AttachmentController {
...
@@ -47,6 +47,7 @@ public class AttachmentController {
return
ok
(
new
JobResponse
(
saveId
));
return
ok
(
new
JobResponse
(
saveId
));
}
}
@PutMapping
()
@PutMapping
()
@ApiOperation
(
value
=
"修改附件."
,
notes
=
"修改必须在数据中附带id."
)
@ApiOperation
(
value
=
"修改附件."
,
notes
=
"修改必须在数据中附带id."
)
public
ResponseEntity
<
JobResponse
>
modify
(
@RequestBody
Attachment
attachment
)
{
public
ResponseEntity
<
JobResponse
>
modify
(
@RequestBody
Attachment
attachment
)
{
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/response/WorkVo.java
浏览文件 @
c6b09091
...
@@ -2,6 +2,7 @@ package com.zjty.tynotes.job.basic.entity.response;
...
@@ -2,6 +2,7 @@ package com.zjty.tynotes.job.basic.entity.response;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.zjty.tynotes.job.basic.entity.database.Attachment
;
import
com.zjty.tynotes.job.basic.entity.database.Attachment
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.entity.User
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -146,4 +147,9 @@ public class WorkVo {
...
@@ -146,4 +147,9 @@ public class WorkVo {
private
int
workloadCount
=
1
;
private
int
workloadCount
=
1
;
/**
* 主任务对象
*/
@ApiModelProperty
(
value
=
"主任务对象"
)
private
Work
workVos
;
}
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/PriviceService.java
0 → 100644
浏览文件 @
c6b09091
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
;
public
interface
PriviceService
{
/**
* 根据任务id 查看主任务
* @return WorkVo 主任务对象
*/
Work
findByWorkIdWorkVo
(
String
superoirId
);
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/WorkService.java
浏览文件 @
c6b09091
...
@@ -134,6 +134,8 @@ public interface WorkService {
...
@@ -134,6 +134,8 @@ public interface WorkService {
*/
*/
int
findBySuperoirIdCount
(
String
SuperoirId
);
int
findBySuperoirIdCount
(
String
SuperoirId
);
// /**
// /**
// * 查看正在进行中的任务
// * 查看正在进行中的任务
// */
// */
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/ConversionServiceImpl.java
浏览文件 @
c6b09091
...
@@ -6,6 +6,8 @@ import com.zjty.tynotes.job.basic.entity.response.WorkVo;
...
@@ -6,6 +6,8 @@ import com.zjty.tynotes.job.basic.entity.response.WorkVo;
import
com.zjty.tynotes.job.basic.repository.AttachmentRepository
;
import
com.zjty.tynotes.job.basic.repository.AttachmentRepository
;
import
com.zjty.tynotes.job.basic.service.AttachmentService
;
import
com.zjty.tynotes.job.basic.service.AttachmentService
;
import
com.zjty.tynotes.job.basic.service.ConversionService
;
import
com.zjty.tynotes.job.basic.service.ConversionService
;
import
com.zjty.tynotes.job.basic.service.PriviceService
;
import
com.zjty.tynotes.job.basic.service.WorkService
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -23,6 +25,8 @@ public class ConversionServiceImpl implements ConversionService {
...
@@ -23,6 +25,8 @@ public class ConversionServiceImpl implements ConversionService {
@Autowired
@Autowired
AttachmentRepository
attachmentRepository
;
AttachmentRepository
attachmentRepository
;
@Autowired
PriviceService
priviceService
;
@Override
@Override
public
WorkVo
workToVo
(
Work
work
)
{
public
WorkVo
workToVo
(
Work
work
)
{
...
@@ -49,27 +53,56 @@ public class ConversionServiceImpl implements ConversionService {
...
@@ -49,27 +53,56 @@ public class ConversionServiceImpl implements ConversionService {
attachments
.
add
(
attachmentRepository
.
findById
(
id
).
get
());
attachments
.
add
(
attachmentRepository
.
findById
(
id
).
get
());
}
}
}
}
return
new
WorkVo
(
work
.
getId
(),
work
.
getSuperiorId
(),
if
(
work
.
getSuperiorId
()==
null
||
""
.
equals
(
work
.
getSuperiorId
())){
work
.
getTitle
(),
return
new
WorkVo
(
work
.
getCreateTime
(),
work
.
getId
(),
work
.
getStateTime
(),
work
.
getSuperiorId
(),
work
.
getEndTime
(),
work
.
getTitle
(),
work
.
getCompleteTime
(),
work
.
getCreateTime
(),
work
.
getUpdateTime
(),
work
.
getStateTime
(),
work
.
getSubmitTime
(),
work
.
getEndTime
(),
work
.
getAuditTime
(),
work
.
getCompleteTime
(),
pUser
,
work
.
getUpdateTime
(),
eUser
,
work
.
getSubmitTime
(),
users
,
work
.
getAuditTime
(),
attachments
,
pUser
,
work
.
getContent
(),
eUser
,
work
.
getWorkload
(),
users
,
work
.
getStatus
(),
attachments
,
work
.
getWorkCoefficient
(),
work
.
getContent
(),
work
.
getPWorkload
(),
work
.
getWorkload
(),
work
.
getWorkloadCount
()
work
.
getStatus
(),
);
work
.
getWorkCoefficient
(),
work
.
getPWorkload
(),
work
.
getWorkloadCount
(),
null
);
}
else
{
return
new
WorkVo
(
work
.
getId
(),
work
.
getSuperiorId
(),
work
.
getTitle
(),
work
.
getCreateTime
(),
work
.
getStateTime
(),
work
.
getEndTime
(),
work
.
getCompleteTime
(),
work
.
getUpdateTime
(),
work
.
getSubmitTime
(),
work
.
getAuditTime
(),
pUser
,
eUser
,
users
,
attachments
,
work
.
getContent
(),
work
.
getWorkload
(),
work
.
getStatus
(),
work
.
getWorkCoefficient
(),
work
.
getPWorkload
(),
work
.
getWorkloadCount
(),
priviceService
.
findByWorkIdWorkVo
(
work
.
getSuperiorId
()));
}
}
}
}
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/PriviceServiceImpl.java
0 → 100644
浏览文件 @
c6b09091
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
.
impl
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.response.WorkVo
;
import
com.zjty.tynotes.job.basic.repository.WorkRepository
;
import
com.zjty.tynotes.job.basic.service.PriviceService
;
import
com.zjty.tynotes.job.common.exception.NotFoundException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
PriviceServiceImpl
implements
PriviceService
{
@Autowired
WorkRepository
workRepository
;
@Override
public
Work
findByWorkIdWorkVo
(
String
superoirId
)
{
return
superoirIdWork
(
superoirId
);
}
private
Work
superoirIdWork
(
String
superoirId
){
if
(!
workRepository
.
existsById
(
superoirId
)){
throw
new
NotFoundException
(
String
.
format
(
"[job] id为 %s 的任务不存在."
,
superoirId
));
}
Work
work
=
workRepository
.
findById
(
superoirId
).
get
();
if
(
work
.
getSuperiorId
()==
null
||
""
.
equals
(
work
.
getSuperiorId
())){
return
work
;
}
else
{
return
superoirIdWork
(
work
.
getSuperiorId
());
}
}
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
浏览文件 @
c6b09091
...
@@ -123,6 +123,7 @@ public class WorkServiceImpl implements WorkService {
...
@@ -123,6 +123,7 @@ public class WorkServiceImpl implements WorkService {
@Override
@Override
public
Work
findById
(
String
workId
)
{
public
Work
findById
(
String
workId
)
{
Optional
<
Work
>
workOptional
=
workRepository
.
findById
(
workId
);
Optional
<
Work
>
workOptional
=
workRepository
.
findById
(
workId
);
return
workOptional
.
orElseThrow
(()
->
new
BadRequestException
(
String
.
format
(
"[job] id为 %s 的数据不存在."
,
workId
)));
return
workOptional
.
orElseThrow
(()
->
new
BadRequestException
(
String
.
format
(
"[job] id为 %s 的数据不存在."
,
workId
)));
}
}
...
...
notes-job/src/main/java/com/zjty/tynotes/job/status/service/RepairService.java
0 → 100644
浏览文件 @
c6b09091
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
public
interface
RepairService
{
void
dbAllToRedis
();
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/RepairServiceImpl.java
0 → 100644
浏览文件 @
c6b09091
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.service.ScoreCoefficientService
;
import
com.zjty.tynotes.job.basic.service.WorkService
;
import
com.zjty.tynotes.job.common.Constants
;
import
com.zjty.tynotes.job.common.constant.WorkStatus
;
import
com.zjty.tynotes.job.common.exception.WorkAttribution
;
import
com.zjty.tynotes.job.common.exception.WorkAttribution1
;
import
com.zjty.tynotes.job.status.entity.RedisPersonalWork
;
import
com.zjty.tynotes.job.status.service.RepairService
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
com.zjty.tynotes.search.subject.service.EsUtil
;
import
com.zjty.tynotes.sms.service.MessageTemplateService
;
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.Date
;
import
java.util.List
;
@Service
public
class
RepairServiceImpl
implements
RepairService
{
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Autowired
MessageTemplateService
messageTemplateService
;
@Autowired
WorkService
workService
;
@Autowired
EsUtil
esUtil
;
@Autowired
ScoreCoefficientService
scoreCoefficientService
;
@Autowired
IUserService
iUserService
;
@Override
public
void
dbAllToRedis
()
{
workService
.
findAll
();
}
private
void
dbToRedis
(
Work
work
){
List
<
String
>
uIds
=
new
ArrayList
<>();
Long
time
=
new
Date
().
getTime
();
String
releaseName
=
iUserService
.
findUserById
(
work
.
getPublisher
()).
getUsername
();
String
executorName
=
iUserService
.
findUserById
(
work
.
getExecutor
()).
getUsername
();
RedisPersonalWork
personalWork
=
new
RedisPersonalWork
(
work
.
getId
(),
time
,
work
.
getTitle
(),
work
.
getStatus
(),
releaseName
,
executorName
,
1
,
WorkAttribution
.
ME_WORK
,
""
,
work
.
getSuperiorId
(),
new
ArrayList
<>(),
0
,
0
);
if
(
releaseName
.
equals
(
executorName
)){
if
(
work
.
getSuperiorId
()
==
null
){
personalWork
.
setWorkAttribution
(
WorkAttribution1
.
ME_RELEASE_WORK
);
personalWork
.
setExecutorEqualRelease
(
1
);
personalWork
.
setReadState
(
1
);
personalWork
.
setIsNotCommission
(
1
);
redisTemplate
.
opsForList
().
leftPush
(
Constants
.
REDIS_EVENT
+
work
.
getPublisher
(),
personalWork
);
}
else
{
uIds
=
tests
(
work
.
getSuperiorId
(),
uIds
);
uIds
.
remove
(
work
.
getPublisher
());
uIds
.
remove
(
work
.
getExecutor
());
personalWork
.
setWorkAttribution
(
WorkAttribution1
.
ME_RESOLVE_WORK
);
personalWork
.
setExecutorEqualRelease
(
1
);
personalWork
.
setReadState
(
1
);
personalWork
.
setIsNotCommission
(
1
);
redisTemplate
.
opsForList
().
leftPush
(
Constants
.
REDIS_EVENT
+
work
.
getPublisher
(),
personalWork
);
List
<
Object
>
list
=
redisTemplate
.
opsForList
().
range
(
Constants
.
REDIS_EVENT
+
work
.
getPublisher
(),
0
,
-
1
);
assert
list
!=
null
;
}
}
else
{
//发布人
if
(
work
.
getSuperiorId
()
==
null
)
{
personalWork
.
setWorkAttribution
(
WorkAttribution1
.
ME_RELEASE_WORK
);
switch
(
work
.
getStatus
()){
case
WorkStatus
.
AUDIT
:
personalWork
.
setIsNotCommission
(
1
);
break
;
case
WorkStatus
.
REVIEW
:
ScoreCoefficient
scoreCoefficient
=
scoreCoefficientService
.
findById
(
work
.
getId
());
if
(
scoreCoefficient
==
null
){
personalWork
.
setIsNotCommission
(
0
);
}
else
{
personalWork
.
setIsNotCommission
(
1
);
}
break
;
default
:
personalWork
.
setIsNotCommission
(
0
);
break
;
}
personalWork
.
setReadState
(
1
);
redisTemplate
.
opsForList
().
leftPush
(
Constants
.
REDIS_EVENT
+
work
.
getPublisher
(),
personalWork
);
}
else
{
uIds
=
tests
(
work
.
getSuperiorId
(),
uIds
);
uIds
.
remove
(
work
.
getPublisher
());
uIds
.
remove
(
work
.
getExecutor
());
personalWork
.
setWorkAttribution
(
WorkAttribution1
.
ME_RESOLVE_WORK
);
switch
(
work
.
getStatus
()){
case
WorkStatus
.
AUDIT
:
personalWork
.
setIsNotCommission
(
1
);
break
;
case
WorkStatus
.
REVIEW
:
ScoreCoefficient
scoreCoefficient
=
scoreCoefficientService
.
findById
(
work
.
getId
());
if
(
scoreCoefficient
==
null
){
personalWork
.
setIsNotCommission
(
0
);
}
else
{
personalWork
.
setIsNotCommission
(
1
);
}
break
;
default
:
personalWork
.
setIsNotCommission
(
0
);
break
;
}
personalWork
.
setReadState
(
1
);
redisTemplate
.
opsForList
().
leftPush
(
Constants
.
REDIS_EVENT
+
work
.
getPublisher
(),
personalWork
);
}
//执行人 判断执行人是否有分解权限
personalWork
.
setWorkAttribution
(
WorkAttribution1
.
ME_RECEIVE_WORK
);
personalWork
.
setReadState
(
1
);
switch
(
work
.
getStatus
()){
case
WorkStatus
.
ONGOING
:
personalWork
.
setIsNotCommission
(
1
);
break
;
case
WorkStatus
.
REVIEW
:
ScoreCoefficient
scoreCoefficient
=
scoreCoefficientService
.
findById
(
work
.
getId
());
if
(
scoreCoefficient
==
null
){
personalWork
.
setIsNotCommission
(
1
);
}
else
{
personalWork
.
setIsNotCommission
(
0
);
}
break
;
default
:
personalWork
.
setIsNotCommission
(
0
);
break
;
}
redisTemplate
.
opsForList
().
leftPush
(
Constants
.
REDIS_EVENT
+
work
.
getExecutor
(),
personalWork
);
}
//有待修改
if
(
uIds
.
size
()!=
0
)
{
for
(
String
id
:
uIds
)
{
personalWork
.
setWorkAttribution
(
WorkAttribution1
.
ME_RELATED_WORK
);
personalWork
.
setReadState
(
1
);
personalWork
.
setIsNotCommission
(
0
);
redisTemplate
.
opsForList
().
leftPush
(
Constants
.
REDIS_EVENT
+
id
,
personalWork
);
}
}
}
private
List
<
String
>
tests
(
String
id
,
List
<
String
>
list
){
Work
work
=
workService
.
findById
(
id
);
String
workId
=
work
.
getSuperiorId
();
list
.
add
(
work
.
getPublisher
());
if
(
workId
==
null
||
""
.
equals
(
workId
)){
return
list
;
}
return
tests
(
workId
,
list
);
}
}
notes-union/src/main/resources/application-simc.properties
浏览文件 @
c6b09091
...
@@ -12,6 +12,7 @@ server.ssl.keyStoreType=PKCS12
...
@@ -12,6 +12,7 @@ server.ssl.keyStoreType=PKCS12
# 证书别名
# 证书别名
server.ssl.keyAlias
=
alias
server.ssl.keyAlias
=
alias
#mongodb configuration
#mongodb configuration
spring.data.mongodb.uri
=
mongodb://localhost:27017/notes2
spring.data.mongodb.uri
=
mongodb://localhost:27017/notes2
# servlet configuration
# servlet configuration
...
@@ -22,6 +23,7 @@ spring.redis.host=localhost
...
@@ -22,6 +23,7 @@ spring.redis.host=localhost
spring.redis.port
=
6379
spring.redis.port
=
6379
spring.redis.timeout
=
5000ms
spring.redis.timeout
=
5000ms
# es configuraiton
# es configuraiton
es.ip
=
localhost
es.ip
=
localhost
logging.file
=
./log/note.log
logging.file
=
./log/note.log
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论