Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
6ae038f7
提交
6ae038f7
authored
9月 14, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新报废单
上级
d8339067
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
503 行增加
和
9 行删除
+503
-9
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+121
-8
RepairBillDao.java
.../com/tykj/dev/device/repair/repository/RepairBillDao.java
+1
-0
RepairDetailService.java
...m/tykj/dev/device/repair/service/RepairDetailService.java
+6
-0
RepairDetailServiceImpl.java
...v/device/repair/service/impl/RepairDetailServiceImpl.java
+15
-0
RepairDetail.java
...om/tykj/dev/device/repair/subject/domin/RepairDetail.java
+5
-0
ChangeNewDeviceVo.java
.../tykj/dev/device/repair/subject/vo/ChangeNewDeviceVo.java
+22
-0
DeviceScrapController.java
...ice/device-scrap/src/main/java/DeviceScrapController.java
+86
-0
DeviceVo.java
dev-device/device-scrap/src/main/java/DeviceVo.java
+53
-0
ScrapConditions.java
dev-device/device-scrap/src/main/java/ScrapConditions.java
+34
-0
ScrapListVo.java
dev-device/device-scrap/src/main/java/ScrapListVo.java
+78
-0
ScrapPage.java
dev-device/device-scrap/src/main/java/ScrapPage.java
+32
-0
GlobalMap.java
...va/com/tykj/dev/device/task/subject/common/GlobalMap.java
+9
-1
RepairStatusEnum.java
...tykj/dev/device/task/subject/common/RepairStatusEnum.java
+41
-0
没有找到文件。
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
6ae038f7
...
...
@@ -7,6 +7,7 @@ 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.repair.repository.RepairBackBillDao
;
import
com.tykj.dev.device.repair.repository.RepairDetailDao
;
import
com.tykj.dev.device.repair.repository.RepairSendBillDao
;
import
com.tykj.dev.device.repair.service.RepairBackBillService
;
import
com.tykj.dev.device.repair.service.RepairBillService
;
...
...
@@ -22,6 +23,8 @@ 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.task.subject.common.BusinessEnum
;
import
com.tykj.dev.device.task.subject.common.GlobalMap
;
import
com.tykj.dev.device.task.subject.common.RepairStatusEnum
;
import
com.tykj.dev.device.task.subject.common.StatusEnum
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
...
...
@@ -84,6 +87,9 @@ public class RepairController {
@Autowired
private
TaskLogService
taskLogService
;
@Autowired
private
RepairDetailDao
repairDetailDao
;
@ApiOperation
(
value
=
"发起维修"
,
notes
=
"可以通过这个接口发起维修"
)
@PostMapping
(
value
=
"/form"
)
public
ResponseEntity
<
Task
>
createRepair
(
@RequestBody
RepairBillSaveVo
repairBillSaveVo
){
...
...
@@ -127,7 +133,7 @@ public class RepairController {
RepairDetail
repairDetail
=
new
RepairDetail
();
repairDetail
.
setDeviceId
(
d
.
getDeviceId
());
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
d
.
getDeviceId
());
repairDetail
.
setLocationUnit
(
deviceLibraryEntity
.
getLocationUnit
());
repairDetail
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
repairDetail
.
setModel
(
deviceLibraryEntity
.
getModel
());
repairDetail
.
setName
(
deviceLibraryEntity
.
getName
());
repairDetail
.
setOwnUnit
(
deviceLibraryEntity
.
getOwnUnit
());
...
...
@@ -188,6 +194,26 @@ public class RepairController {
//存业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"审核成功并出库"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
// //如果当前为省,改变装备的所在为中办
// if (userUtils.getCurrentUnitLevel()==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("中办");
// deviceRepairDetailService.update(repairDetail);
// });
// }
//更新维修单和送修单状态
repairBill
.
setRepairStatus
(
2
);
deviceRepairBillService
.
update
(
repairBill
);
...
...
@@ -272,11 +298,14 @@ public class RepairController {
deviceRepairSendBillService
.
update
(
repairSendBill
);
//分隔装备id
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存接收无误的装备id
List
<
Integer
>
idList
=
new
ArrayList
<>();
for
(
String
s:
strings
)
{
if
(
s
.
length
()
>
2
)
{
//接收无误
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
);
...
...
@@ -299,10 +328,20 @@ public class RepairController {
}
}
}
//更新维修详情单
repairDetailEntities
.
forEach
(
deviceRepairDetailEntity
->
{
deviceRepairDetailEntity
.
setLocationUnit
(
repairBill
.
getReceiveUnit
());
deviceRepairDetailService
.
update
(
deviceRepairDetailEntity
);
//获取所有父业务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
(
userUtils
.
getCurrentUserUnitName
());
deviceRepairDetailService
.
update
(
repairDetail
);
});
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修装备接收入库"
);
...
...
@@ -394,9 +433,9 @@ public class RepairController {
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
taskBto
.
getBillId
());
repairOutPutDeviceVo
.
setRepairBill
(
repairBill
);
List
<
DeviceLibrary
>
deviceLibraryEntities
=
new
ArrayList
<>();
//筛选所有修好装备的id
//筛选所有修好装备
或换新装备
的id
List
<
Integer
>
idList
=
deviceRepairDetailService
.
findByBillId
(
taskBto
.
getBillId
()).
stream
()
.
filter
(
deviceRepairDetailEntity
->
deviceRepairDetailEntity
.
getRepairStatus
().
equals
(
2
))
.
filter
(
deviceRepairDetailEntity
->
deviceRepairDetailEntity
.
getRepairStatus
().
equals
(
2
)
||
deviceRepairDetailEntity
.
getRepairStatus
().
equals
(
3
)
)
.
map
(
RepairDetail:
:
getDeviceId
)
.
collect
(
Collectors
.
toList
());
//根据id添加装备
...
...
@@ -669,11 +708,14 @@ public class RepairController {
repairBackBill
.
setReceiveUserbId
(
repairReceiveVo
.
getReceiveUserbId
());
deviceRepairBackBillService
.
update
(
repairBackBill
);
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存放正常接收的装备id
List
<
Integer
>
idList
=
new
ArrayList
<>();
for
(
String
s:
strings
)
{
if
(
s
.
length
()>
1
)
{
//接收无误的装备
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
);
...
...
@@ -696,6 +738,23 @@ 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
);
});
//改变维修详情装备所在单位为当前单位
repairDetailList
.
forEach
(
repairDetail
->
{
repairDetail
.
setLocationUnit
(
userUtils
.
getCurrentUserUnitName
());
deviceRepairDetailService
.
update
(
repairDetail
);
});
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修成功退回装备接收入库"
);
}
...
...
@@ -772,8 +831,17 @@ public class RepairController {
TaskBto
taskBto
=
taskService
.
get
(
repairStatusChangeVo
.
getTaskId
());
//获取所有父任务id
List
<
Integer
>
fathers
=
StringSplitUtil
.
taskIdSplit
(
taskBto
.
getNodeIdDetail
());
//获取维修详情单
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
repairStatusChangeVo
.
getId
());
//获取旧状态
Integer
oldStatus
=
repairDetail1
.
getRepairStatus
();
//修改当前任务维修详情单该装备状态
deviceRepairDetailService
.
updateIdAndStatus
(
repairStatusChangeVo
.
getId
(),
repairStatusChangeVo
.
getNewStatus
());
repairDetail1
.
setRepairStatus
(
repairStatusChangeVo
.
getNewStatus
());
//如果修改为已报废,更改新装备详情id为0
if
(
repairStatusChangeVo
.
getNewStatus
()==
4
){
repairDetail1
.
setNewDeviceDetailId
(
0
);
}
deviceRepairDetailService
.
update
(
repairDetail1
);
//修改父任务中所有维修详情单中的该装备的状态
if
(
fathers
.
size
()>
0
)
{
fathers
.
forEach
(
integer
->
{
...
...
@@ -785,6 +853,51 @@ public class RepairController {
});
});
}
//获取装备名称
String
deviceName
=
deviceLibraryService
.
getOne
(
repairStatusChangeVo
.
getDeviceId
()).
getName
();
//添加业务日志
String
remark
=
"将装备"
+
deviceName
+
"状态由"
+
GlobalMap
.
getRepairStatusMap
().
get
(
oldStatus
).
name
+
"改为"
+
GlobalMap
.
getRepairStatusMap
().
get
(
repairStatusChangeVo
.
getNewStatus
()).
name
;
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
remark
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
return
ResultUtil
.
success
(
"修改成功"
);
}
@ApiOperation
(
value
=
"维修换新设备"
,
notes
=
"可以通过这个接口维修换新设备"
)
@PostMapping
(
value
=
"/change/new"
)
public
ResponseEntity
<
String
>
changeNewDevice
(
@RequestBody
ChangeNewDeviceVo
changeNewDeviceVo
){
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
changeNewDeviceVo
.
getTaskId
());
//获取当前单位
String
unit
=
userUtils
.
getCurrentUserUnitName
();
//获取所有父任务id
List
<
Integer
>
fathers
=
StringSplitUtil
.
taskIdSplit
(
taskBto
.
getNodeIdDetail
());
//获取维修详情单
RepairDetail
repairDetail1
=
deviceRepairDetailService
.
getOne
(
changeNewDeviceVo
.
getId
());
//获取换新装备
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
changeNewDeviceVo
.
getDeviceId
());
//判断当前装备是否已报废
if
(
repairDetail1
.
getNewDeviceDetailId
()==
0
){
//添加新的维修装备详情
RepairDetail
repairDetail
=
new
RepairDetail
();
BeanUtils
.
copyProperties
(
repairDetail1
,
repairDetail
);
repairDetail
.
setRepairStatus
(
RepairStatusEnum
.
CHANGE_NEW
.
id
);
repairDetail
.
setDeviceId
(
changeNewDeviceVo
.
getDeviceId
());
repairDetail
.
setNewDeviceDetailId
(
null
);
repairDetail
.
setRfidSurfaceId
(
deviceLibrary
.
getRfidSurfaceId
());
repairDetail
.
setSeqNumber
(
deviceLibrary
.
getSeqNumber
());
//当前业务和父任务添加该详情
deviceRepairDetailService
.
save
(
repairDetail
);
fathers
.
forEach
(
integer
->
{
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
taskService
.
get
(
integer
).
getBillId
());
RepairDetail
repairDetail2
=
new
RepairDetail
();
BeanUtils
.
copyProperties
(
repairDetail
,
repairDetail2
);
repairDetail2
.
setId
(
null
);
repairDetail2
.
setDeviceRepairBillId
(
repairBill
.
getId
());
});
//改变装备的所属
deviceLibrary
.
setOwnUnit
(
repairDetail
.
getOwnUnit
());
deviceLibraryService
.
update
(
deviceLibrary
);
}
return
ResultUtil
.
success
(
"换新成功"
);
}
}
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/repository/RepairBillDao.java
浏览文件 @
6ae038f7
...
...
@@ -8,4 +8,5 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* @author dengdiyi
*/
public
interface
RepairBillDao
extends
JpaRepository
<
RepairBill
,
Integer
>,
JpaSpecificationExecutor
<
RepairBill
>
{
}
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/service/RepairDetailService.java
浏览文件 @
6ae038f7
...
...
@@ -30,4 +30,10 @@ public interface RepairDetailService extends RepairPublicService<RepairDetail> {
*/
RepairDetail
updateIdAndStatus
(
Integer
id
,
Integer
status
);
/**
* @param id 主键id
* 根据主键Id查询
*/
RepairDetail
getOne
(
Integer
id
);
}
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/service/impl/RepairDetailServiceImpl.java
浏览文件 @
6ae038f7
...
...
@@ -61,4 +61,19 @@ public class RepairDetailServiceImpl implements RepairDetailService {
throw
new
ApiException
(
ResultUtil
.
failed
(
"所查询ID不存在"
));
}
}
/**
* @param id 主键id
* 根据主键Id查询
*/
@Override
public
RepairDetail
getOne
(
Integer
id
)
{
Optional
<
RepairDetail
>
repairDetail
=
deviceRepairDetailDao
.
findById
(
id
);
if
(
repairDetail
.
isPresent
()){
return
repairDetail
.
get
();
}
else
{
throw
new
ApiException
(
ResultUtil
.
failed
(
"所查询ID不存在"
));
}
}
}
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/subject/domin/RepairDetail.java
浏览文件 @
6ae038f7
...
...
@@ -92,6 +92,11 @@ public class RepairDetail {
*/
@ApiModelProperty
(
value
=
"维修备注"
)
private
String
remark
;
/**
* 已报废换新装备详情主键Id(null代表没有报废,0代表已报废还没有换新)
*/
@ApiModelProperty
(
value
=
"已报废换新装备详情主键Id(null代表没有报废,0代表已报废还没有换新)"
)
private
Integer
newDeviceDetailId
;
/**
* 创建用户id
*/
...
...
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/subject/vo/ChangeNewDeviceVo.java
0 → 100644
浏览文件 @
6ae038f7
package
com
.
tykj
.
dev
.
device
.
repair
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author dengdiyi
*/
@Data
@ApiModel
(
"维修装备换新类"
)
public
class
ChangeNewDeviceVo
{
@ApiModelProperty
(
name
=
"业务id"
,
value
=
"1"
)
private
Integer
taskId
;
@ApiModelProperty
(
name
=
"维修详情单主键Id"
,
value
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
name
=
"装备主键id"
,
value
=
"1"
)
private
Integer
deviceId
;
}
dev-device/device-scrap/src/main/java/DeviceScrapController.java
0 → 100644
浏览文件 @
6ae038f7
import
com.tykj.dev.misc.config.AutoDocument
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
/**
* @author zjm
*/
@RestController
@RequestMapping
(
value
=
"/scrap"
)
@AutoDocument
@Api
(
tags
=
"报废模块"
,
description
=
"报废模块"
)
public
class
DeviceScrapController
{
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/summary"
)
public
ResponseEntity
<
com
.
tykj
.
dev
.
device
.
scrap
.
ScrapPage
>
selectRepairBill
(
@RequestBody
ScrapConditions
scrapConditions
){
List
<
ScrapListVo
>
listVos
=
new
ArrayList
<>();
Long
time
=
1598163550704L
;
listVos
.
add
(
new
ScrapListVo
(
1
,
"No2.2019号WX12"
,
"张馋"
,
"李思念"
,
"伸莎"
,
"MB-001,MC-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
2
,
"No2.2019号WX13"
,
"李生成"
,
"许仁"
,
"詹彻"
,
"MA-001,MP-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
3
,
"No2.2019号WX14"
,
"鲍若人"
,
"李奕"
,
"陈行"
,
"MC-001,M1-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
4
,
"No2.2019号WX15"
,
"李力"
,
"石彻"
,
"陈镇"
,
"MK-001,MC-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
if
(
scrapConditions
.
getDimName
()!=
null
)
{
for
(
int
i
=
0
;
i
<
listVos
.
size
();
i
++)
{
if
(((
ScrapListVo
)
(
listVos
.
get
(
i
))).
getName
().
indexOf
(
scrapConditions
.
getDimName
())
<=
-
1
)
listVos
.
remove
(
i
);
}
}
if
(
scrapConditions
.
getEndTime
()!=
null
&&
scrapConditions
.
getStatusTime
()!=
null
)
{
listVos
.
forEach
(
scrapListVo
->
{
if
(
scrapConditions
.
getStatusTime
().
getTime
()
<
time
&&
scrapConditions
.
getEndTime
().
getTime
()
>
time
)
{
}
else
{
listVos
.
remove
(
scrapListVo
);
}
}
);
}
return
ResponseEntity
.
ok
(
com
.
tykj
.
dev
.
device
.
scrap
.
ScrapPage
.
builder
().
data
(
listVos
)
.
page
(
scrapConditions
.
getPage
()).
size
(
scrapConditions
.
getSize
()).
total
(
listVos
.
size
()).
build
());
}
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/summary/{scrapId}"
)
public
ResponseEntity
<
ScrapListVo
>
selectRepairBill1
(
@PathVariable
Integer
scrapId
){
Map
<
Integer
,
ScrapListVo
>
map
=
new
HashMap
<>();
map
.
put
(
1
,
new
ScrapListVo
(
1
,
"No2.2019号WX12"
,
"张馋"
,
"李思念"
,
"伸莎"
,
"MB-001,MC-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
2
,
new
ScrapListVo
(
2
,
"No2.2019号WX13"
,
"李生成"
,
"许仁"
,
"詹彻"
,
"MA-001,MP-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
3
,
new
ScrapListVo
(
3
,
"No2.2019号WX14"
,
"鲍若人"
,
"李奕"
,
"陈行"
,
"MC-001,M1-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
4
,
new
ScrapListVo
(
4
,
"No2.2019号WX15"
,
"李力"
,
"石彻"
,
"陈镇"
,
"MK-001,MC-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
List
<
DeviceVo
>
listVos
=
new
ArrayList
<>();
Random
rand
=
new
Random
();
// nextInt is normally exclusive of the top value,
// so add 1 to make it inclusive
int
randomNum
=
rand
.
nextInt
((
1000
-
1
)
+
1
)
+
1
;
for
(
int
i
=
0
;
i
<
3
;
i
++){
DeviceVo
deviceVo
=
DeviceVo
.
toDo
();
deviceVo
.
setModel
(
"M"
+
randomNum
);
listVos
.
add
(
deviceVo
);
}
ScrapListVo
scrapListVo
=
map
.
get
(
scrapId
);
scrapListVo
.
setList
(
listVos
);
return
ResponseEntity
.
ok
(
scrapListVo
);
}
}
dev-device/device-scrap/src/main/java/DeviceVo.java
0 → 100644
浏览文件 @
6ae038f7
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceVo.java
* @Description TODO
* @createTime 2020年08月19日 16:39:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"报废装备对象"
,
description
=
"报废装备对象"
)
public
class
DeviceVo
{
@ApiModelProperty
(
value
=
"型号"
,
example
=
"bmxx"
)
public
String
model
;
@ApiModelProperty
(
value
=
"类别"
,
example
=
"1"
)
public
Integer
type
;
@ApiModelProperty
(
value
=
"部件"
,
example
=
"1"
)
public
Integer
parts
;
@ApiModelProperty
(
value
=
"密级"
,
example
=
"1"
)
public
String
secretLevel
;
@ApiModelProperty
(
value
=
"可见范围(应用领域)"
,
example
=
"1"
)
public
Integer
invisibleRange
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"msg"
)
public
String
msg
;
/**
* 装备序列号
*/
@ApiModelProperty
(
value
=
"装备序列号"
)
private
String
seqNumber
;
/**
* 生产序列号
*/
@ApiModelProperty
(
value
=
"生产序列号"
)
private
String
prodNumber
;
public
static
DeviceVo
toDo
(){
return
new
DeviceVo
(
"MB-01"
,
1
,
1
,
"机密"
,
1
,
"---"
,
"MB0125576p101"
,
"MB012374123"
);
}
}
dev-device/device-scrap/src/main/java/ScrapConditions.java
0 → 100644
浏览文件 @
6ae038f7
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* @author zjm
* @version 1.0.0
* @ClassName Conditions.java
* @Description TODO
* @createTime 2020年08月23日 13:56:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"报废装备查询条件"
,
description
=
"报废装备查询条件"
)
public
class
ScrapConditions
{
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"bmxx"
,
name
=
"statusTime"
)
private
Date
statusTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"bmxx"
,
name
=
"endTime"
)
private
Date
endTime
;
@ApiModelProperty
(
value
=
"模糊搜索"
,
example
=
"bmxx"
,
name
=
"dimName"
)
private
String
dimName
;
@ApiModelProperty
(
value
=
"页数"
,
example
=
"bmxx"
,
name
=
"page"
)
private
Integer
page
;
@ApiModelProperty
(
value
=
"条数"
,
example
=
"bmxx"
,
name
=
"size"
)
private
Integer
size
;
}
dev-device/device-scrap/src/main/java/ScrapListVo.java
0 → 100644
浏览文件 @
6ae038f7
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Column
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName entity.java
* @Description TODO
* @createTime 2020年08月19日 16:07:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"专管员对象"
,
description
=
"专管员记录"
)
public
class
ScrapListVo
{
/**
* 主键id
*/
@ApiModelProperty
(
name
=
"主键id"
)
private
Integer
id
;
/**
* 文号
*/
@ApiModelProperty
(
value
=
"文号"
)
private
String
docNumber
;
/**
* 监销人
*/
@ApiModelProperty
(
value
=
"监销人"
)
private
String
supervisor
;
/**
* 主管领导
*/
@ApiModelProperty
(
value
=
"主管领导"
)
private
String
leader
;
/**
* 承办人
*/
@ApiModelProperty
(
value
=
"承办人"
)
private
String
undertaker
;
/**
* 型号
*/
@ApiModelProperty
(
value
=
"型号"
)
private
String
model
;
/**
* 名称
*/
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
/**
* 报废时间
*/
@ApiModelProperty
(
value
=
"报废时间"
)
private
Date
scrap
;
/**
* 报废单位
*/
private
String
unitsName
;
private
String
url
;
private
String
v1
;
private
List
<
DeviceVo
>
list
;
}
dev-device/device-scrap/src/main/java/ScrapPage.java
0 → 100644
浏览文件 @
6ae038f7
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author LJJ cnljj1995@gmail.com
* on 2020-04-26
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"报废单分页"
,
description
=
"报废单分页"
)
@Builder
public
class
ScrapPage
{
@ApiModelProperty
(
value
=
"总数"
,
example
=
"10"
)
private
Integer
total
;
@ApiModelProperty
(
value
=
"页数,0开始"
,
example
=
"0"
)
private
Integer
page
;
@ApiModelProperty
(
value
=
"大小"
,
example
=
"10"
)
private
Integer
size
;
@ApiModelProperty
(
value
=
"数据内容"
,
example
=
"略"
)
private
List
<
ScrapListVo
>
data
;
}
dev-device/device-task/src/main/java/com/tykj/dev/device/task/subject/common/GlobalMap.java
浏览文件 @
6ae038f7
...
...
@@ -10,14 +10,22 @@ import java.util.stream.Collectors;
*/
public
class
GlobalMap
{
private
static
Map
<
Integer
,
StatusEnum
>
statusEnumMap
;
private
static
final
Map
<
Integer
,
StatusEnum
>
statusEnumMap
;
private
static
final
Map
<
Integer
,
RepairStatusEnum
>
repairStatusMap
;
static
{
statusEnumMap
=
Arrays
.
stream
(
StatusEnum
.
values
())
.
collect
(
Collectors
.
toMap
(
statusEnum
->
statusEnum
.
id
,
Function
.
identity
()));
repairStatusMap
=
Arrays
.
stream
(
RepairStatusEnum
.
values
())
.
collect
(
Collectors
.
toMap
(
repairStatusEnum
->
repairStatusEnum
.
id
,
Function
.
identity
()));
}
public
static
Map
<
Integer
,
StatusEnum
>
getStatusEnumMap
()
{
return
statusEnumMap
;
}
public
static
Map
<
Integer
,
RepairStatusEnum
>
getRepairStatusMap
()
{
return
repairStatusMap
;
}
}
dev-device/device-task/src/main/java/com/tykj/dev/device/task/subject/common/RepairStatusEnum.java
0 → 100644
浏览文件 @
6ae038f7
package
com
.
tykj
.
dev
.
device
.
task
.
subject
.
common
;
import
lombok.AllArgsConstructor
;
/**
* @author dengdiyi
* 维修状态枚举
*/
@AllArgsConstructor
public
enum
RepairStatusEnum
{
/**
* 等待维修
*/
WAIT_REPAIR
(
0
,
"等待维修"
),
/**
* 维修中
*/
REPAIRING
(
1
,
"维修中"
),
/**
* 待领取
*/
WAIT_RECEIVE
(
2
,
"待领取"
),
/**
* 换新
*/
CHANGE_NEW
(
3
,
"换新"
),
/**
* 已报废
*/
SCRAPPED
(
4
,
"已报废"
),
/**
* 已领取
*/
RECEIVED
(
5
,
"已领取"
)
;
public
Integer
id
;
public
String
name
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论