Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f255e863
提交
f255e863
authored
9月 13, 2021
作者:
zjm
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'dev' 到 'master'
Dev 合并master 关闭
#8
查看合并请求
!25
上级
4dc44e93
f671961a
显示空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
1123 行增加
和
54 行删除
+1123
-54
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+12
-6
BackController.java
.../com/tykj/dev/device/allot/controller/BackController.java
+202
-4
AllotBillSaveVo.java
...com/tykj/dev/device/allot/subject/vo/AllotBillSaveVo.java
+7
-1
pom.xml
dev-blockcha/pom.xml
+2
-1
pom.xml
dev-config/pom.xml
+2
-1
LogType.java
dev-config/src/main/java/com/tykj/dev/config/LogType.java
+3
-2
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+4
-3
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+119
-6
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+5
-0
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+5
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+5
-0
pom.xml
dev-misc/pom.xml
+2
-1
StatusEnum.java
...misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
+3
-1
DeviceModelSort.java
...rc/main/java/com/tykj/dev/misc/utils/DeviceModelSort.java
+14
-0
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+514
-19
RepairDetailService.java
...m/tykj/dev/device/repair/service/RepairDetailService.java
+6
-0
RepairDetailServiceImpl.java
...v/device/repair/service/impl/RepairDetailServiceImpl.java
+112
-2
BillVo.java
...in/java/com/tykj/dev/device/repair/subject/vo/BillVo.java
+2
-0
ClearRepairVo.java
.../com/tykj/dev/device/repair/subject/vo/ClearRepairVo.java
+27
-0
ClearTaskVo.java
...va/com/tykj/dev/device/repair/subject/vo/ClearTaskVo.java
+8
-0
RepairBillSaveVo.java
...m/tykj/dev/device/repair/subject/vo/RepairBillSaveVo.java
+5
-2
RevokeUnderTask.java
...om/tykj/dev/device/repair/subject/vo/RevokeUnderTask.java
+25
-0
pom.xml
dev-socket/pom.xml
+2
-1
TaskService.java
...in/java/com/tykj/dev/device/task/service/TaskService.java
+7
-0
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+5
-0
UnitsService.java
...om/tykj/dev/device/user/subject/service/UnitsService.java
+9
-0
UnitsServiceImpl.java
...ev/device/user/subject/service/impl/UnitsServiceImpl.java
+13
-3
UserServiceImpl.java
...dev/device/user/subject/service/impl/UserServiceImpl.java
+3
-1
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
f255e863
...
...
@@ -214,13 +214,15 @@ public class AllotBillController {
//直接发起
if
(
allotBillSaveVo
.
getTaskId
()
==
null
)
{
// TaskBto taskBto = new TaskBto(StatusEnum.ALLOTING.id, allotBillSaveVo.getSendUnit() + "配发型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件至" + allotBillSaveVo.getReceiveUnit(), null, ".", billId, 3, userPublicService.findUnitIdByName(allotBillSaveVo.getReceiveUnit()), 1, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOTING
.
id
,
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
null
,
"."
,
billId
,
3
,
userPublicService
.
findUnitIdByName
(
allotBillSaveVo
.
getReceiveUnit
()),
1
,
null
,
userIds
);
// TaskBto taskBto = new TaskBto(StatusEnum.ALLOTING.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3)+"]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件" , null, ".", billId, 3, userPublicService.findUnitIdByName(allotBillSaveVo.getReceiveUnit()), 1, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOTING
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
null
,
"."
,
billId
,
3
,
userPublicService
.
findUnitIdByName
(
allotBillSaveVo
.
getReceiveUnit
()),
1
,
null
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto
);
}
//从草稿发起
else
{
TaskBto
taskBto
=
taskService
.
get
(
allotBillSaveVo
.
getTaskId
());
taskBto
.
setTitle
(
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
);
// taskBto.setTitle("["+allotBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件");
taskBto
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
);
//添加当前操作人为涉及人员
TaskBto
taskBto1
=
taskService
.
addInvolveUser
(
taskBto
,
userId
);
//任务所属单位改为收件单位
...
...
@@ -229,20 +231,23 @@ public class AllotBillController {
saveEntity
=
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
ALLOTING
,
0
);
}
//生成发件方上传配发单的子任务
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_ALLOT_FILE
.
id
,
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
saveEntity
.
getId
(),
saveEntity
.
getNodeIdDetail
()
+
saveEntity
.
getId
()
+
"."
,
saveEntity
.
getBillId
(),
3
,
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
// TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_ALLOT_FILE.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 3, userPublicService.findUnitIdByName(allotBillEntity.getSendUnit()), 0, null, Collections.singletonList(0));
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_ALLOT_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
saveEntity
.
getId
(),
saveEntity
.
getNodeIdDetail
()
+
saveEntity
.
getId
()
+
"."
,
saveEntity
.
getBillId
(),
3
,
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
taskService
.
start
(
taskBto2
);
}
//横向配发
else
{
//直接发起
if
(
allotBillSaveVo
.
getTaskId
()
==
null
)
{
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_CROSS_FILE
.
id
,
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
null
,
"."
,
billId
,
3
,
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getSendUnit
()),
1
,
"country"
,
userIds
);
// TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_CROSS_FILE.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件", null, ".", billId, 3, userPublicService.findUnitIdByName(allotBillEntity.getSendUnit()), 1, "country", userIds);
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_CROSS_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
null
,
"."
,
billId
,
3
,
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getSendUnit
()),
1
,
"country"
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto2
);
}
//从草稿发起
else
{
TaskBto
taskBto
=
taskService
.
get
(
allotBillSaveVo
.
getTaskId
());
taskBto
.
setTitle
(
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
);
// taskBto.setTitle("["+allotBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件");
taskBto
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
);
taskBto
.
setCustomInfo
(
"country"
);
//添加当前操作人为涉及人员
TaskBto
taskBto1
=
taskService
.
addInvolveUser
(
taskBto
,
userId
);
...
...
@@ -495,7 +500,8 @@ public class AllotBillController {
allotBill1
.
setSendUseraId
(
userId
);
AllotBill
allotBill
=
allotBillService
.
addEntity
(
allotBill1
);
//发起草稿任务
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOT_DRAFT
.
id
,
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
null
,
"."
,
allotBill
.
getId
(),
3
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
// TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_DRAFT.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3)+ "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件", null, ".", allotBill.getId(), 3, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOT_DRAFT
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"的装备共"
+
allotBillSaveVo
.
getAllotCount
()
+
"件"
,
null
,
"."
,
allotBill
.
getId
(),
3
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
TaskBto
taskBto1
=
taskService
.
start
(
taskBto
);
//返回保存成功的id
Integer
id
=
taskBto1
.
getId
();
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/BackController.java
浏览文件 @
f255e863
package
com
.
tykj
.
dev
.
device
.
allot
.
controller
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.tykj.dev.config.base.DeviceLifeStatus
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.allot.service.AllotBackBillService
;
import
com.tykj.dev.device.allot.subject.domin.AllotBackBill
;
...
...
@@ -15,6 +16,10 @@ import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.device.repair.subject.domin.RepairDetail
;
import
com.tykj.dev.device.repair.subject.domin.RepairSendBill
;
import
com.tykj.dev.device.repair.subject.vo.DeviceDetailVo
;
import
com.tykj.dev.device.repair.subject.vo.RevokeUnderTask
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.read.service.MessageService
;
...
...
@@ -142,8 +147,8 @@ public class BackController {
TaskBto
saveEntity
;
//直接发起
if
(
allotBillSaveVo
.
getTaskId
()==
null
)
{
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOT_BACKING
.
id
,
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
null
,
"."
,
billId
,
22
,
userPublicService
.
findUnitIdByName
(
allotBillSaveVo
.
getReceiveUnit
()),
1
,
null
,
userIds
);
// TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_BACKING.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3)+"]型号"+StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"的装备共有"+allotBillSaveVo.getAllotCount()+"件", null, ".", billId, 22, userPublicService.findUnitIdByName(allotBillSaveVo.getReceiveUnit()), 1, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOT_BACKING
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
()
)+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
null
,
"."
,
billId
,
22
,
userPublicService
.
findUnitIdByName
(
allotBillSaveVo
.
getReceiveUnit
()),
1
,
null
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto
);
}
//从草稿发起
...
...
@@ -157,7 +162,8 @@ public class BackController {
saveEntity
=
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
ALLOT_BACKING
,
0
);
}
//生成发件方上传退回单的子任务
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_BACK_FILE_2
.
id
,
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
saveEntity
.
getId
(),
saveEntity
.
getNodeIdDetail
()
+
saveEntity
.
getId
()
+
"."
,
saveEntity
.
getBillId
(),
22
,
userPublicService
.
findUnitIdByName
(
allotBackBill1
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
// TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_FILE_2.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3)+"]型号"+StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"的装备共有"+allotBillSaveVo.getAllotCount()+"件", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 22, userPublicService.findUnitIdByName(allotBackBill1.getSendUnit()), 0, null, Collections.singletonList(0));
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_BACK_FILE_2
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
saveEntity
.
getId
(),
saveEntity
.
getNodeIdDetail
()
+
saveEntity
.
getId
()
+
"."
,
saveEntity
.
getBillId
(),
22
,
userPublicService
.
findUnitIdByName
(
allotBackBill1
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
taskService
.
start
(
taskBto2
);
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
//存装备日志
...
...
@@ -496,7 +502,8 @@ public class BackController {
allotBackBill
.
setSendUseraId
(
userId
);
AllotBackBill
allotBackBill1
=
allotBackBillService
.
addEntity
(
allotBackBill
);
//发起草稿任务
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
BACK_DRAFT
.
id
,
"["
+
allotBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
null
,
"."
,
allotBackBill1
.
getId
(),
22
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
// TaskBto taskBto = new TaskBto(StatusEnum.BACK_DRAFT.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3)+"]型号"+StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"的装备共有"+allotBillSaveVo.getAllotCount()+"件", null, ".", allotBackBill1.getId(), 22, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
BACK_DRAFT
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
null
,
"."
,
allotBackBill1
.
getId
(),
22
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
TaskBto
taskBto1
=
taskService
.
start
(
taskBto
);
//返回保存成功的id
Integer
id
=
taskBto1
.
getId
();
...
...
@@ -689,4 +696,195 @@ public class BackController {
return
ResponseEntity
.
ok
(
allotBackBillService
.
getFileList
(
taskId
));
}
@ApiOperation
(
value
=
"省直属发起退回业务"
,
notes
=
"可以通过这个接口发起退回任务"
)
@PostMapping
(
value
=
"/addDirectlyUnderBackBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addDirectlyUnderBackBill
(
@RequestBody
@Validated
AllotBillSaveVo
allotBillSaveVo
)
{
//当前登录单位的级别
Integer
currentUnitLevel
=
userUtils
.
getCurrentUnitLevel
();
AllotBackBill
allotBackBill1
=
new
AllotBackBill
();
if
(
currentUnitLevel
==
1
){
//判断发起退回的装备的生命状态
if
(
allotBillSaveVo
.
getAllotCheckDetail
()!=
null
&&
allotBillSaveVo
.
getAllotCheckDetail
().
length
()>
0
)
{
deviceLibraryService
.
isInStockOrWaitRetired
(
StringSplitUtil
.
split
(
allotBillSaveVo
.
getAllotCheckDetail
()));
}
//1.添加退回单
AllotBackBill
a
=
allotBillSaveVo
.
toBackDo
();
//保存后的实体
AllotBackBill
allotBackBill
;
//如果是直接发起(不是草稿,没有taskId),当前操作人为发件方A岗,添加账单
if
(
allotBillSaveVo
.
getTaskId
()==
null
){
// a.setSendUseraId(userUtils.getCurrentUserId());
allotBackBill
=
allotBackBillService
.
addEntity
(
a
);
}
//从草稿发起
else
{
//获取草稿账单
allotBackBill
=
allotBackBillService
.
getOne
(
taskService
.
get
(
allotBillSaveVo
.
getTaskId
()).
getBillId
());
//copy非null相同字段值
MapperUtils
.
copyNoNullProperties
(
a
,
allotBackBill
);
//判断是否取消上传申请单和批复单据
if
(
a
.
getApplyFiles
()==
null
||
""
.
equals
(
a
.
getApplyFiles
())){
allotBackBill
.
setApplyFiles
(
null
);
}
if
(
a
.
getReplyFiles
()==
null
||
""
.
equals
(
a
.
getReplyFiles
())){
allotBackBill
.
setReplyFiles
(
null
);
}
allotBackBill
=
allotBackBillService
.
update
(
allotBackBill
);
}
//按照当前时间和保存账单的id拼接生成退回单号并保存
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
String
num
=
"NO:第"
+
year
+
"TH"
+
allotBackBill
.
getId
()
+
"号"
;
allotBackBill
.
setNum
(
num
);
//进行赋值
BeanUtils
.
copyProperties
(
allotBillSaveVo
,
allotBackBill
);
allotBackBill1
=
allotBackBillService
.
update
(
allotBackBill
);
Integer
billId
=
allotBackBill
.
getId
();
Integer
userId
=
userUtils
.
getCurrentUserId
();
String
deviceIdDetail
=
allotBackBill
.
getBackCheckDetail
();
//2.发起任务
//构建task涉及人员集合
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
//保存后的taskBto
TaskBto
saveEntity
=
new
TaskBto
();
//直接发起
if
(
allotBillSaveVo
.
getTaskId
()==
null
)
{
// TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_BACK_UNDER_DRAFT.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3)+"]型号"+StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"的装备共有"+allotBillSaveVo.getAllotCount()+"件", null, ".", billId, 22, userPublicService.findUnitIdByName(allotBillSaveVo.getReceiveUnit()), 1, "country", userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_BACK_UNDER_DRAFT
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
null
,
"."
,
billId
,
22
,
userPublicService
.
findUnitIdByName
(
allotBillSaveVo
.
getReceiveUnit
()),
1
,
"country"
,
userIds
);
taskService
.
moveToEnd
(
taskBto
);
}
//从草稿发起
else
{
TaskBto
taskBto
=
taskService
.
get
(
allotBillSaveVo
.
getTaskId
());
//添加当前操作人为涉及人员
TaskBto
taskBto1
=
taskService
.
addInvolveUser
(
taskBto
,
userId
);
taskBto1
.
setCustomInfo
(
"country"
);
//任务所属单位改为收件单位
taskBto1
.
setOwnUnit
(
userPublicService
.
findUnitIdByName
(
allotBillSaveVo
.
getReceiveUnit
()));
taskService
.
moveToEnd
(
taskBto
);
}
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
//存装备日志
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存放所有出库装备id
List
<
Integer
>
ids
=
new
ArrayList
<>();
for
(
String
s
:
strings
)
{
if
(
s
.
length
()
>=
2
)
{
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
ids
.
add
(
id
);
//改变装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
2
);
deviceLibraryEntity
.
setManageStatus
(
0
);
deviceLibraryEntity
.
setOwnUnit
(
allotBackBill
.
getReceiveUnit
());
deviceLibraryEntity
.
setLocationUnit
(
allotBackBill
.
getReceiveUnit
());
deviceLibraryService
.
update
(
deviceLibraryEntity
);
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"对"
+
allotBackBill
.
getReceiveUnit
()
+
"发起退回"
,
fileVoList
,
saveEntity
.
getId
(),
saveEntity
.
getId
());
deviceLogService
.
addLog
(
deviceLogDto
);
}
}
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
ids
,
userUtils
.
getCurrentUnitId
(),
1
);
//发送阅知信息
List
<
Integer
>
idList
=
userPublicService
.
findOtherUser
(
userId
);
idList
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
allotBackBill
.
getReceiveUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
//给被选签发人推阅知
if
(
allotBillSaveVo
.
getSendUserbId
()!=
null
)
{
List
<
Integer
>
idList1
=
new
ArrayList
<>();
idList1
.
add
(
allotBillSaveVo
.
getSendUserbId
());
MessageBto
messageBto
=
new
MessageBto
(
saveEntity
.
getId
(),
saveEntity
.
getBusinessType
(),
"被选为签发人"
,
idList1
,
1
);
messageService
.
add
(
messageBto
);
}
//给同单位专管员和收件单位专管员推阅知
MessageBto
messageBto
=
new
MessageBto
(
saveEntity
.
getId
(),
saveEntity
.
getBusinessType
(),
"对"
+
userPublicService
.
getAreaNameByUnitName
(
allotBackBill
.
getReceiveUnit
())
+
"发起退回"
,
idList
,
1
);
messageService
.
add
(
messageBto
);
log
.
info
(
"[退回模块]:"
+
allotBackBill
.
getSendUnit
()
+
"对"
+
allotBackBill
.
getReceiveUnit
()
+
"发起退回"
);
//添加taskId
allotBackBill1
.
setTaskId
(
saveEntity
.
getId
());
myWebSocket
.
sendMessage1
();
}
return
ResponseEntity
.
ok
(
new
ResultObj
(
allotBackBill1
,
"发起成功"
));
}
@ApiOperation
(
value
=
"保存省直属退回操作(草稿)"
,
notes
=
"可以通过这个接口保存退回操作"
)
@PostMapping
(
value
=
"/saveUnderBackBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
saveUnderBackBill
(
@RequestBody
AllotBillSaveVo
allotBillSaveVo
)
{
//判断装备的生命状态是否能退回
if
(
allotBillSaveVo
.
getAllotCheckDetail
()!=
null
&&
allotBillSaveVo
.
getAllotCheckDetail
().
length
()>
0
)
{
deviceLibraryService
.
isInStockOrWaitRetired
(
StringSplitUtil
.
split
(
allotBillSaveVo
.
getAllotCheckDetail
()));
}
//第一次保存(没有taskId)
if
(
allotBillSaveVo
.
getTaskId
()==
null
){
Integer
userId
=
userUtils
.
getCurrentUserId
();
//保存退回单
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
//转Do
AllotBackBill
allotBackBill
=
allotBillSaveVo
.
toBackDo
();
//状态设为草稿
allotBackBill
.
setBackStatus
(
1
);
//发件A岗设为当前操作人
allotBackBill
.
setReceiveUseraId
(
userId
);
BeanUtils
.
copyProperties
(
allotBillSaveVo
,
allotBackBill
);
//按照当前时间和保存账单的id拼接生成退回单号并保存
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
String
num
=
"NO:第"
+
year
+
"TH"
+
allotBackBill
.
getId
()
+
"号"
;
allotBackBill
.
setNum
(
num
);
AllotBackBill
allotBackBill1
=
allotBackBillService
.
addEntity
(
allotBackBill
);
//发起草稿任务
// TaskBto taskBto = new TaskBto(StatusEnum.BACK_UNDER_DRAFT.id, "["+allotBillSaveVo.getReceiveUnit().substring(0,3)+"]型号"+StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"的装备共有"+allotBillSaveVo.getAllotCount()+"件", null, ".", allotBackBill1.getId(), 22, userUtils.getCurrentUnitId(), 0, "country", userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
BACK_UNDER_DRAFT
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
allotBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
allotBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))+
"的装备共有"
+
allotBillSaveVo
.
getAllotCount
()+
"件"
,
null
,
"."
,
allotBackBill1
.
getId
(),
22
,
userUtils
.
getCurrentUnitId
(),
0
,
"country"
,
userIds
);
TaskBto
taskBto1
=
taskService
.
start
(
taskBto
);
//返回保存成功的id
Integer
id
=
taskBto1
.
getId
();
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"保存成功"
+
id
);
}
else
{
//更新账单
TaskBto
taskBto
=
taskService
.
get
(
allotBillSaveVo
.
getTaskId
());
AllotBackBill
allotBackBill
=
allotBackBillService
.
getOne
(
taskBto
.
getBillId
());
AllotBackBill
allotBackBill1
=
allotBillSaveVo
.
toBackDo
();
//状态设为草稿
allotBackBill1
.
setBackStatus
(
1
);
MapperUtils
.
copyNoNullProperties
(
allotBackBill1
,
allotBackBill
);
allotBackBillService
.
update
(
allotBackBill
);
return
ResponseEntity
.
ok
(
"更新成功"
+
taskBto
.
getId
());
}
}
@ApiOperation
(
value
=
"省直属草稿的撤回"
,
notes
=
"可以通过这个接口保存维修操作"
)
@PostMapping
(
value
=
"/revokeUnderBackBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
revokeUnderBackBill
(
@RequestBody
RevokeUnderTask
revokeUnderTask
)
{
Integer
taskId
=
revokeUnderTask
.
getTaskId
();
List
<
DeviceDetailVo
>
deviceDetailVos
=
revokeUnderTask
.
getDeviceDetailVos
();
//取出装备id
List
<
Integer
>
deviceIds
=
deviceDetailVos
.
stream
().
map
(
DeviceDetailVo:
:
getDeviceId
).
collect
(
Collectors
.
toList
());
//根据taskId查询task
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
//查询账单
Integer
billId
=
taskBto
.
getBillId
();
//查询退回单
AllotBackBill
allotBackBill
=
allotBackBillService
.
getOne
(
billId
);
//修改装备得所属所在
deviceLibraryService
.
updateLocalAndOwn
(
allotBackBill
.
getReceiveUnit
(),
deviceIds
);
allotBackBillService
.
deleteByAllotBackId
(
billId
);
taskService
.
deleteById
(
taskId
);
return
ResponseEntity
.
ok
(
"撤回成功"
);
}
}
dev-allot/src/main/java/com/tykj/dev/device/allot/subject/vo/AllotBillSaveVo.java
浏览文件 @
f255e863
...
...
@@ -51,14 +51,20 @@ public class AllotBillSaveVo {
@ApiModelProperty
(
value
=
"发件方(B岗位)"
)
private
Integer
sendUserbId
;
@ApiModelProperty
(
value
=
"发件经办人id(A岗位)"
)
private
Integer
sendUseraId
;
// @ApiModelProperty(value = "签章审核方")
// private Integer confirmUserId;
// @NotNull(message = "receiveUseraId不能为空")
@Min
(
value
=
1
,
message
=
"receiveUseraId不能小于1"
)
//
@Min(value = 1,message = "receiveUseraId不能小于1")
@ApiModelProperty
(
value
=
"收件方(A岗位)"
)
private
Integer
receiveUseraId
;
@ApiModelProperty
(
value
=
"收件方审核人id(B岗位)"
)
private
Integer
receiveUserbId
;
// @NotNull(message = "fileName不能为空")
@ApiModelProperty
(
value
=
"账单文件名"
)
private
String
fileName
;
...
...
dev-blockcha/pom.xml
浏览文件 @
f255e863
...
...
@@ -15,10 +15,11 @@
</parent>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.7
0
</version>
<version>
1.2.7
8
</version>
</dependency>
<dependency>
<groupId>
com.amazonaws
</groupId>
...
...
dev-config/pom.xml
浏览文件 @
f255e863
...
...
@@ -52,10 +52,11 @@
<!-- <version>0.0.4</version>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.
46
</version>
<version>
1.2.
78
</version>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
...
...
dev-config/src/main/java/com/tykj/dev/config/LogType.java
浏览文件 @
f255e863
...
...
@@ -328,6 +328,7 @@ public enum LogType {
REPAIR_SEND_19
(
129
,
REPAIR
.
id
,
REPAIR_SEND_WAIT_SIGN
.
id
,
END
.
id
,
"上传相关单据,业务办结"
),
REPAIR_SEND_20
(
130
,
REPAIR
.
id
,
REPAIR_SEND_WAIT_SIGN
.
id
,
WAIT_UPLOAD_FILE
.
id
,
"盖电子签章并入库"
),
REPAIR_SEND_21
(
131
,
REPAIR
.
id
,
REPAIR_SEND_SIGN_WAIT_CONFIRM
.
id
,
WAIT_RECEIVE
.
id
,
"拒绝电子签章申请"
),
// REPAIR_SEND_22(131,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, WAIT_RECEIVE.id, "拒绝电子签章申请"),
REPAIR_BACK_14
(
132
,
REPAIR
.
id
,
ORIGIN_STATUS
.
id
,
REPAIR_BACK_SIGN_WAIT_CONFIRM
.
id
,
"申请电子签章"
),
REPAIR_BACK_16
(
134
,
REPAIR
.
id
,
REPAIR_BACK_SIGN_WAIT_CONFIRM
.
id
,
REPAIR_BACK_DRAFT
.
id
,
"拒绝电子签章申请"
),
...
...
@@ -337,7 +338,6 @@ public enum LogType {
REPAIR_BACK_19
(
137
,
REPAIR
.
id
,
REPAIR_BACK_WAIT_SIGN
.
id
,
END
.
id
,
"盖电子签章并出库"
),
// REPAIR_BACK_20(138,REPAIR.id, REPAIR_BACK_WAIT_SIGN.id, WAIT_UPLOAD_BACK_FILE.id, "盖电子签章并入库"),
REPAIR_BACK_20
(
138
,
REPAIR
.
id
,
REPAIR_BACK_WAIT_SIGN
.
id
,
WAIT_UPLOAD_BACK_FILE
.
id
,
"上传签收单"
),
REPAIR_BACK_21
(
139
,
REPAIR
.
id
,
REPAIR_BACK_SIGN_WAIT_CONFIRM
.
id
,
WAIT_BACK_RECEIVE
.
id
,
"拒绝电子签章申请"
),
APPLY_7
(
140
,
APPLY
.
id
,
WAIT_APPLY_FILE
.
id
,
END
.
id
,
"申请不同意,业务办结"
),
// ALLOT_BACK_16(141,ALLOT_BACK.id, BACK_DRAFT.id, ALLOT_BACKING.id, "从草稿发起退回"),
...
...
@@ -372,7 +372,8 @@ public enum LogType {
SELF_CHECK_7
(
169
,
SELF_CHECK
.
id
,
ORIGIN_STATUS
.
id
,
WAIT_SELF_CHECK
.
id
,
"待自查任务"
),
//[业务操作日志]存储失败:找不到业务类型为+4,旧状态为400,新状态为8888的日志模板
SELF_CHECK_8
(
170
,
SELF_CHECK
.
id
,
WAIT_SELF_CHECK
.
id
,
ARCHIVE
.
id
,
"核查结束,系统发起的自查自动结束"
),
;
REPAIR_BACK_21
(
171
,
REPAIR
.
id
,
ORIGIN_STATUS
.
id
,
REPAIR_SEND_UNDER_DRAFT
.
id
,
"省直属等待出库"
),
ALLOT_BACK_21
(
172
,
ALLOT_BACK
.
id
,
ORIGIN_STATUS
.
id
,
BACK_UNDER_DRAFT
.
id
,
"省直属等待出库"
);
public
Integer
id
;
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
f255e863
...
...
@@ -688,9 +688,7 @@ public class DeviceCheckController {
//根据detail userC为省且任务状态是完结状态时 变为无误 否则是等待省审核
Integer
detailId
=
task
.
getBillId
();
Integer
userCId
=
detailRepo
.
findById
(
detailId
).
get
().
getUserCId
();
if
(
task
.
getBillStatus
().
equals
(
END
.
id
)
&&
Objects
.
nonNull
(
userCId
)
&&
userCId
!=
0
&&
userIsProv
(
userCId
)){
if
(
task
.
getBillStatus
().
equals
(
END
.
id
)
&&
userIsProv
(
userCId
)){
checkResult
=
"无误"
;
}
else
{
checkResult
=
"等待省审核"
;
...
...
@@ -733,6 +731,9 @@ public class DeviceCheckController {
* @return
*/
private
boolean
userIsProv
(
Integer
userId
)
{
if
(
Objects
.
isNull
(
userId
)
||
userId
==
0
){
return
false
;
}
Integer
unitsId
=
userService
.
findById
(
userId
).
getUnitsId
();
Integer
level
=
unitsRepo
.
findById
(
unitsId
).
get
().
getLevel
();
return
level
==
1
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
f255e863
...
...
@@ -292,8 +292,125 @@ public class DeviceLibraryController {
map
.
put
(
"models"
,
modelToSort
);
List
<
String
>
nameList
=
names
.
stream
().
distinct
().
sorted
(
Comparator
.
comparing
(
s
->
s
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"names"
,
nameList
);
// map.put("ownUnits",ownUnits);
// map.put("locationUnits",locationUnits);
List
<
String
>
finalOwnUnits
=
DeviceModelSort
.
unitToSort
(
ownUnits
);
map
.
put
(
"ownUnits"
,
finalOwnUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
List
<
String
>
finalLocationUnits
=
DeviceModelSort
.
unitToSort
(
locationUnits
);
map
.
put
(
"locationUnits"
,
finalLocationUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
map
.
put
(
"lifeStatus"
,
status
.
stream
().
map
(
integer
->
new
LifeStatusVo
(
integer
,
lifeStatusMap
.
get
(
integer
))).
collect
(
Collectors
.
toList
()));
map
.
put
(
"storageLocation"
,
storageLocation
);
//形态
List
<
TypeVo
>
typeVoList
=
types
.
stream
().
distinct
().
map
(
integer
->
new
TypeVo
(
integer
,
styleMap
.
get
(
integer
))).
sorted
(
Comparator
.
comparing
(
TypeVo:
:
getType
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"types"
,
typeVoList
);
return
ResultUtil
.
success
(
map
);
}
@ApiOperation
(
value
=
"查询省直属模糊查询核心装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@PostMapping
(
"/core/feature/under/summary"
)
public
ResponseEntity
selectUnderCoreDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
Boolean
hasModelDim
=
deviceLibrarySelectVo
.
getModelDim
()!=
null
;
Boolean
hasNameDim
=
deviceLibrarySelectVo
.
getNameDim
()!=
null
;
Boolean
hasSeqDim
=
deviceLibrarySelectVo
.
getSeqDim
()!=
null
;
Boolean
hasLocationUnitDim
=
deviceLibrarySelectVo
.
getLocationUnitDim
()!=
null
;
Boolean
hasOwnUnitDim
=
deviceLibrarySelectVo
.
getOwnUnitDim
()!=
null
;
Boolean
hasLifeStatusDim
=
deviceLibrarySelectVo
.
getLifeStatusDim
()!=
null
;
Boolean
hasUpdateTimeDim
=
deviceLibrarySelectVo
.
getUpdateTimeDim
()!=
null
;
Boolean
hasRfidCardDim
=
deviceLibrarySelectVo
.
getRfidCardDim
()!=
null
;
//库存位置
Boolean
hasStorageLocationDim
=
deviceLibrarySelectVo
.
getRfidCardDim
()!=
null
;
//形态
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
);
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
{
Boolean
containModelDim
=
!
hasModelDim
||
deviceLibrary
.
getModel
().
contains
(
deviceLibrarySelectVo
.
getModelDim
());
Boolean
containNameDim
=
!
hasNameDim
||
deviceLibrary
.
getName
().
contains
(
deviceLibrarySelectVo
.
getNameDim
());
Boolean
containSeqDim
=
!
hasSeqDim
||
deviceLibrary
.
getSeqNumber
().
contains
(
deviceLibrarySelectVo
.
getSeqDim
());
Boolean
containLocationUnitDim
=
!
hasLocationUnitDim
||
deviceLibrary
.
getLocationUnit
().
contains
(
deviceLibrarySelectVo
.
getLocationUnitDim
());
Boolean
containOwnUnitDim
=
!
hasOwnUnitDim
||
deviceLibrary
.
getOwnUnit
().
contains
(
deviceLibrarySelectVo
.
getOwnUnitDim
());
Boolean
containLifeStatusDim
=
!
hasLifeStatusDim
||
deviceLibrary
.
getLifeStatusName
().
contains
(
deviceLibrarySelectVo
.
getLifeStatusDim
());
Boolean
containUpdateTimeDim
=
!
hasUpdateTimeDim
||
sdf
.
format
(
deviceLibrary
.
getUpdateTime
()).
contains
(
deviceLibrarySelectVo
.
getUpdateTimeDim
());
Boolean
containRfidCardDim
=
!
hasRfidCardDim
||(
deviceLibrary
.
getRfidCardId
()!=
null
&&
deviceLibrary
.
getRfidCardId
().
contains
(
deviceLibrarySelectVo
.
getRfidCardDim
()));
Boolean
containStorageLocationDim
=
!
hasStorageLocationDim
||
deviceLibrary
.
getStorageLocation
().
contains
(
deviceLibrarySelectVo
.
getStorageLocationDim
());
// Boolean containTypeDim = !hasTypeDim||deviceLibrary.getType().contains(deviceLibrarySelectVo.getTypeDim());
return
containModelDim
&&
containNameDim
&&
containSeqDim
&&
containLocationUnitDim
&&
containOwnUnitDim
&&
containLifeStatusDim
&&
containUpdateTimeDim
&&
containRfidCardDim
&&
containStorageLocationDim
;
}).
collect
(
Collectors
.
toList
());
}
// List<DeviceVo> deviceVos = resultList.stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
resultList
.
forEach
(
DeviceLibrary:
:
setConfigName
);
Map
<
Integer
,
DeviceLibrary
>
nodeCollect
=
resultList
.
stream
().
collect
(
Collectors
.
toMap
(
DeviceLibrary:
:
getId
,
deviceLibraryEntity
->
deviceLibraryEntity
));
// List<Comparator<DeviceVo>> comparators = new ArrayList<>();
// if (deviceLibrarySelectVo.getOrders().size() > 0) {
// for (CustomOrder c:deviceLibrarySelectVo.getOrders()) {
// if ("model".equals(c.getCoulmn())){
// if ("ASC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getModel,Comparator.nullsFirst(String::compareTo)));
// }
// else if ("DESC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getModel,Comparator.nullsFirst(String::compareTo)).reversed());
// }
// }
// else if ("name".equals(c.getCoulmn())){
// if ("ASC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getName,Comparator.nullsFirst(String::compareTo)));
// }
// else if ("DESC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getName,Comparator.nullsFirst(String::compareTo)).reversed());
// }
// }
// else if ("seqNumber".equals(c.getCoulmn())){
// if ("ASC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getSeqNumber,Comparator.nullsFirst(String::compareTo)));
// }
// else if ("DESC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getSeqNumber,Comparator.nullsFirst(String::compareTo)).reversed());
// }
// }
// }
// }
List
<
DeviceLibrary
>
containList
=
GetTreeUtils
.
parseTreeFromDown
(
resultList
,
DeviceLibrary:
:
getId
,
deviceLibraryEntity
->
Optional
.
ofNullable
(
nodeCollect
.
get
(
deviceLibraryEntity
.
getPartParentId
())),
DeviceLibrary:
:
addChildNode
);
Page
<
DeviceLibrary
>
deviceLibraryEntities
=
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
containList
,
deviceLibrarySelectVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
Integer
,
String
>
lifeStatusMap
=
configCache
.
getLifeStatusMap
();
//
Map
<
Integer
,
String
>
styleMap
=
configCache
.
getStyleMap
();
Set
<
Integer
>
status
=
new
HashSet
<>();
List
<
String
>
models
=
new
ArrayList
<>();
List
<
String
>
names
=
new
ArrayList
<>();
List
<
String
>
ownUnits
=
new
ArrayList
<>();
List
<
String
>
locationUnits
=
new
ArrayList
<>();
Set
<
String
>
storageLocation
=
new
HashSet
<>();
//形态
List
<
Integer
>
types
=
new
ArrayList
<>();
resultList
.
forEach
(
deviceVo
->
{
deviceVo
.
setConfigName
();
status
.
add
(
deviceVo
.
getLifeStatus
());
models
.
add
(
deviceVo
.
getModel
());
names
.
add
(
deviceVo
.
getName
());
ownUnits
.
add
(
deviceVo
.
getOwnUnit
());
locationUnits
.
add
(
deviceVo
.
getLocationUnit
());
storageLocation
.
add
(
deviceVo
.
getStorageLocation
());
types
.
add
(
deviceVo
.
getType
());
});
map
.
put
(
"pages"
,
deviceLibraryEntities
);
//修改 增加排序
//做一下去重
List
<
String
>
finalModels
=
models
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
modelToSort
=
DeviceModelSort
.
modelToSort
(
finalModels
);
map
.
put
(
"models"
,
modelToSort
);
List
<
String
>
nameList
=
names
.
stream
().
distinct
().
sorted
(
Comparator
.
comparing
(
s
->
s
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"names"
,
nameList
);
List
<
String
>
finalOwnUnits
=
DeviceModelSort
.
unitToSort
(
ownUnits
);
map
.
put
(
"ownUnits"
,
finalOwnUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
List
<
String
>
finalLocationUnits
=
DeviceModelSort
.
unitToSort
(
locationUnits
);
...
...
@@ -484,12 +601,9 @@ public class DeviceLibraryController {
List
<
DeviceStatisticsVo
>
deviceStatisticsVoList
=
deviceLibraryService
.
getDeviceStatisticsPage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
(),
deviceLibrarySelectVo
.
getPageable
().
getSort
());
List
<
DeviceStatisticsVo
>
deviceStatisticsVoSorts
=
deviceStatisticsVoList
.
stream
()
.
sorted
(
Comparator
.
comparing
(
DeviceStatisticsVo:
:
getModel
).
thenComparing
(
DeviceStatisticsVo:
:
getName
)).
collect
(
Collectors
.
toList
());
// Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoList, deviceLibrarySelectVo.getPageable());
Page
<
DeviceStatisticsVo
>
deviceStatisticsVos
=
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
deviceStatisticsVoSorts
,
deviceLibrarySelectVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
Integer
,
String
>
styleMap
=
configCache
.
getStyleMap
();
// Set<String> models = deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getModel).collect(Collectors.toSet());
// Set<String> modelToSort = DeviceModelSort.modelToSort(models);
List
<
String
>
models
=
deviceStatisticsVoList
.
stream
().
map
(
DeviceStatisticsVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
modelToSort
=
DeviceModelSort
.
modelToSort
(
models
);
map
.
put
(
"pages"
,
deviceStatisticsVos
);
...
...
@@ -497,7 +611,6 @@ public class DeviceLibraryController {
//名称排序
map
.
put
(
"names"
,
deviceStatisticsVoList
.
stream
().
map
(
DeviceStatisticsVo:
:
getName
).
distinct
().
sorted
(
Comparator
.
comparing
(
String:
:
toString
)).
collect
(
Collectors
.
toList
()));
//形态
// map.put("typeName",deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getTypeName).distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList()));
List
<
Integer
>
types
=
deviceStatisticsVoList
.
stream
().
map
(
DeviceStatisticsVo:
:
getType
).
distinct
().
collect
(
Collectors
.
toList
());
Collections
.
sort
(
types
);
map
.
put
(
"types"
,
types
.
stream
().
map
(
integer
->
new
TypeVo
(
integer
,
styleMap
.
get
(
integer
))).
collect
(
Collectors
.
toList
()));
...
...
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
f255e863
...
...
@@ -174,5 +174,10 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Modifying
@Query
(
"update DeviceLibrary d set d.ownUnit = d.locationUnit ,d.lifeStatus = 2 where d.id in :deviceIds"
)
int
updateDevicesOwnUnit
(
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
@Transactional
@Modifying
@Query
(
"update DeviceLibrary d set d.ownUnit = :ownUnit,d.locationUnit = :ownUnit,d.lifeStatus = 2 where d.id in :deviceIds"
)
int
updateDevicesOwnUnit
(
@Param
(
"ownUnit"
)
String
ownUnit
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
}
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
f255e863
...
...
@@ -241,4 +241,9 @@ public interface DeviceLibraryService {
* @param deviceIds 装备id
*/
void
updateDevicesOwnUnit
(
List
<
Integer
>
deviceIds
);
/**
* @param
*/
void
updateLocalAndOwn
(
String
localUnit
,
List
<
Integer
>
deviceIds
);
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
f255e863
...
...
@@ -735,6 +735,11 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceLibraryDao
.
updateDevicesOwnUnit
(
deviceIds
);
}
@Override
public
void
updateLocalAndOwn
(
String
localUnit
,
List
<
Integer
>
deviceIds
)
{
deviceLibraryDao
.
updateDevicesOwnUnit
(
localUnit
,
deviceIds
);
}
@Override
public
DeviceLibrary
update
(
DeviceLibrary
deviceLibraryEntity
)
{
...
...
dev-misc/pom.xml
浏览文件 @
f255e863
...
...
@@ -17,10 +17,11 @@
</parent>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.
46
</version>
<version>
1.2.
78
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
浏览文件 @
f255e863
...
...
@@ -272,6 +272,7 @@ public enum StatusEnum {
REPAIR_SEND_DRAFT
(
788
,
"等待出库"
),
REPAIR_SEND_SIGN_WAIT_CONFIRM
(
790
,
"申请签章待审核"
),
REPAIR_SEND_WAIT_SIGN
(
791
,
"等待盖章"
),
REPAIR_SEND_UNDER_DRAFT
(
799
,
"省直属等待出库"
),
/**
* 维修完成退回状态
*/
...
...
@@ -283,6 +284,7 @@ public enum StatusEnum {
REPAIR_BACK_SIGN_WAIT_CONFIRM
(
820
,
"申请签章待审核"
),
REPAIR_BACK_WAIT_SIGN
(
821
,
"等待盖章"
),
REPAIR_BACK_DRAFT
(
888
,
"等待出库"
),
REPAIR_BACK_UNDER_DRAFT
(
889
,
"省直属等待出库"
),
/**
* 配发退回状态
...
...
@@ -294,7 +296,7 @@ public enum StatusEnum {
BACK_DRAFT
(
922
,
"草稿"
),
BACK_SIGN_WAIT_CONFIRM
(
930
,
"申请签章待审核"
),
BACK_WAIT_SIGN
(
931
,
"等待盖章"
),
BACK_UNDER_DRAFT
(
932
,
"等待省直属退回"
),
/**
* 报废状态
*/
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/DeviceModelSort.java
浏览文件 @
f255e863
package
com
.
tykj
.
dev
.
misc
.
utils
;
import
com.tykj.dev.misc.exception.ApiException
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -26,6 +27,19 @@ public class DeviceModelSort {
public
static
Map
<
String
,
Integer
>
mapUnitSort
;
public
static
Map
<
String
,
String
>
mapUnitNameToDisName
;
/**
* 根据单位名称换单位的简称
*/
public
static
String
unitNameToDisName
(
String
unitName
){
if
(
mapUnitNameToDisName
.
containsKey
(
unitName
)){
return
mapUnitNameToDisName
.
get
(
unitName
);
}
else
{
throw
new
ApiException
(
"没有找到对应的单位名称替换简称:"
+
unitName
);
}
}
/**
* 列装型号排序方法
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
f255e863
...
...
@@ -139,6 +139,9 @@ public class RepairController {
@Autowired
private
RepairBillService
repairBillService
;
@Autowired
private
RepairDetailService
repairDetailService
;
@ApiOperation
(
value
=
"判断维修装备是否同一个送修单位"
,
notes
=
"可以通过这个接口判断维修装备是否同一个送修单位"
)
@PostMapping
(
value
=
"/judge"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -162,6 +165,7 @@ public class RepairController {
@PostMapping
(
value
=
"/saveRepairBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
saveRepairBill
(
@RequestBody
RepairBillSaveVo
repairBillSaveVo
)
{
Integer
currentUnitLevel
=
userUtils
.
getCurrentUnitLevel
();
//判断装备的状态是否在库或维修中
deviceLibraryService
.
isInStockOrRepairing
(
StringSplitUtil
.
split
(
repairBillSaveVo
.
getRepairDeviceCheckDetail
()));
//第一次保存
...
...
@@ -198,12 +202,18 @@ public class RepairController {
deviceRepairSendBillEntity
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
deviceRepairSendBillService
.
addEntity
(
deviceRepairSendBillEntity
);
//发起任务
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_SEND_DRAFT
.
id
,
"["
+
repairBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
// TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_SEND_DRAFT.id, "["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件",null, ".", repairBill1.getId(), 5, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_SEND_DRAFT
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
//如果是省发起的维修
if
(
currentUnitLevel
==
1
){
taskBto
.
setCustomInfo
(
"country"
);
}
TaskBto
taskBto1
=
taskService
.
start
(
taskBto
);
Integer
id
=
taskBto1
.
getId
();
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"保存成功"
+
id
+
"&"
+
s1
);
}
else
{
}
else
{
//更新账单
TaskBto
taskBto
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
RepairBill
repairBill1
=
deviceRepairBillService
.
getOne
(
taskBto
.
getBillId
());
...
...
@@ -413,10 +423,11 @@ public class RepairController {
deviceRepairSendBillEntity
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
deviceRepairSendBillEntity
.
setAgent
(
repairBillSaveVo
.
getAgent
());
if
(
repairBillSaveVo
.
getReceiveUnit
().
contains
(
"中办"
)){
deviceRepairSendBillEntity
.
setTitle
(
"["
+
repairBillSaveVo
.
getReceiveUnit
()
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
// deviceRepairSendBillEntity.setTitle("["+repairBillSaveVo.getReceiveUnit() + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件");
deviceRepairSendBillEntity
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
}
else
{
deviceRepairSendBillEntity
.
setTitle
(
"["
+
repairBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
//
deviceRepairSendBillEntity.setTitle("["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件");
deviceRepairSendBillEntity
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
}
if
(
repairBillSaveVo
.
getSendFileList
()
!=
null
&&
repairBillSaveVo
.
getSendFileList
().
size
()
>
0
)
{
deviceRepairSendBillEntity
.
setSendFiles
(
FilesUtil
.
stringFileToList
(
repairBillSaveVo
.
getSendFileList
()));
...
...
@@ -435,9 +446,11 @@ public class RepairController {
if
(
repairBillSaveVo
.
getTaskId
()
==
null
)
{
TaskBto
taskBto
;
if
(
repairBillSaveVo
.
getReceiveUnit
().
contains
(
"中办"
)){
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_FILE
.
id
,
"["
+
repairBillSaveVo
.
getReceiveUnit
()
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
"country"
,
userIds
);
// taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "["+repairBillSaveVo.getReceiveUnit() + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
"country"
,
userIds
);
}
else
{
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_FILE
.
id
,
"["
+
repairBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
"country"
,
userIds
);
// taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
"country"
,
userIds
);
}
saveEntity
=
taskService
.
start
(
taskBto
);
}
...
...
@@ -445,11 +458,12 @@ public class RepairController {
else
{
TaskBto
taskBto1
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
if
(
repairBillSaveVo
.
getReceiveUnit
().
contains
(
"中办"
)){
taskBto1
.
setTitle
(
"["
+
repairBillSaveVo
.
getReceiveUnit
()
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
// taskBto1.setTitle("["+repairBillSaveVo.getReceiveUnit() + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件");
taskBto1
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
}
else
{
taskBto1
.
setTitle
(
"["
+
repairBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
//
taskBto1.setTitle("["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件");
taskBto1
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
}
taskBto1
.
setCustomInfo
(
"country"
);
saveEntity
=
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
WAIT_UPLOAD_FILE
);
...
...
@@ -458,7 +472,8 @@ public class RepairController {
ownUnit
=
userPublicService
.
findUnitIdByName
(
repairBill
.
getReceiveUnit
());
//直接发起的
if
(
repairBillSaveVo
.
getTaskId
()
==
null
)
{
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_RECEIVE
.
id
,
"["
+
repairBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
null
,
userIds
);
// TaskBto taskBto = new TaskBto(StatusEnum.WAIT_RECEIVE.id, "["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_RECEIVE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
null
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto
);
}
//从草稿发起的
...
...
@@ -472,7 +487,8 @@ public class RepairController {
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
//生成子任务(发件方上传回执单)
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_SEND_FILE
.
id
,
"["
+
repairBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
saveEntity
.
getId
(),
saveEntity
.
getNodeIdDetail
()
+
saveEntity
.
getId
()
+
"."
,
saveEntity
.
getBillId
(),
5
,
userPublicService
.
findUnitIdByName
(
repairSendBill
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
// TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_SEND_FILE.id, "["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", saveEntity.getId(), saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(), 5, userPublicService.findUnitIdByName(repairSendBill.getSendUnit()), 0, null, Collections.singletonList(0));
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_SEND_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
saveEntity
.
getId
(),
saveEntity
.
getNodeIdDetail
()
+
saveEntity
.
getId
()
+
"."
,
saveEntity
.
getBillId
(),
5
,
userPublicService
.
findUnitIdByName
(
repairSendBill
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
taskService
.
start
(
taskBto2
);
}
for
(
DeviceDetailVo
d
:
repairBillSaveVo
.
getDeviceList
())
{
...
...
@@ -859,6 +875,7 @@ public class RepairController {
@PostMapping
(
value
=
"/saveRepairBackBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
saveRepairBackBill
(
@RequestBody
RepairBackBillSaveVo
repairBackBillSaveVo
)
{
Integer
currentUnitLevel
=
userUtils
.
getCurrentUnitLevel
();
//第一次保存
if
(
repairBackBillSaveVo
.
getTaskId
()
==
null
)
{
Integer
userId
=
userUtils
.
getCurrentUserId
();
...
...
@@ -878,7 +895,11 @@ public class RepairController {
repairBackBill1
.
setDocNum
(
s1
);
deviceRepairBackBillService
.
update
(
repairBackBill1
);
//发起任务
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_BACK_DRAFT
.
id
,
"["
+
repairBackBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
repairBackBillSaveVo
.
getScriptSaveVos
().
get
(
0
).
getModel
()
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件至"
,
null
,
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
// TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_BACK_DRAFT.id, "["+repairBackBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + repairBackBillSaveVo.getScriptSaveVos().get(0).getModel() + "共有" + repairBackBillSaveVo.getSendingCount() + "件至", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_BACK_DRAFT
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
repairBackBillSaveVo
.
getScriptSaveVos
().
get
(
0
).
getModel
()
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件至"
,
null
,
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
if
(
currentUnitLevel
==
1
){
taskBto
.
setCustomInfo
(
"country"
);
}
TaskBto
taskBto1
=
taskService
.
start
(
taskBto
);
Integer
id
=
taskBto1
.
getId
();
myWebSocket
.
sendMessage1
();
...
...
@@ -928,7 +949,8 @@ public class RepairController {
}
repairBackBill
.
setBackStatus
(
2
);
repairBackBill
.
setSendTime
(
new
Date
());
repairBackBill
.
setTitle
(
"["
+
repairBackBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
);
// repairBackBill.setTitle("["+repairBackBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBackBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBackBillSaveVo.getSendingCount() + "件");
repairBackBill
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
);
repairBackBill
.
setAgent
(
repairBackBillSaveVo
.
getAgent
());
//生成单位签章id
Long
signId2
=
snowflake
.
creatNextId
();
...
...
@@ -951,14 +973,16 @@ public class RepairController {
TaskBto
task
;
//草稿发起
if
(
repairBackBillSaveVo
.
getTaskId
()
==
null
)
{
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
"["
+
repairBackBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
deviceRepairBackBillEntity1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()),
1
,
null
,
userIds
);
// TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_BACK_RECEIVE.id, "["+repairBackBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBackBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBackBillSaveVo.getSendingCount() + "件", null, ".", deviceRepairBackBillEntity1.getId(), BusinessEnum.REPAIR_BACK.id, userPublicService.findUnitIdByName(repairBackBill.getReceiveUnit()), 1, null, userIds);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
deviceRepairBackBillEntity1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()),
1
,
null
,
userIds
);
task
=
taskService
.
start
(
taskBto1
);
}
else
{
TaskBto
taskBto1
=
taskService
.
get
(
repairBackBillSaveVo
.
getTaskId
());
taskBto1
.
setOwnUnit
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()));
task
=
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
WAIT_BACK_RECEIVE
);
}
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_BACK_SEND_FILE
.
id
,
"["
+
repairBackBillSaveVo
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
,
task
.
getId
(),
task
.
getNodeIdDetail
()
+
task
.
getId
()
+
"."
,
task
.
getBillId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
// TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_SEND_FILE.id, "["+repairBackBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBackBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBackBillSaveVo.getSendingCount() + "件", task.getId(), task.getNodeIdDetail() + task.getId() + ".", task.getBillId(), BusinessEnum.REPAIR_BACK.id, userPublicService.findUnitIdByName(repairBackBill.getSendUnit()), 0, null, Collections.singletonList(0));
TaskBto
taskBto2
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_BACK_SEND_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
,
task
.
getId
(),
task
.
getNodeIdDetail
()
+
task
.
getId
()
+
"."
,
task
.
getBillId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
taskService
.
start
(
taskBto2
);
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
...
...
@@ -1081,11 +1105,13 @@ public class RepairController {
//不缺少单据直接办结
if
(
repairReceiveVo
.
getStatus
()
==
0
)
{
userIds
.
add
(
userId
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
END
.
id
,
"["
+
repairBackBill
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairReceiveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBill
.
getReceiveCount
()
+
"件"
,
null
,
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
"country"
,
userIds
);
// TaskBto taskBto1 = new TaskBto(StatusEnum.END.id, "["+repairBackBill.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairReceiveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBackBill.getReceiveCount() + "件", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, "country", userIds);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
END
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBill
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairReceiveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBill
.
getReceiveCount
()
+
"件"
,
null
,
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
"country"
,
userIds
);
taskBto2
=
taskService
.
start
(
taskBto1
);
}
else
{
userIds
.
add
(
0
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_BACK_FILE
.
id
,
"["
+
repairBackBill
.
getReceiveUnit
().
substring
(
0
,
3
)
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairReceiveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBill
.
getReceiveCount
()
+
"件"
,
null
,
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
"country"
,
userIds
);
// TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_FILE.id, "["+repairBackBill.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairReceiveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBackBill.getReceiveCount() + "件", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, "country", userIds);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_BACK_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBill
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairReceiveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBill
.
getReceiveCount
()
+
"件"
,
null
,
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
"country"
,
userIds
);
taskBto2
=
taskService
.
start
(
taskBto1
);
}
//遍历改变维修详情
...
...
@@ -2294,6 +2320,10 @@ public class RepairController {
String
currentUserUnitName
=
userUtils
.
getCurrentUserUnitName
();
//查询维修详情
List
<
RepairDetail
>
byDeviceRepairBillId
=
repairDetailDao
.
findByDeviceRepairBillId
(
repairBill
.
getId
());
//进行过滤
// List<RepairDetail> repairDetails = byDeviceRepairBillId.stream().filter(repairDetail -> repairDetail.getRepairBackBillId() == null && repairDetail.getRepairStatus().equals(RepairStatusEnum.WAIT_REPAIR.id) && repairDetail.getLocationUnit().equals(repairDetail.getOwnUnit()))
// .collect(Collectors.toList());
List
<
RepairDetail
>
repairDetails
=
byDeviceRepairBillId
.
stream
().
filter
(
repairDetail
->
{
if
(!
repairDetail
.
getLocationUnit
().
equals
(
repairDetail
.
getOwnUnit
()))
{
return
repairDetail
.
getRepairBackBillId
()
==
null
&&
repairDetail
.
getRepairStatus
().
equals
(
RepairStatusEnum
.
WAIT_REPAIR
.
id
)
&&
repairDetail
.
getLocationUnit
().
equals
(
currentUserUnitName
);
...
...
@@ -2429,7 +2459,7 @@ public class RepairController {
@Autowired
private
Executor
executor
;
@GetMapping
(
"updateRemark"
)
@ApiOperation
(
"
通过任务id查询维修退回账单中文件
"
)
@ApiOperation
(
"
更新备注
"
)
public
void
updateRemark
(
UpdateRemarkVos
updateRemarkVos
){
List
<
UpdateRemarkVo
>
remarkVos
=
updateRemarkVos
.
getUpdateRemarkVos
();
//通过维修详情id查询
...
...
@@ -2453,6 +2483,471 @@ public class RepairController {
});
}
@PostMapping
(
"AddDirectlyUnderRepairBill"
)
@ApiOperation
(
"省直属发起维修"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
AddDirectlyUnderRepairBill
(
@RequestBody
@Validated
RepairBillSaveVo
repairBillSaveVo
){
//判断装备状态是不是在库和维修中
deviceLibraryService
.
isInStockOrRepairing
(
StringSplitUtil
.
split
(
repairBillSaveVo
.
getRepairDeviceCheckDetail
()));
//存放详情id
List
<
Integer
>
detailIds
=
new
ArrayList
<>();
repairBillSaveVo
.
getDeviceList
().
forEach
(
deviceDetailVo
->
{
if
(
deviceDetailVo
.
getId
()
!=
null
)
{
detailIds
.
add
(
deviceDetailVo
.
getId
());
}
});
//判断维修详情的状态
if
(
detailIds
.
size
()
>
0
)
{
detailIds
.
forEach
(
integer
->
{
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
integer
);
if
((
repairDetail
.
getRepairStatus
()
!=
1
&&
repairDetail
.
getRepairStatus
()
!=
9
)
||
repairDetailDao
.
findAllByPid
(
repairDetail
.
getId
()).
size
()
>
0
)
{
throw
new
ApiException
(
ResponseEntity
.
status
(
303
).
body
(
"序列号"
+
repairDetail
.
getSeqNumber
()
+
"的装备已被其他专管员操作"
));
}
});
}
Integer
userId
=
userUtils
.
getCurrentUserId
();
Integer
level
=
userUtils
.
getCurrentUnitLevel
();
//添加维修单和送修单
RepairBill
repairBill
;
RepairSendBill
deviceRepairSendBillEntity
;
//草稿发起的
if
(
repairBillSaveVo
.
getTaskId
()
!=
null
)
{
repairBill
=
deviceRepairBillService
.
getOne
(
taskService
.
get
(
repairBillSaveVo
.
getTaskId
()).
getBillId
());
deviceRepairSendBillEntity
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
repairBill
.
getId
());
MapperUtils
.
copyNoNullProperties
(
repairBillSaveVo
,
repairBill
);
MapperUtils
.
copyNoNullProperties
(
repairBillSaveVo
,
deviceRepairSendBillEntity
);
}
else
{
RepairBill
repairBill1
=
new
RepairBill
();
RepairSendBill
deviceRepairSendBillEntity1
=
new
RepairSendBill
();
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
repairBill1
);
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
deviceRepairSendBillEntity1
);
repairBill
=
deviceRepairBillService
.
addEntity
(
repairBill1
);
deviceRepairSendBillEntity1
.
setDeviceRepairBillId
(
repairBill
.
getId
());
deviceRepairSendBillEntity
=
deviceRepairSendBillService
.
addEntity
(
deviceRepairSendBillEntity1
);
}
if
(
repairBillSaveVo
.
getScriptSaveVos
()
!=
null
)
{
deviceRepairSendBillEntity
.
setScriptJson
(
JacksonUtil
.
toJSon
(
repairBillSaveVo
.
getScriptSaveVos
()));
}
repairBill
.
setRepairStatus
(
2
);
//运输中
deviceRepairSendBillEntity
.
setRepairStatus
(
2
);
if
(
repairBillSaveVo
.
getRepairUseraId
()
!=
null
)
{
repairBill
.
setRepairUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getRepairUseraId
()).
getName
());
}
repairBill
.
setStartUserB
(
repairBillSaveVo
.
getAgent
());
repairBill
.
setStartUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getStartUseraId
()).
getName
());
//生成单据号
Calendar
calendar
=
Calendar
.
getInstance
();
String
s1
=
"NO:第"
+
calendar
.
get
(
Calendar
.
YEAR
)
+
"WX"
+
repairBill
.
getId
()
+
"号"
;
repairBill
.
setDocNum
(
s1
);
RepairBill
repairBill1
=
deviceRepairBillService
.
update
(
repairBill
);
//发起维修业务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
//发送时间
deviceRepairSendBillEntity
.
setSendTime
(
new
Date
());
//存放维修装备id和维修原因的组合字段
StringBuffer
stringBuffer
=
new
StringBuffer
();
//存维修详情单
// for (DeviceDetailVo d : repairBillSaveVo.getDeviceList()) {
// //存放旧详情
// RepairDetail oldRepairDetail = null;
// //从待维修列表发起维修的
// if (d.getId() != null) {
// oldRepairDetail = deviceRepairDetailService.getOne(d.getId());
// }
// stringBuffer.append(d.getDeviceId());
// stringBuffer.append("Ǵ");
// stringBuffer.append(d.getRemark());
// stringBuffer.append("Ǵ");
// //获取装备信息
// DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(d.getDeviceId());
// //待维修列表当前单位自己添加的维修记录
// if (oldRepairDetail != null && oldRepairDetail.getDeviceRepairBillId() == 0) {
// oldRepairDetail.setRemark(d.getRemark());
// oldRepairDetail.setDeviceRepairBillId(repairBill1.getId());
// oldRepairDetail.setRepairStatus(0);
// deviceRepairDetailService.update(oldRepairDetail);
// } else {
// RepairDetail repairDetail = new RepairDetail();
// //如果是下级待维修装备继续发起维修
// if (d.getId() != null) {
// //set父id
// repairDetail.setPid(d.getId());
// RepairDetail repairDetail1 = deviceRepairDetailService.getOne(d.getId());
// repairDetail1.setRepairStatus(8);
// deviceRepairDetailService.update(repairDetail1);
// }
// repairDetail.setDeviceId(d.getDeviceId());
// repairDetail.setLocationUnit(userUtils.getCurrentUserUnitName());
// repairDetail.setModel(deviceLibraryEntity.getModel());
// repairDetail.setName(deviceLibraryEntity.getName());
// repairDetail.setOwnUnit(deviceLibraryEntity.getOwnUnit());
// repairDetail.setRemark(d.getRemark());
// repairDetail.setRepairStatus(0);
// repairDetail.setRfidSurfaceId(deviceLibraryEntity.getRfidSurfaceId());
// repairDetail.setSeqNumber(deviceLibraryEntity.getSeqNumber());
// repairDetail.setType(deviceLibraryEntity.getType());
// repairDetail.setDeviceRepairBillId(repairBill1.getId());
// deviceRepairDetailService.save(repairDetail);
// }
// //如果当前为省像国家发起的
// if (level == 1) {
// deviceLibraryEntity.setLifeStatus(4);
// deviceLibraryEntity.setLocationUnit(repairBillSaveVo.getReceiveUnit());
// } else {
// deviceLibraryEntity.setLifeStatus(4);
// }
// deviceLibraryEntity.setManageStatus(0);
// deviceLibraryService.update(deviceLibraryEntity);
// //存装备日志
//// DeviceLogDto deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修", null, null);
// DeviceLogDto deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修", null, null);
// deviceLogService.addLog(deviceLogDto);
// }
//存送修单
deviceRepairSendBillEntity
.
setRepairDeviceDetail
(
stringBuffer
.
toString
());
deviceRepairSendBillEntity
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
deviceRepairSendBillEntity
.
setAgent
(
repairBillSaveVo
.
getAgent
());
// deviceRepairSendBillEntity.setTitle("["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件");
deviceRepairSendBillEntity
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
if
(
repairBillSaveVo
.
getSendFileList
()
!=
null
&&
repairBillSaveVo
.
getSendFileList
().
size
()
>
0
)
{
deviceRepairSendBillEntity
.
setSendFiles
(
FilesUtil
.
stringFileToList
(
repairBillSaveVo
.
getSendFileList
()));
}
if
(
repairBillSaveVo
.
getReceiveFileList
()
!=
null
&&
repairBillSaveVo
.
getReceiveFileList
().
size
()
>
0
)
{
deviceRepairSendBillEntity
.
setReceiveFiles
(
FilesUtil
.
stringFileToList
(
repairBillSaveVo
.
getReceiveFileList
()));
}
RepairSendBill
repairSendBill
=
deviceRepairSendBillService
.
update
(
deviceRepairSendBillEntity
);
//业务的待办所属单位
Integer
ownUnit
;
//保存后的taskBto
TaskBto
saveEntity
=
new
TaskBto
();
//当前单位其他专管员id集合
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
//省向国家发起的
if
(
level
==
1
)
{
ownUnit
=
userUtils
.
getCurrentUnitId
();
//直接发起的
if
(
repairBillSaveVo
.
getTaskId
()
==
null
)
{
// TaskBto taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "["+repairBillSaveVo.getReceiveUnit() + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_FILE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
"country"
,
userIds
);
taskService
.
moveToEnd
(
taskBto
);
}
//从草稿发起的
else
{
TaskBto
taskBto1
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
// taskBto1.setTitle("["+repairBillSaveVo.getReceiveUnit() + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件");
taskBto1
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
);
taskBto1
.
setCustomInfo
(
"country"
);
taskService
.
moveToEnd
(
taskBto1
);
}
}
for
(
DeviceDetailVo
d
:
repairBillSaveVo
.
getDeviceList
())
{
//存放旧详情
RepairDetail
oldRepairDetail
=
null
;
//从待维修列表发起维修的
if
(
d
.
getId
()
!=
null
)
{
oldRepairDetail
=
deviceRepairDetailService
.
getOne
(
d
.
getId
());
}
stringBuffer
.
append
(
d
.
getDeviceId
());
stringBuffer
.
append
(
"Ǵ"
);
stringBuffer
.
append
(
d
.
getRemark
());
stringBuffer
.
append
(
"Ǵ"
);
//获取装备信息
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
d
.
getDeviceId
());
//待维修列表当前单位自己添加的维修记录
if
(
oldRepairDetail
!=
null
&&
oldRepairDetail
.
getDeviceRepairBillId
()
==
0
)
{
oldRepairDetail
.
setRemark
(
d
.
getRemark
());
oldRepairDetail
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
oldRepairDetail
.
setRepairStatus
(
0
);
deviceRepairDetailService
.
update
(
oldRepairDetail
);
}
else
{
RepairDetail
repairDetail
=
new
RepairDetail
();
//如果是下级待维修装备继续发起维修
if
(
d
.
getId
()
!=
null
)
{
//set父id
repairDetail
.
setPid
(
d
.
getId
());
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
d
.
getId
());
repairDetail1
.
setRepairStatus
(
8
);
deviceRepairDetailService
.
update
(
repairDetail1
);
}
repairDetail
.
setDeviceId
(
d
.
getDeviceId
());
repairDetail
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
repairDetail
.
setModel
(
deviceLibraryEntity
.
getModel
());
repairDetail
.
setName
(
deviceLibraryEntity
.
getName
());
repairDetail
.
setOwnUnit
(
deviceLibraryEntity
.
getOwnUnit
());
repairDetail
.
setRemark
(
d
.
getRemark
());
repairDetail
.
setRepairStatus
(
0
);
repairDetail
.
setRfidSurfaceId
(
deviceLibraryEntity
.
getRfidSurfaceId
());
repairDetail
.
setSeqNumber
(
deviceLibraryEntity
.
getSeqNumber
());
repairDetail
.
setType
(
deviceLibraryEntity
.
getType
());
repairDetail
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
deviceRepairDetailService
.
save
(
repairDetail
);
}
//如果当前为省像国家发起的
if
(
level
==
1
)
{
deviceLibraryEntity
.
setLifeStatus
(
4
);
deviceLibraryEntity
.
setLocationUnit
(
repairBillSaveVo
.
getReceiveUnit
());
}
deviceLibraryEntity
.
setManageStatus
(
0
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
d
.
getDeviceId
(),
"向"
+
repairBillSaveVo
.
getReceiveUnit
()
+
"发起装备维修"
,
null
,
userId
,
saveEntity
.
getId
());
deviceLogService
.
addLog
(
deviceLogDto
);
}
// //gg
//获取装备id集合
String
deviceIdDetail
=
deviceRepairSendBillEntity
.
getRepairDeviceCheckDetail
();
List
<
Integer
>
idList
=
StringSplitUtil
.
split
(
deviceIdDetail
);
//如果当前为省,改变装备的所在为中办
if
(
level
==
1
)
{
//获取当前业务维修详情 记录
List
<
RepairDetail
>
repairDetailEntities
=
deviceRepairDetailService
.
findByBillId
(
repairBill
.
getId
());
//改变维修详情装备所在单位为中办,状态为维修中
repairDetailEntities
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
repairBillSaveVo
.
getReceiveUnit
());
repairDetail
.
setRepairStatus
(
1
);
deviceRepairDetailService
.
update
(
repairDetail
);
});
}
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
idList
,
userUtils
.
getCurrentUnitId
(),
1
);
//发送阅知信息
if
(
repairBillSaveVo
.
getStartUserbId
()
!=
null
)
{
List
<
Integer
>
idList1
=
new
ArrayList
<>();
idList1
.
add
(
repairBillSaveVo
.
getStartUserbId
());
MessageBto
messageBto
=
new
MessageBto
(
saveEntity
.
getId
(),
saveEntity
.
getBusinessType
(),
"被选为签发人"
,
idList1
,
1
);
messageService
.
add
(
messageBto
);
}
MessageBto
messageBto
=
new
MessageBto
(
saveEntity
.
getId
(),
saveEntity
.
getBusinessType
(),
"向"
+
userPublicService
.
getAreaNameByUnitName
(
repairBill
.
getReceiveUnit
())
+
"发起装备维修"
,
ids
,
1
);
messageService
.
add
(
messageBto
);
myWebSocket
.
sendMessage1
();
//添加taskId
repairBill1
.
setTaskId
(
saveEntity
.
getId
());
return
ResultUtil
.
success
(
repairBill1
);
}
@ApiOperation
(
value
=
"省修好装备出库给省直属"
,
notes
=
"可以通过这个接口修好装备出库"
)
@PostMapping
(
value
=
"/AddDirectlyUnderBackBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
AddDirectlyUnderBackBill
(
@RequestBody
@Validated
RepairBackBillSaveVo
repairBackBillSaveVo
)
{
//存放详情id
List
<
Integer
>
detailIds
=
new
ArrayList
<>();
repairBackBillSaveVo
.
getDeviceList
().
forEach
(
deviceDetailVo
->
{
if
(
deviceDetailVo
.
getId
()
!=
null
)
{
detailIds
.
add
(
deviceDetailVo
.
getId
());
}
});
//判断维修记录的状态
if
(
detailIds
.
size
()
>
0
)
{
detailIds
.
forEach
(
integer
->
{
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
integer
);
if
(
repairDetail
.
getRepairStatus
()
!=
2
)
{
throw
new
ApiException
(
ResponseEntity
.
status
(
303
).
body
(
"序列号"
+
repairDetail
.
getSeqNumber
()
+
"的装备已被其他专管员操作"
));
}
});
}
//获取当前维修业务,维修单
Integer
userId
=
userUtils
.
getCurrentUserId
();
//生成维修退回单
RepairBackBill
repairBackBill
;
//草稿发起
if
(
repairBackBillSaveVo
.
getTaskId
()
!=
null
)
{
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskService
.
get
(
repairBackBillSaveVo
.
getTaskId
()).
getBillId
());
MapperUtils
.
copyNoNullProperties
(
repairBackBillSaveVo
,
repairBackBill
);
}
else
{
RepairBackBill
repairBackBill1
=
new
RepairBackBill
();
BeanUtils
.
copyProperties
(
repairBackBillSaveVo
,
repairBackBill1
);
repairBackBill
=
deviceRepairBackBillService
.
save
(
repairBackBill1
);
}
repairBackBill
.
setBackStatus
(
2
);
repairBackBill
.
setSendTime
(
new
Date
());
// repairBackBill.setTitle("["+repairBackBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBackBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBackBillSaveVo.getSendingCount() + "件");
repairBackBill
.
setTitle
(
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBillSaveVo
.
getReceiveUnit
())
+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
);
repairBackBill
.
setAgent
(
repairBackBillSaveVo
.
getAgent
());
if
(
repairBackBillSaveVo
.
getScriptSaveVos
()
!=
null
)
{
repairBackBill
.
setScriptJson
(
JacksonUtil
.
toJSon
(
repairBackBillSaveVo
.
getScriptSaveVos
()));
}
RepairBackBill
deviceRepairBackBillEntity1
=
deviceRepairBackBillService
.
update
(
repairBackBill
);
Calendar
calendar
=
Calendar
.
getInstance
();
String
s1
=
"NO:第"
+
calendar
.
get
(
Calendar
.
YEAR
)
+
"LQ"
+
repairBackBill
.
getId
()
+
"号"
;
deviceRepairBackBillEntity1
.
setDocNum
(
s1
);
RepairBackBill
repairBackBill1
=
deviceRepairBackBillService
.
update
(
deviceRepairBackBillEntity1
);
//发起维修退回子业务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
TaskBto
task
=
new
TaskBto
();
//草稿发起
if
(
repairBackBillSaveVo
.
getTaskId
()
==
null
)
{
// task = new TaskBto(StatusEnum.WAIT_BACK_RECEIVE.id, "["+repairBackBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBackBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBackBillSaveVo.getSendingCount() + "件", null, ".", deviceRepairBackBillEntity1.getId(), BusinessEnum.REPAIR_BACK.id, userPublicService.findUnitIdByName(repairBackBill.getReceiveUnit()), 1, "country", userIds);
task
=
new
TaskBto
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBackBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBackBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBackBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
deviceRepairBackBillEntity1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()),
1
,
"country"
,
userIds
);
}
else
{
task
=
taskService
.
get
(
repairBackBillSaveVo
.
getTaskId
());
task
.
setOwnUnit
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()));
}
taskService
.
moveToEnd
(
task
);
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
//更新装备和详情的状态,添加装备日志
for
(
DeviceDetailVo
d
:
repairBackBillSaveVo
.
getDeviceList
())
{
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
d
.
getId
());
repairDetail
.
setRepairBackBillId
(
deviceRepairBackBillEntity1
.
getId
());
repairDetail
.
setRepairStatus
(
7
);
repairDetail
.
setBackRemark
(
d
.
getRemark
());
deviceRepairDetailService
.
update
(
repairDetail
);
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
d
.
getDeviceId
());
deviceLibraryEntity
.
setLifeStatus
(
4
);
deviceLibraryEntity
.
setManageStatus
(
0
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
d
.
getDeviceId
(),
"向"
+
repairBackBillSaveVo
.
getReceiveUnit
()
+
"退还维修装备"
,
fileVoList
,
userId
,
task
.
getId
());
deviceLogService
.
addLog
(
deviceLogDto
);
}
String
deviceIdDetail
=
repairBackBill
.
getBackCheckDetail
();
List
<
Integer
>
idList
=
StringSplitUtil
.
split
(
deviceIdDetail
);
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
idList
,
userUtils
.
getCurrentUnitId
(),
1
);
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
if
(
repairBackBillSaveVo
.
getStartUserbId
()
!=
null
)
{
List
<
Integer
>
idList1
=
new
ArrayList
<>();
idList1
.
add
(
repairBackBillSaveVo
.
getStartUserbId
());
MessageBto
messageBto
=
new
MessageBto
(
task
.
getId
(),
task
.
getBusinessType
(),
"被选为签发人"
,
idList1
,
1
);
messageService
.
add
(
messageBto
);
}
MessageBto
messageBto
=
new
MessageBto
(
task
.
getId
(),
task
.
getBusinessType
(),
"向"
+
userPublicService
.
getAreaNameByUnitName
(
repairBackBill
.
getReceiveUnit
())
+
"退回维修装备"
,
ids
,
1
);
messageService
.
add
(
messageBto
);
myWebSocket
.
sendMessage1
();
//添加taskId字段
repairBackBill1
.
setTaskId
(
task
.
getId
());
return
ResultUtil
.
success
(
repairBackBill1
);
}
@ApiOperation
(
value
=
"查询装备是否可以被清退"
)
@PostMapping
(
"/underRepair"
)
public
ClearRepairVo
underRepair
(
@RequestBody
List
<
Integer
>
deviceIds
){
return
repairDetailService
.
underRepair
(
deviceIds
);
}
@ApiOperation
(
value
=
"省直属发起维修保存草稿"
,
notes
=
"可以通过这个接口保存维修操作"
)
@PostMapping
(
value
=
"/saveRepairUnderBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
saveRepairUnderBill
(
@RequestBody
RepairBillSaveVo
repairBillSaveVo
)
{
Integer
currentUnitLevel
=
userUtils
.
getCurrentUnitLevel
();
//判断装备的状态是否在库或维修中
deviceLibraryService
.
isInStockOrRepairing
(
StringSplitUtil
.
split
(
repairBillSaveVo
.
getRepairDeviceCheckDetail
()));
//第一次保存
if
(
repairBillSaveVo
.
getTaskId
()
==
null
)
{
Integer
userId
=
userUtils
.
getCurrentUserId
();
//保存入库单
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
//添加维修单和送修单
RepairBill
repairBill
=
new
RepairBill
();
RepairSendBill
deviceRepairSendBillEntity
=
new
RepairSendBill
();
//相同字段直接拷贝
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
repairBill
);
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
deviceRepairSendBillEntity
);
//维修状态为草稿
repairBill
.
setRepairStatus
(
0
);
deviceRepairSendBillEntity
.
setRepairStatus
(
0
);
//set不相同的字段
if
(
repairBillSaveVo
.
getScriptSaveVos
()
!=
null
)
{
deviceRepairSendBillEntity
.
setScriptJson
(
JacksonUtil
.
toJSon
(
repairBillSaveVo
.
getScriptSaveVos
()));
}
if
(
repairBillSaveVo
.
getRepairUseraId
()
!=
null
)
{
repairBill
.
setRepairUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getRepairUseraId
()).
getName
());
}
repairBill
.
setRepairUserB
(
userUtils
.
getCurrentName
());
repairBill
.
setStartUserB
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getStartUserbId
()).
getName
());
repairBill
.
setStartUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getStartUseraId
()).
getName
());
RepairBill
repairBill1
=
deviceRepairBillService
.
addEntity
(
repairBill
);
//生成单据号
Calendar
calendar
=
Calendar
.
getInstance
();
String
s1
=
"NO:第"
+
calendar
.
get
(
Calendar
.
YEAR
)
+
"WX"
+
repairBill1
.
getId
()
+
"号"
;
repairBill1
.
setDocNum
(
s1
);
deviceRepairBillService
.
update
(
repairBill1
);
//set 关联id
deviceRepairSendBillEntity
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
deviceRepairSendBillService
.
addEntity
(
deviceRepairSendBillEntity
);
//发起任务
// TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_SEND_UNDER_DRAFT.id, "["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件",null, ".", repairBill1.getId(), 5, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_SEND_UNDER_DRAFT
.
id
,
"["
+
DeviceModelSort
.
unitNameToDisName
(
repairBillSaveVo
.
getReceiveUnit
())+
"]型号"
+
StringSplitUtil
.
stringListToString
(
repairBillSaveVo
.
getScriptSaveVos
().
stream
().
map
(
ScriptSaveVo:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
()))
+
"共有"
+
repairBillSaveVo
.
getSendingCount
()
+
"件"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
//如果是省发起的维修
if
(
currentUnitLevel
==
1
){
taskBto
.
setCustomInfo
(
"country"
);
}
TaskBto
taskBto1
=
taskService
.
start
(
taskBto
);
Integer
id
=
taskBto1
.
getId
();
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"保存成功"
+
id
+
"&"
+
s1
);
}
else
{
//更新账单
TaskBto
taskBto
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
RepairBill
repairBill1
=
deviceRepairBillService
.
getOne
(
taskBto
.
getBillId
());
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
repairBill1
.
getId
());
RepairBill
repairBill
=
new
RepairBill
();
RepairSendBill
deviceRepairSendBillEntity
=
new
RepairSendBill
();
//复制到新的二个对象
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
repairBill
);
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
deviceRepairSendBillEntity
);
repairBill
.
setRepairStatus
(
0
);
deviceRepairSendBillEntity
.
setRepairStatus
(
0
);
if
(
repairBillSaveVo
.
getScriptSaveVos
()
!=
null
)
{
deviceRepairSendBillEntity
.
setScriptJson
(
JacksonUtil
.
toJSon
(
repairBillSaveVo
.
getScriptSaveVos
()));
}
if
(
repairBillSaveVo
.
getRepairUseraId
()
!=
null
)
{
repairBill
.
setRepairUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getRepairUseraId
()).
getName
());
}
repairBill
.
setStartUserB
(
repairBillSaveVo
.
getAgent
());
repairBill
.
setStartUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getStartUseraId
()).
getName
());
//将新对象不为null的值拷贝到真实对象
MapperUtils
.
copyNoNullProperties
(
repairBill
,
repairBill1
);
MapperUtils
.
copyNoNullProperties
(
deviceRepairSendBillEntity
,
repairSendBill
);
deviceRepairBillService
.
update
(
repairBill1
);
deviceRepairSendBillService
.
update
(
repairSendBill
);
return
ResponseEntity
.
ok
(
"更新成功"
+
taskBto
.
getId
());
}
}
@ApiOperation
(
value
=
"省直属草稿的撤回"
,
notes
=
"可以通过这个接口保存维修操作"
)
@PostMapping
(
value
=
"/revokeUnderRepairBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
revokeRepairUnderBill
(
@RequestBody
RevokeUnderTask
revokeUnderTask
)
{
Integer
taskId
=
revokeUnderTask
.
getTaskId
();
List
<
DeviceDetailVo
>
deviceDetailVos
=
revokeUnderTask
.
getDeviceDetailVos
();
//取出装备id
List
<
Integer
>
deviceIds
=
deviceDetailVos
.
stream
().
map
(
DeviceDetailVo:
:
getDeviceId
).
collect
(
Collectors
.
toList
());
//根据taskId查询task
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
//查询账单
Integer
billId
=
taskBto
.
getBillId
();
//查询送修单和维修单
RepairSendBill
sendBill
=
repairSendBillService
.
findByRepairdId
(
billId
);
//维修详情
List
<
RepairDetail
>
byBillId
=
repairDetailService
.
findByBillId
(
billId
);
if
(
byBillId
.
size
()>
0
){
byBillId
.
forEach
(
repairDetail
->
repairDetailService
.
delete
(
repairDetail
.
getId
()));
}
repairBillService
.
delete
(
billId
);
repairSendBillService
.
delete
(
sendBill
.
getId
());
taskService
.
deleteById
(
taskId
);
deviceLibraryService
.
updateLifeStatus2
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
deviceIds
);
return
ResponseEntity
.
ok
(
"撤回成功"
);
}
@ApiOperation
(
value
=
"查询装备是否可以被清退"
)
@PostMapping
(
"/getClearTaskVo"
)
public
Map
<
Integer
,
ClearTaskVo
>
getClearTaskVo
(
@RequestBody
List
<
Integer
>
deviceIds
){
return
repairDetailService
.
getClearTaskVo
(
deviceIds
);
}
private
List
<
RepairDetail
>
sortMethod
(
List
<
CustomOrder
>
orders
,
List
<
RepairDetail
>
repairDetails2
,
List
<
RepairDetail
>
repairDetails1
){
List
<
String
>
list
=
orders
.
stream
().
map
(
CustomOrder:
:
getDirection
).
collect
(
Collectors
.
toList
());
List
<
RepairDetail
>
finalList
=
new
ArrayList
<>();
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/service/RepairDetailService.java
浏览文件 @
f255e863
...
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.repair.service;
import
com.tykj.dev.device.repair.subject.domin.RepairDetail
;
import
com.tykj.dev.device.repair.subject.vo.BillVo
;
import
com.tykj.dev.device.repair.subject.vo.ClearRepairVo
;
import
com.tykj.dev.device.repair.subject.vo.ClearTaskVo
;
import
com.tykj.dev.device.repair.subject.vo.SetDevicesOwnUnit
;
...
...
@@ -57,4 +58,9 @@ public interface RepairDetailService extends RepairPublicService<RepairDetail> {
*/
void
setDevicesOwnUnit
(
List
<
BillVo
>
billVos
);
/**
* @param deviceIds 装备id
*/
ClearRepairVo
underRepair
(
List
<
Integer
>
deviceIds
);
}
dev-repair/src/main/java/com/tykj/dev/device/repair/service/impl/RepairDetailServiceImpl.java
浏览文件 @
f255e863
...
...
@@ -7,6 +7,7 @@ import com.tykj.dev.device.library.service.DeviceLibraryService;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.Script
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.device.repair.repository.RepairBillDao
;
import
com.tykj.dev.device.repair.repository.RepairDetailDao
;
import
com.tykj.dev.device.repair.repository.RepairSendBillDao
;
import
com.tykj.dev.device.repair.service.RepairDetailService
;
...
...
@@ -14,14 +15,18 @@ import com.tykj.dev.device.repair.subject.domin.RepairBill;
import
com.tykj.dev.device.repair.subject.domin.RepairDetail
;
import
com.tykj.dev.device.repair.subject.domin.RepairSendBill
;
import
com.tykj.dev.device.repair.subject.vo.BillVo
;
import
com.tykj.dev.device.repair.subject.vo.ClearRepairVo
;
import
com.tykj.dev.device.repair.subject.vo.ClearTaskVo
;
import
com.tykj.dev.device.repair.subject.vo.SetDevicesOwnUnit
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.RepairStatusEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
...
...
@@ -30,6 +35,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
...
...
@@ -59,6 +65,12 @@ public class RepairDetailServiceImpl implements RepairDetailService {
@Autowired
RepairSendBillDao
repairSendBillDao
;
@Autowired
private
RepairBillDao
repairBillDao
;
@Autowired
private
UnitsService
unitsService
;
@Override
public
RepairDetail
save
(
RepairDetail
deviceRepairDetailEntity
)
{
RepairDetail
repairDetail
=
deviceRepairDetailDao
.
save
(
deviceRepairDetailEntity
);
...
...
@@ -160,7 +172,6 @@ public class RepairDetailServiceImpl implements RepairDetailService {
billVo
.
setRepairBillId
(
v
.
getDeviceRepairBillId
());
billVo
.
setDevicesId
(
v
.
getDeviceId
());
billVo
.
setRepairDetailId
(
v
.
getId
());
billVos
.
add
(
billVo
);
//根据装备id查询装备
DeviceLibrary
library
=
deviceLibraryService
.
getOne
(
v
.
getDeviceId
());
DeviceLibrary
deviceLibrary
=
library
.
setConfigName
();
...
...
@@ -171,8 +182,17 @@ public class RepairDetailServiceImpl implements RepairDetailService {
List
<
Task
>
tasks
=
taskList
.
stream
().
filter
(
task
->
task
.
getParentTaskId
()
==
null
).
collect
(
Collectors
.
toList
());
ClearTaskVo
clearTaskVo
=
new
ClearTaskVo
();
clearTaskVo
.
setTaskId
(
tasks
.
get
(
0
).
getId
());
clearTaskVo
.
setBusinessType
(
BusinessEnum
.
REPAIR
.
id
);
billVos
.
add
(
billVo
);
clearTaskVo
.
setBillVos
(
billVos
);
Optional
<
RepairBill
>
byId
=
repairBillDao
.
findById
(
v
.
getDeviceRepairBillId
());
byId
.
ifPresent
(
clearTaskVo:
:
setRepairBill
);
byId
.
ifPresent
(
repairBill
->
{
clearTaskVo
.
setRepairSendBill
(
repairSendBillDao
.
findByDeviceRepairBillId
(
repairBill
.
getId
()));
}
);
clearTaskVos
.
add
(
clearTaskVo
);
}
);
...
...
@@ -192,8 +212,71 @@ public class RepairDetailServiceImpl implements RepairDetailService {
return
map1
;
}
// @Override
// public Map<Integer, ClearTaskVo> getClearTaskVo(List<Integer> deviceIds) {
// List<ClearTaskVo> clearTaskVos = new ArrayList<>();
// Map<Integer,ClearTaskVo> map1 = new HashMap<>();
// //通过装备id查询出账单id (送修单repairBill)
// ClearRepairVo clearRepairVo = underRepair(deviceIds);
// List<RepairDetail> endRepairList = clearRepairVo.getEndRepairList();
// if (endRepairList.size()>0){
// //取出装备id相同的最新时间
// Map<Integer, RepairDetail> map = new HashMap<>();
// endRepairList.forEach(
// repairDetail -> {
// if (!map.containsKey(repairDetail.getDeviceId())) {
// map.put(repairDetail.getDeviceId(), repairDetail);
// }
// }
// );
// List<BillVo> billVos = new ArrayList<>();
// map.forEach(
// (k, v) -> {
// BillVo billVo = new BillVo();
// billVo.setRepairBillId(v.getDeviceRepairBillId());
// billVo.setDevicesId(v.getDeviceId());
// billVo.setRepairDetailId(v.getId());
// //根据装备id查询装备
// DeviceLibrary library = deviceLibraryService.getOne(v.getDeviceId());
// DeviceLibrary deviceLibrary = library.setConfigName();
// BeanUtils.copyProperties(deviceLibrary, billVo);
// //通过账单id和businessType查询task对象
// //过滤出状态是 StatusEnum.REVOKEALLOTTASK.id
// List<Task> taskList = taskService.findByBillIdAndBusinessType(v.getDeviceRepairBillId(), BusinessEnum.REPAIR.id);
// List<Task> tasks = taskList.stream().filter(task -> task.getParentTaskId() == null).collect(Collectors.toList());
// ClearTaskVo clearTaskVo = new ClearTaskVo();
// clearTaskVo.setTaskId(tasks.get(0).getId());
// clearTaskVo.setBusinessType(BusinessEnum.REPAIR.id);
// billVo.setBillStatus(tasks.get(0).getBillStatus());
// billVos.add(billVo);
// clearTaskVo.setBillVos(billVos);
// clearTaskVos.add(clearTaskVo);
// }
// );
// clearTaskVos.forEach(
// clearTaskVo -> {
// if (!map1.containsKey(clearTaskVo.getTaskId())) {
// map1.put(clearTaskVo.getTaskId(), clearTaskVo);
// } else {
// ClearTaskVo clearTaskVo1 = map1.get(clearTaskVo.getTaskId());
// List<BillVo> billVos1 = clearTaskVo1.getBillVos();
// billVos1.addAll(clearTaskVo.getBillVos());
// clearTaskVo1.setBillVos(billVos1);
// map1.put(clearTaskVo.getTaskId(), clearTaskVo1);
// }
// }
// );
// return map1;
// }else {
// return null;
// }
// }
@Override
public
void
setDevicesOwnUnit
(
List
<
BillVo
>
billVos
)
{
//待维修:
//1.下级送修,本级未入库,则需要先将入库任务完成则变成待维修 入库任务完成后则可以将装备的所属改为自己的 装备状态为在库
//2.本级的待维修 直接修改装备为在库
//修改装备的所属以及备注
//1 通过装备id修改装备的所属
//1.2 获取装备的id
...
...
@@ -222,4 +305,31 @@ public class RepairDetailServiceImpl implements RepairDetailService {
});
}
/**
* 查询哪些装备正在运输中(出库方已发起,但是入库方未入库) 装备是否在中办
*/
@Override
public
ClearRepairVo
underRepair
(
List
<
Integer
>
deviceIds
){
ClearRepairVo
clearRepairVo
=
new
ClearRepairVo
();
//通过装备id查询出账单id (送修单repairBill)
List
<
RepairDetail
>
repairDetails
=
deviceRepairDetailDao
.
findAllByDeviceIdIn
(
deviceIds
);
//过滤出装备在中办的
List
<
Units
>
superiorUnitsList
=
unitsService
.
findSuperiorUnitsList
();
List
<
String
>
names
=
superiorUnitsList
.
stream
().
map
(
Units:
:
getName
).
collect
(
Collectors
.
toList
());
List
<
RepairDetail
>
exceptionList
=
repairDetails
.
stream
().
filter
(
repairDetail
->
names
.
contains
(
repairDetail
.
getLocationUnit
())).
sorted
(
Comparator
.
comparing
(
RepairDetail:
:
getCreateTime
)).
collect
(
Collectors
.
toList
());
repairDetails
.
removeAll
(
exceptionList
);
//维修未入库 等待维修分为接收区装备和市发起维修
// List<RepairDetail> repairIngList = repairDetails.stream().filter(repairDetail -> Objects.equals(repairDetail.getRepairStatus(), RepairStatusEnum.WAIT_REPAIR.id)).sorted(Comparator.comparing(RepairDetail::getCreateTime)).collect(Collectors.toList());
List
<
Integer
>
repairStatus1
=
new
ArrayList
<>(
Collections
.
singletonList
(
RepairStatusEnum
.
WAIT_REPAIR
.
id
));
List
<
RepairDetail
>
repairIngList
=
repairDetails
.
stream
().
filter
(
repairDetail
->
repairStatus1
.
contains
(
repairDetail
.
getRepairStatus
()))
.
sorted
(
Comparator
.
comparing
(
RepairDetail:
:
getCreateTime
)).
collect
(
Collectors
.
toList
());
//维修已入库
List
<
Integer
>
repairStatus
=
new
ArrayList
<>(
Arrays
.
asList
(
RepairStatusEnum
.
REPAIRING
.
id
,
RepairStatusEnum
.
WAIT_SEND
.
id
,
RepairStatusEnum
.
WAIT_RECEIVE
.
id
,
RepairStatusEnum
.
RECEIVE_WAIT_STORAGE
.
id
));
List
<
RepairDetail
>
endRepairList
=
repairDetails
.
stream
().
filter
(
repairDetail
->
repairStatus
.
contains
(
repairDetail
.
getRepairStatus
())).
sorted
(
Comparator
.
comparing
(
RepairDetail:
:
getCreateTime
)).
collect
(
Collectors
.
toList
());
clearRepairVo
.
setExceptionList
(
exceptionList
);
clearRepairVo
.
setRepairingList
(
repairIngList
);
clearRepairVo
.
setEndRepairList
(
endRepairList
);
return
clearRepairVo
;
}
}
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/BillVo.java
浏览文件 @
f255e863
...
...
@@ -37,4 +37,6 @@ public class BillVo {
@ApiModelProperty
(
value
=
"可见范围"
)
private
String
invisibleRangeName
;
@ApiModelProperty
(
value
=
"设备状态描述"
)
private
String
deviceStatusDescription
;
}
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/ClearRepairVo.java
0 → 100644
浏览文件 @
f255e863
package
com
.
tykj
.
dev
.
device
.
repair
.
subject
.
vo
;
import
com.tykj.dev.device.repair.subject.domin.RepairDetail
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@ApiModel
(
"返回清退任务"
)
@AllArgsConstructor
@NoArgsConstructor
public
class
ClearRepairVo
{
@ApiModelProperty
(
value
=
"正在维修中维修详情列表"
)
private
List
<
RepairDetail
>
repairingList
;
@ApiModelProperty
(
value
=
"已入库的维修详情列表"
)
private
List
<
RepairDetail
>
endRepairList
;
@ApiModelProperty
(
value
=
"在中办的装备"
)
private
List
<
RepairDetail
>
exceptionList
;
}
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/ClearTaskVo.java
浏览文件 @
f255e863
package
com
.
tykj
.
dev
.
device
.
repair
.
subject
.
vo
;
import
com.tykj.dev.device.repair.subject.domin.RepairBill
;
import
com.tykj.dev.device.repair.subject.domin.RepairSendBill
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -22,6 +24,12 @@ public class ClearTaskVo {
@ApiModelProperty
(
value
=
"维修单详情id"
,
example
=
"1"
)
private
Integer
repairDetailId
;
@ApiModelProperty
(
value
=
"送修单"
,
example
=
"1"
)
private
RepairSendBill
repairSendBill
;
@ApiModelProperty
(
value
=
"维修单"
,
example
=
"1"
)
private
RepairBill
repairBill
;
@ApiModelProperty
(
value
=
"账单id类"
,
example
=
"1"
)
private
List
<
BillVo
>
billVos
;
}
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/RepairBillSaveVo.java
浏览文件 @
f255e863
...
...
@@ -72,11 +72,11 @@ public class RepairBillSaveVo {
@ApiModelProperty
(
value
=
"已出库装备数量"
)
private
Integer
sendedCount
;
@NotNull
(
message
=
"repairDeviceCheckDetail不能为空"
)
//
@NotNull(message = "repairDeviceCheckDetail不能为空")
@ApiModelProperty
(
value
=
"送修装备出库详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增"
)
private
String
repairDeviceCheckDetail
;
@NotNull
(
message
=
"repairDeviceCheckResult不能为空"
)
//
@NotNull(message = "repairDeviceCheckResult不能为空")
@ApiModelProperty
(
value
=
"送修装备出库检查结果"
)
private
String
repairDeviceCheckResult
;
...
...
@@ -95,6 +95,9 @@ public class RepairBillSaveVo {
@ApiModelProperty
(
value
=
"发送方附件"
)
private
List
<
FileRet
>
sendFileList
;
@ApiModelProperty
(
value
=
"收件方附件"
)
private
List
<
FileRet
>
receiveFileList
;
@ApiModelProperty
(
value
=
"单据保存vo"
)
private
List
<
ScriptSaveVo
>
scriptSaveVos
;
}
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/RevokeUnderTask.java
0 → 100644
浏览文件 @
f255e863
package
com
.
tykj
.
dev
.
device
.
repair
.
subject
.
vo
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.repair.subject.domin.RepairDetail
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@ApiModel
(
"省直属任务撤回"
)
@AllArgsConstructor
@NoArgsConstructor
public
class
RevokeUnderTask
{
@ApiModelProperty
(
value
=
"维修的装备"
)
private
List
<
DeviceDetailVo
>
deviceDetailVos
;
@ApiModelProperty
(
value
=
"任务id"
)
private
Integer
taskId
;
}
dev-socket/pom.xml
浏览文件 @
f255e863
...
...
@@ -25,10 +25,11 @@
<version>
3.5
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.
46
</version>
<version>
1.2.
78
</version>
</dependency>
</dependencies>
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/TaskService.java
浏览文件 @
f255e863
...
...
@@ -257,4 +257,11 @@ public interface TaskService {
* 根据billId和businessType获得Task
*/
List
<
Task
>
findByBillIdAndBusinessType
(
Integer
billId
,
Integer
businessType
);
/**
* 根据taskId删除task
* @param taskId 任务id
*/
void
deleteById
(
Integer
taskId
);
}
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
f255e863
...
...
@@ -1181,6 +1181,11 @@ public class TaskServiceImpl implements TaskService {
.
collect
(
Collectors
.
toList
());
}
@Override
public
void
deleteById
(
Integer
taskId
)
{
taskDao
.
deleteById
(
taskId
);
}
@Override
public
void
moveAllSonNodeToEnd
(
Integer
taaskId
)
{
List
<
Task
>
tasks
=
taskDao
.
findAllByParentTaskId
(
taaskId
);
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/UnitsService.java
浏览文件 @
f255e863
...
...
@@ -113,6 +113,14 @@ public interface UnitsService extends PublicService<Units> {
*/
List
<
String
>
findBySubordinateUnitName
(
Integer
unitsId
);
/**
* 根据单位id查询下级单位名称集合
*
* @param unitsId 单位id
* @return 单位对象
*/
List
<
Units
>
findBySubordinateUnit
(
Integer
unitsId
);
UnitsPage
selectPage
(
Integer
page
,
Integer
size
);
...
...
@@ -151,6 +159,7 @@ public interface UnitsService extends PublicService<Units> {
/**
* 省入库上级单位对象查询接口
* 国家单位
*/
List
<
Units
>
findSuperiorUnitsList
();
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UnitsServiceImpl.java
浏览文件 @
f255e863
...
...
@@ -185,7 +185,7 @@ public class UnitsServiceImpl implements UnitsService {
units1
.
add
(
units
);
units1
.
addAll
(
unitsDao
.
findAllByType
(
2
));
}
return
units1
.
stream
().
sorted
(
Comparator
.
comparing
(
Units:
:
getShowOrder
)).
collect
(
Collectors
.
toList
());
return
units1
.
stream
().
sorted
(
Comparator
.
comparing
(
Units:
:
getShowOrder
)).
distinct
().
collect
(
Collectors
.
toList
());
}
@Override
...
...
@@ -197,7 +197,7 @@ public class UnitsServiceImpl implements UnitsService {
// units1.add(units);
units1
.
addAll
(
unitsDao
.
findAllByType
(
2
));
}
return
units1
.
stream
().
sorted
(
Comparator
.
comparing
(
Units:
:
getShowOrder
)).
collect
(
Collectors
.
toList
());
return
units1
.
stream
().
sorted
(
Comparator
.
comparing
(
Units:
:
getShowOrder
)).
distinct
().
collect
(
Collectors
.
toList
());
}
@Override
...
...
@@ -212,6 +212,15 @@ public class UnitsServiceImpl implements UnitsService {
return
list
;
}
@Override
public
List
<
Units
>
findBySubordinateUnit
(
Integer
unitsId
)
{
Units
units
=
unitsDao
.
findById
(
unitsId
).
get
();
List
<
Integer
>
areaIds
=
areaDao
.
findAllByFatherId
(
units
.
getAreaId
()).
stream
().
map
(
Area:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Units
>
list
=
unitsDao
.
findAllByAreaIdIn
(
areaIds
);
list
.
add
(
units
);
return
list
;
}
@Override
public
UnitsPage
selectPage
(
Integer
page
,
Integer
size
)
{
Pageable
pageable
=
PageRequest
.
of
(
page
,
size
,
Sort
.
Direction
.
ASC
,
"level"
);
...
...
@@ -332,7 +341,7 @@ public class UnitsServiceImpl implements UnitsService {
@Override
public
LeftNavigation
findLeftNavigation2
(
SecurityUser
securityUser
)
{
List
<
LeftNavigation
>
leftNavigationList2
=
unitsDao
.
findAllByType
(
2
).
stream
().
filter
(
units1
->
!
units1
.
getName
().
equals
(
"省
应急小组"
)&&
!
units1
.
getName
().
equals
(
"省
机科技管理处"
)&&
!
units1
.
getName
().
equals
(
"省机通信报务处"
)).
map
(
Units:
:
toLeftNavigation
).
collect
(
Collectors
.
toList
());
List
<
LeftNavigation
>
leftNavigationList2
=
unitsDao
.
findAllByType
(
2
).
stream
().
filter
(
units1
->
!
units1
.
getName
().
equals
(
"省机科技管理处"
)&&
!
units1
.
getName
().
equals
(
"省机通信报务处"
)).
map
(
Units:
:
toLeftNavigation
).
collect
(
Collectors
.
toList
());
LeftNavigation
leftNavigation2
=
new
LeftNavigation
(
0
,
"省直属"
,
leftNavigationList2
,
UUID
.
randomUUID
().
toString
(),
1
,
22
,
null
);
return
leftNavigation2
;
}
...
...
@@ -408,6 +417,7 @@ public class UnitsServiceImpl implements UnitsService {
@Override
public
void
addUnitSortMap
()
{
DeviceModelSort
.
mapUnitSort
=
unitsDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
Units:
:
getName
,
Units:
:
getShowOrder
));
DeviceModelSort
.
mapUnitNameToDisName
=
unitsDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
Units:
:
getName
,
Units:
:
getUnitDesc
));
}
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UserServiceImpl.java
浏览文件 @
f255e863
...
...
@@ -370,7 +370,9 @@ public class UserServiceImpl implements UserService {
@Override
public
MemberThat
findById
(
Integer
userId
)
{
MemberThat
memberThat
=
userDao
.
findById
(
userId
).
get
().
toVo
();
MemberThat
memberThat
=
userDao
.
findById
(
userId
)
.
orElseThrow
(()
->
new
ApiException
(
"没有找到指定userId = {}的用户"
,
userId
))
.
toVo
();
Mgrcert
mgrcert
=
mgrcertDao
.
findByUserId
(
userId
);
memberThat
.
setUnitsName
(
unitsService
.
findById
(
memberThat
.
getUnitsId
()).
getName
());
if
(
mgrcert
!=
null
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论