Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
73cd4ede
提交
73cd4ede
authored
4月 21, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
acf3b060
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
291 行增加
和
61 行删除
+291
-61
BackController.java
.../com/tykj/dev/device/allot/controller/BackController.java
+6
-0
DeviceChange.java
...m/tykj/dev/device/library/subject/domin/DeviceChange.java
+3
-0
DeviceEditVo.java
.../com/tykj/dev/device/library/subject/vo/DeviceEditVo.java
+1
-0
ScriptSaveVo.java
.../com/tykj/dev/device/library/subject/vo/ScriptSaveVo.java
+4
-1
StatusEnum.java
...misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
+8
-8
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+4
-1
PackingLibraryDao.java
...tykj/dev/device/packing/repository/PackingLibraryDao.java
+1
-1
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+1
-1
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+217
-47
RepairDetail.java
...om/tykj/dev/device/repair/subject/domin/RepairDetail.java
+0
-1
DeviceEditVo.java
...a/com/tykj/dev/device/repair/subject/vo/DeviceEditVo.java
+40
-0
StatisticalServiceImpl.java
.../dev/statistical/service/impl/StatisticalServiceImpl.java
+4
-1
WorkBench.java
.../src/main/java/com/tykj/dev/statistical/vo/WorkBench.java
+2
-0
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/BackController.java
浏览文件 @
73cd4ede
...
...
@@ -346,6 +346,12 @@ public class BackController {
ids
.
forEach
(
integer
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"上传退回单"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
integer
);
deviceLibrary
.
setLocationUnit
(
allotBackBill
.
getReceiveUnit
());
deviceLibrary
.
setLifeStatus
(
2
);
deviceLibrary
.
setOwnUnit
(
allotBackBill
.
getReceiveUnit
());
deviceLibrary
.
setManageStatus
(
1
);
deviceLibraryService
.
update
(
deviceLibrary
);
});
if
(
idList
.
size
()>
0
)
{
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"被选为经办人"
,
idList
,
1
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/domin/DeviceChange.java
浏览文件 @
73cd4ede
...
...
@@ -60,4 +60,7 @@ public class DeviceChange {
@ApiModelProperty
(
value
=
"区块链记录id"
)
private
String
recordId
;
@Column
(
name
=
"change_files"
,
columnDefinition
=
"TEXT"
)
private
String
changeFiles
;
}
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceEditVo.java
浏览文件 @
73cd4ede
...
...
@@ -34,4 +34,5 @@ public class DeviceEditVo {
@Min
(
value
=
1
,
message
=
"id不能小于1"
)
@ApiModelProperty
(
value
=
"换新维修详情id"
,
example
=
"1"
)
private
Integer
id
;
}
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/ScriptSaveVo.java
浏览文件 @
73cd4ede
...
...
@@ -36,12 +36,15 @@ public class ScriptSaveVo {
@ApiModelProperty
(
value
=
"数量"
)
private
Integer
num
;
@ApiModelProperty
(
value
=
"列装Id"
)
@ApiModelProperty
(
value
=
"列装Id
/维修装备Id
"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"维修记录Id"
)
private
Integer
detailId
;
public
String
toJson
(){
return
JacksonUtil
.
toJSon
(
this
);
}
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
浏览文件 @
73cd4ede
...
...
@@ -194,7 +194,7 @@ public enum StatusEnum {
/**
* 待盖章出库
*/
WAIT_SIGN
(
341
,
"
待盖章出库
"
),
WAIT_SIGN
(
341
,
"
等待盖章
"
),
/**
* 待自查
...
...
@@ -237,22 +237,22 @@ public enum StatusEnum {
WAIT_RECEIVE
(
701
,
"等待接收维修装备"
),
REPAIR_RECEIVE_CONFIRM
(
702
,
"接收维修装备待审核"
),
REPAIRING
(
703
,
"维修中"
),
WAIT_UPLOAD_FILE
(
704
,
"等待上传
送修
单"
),
WAIT_UPLOAD_SEND_FILE
(
722
,
"等待上传
送修
单"
),
WAIT_UPLOAD_FILE
(
704
,
"等待上传
签收
单"
),
WAIT_UPLOAD_SEND_FILE
(
722
,
"等待上传
回执
单"
),
COUNTRY_REPAIRING
(
777
,
"等待接收维修退回装备"
),
REPAIR_SEND_DRAFT
(
788
,
"草稿"
),
REPAIR_SEND_SIGN_WAIT_CONFIRM
(
790
,
"申请签章待审核"
),
REPAIR_SEND_WAIT_SIGN
(
791
,
"
待盖章出库
"
),
REPAIR_SEND_WAIT_SIGN
(
791
,
"
等待盖章
"
),
/**
* 维修完成退回状态
*/
REPAIR_BACK_CONFIRM
(
800
,
"维修退回装备出库待审核"
),
WAIT_BACK_RECEIVE
(
801
,
"等待接收维修退回装备"
),
REPAIR_BACK_RECEIVE_CONFIRM
(
802
,
"接收维修退回装备待审核"
),
WAIT_UPLOAD_BACK_FILE
(
804
,
"等待上传
回执
单"
),
WAIT_UPLOAD_BACK_SEND_FILE
(
810
,
"等待上传
领取
单"
),
WAIT_UPLOAD_BACK_FILE
(
804
,
"等待上传
签收
单"
),
WAIT_UPLOAD_BACK_SEND_FILE
(
810
,
"等待上传
回执
单"
),
REPAIR_BACK_SIGN_WAIT_CONFIRM
(
820
,
"申请签章待审核"
),
REPAIR_BACK_WAIT_SIGN
(
821
,
"
待盖章出库
"
),
REPAIR_BACK_WAIT_SIGN
(
821
,
"
等待盖章
"
),
REPAIR_BACK_DRAFT
(
888
,
"草稿"
),
/**
...
...
@@ -264,7 +264,7 @@ public enum StatusEnum {
WAIT_UPLOAD_BACK_FILE_2
(
911
,
"待上传退回单"
),
BACK_DRAFT
(
922
,
"草稿"
),
BACK_SIGN_WAIT_CONFIRM
(
930
,
"申请签章待审核"
),
BACK_WAIT_SIGN
(
931
,
"
待盖章出库
"
),
BACK_WAIT_SIGN
(
931
,
"
等待盖章
"
),
/**
* 报废状态
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
73cd4ede
...
...
@@ -398,12 +398,12 @@ public class PackingController {
map
.
put
(
"error"
,
"型号"
+
packingModelEdit
.
getModel
()+
"已存在"
);
return
ResponseEntity
.
ok
(
map
);
}
BeanUtils
.
copyProperties
(
packingModelEdit
,
packingLibrary
);
if
(
packingModelEdit
.
getModel
()!=
null
&&!
packingModelEdit
.
getModel
().
equals
(
packingLibrary
.
getModel
())){
packingLibrary
.
setModel
(
packingModelEdit
.
getModel
());
packingLibrary
.
setName
(
packingModelEdit
.
getModel
());
packingLibraryService
.
changeAllModel
(
packingLibrary
.
getId
(),
packingModelEdit
.
getModel
());
}
BeanUtils
.
copyProperties
(
packingModelEdit
,
packingLibrary
);
packingLibraryService
.
update
(
packingLibrary
);
//发送阅知信息
List
<
Integer
>
userIds
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
...
...
@@ -420,6 +420,9 @@ public class PackingController {
@PostMapping
(
"/update/device"
)
public
ResponseEntity
updateDevice
(
@RequestBody
@Validated
PackingLibraryUpdateVo
packingLibraryUpdateVo
){
PackingLibrary
packingLibrary
=
packingLibraryService
.
getOne
(
packingLibraryUpdateVo
.
getPackingId
());
if
(!
packingLibraryUpdateVo
.
getMatchingRange
().
equals
(
packingLibrary
.
getMatchingRange
())&&
packingLibraryService
.
matchingRangeIsExist
(
packingLibrary
.
getPartParentId
(),
packingLibraryUpdateVo
.
getMatchingRange
())){
throw
new
ApiException
(
"该型号下已存在配用范围为"
+
configCache
.
getMatchingRangeMap
().
get
(
packingLibraryUpdateVo
.
getMatchingRange
())+
"的装备"
);
}
//复制相同的字段
if
(
packingLibraryUpdateVo
.
getName
()!=
null
&&!
packingLibraryUpdateVo
.
getName
().
equals
(
packingLibrary
.
getName
())&&!
packingLibraryService
.
nameIsExist
(
packingLibrary
.
getModel
(),
packingLibraryUpdateVo
.
getName
())){
//添加列装日志
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/repository/PackingLibraryDao.java
浏览文件 @
73cd4ede
...
...
@@ -21,7 +21,7 @@ public interface PackingLibraryDao extends JpaRepository<PackingLibrary, Integer
List
<
PackingLibrary
>
findAllByIsRootAndPackingStatus
(
Integer
isRoot
,
Integer
packingStatus
);
List
<
PackingLibrary
>
findAllByPartParentIdAndMatchingRange
(
Integer
partParentId
,
Integer
matchingRange
);
List
<
PackingLibrary
>
findAllByPartParentIdAndMatchingRange
AndPackingStatus
(
Integer
partParentId
,
Integer
matchingRange
,
Integer
packingStatus
);
List
<
PackingLibrary
>
findAllByDeleteTag
(
Integer
deleteTag
);
}
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
73cd4ede
...
...
@@ -576,7 +576,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
*/
@Override
public
PackingLibrary
findSamePacking
(
Integer
parentId
,
Integer
matchingRange
)
{
List
<
PackingLibrary
>
packingLibraries
=
packingLibraryDao
.
findAllByPartParentIdAndMatchingRange
(
parentId
,
matchingRange
);
List
<
PackingLibrary
>
packingLibraries
=
packingLibraryDao
.
findAllByPartParentIdAndMatchingRange
AndPackingStatus
(
parentId
,
matchingRange
,
2
);
if
(
packingLibraries
.
isEmpty
()){
return
null
;
}
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
73cd4ede
...
...
@@ -11,7 +11,6 @@ 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.DeviceChange
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.DeviceEditVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibraryUpdateVo
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
...
...
@@ -34,6 +33,7 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import
com.tykj.dev.device.user.read.service.MessageService
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.subject.dao.UserDao
;
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.device.user.subject.service.UserPublicService
;
...
...
@@ -280,19 +280,19 @@ public class RepairController {
RepairSendBill
deviceRepairSendBillEntity1
=
new
RepairSendBill
();
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
repairBill1
);
BeanUtils
.
copyProperties
(
repairBillSaveVo
,
deviceRepairSendBillEntity1
);
repairBill
=
deviceRepairBillService
.
addEntity
(
repairBill1
);
deviceRepairSendBillEntity
=
deviceRepairSendBillService
.
addEntity
(
deviceRepairSendBillEntity1
);
}
if
(
repairBillSaveVo
.
getScriptSaveVos
()
!=
null
)
{
deviceRepairSendBillEntity1
.
setScriptJson
(
JacksonUtil
.
toJSon
(
repairBillSaveVo
.
getScriptSaveVos
()));
deviceRepairSendBillEntity
.
setScriptJson
(
JacksonUtil
.
toJSon
(
repairBillSaveVo
.
getScriptSaveVos
()));
}
//如果当前为省向国家发起的
if
(
level
==
1
)
{
repairBill1
.
setRepairStatus
(
4
);
deviceRepairSendBillEntity1
.
setRepairStatus
(
5
);
repairBill
.
setRepairStatus
(
4
);
deviceRepairSendBillEntity
.
setRepairStatus
(
5
);
}
else
{
repairBill1
.
setRepairStatus
(
2
);
deviceRepairSendBillEntity1
.
setRepairStatus
(
2
);
}
repairBill
=
deviceRepairBillService
.
addEntity
(
repairBill1
);
deviceRepairSendBillEntity
=
deviceRepairSendBillService
.
addEntity
(
deviceRepairSendBillEntity1
);
repairBill
.
setRepairStatus
(
2
);
deviceRepairSendBillEntity
.
setRepairStatus
(
2
);
}
if
(
repairBillSaveVo
.
getRepairUseraId
()
!=
null
)
{
repairBill
.
setRepairUserA
(
userPublicService
.
getOne
(
repairBillSaveVo
.
getRepairUseraId
()).
getName
());
...
...
@@ -319,13 +319,16 @@ public class RepairController {
StringBuffer
stringBuffer
=
new
StringBuffer
();
//存维修详情单
for
(
DeviceDetailVo
d
:
repairBillSaveVo
.
getDeviceList
())
{
RepairDetail
oldRepairDetail
=
deviceRepairDetailService
.
getOne
(
d
.
getId
());
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
.
getDeviceRepairBillId
()==
0
)
{
if
(
oldRepairDetail
!=
null
&&
oldRepairDetail
.
getDeviceRepairBillId
()==
0
)
{
oldRepairDetail
.
setRemark
(
d
.
getRemark
());
oldRepairDetail
.
setDeviceRepairBillId
(
repairBill1
.
getId
());
oldRepairDetail
.
setRepairStatus
(
0
);
...
...
@@ -376,12 +379,26 @@ public class RepairController {
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
,
"维修业务"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
"country"
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto
);
}
else
{
TaskBto
taskBto1
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
taskBto1
.
setCustomInfo
(
"country"
);
saveEntity
=
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
WAIT_UPLOAD_FILE
);
}
}
else
{
ownUnit
=
userPublicService
.
findUnitIdByName
(
repairBill
.
getReceiveUnit
());
if
(
repairBillSaveVo
.
getTaskId
()==
null
)
{
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_RECEIVE
.
id
,
"维修业务"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
ownUnit
,
1
,
null
,
userIds
);
saveEntity
=
taskService
.
start
(
taskBto
);
}
else
{
TaskBto
taskBto1
=
taskService
.
get
(
repairBillSaveVo
.
getTaskId
());
taskBto1
.
setOwnUnit
(
ownUnit
);
saveEntity
=
taskService
.
moveToSpecial
(
taskBto1
,
StatusEnum
.
WAIT_RECEIVE
);
}
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBill
.
getReceiveUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
...
...
@@ -498,7 +515,8 @@ public class RepairController {
//更新装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraryEntity
.
setLifeStatus
(
4
);
deviceLibraryEntity
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceLibraryEntity
.
setLocationUnit
(
repairBill
.
getReceiveUnit
());
deviceLibraryEntity
.
setManageStatus
(
1
);
//存装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"接收并发起入库"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
...
...
@@ -519,7 +537,7 @@ public class RepairController {
}
//改变维修详情装备所在单位为当前单位
repairDetailEntities
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
repairDetail
.
setLocationUnit
(
repairBill
.
getReceiveUnit
());
repairDetail
.
setRepairStatus
(
1
);
deviceRepairDetailService
.
update
(
repairDetail
);
});
...
...
@@ -556,6 +574,12 @@ public class RepairController {
deviceRepairBillService
.
update
(
repairBill
);
deviceRepairSendBillService
.
update
(
repairSendBill
);
}
if
(
taskBto
.
getBillStatus
().
equals
(
StatusEnum
.
WAIT_RECEIVE
.
id
))
{
taskBto
.
setRemark
(
"入库盖章"
);
}
else
{
taskBto
.
setRemark
(
"出库盖章"
);
}
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
REPAIR_SEND_SIGN_WAIT_CONFIRM
,
userId
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"申请成功"
);
...
...
@@ -717,8 +741,16 @@ public class RepairController {
//获取当前维修业务,维修单
Integer
userId
=
userUtils
.
getCurrentUserId
();
//生成维修退回单
RepairBackBill
repairBackBill
=
new
RepairBackBill
();
BeanUtils
.
copyProperties
(
repairBackBillSaveVo
,
repairBackBill
);
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
(
"维修退回业务"
);
...
...
@@ -732,7 +764,7 @@ public class RepairController {
if
(
repairBackBillSaveVo
.
getScriptSaveVos
()!=
null
){
repairBackBill
.
setScriptJson
(
JacksonUtil
.
toJSon
(
repairBackBillSaveVo
.
getScriptSaveVos
()));
}
RepairBackBill
deviceRepairBackBillEntity1
=
deviceRepairBackBillService
.
sav
e
(
repairBackBill
);
RepairBackBill
deviceRepairBackBillEntity1
=
deviceRepairBackBillService
.
updat
e
(
repairBackBill
);
Calendar
calendar
=
Calendar
.
getInstance
();
String
s1
=
"NO:第"
+
calendar
.
get
(
Calendar
.
YEAR
)
+
"LQ"
+
repairBackBill
.
getId
()
+
"号"
;
deviceRepairBackBillEntity1
.
setDocNum
(
s1
);
...
...
@@ -741,8 +773,16 @@ public class RepairController {
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
"维修退回"
,
null
,
"."
,
deviceRepairBackBillEntity1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getReceiveUnit
()),
1
,
null
,
userIds
);
TaskBto
task
=
taskService
.
start
(
taskBto1
);
TaskBto
task
;
if
(
repairBackBillSaveVo
.
getTaskId
()==
null
)
{
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
"维修退回"
,
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
,
"维修退回"
,
task
.
getId
(),
task
.
getNodeIdDetail
()
+
task
.
getId
()
+
"."
,
task
.
getBillId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getSendUnit
()),
0
,
null
,
Collections
.
singletonList
(
0
));
taskService
.
start
(
taskBto2
);
//添加业务日志
...
...
@@ -788,10 +828,9 @@ public class RepairController {
//获取当前任务
TaskBto
taskBto
;
Integer
userId
=
userUtils
.
getCurrentUserId
();
Integer
level
=
userUtils
.
getCurrentUnitLevel
();
//获取退回单和装备id
RepairBackBill
repairBackBill
;
if
(
level
==
2
||
level
==
3
)
{
if
(
repairReceiveVo
.
getTaskId
()!=
null
)
{
taskBto
=
taskService
.
get
(
repairReceiveVo
.
getTaskId
());
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
WAIT_BACK_RECEIVE
);
taskService
.
addInvolveUser
(
taskBto
,
userId
);
...
...
@@ -835,7 +874,7 @@ public class RepairController {
RepairBackBill
repairBackBill1
=
deviceRepairBackBillService
.
update
(
repairBackBill
);
TaskBto
taskBto2
;
Map
<
Integer
,
List
<
Integer
>>
messageMap
=
new
HashMap
<>();
if
(
level
==
1
)
{
if
(
repairReceiveVo
.
getTaskId
()==
null
)
{
List
<
Integer
>
userIds
=
new
ArrayList
<>();
if
(
repairReceiveVo
.
getStatus
()==
0
)
{
userIds
.
add
(
userId
);
...
...
@@ -851,9 +890,11 @@ public class RepairController {
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
d
.
getId
());
repairDetail
.
setRepairBackBillId
(
repairBackBill1
.
getId
());
repairDetail
.
setRepairStatus
(
5
);
repairDetail
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
if
(
repairDetail
.
getPid
()!=
null
)
{
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
repairDetail
.
getPid
());
repairDetail1
.
setRepairStatus
(
2
);
repairDetail1
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
deviceRepairDetailService
.
update
(
repairDetail1
);
Integer
unitId
=
userPublicService
.
getOne
(
repairDetail1
.
getCreateUserId
()).
getUnitsId
();
if
(
messageMap
.
get
(
unitId
)==
null
)
{
...
...
@@ -880,9 +921,11 @@ public class RepairController {
List
<
RepairDetail
>
repairDetailList
=
repairDetailDao
.
findByRepairBackBillId
(
repairBackBill
.
getId
());
repairDetailList
.
forEach
(
repairDetail
->
{
repairDetail
.
setRepairStatus
(
5
);
repairDetail
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
if
(
repairDetail
.
getPid
()!=
null
)
{
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
repairDetail
.
getPid
());
repairDetail1
.
setRepairStatus
(
2
);
repairDetail1
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
deviceRepairDetailService
.
update
(
repairDetail1
);
Integer
unitId
=
userPublicService
.
getOne
(
repairDetail1
.
getCreateUserId
()).
getUnitsId
();
if
(
messageMap
.
get
(
unitId
)==
null
)
{
...
...
@@ -905,11 +948,11 @@ public class RepairController {
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//更改装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
Integer
unitId
=
userPublicService
.
findUnitIdByName
(
deviceLibraryEntity
.
getOwnUnit
());
deviceLibraryEntity
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceLibraryEntity
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
if
(
deviceLibraryEntity
.
getOwnUnit
().
equals
(
deviceLibraryEntity
.
getLocationUnit
()))
{
deviceLibraryEntity
.
setLifeStatus
(
2
);
}
deviceLibraryEntity
.
setManageStatus
(
1
);
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"维修退回装备接收并发起入库"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
...
...
@@ -930,7 +973,7 @@ public class RepairController {
}
//发送阅知信息
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
if
(
level
>
1
)
{
if
(
repairReceiveVo
.
getTaskId
()!=
null
)
{
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
userPublicService
.
findUnitIdByName
(
repairBackBill
.
getSendUnit
())).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
...
...
@@ -974,6 +1017,12 @@ public class RepairController {
repairBackBill
.
setReceiveUseraId
(
userUtils
.
getCurrentUserId
());
deviceRepairBackBillService
.
update
(
repairBackBill
);
}
if
(
taskBto
.
getBillStatus
().
equals
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
))
{
taskBto
.
setRemark
(
"入库盖章"
);
}
else
{
taskBto
.
setRemark
(
"出库盖章"
);
}
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
REPAIR_BACK_SIGN_WAIT_CONFIRM
,
userId
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"申请成功"
);
...
...
@@ -1380,9 +1429,9 @@ public class RepairController {
@ApiOperation
(
value
=
"查询维修管理列表"
,
notes
=
"可以通过这个接口查询维修管理列表"
)
@PostMapping
(
value
=
"/repairList"
)
public
ResponseEntity
getRepairList
(
@RequestBody
RepairTaskSelectVo
repairTaskSelectVo
)
{
Map
<
Integer
,
DeviceLibrary
>
deviceLibraryMap
=
deviceLibraryService
.
getAllDeviceMap
();
//
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
Integer
type
=
repairTaskSelectVo
.
getType
();
Integer
userId
=
userUtils
.
getCurrentUserId
();
//
Integer userId = userUtils.getCurrentUserId();
String
unitName
=
userUtils
.
getCurrentUserUnitName
();
//待维修装备
if
(
type
==
1
){
...
...
@@ -1391,7 +1440,7 @@ public class RepairController {
integerList
.
add
(
9
);
List
<
RepairDetail
>
repairDetails
=
repairDetailDao
.
findAllByRepairStatusIn
(
integerList
,
repairTaskSelectVo
.
getPageable
().
getSort
());
repairDetails
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
deviceLibraryMap
.
get
(
repairDetail
.
getDeviceId
()).
getLocationUnit
());
//
repairDetail.setLocationUnit(deviceLibraryMap.get(repairDetail.getDeviceId()).getLocationUnit());
repairDetail
.
setConfigName
();
});
List
<
RepairDetail
>
repairDetails1
=
repairDetails
.
stream
().
filter
(
repairDetail
->
repairDetail
.
getLocationUnit
().
equals
(
unitName
)).
collect
(
Collectors
.
toList
());
...
...
@@ -1402,9 +1451,10 @@ public class RepairController {
List
<
Integer
>
integerList
=
new
ArrayList
<>();
integerList
.
add
(
5
);
integerList
.
add
(
9
);
integerList
.
add
(
4
);
List
<
RepairDetail
>
repairDetails1
=
repairDetailDao
.
findAllByRepairStatusNotIn
(
integerList
,
repairTaskSelectVo
.
getPageable
().
getSort
());
repairDetails1
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
deviceLibraryMap
.
get
(
repairDetail
.
getDeviceId
()).
getLocationUnit
());
//
repairDetail.setLocationUnit(deviceLibraryMap.get(repairDetail.getDeviceId()).getLocationUnit());
repairDetail
.
setConfigName
();
});
List
<
RepairDetail
>
repairDetails2
=
repairDetails1
.
stream
().
filter
(
repairDetail
->
userPublicService
.
findUnitsNameByUserId
(
repairDetail
.
getCreateUserId
()).
equals
(
unitName
)).
collect
(
Collectors
.
toList
());
...
...
@@ -1414,22 +1464,34 @@ public class RepairController {
else
if
(
type
==
3
){
List
<
RepairDetail
>
repairDetails
=
repairDetailDao
.
findAllByRepairStatus
(
2
,
repairTaskSelectVo
.
getPageable
().
getSort
());
repairDetails
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
deviceLibraryMap
.
get
(
repairDetail
.
getDeviceId
()).
getLocationUnit
());
//
repairDetail.setLocationUnit(deviceLibraryMap.get(repairDetail.getDeviceId()).getLocationUnit());
repairDetail
.
setConfigName
();
});
List
<
RepairDetail
>
repairDetails2
=
repairDetails
.
stream
().
filter
(
repairDetail
->
repairDetail
.
getLocationUnit
().
equals
(
unitName
)).
collect
(
Collectors
.
toList
());
return
ResponseEntity
.
ok
(
PageUtil
.
getPerPage
(
repairTaskSelectVo
.
getPage
(),
repairTaskSelectVo
.
getSize
(),
repairDetails2
,
repairTaskSelectVo
.
getPageable
()));
}
// else if(type==4){
// List<RepairDetail> repairDetails = repairDetailDao.findAllByRepairStatus(2,repairTaskSelectVo.getPageable().getSort());
// repairDetails.forEach(repairDetail -> {
// repairDetail.setLocationUnit(deviceLibraryMap.get(repairDetail.getDeviceId()).getLocationUnit());
// repairDetail.setConfigName();
// });
// return ResponseEntity.ok(repairDetails.stream().filter(repairDetail -> repairDetail.getLocationUnit().equals(unitName)).collect(Collectors.toList()));
// }
else
if
(
type
==
4
){
Integer
level
=
userUtils
.
getCurrentUnitLevel
();
List
<
RepairDetail
>
repairDetails
;
if
(
level
==
1
)
{
repairDetails
=
repairDetailDao
.
findAllByRepairStatusIn
(
Arrays
.
asList
(
4
,
5
),
repairTaskSelectVo
.
getPageable
().
getSort
());
}
else
if
(
level
==
2
)
{
repairDetails
=
repairDetailDao
.
findAllByRepairStatus
(
5
,
repairTaskSelectVo
.
getPageable
().
getSort
());
}
else
{
throw
new
ApiException
(
"区县没有维修完成列表"
);
}
repairDetails
.
forEach
(
repairDetail
->
{
repairDetail
.
setConfigName
();
});
List
<
String
>
units
=
unitsService
.
findListById
(
0
).
stream
().
map
(
Units:
:
getName
).
collect
(
Collectors
.
toList
());
units
.
addAll
(
unitsService
.
findBySubordinateNotOneself
(
userUtils
.
getCurrentUnitId
()).
stream
().
map
(
Units:
:
getName
).
collect
(
Collectors
.
toList
()));
List
<
RepairDetail
>
repairDetails2
=
repairDetails
.
stream
().
filter
(
repairDetail
->
units
.
contains
(
repairDetail
.
getLocationUnit
())).
collect
(
Collectors
.
toList
());
return
ResponseEntity
.
ok
(
PageUtil
.
getPerPage
(
repairTaskSelectVo
.
getPage
(),
repairTaskSelectVo
.
getSize
(),
repairDetails2
,
repairTaskSelectVo
.
getPageable
()));
}
else
{
throw
new
ApiException
(
"type只能为1,2,3"
);
throw
new
ApiException
(
"type只能为1,2,3
,4
"
);
}
}
...
...
@@ -1475,33 +1537,92 @@ public class RepairController {
@PostMapping
(
value
=
"/changeNew"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
change
(
@RequestBody
DeviceEditVo
deviceEditVo
){
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
deviceEditVo
.
getId
());
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
deviceEditVo
.
getDeviceId
());
//创建新装备
DeviceLibrary
newDevice
=
new
DeviceLibrary
();
BeanUtils
.
copyProperties
(
deviceLibraryEntity
,
newDevice
);
newDevice
.
setId
(
null
);
newDevice
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
if
(
newDevice
.
getOwnUnit
().
equals
(
newDevice
.
getLocationUnit
()))
{
newDevice
.
setLifeStatus
(
2
);
}
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
addEntity
(
newDevice
);
//添加新的维修换新装备记录
RepairDetail
newRepairDetail
=
new
RepairDetail
();
BeanUtils
.
copyProperties
(
repairDetail
,
newRepairDetail
);
newRepairDetail
.
setId
(
null
);
newRepairDetail
.
setDeviceId
(
deviceLibrary
.
getId
());
newRepairDetail
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
newRepairDetail
.
setRepairStatus
(
5
);
if
(
newRepairDetail
.
getPid
()!=
null
)
{
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
repairDetail
.
getPid
());
repairDetail1
.
setRepairStatus
(
2
);
repairDetail1
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceRepairDetailService
.
update
(
repairDetail1
);
Integer
unitId
=
userPublicService
.
getOne
(
repairDetail1
.
getCreateUserId
()).
getUnitsId
();
List
<
Integer
>
integerList
=
new
ArrayList
<>();
integerList
.
addAll
(
userDao
.
findAllByUnitsId
(
unitId
).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
);
messageBto2
.
setRecord
(
String
.
valueOf
(
repairDetail1
.
getId
()));
messageService
.
add
(
messageBto2
);
}
//旧的维修记录改为已报废
repairDetail
.
setRepairStatus
(
4
);
repairDetail
.
setLocationUnit
(
deviceLibraryEntity
.
getLocationUnit
());
repairDetail
.
setOwnUnit
(
deviceLibraryEntity
.
getLocationUnit
());
deviceRepairDetailService
.
update
(
repairDetail
);
deviceLibraryEntity
.
setOwnUnit
(
deviceLibraryEntity
.
getLocationUnit
());
deviceLibraryEntity
.
setLifeStatus
(
5
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
if
(
deviceEditVo
.
getUpdateVoList
()
!=
null
)
{
DeviceLibraryUpdateVo
libraryUpdateVo
=
deviceEditVo
.
getUpdateVoList
();
if
(
libraryUpdateVo
.
getProdNumber
()
!=
null
&&
!
libraryUpdateVo
.
getProdNumber
().
equals
(
deviceLibraryEntity
.
getProdNumber
()))
{
//添加装备日志
String
remark
=
"装备换新:将装备生产序列号由"
+
deviceLibraryEntity
.
getProdNumber
()
+
"
改
为"
+
libraryUpdateVo
.
getProdNumber
();
String
remark
=
"装备换新:将装备生产序列号由"
+
deviceLibraryEntity
.
getProdNumber
()
+
"
换
为"
+
libraryUpdateVo
.
getProdNumber
();
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
deviceEditVo
.
getDeviceId
(),
remark
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibrary
Entity
.
setProdNumber
(
libraryUpdateVo
.
getProdNumber
());
deviceLibrary
.
setProdNumber
(
libraryUpdateVo
.
getProdNumber
());
}
if
(
libraryUpdateVo
.
getSeqNumber
()
!=
null
&&
!
libraryUpdateVo
.
getSeqNumber
().
equals
(
deviceLibraryEntity
.
getSeqNumber
()))
{
if
(
deviceLibraryDao
.
getAllBySeqNumber
(
libraryUpdateVo
.
getSeqNumber
()).
size
()>
0
){
throw
new
ApiException
(
"序列号"
+
libraryUpdateVo
.
getSeqNumber
()+
"已存在"
);
}
else
{
String
remark
=
"装备换新:将装备序列号由"
+
deviceLibraryEntity
.
getSeqNumber
()
+
"
改
为"
+
libraryUpdateVo
.
getSeqNumber
();
String
remark
=
"装备换新:将装备序列号由"
+
deviceLibraryEntity
.
getSeqNumber
()
+
"
换
为"
+
libraryUpdateVo
.
getSeqNumber
();
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
deviceEditVo
.
getDeviceId
(),
remark
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryEntity
.
setSeqNumber
(
libraryUpdateVo
.
getSeqNumber
());
//改变维修详情的序列号
repairDetailDao
.
findAllByDeviceId
(
deviceEditVo
.
getDeviceId
()).
forEach
(
repairDetail
->
{
repairDetail
.
setSeqNumber
(
libraryUpdateVo
.
getSeqNumber
());
deviceRepairDetailService
.
update
(
repairDetail
);
});
deviceLibrary
.
setSeqNumber
(
libraryUpdateVo
.
getSeqNumber
());
newRepairDetail
.
setSeqNumber
(
libraryUpdateVo
.
getSeqNumber
());
}
}
}
deviceLibraryService
.
update
(
deviceLibrary
);
deviceRepairDetailService
.
save
(
newRepairDetail
);
//修改所有父维修记录序列号
if
(
newRepairDetail
.
getPid
()!=
null
){
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
newRepairDetail
.
getPid
());
repairDetail1
.
setSeqNumber
(
newRepairDetail
.
getSeqNumber
());
repairDetail1
.
setDeviceId
(
newRepairDetail
.
getDeviceId
());
repairDetail1
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceRepairDetailService
.
update
(
repairDetail1
);
if
(
repairDetail1
.
getPid
()
!=
null
)
{
RepairDetail
repairDetail2
=
deviceRepairDetailService
.
getOne
(
newRepairDetail
.
getPid
());
repairDetail2
.
setSeqNumber
(
newRepairDetail
.
getSeqNumber
());
repairDetail2
.
setDeviceId
(
newRepairDetail
.
getDeviceId
());
repairDetail2
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceRepairDetailService
.
update
(
repairDetail2
);
}
}
DeviceChange
deviceChange
=
new
DeviceChange
();
deviceChange
.
setNewDeviceId
(
deviceLibrary
.
getId
());
deviceChange
.
setOldDeviceId
(
deviceLibraryEntity
.
getId
());
if
(
deviceEditVo
.
getSendFiles
()!=
null
&&
deviceEditVo
.
getSendFiles
().
size
()>
0
)
{
deviceChange
.
setChangeFiles
(
FilesUtil
.
stringFileToList
(
deviceEditVo
.
getSendFiles
()));
}
deviceChangeService
.
add
(
deviceChange
);
return
ResultUtil
.
success
(
"更新成功"
);
}
...
...
@@ -1565,11 +1686,48 @@ public class RepairController {
ids
.
forEach
(
integer
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"上传领取单"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
integer
);
deviceLibraryEntity
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
deviceLibraryEntity
.
setLifeStatus
(
2
);
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
});
//获取维修详情
List
<
RepairDetail
>
repairDetailList
=
repairDetailDao
.
findByRepairBackBillId
(
repairBackBill
.
getId
());
Map
<
Integer
,
List
<
Integer
>>
messageMap
=
new
HashMap
<>();
repairDetailList
.
forEach
(
repairDetail
->
{
repairDetail
.
setRepairStatus
(
5
);
repairDetail
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
if
(
repairDetail
.
getPid
()!=
null
)
{
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
repairDetail
.
getPid
());
repairDetail1
.
setRepairStatus
(
2
);
repairDetail1
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
deviceRepairDetailService
.
update
(
repairDetail1
);
Integer
unitId
=
userPublicService
.
getOne
(
repairDetail1
.
getCreateUserId
()).
getUnitsId
();
if
(
messageMap
.
get
(
unitId
)==
null
)
{
messageMap
.
put
(
unitId
,
Collections
.
singletonList
(
repairDetail1
.
getId
()));
}
else
{
List
<
Integer
>
integers
=
new
ArrayList
<>(
messageMap
.
getOrDefault
(
unitId
,
new
ArrayList
<>()));
integers
.
add
(
repairDetail1
.
getId
());
messageMap
.
put
(
unitId
,
integers
);
}
}
deviceRepairDetailService
.
update
(
repairDetail
);
});
if
(
idList
.
size
()>
0
)
{
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"被选为经办人"
,
idList
,
1
);
messageService
.
add
(
messageBto
);
}
messageMap
.
keySet
().
forEach
(
integer
->
{
List
<
Integer
>
integerList
=
new
ArrayList
<>();
integerList
.
addAll
(
userDao
.
findAllByUnitsId
(
integer
).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
MessageBto
messageBto2
=
new
MessageBto
(
0
,
5
,
"待领取送修装备"
,
integerList
);
messageBto2
.
setRecord
(
StringSplitUtil
.
idListToString
(
messageMap
.
get
(
integer
)));
messageService
.
add
(
messageBto2
);
});
}
return
ResponseEntity
.
ok
(
"OK"
);
}
...
...
@@ -1591,6 +1749,7 @@ public class RepairController {
else
{
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
taskBto
.
getBillId
());
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
repairBill
.
getId
());
List
<
RepairDetail
>
repairDetailEntities
=
deviceRepairDetailService
.
findByBillId
(
repairBill
.
getId
());
//保存账单
repairSendBill
.
setSendFiles
(
FilesUtil
.
stringFileToList
(
fileVo
.
getSendFiles
()));
List
<
Integer
>
idList
=
new
ArrayList
<>();
...
...
@@ -1630,9 +1789,20 @@ public class RepairController {
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVo
.
getSendFiles
().
forEach
(
fileRet
->
fileVoList
.
add
(
new
FileVo
(
"维修单"
,
fileRet
.
getName
(),
fileRet
.
getPreviewPath
())));
ids
.
forEach
(
integer
->
{
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
integer
);
deviceLibraryEntity
.
setLifeStatus
(
4
);
deviceLibraryEntity
.
setLocationUnit
(
repairBill
.
getReceiveUnit
());
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"上传维修单"
,
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
});
//改变维修详情装备所在单位为当前单位
repairDetailEntities
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
repairBill
.
getReceiveUnit
());
repairDetail
.
setRepairStatus
(
1
);
deviceRepairDetailService
.
update
(
repairDetail
);
});
if
(
idList
.
size
()>
0
)
{
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"被选为经办人"
,
idList
,
1
);
messageService
.
add
(
messageBto
);
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/domin/RepairDetail.java
浏览文件 @
73cd4ede
...
...
@@ -81,7 +81,6 @@ public class RepairDetail {
* 所在单位
*/
@ApiModelProperty
(
value
=
"所在单位"
)
@Transient
private
String
locationUnit
;
/**
* 所属单位
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/DeviceEditVo.java
0 → 100644
浏览文件 @
73cd4ede
package
com
.
tykj
.
dev
.
device
.
repair
.
subject
.
vo
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibraryUpdateVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* @author dengdiyi
*/
@Data
@ApiModel
(
"装备编辑类"
)
public
class
DeviceEditVo
{
@ApiModelProperty
(
value
=
"装备库更新信息"
)
private
DeviceLibraryUpdateVo
updateVoList
;
@ApiModelProperty
(
value
=
"新增配件信息列表"
)
private
List
<
Integer
>
partAddIdList
;
@ApiModelProperty
(
value
=
"删除相关配件id"
)
private
List
<
Integer
>
partIdDeleteList
;
@NotNull
(
message
=
"deviceId不能为空"
)
@Min
(
value
=
1
,
message
=
"deviceId不能小于1"
)
@ApiModelProperty
(
value
=
"装备id"
,
example
=
"1"
)
private
Integer
deviceId
;
@Min
(
value
=
1
,
message
=
"id不能小于1"
)
@ApiModelProperty
(
value
=
"换新维修详情id"
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"换新单"
)
private
List
<
FileRet
>
sendFiles
;
}
dev-statistical/src/main/java/com/tykj/dev/statistical/service/impl/StatisticalServiceImpl.java
浏览文件 @
73cd4ede
...
...
@@ -499,11 +499,14 @@ public class StatisticalServiceImpl implements StatisticalService {
workBench
.
setSelfDeviceNum
(
Long
.
valueOf
(
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getOwnUnit
().
equals
(
unitName
)).
count
()).
intValue
());
workBench
.
setMatchingDeviceNum
(
new
Long
(
matchingDeviceLibraryDao
.
count
()).
intValue
());
workBench
.
setDailyDeviceNum
(
Long
.
valueOf
(
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getOwnUnit
().
equals
(
unitName
)&&
Arrays
.
asList
(
2
,
14
).
contains
(
deviceLibrary
.
getLifeStatus
())).
count
()).
intValue
());
List
<
Task
>
tasks
=
taskDao
.
findAllByBusinessType
(
7
);
List
<
Task
>
allTasks
=
taskDao
.
findAll
();
List
<
Task
>
tasks
=
allTasks
.
stream
().
filter
(
task
->
task
.
getBusinessType
()==
7
).
collect
(
Collectors
.
toList
());
List
<
Task
>
tasks2
=
allTasks
.
stream
().
filter
(
task
->
task
.
getBusinessType
()==
4
).
collect
(
Collectors
.
toList
());
workBench
.
setCheckNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
"check"
.
equals
(
task
.
getCustomInfo
())).
count
()).
intValue
());
workBench
.
setCompleteCheckNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
task
.
getBillStatus
()==
9999
&&
"check"
.
equals
(
task
.
getCustomInfo
())).
count
()).
intValue
());
workBench
.
setExamNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
task
.
getParentTaskId
()==
0
&&
"exam"
.
equals
(
task
.
getCustomInfo
())&&
task
.
getOwnUnit
().
equals
(
unit
)).
count
()).
intValue
());
workBench
.
setExamCompleteNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
task
.
getBillStatus
()==
9999
&&
task
.
getParentTaskId
()==
0
&&
"exam"
.
equals
(
task
.
getCustomInfo
())&&
task
.
getOwnUnit
().
equals
(
unit
)).
count
()).
intValue
());
workBench
.
setSelfCheckNum
(
Long
.
valueOf
(
tasks2
.
stream
().
filter
(
task
->
task
.
getBillStatus
()==
9999
&&
unit
.
equals
(
task
.
getOwnUnit
())).
count
()).
intValue
());
return
workBench
;
}
...
...
dev-statistical/src/main/java/com/tykj/dev/statistical/vo/WorkBench.java
浏览文件 @
73cd4ede
...
...
@@ -38,4 +38,6 @@ public class WorkBench {
private
Integer
lossNum
=
0
;
private
Integer
foundNum
=
0
;
private
Integer
selfCheckNum
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论