Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f6a7fc82
提交
f6a7fc82
authored
3月 20, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[清退] 代码提交
上级
30d8b4fa
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
33 个修改的文件
包含
693 行增加
和
53 行删除
+693
-53
GlobalMap.java
dev-config/src/main/java/com/tykj/dev/config/GlobalMap.java
+4
-1
LogType.java
dev-config/src/main/java/com/tykj/dev/config/LogType.java
+2
-0
DeviceLifeStatus.java
.../main/java/com/tykj/dev/config/base/DeviceLifeStatus.java
+5
-1
pom.xml
dev-file/pom.xml
+4
-1
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+27
-25
Documents.java
.../main/java/com/tykj/dev/device/file/entity/Documents.java
+25
-0
PdfServiceImpl.java
...com/tykj/dev/device/file/service/Impl/PdfServiceImpl.java
+42
-0
PdfService.java
...ain/java/com/tykj/dev/device/file/service/PdfService.java
+22
-0
BusinessEnum.java
...sc/src/main/java/com/tykj/dev/misc/base/BusinessEnum.java
+6
-1
PackingLibraryController.java
...v/device/packing/controller/PackingLibraryController.java
+2
-0
pom.xml
dev-sendback/pom.xml
+2
-0
RepelDevController.java
...kj/dev/device/sendback/controller/RepelDevController.java
+15
-0
RepelQueryController.java
.../dev/device/sendback/controller/RepelQueryController.java
+52
-0
AgainStorageBill.java
...j/dev/device/sendback/entity/domain/AgainStorageBill.java
+33
-0
DeviceRepelDetail.java
.../dev/device/sendback/entity/domain/DeviceRepelDetail.java
+23
-9
OrderOutData.java
.../com/tykj/dev/device/sendback/entity/vo/OrderOutData.java
+5
-1
PagingVo.java
...java/com/tykj/dev/device/sendback/entity/vo/PagingVo.java
+26
-0
RepelManagementVo.java
...tykj/dev/device/sendback/entity/vo/RepelManagementVo.java
+35
-1
StorageDeviceRepel.java
...ykj/dev/device/sendback/entity/vo/StorageDeviceRepel.java
+20
-1
AgainStorageBillDao.java
...j/dev/device/sendback/repository/AgainStorageBillDao.java
+16
-0
AgainStorageBillService.java
.../dev/device/sendback/service/AgainStorageBillService.java
+20
-0
DeviceRepelDetailService.java
...dev/device/sendback/service/DeviceRepelDetailService.java
+1
-1
RepelBusinessService.java
...ykj/dev/device/sendback/service/RepelBusinessService.java
+7
-5
RepelQueryService.java
...m/tykj/dev/device/sendback/service/RepelQueryService.java
+29
-0
AgainStorageBillServiceImpl.java
...ce/sendback/service/impl/AgainStorageBillServiceImpl.java
+81
-0
DeviceRepelDetailServiceImpl.java
...e/sendback/service/impl/DeviceRepelDetailServiceImpl.java
+4
-3
RepelBusinessServiceImpl.java
...evice/sendback/service/impl/RepelBusinessServiceImpl.java
+0
-0
RepelQueryServiceImpl.java
...v/device/sendback/service/impl/RepelQueryServiceImpl.java
+160
-1
RepelTaskStatisticalServiceImpl.java
...endback/service/impl/RepelTaskStatisticalServiceImpl.java
+2
-0
TaskDao.java
...ain/java/com/tykj/dev/device/task/repository/TaskDao.java
+2
-2
TaskService.java
...in/java/com/tykj/dev/device/task/service/TaskService.java
+5
-0
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+7
-0
MyFilter.java
...c/main/java/com/tykj/dev/device/user/config/MyFilter.java
+9
-0
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/GlobalMap.java
浏览文件 @
f6a7fc82
...
...
@@ -3,6 +3,7 @@ package com.tykj.dev.config;
import
com.tykj.dev.misc.base.*
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -12,7 +13,7 @@ import java.util.stream.Collectors;
*/
public
class
GlobalMap
{
p
rivate
static
final
Map
<
Integer
,
StatusEnum
>
statusEnumMap
;
p
ublic
static
final
Map
<
Integer
,
StatusEnum
>
statusEnumMap
;
private
static
final
Map
<
Integer
,
RepairStatusEnum
>
repairStatusMap
;
...
...
@@ -86,4 +87,6 @@ public class GlobalMap {
public
static
Map
<
Integer
,
DeviceInvisibleRange
>
getDeviceInvisibleRangeMap
()
{
return
deviceInvisibleRangeMap
;
}
}
dev-config/src/main/java/com/tykj/dev/config/LogType.java
浏览文件 @
f6a7fc82
...
...
@@ -196,6 +196,8 @@ public enum LogType {
SEND_BACK_28
(
100018
,
SEND_BACK
.
id
,
SEND_BACK_1213
.
id
,
END
.
id
,
"上传了直属单位清退签字单据"
),
SEND_BACK_29
(
100019
,
SEND_BACK
.
id
,
SEND_BACK_1209
.
id
,
SEND_BACK_1215
.
id
,
"单据未上传,继续等待单据上传"
),
SEND_BACK_30
(
100020
,
SEND_BACK
.
id
,
SEND_BACK_1215
.
id
,
END
.
id
,
"接收单据已上传,清退装备配送完成"
),
//重新入库
AGAINSTORAGE_01
(
100021
,
AGAINSTORAGE
.
id
,
ORIGIN_STATUS
.
id
,
END
.
id
,
"发起了重新入库"
),
LOSS_1
(
9000
,
LOSS
.
id
,
ORIGIN_STATUS
.
id
,
LOSS1300
.
id
,
"发起装备丢失上报"
),
...
...
dev-config/src/main/java/com/tykj/dev/config/base/DeviceLifeStatus.java
浏览文件 @
f6a7fc82
...
...
@@ -74,8 +74,12 @@ public enum DeviceLifeStatus {
/**
* 待退役
*/
REPEL
(
15
,
"待退役"
)
;
REPEL
(
15
,
"待退役"
)
,
/**
* 退役中
*/
RETIRED
(
16
,
"退役中"
);
public
Integer
id
;
...
...
dev-file/pom.xml
浏览文件 @
f6a7fc82
...
...
@@ -54,7 +54,10 @@
<version>
2.3.19
</version>
</dependency>
<dependency>
<groupId>
com.tykj
</groupId>
<artifactId>
dev-library
</artifactId>
</dependency>
<dependency>
<groupId>
org.xhtmlrenderer
</groupId>
<artifactId>
flying-saucer-pdf-itext5
</artifactId>
...
...
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
f6a7fc82
...
...
@@ -102,31 +102,33 @@ public class FileController {
*/
@ApiOperation
(
value
=
"生成单据1"
)
@GetMapping
(
"/printDocuments1"
)
public
ResponseEntity
printDocuments
(
HttpServletResponse
response
)
throws
IOException
,
DocumentException
{
Documents
documents
=
new
Documents
();
documents
.
setNumber
(
"NO:第221321134号"
);
documents
.
setReceiveUnit
(
"杭州机要"
);
documents
.
setReplyNum
(
"123123123131"
);
documents
.
setSenderUnit
(
"浙江省"
);
documents
.
setTitle
(
"密码装备清退单"
);
List
<
DocumentDevice
>
documentDevices
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
20
;
i
++){
DocumentDevice
documentDevice
=
new
DocumentDevice
();
documentDevice
.
setCount
(
i
);
documentDevice
.
setModel
(
"MM001"
);
documentDevice
.
setRemark
(
"备注"
);
documentDevice
.
setApplicationField
(
"省一级"
);
documentDevice
.
setDeviceSerialNumber
(
"asdq1231232"
);
documentDevice
.
setProductionSerialNumber
(
"12312312312"
);
documentDevice
.
setParts
(
"密码机"
);
documentDevice
.
setCategory
(
"装备"
);
documentDevice
.
setSecurityClassification
(
"机密"
);
documentDevices
.
add
(
documentDevice
);
}
documents
.
setDocumentDevices
(
documentDevices
);
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
,
url
+
"htmlModel/"
);
showPdf
(
response
,
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"documents/"
).
getFilePath
());
public
ResponseEntity
printDocuments
(
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
IOException
,
DocumentException
{
int
interval
=
request
.
getSession
().
getMaxInactiveInterval
();
System
.
out
.
println
(
"-------"
+
interval
);
// Documents documents=new Documents();
// documents.setNumber("NO:第221321134号");
// documents.setReceiveUnit("杭州机要");
// documents.setReplyNum("123123123131");
// documents.setSenderUnit("浙江省");
// documents.setTitle("密码装备清退单");
// List<DocumentDevice> documentDevices=new ArrayList<>();
// for (int i=0;i<20;i++){
// DocumentDevice documentDevice=new DocumentDevice();
// documentDevice.setCount(i);
// documentDevice.setModel("MM001");
// documentDevice.setRemark("备注");
// documentDevice.setApplicationField("省一级");
// documentDevice.setDeviceSerialNumber("asdq1231232");
// documentDevice.setProductionSerialNumber("12312312312");
// documentDevice.setParts("密码机");
// documentDevice.setCategory("装备");
// documentDevice.setSecurityClassification("机密");
// documentDevices.add(documentDevice);
// }
// documents.setDocumentDevices(documentDevices);
//
// String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRender(documents,url+"htmlModel/");
// showPdf(response,JavaToPdfHtmlFreeMarker.createPdf(content,url,preview,"documents/").getFilePath());
return
ResponseEntity
.
ok
(
"ok"
);
}
...
...
dev-file/src/main/java/com/tykj/dev/device/file/entity/Documents.java
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
file
.
entity
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -22,18 +23,25 @@ import java.util.List;
public
class
Documents
{
@ApiModelProperty
(
name
=
"单据号"
)
private
String
number
;
@ApiModelProperty
(
name
=
"单据标题"
)
private
String
title
;
@ApiModelProperty
(
name
=
"接收单位"
)
private
String
receiveUnit
;
@ApiModelProperty
(
name
=
"批复文号"
)
private
String
replyNum
;
@ApiModelProperty
(
name
=
"相关装备"
)
private
List
<
DocumentDevice
>
documentDevices
;
@ApiModelProperty
(
name
=
"发件单位"
)
private
String
senderUnit
;
@ApiModelProperty
(
name
=
"签章数据"
)
private
String
srcA
;
@ApiModelProperty
(
name
=
"签章数据"
)
private
String
srcB
;
...
...
@@ -49,4 +57,21 @@ public class Documents {
@ApiModelProperty
(
name
=
"接收方人员"
)
private
String
nameB1
;
@ApiModelProperty
(
name
=
"后端转换使用"
)
private
List
<
ScriptSaveVo
>
scriptSaveVos
;
public
Documents
(
String
number
,
String
title
,
String
receiveUnit
,
String
replyNum
,
String
senderUnit
,
String
srcA
,
String
srcB
,
String
nameA
,
String
nameA1
,
String
nameB
,
String
nameB1
,
List
<
ScriptSaveVo
>
scriptSaveVos
)
{
this
.
number
=
number
;
this
.
title
=
title
;
this
.
receiveUnit
=
receiveUnit
;
this
.
replyNum
=
replyNum
;
this
.
senderUnit
=
senderUnit
;
this
.
srcA
=
srcA
;
this
.
srcB
=
srcB
;
this
.
nameA
=
nameA
;
this
.
nameA1
=
nameA1
;
this
.
nameB
=
nameB
;
this
.
nameB1
=
nameB1
;
this
.
scriptSaveVos
=
scriptSaveVos
;
}
}
dev-file/src/main/java/com/tykj/dev/device/file/service/Impl/PdfServiceImpl.java
0 → 100644
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
file
.
service
.
Impl
;
import
com.tykj.dev.device.file.entity.DocumentDevice
;
import
com.tykj.dev.device.file.entity.Documents
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.service.PdfService
;
import
com.tykj.dev.device.file.util.JavaToPdfHtmlFreeMarker
;
import
com.tykj.dev.device.library.subject.vo.Script
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.stream.Collectors
;
/**
* @author zjm
* @version 1.0.0
* @ClassName PdfServiceImpl.java
* @Description TODO
* @createTime 2021年03月17日 16:03:00
*/
@Service
@Slf4j
public
class
PdfServiceImpl
implements
PdfService
{
@Value
(
"${file.path}"
)
public
String
url
;
@Value
(
"${preview.path}"
)
public
String
preview
;
@Override
public
FileRet
billPdf
(
Documents
documents
)
{
documents
.
setDocumentDevices
(
documents
.
getScriptSaveVos
().
stream
().
map
(
this
::
toDocDev
).
collect
(
Collectors
.
toList
()));
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成出入单据对接口 documents"
);
return
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"documents/"
);
}
private
DocumentDevice
toDocDev
(
ScriptSaveVo
scriptSaveVo
){
return
new
DocumentDevice
(
null
,
scriptSaveVo
.
getModel
(),
null
,
scriptSaveVo
.
getType
(),
scriptSaveVo
.
getSecretLevel
(),
scriptSaveVo
.
getInvisibleRange
(),
scriptSaveVo
.
getNum
(),
scriptSaveVo
.
getSeqNumber
(),
null
,
scriptSaveVo
.
getRemark
());
}
}
dev-file/src/main/java/com/tykj/dev/device/file/service/PdfService.java
0 → 100644
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
file
.
service
;
import
com.tykj.dev.device.file.entity.Documents
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.util.JavaToPdfHtmlFreeMarker
;
/**
* @author zjm
* @version 1.0.0
* @ClassName PdfService.java
* @Description TODO
* @createTime 2021年03月17日 15:49:00
*/
public
interface
PdfService
{
/**
* 根据单据信息生成单据pdf
* @param documents 单据信息
* @return 单据地址信息
*/
FileRet
billPdf
(
Documents
documents
);
}
dev-misc/src/main/java/com/tykj/dev/misc/base/BusinessEnum.java
浏览文件 @
f6a7fc82
...
...
@@ -106,7 +106,12 @@ public enum BusinessEnum {
/**
* 找回
*/
RETRIEVE
(
25
,
"找回"
);
RETRIEVE
(
25
,
"找回"
),
/**
* 重新入库
*/
AGAINSTORAGE
(
26
,
"重新入库"
);
public
Integer
id
;
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingLibraryController.java
浏览文件 @
f6a7fc82
...
...
@@ -7,6 +7,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import
com.tykj.dev.device.packing.service.PackingLibraryService
;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.packing.subject.vo.*
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -50,6 +51,7 @@ public class PackingLibraryController {
@ApiOperation
(
value
=
"获取装备单据显示"
,
notes
=
"获取装备单据显示"
)
@PostMapping
(
"/getScript"
)
public
ResponseEntity
setRecord
(
@RequestBody
List
<
Integer
>
ids
){
// throw new ApiException(ResponseEntity.status(303).body("aaa"));
return
ResponseEntity
.
ok
(
packingLibraryService
.
getDevcieScript
(
ids
));
}
...
...
dev-sendback/pom.xml
浏览文件 @
f6a7fc82
...
...
@@ -37,5 +37,6 @@
<groupId>
com.tykj.dev
</groupId>
<artifactId>
config
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
dev-sendback/src/main/java/com/tykj/dev/device/sendback/controller/RepelDevController.java
浏览文件 @
f6a7fc82
...
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.sendback.controller;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.sendback.entity.domain.DeviceRepel
;
import
com.tykj.dev.device.sendback.entity.vo.*
;
import
com.tykj.dev.device.sendback.service.AgainStorageBillService
;
import
com.tykj.dev.device.sendback.service.RepelBusinessService
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
io.swagger.annotations.Api
;
...
...
@@ -30,6 +31,9 @@ public class RepelDevController {
@Autowired
RepelBusinessService
repelBusinessService
;
@Autowired
AgainStorageBillService
againStorageBillService
;
@PostMapping
(
value
=
"/initiateRepel/{userId}"
)
@ApiOperation
(
value
=
"省发布清退接口"
,
notes
=
"省发布清退接口"
)
public
ResponseEntity
initiateRepel
(
@PathVariable
Integer
userId
,
@RequestBody
DeviceRepel
deviceRepel
){
...
...
@@ -198,6 +202,17 @@ public class RepelDevController {
return
ResponseEntity
.
ok
(
"重新入库成功"
);
}
/**
* 重新入库接口会生成业务记录
*/
@ApiOperation
(
value
=
"重新入库接口会生成业务记录"
,
notes
=
"重新入库接口会生成业务记录"
)
@PostMapping
(
value
=
"/againPutInStorage/business"
)
public
ResponseEntity
againPutInStorage1
(
@RequestBody
List
<
Integer
>
ids
,
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
){
againStorageBillService
.
againPutInStorage
(
ids
,
securityUser
);
return
ResponseEntity
.
ok
(
"重新入库成功"
);
}
/**
* 测试
*/
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/controller/RepelQueryController.java
浏览文件 @
f6a7fc82
...
...
@@ -187,4 +187,56 @@ public class RepelQueryController {
public
ResponseEntity
findOutsideTheProvince
()
{
return
ResponseEntity
.
ok
(
repelQueryService
.
findOutsideTheProvince
());
}
// /**
// * 查询清退任务
// * @param
// * @return
// */
// @ApiOperation(value = "查询退役中的装备列表", notes = "可以通过这个接口查询查询清退任务")
// @PostMapping(value = "/findRetired")
// public ResponseEntity selectRepairTasks(@RequestBody ModelAndTypeVo modelAndTypeVo){
//
// return ResponseEntity.ok(repelQueryService.findRetired(modelAndTypeVo));
// }
/**
* 待清退 待退役
*/
@PostMapping
(
value
=
"/toBeRetiredDeviceList"
)
@ApiOperation
(
value
=
"待清退"
,
notes
=
"待清退列表"
)
public
ResponseEntity
clearedList1
(
@RequestBody
RepelManagementVo
repelManagementVo
){
return
ResponseEntity
.
ok
(
repelQueryService
.
toBeRetiredDeviceList
(
repelManagementVo
));
}
/**
* 退役中
*/
@PostMapping
(
value
=
"/findRetired"
)
@ApiOperation
(
value
=
"退役中"
,
notes
=
"退役中列表"
)
public
ResponseEntity
clearedList2
(
@RequestBody
RepelManagementVo
repelManagementVo
){
return
ResponseEntity
.
ok
(
repelQueryService
.
findRetired
(
repelManagementVo
));
}
/**
* 已清退列表
*/
@PostMapping
(
value
=
"/clearedDeviceList"
)
@ApiOperation
(
value
=
"已清退"
,
notes
=
"已清退列表"
)
public
ResponseEntity
clearedList3
(
@RequestBody
RepelManagementVo
repelManagementVo
){
return
ResponseEntity
.
ok
(
repelQueryService
.
clearedDeviceList
(
repelManagementVo
));
}
/**
* 已退役
*/
@PostMapping
(
value
=
"/retiredDeviceList"
)
@ApiOperation
(
value
=
"已退役"
,
notes
=
"已清退列表"
)
public
ResponseEntity
clearedList4
(
@RequestBody
RepelManagementVo
repelManagementVo
){
return
ResponseEntity
.
ok
(
repelQueryService
.
retiredDeviceList
(
repelManagementVo
));
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/domain/AgainStorageBill.java
0 → 100644
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
entity
.
domain
;
import
com.tykj.dev.misc.base.BaseEntity
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.EntityListeners
;
/**
* @author zjm
* @version 1.0.0
* @ClassName AgainStorageBill.java
* @Description TODO
* @createTime 2021年03月16日 16:27:00
*/
@Data
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
@ApiModel
(
"重新入库业务"
)
public
class
AgainStorageBill
extends
BaseEntity
{
@Column
(
name
=
"dev_ids"
,
columnDefinition
=
"TEXT"
)
private
String
DevIds
;
public
AgainStorageBill
(
String
devIds
)
{
DevIds
=
devIds
;
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/domain/DeviceRepelDetail.java
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
entity
.
domain
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.tykj.dev.device.file.entity.Documents
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
...
...
@@ -43,19 +44,20 @@ public class DeviceRepelDetail extends BaseEntity {
private
Integer
repelId
;
/**
*
编号
*
标题
*/
@ApiModelProperty
(
value
=
"单据编号"
)
private
String
num
;
private
String
title
;
/**
*
申请文
号
*
编
号
*/
@ApiModelProperty
(
value
=
"单据编号"
)
private
String
num
;
@ApiModelProperty
(
value
=
"申请文号"
)
private
String
applyNumber
;
/**
* 批复文号
*/
@ApiModelProperty
(
value
=
"批复文号"
)
private
String
replayNumber
;
/**
...
...
@@ -235,9 +237,14 @@ public class DeviceRepelDetail extends BaseEntity {
@ApiModelProperty
(
value
=
"清退状态"
,
name
=
"1.清退中,2.清退完成"
)
private
Integer
repelStatus
;
@ApiModelProperty
(
value
=
"批复文号文件"
)
@Column
(
name
=
"reply_files"
,
columnDefinition
=
"TEXT"
)
private
String
replyFiles
;
@ApiModelProperty
(
value
=
"申请文号文件"
)
@Column
(
name
=
"apply_files"
,
columnDefinition
=
"TEXT"
)
private
String
applyFiles
;
@Column
(
name
=
"send_files"
,
columnDefinition
=
"TEXT"
)
private
String
sendFiles
;
...
...
@@ -248,12 +255,17 @@ public class DeviceRepelDetail extends BaseEntity {
private
List
<
ScriptSaveVo
>
scripts
=
new
ArrayList
<>();
@Transient
private
List
<
FileRet
>
replyFileList
=
new
ArrayList
<>();
@Transient
private
List
<
FileRet
>
sendFileList
=
new
ArrayList
<>();
@Transient
@ApiModelProperty
(
value
=
"批复文号文件集合"
)
private
List
<
FileRet
>
replyFileList
=
new
ArrayList
<>();
@Transient
@ApiModelProperty
(
value
=
"申请文号文件集合"
)
private
List
<
FileRet
>
applyFileList
=
new
ArrayList
<>();
@Transient
@ApiModelProperty
(
value
=
"装备List"
)
...
...
@@ -272,6 +284,8 @@ public class DeviceRepelDetail extends BaseEntity {
private
List
<
FileRet
>
outboundFiles
;
public
Documents
toDoc
(){
return
new
Documents
(
num
,
"装备清退单据"
,
receiveUnit
,
replayNumber
,
sendUnit
,
null
,
null
,
senderUserA
,
senderUserB
,
receiveUserA
,
receiveUserB
,
null
);
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/OrderOutData.java
浏览文件 @
f6a7fc82
...
...
@@ -38,6 +38,7 @@ public class OrderOutData {
*/
@ApiModelProperty
(
value
=
"批复文号"
)
private
String
replayNumber
;
/**
* 发件单位
*/
...
...
@@ -173,12 +174,15 @@ public class OrderOutData {
@ApiModelProperty
(
value
=
"清退单文件"
)
private
List
<
FileRet
>
billFileList
;
@ApiModelProperty
(
value
=
"发件单位签章id"
)
private
String
leftSignatureId
;
@ApiModelProperty
(
value
=
"批复文号文件集合"
)
private
List
<
FileRet
>
replyFileList
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"申请文号文件集合"
)
private
List
<
FileRet
>
applyFileList
=
new
ArrayList
<>();
private
List
<
FileRet
>
sendFileList
=
new
ArrayList
<>();
@ApiModelProperty
(
value
=
"单据装备数据信息"
)
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/PagingVo.java
0 → 100644
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
entity
.
vo
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.apache.poi.ss.formula.functions.T
;
import
java.util.List
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
PagingVo
{
private
Integer
total
;
private
Integer
page
;
private
Integer
size
;
private
List
<
DeviceLibrary
>
data
;
}
\ No newline at end of file
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/RepelManagementVo.java
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
entity
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.tykj.dev.misc.base.CustomPage
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -20,7 +21,7 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"清退管理 清退清退vo"
)
public
class
RepelManagementVo
{
public
class
RepelManagementVo
extends
CustomPage
{
@ApiModelProperty
(
name
=
"开始清退的年份 默认各式 2020-01-01 00:00:00"
)
private
Long
time
;
...
...
@@ -29,4 +30,37 @@ public class RepelManagementVo {
@ApiModelProperty
(
name
=
"单位id"
)
private
Integer
unitId
;
@ApiModelProperty
(
name
=
"单位名称"
)
private
String
unitName
;
@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"
)
public
Integer
invisibleRange
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"BM-1"
)
public
String
name
;
@ApiModelProperty
(
value
=
"配用范围"
,
example
=
"1"
)
public
Integer
matchingRange
;
@ApiModelProperty
(
value
=
"入库类型"
,
example
=
"1"
)
public
Integer
storageType
;
@ApiModelProperty
(
value
=
"管理状态"
,
example
=
"1"
)
public
Integer
manageStatus
;
@ApiModelProperty
(
value
=
"模糊查询内容"
,
example
=
"测试"
)
public
String
content
;
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/vo/StorageDeviceRepel.java
浏览文件 @
f6a7fc82
...
...
@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.print.attribute.standard.Sides
;
import
java.util.List
;
/**
...
...
@@ -37,6 +38,7 @@ public class StorageDeviceRepel {
private
Integer
isIgnore
;
private
Integer
userId
;
private
Integer
taskId
;
...
...
@@ -51,5 +53,22 @@ public class StorageDeviceRepel {
private
String
senderName
;
private
String
senderId
;
private
Integer
senderId
;
/**
* 电子签章发件方
*/
private
String
srcA
;
/**
* 电子签章收件方
*/
private
String
srcB
;
/**
* 接收方、发件方都使用电子签章
*/
private
Integer
isNotTwoSides
;
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/repository/AgainStorageBillDao.java
0 → 100644
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
repository
;
import
com.tykj.dev.device.sendback.entity.domain.AgainStorageBill
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName AgainStorageBillDao.java
* @Description TODO
* @createTime 2021年03月16日 16:48:00
*/
public
interface
AgainStorageBillDao
extends
JpaRepository
<
AgainStorageBill
,
Integer
>,
JpaSpecificationExecutor
<
AgainStorageBill
>
{
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/AgainStorageBillService.java
0 → 100644
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
service
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName AgainStorageBillService.java
* @Description TODO
* @createTime 2021年03月16日 17:05:00
*/
public
interface
AgainStorageBillService
{
/**
* 装备重新入库 改变装备的生命状态
* @param ids 装备id
*/
void
againPutInStorage
(
List
<
Integer
>
ids
,
SecurityUser
securityUser
);
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/DeviceRepelDetailService.java
浏览文件 @
f6a7fc82
...
...
@@ -32,7 +32,7 @@ public interface DeviceRepelDetailService {
/**
* 根据年份以及单位 查询清退的装备列表
*/
List
<
DeviceLibrary
>
findYearAndUnitToDeviceList
(
Date
time
,
Date
endTime
,
Integer
unitId
);
List
<
Integer
>
findYearAndUnitToDeviceList
(
Date
time
,
Date
endTime
,
Integer
unitId
);
List
<
DeviceRepelDetail
>
findUnitIdSendOrReceive
(
Integer
unitId
);
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/RepelBusinessService.java
浏览文件 @
f6a7fc82
...
...
@@ -41,14 +41,11 @@ public interface RepelBusinessService {
* 修改repeltask的状态
* 以及修改账单的详情把装备写入到实体中
*/
void
resolveConfirm
(
Integer
taskId
,
Integer
userId
);
/**
* 选择装备 与账单和task关联
*/
void
submitChooseDevice
(
Integer
taskId
,
ResolveConfirm
resolveConfirm
);
/**
...
...
@@ -72,7 +69,6 @@ public interface RepelBusinessService {
void
storageDeviceRepel
(
Integer
taskId
,
StorageDeviceRepel
storageDeviceRepel
);
/**
* 本级装备待清退提交
*/
...
...
@@ -100,7 +96,6 @@ public interface RepelBusinessService {
*/
DeviceRepelDetail
provinceSendOutSuperior
(
Integer
userId
,
OrderOutData
orderOutData
);
/**
* 上传中办的回执单
* @param taskId 任务ID
...
...
@@ -125,4 +120,11 @@ public interface RepelBusinessService {
* @param ids 装备id
*/
void
againPutInStorage
(
List
<
Integer
>
ids
);
/**
* 省直接从在库到待退役
* 装备装备 在库-》待退役
*/
void
directlyRetired
(
List
<
Integer
>
ids
);
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/RepelQueryService.java
浏览文件 @
f6a7fc82
...
...
@@ -48,6 +48,11 @@ public interface RepelQueryService {
List
<
ModelNameGroup
>
toRepelList
(
RepelManagementVo
repelManagementVo
);
/**
* 待清退列表 省
*/
List
<
DeviceLibrary
>
toRepelListDev
(
RepelManagementVo
repelManagementVo
);
/**
* 待清退页面查询统计查询接口
*/
...
...
@@ -101,4 +106,28 @@ public interface RepelQueryService {
*/
DeviceChooseRepel
findDeviceChooseRepel1
(
List
<
Integer
>
fielding
,
Integer
unitId
);
/**
* 查看退役中装备列表
* @param repelManagementVo
* @return
*/
PagingVo
findRetired
(
RepelManagementVo
repelManagementVo
);
/**
* 查看待退役列表装备
*/
PagingVo
toBeRetiredDeviceList
(
RepelManagementVo
repelManagementVo
);
/**
* 查看已清退装备列表
*/
PagingVo
clearedDeviceList
(
RepelManagementVo
repelManagementVo
);
/**
* 查看已退役装备列表
*/
PagingVo
retiredDeviceList
(
RepelManagementVo
repelManagementVo
);
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/AgainStorageBillServiceImpl.java
0 → 100644
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
service
.
impl
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.sendback.entity.domain.AgainStorageBill
;
import
com.tykj.dev.device.sendback.repository.AgainStorageBillDao
;
import
com.tykj.dev.device.sendback.service.AgainStorageBillService
;
import
com.tykj.dev.device.sendback.util.StringUtils
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.read.service.MessageService
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.DeviceLifeStatus
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author zjm
* @version 1.0.0
* @ClassName AgainStorageBillServiceImpl.java
* @Description TODO
* @createTime 2021年03月16日 17:07:00
*/
@Service
public
class
AgainStorageBillServiceImpl
implements
AgainStorageBillService
{
@Autowired
DeviceLibraryDao
deviceLibraryDao
;
@Autowired
AgainStorageBillDao
againStorageBillDao
;
@Autowired
TaskService
taskService
;
@Autowired
MessageService
messageService
;
@Autowired
UserService
userService
;
@Override
public
void
againPutInStorage
(
List
<
Integer
>
ids
,
SecurityUser
securityUser
)
{
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
getDeviceLibraryEntitiesByIdIn
(
ids
);
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setLifeStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
)
);
deviceLibraryDao
.
saveAll
(
deviceLibraries
);
AgainStorageBill
againStorageBill
=
againStorageBillDao
.
save
(
new
AgainStorageBill
(
StringUtils
.
ListToString
(
ids
)));
TaskBto
taskBto
=
againStorageTask
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
againStorageBill
.
getId
(),
securityUser
.
getCurrentUserInfo
().
getUserId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
securityUser
.
getUsername
()+
"发起了重新入库"
,
gainThisUser
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
securityUser
.
getCurrentUserInfo
().
getUnitsId
())));
}
/**
* 重新入库任务发起
* 这里应为重新入库直接完结所有发起task任务为完结状态
*/
private
TaskBto
againStorageTask
(
Integer
unitId
,
Integer
againStorageId
,
Integer
userId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
END
.
id
,
LocalDateTime
.
now
().
atZone
(
ZoneOffset
.
ofHours
(
8
)).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
))
+
"重新入库"
,
null
,
"."
,
againStorageId
,
BusinessEnum
.
AGAINSTORAGE
.
id
,
unitId
,
0
,
null
,
list
));
}
private
void
addMessage
(
MessageBto
messageBto
){
messageService
.
add
(
messageBto
);
}
private
List
<
Integer
>
gainThisUser
(
Integer
userId
,
Integer
unitId
){
return
userService
.
findAllByUnite
(
unitId
).
stream
().
filter
(
user
->
user
.
getUnitsId
()!=
userId
).
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/DeviceRepelDetailServiceImpl.java
浏览文件 @
f6a7fc82
...
...
@@ -6,6 +6,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import
com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail
;
import
com.tykj.dev.device.sendback.repository.DeviceRepelDetailDao
;
import
com.tykj.dev.device.sendback.service.DeviceRepelDetailService
;
import
com.tykj.dev.device.sendback.util.StringUtils
;
import
com.tykj.dev.misc.exception.ApiException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -71,10 +72,10 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
}
@Override
public
List
<
DeviceLibrary
>
findYearAndUnitToDeviceList
(
Date
time
,
Date
endTime
,
Integer
unitId
)
{
Set
<
DeviceLibrary
>
libraries
=
new
HashSet
<>();
public
List
<
Integer
>
findYearAndUnitToDeviceList
(
Date
time
,
Date
endTime
,
Integer
unitId
)
{
Set
<
Integer
>
libraries
=
new
HashSet
<>();
deviceRepelDetailDao
.
findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus
(
time
,
endTime
,
unitId
,
2
).
forEach
(
deviceRepelDetail
->
libraries
.
addAll
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()))
deviceRepelDetail
->
libraries
.
addAll
(
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()))
);
return
new
ArrayList
<>(
libraries
);
}
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelBusinessServiceImpl.java
浏览文件 @
f6a7fc82
差异被折叠。
点击展开。
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelQueryServiceImpl.java
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
sendback
.
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
;
...
...
@@ -21,8 +23,12 @@ 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.data.domain.Page
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -133,6 +139,11 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return
toModelNameGroup
(
deviceLibraryDao
.
findAllByOwnUnitAndLocationUnitAndLifeStatus
(
units
.
getName
(),
units
.
getName
(),
DeviceLifeStatus
.
REPEL
.
id
).
stream
().
map
(
DeviceLibrary:
:
setConfigName
).
filter
(
deviceLibrary
->
deviceLibrary
.
getUpdateTime
()==
null
||(
deviceLibrary
.
getUpdateTime
().
getTime
()>=
repelManagementVo
.
getTime
()&&
deviceLibrary
.
getUpdateTime
().
getTime
()<=
repelManagementVo
.
getEndTime
())).
collect
(
Collectors
.
toList
()));
}
@Override
public
List
<
DeviceLibrary
>
toRepelListDev
(
RepelManagementVo
repelManagementVo
)
{
return
null
;
}
private
List
<
ModelNameGroup
>
toModelNameGroup
(
List
<
DeviceLibrary
>
deviceLibraries
){
Map
<
String
,
ModelNameGroup
>
modelNameGroupMap
=
new
HashMap
<>();
deviceLibraries
.
forEach
(
...
...
@@ -180,7 +191,8 @@ public class RepelQueryServiceImpl implements RepelQueryService {
@Override
public
List
<
ModelNameGroup
>
clearedList
(
RepelManagementVo
repelManagementVo
)
{
new
Date
(
repelManagementVo
.
getTime
());
return
toModelNameGroup
(
repelDetailService
.
findYearAndUnitToDeviceList
(
new
Date
(
repelManagementVo
.
getTime
()),
new
Date
(
repelManagementVo
.
getEndTime
()),
repelManagementVo
.
getUnitId
()));
// return toModelNameGroup(repelDetailService.findYearAndUnitToDeviceList(new Date(repelManagementVo.getTime()),new Date(repelManagementVo.getEndTime()),repelManagementVo.getUnitId()));
return
new
ArrayList
<>();
}
@Override
...
...
@@ -297,6 +309,24 @@ public class RepelQueryServiceImpl implements RepelQueryService {
);
return
new
DeviceChooseRepel
(
deviceLibraries
,
deviceLibrariesAbnormal
,
1
);
}
//装备有现成的接口直接调用
@Override
public
PagingVo
findRetired
(
RepelManagementVo
repelManagementVo
)
{
Page
<
DeviceLibrary
>
page
=
deviceLibraryDao
.
findAll
(
getFindRetiredSpecification
(
repelManagementVo
),
repelManagementVo
.
getPageable
());
return
PagingVo
.
builder
()
.
data
(
page
.
getContent
().
stream
().
map
(
DeviceLibrary:
:
setConfigName
).
collect
(
Collectors
.
toList
())).
page
(
repelManagementVo
.
getPage
())
.
size
(
repelManagementVo
.
getSize
()).
total
((
int
)
page
.
getTotalElements
()).
build
();
}
private
Specification
<
DeviceLibrary
>
getFindRetiredSpecification
(
RepelManagementVo
repelManagementVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
repelManagementVo
);
// List<Integer> leftStatus=new ArrayList<>();
// leftStatus.add(com.tykj.dev.config.base.DeviceLifeStatus.RETIRED.id);
predicateBuilder
.
in
(
"lifeStatus"
,
com
.
tykj
.
dev
.
config
.
base
.
DeviceLifeStatus
.
RETIRED
.
id
);
return
predicateBuilder
.
build
();
}
private
DevRepelVo
devRepelVo
(
DeviceLibrary
deviceLibrary
){
return
new
DevRepelVo
(
deviceLibrary
.
getId
(),
deviceLibrary
.
getName
(),
deviceLibrary
.
getModel
(),
deviceLibrary
.
getSeqNumber
(),
deviceLibrary
.
getType
(),
deviceLibrary
.
getTypeName
(),
deviceLibrary
.
getUpdateTime
());
...
...
@@ -314,4 +344,133 @@ public class RepelQueryServiceImpl implements RepelQueryService {
}
}
/**
* 查询已清退装备列表
*/
@Override
public
PagingVo
retiredDeviceList
(
RepelManagementVo
repelManagementVo
)
{
Page
<
DeviceLibrary
>
page
=
deviceLibraryDao
.
findAll
(
getRetiredSpecification
(
repelManagementVo
),
repelManagementVo
.
getPageable
());
return
PagingVo
.
builder
()
.
data
(
page
.
getContent
().
stream
().
map
(
DeviceLibrary:
:
setConfigName
).
collect
(
Collectors
.
toList
())).
page
(
repelManagementVo
.
getPage
())
.
size
(
repelManagementVo
.
getSize
()).
total
((
int
)
page
.
getTotalElements
()).
build
();
}
private
Specification
<
DeviceLibrary
>
getRetiredSpecification
(
RepelManagementVo
repelManagementVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
repelManagementVo
);
predicateBuilder
.
in
(
"lifeStatus"
,
DeviceLifeStatus
.
REPEL
.
id
);
return
predicateBuilder
.
build
();
}
/**
* 查询已清退装备列表
*/
@Override
public
PagingVo
clearedDeviceList
(
RepelManagementVo
repelManagementVo
)
{
Page
<
DeviceLibrary
>
page
=
deviceLibraryDao
.
findAll
(
getClearedSpecification
(
repelManagementVo
),
repelManagementVo
.
getPageable
());
return
PagingVo
.
builder
()
.
data
(
page
.
getContent
().
stream
().
map
(
DeviceLibrary:
:
setConfigName
).
collect
(
Collectors
.
toList
())).
page
(
repelManagementVo
.
getPage
())
.
size
(
repelManagementVo
.
getSize
()).
total
((
int
)
page
.
getTotalElements
()).
build
();
}
private
Specification
<
DeviceLibrary
>
getClearedSpecification
(
RepelManagementVo
repelManagementVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
repelManagementVo
);
//unitId为空,默认查询当前单位
predicateBuilder
.
in
(
"id"
,
repelDetailService
.
findYearAndUnitToDeviceList
(
new
Date
(
repelManagementVo
.
getTime
()),
new
Date
(
repelManagementVo
.
getEndTime
()),
repelManagementVo
.
getUnitId
()));
return
predicateBuilder
.
build
();
}
/**
* 查询待退役列表
* @param repelManagementVo 条件对象
* @return 退役对象
*/
@Override
public
PagingVo
toBeRetiredDeviceList
(
RepelManagementVo
repelManagementVo
)
{
Page
<
DeviceLibrary
>
page
=
deviceLibraryDao
.
findAll
(
getSelectSpecification
(
repelManagementVo
),
repelManagementVo
.
getPageable
());
// deviceLibraryDao.findAll(getSelectSpecification(repelManagementVo),repelManagementVo.getPageable())
// deviceLibrarySelectVo.setLifeStatus(leftStatus);
return
PagingVo
.
builder
()
.
data
(
page
.
getContent
().
stream
().
map
(
DeviceLibrary:
:
setConfigName
).
collect
(
Collectors
.
toList
())).
page
(
repelManagementVo
.
getPage
())
.
size
(
repelManagementVo
.
getSize
()).
total
((
int
)
page
.
getTotalElements
()).
build
();
}
private
Specification
<
DeviceLibrary
>
getSelectSpecification
(
RepelManagementVo
repelManagementVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
repelManagementVo
);
//unitId为空,默认查询当前单位
// List<Integer> leftStatus=new ArrayList<>();
// leftStatus.add(DeviceLifeStatus.REPEL.id);
predicateBuilder
.
eq
(
"lifeStatus"
,
DeviceLifeStatus
.
REPEL
.
id
);
predicateBuilder
.
eq
(
"locationUnit"
,
repelManagementVo
.
getUnitName
());
predicateBuilder
.
eq
(
"ownUnit"
,
repelManagementVo
.
getUnitName
());
return
predicateBuilder
.
build
();
}
private
PredicateBuilder
<
DeviceLibrary
>
getPredicateBuilder
(
RepelManagementVo
repelManagementVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
Specifications
.
and
();
if
(
repelManagementVo
!=
null
)
{
if
(
repelManagementVo
.
getModel
()
!=
null
)
{
predicateBuilder
.
eq
(
"model"
,
repelManagementVo
.
getModel
());
}
if
(
repelManagementVo
.
getName
()
!=
null
)
{
predicateBuilder
.
eq
(
"name"
,
repelManagementVo
.
getName
());
}
if
(
repelManagementVo
.
getSecretLevel
()
!=
null
)
{
predicateBuilder
.
eq
(
"secretLevel"
,
repelManagementVo
.
getSecretLevel
());
}
if
(
repelManagementVo
.
getMatchingRange
()
!=
null
)
{
predicateBuilder
.
eq
(
"matchingRange"
,
repelManagementVo
.
getMatchingRange
());
}
if
(
repelManagementVo
.
getStorageType
()
!=
null
)
{
predicateBuilder
.
eq
(
"storageType"
,
repelManagementVo
.
getStorageType
());
}
if
(
repelManagementVo
.
getManageStatus
()
!=
null
)
{
predicateBuilder
.
eq
(
"manageStatus"
,
repelManagementVo
.
getManageStatus
());
}
if
(
repelManagementVo
.
getInvisibleRange
()
!=
null
)
{
predicateBuilder
.
eq
(
"invisibleRange"
,
repelManagementVo
.
getInvisibleRange
());
}
// if (repelManagementVo.getTime()!=null){
// predicateBuilder.gt("updateTime",new Date(repelManagementVo.getTime()));
// }
// if (repelManagementVo.getEndTime()!=null){
// predicateBuilder.lt("updateTime",new Date(repelManagementVo.getEndTime()));
//
// }
if
(
repelManagementVo
.
getContent
()
!=
null
)
{
Class
<
DeviceLibrary
>
deviceLibraryEntity
=
DeviceLibrary
.
class
;
Field
[]
declaredFields
=
deviceLibraryEntity
.
getDeclaredFields
();
PredicateBuilder
<
DeviceLibrary
>
p
=
Specifications
.
or
();
for
(
Field
field
:
declaredFields
)
{
if
(
field
.
getType
().
equals
(
String
.
class
)
&&
field
.
getAnnotation
(
Transient
.
class
)
==
null
)
{
p
.
like
(
field
.
getName
(),
"%"
+
repelManagementVo
.
getContent
()
+
"%"
);
}
}
predicateBuilder
.
predicate
(
p
.
build
());
}
// if (repelManagementVo.getEndTime() != null) {
// predicateBuilder.lt("updateTime", repelManagementVo.getEndTime());
// }
}
return
predicateBuilder
;
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelTaskStatisticalServiceImpl.java
浏览文件 @
f6a7fc82
...
...
@@ -45,11 +45,13 @@ public class RepelTaskStatisticalServiceImpl implements RepelTaskStatisticalServ
return
list
;
}
@Override
public
void
saveAllRepelTaskStatistical
(
List
<
RepelTaskStatistical
>
repelTaskStatisticalList
)
{
repelTaskStatisticalDao
.
saveAll
(
repelTaskStatisticalList
);
}
@Override
public
RepelTaskStatistical
findRepelTaskStatistical
(
Integer
taskId
,
Integer
repelId
)
{
return
repelTaskStatisticalDao
.
findByTaskIdAndAndRepelId
(
taskId
,
repelId
);
...
...
dev-task/src/main/java/com/tykj/dev/device/task/repository/TaskDao.java
浏览文件 @
f6a7fc82
package
com
.
tykj
.
dev
.
device
.
task
.
repository
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
...
...
@@ -55,8 +56,7 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE
@Query
(
"select o.billId from Task o where o.id=?1 and o.businessType=?2"
)
Integer
findBillId
(
int
id
,
int
businessType
);
@Query
(
"select o.billId from Task o where o.parentTaskId = ?1 and o. businessType = ?2"
)
Integer
findBillIdByParentId
(
int
parentTaskId
,
int
businessType
);
TaskBto
findByParentTaskIdAndBusinessType
(
int
parentTaskId
,
int
businessType
);
List
<
Task
>
findTaskEntitiesByParentTaskIdAndAndBusinessType
(
Integer
parentTaskId
,
Integer
businessType
);
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/TaskService.java
浏览文件 @
f6a7fc82
...
...
@@ -187,4 +187,9 @@ public interface TaskService {
* 将父Task所有子Task办结
*/
void
moveAllSonNodeToEnd
(
Integer
taaskId
);
/**
* 根据上级id以及billType 查询task
*/
TaskBto
findBillTypeAndFatherId
(
Integer
billType
,
Integer
fatherId
);
}
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
f6a7fc82
...
...
@@ -21,6 +21,7 @@ import com.tykj.dev.device.user.subject.entity.User;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.CustomOrder
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
...
...
@@ -789,6 +790,12 @@ public class TaskServiceImpl implements TaskService {
return
taskDao
.
findAllByBusinessType
(
billType
).
stream
().
map
(
Task:
:
parse2Bto
).
collect
(
Collectors
.
toList
());
}
@Override
public
TaskBto
findBillTypeAndFatherId
(
Integer
billType
,
Integer
fatherId
)
{
return
taskDao
.
findByParentTaskIdAndBusinessType
(
fatherId
,
billType
);
}
@Override
public
void
moveAllSonNodeToEnd
(
Integer
taaskId
)
{
List
<
Task
>
tasks
=
taskDao
.
findAllByParentTaskId
(
taaskId
);
...
...
dev-user/src/main/java/com/tykj/dev/device/user/config/MyFilter.java
浏览文件 @
f6a7fc82
...
...
@@ -5,6 +5,7 @@ import com.tykj.dev.device.user.subject.dao.UserDao;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.VenitalisService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
...
...
@@ -23,6 +24,7 @@ import java.util.Map;
/**
* @author zjm
*/
@Slf4j
public
class
MyFilter
extends
UsernamePasswordAuthenticationFilter
{
@Autowired
SessionRegistry
sessionRegistry
;
...
...
@@ -73,6 +75,13 @@ public class MyFilter extends UsernamePasswordAuthenticationFilter {
SecurityUser
principal
=
new
SecurityUser
();
principal
.
setUsername
(
username
);
sessionRegistry
.
registerNewSession
(
request
.
getSession
(
true
).
getId
(),
principal
);
log
.
info
(
"session:{}"
,
request
.
getSession
(
true
).
getId
());
// sessionRegistry.getAllPrincipals().forEach(
// u->{
// log.info("see对应{}",u);
// log.info("see-id:{}",sessionRegistry.getAllSessions(u, false).get(0).getSessionId());
// }
// );
return
this
.
getAuthenticationManager
().
authenticate
(
authRequest
);
}
else
{
SecurityUser
principal
=
new
SecurityUser
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论