Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
a915d304
提交
a915d304
authored
5月 13, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
b31093a0
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
231 行增加
和
66 行删除
+231
-66
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+1
-3
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+59
-56
TaskController.java
...a/com/tykj/dev/device/task/controller/TaskController.java
+85
-0
TaskSelectVo.java
...ava/com/tykj/dev/device/task/subject/vo/TaskSelectVo.java
+0
-1
MessageController.java
...kj/dev/device/user/read/controller/MessageController.java
+6
-0
MessageService.java
...com/tykj/dev/device/user/read/service/MessageService.java
+2
-0
MessageServiceImpl.java
...dev/device/user/read/service/impl/MessageServiceImpl.java
+55
-5
UserRecordDao.java
...a/com/tykj/dev/device/user/subject/dao/UserRecordDao.java
+1
-0
UserRecord.java
...a/com/tykj/dev/device/user/subject/entity/UserRecord.java
+22
-1
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
a915d304
...
@@ -389,22 +389,20 @@ public class DeviceLibraryController {
...
@@ -389,22 +389,20 @@ public class DeviceLibraryController {
}
}
deviceLogUserVos
.
addAll
(
deviceLogEntities
);
deviceLogUserVos
.
addAll
(
deviceLogEntities
);
libraryEntities
.
add
(
deviceLibraryEntity
);
libraryEntities
.
add
(
deviceLibraryEntity
);
deviceDetailVo
.
setDeviceLogEntityList
(
deviceLogUserVos
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceLogUserVo:
:
getCreateTime
).
reversed
()).
collect
(
Collectors
.
toList
()));
if
(
deviceLibraryEntity
.
getIsPart
()
==
0
)
{
if
(
deviceLibraryEntity
.
getIsPart
()
==
0
)
{
List
<
DeviceLibrary
>
partList
=
deviceLibraryDao
.
getAllByPartParentIdAndIsPart
(
id
,
1
);
List
<
DeviceLibrary
>
partList
=
deviceLibraryDao
.
getAllByPartParentIdAndIsPart
(
id
,
1
);
partList
.
forEach
(
DeviceLibrary:
:
setConfigName
);
partList
.
forEach
(
DeviceLibrary:
:
setConfigName
);
libraryEntities
.
addAll
(
partList
);
libraryEntities
.
addAll
(
partList
);
deviceDetailVo
.
setDeviceList
(
libraryEntities
);
deviceDetailVo
.
setDeviceList
(
libraryEntities
);
deviceDetailVo
.
setDeviceLogEntityList
(
deviceLogUserVos
);
return
ResultUtil
.
success
(
deviceDetailVo
);
return
ResultUtil
.
success
(
deviceDetailVo
);
}
else
{
}
else
{
if
(
deviceLibraryEntity
.
getPartParentId
()
==
null
)
{
if
(
deviceLibraryEntity
.
getPartParentId
()
==
null
)
{
deviceDetailVo
.
setDeviceList
(
libraryEntities
);
deviceDetailVo
.
setDeviceList
(
libraryEntities
);
deviceDetailVo
.
setDeviceLogEntityList
(
deviceLogEntities
);
return
ResultUtil
.
success
(
deviceDetailVo
);
return
ResultUtil
.
success
(
deviceDetailVo
);
}
}
libraryEntities
.
add
(
deviceLibraryService
.
getOne
(
deviceLibraryEntity
.
getPartParentId
()).
setConfigName
());
libraryEntities
.
add
(
deviceLibraryService
.
getOne
(
deviceLibraryEntity
.
getPartParentId
()).
setConfigName
());
deviceDetailVo
.
setDeviceList
(
libraryEntities
);
deviceDetailVo
.
setDeviceList
(
libraryEntities
);
deviceDetailVo
.
setDeviceLogEntityList
(
deviceLogUserVos
);
return
ResultUtil
.
success
(
deviceDetailVo
);
return
ResultUtil
.
success
(
deviceDetailVo
);
}
}
}
}
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
a915d304
...
@@ -182,6 +182,8 @@ public class StorageBillController {
...
@@ -182,6 +182,8 @@ public class StorageBillController {
List
<
String
>
strings3
=
DeviceSeqUtil
.
createDeviceSeqs
(
s
.
getProdInterval
(),
s
.
getStorageCount
());
List
<
String
>
strings3
=
DeviceSeqUtil
.
createDeviceSeqs
(
s
.
getProdInterval
(),
s
.
getStorageCount
());
List
<
List
<
String
>>
sons
=
new
ArrayList
<>();
List
<
List
<
String
>>
sons
=
new
ArrayList
<>();
List
<
List
<
String
>>
sons2
=
new
ArrayList
<>();
List
<
List
<
String
>>
sons2
=
new
ArrayList
<>();
List
<
List
<
String
>>
sons3
=
new
ArrayList
<>();
List
<
List
<
String
>>
sons4
=
new
ArrayList
<>();
int
count
=
1
;
int
count
=
1
;
Integer
deviceNum
=
s
.
getStorageCount
();
Integer
deviceNum
=
s
.
getStorageCount
();
while
(
deviceNum
>=
count
)
{
while
(
deviceNum
>=
count
)
{
...
@@ -257,62 +259,62 @@ public class StorageBillController {
...
@@ -257,62 +259,62 @@ public class StorageBillController {
}
}
map
.
put
(
s2
.
getPackingId
(),
packingLibraries
);
map
.
put
(
s2
.
getPackingId
(),
packingLibraries
);
}
}
//
if (s2.getList() != null && s2.getList().size() != 0) {
if
(
s2
.
getList
()
!=
null
&&
s2
.
getList
().
size
()
!=
0
)
{
//
for (int k = 0; k < s2.getList().size(); k++) {
for
(
int
k
=
0
;
k
<
s2
.
getList
().
size
();
k
++)
{
// StorageBillDetailVo s3 = s
.getList().get(k);
StorageBillDetailVo
s3
=
s2
.
getList
().
get
(
k
);
// if (k >= sons
.size()) {
if
(
k
>=
sons3
.
size
())
{
// sons
.add(DeviceSeqUtil.createDeviceSeqs(s3.getSeqInterval(), s3.getStorageCount()));
sons3
.
add
(
DeviceSeqUtil
.
createDeviceSeqs
(
s3
.
getSeqInterval
(),
s3
.
getStorageCount
()));
// sons2
.add(DeviceSeqUtil.createDeviceSeqs(s3.getProdInterval(), s3.getStorageCount()));
sons4
.
add
(
DeviceSeqUtil
.
createDeviceSeqs
(
s3
.
getProdInterval
(),
s3
.
getStorageCount
()));
//
}
}
//
packingLibraryEntity = packingLibraryService.getOne(s3.getPackingId());
packingLibraryEntity
=
packingLibraryService
.
getOne
(
s3
.
getPackingId
());
// List<String> strings4 = sons
.get(k);
List
<
String
>
strings4
=
sons3
.
get
(
k
);
// List<String> strings5 = sons2
.get(k);
List
<
String
>
strings5
=
sons4
.
get
(
k
);
//
if (s3.getStorageCount() >= count) {
if
(
s3
.
getStorageCount
()
>=
count
)
{
//
packingLibraryEntity.setCorresponding(count);
packingLibraryEntity
.
setCorresponding
(
count
);
//
if (!strings4.isEmpty()) {
if
(!
strings4
.
isEmpty
())
{
//
if (deviceLibraryDao.getAllBySeqNumber(strings4.get(0)).size() > 0) {
if
(
deviceLibraryDao
.
getAllBySeqNumber
(
strings4
.
get
(
0
)).
size
()
>
0
)
{
//
throw new ApiException("序列号" + strings4.get(0) + "已存在");
throw
new
ApiException
(
"序列号"
+
strings4
.
get
(
0
)
+
"已存在"
);
//
}
}
//
if (seqs.contains(strings4.get(0))){
if
(
seqs
.
contains
(
strings4
.
get
(
0
))){
//
throw new ApiException("序列号" + strings4.get(0) + "不能重复");
throw
new
ApiException
(
"序列号"
+
strings4
.
get
(
0
)
+
"不能重复"
);
//
}
}
//
packingLibraryEntity.setSeq(strings4.get(0));
packingLibraryEntity
.
setSeq
(
strings4
.
get
(
0
));
//
strings4.remove(0);
strings4
.
remove
(
0
);
//
}
}
//
if (!strings5.isEmpty()) {
if
(!
strings5
.
isEmpty
())
{
//
packingLibraryEntity.setProdNumber(strings5.get(0));
packingLibraryEntity
.
setProdNumber
(
strings5
.
get
(
0
));
//
strings5.remove(0);
strings5
.
remove
(
0
);
//
}
}
//
seqs.add(packingLibraryEntity.getSeq());
seqs
.
add
(
packingLibraryEntity
.
getSeq
());
//
libraryEntities.add(packingLibraryEntity);
libraryEntities
.
add
(
packingLibraryEntity
);
//
}
}
//
if (s3.getStorageCount() - strings4.size() == deviceNum) {
if
(
s3
.
getStorageCount
()
-
strings4
.
size
()
==
deviceNum
)
{
//
List<PackingLibrary> packingLibraries = new ArrayList<>();
List
<
PackingLibrary
>
packingLibraries
=
new
ArrayList
<>();
//
for (int i = 0; i < s3.getStorageCount() - deviceNum; i++) {
for
(
int
i
=
0
;
i
<
s3
.
getStorageCount
()
-
deviceNum
;
i
++)
{
//
packingLibraryEntity = packingLibraryService.getOne(s3.getPackingId());
packingLibraryEntity
=
packingLibraryService
.
getOne
(
s3
.
getPackingId
());
//
packingLibraryEntity.setCorresponding(0);
packingLibraryEntity
.
setCorresponding
(
0
);
//
if (!strings4.isEmpty()) {
if
(!
strings4
.
isEmpty
())
{
//
if (deviceLibraryDao.getAllBySeqNumber(strings4.get(0)).size() > 0) {
if
(
deviceLibraryDao
.
getAllBySeqNumber
(
strings4
.
get
(
0
)).
size
()
>
0
)
{
//
throw new ApiException("序列号" + strings4.get(0) + "已存在");
throw
new
ApiException
(
"序列号"
+
strings4
.
get
(
0
)
+
"已存在"
);
//
}
}
//
if (seqs.contains(strings4.get(0))){
if
(
seqs
.
contains
(
strings4
.
get
(
0
))){
//
throw new ApiException("序列号" + strings4.get(0) + "不能重复");
throw
new
ApiException
(
"序列号"
+
strings4
.
get
(
0
)
+
"不能重复"
);
//
}
}
//
packingLibraryEntity.setSeq(strings4.get(0));
packingLibraryEntity
.
setSeq
(
strings4
.
get
(
0
));
//
strings4.remove(0);
strings4
.
remove
(
0
);
//
}
}
//
if (!strings5.isEmpty()) {
if
(!
strings5
.
isEmpty
())
{
//
packingLibraryEntity.setProdNumber(strings5.get(0));
packingLibraryEntity
.
setProdNumber
(
strings5
.
get
(
0
));
//
strings5.remove(0);
strings5
.
remove
(
0
);
//
}
}
//
seqs.add(packingLibraryEntity.getSeq());
seqs
.
add
(
packingLibraryEntity
.
getSeq
());
//
packingLibraries.add(packingLibraryEntity);
packingLibraries
.
add
(
packingLibraryEntity
);
//
}
}
//
map.put(s3.getPackingId(), packingLibraries);
map
.
put
(
s3
.
getPackingId
(),
packingLibraries
);
//
}
}
//
}
}
//
//
}
}
}
}
}
}
...
@@ -410,6 +412,7 @@ public class StorageBillController {
...
@@ -410,6 +412,7 @@ public class StorageBillController {
if
(
deviceLibraryEntity
.
getIsPart
()
==
1
)
{
if
(
deviceLibraryEntity
.
getIsPart
()
==
1
)
{
deviceLibraryEntity
.
setPartParentId
(
parentId
);
deviceLibraryEntity
.
setPartParentId
(
parentId
);
saveEntity
=
deviceLibraryService
.
addEntity
(
deviceLibraryEntity
);
saveEntity
=
deviceLibraryService
.
addEntity
(
deviceLibraryEntity
);
parentId
=
saveEntity
.
getId
();
}
}
}
}
//如果是单独的配件,不用设置父装备id
//如果是单独的配件,不用设置父装备id
...
...
dev-task/src/main/java/com/tykj/dev/device/task/controller/TaskController.java
浏览文件 @
a915d304
...
@@ -9,10 +9,14 @@ import com.tykj.dev.device.task.subject.bto.TaskBto;
...
@@ -9,10 +9,14 @@ import com.tykj.dev.device.task.subject.bto.TaskBto;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.task.subject.vo.*
;
import
com.tykj.dev.device.task.subject.vo.*
;
import
com.tykj.dev.device.task.utils.TaskUtils
;
import
com.tykj.dev.device.task.utils.TaskUtils
;
import
com.tykj.dev.device.user.subject.dao.UserRecordDao
;
import
com.tykj.dev.device.user.subject.entity.UserRecord
;
import
com.tykj.dev.device.user.subject.service.UserRecordService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.utils.PageUtil
;
import
com.tykj.dev.misc.utils.PageUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -49,6 +53,12 @@ public class TaskController {
...
@@ -49,6 +53,12 @@ public class TaskController {
@Autowired
@Autowired
private
TaskDao
taskDao
;
private
TaskDao
taskDao
;
@Autowired
private
UserRecordService
userRecordService
;
@Autowired
private
UserRecordDao
userRecordDao
;
@ApiOperation
(
value
=
"业务分页查询"
,
notes
=
"可以通过这个接口分页查询业务"
)
@ApiOperation
(
value
=
"业务分页查询"
,
notes
=
"可以通过这个接口分页查询业务"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/manage/summary"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/manage/summary"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
getTaskPage
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
public
ResponseEntity
getTaskPage
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
...
@@ -75,10 +85,85 @@ public class TaskController {
...
@@ -75,10 +85,85 @@ public class TaskController {
return
ResultUtil
.
success
(
map
);
return
ResultUtil
.
success
(
map
);
}
}
@ApiOperation
(
value
=
"新增待办列表查询"
,
notes
=
"可以通过这个接口查询业务"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getNewTaskList"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
getNewTaskList
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
Integer
userId
=
userUtils
.
getCurrentUserId
();
UserRecord
userRecord
=
userRecordDao
.
findByUserId
(
userId
);
if
(
userRecord
==
null
){
return
ResponseEntity
.
ok
(
Collections
.
EMPTY_LIST
);
}
else
{
List
<
Integer
>
newTaskIds
;
if
(
taskSelectVo
.
getType
()==
1
)
{
newTaskIds
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getNewTaskIds
());
}
else
{
newTaskIds
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getNewCountryTaskIds
());
}
taskSelectVo
.
setSelectNum
(
2
);
List
<
TaskUserVo
>
taskUserVos
=
taskService
.
getList
(
taskSelectVo
).
stream
().
filter
(
taskUserVo
->
newTaskIds
.
contains
(
taskUserVo
.
getId
())).
collect
(
Collectors
.
toList
());
return
ResponseEntity
.
ok
(
taskUtils
.
orderByTrackingTimeDateDesc
(
taskUserVos
));
}
}
@ApiOperation
(
value
=
"业务跟踪待办列表查询"
,
notes
=
"可以通过这个接口查询业务"
)
@ApiOperation
(
value
=
"业务跟踪待办列表查询"
,
notes
=
"可以通过这个接口查询业务"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getTaskList"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getTaskList"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
getTaskList
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
public
ResponseEntity
getTaskList
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
Boolean
hasCondition
=
taskSelectVo
.
getContent
()!=
null
||
taskSelectVo
.
getStartTime
()!=
null
||
taskSelectVo
.
getEndTime
()!=
null
||
(
taskSelectVo
.
getBusinessType
()!=
null
&&
taskSelectVo
.
getBusinessType
().
size
()>
0
)||
taskSelectVo
.
getBillStatus
()!=
null
||
(
taskSelectVo
.
getRemark
()!=
null
&&
taskSelectVo
.
getRemark
().
size
()>
0
)||
taskSelectVo
.
getTitleDim
()!=
null
||
taskSelectVo
.
getStatusDim
()!=
null
||
taskSelectVo
.
getCreateUserDim
()!=
null
||
taskSelectVo
.
getProcessingUserDim
()!=
null
;
Integer
userId
=
userUtils
.
getCurrentUserId
();
List
<
TaskUserVo
>
taskUserVos
=
taskService
.
getList
(
taskSelectVo
);
List
<
TaskUserVo
>
taskUserVos
=
taskService
.
getList
(
taskSelectVo
);
if
(!
hasCondition
){
List
<
Integer
>
taskIds
=
taskUserVos
.
stream
().
map
(
TaskUserVo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
taskSelectVo
.
getSelectNum
()==
2
)
{
if
(
taskSelectVo
.
getType
()
==
1
)
{
if
(
userRecordDao
.
findByUserId
(
userId
)
==
null
)
{
UserRecord
userRecord
=
new
UserRecord
();
userRecord
.
setUserId
(
userId
);
userRecord
.
setTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
userRecord
.
setNewTaskIds
(
userRecord
.
getTaskIds
());
userRecordService
.
save
(
userRecord
);
}
else
{
UserRecord
userRecord
=
userRecordDao
.
findByUserId
(
userId
);
if
(
userRecord
.
getTaskIds
()
==
null
)
{
userRecord
.
setTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
userRecord
.
setNewTaskIds
(
userRecord
.
getTaskIds
());
userRecordService
.
save
(
userRecord
);
}
else
{
List
<
Integer
>
ids
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getTaskIds
());
userRecord
.
setTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
taskIds
.
removeAll
(
ids
);
userRecord
.
setNewTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
userRecordService
.
save
(
userRecord
);
}
}
}
else
{
if
(
userRecordDao
.
findByUserId
(
userId
)
==
null
)
{
UserRecord
userRecord
=
new
UserRecord
();
userRecord
.
setUserId
(
userId
);
userRecord
.
setCountryTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
userRecord
.
setNewCountryTaskIds
(
userRecord
.
getCountryTaskIds
());
userRecordService
.
save
(
userRecord
);
}
else
{
UserRecord
userRecord
=
userRecordDao
.
findByUserId
(
userId
);
if
(
userRecord
.
getCountryTaskIds
()
==
null
)
{
userRecord
.
setCountryTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
userRecord
.
setNewCountryTaskIds
(
userRecord
.
getCountryTaskIds
());
userRecordService
.
save
(
userRecord
);
}
else
{
List
<
Integer
>
ids
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getCountryTaskIds
());
userRecord
.
setCountryTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
taskIds
.
removeAll
(
ids
);
userRecordService
.
save
(
userRecord
);
}
}
}
}
}
return
ResultUtil
.
success
(
taskUtils
.
orderByTopDescAndReadAsc
(
taskUserVos
));
return
ResultUtil
.
success
(
taskUtils
.
orderByTopDescAndReadAsc
(
taskUserVos
));
}
}
...
...
dev-task/src/main/java/com/tykj/dev/device/task/subject/vo/TaskSelectVo.java
浏览文件 @
a915d304
...
@@ -43,5 +43,4 @@ public class TaskSelectVo extends CustomPage {
...
@@ -43,5 +43,4 @@ public class TaskSelectVo extends CustomPage {
@ApiModelProperty
(
value
=
"待办人模糊查询字段"
)
@ApiModelProperty
(
value
=
"待办人模糊查询字段"
)
private
String
processingUserDim
;
private
String
processingUserDim
;
}
}
dev-user/src/main/java/com/tykj/dev/device/user/read/controller/MessageController.java
浏览文件 @
a915d304
...
@@ -48,6 +48,12 @@ public class MessageController {
...
@@ -48,6 +48,12 @@ public class MessageController {
return
ResponseEntity
.
ok
(
messageService
.
getList
());
return
ResponseEntity
.
ok
(
messageService
.
getList
());
}
}
@ApiOperation
(
value
=
"新增阅知信息查询"
)
@GetMapping
(
"/getNew"
)
public
ResponseEntity
getNewMessage
(){
return
ResponseEntity
.
ok
(
messageService
.
getNewList
());
}
@ApiOperation
(
value
=
"所有阅知信息查询"
)
@ApiOperation
(
value
=
"所有阅知信息查询"
)
@PostMapping
(
"/get/all"
)
@PostMapping
(
"/get/all"
)
public
ResponseEntity
getAllMessage
(
@RequestBody
MessageSelectVo
messageSelectVo
){
public
ResponseEntity
getAllMessage
(
@RequestBody
MessageSelectVo
messageSelectVo
){
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/service/MessageService.java
浏览文件 @
a915d304
...
@@ -24,6 +24,8 @@ public interface MessageService {
...
@@ -24,6 +24,8 @@ public interface MessageService {
List
<
MessageUserVo
>
getList
();
List
<
MessageUserVo
>
getList
();
List
<
MessageUserVo
>
getNewList
();
List
<
MessageUserVo
>
getAllList
(
MessageSelectVo
messageSelectVo
);
List
<
MessageUserVo
>
getAllList
(
MessageSelectVo
messageSelectVo
);
List
<
MessageBto
>
getBtoList
();
List
<
MessageBto
>
getBtoList
();
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/service/impl/MessageServiceImpl.java
浏览文件 @
a915d304
...
@@ -9,17 +9,18 @@ import com.tykj.dev.device.user.read.service.MessageService;
...
@@ -9,17 +9,18 @@ import com.tykj.dev.device.user.read.service.MessageService;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.read.subject.domin.Message
;
import
com.tykj.dev.device.user.read.subject.domin.Message
;
import
com.tykj.dev.device.user.read.subject.vo.MessageUserVo
;
import
com.tykj.dev.device.user.read.subject.vo.MessageUserVo
;
import
com.tykj.dev.device.user.subject.dao.UserRecordDao
;
import
com.tykj.dev.device.user.subject.entity.UserRecord
;
import
com.tykj.dev.device.user.subject.service.UserRecordService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Comparator
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -38,6 +39,12 @@ public class MessageServiceImpl implements MessageService {
...
@@ -38,6 +39,12 @@ public class MessageServiceImpl implements MessageService {
@Autowired
@Autowired
BlockChainUtil
blockChainUtil
;
BlockChainUtil
blockChainUtil
;
@Autowired
UserRecordDao
userRecordDao
;
@Autowired
UserRecordService
userRecordService
;
@Override
@Override
public
void
add
(
MessageBto
messageBto
)
{
public
void
add
(
MessageBto
messageBto
)
{
Message
message
=
messageDao
.
save
(
messageBto
.
toDo
());
Message
message
=
messageDao
.
save
(
messageBto
.
toDo
());
...
@@ -83,12 +90,55 @@ public class MessageServiceImpl implements MessageService {
...
@@ -83,12 +90,55 @@ public class MessageServiceImpl implements MessageService {
@Override
@Override
public
List
<
MessageUserVo
>
getList
()
{
public
List
<
MessageUserVo
>
getList
()
{
Integer
userId
=
userUtils
.
getCurrentUserId
();
Integer
userId
=
userUtils
.
getCurrentUserId
();
return
messageDao
.
findAll
().
stream
()
List
<
MessageUserVo
>
messageUserVos
=
messageDao
.
findAll
().
stream
()
.
map
(
Message:
:
parse2Bto
)
.
map
(
Message:
:
parse2Bto
)
.
filter
(
messageBto
->
messageBto
.
getInvolveUserIdList
().
contains
(
userId
)&&!
messageBto
.
getCompleteUserIdList
().
contains
(
userId
))
.
filter
(
messageBto
->
messageBto
.
getInvolveUserIdList
().
contains
(
userId
)&&!
messageBto
.
getCompleteUserIdList
().
contains
(
userId
))
.
map
(
MessageBto:
:
toVo
)
.
map
(
MessageBto:
:
toVo
)
.
sorted
(
Comparator
.
comparing
(
MessageUserVo:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)).
reversed
())
.
sorted
(
Comparator
.
comparing
(
MessageUserVo:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)).
reversed
())
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
Integer
>
ids
=
messageUserVos
.
stream
().
map
(
MessageUserVo:
:
getId
).
collect
(
Collectors
.
toList
());
UserRecord
userRecord
=
userRecordDao
.
findByUserId
(
userId
);
if
(
userRecord
==
null
){
UserRecord
userRecord2
=
new
UserRecord
();
userRecord2
.
setUserId
(
userId
);
userRecord2
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
userRecord2
.
setNewReadIds
(
userRecord2
.
getReadIds
());
userRecordService
.
save
(
userRecord2
);
}
else
{
if
(
userRecord
.
getReadIds
()
==
null
)
{
userRecord
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
userRecord
.
setNewReadIds
(
userRecord
.
getReadIds
());
userRecordService
.
save
(
userRecord
);
}
else
{
List
<
Integer
>
integerList
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getReadIds
());
userRecord
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
ids
.
removeAll
(
integerList
);
userRecord
.
setNewReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
userRecordService
.
save
(
userRecord
);
}
}
return
messageUserVos
;
}
@Override
public
List
<
MessageUserVo
>
getNewList
()
{
List
<
MessageUserVo
>
messageUserVos
=
new
ArrayList
<>();
Integer
userId
=
userUtils
.
getCurrentUserId
();
UserRecord
userRecord
=
userRecordDao
.
findByUserId
(
userId
);
if
(
userRecord
==
null
){
return
messageUserVos
;
}
else
{
List
<
Integer
>
newTaskIds
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getNewReadIds
());
messageUserVos
=
messageDao
.
findAll
().
stream
()
.
map
(
Message:
:
parse2Bto
)
.
filter
(
messageBto
->
messageBto
.
getInvolveUserIdList
().
contains
(
userId
)
&&
!
messageBto
.
getCompleteUserIdList
().
contains
(
userId
)
&&
newTaskIds
.
contains
(
messageBto
.
getId
()))
.
map
(
MessageBto:
:
toVo
)
.
sorted
(
Comparator
.
comparing
(
MessageUserVo:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)).
reversed
())
.
collect
(
Collectors
.
toList
());
return
messageUserVos
;
}
}
}
@Override
@Override
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/dao/UserRecordDao.java
浏览文件 @
a915d304
...
@@ -5,4 +5,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
...
@@ -5,4 +5,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
public
interface
UserRecordDao
extends
JpaRepository
<
UserRecord
,
Integer
>,
JpaSpecificationExecutor
<
UserRecord
>
{
public
interface
UserRecordDao
extends
JpaRepository
<
UserRecord
,
Integer
>,
JpaSpecificationExecutor
<
UserRecord
>
{
UserRecord
findByUserId
(
Integer
userId
);
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/UserRecord.java
浏览文件 @
a915d304
...
@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.annotations.SQLDelete
;
import
org.hibernate.annotations.Where
;
import
org.springframework.data.annotation.CreatedBy
;
import
org.springframework.data.annotation.CreatedBy
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedBy
;
...
@@ -21,6 +23,8 @@ import java.util.Date;
...
@@ -21,6 +23,8 @@ import java.util.Date;
@Data
@Data
@Entity
@Entity
@ApiModel
(
value
=
"用户待办阅知记录对象"
,
description
=
"用户记录"
)
@ApiModel
(
value
=
"用户待办阅知记录对象"
,
description
=
"用户记录"
)
@SQLDelete
(
sql
=
"update user_record set delete_tag = 1 where id = ?"
)
@Where
(
clause
=
"delete_tag = 0"
)
public
class
UserRecord
{
public
class
UserRecord
{
@Id
@Id
...
@@ -32,14 +36,31 @@ public class UserRecord {
...
@@ -32,14 +36,31 @@ public class UserRecord {
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"userId"
)
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"userId"
)
private
Integer
userId
;
private
Integer
userId
;
@ApiModelProperty
(
value
=
"待办任务id拼接"
,
name
=
"taskIds"
)
@ApiModelProperty
(
value
=
"
省以下
待办任务id拼接"
,
name
=
"taskIds"
)
@Column
(
name
=
"task_ids"
,
columnDefinition
=
"TEXT"
)
@Column
(
name
=
"task_ids"
,
columnDefinition
=
"TEXT"
)
private
String
taskIds
;
private
String
taskIds
;
@ApiModelProperty
(
value
=
"新增省以下待办任务id拼接"
,
name
=
"taskIds"
)
@Column
(
name
=
"new_task_ids"
,
columnDefinition
=
"TEXT"
)
private
String
newTaskIds
;
@ApiModelProperty
(
value
=
"中央到省待办任务id拼接"
,
name
=
"taskIds"
)
@Column
(
name
=
"country_task_ids"
,
columnDefinition
=
"TEXT"
)
private
String
countryTaskIds
;
@ApiModelProperty
(
value
=
"新增中央到省待办任务id拼接"
,
name
=
"taskIds"
)
@Column
(
name
=
"new_country_task_ids"
,
columnDefinition
=
"TEXT"
)
private
String
newCountryTaskIds
;
@ApiModelProperty
(
value
=
"阅知任务id拼接"
,
name
=
"readIds"
)
@ApiModelProperty
(
value
=
"阅知任务id拼接"
,
name
=
"readIds"
)
@Column
(
name
=
"read_ids"
,
columnDefinition
=
"TEXT"
)
@Column
(
name
=
"read_ids"
,
columnDefinition
=
"TEXT"
)
private
String
readIds
;
private
String
readIds
;
@ApiModelProperty
(
value
=
"新阅知任务id拼接"
,
name
=
"readIds"
)
@Column
(
name
=
"new_read_ids"
,
columnDefinition
=
"TEXT"
)
private
String
newReadIds
;
@ApiModelProperty
(
value
=
"创建用户id"
)
@ApiModelProperty
(
value
=
"创建用户id"
)
@CreatedBy
@CreatedBy
private
Integer
createUserId
;
private
Integer
createUserId
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论