Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
8f78d70d
提交
8f78d70d
authored
2月 01, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【zjm】 提交1-31代码的修改
上级
84c5d132
全部展开
显示空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
467 行增加
和
208 行删除
+467
-208
LogType.java
dev-config/src/main/java/com/tykj/dev/config/LogType.java
+16
-3
DeviceLossController.java
...tykj/dev/device/loss/controller/DeviceLossController.java
+15
-0
DeviceLoss.java
...va/com/tykj/dev/device/loss/entity/domain/DeviceLoss.java
+42
-35
DeviceLossVo.java
...java/com/tykj/dev/device/loss/entity/vo/DeviceLossVo.java
+55
-0
LossAuditvo.java
.../java/com/tykj/dev/device/loss/entity/vo/LossAuditvo.java
+1
-1
RetrieveAuditvo.java
...a/com/tykj/dev/device/loss/entity/vo/RetrieveAuditvo.java
+1
-1
LossBillSelectServiceImpl.java
...v/device/loss/service/impl/LossBillSelectServiceImpl.java
+21
-1
LossBillServiceImpl.java
...ykj/dev/device/loss/service/impl/LossBillServiceImpl.java
+47
-13
StatusEnum.java
...misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
+3
-1
StringSplitUtil.java
...rc/main/java/com/tykj/dev/misc/utils/StringSplitUtil.java
+19
-0
RepelDevController.java
...kj/dev/device/sendback/controller/RepelDevController.java
+13
-0
RepelQueryController.java
.../dev/device/sendback/controller/RepelQueryController.java
+10
-0
StorageDeviceRepel.java
...ykj/dev/device/sendback/entity/vo/StorageDeviceRepel.java
+4
-0
RepelBusinessService.java
...ykj/dev/device/sendback/service/RepelBusinessService.java
+10
-0
RepelQueryService.java
...m/tykj/dev/device/sendback/service/RepelQueryService.java
+5
-0
DeviceRepelDetailServiceImpl.java
...e/sendback/service/impl/DeviceRepelDetailServiceImpl.java
+3
-5
RepelBusinessServiceImpl.java
...evice/sendback/service/impl/RepelBusinessServiceImpl.java
+34
-5
RepelQueryServiceImpl.java
...v/device/sendback/service/impl/RepelQueryServiceImpl.java
+9
-0
WorkHandover.java
...n/java/com/tykj/dev/device/train/entity/WorkHandover.java
+26
-18
WorkHandoverAddVo.java
...om/tykj/dev/device/train/entity/vo/WorkHandoverAddVo.java
+3
-16
WorkHandoverService.java
...om/tykj/dev/device/train/service/WorkHandoverService.java
+1
-1
WorkHandoverServiceImpl.java
...ev/device/train/service/impl/WorkHandoverServiceImpl.java
+26
-19
RepairControllerTest.java
...c/test/java/com/tykj/dev/repair/RepairControllerTest.java
+0
-0
DeviceCheckControllerTest.java
...st/java/com/tykj/dev/train/DeviceCheckControllerTest.java
+87
-87
pom.xml
dev-user/pom.xml
+5
-1
UnitsService.java
...om/tykj/dev/device/user/subject/service/UnitsService.java
+6
-1
UnitsServiceImpl.java
...ev/device/user/subject/service/impl/UnitsServiceImpl.java
+5
-0
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/LogType.java
浏览文件 @
8f78d70d
...
...
@@ -187,9 +187,22 @@ public enum LogType {
SEND_BACK_20
(
100010
,
SEND_BACK
.
id
,
SEND_BACK_1211
.
id
,
END
.
id
,
"省对单位审核不通过,任务结束"
),
SEND_BACK_21
(
100011
,
SEND_BACK
.
id
,
SEND_BACK_1211
.
id
,
SEND_BACK_1204
.
id
,
"省对单位审核通过,等待下级单位提交"
),
SEND_BACK_23
(
100013
,
SEND_BACK
.
id
,
SEND_BACK_1212
.
id
,
END
.
id
,
"清退统计任务已办结"
),
SEND_BACK_24
(
100014
,
SEND_BACK
.
id
,
SEND_BACK_1204
.
id
,
SEND_BACK_1212
.
id
,
"市清退统计任务待办结"
),
SEND_BACK_25
(
100015
,
SEND_BACK
.
id
,
SEND_BACK_1200
.
id
,
SEND_BACK_1212
.
id
,
"省清退统计任务待办结"
),
SEND_BACK_24
(
100014
,
SEND_BACK_STATISTICAL
.
id
,
SEND_BACK_1204
.
id
,
SEND_BACK_1212
.
id
,
"市清退统计任务待办结"
),
SEND_BACK_25
(
100015
,
SEND_BACK_STATISTICAL
.
id
,
SEND_BACK_1200
.
id
,
SEND_BACK_1212
.
id
,
"省清退统计任务待办结"
),
SEND_BACK_26
(
100016
,
SEND_BACK
.
id
,
SEND_BACK_1214
.
id
,
END
.
id
,
"清退装备任务,上传了回执单据"
),
SEND_BACK_27
(
100017
,
SEND_BACK
.
id
,
SEND_BACK_1202
.
id
,
SEND_BACK_1213
.
id
,
"省直属单位清退装备选择完成,等待签字单据上传"
),
SEND_BACK_28
(
100018
,
SEND_BACK
.
id
,
SEND_BACK_1213
.
id
,
END
.
id
,
"上传了直属单位清退签字单据"
),
LOSS_1
(
9000
,
LOSS
.
id
,
ORIGIN_STATUS
.
id
,
LOSS1300
.
id
,
"发起装备丢失上报"
),
LOSS_2
(
9001
,
LOSS
.
id
,
LOSS1300
.
id
,
LOSS1300
.
id
,
"确认了装备丢失"
),
LOSS_3
(
9002
,
LOSS
.
id
,
LOSS1300
.
id
,
END
.
id
,
"确认了装备丢失报告,报告任务结束"
),
LOSS_4
(
9003
,
LOSS
.
id
,
ORIGIN_STATUS
.
id
,
END
.
id
,
"省装备丢失报告发起记录"
),
RETRIEVE_1
(
9010
,
RETRIEVE
.
id
,
ORIGIN_STATUS
.
id
,
RETRIEVE1400
.
id
,
"发起装备找回上报"
),
RETRIEVE_2
(
9011
,
RETRIEVE
.
id
,
RETRIEVE1400
.
id
,
RETRIEVE1400
.
id
,
"确认了装备找回上报"
),
RETRIEVE_3
(
9012
,
RETRIEVE
.
id
,
RETRIEVE1400
.
id
,
END
.
id
,
"确认了装备找回上报,找回任务结束"
),
RETRIEVE_4
(
9013
,
LOSS
.
id
,
ORIGIN_STATUS
.
id
,
END
.
id
,
"省装备找回报告发起记录"
),
WORK_H1
(
79
,
WORK_HANDOVER
.
id
,
ORIGIN_STATUS
.
id
,
WORKHANDOVER1011
.
id
,
"工作交接任务生成完成,等待上传交接单"
),
...
...
dev-loss/src/main/java/com/tykj/dev/device/loss/controller/DeviceLossController.java
浏览文件 @
8f78d70d
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.loss.controller;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.loss.entity.vo.LossAuditvo
;
import
com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo
;
import
com.tykj.dev.device.loss.service.LossBillService
;
import
com.tykj.dev.device.loss.entity.domain.DeviceLoss
;
import
io.swagger.annotations.Api
;
...
...
@@ -38,4 +39,18 @@ public class DeviceLossController {
lossBillService
.
superiorAuditLoss
(
lossAuditvo
);
return
ResponseEntity
.
ok
(
"确认成功"
);
}
@PostMapping
(
value
=
"/initiateRetrieve"
)
@ApiOperation
(
value
=
"找回装备上报"
,
notes
=
"找回装备上报接口"
)
public
ResponseEntity
initiateRetrieve
(
@RequestBody
DeviceLoss
deviceLoss
){
lossBillService
.
initiateRetrieve
(
deviceLoss
);
return
ResponseEntity
.
ok
(
"上报成功"
);
}
@PostMapping
(
value
=
"/superiorAuditRetrieve"
)
@ApiOperation
(
value
=
"上报上级单位确认接口"
,
notes
=
"上报上级单位确认接口"
)
public
ResponseEntity
superiorAuditRetrieve
(
@RequestBody
RetrieveAuditvo
retrieveAuditvo
){
lossBillService
.
superiorAuditRetrieve
(
retrieveAuditvo
);
return
ResponseEntity
.
ok
(
"确认成功"
);
}
}
dev-loss/src/main/java/com/tykj/dev/device/loss/entity/domain/DeviceLoss.java
浏览文件 @
8f78d70d
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.loss.entity.domain;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.loss.entity.vo.DeviceLossVo
;
import
com.tykj.dev.device.loss.util.StringUtils
;
import
com.tykj.dev.misc.base.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -98,8 +99,8 @@ public class DeviceLoss extends BaseEntity {
/**
* 找回业务状态
*/
@ApiModelProperty
(
value
=
"找回业务状态"
)
private
Integer
backStatus
;
@ApiModelProperty
(
value
=
"找回业务状态
1.等待审核 2.审核通过 3.审核失败
"
)
private
Integer
backStatus
=
1
;
/**
* 单据集合
...
...
@@ -115,37 +116,43 @@ public class DeviceLoss extends BaseEntity {
@Transient
private
List
<
Integer
>
devIdsList
;
public
String
getDevIds
()
{
return
devIds
;
}
public
void
setDevIds
()
{
this
.
devIds
=
StringUtils
.
ListToString
(
devIdsList
);
}
public
String
getLossFile
()
{
return
lossFile
;
}
public
void
setLossFile
()
{
this
.
lossFile
=
FilesUtil
.
stringFileToList
(
fileRetList
);
}
public
List
<
FileRet
>
getFileRetList
()
{
return
FilesUtil
.
stringFileToList
(
lossFile
);
}
public
void
setFileRetList
(
List
<
FileRet
>
fileRetList
)
{
this
.
fileRetList
=
fileRetList
;
}
public
List
<
Integer
>
getDevIdsList
()
{
return
StringUtils
.
stringToList
(
devIds
);
}
public
void
setDevIdsList
(
List
<
Integer
>
devIdsList
)
{
this
.
devIdsList
=
devIdsList
;
}
/**
* 装备集合
*/
@ApiModelProperty
(
value
=
"装备集合"
)
@Transient
private
List
<
DeviceLossVo
>
deviceLossVoList
;
// public String getDevIds() {
// return devIds;
// }
//
// public void setDevIds() {
// this.devIds = StringUtils.ListToString(devIdsList);
// }
//
// public String getLossFile() {
// return lossFile;
// }
//
// public void setLossFile() {
// this.lossFile = FilesUtil.stringFileToList(fileRetList);
// }
//
// public List<FileRet> getFileRetList() {
// return FilesUtil.stringFileToList(lossFile);
// }
//
// public void setFileRetList(List<FileRet> fileRetList) {
// this.fileRetList = fileRetList;
// }
//
// public List<Integer> getDevIdsList() {
// return StringUtils.stringToList(devIds);
// }
//
// public void setDevIdsList(List<Integer> devIdsList) {
// this.devIdsList = devIdsList;
// }
}
dev-loss/src/main/java/com/tykj/dev/device/loss/entity/vo/DeviceLossVo.java
0 → 100644
浏览文件 @
8f78d70d
package
com
.
tykj
.
dev
.
device
.
loss
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author dengdiyi
*/
@Data
@ApiModel
(
"装备类"
)
public
class
DeviceLossVo
{
private
Integer
id
;
/**
* 型号
*/
@ApiModelProperty
(
value
=
"型号"
)
private
String
model
;
/**
* 类型
*/
@ApiModelProperty
(
value
=
"类型"
)
private
Integer
type
;
/**
* 装备名称
*/
@ApiModelProperty
(
value
=
"装备名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"装备序列号"
)
private
String
seqNumber
;
/**
* rfid表面号
*/
@ApiModelProperty
(
value
=
"rfid表面号"
)
private
String
rfidSurfaceId
;
/**
* 所在单位
*/
@ApiModelProperty
(
value
=
"所在单位"
)
private
String
locationUnit
;
/**
* 所属单位
*/
@ApiModelProperty
(
value
=
"所属单位"
)
private
String
ownUnit
;
}
dev-loss/src/main/java/com/tykj/dev/device/loss/entity/vo/LossAuditvo.java
浏览文件 @
8f78d70d
...
...
@@ -38,7 +38,7 @@ public class LossAuditvo {
* 用户单位名称
*/
@ApiModelProperty
(
value
=
"用户单位名称"
)
private
Integer
unitName
;
private
String
unitName
;
/**
* 备注
*/
...
...
dev-loss/src/main/java/com/tykj/dev/device/loss/entity/vo/RetrieveAuditvo.java
浏览文件 @
8f78d70d
...
...
@@ -38,7 +38,7 @@ public class RetrieveAuditvo {
* 用户单位名称
*/
@ApiModelProperty
(
value
=
"用户单位名称"
)
private
Integer
unitName
;
private
String
unitName
;
/**
* 备注
*/
...
...
dev-loss/src/main/java/com/tykj/dev/device/loss/service/impl/LossBillSelectServiceImpl.java
浏览文件 @
8f78d70d
package
com
.
tykj
.
dev
.
device
.
loss
.
service
.
impl
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.loss.entity.domain.DeviceLoss
;
import
com.tykj.dev.device.loss.entity.vo.DeviceLossVo
;
import
com.tykj.dev.device.loss.service.DeviceLossService
;
import
com.tykj.dev.device.loss.service.LossBillSelectService
;
import
com.tykj.dev.device.loss.util.StringUtils
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.misc.base.BeanHelper
;
import
org.modelmapper.ModelMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.stream.Collectors
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -21,9 +30,20 @@ public class LossBillSelectServiceImpl implements LossBillSelectService {
TaskService
taskService
;
@Autowired
DeviceLossService
deviceLossService
;
@Autowired
DeviceLibraryDao
deviceLibraryDao
;
@Override
public
DeviceLoss
findDeviceLoss
(
Integer
taskId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
return
deviceLossService
.
findByDeviceLoss
(
taskBto
.
getBillId
());
DeviceLoss
deviceLoss
=
deviceLossService
.
findByDeviceLoss
(
taskBto
.
getBillId
());
deviceLoss
.
setDeviceLossVoList
(
deviceLibraryDao
.
findAllById
(
StringUtils
.
stringToList
(
deviceLoss
.
getDevIds
()))
.
stream
().
map
(
this
::
toDeviceLossVo
).
collect
(
Collectors
.
toList
()));
deviceLoss
.
setFileRetList
(
FilesUtil
.
stringFileToList
(
deviceLoss
.
getLossFile
()));
return
deviceLoss
;
}
private
DeviceLossVo
toDeviceLossVo
(
DeviceLibrary
deviceLibrary
){
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
return
mapper
.
map
(
deviceLibrary
,
DeviceLossVo
.
class
);
}
}
dev-loss/src/main/java/com/tykj/dev/device/loss/service/impl/LossBillServiceImpl.java
浏览文件 @
8f78d70d
package
com
.
tykj
.
dev
.
device
.
loss
.
service
.
impl
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
...
...
@@ -8,6 +9,7 @@ import com.tykj.dev.device.loss.entity.vo.LossAuditvo;
import
com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo
;
import
com.tykj.dev.device.loss.service.DeviceLossService
;
import
com.tykj.dev.device.loss.service.LossBillService
;
import
com.tykj.dev.device.loss.util.StringUtils
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.subject.entity.Area
;
...
...
@@ -52,19 +54,22 @@ public class LossBillServiceImpl implements LossBillService {
@Autowired
DeviceLogService
deviceLogService
;
@Override
public
void
initiateLoss
(
DeviceLoss
deviceLoss
)
{
deviceLoss
.
setDevIds
(
StringUtils
.
ListToString
(
deviceLoss
.
getDevIdsList
()));
deviceLoss
.
setLossFile
(
FilesUtil
.
stringFileToList
(
deviceLoss
.
getFileRetList
()));
DeviceLoss
deviceLossThis
=
deviceLossService
.
save
(
deviceLoss
);
Units
units
=
unitsService
.
findById
(
deviceLoss
.
getUnitId
());
Area
area
=
areaService
.
findByid
(
units
.
getAreaId
());
if
(
units
.
getLevel
()
==
1
)
{
end
(
deviceLossThis
.
getCreateUserId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
,
units
.
getUnitId
());
}
else
{
Units
parentUnits
=
unitsService
.
find
By
AreaId
(
area
.
getFatherId
());
Units
parentUnits
=
unitsService
.
find
Unit
AreaId
(
area
.
getFatherId
());
newLossTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
);
}
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
LOSS
.
id
,
deviceLoss
.
getDevIdsList
());
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
deviceLoss
.
getCreateUserId
());
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备报备丢失"
,
deviceLoss
.
getCreateUserId
());
}
...
...
@@ -80,7 +85,7 @@ public class LossBillServiceImpl implements LossBillService {
deviceLoss
.
setProvinceDes
(
lossAuditvo
.
getDes
());
taskService
.
moveToEnd
(
taskBto
);
}
else
{
Units
parentUnits
=
unitsService
.
find
By
AreaId
(
area
.
getFatherId
());
Units
parentUnits
=
unitsService
.
find
Unit
AreaId
(
area
.
getFatherId
());
deviceLoss
.
setCityUnitName
(
units
.
getName
());
deviceLoss
.
setCityDes
(
lossAuditvo
.
getDes
());
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
...
...
@@ -92,35 +97,65 @@ public class LossBillServiceImpl implements LossBillService {
@Override
public
void
initiateRetrieve
(
DeviceLoss
deviceLoss
)
{
deviceLoss
.
setDevIds
(
StringUtils
.
ListToString
(
deviceLoss
.
getDevIdsList
()));
deviceLoss
.
setLossFile
(
FilesUtil
.
stringFileToList
(
deviceLoss
.
getFileRetList
()));
DeviceLoss
deviceLossThis
=
deviceLossService
.
save
(
deviceLoss
);
Units
units
=
unitsService
.
findById
(
deviceLoss
.
getUnitId
());
Area
area
=
areaService
.
findByid
(
units
.
getAreaId
());
if
(
units
.
getLevel
()
==
1
)
{
endRetrieve
(
deviceLossThis
.
getCreateUserId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"
丢失
装备任务"
,
units
.
getUnitId
());
endRetrieve
(
deviceLossThis
.
getCreateUserId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"
找回
装备任务"
,
units
.
getUnitId
());
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
deviceLoss
.
getDevIdsList
());
}
else
{
Units
parentUnits
=
unitsService
.
find
By
AreaId
(
area
.
getFatherId
());
newRetrieveTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"
丢失
装备任务"
);
Units
parentUnits
=
unitsService
.
find
Unit
AreaId
(
area
.
getFatherId
());
newRetrieveTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"
找回
装备任务"
);
}
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
deviceLoss
.
getCreateUserId
());
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备找回上报"
,
deviceLoss
.
getCreateUserId
());
}
@Override
public
void
superiorAuditRetrieve
(
RetrieveAuditvo
retrieveAuditvo
)
{
Units
units
=
unitsService
.
findById
(
retrieveAuditvo
.
getUnitId
());
Area
area
=
areaService
.
findByid
(
units
.
getAreaId
());
TaskBto
taskBto
=
taskService
.
get
(
retrieveAuditvo
.
getTaskId
());
DeviceLoss
deviceLoss
=
deviceLossService
.
findByDeviceLoss
(
taskBto
.
getBillId
());
if
(
units
.
getLevel
()==
1
){
deviceLoss
.
setProvinceUnitName
(
units
.
getName
());
deviceLoss
.
setProvinceDes
(
retrieveAuditvo
.
getDes
());
taskService
.
moveToEnd
(
taskBto
);
if
(
retrieveAuditvo
.
getType
()==
1
){
deviceLoss
.
setBackStatus
(
2
);
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
deviceLoss
.
getDevIdsList
());
}
else
{
deviceLoss
.
setBackStatus
(
3
);
}
}
else
{
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
deviceLoss
.
setCityUnitName
(
units
.
getName
());
deviceLoss
.
setCityDes
(
retrieveAuditvo
.
getDes
());
if
(
retrieveAuditvo
.
getType
()==
1
){
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1400
,
0
);
}
else
{
taskService
.
moveToEnd
(
taskBto
);
deviceLoss
.
setBackStatus
(
3
);
}
}
deviceLossService
.
save
(
deviceLoss
);
}
private
void
newRetrieveTask
(
Integer
unitId
,
Integer
lossId
,
String
title
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
0
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
RETRIEVE
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
0
,
""
,
list
));
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
RETRIEVE
1400
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
0
,
""
,
list
));
}
private
void
endRetrieve
(
Integer
userId
,
Integer
lossId
,
String
title
,
Integer
unitId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
LOSS1300
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
0
,
""
,
list
));
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
END
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
0
,
""
,
list
));
}
...
...
@@ -133,17 +168,16 @@ public class LossBillServiceImpl implements LossBillService {
private
void
end
(
Integer
userId
,
Integer
lossId
,
String
title
,
Integer
unitId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
LOSS1300
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
0
,
""
,
list
));
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
END
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
0
,
""
,
list
));
}
private
void
devLogAdd
(
List
<
Integer
>
ids
,
Integer
userId
){
private
void
devLogAdd
(
List
<
Integer
>
ids
,
String
remark
,
Integer
userId
){
List
<
DeviceLog
>
logDtos
=
new
ArrayList
<>();
deviceLibraryDao
.
findAllById
(
ids
).
forEach
(
deviceLibrary
->
logDtos
.
add
(
new
DeviceLogDto
(
deviceLibrary
.
getId
(),
"报备装备丢失"
,
null
,
userId
).
toDo
())
deviceLibrary
->
logDtos
.
add
(
new
DeviceLogDto
(
deviceLibrary
.
getId
(),
remark
,
null
,
userId
).
toDo
())
);
CompletableFuture
.
runAsync
(()
->
deviceLogService
.
saveAllLog
(
logDtos
));
}
}
dev-misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
浏览文件 @
8f78d70d
...
...
@@ -84,13 +84,15 @@ public enum StatusEnum {
SEND_BACK_1211
(
1211
,
"市发清退任务待省审核"
),
SEND_BACK_1212
(
1212
,
"清退统计任务待办结"
),
SEND_BACK_1213
(
1213
,
"省直属清退任务待上传单据"
),
SEND_BACK_1214
(
1214
,
"清退出库等待上传回执单"
),
LOSS1300
(
1300
,
"丢失装备等待审核"
),
RETRIEVE
(
1400
,
"装备找回等待审核"
),
RETRIEVE
1400
(
1400
,
"装备找回等待审核"
),
// SEND_BACK_1204(1204, "入库待审核"),
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/StringSplitUtil.java
浏览文件 @
8f78d70d
package
com
.
tykj
.
dev
.
misc
.
utils
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author dengdiyi
...
...
@@ -82,4 +84,21 @@ public class StringSplitUtil {
}
return
list
;
}
public
static
String
ListToString
(
List
<
Integer
>
idList
){
StringBuffer
stringBuffer
=
new
StringBuffer
();
idList
.
forEach
(
i
->
stringBuffer
.
append
(
","
).
append
(
i
)
);
return
stringBuffer
.
toString
();
}
public
static
List
<
Integer
>
stringToList
(
String
idStirng
){
if
(
idStirng
!=
null
)
{
List
<
String
>
idStringList
=
Arrays
.
asList
(
idStirng
.
split
(
","
));
return
idStringList
.
stream
().
filter
(
list2
->
!
list2
.
equals
(
""
)).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
}
else
{
return
new
ArrayList
<>();
}
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/controller/RepelDevController.java
浏览文件 @
8f78d70d
...
...
@@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -163,4 +165,15 @@ public class RepelDevController {
return
ResponseEntity
.
ok
(
"省直属单位任务提交成功"
);
}
/**
* 清退装备任务等待上传回执单
*/
@ApiOperation
(
value
=
"清退装备任务等待上传回执单"
,
notes
=
"上传回执单 也可以不上传回执单"
)
@GetMapping
(
value
=
"/receipts"
)
public
ResponseEntity
receipts
(
@RequestBody
StorageDeviceRepel
storageDeviceRepel
){
repelBusinessService
.
receipts
(
storageDeviceRepel
);
return
ResponseEntity
.
ok
(
"上传回执单成功"
);
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/controller/RepelQueryController.java
浏览文件 @
8f78d70d
...
...
@@ -90,6 +90,16 @@ public class RepelQueryController {
return
ResponseEntity
.
ok
(
repelQueryService
.
clearedList
(
repelManagementVo
));
}
/**
* 已退役
*/
@PostMapping
(
value
=
"/retiredList"
)
@ApiOperation
(
value
=
"已退役列表"
,
notes
=
"已退役列表接口"
)
public
ResponseEntity
retiredList
(
@RequestBody
RepelManagementVo
repelManagementVo
){
return
ResponseEntity
.
ok
(
repelQueryService
.
retiredList
(
repelManagementVo
));
}
// /**
// * 省直属任务装备查询接口
// */
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/StorageDeviceRepel.java
浏览文件 @
8f78d70d
...
...
@@ -26,5 +26,9 @@ public class StorageDeviceRepel {
private
List
<
Integer
>
deviceIds
;
private
List
<
FileRet
>
outFiles
;
private
Integer
userId
;
private
Integer
taskId
;
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/RepelBusinessService.java
浏览文件 @
8f78d70d
package
com
.
tykj
.
dev
.
device
.
sendback
.
service
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.sendback.entity.domain.DeviceRepel
;
import
com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail
;
import
com.tykj.dev.device.sendback.entity.vo.OrderOutData
;
...
...
@@ -7,6 +8,8 @@ import com.tykj.dev.device.sendback.entity.vo.RepelAuditResult;
import
com.tykj.dev.device.sendback.entity.vo.ResolveConfirm
;
import
com.tykj.dev.device.sendback.entity.vo.StorageDeviceRepel
;
import
java.util.List
;
public
interface
RepelBusinessService
{
/**
...
...
@@ -104,4 +107,11 @@ public interface RepelBusinessService {
* @param storageDeviceRepel 单据 和装备id对象
*/
void
receiptSingle
(
Integer
taskId
,
StorageDeviceRepel
storageDeviceRepel
);
/**
* 出库等待上传回执单
*/
void
receipts
(
StorageDeviceRepel
storageDeviceRepel
);
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/RepelQueryService.java
浏览文件 @
8f78d70d
...
...
@@ -56,6 +56,11 @@ public interface RepelQueryService {
*/
List
<
ModelNameGroup
>
clearedList
(
RepelManagementVo
repelManagementVo
);
/**
* 退役装备列表
*/
List
<
ModelNameGroup
>
retiredList
(
RepelManagementVo
repelManagementVo
);
/**
*省直属任务装备查询接口 (无用)
*/
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/DeviceRepelDetailServiceImpl.java
浏览文件 @
8f78d70d
...
...
@@ -68,13 +68,11 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
@Override
public
List
<
DeviceLibrary
>
findYearAndUnitToDeviceList
(
Date
time
,
Date
endTime
,
Integer
unitId
)
{
List
<
DeviceLibrary
>
libraries
=
new
ArrayLis
t
<>();
Set
<
DeviceLibrary
>
libraries
=
new
HashSe
t
<>();
deviceRepelDetailDao
.
findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus
(
time
,
endTime
,
unitId
,
2
).
forEach
(
deviceRepelDetail
->
{
libraries
.
addAll
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()));
}
deviceRepelDetail
->
libraries
.
addAll
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()))
);
return
libraries
;
return
new
ArrayList
<>(
libraries
)
;
}
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelBusinessServiceImpl.java
浏览文件 @
8f78d70d
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.sendback.service.impl;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.tykj.dev.config.GlobalMap
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
...
...
@@ -26,6 +27,7 @@ import com.tykj.dev.device.user.subject.service.GroupService;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.DeviceLifeStatus
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -414,9 +416,12 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
orderOutDataRepelDetail
.
setRightSignatureId
(
UUID
.
randomUUID
().
toString
());
orderOutDataRepelDetail
.
setNum
(
"NO:第"
+
LocalDateTime
.
now
().
getYear
()+
"QT"
+
deviceRepelDetail
.
getId
());
deviceRepelDetailService
.
saveDeviceRepelDetail
(
orderOutDataRepelDetail
);
deviceLibraryDao
.
upDateLeftStatusAndOwnUnitName
(
15
,
orderOutData
.
getReceiveUnit
(),
StringUtils
.
stringToList
(
orderOutDataRepelDetail
.
getDeviceIds
()));
deviceLibraryDao
.
upDateLeftStatusAndOwnUnitName
(
DeviceLifeStatus
.
REPEL
.
id
,
orderOutData
.
getReceiveUnit
(),
StringUtils
.
stringToList
(
orderOutDataRepelDetail
.
getDeviceIds
()));
taskBto
.
setOwnUnit
(
orderOutData
.
getReceiveUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1209
,
0
);
waitingReceiptsTask
(
orderOutData
.
getSendUnitId
(),
deviceRepelDetail
.
getId
(),
taskBto
.
getParentTaskId
(),
"清退装备出库等待上传回执单"
);
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
deviceRepelDetail
.
getSendUnit
()+
"装备清退出库"
+
",等待"
+
deviceRepelDetail
.
getReceiveUnit
()+
"接收"
,
userId
);
orderOutDataRepelDetail
.
setDeviceLibraryEntities
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()));
//把一些字段填写到对象中,保存入库
...
...
@@ -437,9 +442,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
//否则为待清退
Integer
inStock
;
if
(
unitsService
.
findById
(
deviceRepelDetail
.
getReceiveUnitId
()).
getLevel
()==
2
){
inStock
=
2
;
inStock
=
DeviceLifeStatus
.
IN_LIBRARY
.
id
;
}
else
{
inStock
=
15
;
inStock
=
DeviceLifeStatus
.
REPEL
.
id
;
}
List
<
DeviceLibrary
>
libraries
=
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
());
libraries
.
forEach
(
...
...
@@ -487,7 +492,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
);
log
.
info
(
"更新数据装备以及所属单位-{}"
,
libraries
.
size
());
long
time
=
System
.
currentTimeMillis
();
deviceLibraryDao
.
upDateLeftStatusAndUnitName
(
15
,
units
.
getName
(),
libraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
()));
deviceLibraryDao
.
upDateLeftStatusAndUnitName
(
DeviceLifeStatus
.
REPEL
.
id
,
units
.
getName
(),
libraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
()));
log
.
info
(
"更新数据装备以及所属单位{}"
,
System
.
currentTimeMillis
()-
time
);
// deviceRepelDetail.setDeviceIds(ids.toString());
...
...
@@ -552,7 +557,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
);
log
.
info
(
"更新数据装备以及所属单位-{}"
,
libraries
.
size
());
long
time
=
System
.
currentTimeMillis
();
deviceLibraryDao
.
upDateLeftStatus
AndUnitName
(
2
,
deviceRepelDetail
.
getReceiveUnit
()
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
RETIRE
.
id
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
log
.
info
(
"更新数据装备以及所属单位{}"
,
System
.
currentTimeMillis
()-
time
);
// deviceLibraryDao.saveAll(libraries);
...
...
@@ -565,6 +570,15 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
}
@Override
public
void
receipts
(
StorageDeviceRepel
storageDeviceRepel
)
{
TaskBto
taskBto
=
taskService
.
get
(
storageDeviceRepel
.
getTaskId
());
taskService
.
moveToEnd
(
taskBto
);
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetail
(
taskBto
.
getBillId
());
deviceRepelDetail
.
setOutboundFile
(
FilesUtil
.
stringFileToList
(
storageDeviceRepel
.
getOutFiles
()));
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
}
/**
* 生成区清退任务
...
...
@@ -643,6 +657,21 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1201
.
id
,
title
,
parentTaskId
,
"."
,
repelDetailId
,
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
0
,
""
,
list
));
}
/**
* 清退出库等待上传回执单
* @param unitId
* @param repelDetailId
* @param parentTaskId
* @return
*/
private
TaskBto
waitingReceiptsTask
(
Integer
unitId
,
Integer
repelDetailId
,
Integer
parentTaskId
,
String
title
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
0
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1214
.
id
,
title
,
parentTaskId
,
"."
,
repelDetailId
,
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
0
,
""
,
list
));
}
/**
* 省直属单位任务 省自己完成 16
* @param unitId 执行单位
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelQueryServiceImpl.java
浏览文件 @
8f78d70d
...
...
@@ -12,6 +12,7 @@ import com.tykj.dev.device.task.service.TaskService;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.misc.base.DeviceLifeStatus
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -145,6 +146,14 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return
toModelNameGroup
(
repelDetailService
.
findYearAndUnitToDeviceList
(
new
Date
(
repelManagementVo
.
getTime
()),
new
Date
(
repelManagementVo
.
getEndTime
()),
repelManagementVo
.
getUnitId
()));
}
@Override
public
List
<
ModelNameGroup
>
retiredList
(
RepelManagementVo
repelManagementVo
)
{
Units
units
=
unitsService
.
findById
(
repelManagementVo
.
getUnitId
());
return
toModelNameGroup
(
deviceLibraryDao
.
findAllByOwnUnitAndLocationUnitAndLifeStatus
(
units
.
getName
(),
units
.
getName
(),
DeviceLifeStatus
.
RETIRE
.
id
).
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getUpdateTime
().
getTime
()>=
repelManagementVo
.
getTime
()&&
deviceLibrary
.
getUpdateTime
().
getTime
()<=
repelManagementVo
.
getEndTime
()).
collect
(
Collectors
.
toList
()));
}
@Override
public
List
<
DeviceLibrary
>
provinceDirectlyUnderDev
(
Integer
taskId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/WorkHandover.java
浏览文件 @
8f78d70d
package
com
.
tykj
.
dev
.
device
.
train
.
entity
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverVo
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.misc.base.BeanHelper
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -11,6 +13,7 @@ import org.springframework.data.annotation.CreatedDate;
import
org.springframework.data.annotation.LastModifiedDate
;
import
javax.persistence.*
;
import
java.util.List
;
/**
* @author zjm
...
...
@@ -33,30 +36,24 @@ public class WorkHandover {
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
private
Integer
workHandoverId
;
/**
* 交接人
*/
private
Integer
handoverUserAId
;
private
String
handoverUserIds
;
/**
* 交接人b
*/
private
Integer
handoverUserBId
;
/**
* 移交人a
*/
private
Integer
turnOverUserAId
;
/**
* 移交人b
*/
private
Integer
turnOverUserBId
;
private
String
turnOverUserIds
;
/**
* 监交人
*/
private
String
inUserName
;
/**
* 代办业务 json
*/
...
...
@@ -70,12 +67,12 @@ public class WorkHandover {
/**
* 文件集合(装备列表签字文件集合)
*/
private
String
file
Lists
;
private
String
file
;
/**
* 状态 1.新建 2.完成
*/
private
Integer
status
;
private
Integer
status
=
1
;
/**
* 创建时间
...
...
@@ -92,10 +89,21 @@ public class WorkHandover {
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
public
WorkHandoverVo
toWorkHandover
()
{
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
WorkHandoverVo
workHandoverVo
=
mapper
.
map
(
this
,
WorkHandoverVo
.
class
);
/**
* 发起用户集合
*/
@Transient
private
List
<
User
>
handoverUserList
;
return
workHandoverVo
;
}
/**
* 接收用户集合
*/
@Transient
private
List
<
User
>
turnOverUserList
;
/**
* 接收用户集合
*/
@Transient
private
List
<
FileRet
>
fileRets
;
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/WorkHandoverAddVo.java
浏览文件 @
8f78d70d
...
...
@@ -7,6 +7,8 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
org.modelmapper.ModelMapper
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -19,25 +21,10 @@ import org.modelmapper.ModelMapper;
@NoArgsConstructor
public
class
WorkHandoverAddVo
{
/**
* 交接人
*/
private
Integer
handoverUserAId
;
/**
* 交接人b
*/
private
Integer
handoverUserBId
;
/**
* 移交人a
*/
private
Integer
turnOverUserAId
;
/**
* 移交人b
*/
private
Integer
turnOverUserBId
;
private
List
<
Integer
>
turnOverUserAId
;
public
WorkHandover
toWorkHandover
()
{
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/WorkHandoverService.java
浏览文件 @
8f78d70d
...
...
@@ -28,6 +28,6 @@ public interface WorkHandoverService {
/**
* 查询工作交接详情
*/
WorkHandover
Vo
findById
(
Integer
workHandoverId
);
WorkHandover
findById
(
Integer
workHandoverId
);
}
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/WorkHandoverServiceImpl.java
浏览文件 @
8f78d70d
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.train.service.impl;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.vo.TaskUserVo
;
...
...
@@ -13,11 +14,14 @@ import com.tykj.dev.device.train.entity.vo.WorkHandoverVo;
import
com.tykj.dev.device.train.service.TrainTaskService
;
import
com.tykj.dev.device.train.service.WorkHandoverService
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
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.UserService
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,6 +31,8 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
/**
* @author zjm
...
...
@@ -50,15 +56,26 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
@Autowired
UserService
userService
;
@Autowired
UnitsService
unitsService
;
@Override
public
WorkHandover
createWorkHandover
(
WorkHandoverAddVo
workHandoverAddVo
,
SecurityUser
securityUser
)
{
log
.
info
(
"[workHandover] 新建工作交接"
);
// WorkHandover
List
<
User
>
users
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
());
List
<
Integer
>
handoverIds
=
users
.
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
WorkHandover
workHandover
=
new
WorkHandover
();
workHandover
.
setStatus
(
1
);
workHandover
.
setTurnOverUserIds
(
StringSplitUtil
.
ListToString
(
workHandoverAddVo
.
getTurnOverUserAId
()));
workHandover
.
setHandoverUserIds
(
StringSplitUtil
.
ListToString
(
handoverIds
));
//创建workHandoverDB 存储数据库
WorkHandover
workHandover
=
workHandoverDao
.
save
(
workHandoverAddVo
.
toWorkHandover
()
);
workHandover
=
workHandoverDao
.
save
(
workHandover
);
List
<
Integer
>
integers
=
new
ArrayList
<>();
integers
.
add
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
WORKHANDOVER1011
.
id
,
"工作交接"
,
null
,
null
,
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
workHandover
.
setTurnOverUserList
(
userService
.
findAllUserIdInUser
(
workHandoverAddVo
.
getTurnOverUserAId
()));
workHandover
.
setHandoverUserList
(
userService
.
findAllUserIdInUser
(
handoverIds
));
return
workHandover
;
}
...
...
@@ -74,10 +91,10 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"未找到id为"
+
workHandoverEndAddVo
.
getWorkHandoverId
()
+
" 工作交接业务"
));
}
workHandover
.
setStatus
(
2
);
workHandover
.
setFile
Lists
(
JacksonUtil
.
toJSon
(
workHandoverEndAddVo
.
getFileLists
()));
workHandover
.
setFile
(
JacksonUtil
.
toJSon
(
workHandoverEndAddVo
.
getFileLists
()));
workHandover
=
workHandoverDao
.
save
(
workHandover
);
//把移交人的所有代办任务和跟踪任务替换名称,换成交接人
taskService
.
workHandover
(
workHandover
.
getHandoverUserAId
(),
workHandover
.
getTurnOverUserAId
());
//
taskService.workHandover(workHandover.getHandoverUserAId(), workHandover.getTurnOverUserAId());
//推入完结状态
TaskBto
taskBto
=
trainTaskService
.
selectFatherIsNullAndBillidAndBillType
(
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
);
taskService
.
moveToEnd
(
taskBto
);
...
...
@@ -87,24 +104,14 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
}
@Override
public
WorkHandover
Vo
findById
(
Integer
workHandoverId
)
{
public
WorkHandover
findById
(
Integer
workHandoverId
)
{
Optional
<
WorkHandover
>
optionalWorkHandover
=
workHandoverDao
.
findById
(
workHandoverId
);
if
(
optionalWorkHandover
.
isPresent
())
{
WorkHandover
workHandover
=
optionalWorkHandover
.
get
();
WorkHandoverVo
workHandoverVo
=
workHandover
.
toWorkHandover
();
if
(
workHandover
.
getFileLists
()!=
null
)
{
workHandoverVo
.
setFileLists
(
JacksonUtil
.
readValue
(
workHandover
.
getFileLists
(),
new
TypeReference
<
List
<
FileRet
>>()
{
}));
}
if
(
workHandover
.
getCommissionWord
()!=
null
)
{
workHandoverVo
.
setCommissionWord
(
JacksonUtil
.
readValue
(
workHandover
.
getCommissionWord
(),
new
TypeReference
<
List
<
TaskUserVo
>>()
{
}));
}
if
(
workHandover
.
getTrackingWord
()!=
null
)
{
workHandoverVo
.
setTrackingWord
(
JacksonUtil
.
readValue
(
workHandover
.
getTrackingWord
(),
new
TypeReference
<
List
<
TaskUserVo
>>()
{
}));
}
return
workHandoverVo
;
workHandover
.
setHandoverUserList
(
userService
.
findAllUserIdInUser
(
StringSplitUtil
.
stringToList
(
workHandover
.
getHandoverUserIds
())));
workHandover
.
setTurnOverUserList
(
userService
.
findAllUserIdInUser
(
StringSplitUtil
.
stringToList
(
workHandover
.
getTurnOverUserIds
())));
workHandover
.
setFileRets
(
FilesUtil
.
stringFileToList
(
workHandover
.
getFile
()));
return
workHandover
;
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"没有这个id:"
+
workHandoverId
));
}
...
...
dev-union/src/test/java/com/tykj/dev/repair/RepairControllerTest.java
浏览文件 @
8f78d70d
差异被折叠。
点击展开。
dev-union/src/test/java/com/tykj/dev/train/DeviceCheckControllerTest.java
浏览文件 @
8f78d70d
package
com
.
tykj
.
dev
.
train
;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.dev.device.task.repository.TaskDao
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverVo
;
import
com.tykj.dev.device.train.service.WorkHandoverService
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.union.BaseTest
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.RequestBuilder
;
import
static
com
.
tykj
.
dev
.
misc
.
utils
.
JacksonUtil
.
toJSon
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
post
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
/**
* DeviceCheckControllerTest.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/15 at 11:17 上午
*/
@SuppressWarnings
(
"ALL"
)
@WithMockUser
(
username
=
"shena"
,
password
=
"qwer1234"
,
authorities
=
"省A专管员"
)
@ActiveProfiles
(
"dev"
)
@Slf4j
class
WorkHandoverTest
extends
BaseTest
{
@Autowired
protected
MockMvc
mockMvc
;
@Autowired
WorkHandoverService
workHandoverService
;
@Autowired
UserService
userService
;
@Autowired
private
TaskDao
taskRepo
;
private
String
url
=
"/user/handover/"
;
@Test
void
startManualCheck
()
throws
Exception
{
WorkHandoverAddVo
workHandoverAddVo
=
new
WorkHandoverAddVo
();
//交接人
workHandoverAddVo
.
setHandoverUserId
(
9
);
//移交人
workHandoverAddVo
.
setTurnOverUserId
(
10
);
//监交人
workHandoverAddVo
.
setInUserName
(
"省a专管员"
);
// 测试
RequestBuilder
request
;
request
=
post
(
url
+
"create"
)
.
header
(
"Origin"
,
"*"
)
.
contentType
(
MediaType
.
APPLICATION_JSON
)
.
content
(
toJSon
(
workHandoverAddVo
));
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
isOk
())
.
andDo
(
mvcResult1
->
System
.
out
.
println
(
"[测试结果] 工作交接任务测试通过"
));
// A 接口
Task
initTask
=
taskRepo
.
findAll
(
Specifications
.<
Task
>
and
()
.
eq
(
"billStatus"
,
StatusEnum
.
WORKHANDOVER1011
.
id
)
.
build
())
.
get
(
0
);
Integer
workBillId
=
initTask
.
getBillId
();
WorkHandoverVo
workHandover
=
workHandoverService
.
findById
(
workBillId
);
if
(
workHandover
!=
null
)
{
log
.
info
(
"[workHandover] 新建工作交接业务完成"
);
}
else
{
log
.
info
(
"[workHandover] 新建工作交接业务不通过"
);
}
}
}
\ No newline at end of file
//package com.tykj.dev.train;
//
//import com.github.wenhao.jpa.Specifications;
//import com.tykj.dev.device.task.repository.TaskDao;
//import com.tykj.dev.device.task.subject.domin.Task;
//import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo;
//import com.tykj.dev.device.train.entity.vo.WorkHandoverVo;
//import com.tykj.dev.device.train.service.WorkHandoverService;
//import com.tykj.dev.device.user.subject.service.UserService;
//import com.tykj.dev.misc.base.StatusEnum;
//import com.tykj.dev.union.BaseTest;
//import lombok.extern.slf4j.Slf4j;
//import org.junit.jupiter.api.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.security.test.context.support.WithMockUser;
//import org.springframework.test.context.ActiveProfiles;
//import org.springframework.test.web.servlet.MockMvc;
//import org.springframework.test.web.servlet.RequestBuilder;
//
//import static com.tykj.dev.misc.utils.JacksonUtil.toJSon;
//import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
//import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
//
///**
// * DeviceCheckControllerTest.
// *
// * @author Matrix <xhyrzldf@gmail.com>
// * @since 2020/9/15 at 11:17 上午
// */
//@SuppressWarnings("ALL")
//@WithMockUser(username = "shena", password = "qwer1234", authorities = "省A专管员")
//@ActiveProfiles("dev")
//@Slf4j
//class WorkHandoverTest extends BaseTest {
//
// @Autowired
// protected MockMvc mockMvc;
// @Autowired
// WorkHandoverService workHandoverService;
// @Autowired
// UserService userService;
// @Autowired
// private TaskDao taskRepo;
//
// private String url = "/user/handover/";
//
// @Test
// void startManualCheck() throws Exception {
//
// WorkHandoverAddVo workHandoverAddVo = new WorkHandoverAddVo();
// //交接人
//// workHandoverAddVo.setHandoverUserId(9);
//// //移交人
//// workHandoverAddVo.setTurnOverUserId(10);
//// //监交人
//// workHandoverAddVo.setInUserName("省a专管员");
//
// // 测试
// RequestBuilder request;
//
// request = post(url + "create")
// .header("Origin", "*")
// .contentType(MediaType.APPLICATION_JSON)
// .content(toJSon(workHandoverAddVo));
//
// mockMvc.perform(request)
// .andExpect(status().isOk())
// .andDo(mvcResult1 -> System.out.println("[测试结果] 工作交接任务测试通过"));
//
//
// // A 接口
// Task initTask = taskRepo.findAll(Specifications.<Task>and()
// .eq("billStatus", StatusEnum.WORKHANDOVER1011.id)
// .build())
// .get(0);
// Integer workBillId = initTask.getBillId();
// WorkHandoverVo workHandover = workHandoverService.findById(workBillId);
// if (workHandover != null) {
// log.info("[workHandover] 新建工作交接业务完成");
// } else {
// log.info("[workHandover] 新建工作交接业务不通过");
// }
//
// }
//}
\ No newline at end of file
dev-user/pom.xml
浏览文件 @
8f78d70d
...
...
@@ -34,7 +34,10 @@
<groupId>
com.tykj.dev
</groupId>
<artifactId>
socket
</artifactId>
</dependency>
<dependency>
<groupId>
com.tykj.dev
</groupId>
<artifactId>
blockcha
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/UnitsService.java
浏览文件 @
8f78d70d
...
...
@@ -19,6 +19,11 @@ public interface UnitsService extends PublicService<Units> {
Units
findbyName
(
String
name
);
/**
* 根据区域id查询区域下的单位
*/
Units
findUnitAreaId
(
Integer
areaId
);
/**
* 下级全部单位
* @param leven 等级
...
...
@@ -75,7 +80,7 @@ public interface UnitsService extends PublicService<Units> {
List
<
Integer
>
findSuperiorByunitsId
(
Integer
unitsId
);
/**
* 根据
区域id
查询上级对象
* 根据
单位
查询上级对象
*
* @param unitsId 区域id
* @return 单位对象
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UnitsServiceImpl.java
浏览文件 @
8f78d70d
...
...
@@ -48,6 +48,11 @@ public class UnitsServiceImpl implements UnitsService {
return
unitsDao
.
findByName
(
name
);
}
@Override
public
Units
findUnitAreaId
(
Integer
areaId
)
{
return
unitsDao
.
findByAreaId
(
areaId
).
get
(
0
);
}
@Override
public
List
<
Units
>
findListById
(
Integer
leven
)
{
return
unitsDao
.
findAllByLevel
(
leven
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论