Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
5e141d45
提交
5e141d45
authored
12月 02, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交维修更改
上级
88bba9df
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
300 行增加
和
92 行删除
+300
-92
AllotBackBillController.java
.../dev/device/allot/controller/AllotBackBillController.java
+29
-6
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+104
-35
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+2
-0
LogType.java
dev-config/src/main/java/com/tykj/dev/config/LogType.java
+3
-3
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+150
-40
RepairBackBillSaveVo.java
...kj/dev/device/repair/subject/vo/RepairBackBillSaveVo.java
+2
-2
RepairBillSaveVo.java
...m/tykj/dev/device/repair/subject/vo/RepairBillSaveVo.java
+2
-2
RepairReceiveVo.java
...om/tykj/dev/device/repair/subject/vo/RepairReceiveVo.java
+2
-2
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+6
-2
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBackBillController.java
浏览文件 @
5e141d45
...
...
@@ -13,8 +13,12 @@ import com.tykj.dev.device.library.service.DeviceLogService;
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.read.service.MessageService
;
import
com.tykj.dev.device.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.ResultObj
;
...
...
@@ -38,6 +42,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author dengdiyi
...
...
@@ -79,6 +84,12 @@ public class AllotBackBillController {
@Autowired
private
InputOutputDeviceService
inputOutputDeviceService
;
@Autowired
private
UserDao
userDao
;
@Autowired
private
MessageService
messageService
;
@ApiOperation
(
value
=
"发起配发退回业务"
,
notes
=
"可以通过这个接口发起配发退回任务"
)
@PostMapping
(
value
=
"/back"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -155,12 +166,15 @@ public class AllotBackBillController {
public
ResponseEntity
allotBackReceive
(
@RequestBody
@Validated
AllotBackReceiveVo
allotBackReceiveVo
)
{
//获取当前任务和账单
TaskBto
taskBto
=
taskService
.
get
(
allotBackReceiveVo
.
getTaskId
());
taskService
.
addInvolveUser
(
taskBto
,
userUtils
.
getCurrentUserId
());
AllotBackBill
allotBackBill
=
allotBackBillService
.
getOne
(
taskBto
.
getBillId
());
//更改账单状态
allotBackBill
.
setBackStatus
(
1
);
allotBackBill
.
setBackStatus
(
3
);
allotBackBill
.
setReceiveUseraId
(
userUtils
.
getCurrentUserId
());
BeanUtils
.
copyProperties
(
allotBackReceiveVo
,
allotBackBill
);
//任务推至下一阶段
taskService
.
moveToNext
(
taskBto
,
allotBackReceiveVo
.
getReceiveUserbId
());
//任务推至完结
taskService
.
moveToEnd
(
taskBto
);
// taskService.moveToNext(taskBto, allotBackReceiveVo.getReceiveUserbId());
//分隔装备id信息
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"退回单"
,
allotBackReceiveVo
.
getBillFileName
(),
allotBackReceiveVo
.
getBillFileUrl
()));
...
...
@@ -175,10 +189,12 @@ public class AllotBackBillController {
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//改变装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
0
);
deviceLibraryEntity
.
setLifeStatus
(
2
);
deviceLibraryEntity
.
setOwnUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraryEntity
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"接收
并发起入库
"
,
fileVoList
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"接收
配发退回装备
"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
...
...
@@ -189,13 +205,20 @@ public class AllotBackBillController {
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
11
);
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"接收
入库
丢失"
,
fileVoList
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"接收
配发退回装备
丢失"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
}
}
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
allotBackBill
.
getSendUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
userUtils
.
getCurrentUserUnitName
()+
"接收配发退回装备"
,
ids
);
messageService
.
add
(
messageBto
);
log
.
info
(
"[配发模块]:配发退回接收入库"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"配发退回接收入库"
);
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
5e141d45
package
com
.
tykj
.
dev
.
device
.
allot
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.allot.service.AllotBackBillService
;
import
com.tykj.dev.device.allot.service.AllotBillService
;
import
com.tykj.dev.device.allot.subject.domin.AllotBackBill
;
import
com.tykj.dev.device.allot.subject.domin.AllotBill
;
import
com.tykj.dev.device.allot.subject.vo.AllotBillConfirmVo
;
import
com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo
;
...
...
@@ -12,9 +14,13 @@ import com.tykj.dev.device.library.service.DeviceLogService;
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.read.service.MessageService
;
import
com.tykj.dev.device.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
...
...
@@ -40,6 +46,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author dengdiyi
...
...
@@ -81,6 +88,15 @@ public class AllotBillController {
@Autowired
private
InputOutputDeviceService
inputOutputDeviceService
;
@Autowired
private
MessageService
messageService
;
@Autowired
private
UserDao
userDao
;
@Autowired
private
AllotBackBillService
allotBackBillService
;
@ApiOperation
(
value
=
"发起配发业务"
,
notes
=
"可以通过这个接口发起配发任务"
)
@PostMapping
(
value
=
"/addAllotBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -106,23 +122,38 @@ public class AllotBillController {
//2.发起任务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
allotBillSaveVo
.
getSendUserbId
()
);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOT
_SEND_CONFIRM
.
id
,
"配发业务"
,
null
,
"."
,
billId
,
3
,
userUtils
.
getCurrentUnitId
(
),
1
,
null
,
userIds
);
userIds
.
add
(
0
);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOT
ING
.
id
,
"配发业务"
,
null
,
"."
,
billId
,
3
,
userPublicService
.
findUnitIdByName
(
allotBillSaveVo
.
getReceiveUnit
()
),
1
,
null
,
userIds
);
TaskBto
saveEntity
=
taskService
.
start
(
taskBto
);
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
allotBillEntity
.
getFileName
(),
allotBillEntity
.
getFileUrl
()));
//存装备日志
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
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
(
3
);
deviceLibraryEntity
.
setManageStatus
(
0
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"对"
+
allotBillEntity
.
getReceiveUnit
()
+
"发起配发"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
}
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
ids
,
userUtils
.
getCurrentUnitId
(),
1
);
//发送阅知信息
List
<
Integer
>
idList
=
userPublicService
.
findOtherUser
(
userId
);
idList
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getReceiveUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto
=
new
MessageBto
(
saveEntity
.
getId
(),
saveEntity
.
getBusinessType
(),
allotBillEntity
.
getSendUnit
()
+
"对"
+
allotBillEntity
.
getReceiveUnit
()
+
"发起配发"
,
idList
);
messageService
.
add
(
messageBto
);
log
.
info
(
"[配发模块]:"
+
allotBillEntity
.
getSendUnit
()
+
"对"
+
allotBillEntity
.
getReceiveUnit
()
+
"发起配发"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
new
ResultObj
(
allotBill
Entity
,
"发起成功"
));
return
ResponseEntity
.
ok
(
new
ResultObj
(
save
Entity
,
"发起成功"
));
}
@ApiOperation
(
value
=
"配发审核"
,
notes
=
"可以通过这个接口对配发审核"
)
...
...
@@ -195,6 +226,7 @@ public class AllotBillController {
@PostMapping
(
value
=
"/receiveDevice"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
receiveDevice
(
@RequestBody
@Validated
AllotReceiveVo
allotReceiveVo
)
{
Integer
userId
=
userUtils
.
getCurrentUserId
();
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveVo
.
getTaskId
());
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
taskBto
.
getBillId
());
...
...
@@ -202,12 +234,15 @@ public class AllotBillController {
fileVoList
.
add
(
new
FileVo
(
"配发单"
,
allotReceiveVo
.
getBillFileName
(),
allotReceiveVo
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
allotReceiveVo
.
getReceiveFileName
(),
allotReceiveVo
.
getReceiveFileUrl
()));
//更新账单状态
allotBillEntity
.
setAllotStatus
(
3
);
allotBillEntity
.
setAllotStatus
(
5
);
BeanUtils
.
copyProperties
(
allotReceiveVo
,
allotBillEntity
);
allotBillEntity
.
setReceiveTime
(
TimestampUtil
.
getCurrentTimestamp
());
allotBillEntity
.
setReceiveUseraId
(
userId
);
allotBillService
.
update
(
allotBillEntity
);
//推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
allotReceiveVo
.
getReceiveUserbId
()));
taskService
.
addInvolveUser
(
taskBto
,
userId
);
// //推至下一阶段
// taskService.update(taskService.moveToNext(taskBto, allotReceiveVo.getReceiveUserbId()));
taskService
.
moveToEnd
(
taskBto
);
//分隔装备id信息
String
deviceIdDetail
=
allotReceiveVo
.
getReceiveCheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
...
...
@@ -218,8 +253,11 @@ public class AllotBillController {
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//改变装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
0
);
//
deviceLibraryEntity.setLifeStatus(0);
deviceLibraryEntity
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceLibraryEntity
.
setLifeStatus
(
2
);
deviceLibraryEntity
.
setOwnUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceLibraryEntity
.
setManageStatus
(
1
);
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"接收并发起入库"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
...
...
@@ -238,6 +276,13 @@ public class AllotBillController {
}
}
}
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userId
);
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getSendUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"接收配发装备"
,
ids
);
messageService
.
add
(
messageBto
);
log
.
info
(
"[配发模块]:接收并发起入库"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"配发接收入库"
);
...
...
@@ -250,34 +295,35 @@ public class AllotBillController {
//获取任务和账单
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveConfirmVo
.
getTaskId
());
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
taskBto
.
getBillId
());
String
deviceIdDetail
=
allotBillEntity
.
get
Receive
CheckDetail
();
String
deviceIdDetail
=
allotBillEntity
.
get
Allot
CheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//审核通过
if
(
allotReceiveConfirmVo
.
getStatus
()
==
0
)
{
//业务完结
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//更新账单
allotBillEntity
.
setAllotStatus
(
5
);
allotBillService
.
update
(
allotBillEntity
);
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
(
2
);
deviceLibraryEntity
.
setOwnUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceLibraryEntity
.
setManageStatus
(
1
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"审核成功并入库"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
log
.
info
(
"[配发模块]:审核成功并入库"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"审核成功"
);
}
//
审核失败
//
if (allotReceiveConfirmVo.getStatus() == 0) {
//
//业务完结
//
taskService.update(taskService.moveToEnd(taskBto));
//
//更新账单
//
allotBillEntity.setAllotStatus(5);
//
allotBillService.update(allotBillEntity);
//
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(2);
//
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
//
deviceLibraryEntity.setManageStatus(1);
//
DeviceLogDto deviceLogDto = new DeviceLogDto(id, "审核成功并入库", null);
//
deviceLogService.addLog(deviceLogDto);
//
deviceLibraryService.update(deviceLibraryEntity);
//
}
//
}
//
log.info("[配发模块]:审核成功并入库");
//
myWebSocket.sendMessage1();
//
return ResponseEntity.ok("审核成功");
//
}
//
拒绝接收
if
(
allotReceiveConfirmVo
.
getStatus
()
==
1
)
{
taskService
.
addInvolveUser
(
taskBto
,
userUtils
.
getCurrentUserId
());
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//更新账单状态
...
...
@@ -289,16 +335,39 @@ public class AllotBillController {
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
);
deviceLibraryEntity
.
setLifeStatus
(
3
);
deviceLibraryEntity
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"拒绝接收配发装备"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
}
}
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getSendUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
allotBillEntity
.
getReceiveUnit
()+
"拒绝接收配发装备"
,
ids
);
messageService
.
add
(
messageBto
);
//生成配发退回单
AllotBackBill
allotBackBill
=
new
AllotBackBill
();
allotBackBill
.
setAllotBillId
(
taskBto
.
getBillId
());
allotBackBill
.
setSendUseraId
(
userUtils
.
getCurrentUserId
());
allotBackBill
.
setSendUnit
(
userUtils
.
getCurrentUserUnitName
());
allotBackBill
.
setReceiveUnit
(
allotBillEntity
.
getSendUnit
());
allotBackBill
.
setBackCheckDetail
(
allotBillEntity
.
getAllotCheckDetail
());
AllotBackBill
allotBackBill1
=
allotBackBillService
.
addEntity
(
allotBackBill
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
allotBackBill1
.
getCreateTime
());
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
String
num
=
"NO:第"
+
year
+
"TH"
+
allotBackBill1
.
getId
()
+
"号"
;
allotBackBill1
.
setNum
(
num
);
allotBackBillService
.
update
(
allotBackBill1
);
//生成配发退回子业务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userUtils
.
getCurrentUserId
());
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_BACK
.
id
,
"配发退回业务"
,
taskBto
.
getId
(),
taskBto
.
getNodeIdDetail
()
+
taskBto
.
getId
()
+
"."
,
0
,
BusinessEnum
.
ALLOT_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
userIds
.
add
(
0
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
ALLOT_BACKING
.
id
,
"配发退回业务"
,
taskBto
.
getId
(),
taskBto
.
getNodeIdDetail
()
+
taskBto
.
getId
()
+
"."
,
allotBackBill1
.
getId
(),
BusinessEnum
.
ALLOT_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getSendUnit
()),
1
,
null
,
userIds
);
TaskBto
task
=
taskService
.
start
(
taskBto1
);
log
.
info
(
"[配发模块]:配发入库审核失败"
);
myWebSocket
.
sendMessage1
();
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
5e141d45
...
...
@@ -148,7 +148,9 @@ public class DeviceApplyController {
public
ResponseEntity
addDeviceApplyBillReplay
(
@RequestBody
@Validated
DeviceApplyConfirmVo
deviceApplyConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
deviceApplyConfirmVo
.
getTaskId
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
taskService
.
addInvolveUser
(
taskBto
,
userId
);
DeviceApplyBill
applyBillEntity
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
applyBillEntity
.
setReplyUseraId
(
userId
);
//阅知用户Id
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userId
);
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
applyBillEntity
.
getApplyUnit
())).
stream
()
...
...
dev-config/src/main/java/com/tykj/dev/config/LogType.java
浏览文件 @
5e141d45
...
...
@@ -81,7 +81,7 @@ public enum LogType {
REPAIR_SEND_3
(
32
,
REPAIR_SEND_CONFIRM
.
id
,
ARCHIVE
.
id
,
"维修出库审核失败"
),
REPAIR_SEND_4
(
33
,
WAIT_RECEIVE
.
id
,
END
.
id
,
"接收维修装备并发起入库"
),
REPAIR_SEND_4
(
33
,
WAIT_RECEIVE
.
id
,
REPAIRING
.
id
,
"接收维修装备并发起入库"
),
DESTROY_4
(
100
,
WAIT_UPLOAD_BILL_FILE
.
id
,
END
.
id
,
"上传销毁单"
),
...
...
@@ -91,7 +91,7 @@ public enum LogType {
REPAIR_SEND_7
(
36
,
REPAIR_SEND_CONFIRM
.
id
,
COUNTRY_REPAIRING
.
id
,
"审核成功并出库"
),
REPAIR_BACK_1
(
37
,
ORIGIN_STATUS
.
id
,
REPAIR_BACK_CONFIRM
.
id
,
"向(%receiveUnit)退还维修装备"
),
REPAIR_BACK_1
(
37
,
ORIGIN_STATUS
.
id
,
WAIT_BACK_RECEIVE
.
id
,
"向(%receiveUnit)退还维修装备"
),
REPAIR_BACK_2
(
38
,
REPAIR_BACK_CONFIRM
.
id
,
WAIT_BACK_RECEIVE
.
id
,
"维修退回审核成功并出库"
),
...
...
@@ -166,12 +166,12 @@ public enum LogType {
WORK_H1
(
79
,
ORIGIN_STATUS
.
id
,
WORKHANDOVER1011
.
id
,
"工作交接任务生成完成,等待上传交接单"
),
WORK_H2
(
80
,
WORKHANDOVER1011
.
id
,
END
.
id
,
"工作交接完成"
),
STORAGE_4
(
81
,
ORIGIN_STATUS
.
id
,
END
.
id
,
"进行装备入库"
),
ALLOT_8
(
82
,
ORIGIN_STATUS
.
id
,
ALLOTING
.
id
,
"对(%receiveUnit)发起配发"
),
ALLOT_9
(
83
,
ALLOTING
.
id
,
END
.
id
,
"接收配发装备"
),
ALLOT_10
(
84
,
WAIT_ALLOT
.
id
,
ALLOTING
.
id
,
"对(%receiveUnit)发起配发"
),
ALLOT_11
(
85
,
ALLOTING
.
id
,
ARCHIVE
.
id
,
"拒绝接收配发装备"
),
ALLOT_BACK_5
(
86
,
ALLOT_BACKING
.
id
,
END
.
id
,
"接收配发退回装备"
),
REPAIR_SEND_10
(
87
,
ORIGIN_STATUS
.
id
,
COUNTRY_REPAIRING
.
id
,
"向(%receiveUnit)发起装备维修"
),
;
public
Integer
id
;
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
5e141d45
...
...
@@ -9,6 +9,8 @@ import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import
com.tykj.dev.device.library.subject.domin.DeviceChange
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.read.service.MessageService
;
import
com.tykj.dev.device.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.repair.repository.RepairBackBillDao
;
import
com.tykj.dev.device.repair.repository.RepairDetailDao
;
import
com.tykj.dev.device.repair.repository.RepairSendBillDao
;
...
...
@@ -25,11 +27,12 @@ import com.tykj.dev.device.task.service.TaskLogService;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.bto.TaskLogBto
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.RepairStatusEnum
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.Snowflake
;
...
...
@@ -108,22 +111,38 @@ public class RepairController {
@Autowired
private
InputOutputDeviceService
inputOutputDeviceService
;
@Autowired
private
UserDao
userDao
;
@Autowired
private
MessageService
messageService
;
@ApiOperation
(
value
=
"发起维修"
,
notes
=
"可以通过这个接口发起维修"
)
@PostMapping
(
value
=
"/form"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
createRepair
(
@RequestBody
@Validated
RepairBillSaveVo
repairBillSaveVo
)
{
Integer
level
=
userUtils
.
getCurrentUnitLevel
();
//添加维修单和送修单
RepairBill
repairBill
=
new
RepairBill
();
RepairSendBill
deviceRepairSendBillEntity
=
new
RepairSendBill
();
Integer
userId
=
userUtils
.
getCurrentUserId
();
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
repairBill
);
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
deviceRepairSendBillEntity
);
repairBill
.
setRepairStatus
(
0
);
// repairBill.setRepairStatus(0);
//更新维修单和送修单状态
//如果当前为省向国家发起的
if
(
level
==
1
)
{
repairBill
.
setRepairStatus
(
4
);
deviceRepairSendBillEntity
.
setRepairStatus
(
5
);
}
else
{
repairBill
.
setRepairStatus
(
2
);
deviceRepairSendBillEntity
.
setRepairStatus
(
2
);
}
if
(
repairBillSaveVo
.
getRepairUseraId
()
!=
null
)
{
repairBill
.
setRepairUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getRepairUseraId
()).
getName
());
}
repairBill
.
setStartUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getStartUseraId
()).
getName
());
repairBill
.
setStartUserB
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getStartUserbId
()).
getName
());
//
repairBill.setStartUserB(userPublicService.getOne(repairBillSaveVo.getStartUserbId()).getName());
//生成单位电子签章id
Long
signId
=
snowflake
.
creatNextId
();
Long
signId2
=
snowflake
.
creatNextId
();
...
...
@@ -137,7 +156,7 @@ public class RepairController {
//发起维修业务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
repairBillSaveVo
.
getStartUserbId
()
);
userIds
.
add
(
0
);
//存业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
repairBillSaveVo
.
getFileName
(),
repairBillSaveVo
.
getFileUrl
()));
...
...
@@ -164,6 +183,14 @@ public class RepairController {
repairDetail
.
setType
(
deviceLibraryEntity
.
getType
());
repairDetail
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
deviceRepairDetailService
.
save
(
repairDetail
);
//如果当前为省像国家发起的
if
(
level
==
1
)
{
deviceLibraryEntity
.
setLifeStatus
(
4
);
}
else
{
deviceLibraryEntity
.
setLifeStatus
(
3
);
}
deviceLibraryEntity
.
setManageStatus
(
0
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
d
.
getDeviceId
(),
"向"
+
repairBillSaveVo
.
getReceiveUnit
()
+
"发起装备维修"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
...
...
@@ -174,8 +201,58 @@ public class RepairController {
deviceRepairSendBillEntity
.
setAgent
(
repairBillSaveVo
.
getAgent
());
deviceRepairSendBillEntity
.
setTitle
(
"维修业务"
);
deviceRepairSendBillService
.
addEntity
(
deviceRepairSendBillEntity
);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
,
"维修业务"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
TaskBto
saveEntity
=
taskService
.
start
(
taskBto
);
Integer
ownUnit
;
TaskBto
saveEntity
;
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
if
(
level
==
1
)
{
ownUnit
=
userUtils
.
getCurrentUnitId
();
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
COUNTRY_REPAIRING
.
id
,
"维修业务"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
null
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto
);
}
else
{
ownUnit
=
userPublicService
.
findUnitIdByName
(
repairBill
.
getReceiveUnit
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_RECEIVE
.
id
,
"维修业务"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
null
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto
);
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBill
.
getReceiveUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
}
if
(
repairBillSaveVo
.
getTaskId
()!=
null
)
{
TaskBto
parentTask
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
saveEntity
.
setParentTaskId
(
parentTask
.
getId
());
saveEntity
.
setNodeIdDetail
(
parentTask
.
getNodeIdDetail
()
+
repairBillSaveVo
.
getTaskId
()
+
"."
);
taskService
.
update
(
saveEntity
);
}
String
deviceIdDetail
=
deviceRepairSendBillEntity
.
getRepairDeviceCheckDetail
();
List
<
Integer
>
idList
=
StringSplitUtil
.
split
(
deviceIdDetail
);
//如果当前为省,改变装备的所在为中办
if
(
level
==
1
)
{
//获取当前业务维修详情
List
<
RepairDetail
>
repairDetailEntities
=
deviceRepairDetailService
.
findByBillId
(
repairBill
.
getId
());
if
(
repairBillSaveVo
.
getTaskId
()!=
null
)
{
TaskBto
parentTask
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
//获取所有父业务id
List
<
Integer
>
fathers
=
StringSplitUtil
.
taskIdSplit
(
parentTask
.
getNodeIdDetail
()+
repairBillSaveVo
.
getTaskId
()
+
"."
);
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
);
});
}
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
idList
,
userUtils
.
getCurrentUnitId
(),
1
);
//发送阅知信息
MessageBto
messageBto
=
new
MessageBto
(
saveEntity
.
getId
(),
saveEntity
.
getBusinessType
(),
repairBill
.
getSendUnit
()+
"向"
+
repairBill
.
getReceiveUnit
()+
"发起装备维修"
,
ids
);
messageService
.
add
(
messageBto
);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
saveEntity
);
}
...
...
@@ -184,14 +261,13 @@ public class RepairController {
@PostMapping
(
value
=
"/continue/form"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
continueCreateRepair
(
@RequestBody
@Validated
RepairBillSaveVo
deviceRepairBillSaveVo
)
{
ResponseEntity
responseEntity
=
createRepair
(
deviceRepairBillSaveVo
);
ResultObj
resultObj
=
(
ResultObj
)
responseEntity
.
getBody
();
TaskBto
taskBto
=
(
TaskBto
)
Objects
.
requireNonNull
(
resultObj
).
getData
();
TaskBto
parentTask
=
taskService
.
get
(
deviceRepairBillSaveVo
.
getTaskId
());
taskBto
.
setParentTaskId
(
parentTask
.
getId
());
taskBto
.
setNodeIdDetail
(
parentTask
.
getNodeIdDetail
()
+
deviceRepairBillSaveVo
.
getTaskId
()
+
"."
);
taskService
.
update
(
taskBto
);
return
ResultUtil
.
success
(
"继续向上级发起维修成功"
);
// ResultObj resultObj = (ResultObj) responseEntity.getBody();
// TaskBto taskBto = (TaskBto) Objects.requireNonNull(resultObj).getData();
// TaskBto parentTask = taskService.get(deviceRepairBillSaveVo.getTaskId());
// taskBto.setParentTaskId(parentTask.getId());
// taskBto.setNodeIdDetail(parentTask.getNodeIdDetail() + deviceRepairBillSaveVo.getTaskId() + ".");
// taskService.update(taskBto);
return
createRepair
(
deviceRepairBillSaveVo
);
}
@ApiOperation
(
value
=
"发起维修审核"
,
notes
=
"可以通过这个接口发起维修审核"
)
...
...
@@ -322,10 +398,10 @@ public class RepairController {
fileVoList
.
add
(
new
FileVo
(
"维修单"
,
repairSendBill
.
getBillFileName
(),
repairSendBill
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
repairSendBill
.
getReceiveFileName
(),
repairSendBill
.
getReceiveFileUrl
()));
//更新维修单和送修单
repairBill
.
setRepairStatus
(
6
);
repairBill
.
setRepairStatus
(
4
);
repairBill
.
setRepairUserB
(
userPublicService
.
getOne
(
repairReceiveVo
.
getReceiveUserbId
()).
getName
());
deviceRepairBillService
.
update
(
repairBill
);
repairSendBill
.
setRepairStatus
(
6
);
repairSendBill
.
setRepairStatus
(
5
);
repairSendBill
.
setBillFileName
(
repairReceiveVo
.
getBillFileName
());
repairSendBill
.
setBillFileUrl
(
repairReceiveVo
.
getBillFileUrl
());
repairSendBill
.
setReceiveTime
(
new
Date
());
...
...
@@ -337,7 +413,8 @@ public class RepairController {
repairSendBill
.
setRepairUserbId
(
repairReceiveVo
.
getReceiveUserbId
());
deviceRepairSendBillService
.
update
(
repairSendBill
);
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairReceiveVo
.
getReceiveUserbId
()));
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
REPAIRING
);
// taskService.update(taskService.moveToNext(taskBto, repairReceiveVo.getReceiveUserbId()));
//分隔装备id
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存接收无误的装备id
...
...
@@ -348,9 +425,9 @@ public class RepairController {
if
(
"1"
.
equals
(
s
.
substring
(
s
.
length
()
-
1
)))
{
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
idList
.
add
(
id
);
//
改变
装备状态
//
更新
装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
0
);
deviceLibraryEntity
.
setLifeStatus
(
4
);
deviceLibraryEntity
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"接收并发起入库"
,
fileVoList
);
...
...
@@ -383,8 +460,16 @@ public class RepairController {
//改变维修详情装备所在单位为当前单位
repairDetailEntities
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
repairDetail
.
setRepairStatus
(
1
);
deviceRepairDetailService
.
update
(
repairDetail
);
});
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBill
.
getSendUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
repairBill
.
getReceiveUnit
()+
"接收维修装备"
,
ids
);
messageService
.
add
(
messageBto
);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修装备接收入库"
);
}
...
...
@@ -513,7 +598,7 @@ public class RepairController {
//生成维修退回单
RepairBackBill
repairBackBill
=
new
RepairBackBill
();
BeanUtils
.
copyProperties
(
repairBackBillSaveVo
,
repairBackBill
);
repairBackBill
.
setBackStatus
(
0
);
repairBackBill
.
setBackStatus
(
2
);
repairBackBill
.
setDeviceRepairBillId
(
repairBill
.
getId
());
repairBackBill
.
setSendTime
(
new
Date
());
repairBackBill
.
setTitle
(
"维修退回业务"
);
...
...
@@ -530,17 +615,24 @@ public class RepairController {
//发起维修退回子业务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
repairBackBillSaveVo
.
getStartUserbId
()
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
REPAIR_BACK_CONFIRM
.
id
,
"维修退回"
,
taskBto
.
getId
(),
taskBto
.
getNodeIdDetail
()
+
taskBto
.
getId
()
+
"."
,
deviceRepairBackBillEntity1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(
),
1
,
null
,
userIds
);
userIds
.
add
(
0
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
"维修退回"
,
taskBto
.
getId
(),
taskBto
.
getNodeIdDetail
()
+
taskBto
.
getId
()
+
"."
,
deviceRepairBackBillEntity1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()
),
1
,
null
,
userIds
);
TaskBto
task
=
taskService
.
start
(
taskBto1
);
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
repairBackBillSaveVo
.
getFileName
(),
repairBackBillSaveVo
.
getFileUrl
()));
//添加装备日志
for
(
DeviceDetailVo
d
:
repairBackBillSaveVo
.
getDeviceList
())
{
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
d
.
getDeviceId
());
deviceLibraryEntity
.
setLifeStatus
(
3
);
deviceLibraryEntity
.
setManageStatus
(
0
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
d
.
getDeviceId
(),
"向"
+
repairBackBillSaveVo
.
getReceiveUnit
()
+
"退还维修装备"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
String
deviceIdDetail
=
repairBackBill
.
getBackCheckDetail
();
List
<
Integer
>
idList
=
StringSplitUtil
.
split
(
deviceIdDetail
);
//添加出库白名单
inputOutputDeviceService
.
addWhiteDevices
(
idList
,
userUtils
.
getCurrentUnitId
(),
1
);
//判断是否修完
List
<
RepairDetail
>
deviceRepairDetailEntities
=
deviceRepairDetailService
.
findByBillId
(
repairBill
.
getId
());
//获取所有装备的维修状态
...
...
@@ -561,8 +653,15 @@ public class RepairController {
//维修主业务完结
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
}
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
repairBackBill
.
getSendUnit
()+
"向"
+
repairBackBill
.
getReceiveUnit
()+
"退回维修装备"
,
ids
);
messageService
.
add
(
messageBto
);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"出库成功待审核"
);
return
ResultUtil
.
success
(
task
);
}
@ApiOperation
(
value
=
"修好装备出库审核"
,
notes
=
"可以通过这个接口修好装备出库审核"
)
...
...
@@ -637,6 +736,7 @@ public class RepairController {
TaskBto
taskBto
=
taskService
.
get
(
repairReceiveVo
.
getTaskId
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
Integer
level
=
userUtils
.
getCurrentUnitLevel
();
taskService
.
addInvolveUser
(
taskBto
,
userId
);
//获取退回单和装备id
RepairBackBill
repairBackBill
;
if
(
level
==
2
||
level
==
3
)
{
...
...
@@ -677,7 +777,7 @@ public class RepairController {
fileVoList
.
add
(
new
FileVo
(
"维修单"
,
repairBackBill
.
getBillFileName
(),
repairBackBill
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
repairBackBill
.
getReceiveFileName
(),
repairBackBill
.
getReceiveFileUrl
()));
//更新退回单
repairBackBill
.
setBackStatus
(
3
);
repairBackBill
.
setBackStatus
(
5
);
repairBackBill
.
setBillFileName
(
repairReceiveVo
.
getBillFileName
());
repairBackBill
.
setBillFileUrl
(
repairReceiveVo
.
getBillFileUrl
());
repairBackBill
.
setReceiveTime
(
new
Date
());
...
...
@@ -688,19 +788,21 @@ public class RepairController {
repairBackBill
.
setBackReciveCheckResult
(
repairReceiveVo
.
getReceiveCheckResult
());
repairBackBill
.
setReceiveUserbId
(
repairReceiveVo
.
getReceiveUserbId
());
RepairBackBill
repairBackBill1
=
deviceRepairBackBillService
.
update
(
repairBackBill
);
TaskBto
taskBto2
;
if
(
level
==
1
)
{
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
repairReceiveVo
.
getReceiveUserbId
());
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
REPAIR_BACK_RECEIVE_CONFIRM
.
id
,
"维修退回"
,
taskBto
.
getId
(),
taskBto
.
getNodeIdDetail
()
+
taskBto
.
getId
()
+
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
taskService
.
start
(
taskBto1
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
END
.
id
,
"维修退回"
,
taskBto
.
getId
(),
taskBto
.
getNodeIdDetail
()
+
taskBto
.
getId
()
+
"."
,
repairBackBill1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
taskBto2
=
taskService
.
start
(
taskBto1
);
//添加业务日志
TaskLogBto
taskLogBto2
=
new
TaskLogBto
(
taskBto1
.
getId
(),
"维修退回装备接收并发起入库"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto2
);
}
else
{
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairReceiveVo
.
getReceiveUserbId
()));
// taskService.update(taskService.moveToNext(taskBto, repairReceiveVo.getReceiveUserbId()));
taskBto2
=
taskService
.
moveToEnd
(
taskBto
);
}
TaskBto
parent
=
taskService
.
get
(
taskBto2
.
getParentTaskId
());
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存放正常接收的装备id
List
<
Integer
>
idList
=
new
ArrayList
<>();
...
...
@@ -712,7 +814,7 @@ public class RepairController {
idList
.
add
(
id
);
//更改装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
0
);
deviceLibraryEntity
.
setLifeStatus
(
2
);
deviceLibraryEntity
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修退回装备接收并发起入库"
,
fileVoList
);
...
...
@@ -733,22 +835,30 @@ public class RepairController {
}
}
//获取维修详情
List
<
RepairDetail
>
repairDetailList
=
deviceRepairDetailService
.
findByBillId
(
taskBto
.
getBillId
());
//获取所有父业务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
());
//添加维修详情
repairDetailList
.
addAll
(
repairDetails
);
});
List
<
RepairDetail
>
repairDetailList
=
deviceRepairDetailService
.
findByBillId
(
parent
.
getBillId
());
//
//获取所有父业务id
// List<Integer> fathers = StringSplitUtil.taskIdSplit(taskBto2
.getNodeIdDetail());
//
fathers.forEach(integer -> {
//
//筛选出父业务相同装备的维修详情
//
List<RepairDetail> repairDetails = repairDetailDao.findByDeviceRepairBillId(taskService.get(integer).getBillId()).stream()
//
.filter(repairDetail -> idList.contains(repairDetail.getDeviceId()))
//
.collect(Collectors.toList());
//
//添加维修详情
//
repairDetailList.addAll(repairDetails);
//
});
//改变维修详情装备所在单位为当前单位
repairDetailList
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
repairDetail
.
setRepairStatus
(
5
);
deviceRepairDetailService
.
update
(
repairDetail
);
});
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto
=
new
MessageBto
(
taskBto2
.
getId
(),
taskBto2
.
getBusinessType
(),
repairBackBill
.
getReceiveUnit
()+
"接收维修退回装备"
,
ids
);
messageService
.
add
(
messageBto
);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修成功退回装备接收入库"
);
}
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/RepairBackBillSaveVo.java
浏览文件 @
5e141d45
...
...
@@ -27,8 +27,8 @@ public class RepairBackBillSaveVo {
@ApiModelProperty
(
value
=
"退回发起人"
,
example
=
"1"
)
private
Integer
startUseraId
;
@NotNull
(
message
=
"startUserbId不能为空"
)
@Min
(
value
=
1
,
message
=
"startUserbId不能小于1"
)
//
@NotNull(message = "startUserbId不能为空")
//
@Min(value = 1,message = "startUserbId不能小于1")
@ApiModelProperty
(
value
=
"退回确认人"
,
example
=
"1"
)
private
Integer
startUserbId
;
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/RepairBillSaveVo.java
浏览文件 @
5e141d45
...
...
@@ -22,8 +22,8 @@ public class RepairBillSaveVo {
@ApiModelProperty
(
value
=
"发起申请人"
,
example
=
"1"
)
private
Integer
startUseraId
;
@NotNull
(
message
=
"startUserbId不能为空"
)
@Min
(
value
=
1
,
message
=
"startUserbId不能小于1"
)
//
@NotNull(message = "startUserbId不能为空")
//
@Min(value = 1,message = "startUserbId不能小于1")
@ApiModelProperty
(
value
=
"发起确认人"
,
example
=
"1"
)
private
Integer
startUserbId
;
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/RepairReceiveVo.java
浏览文件 @
5e141d45
...
...
@@ -14,8 +14,8 @@ import javax.validation.constraints.NotNull;
@ApiModel
(
"配发接收类"
)
public
class
RepairReceiveVo
{
@NotNull
(
message
=
"receiveUserbId不能为空"
)
@Min
(
value
=
1
,
message
=
"receiveUserbId不能小于1"
)
//
@NotNull(message = "receiveUserbId不能为空")
//
@Min(value = 1,message = "receiveUserbId不能小于1")
@ApiModelProperty
(
value
=
"接收单位B岗"
)
private
Integer
receiveUserbId
;
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
5e141d45
...
...
@@ -9,6 +9,8 @@ import com.tykj.dev.device.library.subject.vo.DeviceLibrarySaveVo;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.packing.service.PackingLibraryService
;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.read.service.MessageService
;
import
com.tykj.dev.device.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.storage.service.StorageBillService
;
import
com.tykj.dev.device.storage.subject.domin.StorageBill
;
import
com.tykj.dev.device.storage.subject.vo.StorageBillConfirmVo
;
...
...
@@ -18,6 +20,7 @@ import com.tykj.dev.device.storage.subject.vo.StorageDetailVo;
import
com.tykj.dev.device.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.bto.TaskLogBto
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
...
...
@@ -34,8 +37,6 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
com.tykj.dev.device.read.service.MessageService
;
import
com.tykj.dev.device.read.subject.bto.MessageBto
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -143,6 +144,9 @@ public class StorageBillController {
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"配发单"
,
storageBillEntity
.
getFileName
(),
storageBillEntity
.
getFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
storageBillEntity
.
getReceiveFileName
(),
storageBillEntity
.
getReceiveFileUrl
()));
//添加业务日志
TaskLogBto
taskLogBto2
=
new
TaskLogBto
(
taskEntity1
.
getId
(),
"发起装备入库"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto2
);
//3.存装备
Integer
parentId
=
null
;
for
(
DeviceLibrarySaveVo
d
:
storageBillSaveVo
.
getDeviceLibrarySaveVoList
())
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论