Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
7a6516a1
提交
7a6516a1
authored
4月 09, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[报废、退役、清退、销毁] 代码提交
上级
4679ecc9
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
50 个修改的文件
包含
968 行增加
和
871 行删除
+968
-871
DecommissioningDevController.java
...ommissioning/controller/DecommissioningDevController.java
+30
-0
DecommissioningQueryController.java
...missioning/controller/DecommissioningQueryController.java
+8
-1
DeviceDecommissioningDetail.java
...e/decommissioning/entity/DeviceDecommissioningDetail.java
+5
-47
DecommissioningOrderOutData.java
...ecommissioning/entity/vo/DecommissioningOrderOutData.java
+8
-31
DeviceDecommissioningDetailDao.java
...missioning/repository/DeviceDecommissioningDetailDao.java
+1
-0
DeviceDecommissioningBusinessService.java
...sioning/service/DeviceDecommissioningBusinessService.java
+20
-0
DeviceDecommissioningDetailService.java
...issioning/service/DeviceDecommissioningDetailService.java
+2
-0
DeviceDecommissioningQueryService.java
...missioning/service/DeviceDecommissioningQueryService.java
+7
-1
DeviceDecommissioningBusinessServiceImpl.java
...ervice/impl/DeviceDecommissioningBusinessServiceImpl.java
+0
-0
DeviceDecommissioningDetailServiceImpl.java
.../service/impl/DeviceDecommissioningDetailServiceImpl.java
+6
-0
DeviceDecommissioningQueryServiceImpl.java
...g/service/impl/DeviceDecommissioningQueryServiceImpl.java
+21
-4
DeviceDestroyController.java
...ev/device/destroy/controller/DeviceDestroyController.java
+0
-0
DeviceDestroyQueryController.java
...vice/destroy/controller/DeviceDestroyQueryController.java
+46
-0
DeviceDestroyBill.java
...j/dev/device/destroy/entity/domain/DeviceDestroyBill.java
+55
-165
CanDestroyDeviceSelectVo.java
...ev/device/destroy/entity/vo/CanDestroyDeviceSelectVo.java
+0
-27
DeviceDestroyBillSelectVo.java
...v/device/destroy/entity/vo/DeviceDestroyBillSelectVo.java
+0
-37
DeviceDestroyBillVo.java
...ykj/dev/device/destroy/entity/vo/DeviceDestroyBillVo.java
+93
-0
DeviceDestroyConfirmVo.java
.../dev/device/destroy/entity/vo/DeviceDestroyConfirmVo.java
+0
-26
DeviceDestroyDetailResultVo.java
...device/destroy/entity/vo/DeviceDestroyDetailResultVo.java
+0
-95
DeviceDestroyFormVo.java
...ykj/dev/device/destroy/entity/vo/DeviceDestroyFormVo.java
+0
-56
DeviceDestroyListVo.java
...ykj/dev/device/destroy/entity/vo/DeviceDestroyListVo.java
+0
-83
DeviceDestroyReadConfirm.java
...ev/device/destroy/entity/vo/DeviceDestroyReadConfirm.java
+0
-27
UploadDestroyFileVo.java
...ykj/dev/device/destroy/entity/vo/UploadDestroyFileVo.java
+0
-38
DeviceDestroyBillDao.java
...j/dev/device/destroy/repository/DeviceDestroyBillDao.java
+3
-0
DeviceDestroyBillService.java
.../dev/device/destroy/service/DeviceDestroyBillService.java
+20
-14
DeviceDestroyBusinessService.java
.../device/destroy/service/DeviceDestroyBusinessService.java
+30
-0
DeviceDestroyQueryService.java
...dev/device/destroy/service/DeviceDestroyQueryService.java
+25
-0
DeviceDestroyBillServiceImpl.java
...ce/destroy/service/Impl/DeviceDestroyBillServiceImpl.java
+0
-0
DeviceDestroyBusinessServiceImpl.java
...estroy/service/Impl/DeviceDestroyBusinessServiceImpl.java
+119
-0
DeviceDestroyQueryServiceImpl.java
...e/destroy/service/Impl/DeviceDestroyQueryServiceImpl.java
+52
-0
StatusEnum.java
...misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
+17
-4
DeviceScrapController.java
...kj/dev/device/scrap/controller/DeviceScrapController.java
+0
-159
ScrapBusinessController.java
.../dev/device/scrap/controller/ScrapBusinessController.java
+32
-1
ScrapQueryController.java
...ykj/dev/device/scrap/controller/ScrapQueryController.java
+9
-1
ScrapDao.java
...n/java/com/tykj/dev/device/scrap/repository/ScrapDao.java
+4
-0
ScrapBusinessService.java
...m/tykj/dev/device/scrap/service/ScrapBusinessService.java
+21
-0
ScrapQueryService.java
.../com/tykj/dev/device/scrap/service/ScrapQueryService.java
+4
-0
ScrapService.java
.../java/com/tykj/dev/device/scrap/service/ScrapService.java
+7
-0
ScrapBusinessServiceImpl.java
...v/device/scrap/service/impl/ScrapBusinessServiceImpl.java
+118
-18
ScrapQueryServiceImpl.java
.../dev/device/scrap/service/impl/ScrapQueryServiceImpl.java
+20
-0
ScrapServiceImpl.java
.../tykj/dev/device/scrap/service/impl/ScrapServiceImpl.java
+9
-0
Scrap.java
...n/java/com/tykj/dev/device/scrap/subject/domin/Scrap.java
+5
-0
ScrapOrderOutData.java
...m/tykj/dev/device/scrap/subject/vo/ScrapOrderOutData.java
+8
-0
RepelDevController.java
...kj/dev/device/sendback/controller/RepelDevController.java
+28
-0
OrderOutData.java
.../com/tykj/dev/device/sendback/entity/vo/OrderOutData.java
+1
-1
RepelBusinessService.java
...ykj/dev/device/sendback/service/RepelBusinessService.java
+21
-1
RepelBusinessServiceImpl.java
...evice/sendback/service/impl/RepelBusinessServiceImpl.java
+71
-5
TaskService.java
...in/java/com/tykj/dev/device/task/service/TaskService.java
+7
-0
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+6
-0
DeviceUseReportServiceImpl.java
...ce/usereport/service/impl/DeviceUseReportServiceImpl.java
+29
-29
没有找到文件。
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/controller/DecommissioningDevController.java
浏览文件 @
7a6516a1
...
...
@@ -36,6 +36,36 @@ public class DecommissioningDevController {
return
ResponseEntity
.
ok
(
deviceDecommissioningBusinessService
.
provinceSendDecommissioning
(
userId
,
orderOutData
));
}
/**
* 退役任务保存草稿
*/
@ApiOperation
(
value
=
"退役任务保存草稿"
,
notes
=
"退役任务保存草稿"
)
@PostMapping
(
value
=
"/saveDeviceDecommissioningDraft/{userId}"
)
public
ResponseEntity
saveDeviceDecommissioningDraft
(
@PathVariable
Integer
userId
,
@RequestBody
DecommissioningOrderOutData
orderOutData
){
return
ResponseEntity
.
ok
(
deviceDecommissioningBusinessService
.
saveDeviceDecommissioningDraft
(
userId
,
orderOutData
));
}
/**
* 出库把任务推送至盖章审核
*/
@ApiOperation
(
value
=
"出库把任务推送至盖章审核"
,
notes
=
"出库把任务推送至盖章审核"
)
@PostMapping
(
value
=
"/sealOfAudit/{userId}/{taskId}"
)
public
ResponseEntity
sealOfAudit
(
@PathVariable
Integer
userId
,
@RequestBody
DecommissioningOrderOutData
orderOutData
,
@PathVariable
Integer
taskId
){
deviceDecommissioningBusinessService
.
sealOfAudit
(
userId
,
taskId
,
orderOutData
);
return
ResponseEntity
.
ok
(
"退役任务保存草稿成功"
);
}
/**
* 出库盖章审核调用
*/
@ApiOperation
(
value
=
"退役出库盖章审核调用"
,
notes
=
"退役出库盖章审核调用"
)
@PostMapping
(
value
=
"/outSealOfAuditEnd/{reviewTheResults}/{taskId}"
)
public
ResponseEntity
outSealOfAuditEnd
(
@PathVariable
Integer
reviewTheResults
,
@PathVariable
Integer
taskId
){
deviceDecommissioningBusinessService
.
outSealOfAuditEnd
(
taskId
,
reviewTheResults
);
return
ResponseEntity
.
ok
(
"盖章审核成功"
);
}
/**
* 省上传中办回执单
*/
...
...
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/controller/DecommissioningQueryController.java
浏览文件 @
7a6516a1
...
...
@@ -25,7 +25,6 @@ public class DecommissioningQueryController {
@Autowired
DeviceDecommissioningQueryService
deviceDecommissioningQueryService
;
/**
* 查询退役中办任务
*/
...
...
@@ -85,4 +84,12 @@ public class DecommissioningQueryController {
return
ResponseEntity
.
ok
(
deviceDecommissioningQueryService
.
findTaskIdDeviceDecommissioningDetail
(
taskId
));
}
/**
* 根据ApplyId查询退役任务
*/
@GetMapping
(
value
=
"/findApplyIdToDecommissioningTask/{applyId}"
)
@ApiOperation
(
value
=
"根据taskId查询业务详情"
,
notes
=
"根据taskId查询业务详情"
)
public
ResponseEntity
findApplyIdToDecommissioningTask
(
@PathVariable
Integer
applyId
){
return
ResponseEntity
.
ok
(
deviceDecommissioningQueryService
.
findApplyIdToDecommissioningTask
(
applyId
));
}
}
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/entity/DeviceDecommissioningDetail.java
浏览文件 @
7a6516a1
...
...
@@ -35,6 +35,11 @@ public class DeviceDecommissioningDetail extends BaseEntity {
@ApiModelProperty
(
value
=
"单据编号"
)
private
String
title
;
/**
* 申请id
*/
private
Integer
applyId
;
/**
* 编号
*/
...
...
@@ -147,53 +152,6 @@ public class DeviceDecommissioningDetail extends BaseEntity {
@Column
(
name
=
"in_file"
,
columnDefinition
=
"TEXT"
)
private
String
inFile
;
/**
* 退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功)
*/
@ApiModelProperty
(
value
=
"退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功)"
)
private
Integer
sendBackStatus
;
/**
* 退回装备数量
*/
@ApiModelProperty
(
value
=
"退回装备数量"
)
private
Integer
sendBackCount
;
/**
* 已出库装备数量
*/
@ApiModelProperty
(
value
=
"已出库装备数量"
)
private
Integer
sendedCount
;
/**
* 已接收装备数量
*/
@ApiModelProperty
(
value
=
"已接收装备数量"
)
private
Integer
receiveCount
;
/**
* 出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配
*/
@Column
(
name
=
"send_check_detail"
,
columnDefinition
=
"TEXT"
)
@ApiModelProperty
(
value
=
"出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配"
)
private
String
sendCheckDetail
;
/**
* 出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条
*/
@ApiModelProperty
(
value
=
"出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条"
)
@Column
(
name
=
"send_check_result"
,
columnDefinition
=
"TEXT"
)
private
String
sendCheckResult
;
/**
* 接收方入库检查详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配
*/
@ApiModelProperty
(
value
=
"接收方入库检查详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配"
)
@Column
(
name
=
"receive_check_detail"
,
columnDefinition
=
"TEXT"
)
private
String
receiveCheckDetail
;
/**
* 接收方检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条
*/
@ApiModelProperty
(
value
=
"接收方检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条"
)
@Column
(
name
=
"receive_check_result"
,
columnDefinition
=
"TEXT"
)
private
String
receiveCheckResult
;
@ApiModelProperty
(
value
=
"装备id集合"
)
@Column
(
name
=
"device_ids"
,
columnDefinition
=
"TEXT"
)
private
String
deviceIds
;
...
...
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/entity/vo/DecommissioningOrderOutData.java
浏览文件 @
7a6516a1
...
...
@@ -124,37 +124,6 @@ public class DecommissioningOrderOutData {
@ApiModelProperty
(
value
=
"清退单文件"
)
private
String
billFile
;
/**
* 退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功)
*/
@ApiModelProperty
(
value
=
"退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功)"
)
private
Integer
sendBackStatus
;
/**
* 退回装备数量
*/
@ApiModelProperty
(
value
=
"退回装备数量"
)
private
Integer
sendBackCount
;
/**
* 已出库装备数量
*/
@ApiModelProperty
(
value
=
"已出库装备数量"
)
private
Integer
sendedCount
;
/**
* 已接收装备数量
*/
@ApiModelProperty
(
value
=
"已接收装备数量"
)
private
Integer
receiveCount
;
/**
* 出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配
*/
@ApiModelProperty
(
value
=
"出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配"
)
private
String
sendCheckDetail
;
/**
* 出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条
*/
@ApiModelProperty
(
value
=
"出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条"
)
private
String
sendCheckResult
;
/**
* 装备id集合
*/
...
...
@@ -186,6 +155,14 @@ public class DecommissioningOrderOutData {
@ApiModelProperty
(
value
=
"单据装备数据信息"
)
private
List
<
ScriptSaveVo
>
scriptSaveVos
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"任务Id"
)
private
Integer
taskId
;
/**
* 申请id
*/
@ApiModelProperty
(
value
=
"申请id"
)
private
Integer
applyId
;
public
DeviceDecommissioningDetail
toDeviceDecommissioningDetail
()
{
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
return
mapper
.
map
(
this
,
DeviceDecommissioningDetail
.
class
);
...
...
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/repository/DeviceDecommissioningDetailDao.java
浏览文件 @
7a6516a1
...
...
@@ -5,4 +5,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
public
interface
DeviceDecommissioningDetailDao
extends
JpaRepository
<
DeviceDecommissioningDetail
,
Integer
>,
JpaSpecificationExecutor
<
DeviceDecommissioningDetail
>
{
DeviceDecommissioningDetail
findByApplyId
(
Integer
applyId
);
}
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/service/DeviceDecommissioningBusinessService.java
浏览文件 @
7a6516a1
...
...
@@ -13,6 +13,11 @@ import com.tykj.dev.device.decommissioning.entity.vo.StorageDeviceDevommissiong;
*/
public
interface
DeviceDecommissioningBusinessService
{
/**
* 退役任务保存草稿
*/
DeviceDecommissioningDetail
saveDeviceDecommissioningDraft
(
Integer
userId
,
DecommissioningOrderOutData
decommissioningOrderOutData
);
/**
* 生成省中办退役的任务
* @param userId 用户id
...
...
@@ -26,4 +31,19 @@ public interface DeviceDecommissioningBusinessService {
* @param storageDeviceDevommissiong 单据 和装id对象
*/
void
receiptSingle
(
Integer
taskId
,
StorageDeviceDevommissiong
storageDeviceDevommissiong
);
/**
* 出库把任务推送至盖章审核
*/
void
sealOfAudit
(
Integer
taskId
,
Integer
userId
,
DecommissioningOrderOutData
orderOutData
);
/**
* 出库盖章审核调用
* 通过出库
* 不通过 退回状态
*/
void
outSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
);
void
deleteDrafts
(
Integer
taskId
);
}
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/service/DeviceDecommissioningDetailService.java
浏览文件 @
7a6516a1
...
...
@@ -35,4 +35,6 @@ public interface DeviceDecommissioningDetailService {
List
<
DeviceDecommissioningDetail
>
findAll
();
DeviceDecommissioningDetail
findApplyId
(
Integer
applyId
);
}
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/service/DeviceDecommissioningQueryService.java
浏览文件 @
7a6516a1
...
...
@@ -4,6 +4,7 @@ import com.tykj.dev.device.decommissioning.entity.DeviceDecommissioningDetail;
import
com.tykj.dev.device.decommissioning.entity.vo.PagingVo
;
import
com.tykj.dev.device.decommissioning.entity.vo.RepelManagementVo
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
org.apache.poi.ss.formula.functions.T
;
import
java.util.List
;
...
...
@@ -48,5 +49,10 @@ public interface DeviceDecommissioningQueryService {
/**
* 根据taskId查询退役业务详情
*/
DeviceDecommissioningDetail
findTaskIdDeviceDecommissioningDetail
(
Integer
taskId
);
DeviceDecommissioningDetail
findTaskIdDeviceDecommissioningDetail
(
Integer
task
);
/**
* 根据申请id查询退役任务
*/
TaskBto
findApplyIdToDecommissioningTask
(
Integer
applyId
);
}
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/service/impl/DeviceDecommissioningBusinessServiceImpl.java
浏览文件 @
7a6516a1
差异被折叠。
点击展开。
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/service/impl/DeviceDecommissioningDetailServiceImpl.java
浏览文件 @
7a6516a1
...
...
@@ -31,6 +31,7 @@ import java.util.stream.Collectors;
*/
@Service
@Slf4j
@SuppressWarnings
(
"ALL"
)
public
class
DeviceDecommissioningDetailServiceImpl
implements
DeviceDecommissioningDetailService
{
@Autowired
DeviceDecommissioningDetailDao
deviceDecommissioningDetailDao
;
...
...
@@ -77,6 +78,11 @@ public class DeviceDecommissioningDetailServiceImpl implements DeviceDecommissio
return
deviceDecommissioningDetailDao
.
findAll
();
}
@Override
public
DeviceDecommissioningDetail
findApplyId
(
Integer
applyId
)
{
return
deviceDecommissioningDetailDao
.
findByApplyId
(
applyId
);
}
private
List
<
DeviceLibrary
>
findInvoleDevice
(
String
involeDevice
){
if
(
involeDevice
!=
null
&&
!
involeDevice
.
equals
(
","
)
)
{
List
<
String
>
idStringList
=
Arrays
.
asList
(
involeDevice
.
split
(
","
));
...
...
dev-decommissioning/src/main/java/com/tykj/dev/device/decommissioning/service/impl/DeviceDecommissioningQueryServiceImpl.java
浏览文件 @
7a6516a1
...
...
@@ -11,24 +11,24 @@ import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.user.subject.entity.Units
;
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.exception.ApiException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
*/
@Service
@Slf4j
@SuppressWarnings
(
"ALL"
)
public
class
DeviceDecommissioningQueryServiceImpl
implements
DeviceDecommissioningQueryService
{
@Autowired
...
...
@@ -116,6 +117,22 @@ public class DeviceDecommissioningQueryServiceImpl implements DeviceDecommission
return
deviceDecommissioningDetailService
.
findDeviceDecommissioningDetail
(
taskBto
.
getBillId
());
}
@Override
public
TaskBto
findApplyIdToDecommissioningTask
(
Integer
applyId
)
{
DeviceDecommissioningDetail
deviceDecommissioningDetail
=
deviceDecommissioningDetailService
.
findApplyId
(
applyId
);
if
(
deviceDecommissioningDetail
.
getId
()==
null
){
return
null
;
}
else
{
Optional
<
Task
>
billIdAndBusinessType
=
taskService
.
findBillIdAndBusinessType
(
deviceDecommissioningDetail
.
getId
(),
BusinessEnum
.
DECOMMISSIONING
.
id
);
if
(
billIdAndBusinessType
.
isPresent
()){
return
billIdAndBusinessType
.
get
().
parse2Bto
();
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"[退役] 根据申请id未查询退役任务 :"
+
applyId
));
}
}
}
private
Specification
<
DeviceLibrary
>
getRetiredSpecification
(
RepelManagementVo
repelManagementVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
repelManagementVo
);
predicateBuilder
.
eq
(
"lifeStatus"
,
DeviceLifeStatus
.
RETIRE
.
id
);
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/controller/DeviceDestroyController.java
浏览文件 @
7a6516a1
差异被折叠。
点击展开。
dev-destroy/src/main/java/com/tykj/dev/device/destroy/controller/DeviceDestroyQueryController.java
0 → 100644
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
destroy
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillVo
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyBusinessService
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyQueryService
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.core.annotation.AuthenticationPrincipal
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
/**
* @author huangxiahao
*/
@RestController
@RequestMapping
(
value
=
"/destroyQuery"
)
@AutoDocument
@Api
(
tags
=
"销毁查询模块"
,
value
=
"销毁查询模块"
)
public
class
DeviceDestroyQueryController
{
@Autowired
DeviceDestroyQueryService
deviceDestroyQueryService
;
/**
* 根据任务id查询销毁业务
*/
@ApiOperation
(
value
=
"根据任务id查询销毁业务"
,
notes
=
"根据任务id查询销毁业务"
)
@PostMapping
(
value
=
"/findTaskId/{taskId}"
)
public
ResponseEntity
findTaskId
(
@PathVariable
Integer
taskId
){
return
ResponseEntity
.
ok
(
deviceDestroyQueryService
.
findTaskId
(
taskId
));
}
/**
* 根据ApplyId查询销毁任务
*/
@GetMapping
(
value
=
"/findApplyIdToDeviceDestroyTask/{applyId}"
)
@ApiOperation
(
value
=
"根据ApplyId查询销毁任务"
,
notes
=
"根据ApplyId查询销毁任务"
)
public
ResponseEntity
findApplyIdToDeviceDestroyTask
(
@PathVariable
Integer
applyId
){
return
ResponseEntity
.
ok
(
deviceDestroyQueryService
.
findApplyIdToDeviceDestroyTask
(
applyId
));
}
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/domain/DeviceDestroyBill.java
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
domain
;
import
com.tykj.dev.device.destroy.entity.enums.DestroyStatus
;
import
com.tykj.dev.device.destroy.entity.vo.DeviceDestroyFormVo
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.
device.user.subject.entity.User
;
import
com.tykj.dev.
misc.base.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -11,10 +10,6 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
org.hibernate.annotations.SQLDelete
;
import
org.hibernate.annotations.Where
;
import
org.springframework.data.annotation.CreatedBy
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.*
;
...
...
@@ -26,7 +21,7 @@ import java.util.List;
* entity class for device_destroy_bill
* 装备销毁账单
*
* @author
huangxiahao
* @author
zjm
*/
@Data
@Entity
...
...
@@ -36,182 +31,77 @@ import java.util.List;
@SQLDelete
(
sql
=
"update device_destroy_bill set delete_tag = 1 where id = ?"
)
@Where
(
clause
=
"delete_tag = 0"
)
@ApiModel
(
"装备销毁账单"
)
public
class
DeviceDestroyBill
{
/**
* 主键id
*/
@Id
@GeneratedValue
@ApiModelProperty
(
name
=
"主键id"
)
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
private
Integer
id
;
/**
* 发起销毁业务经办人id(A岗)
*/
@ApiModelProperty
(
value
=
"发起销毁业务经办人id(A岗)"
)
private
Integer
startUserAId
;
/**
* 发起销毁业务审核人id(B岗)
*/
@ApiModelProperty
(
value
=
"发起销毁业务审核人id(B岗)"
)
private
Integer
startUserBId
;
/**
* 销毁状态(0:销毁装备出库待审核,1:销毁装备出库审核失败,2:已销毁)
*/
@ApiModelProperty
(
value
=
"销毁状态(0:销毁装备出库待审核,1:销毁装备出库审核失败,2:已销毁)"
)
private
Integer
destroyStatus
;
/**
* 出库附件文件名
*/
@ApiModelProperty
(
value
=
"出库附件文件名"
)
private
String
fileName
;
/**
* 出库附件文件地址URL
*/
@Column
(
name
=
"file_url"
,
columnDefinition
=
"TEXT"
)
@ApiModelProperty
(
value
=
"出库附件文件地址URL"
)
private
String
fileUrl
;
/**
* 出库附件文件名
*/
@ApiModelProperty
(
value
=
"销毁附件文件名"
)
private
String
destroyFileName
;
/**
* 出库附件文件地址URL
*/
@Column
(
name
=
"destroy_file_url"
,
columnDefinition
=
"TEXT"
)
@ApiModelProperty
(
value
=
"销毁附件文件地址URL"
)
private
String
destroyFileUrl
;
/**
* 装备销毁出库详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增
*/
@Column
(
name
=
"destroy_device_detail"
,
columnDefinition
=
"TEXT"
)
@ApiModelProperty
(
value
=
"装备销毁出库详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增"
)
private
String
destroyDeviceDetail
;
/**
* 创建用户id
*/
@ApiModelProperty
(
value
=
"创建用户id"
)
@CreatedBy
private
Integer
createUserId
;
/**
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@CreatedDate
private
Date
createTime
;
/**
* 更新用户id
*/
@ApiModelProperty
(
value
=
"更新用户id"
)
@LastModifiedBy
private
Integer
updateUserId
;
/**
* 更新时间
*/
@ApiModelProperty
(
value
=
"更新时间"
)
@LastModifiedDate
private
Date
updateTime
;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty
(
value
=
"删除标记(0:未删除,1:已删除)"
)
private
Integer
deleteTag
=
0
;
/**
* 文号
*/
@ApiModelProperty
(
value
=
"文号"
)
private
Integer
docNumber
;
/**
* 监销人
*/
public
class
DeviceDestroyBill
extends
BaseEntity
{
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"申请id"
)
private
Integer
applyId
;
@ApiModelProperty
(
value
=
"单据编号"
)
private
String
num
;
@ApiModelProperty
(
value
=
"单位Id"
)
private
Integer
unitId
;
@ApiModelProperty
(
value
=
"申请文号"
)
private
String
applyNumber
;
@ApiModelProperty
(
value
=
"批复文号"
)
private
String
replayNumber
;
@ApiModelProperty
(
value
=
"监销人"
)
private
String
supervisor
;
/**
* 主管领导
*/
@ApiModelProperty
(
value
=
"主管领导"
)
private
String
leader
;
/**
* 承办人
*/
@ApiModelProperty
(
value
=
"承办人"
)
private
String
undertaker
;
/**
* 销毁日期
*/
@ApiModelProperty
(
value
=
"销毁日期"
)
private
Date
destroyTime
;
@ApiModelProperty
(
value
=
"经办人"
)
@Transient
private
String
userA
;
@ApiModelProperty
(
value
=
"型号"
)
@Transient
private
String
model
;
private
String
agent
;
@ApiModelProperty
(
value
=
"名称"
)
@Transient
private
String
name
;
@ApiModelProperty
(
value
=
"销毁日期"
)
private
Date
destroyTime
;
@ApiModelProperty
(
value
=
"区块链记录id"
)
private
String
recordId
;
@ApiModelProperty
(
value
=
"单据数据"
)
@Column
(
name
=
"script_json"
,
columnDefinition
=
"TEXT"
)
private
String
scriptJson
;
@ApiModelProperty
(
value
=
"申请文件数据"
)
@Column
(
name
=
"apply_files"
,
columnDefinition
=
"TEXT"
)
private
String
applyFiles
;
@ApiModelProperty
(
value
=
"批复文件数据"
)
@Column
(
name
=
"replay_files"
,
columnDefinition
=
"TEXT"
)
private
String
replayFiles
;
@ApiModelProperty
(
value
=
"销毁文件数据"
)
@Column
(
name
=
"destruction_files"
,
columnDefinition
=
"TEXT"
)
private
String
destructionFiles
;
@Transient
@ApiModelProperty
(
value
=
"单据数据集合"
)
private
List
<
ScriptSaveVo
>
scripts
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"单号"
)
@Transient
private
String
num
;
@ApiModelProperty
(
value
=
"申请文件集合"
)
private
List
<
FileRet
>
applyFileList
;
@ApiModelProperty
(
value
=
"批复文件集合"
)
@Transient
private
List
<
FileRet
>
replayFileList
;
@ApiModelProperty
(
value
=
"销毁文件集合"
)
@Transient
private
List
<
FileRet
>
destructionFileList
;
@Transient
private
String
unitName
;
public
DeviceDestroyBill
(
Integer
startUserAId
,
Integer
startUserBId
,
Integer
destroyStatus
,
String
fileName
,
String
fileUrl
,
String
supervisor
,
String
leader
,
String
undertaker
,
String
userA
,
String
destroyDeviceDetail
)
{
this
.
startUserAId
=
startUserAId
;
this
.
startUserBId
=
startUserBId
;
this
.
destroyStatus
=
destroyStatus
;
this
.
fileName
=
fileName
;
this
.
fileUrl
=
fileUrl
;
this
.
supervisor
=
supervisor
;
this
.
leader
=
leader
;
this
.
undertaker
=
undertaker
;
this
.
userA
=
userA
;
this
.
destroyDeviceDetail
=
destroyDeviceDetail
;
}
public
static
DeviceDestroyBill
formVoToBill
(
DeviceDestroyFormVo
formVo
,
User
user
)
{
return
new
DeviceDestroyBill
(
user
.
getUserId
(),
formVo
.
getConfirmUserId
(),
DestroyStatus
.
NEED_CONFIRM
.
getStatus
(),
formVo
.
getFileName
(),
formVo
.
getFileUrl
(),
formVo
.
getSupervisor
(),
formVo
.
getLeader
(),
formVo
.
getUndertaker
(),
user
.
getName
(),
deviceDetailListToString
(
formVo
.
getDevices
())
);
}
/**
* 生成装备销毁出库详情
*
* @return 装备出库详情
*/
public
static
String
deviceDetailListToString
(
List
<
Integer
>
deviceIds
)
{
StringBuffer
deviceDetail
=
new
StringBuffer
();
deviceDetail
.
append
(
"x"
);
deviceIds
.
forEach
(
device
->
{
//拼接对应的字符串 例如: 21x
deviceDetail
.
append
(
device
.
toString
());
deviceDetail
.
append
(
1
);
deviceDetail
.
append
(
"x"
);
});
return
deviceDetail
.
toString
();
}
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/CanDestroyDeviceSelectVo.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author HuangXiahao
* @version V1.0
* @class CanDestoryDeviceSelectVo
* @packageName com.tykj.dev.device.destory.subject.entity.vo
**/
@ApiModel
(
"可销毁装备查询类"
)
@Data
public
class
CanDestroyDeviceSelectVo
{
@ApiModelProperty
(
value
=
"型号"
,
example
=
"bmxx"
)
public
String
model
;
@ApiModelProperty
(
value
=
"类型"
,
example
=
"1"
)
public
Integer
type
;
@ApiModelProperty
(
value
=
"密级"
,
example
=
"1"
)
public
Integer
secretLevel
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"装备1"
)
private
String
name
;
@ApiModelProperty
(
value
=
"模糊查询"
,
example
=
"装备1"
)
private
String
content
;
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyBillSelectVo.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
com.tykj.dev.misc.base.CustomPage
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author dengdiyi
*/
@Data
@ApiModel
(
"销毁单查询"
)
public
class
DeviceDestroyBillSelectVo
extends
CustomPage
{
@ApiModelProperty
(
value
=
"模糊查询关键字"
,
example
=
"测试"
)
public
String
content
;
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"2020-10-10 01:10:10"
)
public
Date
startTime
;
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"2020-10-10 01:10:10"
)
public
Date
endTime
;
/**
* 监销人
*/
@ApiModelProperty
(
value
=
"监销人"
)
private
String
supervisor
;
/**
* 主管领导
*/
@ApiModelProperty
(
value
=
"主管领导"
)
private
String
leader
;
/**
* 承办人
*/
@ApiModelProperty
(
value
=
"承办人"
)
private
String
undertaker
;
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyBillVo.java
0 → 100644
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.misc.base.BaseEntity
;
import
com.tykj.dev.misc.base.BeanHelper
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.annotations.SQLDelete
;
import
org.hibernate.annotations.Where
;
import
org.modelmapper.ModelMapper
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.EntityListeners
;
import
javax.persistence.Transient
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* entity class for device_destroy_bill
* 装备销毁账单
*
* @author zjm
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"装备销毁vo"
)
public
class
DeviceDestroyBillVo
{
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"申请id"
)
private
Integer
applyId
;
@ApiModelProperty
(
value
=
"单据编号"
)
private
String
num
;
@ApiModelProperty
(
value
=
"申请文号"
)
private
String
applyNumber
;
@ApiModelProperty
(
value
=
"批复文号"
)
private
String
replayNumber
;
@ApiModelProperty
(
value
=
"监销人"
)
private
String
supervisor
;
@ApiModelProperty
(
value
=
"主管领导"
)
private
String
leader
;
@ApiModelProperty
(
value
=
"承办人"
)
private
String
undertaker
;
@ApiModelProperty
(
value
=
"经办人"
)
private
String
agent
;
@ApiModelProperty
(
value
=
"销毁日期"
)
private
Date
destroyTime
;
@ApiModelProperty
(
value
=
"单位Id"
)
private
Integer
unitId
;
@ApiModelProperty
(
value
=
"单据数据集合"
)
private
List
<
ScriptSaveVo
>
scripts
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"申请文件集合"
)
private
List
<
FileRet
>
applyFileList
;
@ApiModelProperty
(
value
=
"批复文件集合"
)
private
List
<
FileRet
>
replayFileList
;
@ApiModelProperty
(
value
=
"销毁文件集合"
)
private
List
<
FileRet
>
destructionFileList
;
@ApiModelProperty
(
value
=
"任务id"
)
private
Integer
taskId
;
private
String
unitName
;
public
DeviceDestroyBill
toDeviceDestroyBill
()
{
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
return
mapper
.
map
(
this
,
DeviceDestroyBill
.
class
);
}
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyConfirmVo.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @author HuangXiahao
* @version V1.0
* @class DeviceDestoryConfirmVo
* @packageName com.tykj.dev.device.destory.subject.entity.vo
**/
@Data
@ApiModel
(
"销毁单确认"
)
public
class
DeviceDestroyConfirmVo
{
@NotNull
@ApiModelProperty
(
value
=
"任务ID"
,
example
=
"1"
)
private
Integer
taskId
;
@NotNull
@ApiModelProperty
(
value
=
"审核结果 0为不通过 1为通过 "
,
example
=
"1"
)
private
Integer
result
;
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyDetailResultVo.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Transient
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author HuangXiahao
* @version V1.0
* @class DeviceDestoryDetailSelectVo
* @packageName com.tykj.dev.device.destory.subject.entity.vo
**/
@Data
@ApiModel
(
"销毁详情查询类"
)
public
class
DeviceDestroyDetailResultVo
{
@ApiModelProperty
(
value
=
"发起人ID"
,
example
=
"1"
)
private
Integer
startUserId
;
@ApiModelProperty
(
value
=
"审核人ID"
,
example
=
"1"
)
private
Integer
confirmUserId
;
@ApiModelProperty
(
value
=
"发起人"
,
example
=
"1"
)
private
String
startUser
;
@ApiModelProperty
(
value
=
"审核人"
,
example
=
"1"
)
private
String
confirmUser
;
@ApiModelProperty
(
value
=
"销毁状态(0:销毁装备出库待审核,1:销毁装备出库审核失败,2:已销毁)"
)
private
Integer
destoryStatus
;
@ApiModelProperty
(
value
=
"出库附件文件名"
)
private
String
fileName
;
@ApiModelProperty
(
value
=
"出库附件文件地址URL"
)
private
String
fileUrl
;
@ApiModelProperty
(
value
=
"文号"
)
private
String
docNumber
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"承办人"
)
private
String
undertaker
;
@ApiModelProperty
(
value
=
"主管领导"
)
private
String
leader
;
@ApiModelProperty
(
value
=
"监销人"
)
private
String
supervisor
;
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"型号"
)
private
String
model
;
@ApiModelProperty
(
value
=
"销毁单位"
)
private
String
unit
;
@ApiModelProperty
(
value
=
"销毁装备列表"
,
example
=
"1"
)
private
List
<
DeviceLibrary
>
devices
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"装备数据"
,
example
=
"1"
)
private
List
<
ScriptSaveVo
>
scripts
=
new
ArrayList
<>();
public
DeviceDestroyDetailResultVo
(
Integer
startUserId
,
Integer
confirmUserId
,
String
startUser
,
String
confirmUser
,
Integer
destoryStatus
,
String
fileName
,
String
fileUrl
,
String
docNumber
,
Date
createTime
,
String
undertaker
,
String
leader
,
String
supervisor
,
String
name
,
String
model
,
String
unit
,
List
<
DeviceLibrary
>
devices
,
List
<
ScriptSaveVo
>
scripts
)
{
this
.
startUserId
=
startUserId
;
this
.
confirmUserId
=
confirmUserId
;
this
.
startUser
=
startUser
;
this
.
confirmUser
=
confirmUser
;
this
.
destoryStatus
=
destoryStatus
;
this
.
fileName
=
fileName
;
this
.
fileUrl
=
fileUrl
;
this
.
docNumber
=
docNumber
;
this
.
createTime
=
createTime
;
this
.
undertaker
=
undertaker
;
this
.
leader
=
leader
;
this
.
supervisor
=
supervisor
;
this
.
name
=
name
;
this
.
model
=
model
;
this
.
unit
=
unit
;
this
.
devices
=
devices
;
this
.
scripts
=
scripts
;
}
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyFormVo.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Transient
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author HuangXiahao
* @version V1.0
* @class DestoryFormVo
* @packageName com.tykj.dev.device.destory.subject.entity.vo
**/
@Data
public
class
DeviceDestroyFormVo
{
// @NotNull(message = "confirmUserId不能为空")
@ApiModelProperty
(
value
=
"待审核人ID"
,
example
=
"1"
)
private
Integer
confirmUserId
;
@NotEmpty
(
message
=
"devices不能为空"
)
@ApiModelProperty
(
value
=
"装备列表"
)
private
List
<
Integer
>
devices
;
// @NotNull(message = "fileName不能为空")
@ApiModelProperty
(
value
=
"文件名称"
,
example
=
"文件X"
)
private
String
fileName
;
// @NotNull(message = "fileUrl不能为空")
@ApiModelProperty
(
value
=
"文件URL"
,
example
=
"/images/xxxxx"
)
private
String
fileUrl
;
@ApiModelProperty
(
value
=
"承办人"
)
private
String
undertaker
;
@ApiModelProperty
(
value
=
"主管领导"
)
private
String
leader
;
@ApiModelProperty
(
value
=
"监销人"
)
private
String
supervisor
;
@ApiModelProperty
(
value
=
"销毁时间"
)
private
Date
destroyTime
;
@ApiModelProperty
(
value
=
"销毁单据装备数据"
)
private
List
<
ScriptSaveVo
>
scriptSaveVos
=
new
ArrayList
<>();
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyListVo.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
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 DeviceDestotyListVo.java
* @Description 销毁单列表页
* @createTime 2020年08月19日 14:04:00
*/
@ApiModel
(
"销毁清单列表"
)
@AllArgsConstructor
@NoArgsConstructor
@Data
public
class
DeviceDestroyListVo
{
/**
* 主键id
*/
@ApiModelProperty
(
name
=
"主键id"
)
private
Integer
id
;
/**
* 发起销毁业务经办人id(A岗)
*/
@ApiModelProperty
(
value
=
"发起销毁业务经办人id(A岗)"
)
private
Integer
startUserAId
;
/**
* 发起销毁业务审核人id(B岗)
*/
@ApiModelProperty
(
value
=
"发起销毁业务审核人id(B岗)"
)
private
Integer
startUserBId
;
/**
* 销毁状态(0:销毁装备出库待审核,1:销毁装备出库审核失败,2:已销毁)
*/
@ApiModelProperty
(
value
=
"销毁状态(0:销毁装备出库待审核,1:销毁装备出库审核失败,2:已销毁)"
)
private
Integer
destoryStatus
;
/**
* 装备销毁出库详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增
*/
@ApiModelProperty
(
value
=
"装备销毁出库详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增"
)
private
String
destoryDeviceDetail
;
/**
* 文号
*/
@ApiModelProperty
(
value
=
"文号"
)
private
Integer
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
;
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyReadConfirm.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @author HuangXiahao
* @version V1.0
* @class DeviceDestroyReadComfirm
* @packageName com.tykj.dev.device.destory.subject.entity.vo
**/
@ApiModel
(
"销毁状态阅读确认"
)
@Data
public
class
DeviceDestroyReadConfirm
{
@NotNull
@ApiModelProperty
(
value
=
"工作ID"
,
example
=
"1"
)
private
Integer
jobId
;
@NotNull
@ApiModelProperty
(
value
=
"任务ID"
,
example
=
"1"
)
private
Integer
taskId
;
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/UploadDestroyFileVo.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
destroy
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
/**
* @author dengdiyi
*/
@ApiModel
(
"上传销毁单"
)
@Data
public
class
UploadDestroyFileVo
{
@NotNull
(
message
=
"taskId不能为空"
)
@Min
(
value
=
1
,
message
=
"taskId不能小于1"
)
@ApiModelProperty
(
name
=
"业务id"
)
private
Integer
taskId
;
@NotNull
(
message
=
"destroyFileName不能为空"
)
@ApiModelProperty
(
value
=
"销毁附件文件名"
)
private
String
destroyFileName
;
@NotNull
(
message
=
"destroyFileUrl不能为空"
)
@ApiModelProperty
(
value
=
"销毁附件文件地址URL"
)
private
String
destroyFileUrl
;
@ApiModelProperty
(
value
=
"承办人"
)
private
String
undertaker
;
@ApiModelProperty
(
value
=
"主管领导"
)
private
String
leader
;
@ApiModelProperty
(
value
=
"监销人"
)
private
String
supervisor
;
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/repository/DeviceDestroyBillDao.java
浏览文件 @
7a6516a1
...
...
@@ -4,10 +4,13 @@ import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.util.Optional
;
/**
* @author dengdiyi
*/
public
interface
DeviceDestroyBillDao
extends
JpaRepository
<
DeviceDestroyBill
,
Integer
>,
JpaSpecificationExecutor
<
DeviceDestroyBill
>
{
Optional
<
DeviceDestroyBill
>
findByApplyId
(
Integer
applyId
);
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/DeviceDestroyBillService.java
浏览文件 @
7a6516a1
...
...
@@ -2,32 +2,38 @@ package com.tykj.dev.device.destroy.service;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillSelectVo
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.Optional
;
/**
* @author
dengdiyi
* @author
zjm
*/
public
interface
DeviceDestroyBillService
{
DeviceDestroyBill
addEntity
(
DeviceDestroyBill
deviceDestoryBillEntity
);
/**
* @param deviceDestroyBills 异步上链
* 添加报废详情
* @return 报废详情对象
*/
void
sendHash
(
List
<
DeviceDestroyBill
>
deviceDestroyBills
);
DeviceDestroyBill
saveDeviceDestroyBill
(
DeviceDestroyBill
scrap
);
Page
<
DeviceDestroyBill
>
getPage
(
DeviceDestroyBillSelectVo
deviceDestoryBillSelectVo
,
Pageable
pageable
);
/**
* 根据报废详情id查询清退详情
* @param scrapId 报废详情id
* @return 详情对象
*/
DeviceDestroyBill
findDeviceDestroyBill
(
Integer
scrapId
);
DeviceDestroyBill
getOne
(
Integer
id
);
DeviceDestroyBill
updateEntity
(
DeviceDestroyBill
deviceDestoryBillEntity
);
/**
* 查询所有的报废任务
*/
List
<
DeviceDestroyBill
>
findAll
();
void
delete
(
Integer
id
);
// Page<DeviceDestroyBill> findPageScrapList(ScrapSelectVo scrapSelectVo
);
Integer
getNewDocNumber
()
throws
ParseException
;
/**
* 根据申请id查询报废任务
*/
Optional
<
DeviceDestroyBill
>
findApplyId
(
Integer
applyId
);
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/DeviceDestroyBusinessService.java
0 → 100644
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
destroy
.
service
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillVo
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceDestroyBusinessService.java
* @Description TODO
* @createTime 2021年04月09日 10:50:00
*/
public
interface
DeviceDestroyBusinessService
{
/**
* 销毁任务保存草稿
*/
DeviceDestroyBill
saveDeviceDestroyBill
(
SecurityUser
securityUser
,
DeviceDestroyBillVo
deviceDestroyBillVo
);
/**
* 生成销毁任务等待上传销毁单
*/
DeviceDestroyBill
provinceDeviceDestroyBill
(
SecurityUser
securityUser
,
DeviceDestroyBillVo
deviceDestroyBillVo
);
/**
* 上传销毁单接口 任务完结
*/
void
receiptSingle
(
Integer
taskId
,
DeviceDestroyBillVo
deviceDestroyBillVo
);
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/DeviceDestroyQueryService.java
0 → 100644
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
destroy
.
service
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
org.springframework.data.domain.Page
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceDestroyQueryService.java
* @Description TODO
* @createTime 2021年04月09日 10:52:00
*/
public
interface
DeviceDestroyQueryService
{
// Page<DeviceDestroyBill> findPageScrapList(ScrapSelectVo scrapSelectVo);
/**
* 根据taskId查询报废详情
* @param taskId 任务id
* @return 详情
*/
DeviceDestroyBill
findTaskId
(
Integer
taskId
);
TaskBto
findApplyIdToDeviceDestroyTask
(
Integer
applyId
);
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/Impl/DeviceDestroyBillServiceImpl.java
浏览文件 @
7a6516a1
差异被折叠。
点击展开。
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/Impl/DeviceDestroyBusinessServiceImpl.java
0 → 100644
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
destroy
.
service
.
Impl
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillVo
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyBillService
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyBusinessService
;
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.user.subject.entity.SecurityUser
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceDestroyBusinessServiceImpl.java
* @Description TODO
* @createTime 2021年04月09日 10:57:00
*/
@Service
@Slf4j
public
class
DeviceDestroyBusinessServiceImpl
implements
DeviceDestroyBusinessService
{
@Autowired
TaskService
taskService
;
@Autowired
DeviceDestroyBillService
deviceDestroyBillService
;
@Override
public
DeviceDestroyBill
saveDeviceDestroyBill
(
SecurityUser
securityUser
,
DeviceDestroyBillVo
deviceDestroyBillVo
)
{
DeviceDestroyBill
deviceDestroyBill
=
deviceDestroyBillVo
.
toDeviceDestroyBill
();
deviceDestroyBill
.
setApplyFiles
(
FilesUtil
.
stringFileToList
(
deviceDestroyBill
.
getApplyFileList
()));
deviceDestroyBill
.
setReplayFiles
(
FilesUtil
.
stringFileToList
(
deviceDestroyBill
.
getReplayFileList
()));
deviceDestroyBill
.
setScriptJson
(
JacksonUtil
.
toJSon
(
deviceDestroyBill
.
getScripts
()));
deviceDestroyBillService
.
saveDeviceDestroyBill
(
deviceDestroyBill
);
deviceDestroyBill
.
setNum
(
"NO:第"
+
LocalDateTime
.
now
().
getYear
()
+
"XF"
+
deviceDestroyBill
.
getId
());
deviceDestroyBillService
.
saveDeviceDestroyBill
(
deviceDestroyBill
);
if
(
deviceDestroyBillVo
.
getTaskId
()==
null
){
sendDraftTask
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
deviceDestroyBill
.
getId
(),
securityUser
.
getCurrentUserInfo
().
getUserId
());
}
return
deviceDestroyBill
;
}
@Override
public
DeviceDestroyBill
provinceDeviceDestroyBill
(
SecurityUser
securityUser
,
DeviceDestroyBillVo
deviceDestroyBillVo
)
{
DeviceDestroyBill
deviceDestroyBill
=
deviceDestroyBillVo
.
toDeviceDestroyBill
();
deviceDestroyBill
.
setApplyFiles
(
FilesUtil
.
stringFileToList
(
deviceDestroyBill
.
getApplyFileList
()));
deviceDestroyBill
.
setReplayFiles
(
FilesUtil
.
stringFileToList
(
deviceDestroyBill
.
getReplayFileList
()));
deviceDestroyBill
.
setScriptJson
(
JacksonUtil
.
toJSon
(
deviceDestroyBill
.
getScripts
()));
if
(
deviceDestroyBillVo
.
getTaskId
()==
null
){
deviceDestroyBillService
.
saveDeviceDestroyBill
(
deviceDestroyBill
);
deviceDestroyBill
.
setNum
(
"NO:第"
+
LocalDateTime
.
now
().
getYear
()
+
"XF"
+
deviceDestroyBill
.
getId
());
awaitUploadDestructionTask
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
deviceDestroyBill
.
getId
(),
securityUser
.
getCurrentUserInfo
().
getUserId
());
}
else
{
TaskBto
taskBto
=
taskService
.
get
(
deviceDestroyBillVo
.
getTaskId
());
deviceDestroyBill
.
setId
(
taskBto
.
getBillId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
DESTROY_2
,
0
);
}
deviceDestroyBillService
.
saveDeviceDestroyBill
(
deviceDestroyBill
);
return
deviceDestroyBill
;
}
@Override
public
void
receiptSingle
(
Integer
taskId
,
DeviceDestroyBillVo
deviceDestroyBillVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
DeviceDestroyBill
deviceDestroyBill
=
deviceDestroyBillService
.
findDeviceDestroyBill
(
taskBto
.
getBillId
());
if
(
deviceDestroyBillVo
.
getSupervisor
()!=
null
)
{
deviceDestroyBill
.
setSupervisor
(
deviceDestroyBill
.
getSupervisor
());
}
if
(
deviceDestroyBillVo
.
getLeader
()!=
null
)
{
deviceDestroyBill
.
setLeader
(
deviceDestroyBill
.
getLeader
());
}
if
(
deviceDestroyBillVo
.
getUndertaker
()!=
null
)
{
deviceDestroyBill
.
setUndertaker
(
deviceDestroyBill
.
getUndertaker
());
}
deviceDestroyBill
.
setDestructionFiles
(
FilesUtil
.
stringFileToList
(
deviceDestroyBillVo
.
getDestructionFileList
()));
deviceDestroyBillService
.
saveDeviceDestroyBill
(
deviceDestroyBill
);
taskService
.
moveToEnd
(
taskBto
);
}
/**
* 保存为草稿
*/
private
TaskBto
sendDraftTask
(
Integer
unitId
,
Integer
repelDetailId
,
Integer
userId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
list
.
add
(
0
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
DESTROY_0
.
id
,
"报废设备任务"
,
null
,
"."
,
repelDetailId
,
BusinessEnum
.
DESTROY
.
id
,
unitId
,
1
,
"country"
,
list
));
}
/**
* 等待上传销毁单据
* @param userId 当前用户对象
* @param unitId 单位id
* @param repelDetailId 业务id
*/
private
TaskBto
awaitUploadDestructionTask
(
Integer
unitId
,
Integer
repelDetailId
,
Integer
userId
){
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
DESTROY_2
.
id
,
"报废设备任务"
,
null
,
"."
,
repelDetailId
,
BusinessEnum
.
DESTROY
.
id
,
unitId
,
1
,
"country"
,
userIds
));
}
}
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/Impl/DeviceDestroyQueryServiceImpl.java
0 → 100644
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
destroy
.
service
.
Impl
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyBillService
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyQueryService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.Optional
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceDestroyQueryServiceImpl.java
* @Description TODO
* @createTime 2021年04月09日 13:03:00
*/
@Service
public
class
DeviceDestroyQueryServiceImpl
implements
DeviceDestroyQueryService
{
@Autowired
DeviceDestroyBillService
deviceDestroyBillService
;
@Autowired
TaskService
taskService
;
@Override
public
DeviceDestroyBill
findTaskId
(
Integer
taskId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
return
deviceDestroyBillService
.
findDeviceDestroyBill
(
taskBto
.
getBillId
());
}
@Override
public
TaskBto
findApplyIdToDeviceDestroyTask
(
Integer
applyId
)
{
Optional
<
DeviceDestroyBill
>
deviceDestroyBill
=
deviceDestroyBillService
.
findApplyId
(
applyId
);
if
(!
deviceDestroyBill
.
isPresent
()){
return
null
;
}
else
{
Optional
<
Task
>
billIdAndBusinessType
=
taskService
.
findBillIdAndBusinessType
(
deviceDestroyBill
.
get
().
getId
(),
BusinessEnum
.
SCRAP
.
id
);
if
(
billIdAndBusinessType
.
isPresent
()){
return
billIdAndBusinessType
.
get
().
parse2Bto
();
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"[销毁] 根据申请id未查询退役任务 :"
+
applyId
));
}
}
}
}
dev-misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
浏览文件 @
7a6516a1
...
...
@@ -24,9 +24,9 @@ public enum StatusEnum {
/**
* 销毁业务
*/
CREATE_DESTROY_BUSINESS
(
8110
,
"装备销毁业务开始
"
),
DESTROY_
BUSINESS_NEED_CONFIRM
(
8111
,
"等待审核"
),
WAIT_UPLOAD_BILL_FILE
(
8112
,
"等待上传销毁单"
),
DESTROY_0
(
8110
,
"装备销毁业务草稿
"
),
DESTROY_
1
(
8111
,
"等待审核"
),
DESTROY_2
(
8112
,
"等待上传销毁单"
),
/**
* 退装业务
...
...
@@ -77,10 +77,19 @@ public enum StatusEnum {
SEND_BACK_1214
(
1214
,
"清退出库等待上传回执单"
),
SEND_BACK_1215
(
1215
,
"清退出库接收方单据待补充"
),
SEND_BACK_1216
(
1216
,
"市本级装备待清退"
),
SEND_BACK_1217
(
1217
,
"签章审核"
),
SEND_BACK_1218
(
1218
,
"入库等待盖电子签章"
),
SEND_BACK_1219
(
1219
,
"出库等待盖电子签章"
),
DECOMMISSIONING_1250
(
1250
,
"退役草稿"
),
DECOMMISSIONING_1251
(
1251
,
"退役出库签章审核"
),
DECOMMISSIONING_1252
(
1252
,
"退役出库等待盖电子签章"
),
LOSS1300
(
1300
,
"丢失装备等待市审核"
),
...
...
@@ -237,7 +246,11 @@ public enum StatusEnum {
/**
* 报废状态
*/
WAIT_UPLOAD_SCRAP_FILE
(
2222
,
"待上传报废单"
);
SCRAP_2222
(
2222
,
"待上传报废单"
),
SCRAP_2223
(
2223
,
"报废草稿"
),
SCRAP_2224
(
2224
,
"报废出库签章审核"
),
SCRAP_2225
(
2225
,
"报废出库等待盖电子签章"
)
;
public
Integer
id
;
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/controller/DeviceScrapController.java
deleted
100644 → 0
浏览文件 @
4679ecc9
package
com
.
tykj
.
dev
.
device
.
scrap
.
controller
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.tykj.dev.config.base.DeviceLifeStatus
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.device.scrap.service.ScrapBillService
;
import
com.tykj.dev.device.scrap.subject.domin.ScrapBill
;
import
com.tykj.dev.device.scrap.subject.vo.ScrapSaveVo
;
import
com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo
;
import
com.tykj.dev.device.scrap.subject.vo.UploadVo
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
com.tykj.dev.misc.utils.TaskDisposeUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author zjm
*/
@RestController
@RequestMapping
(
value
=
"/scrap"
)
@AutoDocument
@Api
(
tags
=
"报废模块"
,
description
=
"报废模块"
)
public
class
DeviceScrapController
{
@Autowired
private
DeviceLibraryService
deviceLibraryService
;
@Autowired
private
ScrapBillService
scrapBillService
;
@Autowired
private
UserUtils
userUtils
;
@Autowired
private
TaskService
taskService
;
@Autowired
private
DeviceLogService
deviceLogService
;
@Autowired
private
DeviceLibraryDao
deviceLibraryDao
;
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/summary"
)
public
ResponseEntity
selectRepairBill
(
@RequestBody
ScrapSelectVo
scrapSelectVo
)
{
return
ResponseEntity
.
ok
(
scrapBillService
.
getPage
(
scrapSelectVo
));
}
@ApiOperation
(
value
=
"查询列表详情"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/summary/{scrapId}"
)
public
ResponseEntity
selectRepairBill1
(
@PathVariable
Integer
scrapId
)
{
Map
<
Integer
,
DeviceLibrary
>
deviceLibraryMap
=
deviceLibraryService
.
getAllDeviceMap
();
List
<
Object
>
list
=
new
ArrayList
<>();
ScrapBill
scrapBill
=
scrapBillService
.
getOne
(
scrapId
);
if
(
scrapBill
.
getScriptJson
()!=
null
){
scrapBill
.
setScripts
(
JacksonUtil
.
readValue
(
scrapBill
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{}));
}
list
.
add
(
scrapBill
);
List
<
DeviceLibrary
>
deviceLibraries
=
StringSplitUtil
.
userIdSplit
(
scrapBill
.
getScrapDetail
()).
stream
()
.
map
(
deviceLibraryMap:
:
get
)
.
collect
(
Collectors
.
toList
());
list
.
add
(
deviceLibraries
);
return
ResponseEntity
.
ok
(
list
);
}
@ApiOperation
(
value
=
"发起报废"
,
notes
=
"发起报废单"
)
@PostMapping
(
value
=
"/form"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
commitScrap
(
@RequestBody
@Validated
ScrapSaveVo
scrapSaveVo
)
{
deviceLibraryService
.
isWaitRetired
(
scrapSaveVo
.
getDeviceIds
());
//转实体类
ScrapBill
scrapBill
=
scrapSaveVo
.
toDo
();
//计算所有不同的型号
Set
<
String
>
models
=
scrapSaveVo
.
getDeviceIds
().
stream
().
map
(
integer
->
deviceLibraryService
.
getOne
(
integer
).
getModel
()).
collect
(
Collectors
.
toSet
());
StringBuffer
stringBuffer
=
new
StringBuffer
();
models
.
forEach
(
s
->
stringBuffer
.
append
(
s
).
append
(
","
));
stringBuffer
.
deleteCharAt
(
stringBuffer
.
length
()
-
1
);
scrapBill
.
setModels
(
stringBuffer
.
toString
());
//计算所有不同的名称
Set
<
String
>
names
=
scrapSaveVo
.
getDeviceIds
().
stream
().
map
(
integer
->
deviceLibraryService
.
getOne
(
integer
).
getName
()).
collect
(
Collectors
.
toSet
());
StringBuffer
stringBuffer2
=
new
StringBuffer
();
names
.
forEach
(
s
->
stringBuffer2
.
append
(
s
).
append
(
","
));
stringBuffer2
.
deleteCharAt
(
stringBuffer2
.
length
()
-
1
);
scrapBill
.
setNames
(
stringBuffer2
.
toString
());
scrapBill
.
setScriptJson
(
JacksonUtil
.
toJSon
(
scrapSaveVo
.
getScriptSaveVos
()));
ScrapBill
scrapBill1
=
scrapBillService
.
add
(
scrapBill
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
String
num
=
"NO:第"
+
year
+
"BF"
+
scrapBill1
.
getId
()
+
"号"
;
scrapBill1
.
setDocNumber
(
num
);
ScrapBill
scrapBill2
=
scrapBillService
.
update
(
scrapBill1
);
//发起任务
Integer
userId
=
userUtils
.
getCurrentUserId
();
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_SCRAP_FILE
.
id
,
"报废业务"
,
null
,
"."
,
scrapBill2
.
getId
(),
23
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
taskService
.
start
(
taskBto
);
//添加装备日志
for
(
Integer
id:
scrapSaveVo
.
getDeviceIds
())
{
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
id
);
deviceLibrary
.
setLifeStatus
(
DeviceLifeStatus
.
IN_THE_SCRAPPED
.
id
);
deviceLibraryService
.
update
(
deviceLibrary
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"发起报废"
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
return
selectRepairBill1
(
taskBto
.
getBillId
());
}
@ApiOperation
(
value
=
"上传报废单"
,
notes
=
"上传报废单"
)
@PostMapping
(
value
=
"/upload"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
uploadScrap
(
@RequestBody
@Validated
UploadVo
uploadVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
uploadVo
.
getTaskId
());
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
WAIT_UPLOAD_SCRAP_FILE
);
ScrapBill
scrapBill
=
scrapBillService
.
getOne
(
taskBto
.
getBillId
());
scrapBill
.
setFileName
(
uploadVo
.
getFileName
());
scrapBill
.
setFileUrl
(
uploadVo
.
getFileUrl
());
scrapBill
.
setUndertaker
(
uploadVo
.
getUndertaker
());
scrapBill
.
setLeader
(
uploadVo
.
getLeader
());
scrapBill
.
setSupervisor
(
uploadVo
.
getSupervisor
());
scrapBillService
.
update
(
scrapBill
);
taskService
.
addInvolveUser
(
taskBto
,
userUtils
.
getCurrentUserId
());
taskService
.
moveToEnd
(
taskBto
);
List
<
Integer
>
ids
=
StringSplitUtil
.
userIdSplit
(
scrapBill
.
getScrapDetail
());
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
SCRAP_I
.
id
,
ids
);
List
<
FileVo
>
fileVos
=
new
ArrayList
<>();
fileVos
.
add
(
new
FileVo
(
"报废单"
,
scrapBill
.
getFileName
(),
scrapBill
.
getFileUrl
()));
//添加装备日志
for
(
Integer
id:
StringSplitUtil
.
userIdSplit
(
scrapBill
.
getScrapDetail
()))
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"上传报废单"
,
fileVos
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
return
ResponseEntity
.
ok
(
"上传成功"
);
}
}
dev-scrap/src/main/java/com/tykj/dev/device/scrap/controller/ScrapBusinessController.java
浏览文件 @
7a6516a1
...
...
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
* @createTime 2021年01月10日 13:52:00
*/
@RestController
@Api
(
tags
=
"装备
退役
业务接口模块"
,
description
=
"包括装备退役业务相关接口"
)
@Api
(
tags
=
"装备
报废
业务接口模块"
,
description
=
"包括装备退役业务相关接口"
)
@AutoDocument
@RequestMapping
(
"/scrapBusiness"
)
public
class
ScrapBusinessController
{
...
...
@@ -36,6 +36,37 @@ public class ScrapBusinessController {
return
ResponseEntity
.
ok
(
scrapBusinessService
.
provinceScrap
(
userId
,
scrapOrderOutData
));
}
/**
* 退役任务保存草稿
*/
@ApiOperation
(
value
=
"报废任务保存草稿"
,
notes
=
"报废任务保存草稿"
)
@PostMapping
(
value
=
"/saveDeviceDecommissioningDraft/{userId}"
)
public
ResponseEntity
saveDeviceDecommissioningDraft
(
@PathVariable
Integer
userId
,
@RequestBody
ScrapOrderOutData
scrapOrderOutData
){
return
ResponseEntity
.
ok
(
scrapBusinessService
.
saveDeviceScrapDraft
(
userId
,
scrapOrderOutData
));
}
/**
* 出库把任务推送至盖章审核
*/
@ApiOperation
(
value
=
"出库把任务推送至盖章审核"
,
notes
=
"出库把任务推送至盖章审核"
)
@PostMapping
(
value
=
"/sealOfAudit/{userId}/{taskId}"
)
public
ResponseEntity
sealOfAudit
(
@PathVariable
Integer
userId
,
@RequestBody
ScrapOrderOutData
scrapOrderOutData
,
@PathVariable
Integer
taskId
){
scrapBusinessService
.
sealOfAudit
(
userId
,
taskId
,
scrapOrderOutData
);
return
ResponseEntity
.
ok
(
"退役任务保存草稿成功"
);
}
/**
* 出库盖章审核调用
*/
@ApiOperation
(
value
=
"报废出库盖章审核调用"
,
notes
=
"报废出库盖章审核调用"
)
@PostMapping
(
value
=
"/outSealOfAuditEnd/{reviewTheResults}/{taskId}"
)
public
ResponseEntity
outSealOfAuditEnd
(
@PathVariable
Integer
reviewTheResults
,
@PathVariable
Integer
taskId
){
scrapBusinessService
.
outSealOfAuditEnd
(
taskId
,
reviewTheResults
);
return
ResponseEntity
.
ok
(
"盖章审核成功"
);
}
/**
* 省上传中办回执单
*/
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/controller/ScrapQueryController.java
浏览文件 @
7a6516a1
...
...
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
* @createTime 2021年01月10日 15:43:00
*/
@RestController
@Api
(
tags
=
"装备
退役
查询接口模块"
,
description
=
"包括装备清退、装备异常处理、装备出库、装备入库"
)
@Api
(
tags
=
"装备
报废
查询接口模块"
,
description
=
"包括装备清退、装备异常处理、装备出库、装备入库"
)
@AutoDocument
@RequestMapping
(
"/scrapQuery"
)
public
class
ScrapQueryController
{
...
...
@@ -38,4 +38,12 @@ public class ScrapQueryController {
return
ResponseEntity
.
ok
(
scrapQueryService
.
findPageScrapList
(
scrapSelectVo
));
}
/**
* 根据ApplyId查询报废任务
*/
@GetMapping
(
value
=
"/findApplyIdToScrapTask/{applyId}"
)
@ApiOperation
(
value
=
"根据ApplyId查询报废任务"
,
notes
=
"根据ApplyId查询报废任务"
)
public
ResponseEntity
findApplyIdToScrapTask
(
@PathVariable
Integer
applyId
){
return
ResponseEntity
.
ok
(
scrapQueryService
.
findApplyIdToScrapTask
(
applyId
));
}
}
dev-scrap/src/main/java/com/tykj/dev/device/scrap/repository/ScrapDao.java
浏览文件 @
7a6516a1
...
...
@@ -5,6 +5,8 @@ import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.util.Optional
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -13,4 +15,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* @createTime 2021年03月31日 10:15:00
*/
public
interface
ScrapDao
extends
JpaRepository
<
Scrap
,
Integer
>,
JpaSpecificationExecutor
<
Scrap
>
{
Optional
<
Scrap
>
findByApplyId
(
Integer
applyId
);
}
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/ScrapBusinessService.java
浏览文件 @
7a6516a1
...
...
@@ -12,6 +12,12 @@ import com.tykj.dev.device.scrap.subject.vo.StorageScrap;
* @createTime 2021年03月31日 13:14:00
*/
public
interface
ScrapBusinessService
{
/**
* 退役任务保存草稿
*/
Scrap
saveDeviceScrapDraft
(
Integer
userId
,
ScrapOrderOutData
scrapOrderOutData
);
/**
* 生成省中办报废的任务
* @param userId 用户id
...
...
@@ -25,4 +31,19 @@ public interface ScrapBusinessService {
* @param storageScrap 单据 和装id对象
*/
void
receiptSingle
(
Integer
taskId
,
StorageScrap
storageScrap
);
/**
* 出库把任务推送至盖章审核
*/
void
sealOfAudit
(
Integer
taskId
,
Integer
userId
,
ScrapOrderOutData
scrapOrderOutData
);
/**
* 出库盖章审核调用
* 通过出库
* 不通过 退回状态
*/
void
outSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
);
void
deleteDrafts
(
Integer
taskId
);
}
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/ScrapQueryService.java
浏览文件 @
7a6516a1
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.scrap.service;
import
com.tykj.dev.device.scrap.subject.domin.Scrap
;
import
com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
org.springframework.data.domain.Page
;
/**
...
...
@@ -20,4 +21,7 @@ public interface ScrapQueryService {
* @return 详情
*/
Scrap
findTaskId
(
Integer
taskId
);
TaskBto
findApplyIdToScrapTask
(
Integer
applyId
);
}
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/ScrapService.java
浏览文件 @
7a6516a1
...
...
@@ -5,6 +5,7 @@ import com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
import
java.util.Optional
;
public
interface
ScrapService
{
/**
...
...
@@ -33,4 +34,10 @@ public interface ScrapService {
List
<
Scrap
>
findAll
();
Page
<
Scrap
>
findPageScrapList
(
ScrapSelectVo
scrapSelectVo
);
/**
* 根据申请id查询报废任务
*/
Optional
<
Scrap
>
findApplyId
(
Integer
applyId
);
}
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/impl/ScrapBusinessServiceImpl.java
浏览文件 @
7a6516a1
...
...
@@ -70,41 +70,79 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
MessageService
messageService
;
@Override
public
Scrap
provinceScrap
(
Integer
userId
,
ScrapOrderOutData
scrapOrderOutData
)
{
public
Scrap
saveDeviceScrapDraft
(
Integer
userId
,
ScrapOrderOutData
scrapOrderOutData
)
{
User
user
=
userService
.
findByUser
(
userId
);
Units
units
=
unitsService
.
findById
(
user
.
getUnitsId
());
Scrap
scrap
=
scrapOrderOutData
.
toScrap
();
Units
units
=
unitsService
.
findById
(
user
.
getUnitsId
());
Scrap
scrap
=
scrapOrderOutData
.
toScrap
();
List
<
ScriptSaveVo
>
scriptSaveVos
=
scrapOrderOutData
.
getScriptSaveVos
();
List
<
String
>
seqNumbers
=
new
ArrayList
<>();
scriptSaveVos
.
forEach
(
scriptSaveVo
->
{
if
(
scriptSaveVo
.
getSeqNumber
()
!=
null
)
{
seqNumbers
.
addAll
(
DeviceSeqUtil
.
selectDeviceSeqs
(
scriptSaveVo
.
getSeqNumber
()));
}
}
);
scrap
.
setDeviceIds
(
StringUtils
.
ListToString
(
scrapOrderOutData
.
getDevIds
()));
scrap
.
setOutboundFile
(
FilesUtil
.
stringFileToList
(
scrapOrderOutData
.
getOutboundFileList
()));
scrapService
.
saveScrap
(
scrap
);
scrap
.
setScripts
(
scrapOrderOutData
.
getScriptSaveVos
());
scrap
.
setScriptJson
(
JacksonUtil
.
toJSon
(
scrapOrderOutData
.
getScriptSaveVos
()));
scrap
.
setNum
(
"NO:第"
+
LocalDateTime
.
now
().
getYear
()+
"QT"
+
scrap
.
getId
());
List
<
DeviceLibrary
>
deviceLibraries
=
findInvoleDevice
(
scrap
.
getDeviceIds
());
scrap
.
setNum
(
"NO:第"
+
LocalDateTime
.
now
().
getYear
()
+
"QT"
+
scrap
.
getId
());
scrap
.
setDeviceLibraryEntities
(
findInvoleDevice
(
scrap
.
getDeviceIds
()));
scrapService
.
saveScrap
(
scrap
);
List
<
ScriptSaveVo
>
scriptSaveVos
=
scrapOrderOutData
.
getScriptSaveVos
();
List
<
String
>
seqNumbers
=
new
ArrayList
<>();
if
(
scrapOrderOutData
.
getTaskId
()==
null
)
{
sendDraftTask
(
units
.
getUnitId
(),
scrap
.
getId
(),
userId
);
}
return
scrap
;
}
@Override
public
Scrap
provinceScrap
(
Integer
userId
,
ScrapOrderOutData
scrapOrderOutData
)
{
User
user
=
userService
.
findByUser
(
userId
);
Units
units
=
unitsService
.
findById
(
user
.
getUnitsId
());
Scrap
scrap
=
scrapOrderOutData
.
toScrap
();
List
<
ScriptSaveVo
>
scriptSaveVos
=
scrapOrderOutData
.
getScriptSaveVos
();
List
<
String
>
seqNumbers
=
new
ArrayList
<>();
scriptSaveVos
.
forEach
(
scriptSaveVo
->
{
if
(
scriptSaveVo
.
getSeqNumber
()
!=
null
)
{
if
(
scriptSaveVo
.
getSeqNumber
()
!=
null
)
{
seqNumbers
.
addAll
(
DeviceSeqUtil
.
selectDeviceSeqs
(
scriptSaveVo
.
getSeqNumber
()));
}
}
);
deviceLibraryDao
.
upDateSeqNumbersLeftStatus
(
DeviceLifeStatus
.
RETIRED
.
id
,
seqNumbers
);
devLogAdd
(
deviceLibraries
,
"发起了报废任务"
,
userId
);
TaskBto
taskBto
=
sendOutSuperior
(
units
.
getUnitId
(),
scrap
.
getId
(),
userId
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起退役任务,待上传回执单据"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
//判断是否为草稿 还是直接发起
if
(
scrapOrderOutData
.
getTaskId
()!=
null
){
TaskBto
taskBto
=
taskService
.
get
(
scrapOrderOutData
.
getTaskId
());
List
<
StatusEnum
>
statusEnums
=
new
ArrayList
<>();
statusEnums
.
add
(
StatusEnum
.
DECOMMISSIONING_1250
);
statusEnums
.
add
(
StatusEnum
.
DECOMMISSIONING_1252
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
statusEnums
);
Scrap
scrap1
=
scrapService
.
findScrap
(
taskBto
.
getBillId
());
scrap
.
setId
(
scrap1
.
getId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SCRAP_2222
);
}
else
{
scrapService
.
saveScrap
(
scrap
);
scrap
.
setNum
(
"NO:第"
+
LocalDateTime
.
now
().
getYear
()
+
"QT"
+
scrap
.
getId
());
TaskBto
taskBto
=
sendOutSuperior
(
units
.
getUnitId
(),
scrap
.
getId
(),
userId
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起报废任务,待上传回执单据"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
}
scrap
.
setDeviceIds
(
StringUtils
.
ListToString
(
scrapOrderOutData
.
getDevIds
()));
scrap
.
setOutboundFile
(
FilesUtil
.
stringFileToList
(
scrapOrderOutData
.
getOutboundFileList
()));
scrap
.
setScripts
(
scrapOrderOutData
.
getScriptSaveVos
());
scrap
.
setScriptJson
(
JacksonUtil
.
toJSon
(
scrapOrderOutData
.
getScriptSaveVos
()));
scrap
.
setDeviceLibraryEntities
(
findInvoleDevice
(
scrap
.
getDeviceIds
()));
scrapService
.
saveScrap
(
scrap
);
deviceLibraryDao
.
upDateSeqNumbersLeftStatus
(
DeviceLifeStatus
.
IN_THE_SCRAPPED
.
id
,
seqNumbers
);
return
scrap
;
}
@Override
public
void
receiptSingle
(
Integer
taskId
,
StorageScrap
storageScrap
)
{
User
user
=
userService
.
findByUser
(
storageScrap
.
getUserId
());
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
S
END_BACK_1210
);
User
user
=
userService
.
findByUser
(
storageScrap
.
getUserId
());
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
S
CRAP_2222
);
Scrap
scrap
=
scrapService
.
findScrap
(
taskBto
.
getBillId
());
scrap
.
setBillFile
(
FilesUtil
.
stringFileToList
(
storageScrap
.
getFileRets
()));
if
(
storageScrap
.
getUserBName
()!=
null
)
{
...
...
@@ -131,12 +169,63 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
}
}
);
deviceLibraryDao
.
upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus
(
DeviceLifeStatus
.
RETIRE
.
id
,
scrap
.
getReceiveUnit
(),
0
,
seqNumbers
);
deviceLibraryDao
.
upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus
(
DeviceLifeStatus
.
SCRAP_I
.
id
,
scrap
.
getReceiveUnit
(),
0
,
seqNumbers
);
scrapService
.
saveScrap
(
scrap
);
devLogAdd
(
findInvoleDevice
(
scrap
.
getDeviceIds
()),
"上传了报废单据,装备状态-》已报废"
,
storageScrap
.
getUserId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"退役任务回执单据上传成功任务结束"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"报废单据上传,任务结束"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
}
@Override
public
void
sealOfAudit
(
Integer
taskId
,
Integer
userId
,
ScrapOrderOutData
scrapOrderOutData
)
{
Scrap
scrap
=
new
Scrap
();
User
user
=
userService
.
findByUser
(
userId
);
Units
units
=
unitsService
.
findById
(
user
.
getUnitsId
());
if
(
taskId
==
null
){
scrap
=
scrapOrderOutData
.
toScrap
();
scrapService
.
saveScrap
(
scrap
);
sealOfAuditTask
(
units
.
getUnitId
(),
scrap
.
getId
(),
userId
);
}
else
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
List
<
StatusEnum
>
statusEnums
=
new
ArrayList
<>();
statusEnums
.
add
(
StatusEnum
.
SCRAP_2223
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
statusEnums
);
scrap
=
scrapService
.
findScrap
(
taskBto
.
getBillId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SCRAP_2225
,
userId
);
}
scrap
.
setScriptJson
(
JacksonUtil
.
toJSon
(
scrapOrderOutData
.
getScriptSaveVos
()));
scrap
.
setScripts
(
scrapOrderOutData
.
getScriptSaveVos
());
scrap
.
setSenderUserB
(
user
.
getName
());
scrap
.
setSendUserbId
(
userId
);
scrapService
.
saveScrap
(
scrap
);
}
@Override
public
void
outSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
if
(
reviewTheResults
==
0
){
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SCRAP_2225
,
0
);
}
else
{
Scrap
scrap
=
scrapService
.
findScrap
(
taskBto
.
getBillId
());
scrap
.
setSenderUserB
(
null
);
scrap
.
setSendUserbId
(
null
);
scrapService
.
saveScrap
(
scrap
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SCRAP_2223
,
scrap
.
getSendUseraId
());
}
}
@Override
public
void
deleteDrafts
(
Integer
taskId
)
{
}
/**
* 发起调用电子签章确认任务
*/
private
TaskBto
sealOfAuditTask
(
Integer
unitId
,
Integer
repelDetailId
,
Integer
userId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SCRAP_2224
.
id
,
"报废任务"
,
null
,
"."
,
repelDetailId
,
BusinessEnum
.
DECOMMISSIONING
.
id
,
unitId
,
0
,
""
,
list
));
}
/**
* 报废省出库中办
...
...
@@ -149,7 +238,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
0
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
WAIT_UPLOAD_SCRAP_FILE
.
id
,
"报废业务"
,
null
,
"."
,
repelDetailId
,
BusinessEnum
.
SCRAP
.
id
,
unitId
,
1
,
"country"
,
userIds
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SCRAP_2222
.
id
,
"报废业务"
,
null
,
"."
,
repelDetailId
,
BusinessEnum
.
SCRAP
.
id
,
unitId
,
1
,
"country"
,
userIds
));
}
/**
...
...
@@ -172,6 +261,17 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
}
/**
* 报废保存为草稿
*/
private
TaskBto
sendDraftTask
(
Integer
unitId
,
Integer
repelDetailId
,
Integer
userId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
list
.
add
(
0
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SCRAP_2223
.
id
,
"报废设备任务"
,
null
,
"."
,
repelDetailId
,
BusinessEnum
.
DECOMMISSIONING
.
id
,
unitId
,
1
,
""
,
list
));
}
private
void
addMessage
(
MessageBto
messageBto
){
messageService
.
add
(
messageBto
);
}
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/impl/ScrapQueryServiceImpl.java
浏览文件 @
7a6516a1
...
...
@@ -9,12 +9,17 @@ import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
import
com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.util.Optional
;
/**
* @author zjm
...
...
@@ -41,4 +46,19 @@ public class ScrapQueryServiceImpl implements ScrapQueryService {
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
return
scrapService
.
findScrap
(
taskBto
.
getBillId
());
}
@Override
public
TaskBto
findApplyIdToScrapTask
(
Integer
applyId
)
{
Optional
<
Scrap
>
scrap
=
scrapService
.
findApplyId
(
applyId
);
if
(!
scrap
.
isPresent
()){
return
null
;
}
else
{
Optional
<
Task
>
billIdAndBusinessType
=
taskService
.
findBillIdAndBusinessType
(
scrap
.
get
().
getId
(),
BusinessEnum
.
SCRAP
.
id
);
if
(
billIdAndBusinessType
.
isPresent
()){
return
billIdAndBusinessType
.
get
().
parse2Bto
();
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"[报废] 根据申请id未查询退役任务 :"
+
applyId
));
}
}
}
}
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/impl/ScrapServiceImpl.java
浏览文件 @
7a6516a1
package
com
.
tykj
.
dev
.
device
.
scrap
.
service
.
impl
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.Specifications
;
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.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.device.scrap.repository.ScrapDao
;
import
com.tykj.dev.device.scrap.service.ScrapService
;
import
com.tykj.dev.device.scrap.subject.domin.Scrap
;
import
com.tykj.dev.device.scrap.subject.domin.ScrapBill
;
import
com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
@@ -51,6 +54,7 @@ public class ScrapServiceImpl implements ScrapService {
if
(
optional
.
isPresent
()){
Scrap
scrap
=
optional
.
get
();
scrap
.
setDeviceLibraryEntities
(
findInvoleDevice
(
scrap
.
getDeviceIds
()));
scrap
.
setScripts
(
JacksonUtil
.
readValue
(
scrap
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{}));
scrap
.
setBillFiles
(
FilesUtil
.
stringFileToList
(
scrap
.
getBillFile
()));
scrap
.
setOutboundFiles
(
FilesUtil
.
stringFileToList
(
scrap
.
getOutboundFile
()));
return
scrap
;
...
...
@@ -97,6 +101,11 @@ public class ScrapServiceImpl implements ScrapService {
return
scrapDao
.
findAll
(
predicateBuilder
.
build
(),
scrapSelectVo
.
getPageable
());
}
@Override
public
Optional
<
Scrap
>
findApplyId
(
Integer
applyId
)
{
return
scrapDao
.
findByApplyId
(
applyId
);
}
private
List
<
DeviceLibrary
>
findInvoleDevice
(
String
involeDevice
){
if
(
involeDevice
!=
null
&&
!
involeDevice
.
equals
(
","
)
)
{
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/subject/domin/Scrap.java
浏览文件 @
7a6516a1
...
...
@@ -35,6 +35,11 @@ public class Scrap extends BaseEntity {
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
/**
* 申请id
*/
private
Integer
applyId
;
@ApiModelProperty
(
value
=
"单据编号"
)
private
String
num
;
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/subject/vo/ScrapOrderOutData.java
浏览文件 @
7a6516a1
...
...
@@ -186,6 +186,14 @@ public class ScrapOrderOutData {
@ApiModelProperty
(
value
=
"单据装备数据信息"
)
private
List
<
ScriptSaveVo
>
scriptSaveVos
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"任务Id"
)
private
Integer
taskId
;
/**
* 申请id
*/
@ApiModelProperty
(
value
=
"申请id"
)
private
Integer
applyId
;
public
Scrap
toScrap
()
{
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
return
mapper
.
map
(
this
,
Scrap
.
class
);
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/controller/RepelDevController.java
浏览文件 @
7a6516a1
...
...
@@ -75,6 +75,34 @@ public class RepelDevController {
return
ResponseEntity
.
ok
(
repelBusinessService
.
sendBackOutCheck
(
taskId
,
userId
,
orderOutData
));
}
@ApiOperation
(
value
=
"清退出库任务申请签章"
,
notes
=
"清退出库任务申请签章"
)
@PostMapping
(
value
=
"/sealOfAudit/{userId}/{taskId}"
)
public
ResponseEntity
sealOfAudit
(
@PathVariable
Integer
taskId
,
@RequestBody
OrderOutData
orderOutData
,
@PathVariable
Integer
userId
){
repelBusinessService
.
sealOfAudit
(
taskId
,
userId
,
orderOutData
);
return
ResponseEntity
.
ok
(
"申请成功,等待审核"
);
}
@ApiOperation
(
value
=
"清退入库任务申请签章"
,
notes
=
"清退入库任务申请签章"
)
@PostMapping
(
value
=
"/sendSealOfAudit/{userId}/{taskId}"
)
public
ResponseEntity
sendSealOfAudit
(
@PathVariable
Integer
taskId
,
@PathVariable
Integer
userId
){
repelBusinessService
.
sendSealOfAudit
(
taskId
,
userId
);
return
ResponseEntity
.
ok
(
"申请成功,等待审核"
);
}
@ApiOperation
(
value
=
"清退出库申请签章审核接口"
,
notes
=
"清退出库申请签章审核接口"
)
@PostMapping
(
value
=
"/outSealOfAuditEnd/{reviewTheResults}/{taskId}"
)
public
ResponseEntity
outSealOfAuditEnd
(
@PathVariable
Integer
taskId
,
@PathVariable
Integer
reviewTheResults
){
repelBusinessService
.
outSealOfAuditEnd
(
taskId
,
reviewTheResults
);
return
ResponseEntity
.
ok
(
"审核成功"
);
}
@ApiOperation
(
value
=
"清退入库申请签章审核接口"
,
notes
=
"清退入库申请签章审核接口"
)
@PostMapping
(
value
=
"/sendSealOfAuditEnd/{reviewTheResults}/{taskId}"
)
public
ResponseEntity
sendSealOfAuditEnd
(
@PathVariable
Integer
taskId
,
@PathVariable
Integer
reviewTheResults
){
repelBusinessService
.
sendSealOfAuditEnd
(
taskId
,
reviewTheResults
);
return
ResponseEntity
.
ok
(
"审核成功"
);
}
@ApiOperation
(
value
=
"清退入库任务接口"
,
notes
=
"清退入库任务接口"
)
@PostMapping
(
value
=
"/storageDeviceRepel/{taskId}"
)
public
ResponseEntity
storageDeviceRepel
(
@PathVariable
Integer
taskId
,
@RequestBody
StorageDeviceRepel
storageDeviceRepel
){
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/OrderOutData.java
浏览文件 @
7a6516a1
...
...
@@ -91,7 +91,7 @@ public class OrderOutData {
* 签发人
*/
@ApiModelProperty
(
value
=
"签发人(B岗位)"
)
private
String
sendUserbId
;
private
Integer
sendUserbId
;
/**
* 收件方 经办人
*/
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/RepelBusinessService.java
浏览文件 @
7a6516a1
...
...
@@ -62,9 +62,29 @@ public interface RepelBusinessService {
*/
DeviceRepelDetail
sendBackOutCheck
(
Integer
taskId
,
Integer
userId
,
OrderOutData
orderOutData
);
/**
* 出库把任务推送至盖章审核
*/
void
sealOfAudit
(
Integer
taskId
,
Integer
userId
,
OrderOutData
orderOutData
);
// void SealOfAudit()
/**
* 入库把任务推送至盖章审核
*/
void
sendSealOfAudit
(
Integer
taskId
,
Integer
userId
);
/**
* 出库盖章审核调用
* 通过出库
* 不通过 退回状态
*/
void
outSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
);
/**
* 入库盖章审核调用
* 通过出库
* 不通过 退回状态
*/
void
sendSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
);
/**
* 上级清退装备入库
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelBusinessServiceImpl.java
浏览文件 @
7a6516a1
...
...
@@ -23,6 +23,7 @@ import com.tykj.dev.device.sendback.entity.vo.*;
import
com.tykj.dev.device.sendback.service.*
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.base.ret.MemberThat
;
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.entity.Area
;
...
...
@@ -506,6 +507,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1205
);
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1206
);
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1208
);
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1219
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
statusEnums
);
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetail
(
taskBto
.
getBillId
());
DeviceRepelDetail
orderOutDataRepelDetail
=
orderOutData
.
toTrainDetailsVo
();
...
...
@@ -535,6 +537,70 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
return
orderOutDataRepelDetail
;
}
@Override
public
void
sealOfAudit
(
Integer
taskId
,
Integer
userId
,
OrderOutData
orderOutData
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
MemberThat
memberThat
=
userService
.
findById
(
orderOutData
.
getSendUserbId
());
List
<
StatusEnum
>
statusEnums
=
new
ArrayList
<>();
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1205
);
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1206
);
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1208
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
statusEnums
);
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetail
(
taskBto
.
getBillId
());
deviceRepelDetail
.
setSenderUserA
(
orderOutData
.
getSenderUserA
());
deviceRepelDetail
.
setSendUseraId
(
orderOutData
.
getSendUseraId
());
deviceRepelDetail
.
setScriptJson
(
JacksonUtil
.
toJSon
(
orderOutData
.
getScriptSaveVos
()));
deviceRepelDetail
.
setScripts
(
orderOutData
.
getScriptSaveVos
());
deviceRepelDetail
.
setSenderUserB
(
memberThat
.
getName
());
deviceRepelDetail
.
setSendUserbId
(
orderOutData
.
getSendUserbId
());
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1217
,
orderOutData
.
getSendUserbId
());
}
@Override
public
void
sendSealOfAudit
(
Integer
taskId
,
Integer
userId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
MemberThat
memberThat
=
userService
.
findById
(
userId
);
List
<
StatusEnum
>
enumList
=
new
ArrayList
<>();
enumList
.
add
(
StatusEnum
.
SEND_BACK_1209
);
enumList
.
add
(
StatusEnum
.
SEND_BACK_1213
);
enumList
.
add
(
StatusEnum
.
SEND_BACK_1215
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
enumList
);
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetail
(
taskBto
.
getBillId
());
deviceRepelDetail
.
setReceiveUserB
(
memberThat
.
getName
());
deviceRepelDetail
.
setReceiveUserbId
(
userId
);
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1217
,
userId
);
}
@Override
public
void
outSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
if
(
reviewTheResults
==
0
){
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1219
,
0
);
}
else
{
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetail
(
taskBto
.
getBillId
());
deviceRepelDetail
.
setSenderUserB
(
null
);
deviceRepelDetail
.
setSendUserbId
(
null
);
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1208
,
deviceRepelDetail
.
getSendUseraId
());
}
}
@Override
public
void
sendSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
if
(
reviewTheResults
==
0
){
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1218
,
0
);
}
else
{
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetail
(
taskBto
.
getBillId
());
deviceRepelDetail
.
setReceiveUserbId
(
null
);
deviceRepelDetail
.
setReceiveUserB
(
null
);
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1209
,
deviceRepelDetail
.
getReceiveUseraId
());
}
}
@Override
public
void
storageDeviceRepel
(
Integer
taskId
,
StorageDeviceRepel
storageDeviceRepel
)
{
//判断是否上传单据
...
...
@@ -567,13 +633,14 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail
.
setSenderUserB
(
storageDeviceRepel
.
getSenderName
());
}
//判断是否为入库单据待补充 还是直接入库。
RepelTaskStatistical
repelTaskStatistical
=
repelTaskStatisticalService
.
findRepelTaskStatistical
(
taskBto
.
getId
(),
deviceRepelDetail
.
getRepelId
());
RepelTaskStatistical
repelTaskStatistical
=
repelTaskStatisticalService
.
findRepelTaskStatistical
(
taskBto
.
getId
(),
deviceRepelDetail
.
getRepelId
());
if
(
storageDeviceRepel
.
getFileRets
()!=
null
&&
storageDeviceRepel
.
getFileRets
().
size
()!=
0
)
{
List
<
StatusEnum
>
enumList
=
new
ArrayList
<>();
enumList
.
add
(
StatusEnum
.
SEND_BACK_1209
);
enumList
.
add
(
StatusEnum
.
SEND_BACK_1213
);
enumList
.
add
(
StatusEnum
.
SEND_BACK_1215
);
enumList
.
add
(
StatusEnum
.
SEND_BACK_1218
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
enumList
);
deviceRepelDetail
.
setBillFile
(
FilesUtil
.
stringFileToList
(
storageDeviceRepel
.
getFileRets
()));
deviceRepelDetail
.
setRepelStatus
(
2
);
...
...
@@ -584,12 +651,11 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
else
{
deviceLibraryDao
.
upDateLeftStatusAndUnitNameAndLockStatus
(
DeviceLifeStatus
.
SEND_BACK
.
id
,
deviceRepelDetail
.
getReceiveUnit
(),
0
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
}
List
<
DeviceLibrary
>
libraries
=
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
());
libraries
.
forEach
(
List
<
DeviceLibrary
>
libraries
=
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
());
libraries
.
forEach
(
deviceLibrary
->
{
list
.
add
(
new
RepelDeviceUnit
(
deviceLibrary
.
getId
(),
deviceRepelDetail
.
getSendUnitId
()));
}
);
});
//添加根据type修改装备状态
repelDeviceUnitService
.
saveAllRepelDeviceUnit
(
list
);
taskService
.
moveToEnd
(
taskBto
);
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/TaskService.java
浏览文件 @
7a6516a1
...
...
@@ -7,6 +7,7 @@ import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import
com.tykj.dev.misc.base.StatusEnum
;
import
java.util.List
;
import
java.util.Optional
;
/**
* @author dengdiyi
...
...
@@ -171,6 +172,12 @@ public interface TaskService {
*/
List
<
TaskBto
>
findBillIdAndBillType
(
List
<
Integer
>
billIds
,
Integer
billType
);
/**
* 根据业务id 以及 业务类型进行查询
*/
Optional
<
Task
>
findBillIdAndBusinessType
(
Integer
billId
,
Integer
businessType
);
/**
* 根据父id查询customInfo为shi的task
*/
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
7a6516a1
...
...
@@ -775,6 +775,11 @@ public class TaskServiceImpl implements TaskService {
return
taskDao
.
findAllByBillIdInAndBusinessType
(
billIds
,
billType
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
());
}
@Override
public
Optional
<
Task
>
findBillIdAndBusinessType
(
Integer
billId
,
Integer
businessType
)
{
return
taskDao
.
findByBillIdAndBusinessType
(
billId
,
businessType
);
}
@Override
public
TaskBto
findFatherIdAndCustomInfo
(
Integer
taskId
)
{
...
...
@@ -875,6 +880,7 @@ public class TaskServiceImpl implements TaskService {
return
unitExists
&&
pointExists
&&
!
userConfirm
&&
!
userConfirm2
&&
!
isDraft
&&
isCreateUnit
;
})
.
collect
(
Collectors
.
toList
());
//涉及人员当前指针为-1,且所属单位为当前单位
List
<
TaskBto
>
taskBtos1
=
taskBtos
.
stream
()
.
filter
(
taskBto
->
{
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/service/impl/DeviceUseReportServiceImpl.java
浏览文件 @
7a6516a1
...
...
@@ -191,16 +191,16 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
//省级才能销毁,列装,退装
if
(
userUtils
.
getCurrentUnitLevel
()
==
1
)
{
//筛选出在日期范围内的销毁单
List
<
DeviceDestroyBill
>
deviceDestoryBillEntities
=
deviceDestroyBillDao
.
findAll
().
stream
()
.
filter
(
deviceDestoryBillEntity
->
deviceDestoryBillEntity
.
getDestroyStatus
()
==
2
&&
deviceDestoryBillEntity
.
getDestroyTime
()!=
null
&&
deviceDestoryBillEntity
.
getDestroyTime
().
after
(
date
)
&&
deviceDestoryBillEntity
.
getDestroyTime
().
before
(
date2
))
.
collect
(
toList
());
//累加销毁数量
if
(
deviceDestoryBillEntities
.
size
()
>
0
)
{
for
(
DeviceDestroyBill
s
:
deviceDestoryBillEntities
)
{
List
<
Integer
>
list
=
StringSplitUtil
.
split
(
s
.
getDestroyDeviceDetail
());
destoryNum
=
destoryNum
+
list
.
size
();
}
}
//
List<DeviceDestroyBill> deviceDestoryBillEntities = deviceDestroyBillDao.findAll().stream()
//
.filter(deviceDestoryBillEntity -> deviceDestoryBillEntity.getDestroyStatus() == 2 && deviceDestoryBillEntity.getDestroyTime()!=null&&deviceDestoryBillEntity.getDestroyTime().after(date) && deviceDestoryBillEntity.getDestroyTime().before(date2))
//
.collect(toList());
//
//累加销毁数量
//
if (deviceDestoryBillEntities.size() > 0) {
//
for (DeviceDestroyBill s : deviceDestoryBillEntities) {
//
List<Integer> list = StringSplitUtil.split(s.getDestroyDeviceDetail());
//
destoryNum = destoryNum + list.size();
//
}
//
}
//筛选列装
List
<
PackingLibrary
>
packingLibraryEntities
=
packingLibraryDao
.
findAll
().
stream
()
.
filter
(
packingLibraryEntity
->
packingLibraryEntity
.
getPackingStatus
()!=
null
&&
packingLibraryEntity
.
getPackingStatus
()
==
2
&&
packingLibraryEntity
.
getCreateTime
()!=
null
&&
packingLibraryEntity
.
getCreateTime
().
after
(
date
)
&&
packingLibraryEntity
.
getCreateTime
().
before
(
date2
))
...
...
@@ -309,25 +309,25 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
public
List
<
DeviceStatistics
>
getDestroyStatistics
(
Date
startDate
,
Date
endDate
)
{
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
//筛选出日期范围内所有销毁账单
List
<
DeviceDestroyBill
>
deviceDestroyBills
=
deviceDestroyBillDao
.
findAll
().
stream
()
.
filter
(
deviceDestroyBill
->
deviceDestroyBill
.
getDestroyStatus
()
==
2
&&
deviceDestroyBill
.
getDestroyTime
().
after
(
startDate
)
&&
deviceDestroyBill
.
getDestroyTime
().
before
(
endDate
))
.
collect
(
toList
());
//获取所有销毁的装备
if
(
deviceDestroyBills
.
size
()
>
0
)
{
for
(
DeviceDestroyBill
s
:
deviceDestroyBills
)
{
String
[]
strings
=
s
.
getDestroyDeviceDetail
().
split
(
"x"
);
for
(
String
s1
:
strings
)
{
if
(
s1
.
length
()
>=
2
)
{
//出库无误装备
if
(
"1"
.
equals
(
s1
.
substring
(
s1
.
length
()
-
1
)))
{
Integer
id
=
Integer
.
parseInt
(
s1
.
substring
(
0
,
s1
.
length
()
-
1
));
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
deviceLibraries
.
add
(
deviceLibraryEntity
);
}
}
}
}
}
//
List<DeviceDestroyBill> deviceDestroyBills = deviceDestroyBillDao.findAll().stream()
//
.filter(deviceDestroyBill -> deviceDestroyBill.getDestroyStatus() == 2 && deviceDestroyBill.getDestroyTime().after(startDate) && deviceDestroyBill.getDestroyTime().before(endDate))
//
.collect(toList());
//
//获取所有销毁的装备
//
if (deviceDestroyBills.size() > 0) {
//
for (DeviceDestroyBill s : deviceDestroyBills) {
//
String[] strings = s.getDestroyDeviceDetail().split("x");
//
for (String s1 : strings) {
//
if (s1.length() >= 2) {
//
//出库无误装备
//
if ("1".equals(s1.substring(s1.length() - 1))) {
//
Integer id = Integer.parseInt(s1.substring(0, s1.length() - 1));
//
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
//
deviceLibraries.add(deviceLibraryEntity);
//
}
//
}
//
}
//
}
//
}
return
getDeviceStatistics
(
deviceLibraries
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论