Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
8bf077a4
提交
8bf077a4
authored
4月 13, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
853c2536
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
107 行增加
和
378 行删除
+107
-378
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+3
-1
BackController.java
.../com/tykj/dev/device/allot/controller/BackController.java
+3
-1
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+10
-9
PackingLibraryDao.java
...tykj/dev/device/packing/repository/PackingLibraryDao.java
+2
-0
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+1
-1
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+47
-342
FileUploadVo.java
...a/com/tykj/dev/device/repair/subject/vo/FileUploadVo.java
+4
-1
DeviceRetiredController.java
...ev/device/retired/controller/DeviceRetiredController.java
+30
-23
DeviceRetiredResultVo.java
...j/dev/device/retired/entity/vo/DeviceRetiredResultVo.java
+7
-0
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
8bf077a4
...
...
@@ -154,7 +154,9 @@ public class AllotBillController {
}
//1.添加配发单
AllotBill
a
=
allotBillSaveVo
.
toDo
();
a
.
setSendUseraId
(
userUtils
.
getCurrentUserId
());
if
(
allotBillSaveVo
.
getTaskId
()==
null
)
{
a
.
setSendUseraId
(
userUtils
.
getCurrentUserId
());
}
AllotBill
allotBillEntity
;
if
(
allotBillSaveVo
.
getTaskId
()==
null
){
allotBillEntity
=
allotBillService
.
addEntity
(
a
);
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/BackController.java
浏览文件 @
8bf077a4
...
...
@@ -93,7 +93,9 @@ public class BackController {
}
//1.添加配发单
AllotBackBill
a
=
allotBillSaveVo
.
toBackDo
();
a
.
setSendUseraId
(
userUtils
.
getCurrentUserId
());
if
(
allotBillSaveVo
.
getTaskId
()==
null
)
{
a
.
setSendUseraId
(
userUtils
.
getCurrentUserId
());
}
AllotBackBill
allotBackBill
=
allotBackBillService
.
addEntity
(
a
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
...
...
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
8bf077a4
...
...
@@ -20,6 +20,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -85,11 +86,11 @@ public class DeviceLibraryController {
}
@ApiOperation
(
value
=
"根据装备id查询装备详情"
,
notes
=
"根据装备id查询装备详情"
)
@PostMapping
(
"/selectByIds"
)
public
ResponseEntity
selectByIds
(
@RequestBody
List
<
Integer
>
ids
){
@PostMapping
(
"/selectByIds
/{page}/{size}
"
)
public
ResponseEntity
selectByIds
(
@RequestBody
List
<
Integer
>
ids
,
@PathVariable
(
"page"
)
int
page
,
@PathVariable
(
"size"
)
int
size
){
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
ids
.
forEach
(
integer
->
deviceLibraries
.
add
(
deviceLibraryService
.
getOne
(
integer
).
setConfigName
()));
return
ResponseEntity
.
ok
(
deviceLibraries
);
return
ResponseEntity
.
ok
(
PageUtil
.
getPerPage
(
page
,
size
,
deviceLibraries
,
PageRequest
.
of
(
page
,
size
))
);
}
@ApiOperation
(
value
=
"根据装备id查询装备详情"
,
notes
=
"根据装备id查询装备详情"
)
...
...
@@ -479,7 +480,7 @@ public class DeviceLibraryController {
d
.
setPartParentId
(
deviceEditVo
.
getDeviceId
());
deviceLibraryService
.
update
(
d
);
//添加装备日志
String
remark
=
"将
表面号为"
+
d
.
getRfidSurfaceId
()
+
"的配件与表面号为"
+
deviceLibraryEntity
.
getRfidSurfaceId
()
+
"的装备绑定"
;
String
remark
=
"将
序列号为"
+
d
.
getSeqNumber
()
+
"的配件与表面号为"
+
deviceLibraryEntity
.
getSeqNumber
()
+
"的装备绑定"
;
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
deviceEditVo
.
getDeviceId
(),
remark
,
null
);
DeviceLogDto
deviceLogDto2
=
new
DeviceLogDto
(
id
,
remark
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
...
...
@@ -489,7 +490,7 @@ public class DeviceLibraryController {
deviceLibraryEntity
.
setPartParentId
(
id
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
//添加装备日志
String
remark
=
"将
表面号为"
+
deviceLibraryEntity
.
getRfidSurfaceId
()
+
"的配件与表面号为"
+
d
.
getRfidSurfaceId
()
+
"的装备绑定"
;
String
remark
=
"将
序列号为"
+
deviceLibraryEntity
.
getSeqNumber
()
+
"的配件与序列号为"
+
d
.
getSeqNumber
()
+
"的装备绑定"
;
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
deviceEditVo
.
getDeviceId
(),
remark
,
null
);
DeviceLogDto
deviceLogDto2
=
new
DeviceLogDto
(
id
,
remark
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
...
...
@@ -529,19 +530,19 @@ public class DeviceLibraryController {
return
ResultUtil
.
success
(
"更新成功"
);
}
@ApiOperation
(
value
=
"通过
表面
号查询配件"
,
notes
=
"通过表面号查询配件"
)
@ApiOperation
(
value
=
"通过
序列
号查询配件"
,
notes
=
"通过表面号查询配件"
)
@GetMapping
(
"/selectPart/{rfid}"
)
public
ResponseEntity
selectPart
(
@PathVariable
(
"rfid"
)
String
rfid
)
{
List
<
DeviceLibrary
>
libraryEntities
=
deviceLibraryDao
.
getAllBy
RfidSurfaceId
(
rfid
);
List
<
DeviceLibrary
>
libraryEntities
=
deviceLibraryDao
.
getAllBy
SeqNumber
(
rfid
);
libraryEntities
.
forEach
(
DeviceLibrary:
:
setConfigName
);
List
<
DeviceLibrary
>
deviceLibraryEntityList
=
libraryEntities
.
stream
().
filter
(
deviceLibraryEntity
->
deviceLibraryEntity
.
getIsPart
()
==
1
).
collect
(
Collectors
.
toList
());
return
ResultUtil
.
success
(
deviceLibraryEntityList
);
}
@ApiOperation
(
value
=
"通过
表面
号查询装备"
,
notes
=
"通过表面号查询装备"
)
@ApiOperation
(
value
=
"通过
序列
号查询装备"
,
notes
=
"通过表面号查询装备"
)
@GetMapping
(
"/selectDevice/{rfid}"
)
public
ResponseEntity
selectDevice
(
@PathVariable
(
"rfid"
)
String
rfid
)
{
List
<
DeviceLibrary
>
libraryEntities
=
deviceLibraryDao
.
getAllBy
RfidSurfaceId
(
rfid
);
List
<
DeviceLibrary
>
libraryEntities
=
deviceLibraryDao
.
getAllBy
SeqNumber
(
rfid
);
libraryEntities
.
forEach
(
DeviceLibrary:
:
setConfigName
);
List
<
DeviceLibrary
>
deviceLibraryEntityList
=
libraryEntities
.
stream
().
filter
(
deviceLibraryEntity
->
deviceLibraryEntity
.
getIsPart
()
==
0
).
collect
(
Collectors
.
toList
());
return
ResultUtil
.
success
(
deviceLibraryEntityList
);
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/repository/PackingLibraryDao.java
浏览文件 @
8bf077a4
...
...
@@ -13,6 +13,8 @@ public interface PackingLibraryDao extends JpaRepository<PackingLibrary, Integer
List
<
PackingLibrary
>
findAllByPartParentId
(
Integer
id
);
List
<
PackingLibrary
>
findAllByPartParentIdAndPackingStatus
(
Integer
id
,
Integer
packingId
);
List
<
PackingLibrary
>
findAllByIdIn
(
List
<
Integer
>
ids
);
PackingLibrary
findByShowOrder
(
Integer
showOrder
);
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
8bf077a4
...
...
@@ -291,7 +291,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
throw
new
ApiException
(
ResponseEntity
.
status
(
303
).
body
(
"该列装型号已有装备,请进行退装操作"
));
}
if
(
packingLibrary
.
getIsRoot
()==
1
)
{
if
(
packingLibraryDao
.
findAllByPartParentId
(
id
).
size
()>
0
){
if
(
packingLibraryDao
.
findAllByPartParentId
AndPackingStatus
(
id
,
2
).
size
()>
0
){
throw
new
ApiException
(
ResponseEntity
.
status
(
303
).
body
(
"该列装型号目录下存在列装装备"
));
}
Integer
order
=
packingLibrary
.
getShowOrder
();
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
8bf077a4
...
...
@@ -364,107 +364,6 @@ public class RepairController {
return
createRepair
(
deviceRepairBillSaveVo
);
}
@ApiOperation
(
value
=
"发起维修审核"
,
notes
=
"可以通过这个接口发起维修审核"
)
@PostMapping
(
value
=
"/sendConfirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
sendConfirm
(
@RequestBody
@Validated
RepairConfirmVo
deviceRepairConfirmVo
)
{
Integer
level
=
userUtils
.
getCurrentUnitLevel
();
TaskBto
taskBto
=
taskService
.
get
(
deviceRepairConfirmVo
.
getTaskId
());
//获取维修单,送修单,装备详情
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
taskBto
.
getBillId
());
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
repairBill
.
getId
());
String
deviceIdDetail
=
repairSendBill
.
getRepairDeviceCheckDetail
();
List
<
Integer
>
idList
=
StringSplitUtil
.
split
(
deviceIdDetail
);
//审核成功
if
(
deviceRepairConfirmVo
.
getStatus
()
==
0
)
{
if
(
userUtils
.
getCurrentUnitLevel
()
!=
1
)
{
taskBto
.
setOwnUnit
(
userPublicService
.
findUnitIdByName
(
repairBill
.
getReceiveUnit
()));
}
//任务推至下一阶段
if
(
level
==
2
||
level
==
3
)
{
if
(
repairSendBill
.
getRepairUseraId
()
!=
null
)
{
//指定用户
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairSendBill
.
getRepairUseraId
()));
}
else
{
//不指定用户
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
));
}
}
//省送国家,任务之间推至维修状态,发起人a的待办
if
(
level
==
1
)
{
taskService
.
update
(
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
COUNTRY_REPAIRING
,
repairSendBill
.
getStartUseraId
()));
}
//如果当前为省,改变装备的所在为中办
if
(
level
==
1
)
{
//获取当前业务维修详情
List
<
RepairDetail
>
repairDetailEntities
=
deviceRepairDetailService
.
findByBillId
(
repairBill
.
getId
());
//获取所有父业务id
List
<
Integer
>
fathers
=
StringSplitUtil
.
taskIdSplit
(
taskBto
.
getNodeIdDetail
());
fathers
.
forEach
(
integer
->
{
//筛选出父业务相同装备的维修详情
List
<
RepairDetail
>
repairDetails
=
repairDetailDao
.
findByDeviceRepairBillId
(
taskService
.
get
(
integer
).
getBillId
()).
stream
()
.
filter
(
repairDetail
->
idList
.
contains
(
repairDetail
.
getDeviceId
()))
.
collect
(
Collectors
.
toList
());
//添加维修详情
repairDetailEntities
.
addAll
(
repairDetails
);
});
//改变维修详情装备所在单位为中办,状态为维修中
repairDetailEntities
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
"中办"
);
repairDetail
.
setRepairStatus
(
1
);
deviceRepairDetailService
.
update
(
repairDetail
);
});
}
//更新维修单和送修单状态
//如果当前为省向国家发起的
if
(
level
==
1
)
{
repairBill
.
setRepairStatus
(
4
);
repairSendBill
.
setRepairStatus
(
5
);
}
else
{
repairBill
.
setRepairStatus
(
2
);
repairSendBill
.
setRepairStatus
(
2
);
}
deviceRepairBillService
.
update
(
repairBill
);
deviceRepairSendBillService
.
update
(
repairSendBill
);
//修改装备状态,存装备日志
if
(
idList
.
size
()
>
0
)
{
for
(
Integer
id
:
idList
)
{
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
4
);
deviceLibraryEntity
.
setManageStatus
(
0
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"审核成功并出库"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
idList
,
userUtils
.
getCurrentUnitId
(),
1
);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"审核成功"
);
}
//审核失败
if
(
deviceRepairConfirmVo
.
getStatus
()
==
1
)
{
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//更新维修单和送修单状态
repairBill
.
setRepairStatus
(
1
);
repairSendBill
.
setRepairStatus
(
1
);
deviceRepairBillService
.
update
(
repairBill
);
deviceRepairSendBillService
.
update
(
repairSendBill
);
//存装备日志
if
(
idList
.
size
()
>
0
)
{
for
(
Integer
id
:
idList
)
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修出库审核失败"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
}
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修出库审核失败"
);
}
else
{
return
ResultUtil
.
failed
(
"status只能为0或1"
);
}
}
@ApiOperation
(
value
=
"接收维修装备"
,
notes
=
"可以通过这个接口接收维修装备"
)
@PostMapping
(
value
=
"/receive"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -631,6 +530,12 @@ public class RepairController {
MessageBto
messageBto2
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"被选为经办人"
,
Collections
.
singletonList
(
fileUploadVo
.
getRepairUserbId
()),
1
);
messageService
.
add
(
messageBto2
);
}
if
(
fileUploadVo
.
getRepairUseraId
()!=
null
){
repairSendBill
.
setRepairUseraId
(
fileUploadVo
.
getRepairUseraId
());
repairBill
.
setRepairUserA
(
userPublicService
.
getOne
(
fileUploadVo
.
getRepairUseraId
()).
getName
());
// MessageBto messageBto2 = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为经办人", Collections.singletonList(fileUploadVo.getRepairUserbId()), 1);
// messageService.add(messageBto2);
}
deviceRepairBillService
.
update
(
repairBill
);
deviceRepairSendBillService
.
update
(
repairSendBill
);
//添加装备日志
...
...
@@ -644,77 +549,6 @@ public class RepairController {
return
ResponseEntity
.
ok
(
"上传成功"
);
}
@ApiOperation
(
value
=
"接收维修装备审核"
,
notes
=
"可以通过这个接口对接收维修装备审核"
)
@PostMapping
(
value
=
"/receiveConfirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
receiveConfirm
(
@RequestBody
@Validated
RepairConfirmVo
repairConfirmVo
)
{
//获取任务
TaskBto
taskBto
=
taskService
.
get
(
repairConfirmVo
.
getTaskId
());
//获取维修单,送修单,装备详情,维修详情单
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
taskBto
.
getBillId
());
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
repairBill
.
getId
());
String
deviceIdDetail
=
repairSendBill
.
getRepairReciveCheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
List
<
RepairDetail
>
repairDetailEntities
=
deviceRepairDetailService
.
findByBillId
(
repairBill
.
getId
());
//审核通过
if
(
repairConfirmVo
.
getStatus
()
==
0
)
{
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairSendBill
.
getRepairUseraId
()));
//修改维修单,送修单状态
repairBill
.
setRepairStatus
(
4
);
repairSendBill
.
setRepairStatus
(
5
);
deviceRepairBillService
.
update
(
repairBill
);
deviceRepairSendBillService
.
update
(
repairSendBill
);
for
(
String
s
:
strings
)
{
//接收无误的装备
if
(
s
.
length
()
>=
2
&&
"1"
.
equals
(
s
.
substring
(
s
.
length
()
-
1
)))
{
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//更新装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
4
);
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"审核成功并入库维修"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
//更改维修详情单装备的状态
repairDetailEntities
.
forEach
(
deviceRepairDetailEntity
->
{
deviceRepairDetailEntity
.
setRepairStatus
(
1
);
deviceRepairDetailService
.
update
(
deviceRepairDetailEntity
);
});
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"审核成功"
);
}
//审核失败
if
(
repairConfirmVo
.
getStatus
()
==
1
)
{
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//修改维修单,送修单状态
repairBill
.
setRepairStatus
(
3
);
repairSendBill
.
setRepairStatus
(
4
);
deviceRepairBillService
.
update
(
repairBill
);
deviceRepairSendBillService
.
update
(
repairSendBill
);
for
(
String
s
:
strings
)
{
//接收无误的装备
if
(
s
.
length
()
>=
2
&&
"1"
.
equals
(
s
.
substring
(
s
.
length
()
-
1
)))
{
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//更新装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
1
);
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修装备入库审核失败"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修装备接收入库审核失败"
);
}
else
{
return
ResultUtil
.
failed
(
"status只能为0或1"
);
}
}
@ApiOperation
(
value
=
"修好装备出库"
,
notes
=
"可以通过这个接口修好装备出库"
)
@PostMapping
(
value
=
"/back"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -800,70 +634,6 @@ public class RepairController {
return
ResultUtil
.
success
(
repairBackBill1
);
}
@ApiOperation
(
value
=
"修好装备出库审核"
,
notes
=
"可以通过这个接口修好装备出库审核"
)
@PostMapping
(
value
=
"/back/confirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
backConfirm
(
@RequestBody
@Validated
RepairConfirmVo
repairConfirmVo
)
{
//获取业务,账单,相关装备Id
TaskBto
taskBto
=
taskService
.
get
(
repairConfirmVo
.
getTaskId
());
RepairBackBill
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskBto
.
getBillId
());
String
deviceIdDetail
=
repairBackBill
.
getBackCheckDetail
();
List
<
Integer
>
idList
=
StringSplitUtil
.
split
(
deviceIdDetail
);
//审核成功
if
(
repairConfirmVo
.
getStatus
()
==
0
)
{
//改变账单状态
repairBackBill
.
setBackStatus
(
2
);
deviceRepairBackBillService
.
update
(
repairBackBill
);
if
(
idList
.
size
()
>
0
)
{
for
(
Integer
id
:
idList
)
{
//改变装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
4
);
deviceLibraryEntity
.
setManageStatus
(
0
);
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修退回审核成功并出库"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
idList
,
userUtils
.
getCurrentUnitId
(),
1
);
//设置任务的所属单位
taskBto
.
setOwnUnit
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()));
//不指定接收人
if
(
repairBackBill
.
getReceiveUseraId
()
!=
null
)
{
//业务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairBackBill
.
getReceiveUseraId
()));
}
else
{
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
));
}
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"审核成功"
);
}
//审核失败
if
(
repairConfirmVo
.
getStatus
()
==
1
)
{
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"维修退回出库审核失败"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//更新退回单状态
repairBackBill
.
setBackStatus
(
1
);
deviceRepairBackBillService
.
update
(
repairBackBill
);
if
(
idList
.
size
()
>
0
)
{
for
(
Integer
id
:
idList
)
{
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修退回出库审核失败"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
}
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修退回出库审核失败"
);
}
else
{
return
ResultUtil
.
failed
(
"status只能为0或1"
);
}
}
@ApiOperation
(
value
=
"修好装备送回接收入库"
,
notes
=
"可以通过这个接口修好装备送回接收"
)
@PostMapping
(
value
=
"/back/receive"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -1054,116 +824,45 @@ public class RepairController {
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
WAIT_UPLOAD_BACK_FILE
);
Integer
userId
=
userUtils
.
getCurrentUserId
();
taskService
.
addInvolveUser
(
taskBto
,
userId
);
//不上传单据
if
(
fileUploadVo
.
getStatus
()==
0
){
taskService
.
moveToArchive
(
taskBto
);
RepairBackBill
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskBto
.
getBillId
());
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userId
);
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getSendUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
taskService
.
moveToEnd
(
taskBto
);
taskService
.
moveAllSonNodeToEnd
(
taskBto
.
getId
());
//阅知
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"业务办结"
,
ids
,
1
);
messageService
.
add
(
messageBto
);
repairBackBill
.
setBillFileName
(
fileUploadVo
.
getBillFileName
());
repairBackBill
.
setBillFileUrl
(
fileUploadVo
.
getBillFileUrl
());
if
(
fileUploadVo
.
getStartUserbId
()!=
null
){
repairBackBill
.
setStartUserbId
(
fileUploadVo
.
getStartUserbId
());
repairBackBill
.
setAgent
(
userPublicService
.
getOne
(
fileUploadVo
.
getStartUserbId
()).
getName
());
MessageBto
messageBto1
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"被选为签发人"
,
Collections
.
singletonList
(
fileUploadVo
.
getStartUserbId
()),
1
);
messageService
.
add
(
messageBto1
);
}
else
{
RepairBackBill
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskBto
.
getBillId
());
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userId
);
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getSendUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
taskService
.
moveToEnd
(
taskBto
);
taskService
.
moveAllSonNodeToEnd
(
taskBto
.
getId
());
//阅知
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"业务办结"
,
ids
,
1
);
messageService
.
add
(
messageBto
);
repairBackBill
.
setBillFileName
(
fileUploadVo
.
getBillFileName
());
repairBackBill
.
setBillFileUrl
(
fileUploadVo
.
getBillFileUrl
());
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
if
(
fileUploadVo
.
getReceiveFiles
()!=
null
&&
fileUploadVo
.
getReceiveFiles
().
size
()>
0
){
fileUploadVo
.
getReceiveFiles
().
forEach
(
fileRet
->
{
fileVoList
.
add
(
new
FileVo
(
"回执单"
,
fileRet
.
getName
(),
fileRet
.
getPreviewPath
()));
});
repairBackBill
.
setReceiveFiles
(
FilesUtil
.
stringFileToList
(
fileUploadVo
.
getReceiveFiles
()));
}
deviceRepairBackBillService
.
update
(
repairBackBill
);
//添加装备日志
List
<
Integer
>
deviceIds
=
StringSplitUtil
.
split
(
repairBackBill
.
getBackReciveCheckDetail
());
deviceIds
.
forEach
(
integer
->
{
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"上传回执单据"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
});
if
(
fileUploadVo
.
getReceiveUserbId
()!=
null
){
repairBackBill
.
setReceiveUserbId
(
fileUploadVo
.
getReceiveUserbId
());
MessageBto
messageBto2
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"被选为经办人"
,
Collections
.
singletonList
(
fileUploadVo
.
getReceiveUserbId
()),
1
);
messageService
.
add
(
messageBto2
);
}
return
ResponseEntity
.
ok
(
"上传成功"
);
}
@ApiOperation
(
value
=
"修好装备送回接收入库审核"
,
notes
=
"可以通过这个接口修好装备送回接收"
)
@PostMapping
(
value
=
"/back/receive/confirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
backReceiveConfirm
(
@RequestBody
@Validated
RepairConfirmVo
repairConfirmVo
)
{
//获取业务,退回单,装备id
TaskBto
taskBto
=
taskService
.
get
(
repairConfirmVo
.
getTaskId
());
RepairBackBill
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskBto
.
getBillId
());
String
deviceIdDetail
=
repairBackBill
.
getBackReciveCheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//审核通过
if
(
repairConfirmVo
.
getStatus
()
==
0
)
{
//业务完结
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//更新退回单状态
repairBackBill
.
setBackStatus
(
5
);
deviceRepairBackBillService
.
update
(
repairBackBill
);
List
<
Integer
>
integerList
=
new
ArrayList
<>();
for
(
String
s
:
strings
)
{
//接收无误的装备
if
(
s
.
length
()
>=
2
&&
"1"
.
equals
(
s
.
substring
(
s
.
length
()
-
1
)))
{
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//更新装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
if
(
deviceLibraryEntity
.
getOwnUnit
().
equals
(
deviceLibraryEntity
.
getLocationUnit
()))
{
deviceLibraryEntity
.
setLifeStatus
(
2
);
}
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修退回装备入库审核成功"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
integerList
.
add
(
id
);
}
}
//获取所有父业务id
List
<
Integer
>
fathers
=
StringSplitUtil
.
taskIdSplit
(
taskBto
.
getNodeIdDetail
());
//更改父任务维修详情单为已领取
fathers
.
forEach
(
integer
->
{
//筛选出父业务相同装备的维修详情
List
<
RepairDetail
>
repairDetails
=
repairDetailDao
.
findByDeviceRepairBillId
(
taskService
.
get
(
integer
).
getBillId
()).
stream
()
.
filter
(
repairDetail
->
integerList
.
contains
(
repairDetail
.
getDeviceId
()))
.
collect
(
Collectors
.
toList
());
repairDetails
.
forEach
(
repairDetail
->
{
repairDetail
.
setRepairStatus
(
5
);
deviceRepairDetailService
.
update
(
repairDetail
);
});
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
if
(
fileUploadVo
.
getReceiveFiles
()!=
null
&&
fileUploadVo
.
getReceiveFiles
().
size
()>
0
){
fileUploadVo
.
getReceiveFiles
().
forEach
(
fileRet
->
{
fileVoList
.
add
(
new
FileVo
(
"回执单"
,
fileRet
.
getName
(),
fileRet
.
getPreviewPath
()));
});
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"审核成功"
);
}
//审核失败
if
(
repairConfirmVo
.
getStatus
()
==
1
)
{
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//更新退回单状态
repairBackBill
.
setBackStatus
(
4
);
deviceRepairBackBillService
.
update
(
repairBackBill
);
for
(
String
s
:
strings
)
{
//接收无误的装备
if
(
s
.
length
()
>=
2
&&
"1"
.
equals
(
s
.
substring
(
s
.
length
()
-
1
)))
{
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//修改装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
1
);
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修退回装备入库审核失败"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修成功退回装备入库审核失败"
);
}
else
{
return
ResultUtil
.
failed
(
"status只能为0或1"
);
repairBackBill
.
setReceiveFiles
(
FilesUtil
.
stringFileToList
(
fileUploadVo
.
getReceiveFiles
()));
}
deviceRepairBackBillService
.
update
(
repairBackBill
);
//添加装备日志
List
<
Integer
>
deviceIds
=
StringSplitUtil
.
split
(
repairBackBill
.
getBackReciveCheckDetail
());
deviceIds
.
forEach
(
integer
->
{
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"上传回执单据"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
});
return
ResponseEntity
.
ok
(
"上传成功"
);
}
@ApiOperation
(
value
=
"更改维修装备状态"
,
notes
=
"可以通过这个接口更改维修装备状态"
)
...
...
@@ -1640,6 +1339,12 @@ public class RepairController {
repairBackBill
.
setReceiveUserbId
(
fileVo
.
getReceiveUserbId
());
idList
.
add
(
fileVo
.
getReceiveUserbId
());
}
if
(
fileVo
.
getStartUserbId
()!=
null
){
repairBackBill
.
setStartUserbId
(
fileVo
.
getStartUserbId
());
repairBackBill
.
setAgent
(
userPublicService
.
getOne
(
fileVo
.
getStartUserbId
()).
getName
());
MessageBto
messageBto1
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"被选为签发人"
,
Collections
.
singletonList
(
fileVo
.
getStartUserbId
()),
1
);
messageService
.
add
(
messageBto1
);
}
deviceRepairBackBillService
.
update
(
repairBackBill
);
List
<
Integer
>
ids
=
StringSplitUtil
.
split
(
repairBackBill
.
getBackCheckDetail
());
//业务完结
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/FileUploadVo.java
浏览文件 @
8bf077a4
...
...
@@ -40,5 +40,8 @@ public class FileUploadVo {
private
Integer
startUserbId
;
@ApiModelProperty
(
value
=
"接收单位B岗"
)
private
Integer
repairUserbId
;
private
Integer
receiveUserbId
;
@ApiModelProperty
(
value
=
"接收单位A岗"
)
private
Integer
repairUseraId
;
}
dev-retired/src/main/java/com/tykj/dev/device/retired/controller/DeviceRetiredController.java
浏览文件 @
8bf077a4
...
...
@@ -27,10 +27,7 @@ import com.tykj.dev.device.user.util.AuthenticationUtils;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.ListUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
com.tykj.dev.misc.utils.TaskDisposeUtil
;
import
com.tykj.dev.misc.utils.*
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -42,10 +39,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.transaction.Transactional
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -108,11 +102,19 @@ public class DeviceRetiredController {
BeanUtils
.
copyProperties
(
canRetiredDeviceSelectVo
,
packingLibrarySelectVo
);
List
<
PackingLibrary
>
list
=
packingLibraryService
.
getList
(
packingLibrarySelectVo
);
//循环获取列装主体的数量,并生成VO
list
.
forEach
(
packingLibrary
->
{
for
(
PackingLibrary
packingLibrary
:
list
)
{
DeviceRetiredResultVo
deviceRetiredResultVo
=
calcDeviceRetiredResultVo
(
packingLibrary
);
deviceRetiredResultVos
.
add
(
deviceRetiredResultVo
);
});
return
ResultUtil
.
success
(
deviceRetiredResultVos
.
stream
().
filter
(
DeviceRetiredResultVo:
:
devNumIsZero
).
collect
(
Collectors
.
toList
()));
}
Map
<
Integer
,
DeviceRetiredResultVo
>
nodeCollect
=
deviceRetiredResultVos
.
stream
().
collect
(
Collectors
.
toMap
(
DeviceRetiredResultVo:
:
getId
,
deviceRetiredResultVo
->
deviceRetiredResultVo
));
List
<
DeviceRetiredResultVo
>
containList
=
GetTreeUtils
.
parseTreeFromDown
(
deviceRetiredResultVos
,
DeviceRetiredResultVo:
:
getId
,
d
->
Optional
.
ofNullable
(
nodeCollect
.
get
(
d
.
getPartParentId
())),
DeviceRetiredResultVo:
:
addChildNode
).
stream
().
filter
(
DeviceRetiredResultVo:
:
devNumIsZero
).
collect
(
Collectors
.
toList
());
return
ResultUtil
.
success
(
containList
);
}
@ApiOperation
(
value
=
"提交退装表单"
,
notes
=
"可以通过这个接口提交销毁表单发起退装流程"
)
...
...
@@ -230,18 +232,23 @@ public class DeviceRetiredController {
DeviceRetiredResultVo
deviceRetiredResultVo
=
new
DeviceRetiredResultVo
();
BeanUtils
.
copyProperties
(
packingLibraryEntity
,
deviceRetiredResultVo
);
deviceRetiredResultVo
.
setCount
(
deviceRetiredBillService
.
getCantPackingCount
(
packingLibraryEntity
.
getId
()));
List
<
PackingLibrary
>
PackingChildren
=
packingLibraryEntity
.
getChilds
();
for
(
PackingLibrary
p
:
PackingChildren
)
{
DeviceRetiredResultVo
childDeviceRetiredResultVo
=
new
DeviceRetiredResultVo
();
BeanUtils
.
copyProperties
(
p
,
childDeviceRetiredResultVo
);
childDeviceRetiredResultVo
.
setCount
(
deviceRetiredBillService
.
getCantPackingCount
(
p
.
getId
()));
if
(!
p
.
getChilds
().
isEmpty
()){
for
(
PackingLibrary
pack:
p
.
getChilds
())
{
childDeviceRetiredResultVo
.
getChilds
().
add
(
calcDeviceRetiredResultVo
(
pack
));
}
}
deviceRetiredResultVo
.
getChilds
().
add
(
childDeviceRetiredResultVo
);
}
deviceRetiredResultVo
.
setChilds
(
new
ArrayList
<>());
// List<PackingLibrary> PackingChildren = packingLibraryEntity.getChilds();
// for (PackingLibrary p : PackingChildren) {
// DeviceRetiredResultVo childDeviceRetiredResultVo = new DeviceRetiredResultVo();
// BeanUtils.copyProperties(p, childDeviceRetiredResultVo);
// childDeviceRetiredResultVo.setCount(deviceRetiredBillService.getCantPackingCount(p.getId()));
// if (p.getChilds()!=null&&!p.getChilds().isEmpty()){
// for (PackingLibrary pack:p.getChilds()) {
// List<DeviceRetiredResultVo> d = childDeviceRetiredResultVo.getChilds();
// d.add(calcDeviceRetiredResultVo(pack));
// childDeviceRetiredResultVo.setChilds(d);
// }
// }
// List<DeviceRetiredResultVo> d = childDeviceRetiredResultVo.getChilds();
// d.add(childDeviceRetiredResultVo);
// childDeviceRetiredResultVo.setChilds(d);
// }
return
deviceRetiredResultVo
;
}
...
...
dev-retired/src/main/java/com/tykj/dev/device/retired/entity/vo/DeviceRetiredResultVo.java
浏览文件 @
8bf077a4
...
...
@@ -20,6 +20,9 @@ public class DeviceRetiredResultVo {
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"id"
)
private
Integer
partParentId
;
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
...
...
@@ -67,4 +70,8 @@ public class DeviceRetiredResultVo {
return
false
;
}
}
public
void
addChildNode
(
DeviceRetiredResultVo
deviceRetiredResultVo
)
{
childs
.
add
(
deviceRetiredResultVo
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论