Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
e7640063
提交
e7640063
authored
9月 15, 2020
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改了编译错误的部分
上级
53210662
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
33 个修改的文件
包含
364 行增加
和
340 行删除
+364
-340
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+18
-20
AllotBillSelectController.java
...ev/device/allot/controller/AllotBillSelectController.java
+6
-7
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+14
-14
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+15
-15
DeviceDestroyController.java
...ev/device/destroy/controller/DeviceDestroyController.java
+5
-6
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+14
-12
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+3
-3
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+23
-26
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+13
-13
PackingLibraryController.java
...v/device/packing/controller/PackingLibraryController.java
+19
-19
RepairBillSelectController.java
.../device/repair/controller/RepairBillSelectController.java
+3
-5
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+0
-0
DeviceRetiredController.java
...ev/device/retired/controller/DeviceRetiredController.java
+13
-13
DeviceScrapController.java
...ice/device-scrap/src/main/java/DeviceScrapController.java
+18
-20
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+18
-18
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+10
-10
TaskController.java
...a/com/tykj/dev/device/task/controller/TaskController.java
+24
-25
TaskSelectController.java
...ev/device/taskselect/controller/TaskSelectController.java
+3
-4
HandoverController.java
.../tykj/dev/device/train/controller/HandoverController.java
+2
-4
TrainController.java
...com/tykj/dev/device/train/controller/TrainController.java
+5
-6
TrainJobController.java
.../tykj/dev/device/train/controller/TrainJobController.java
+0
-0
AreaController.java
...kj/dev/device/user/subject/controller/AreaController.java
+2
-8
PermissionsController.java
...device/user/subject/controller/PermissionsController.java
+5
-8
RoleController.java
...kj/dev/device/user/subject/controller/RoleController.java
+13
-14
UnitsController.java
...j/dev/device/user/subject/controller/UnitsController.java
+6
-10
UserArchivesController.java
...evice/user/subject/controller/UserArchivesController.java
+3
-8
UserController.java
...kj/dev/device/user/subject/controller/UserController.java
+18
-20
UserRoleController.java
...ev/device/user/subject/controller/UserRoleController.java
+4
-4
DeviceUseReportController.java
...evice/usereport/controller/DeviceUseReportController.java
+9
-9
ResultUtil.java
...isc/src/main/java/com/tykj/dev/misc/utils/ResultUtil.java
+15
-15
RfidController.java
...ain/java/com/tykj/dev/rfid/controller/RfidController.java
+0
-0
DeviceCheckControllerTest.java
.../com/tykj/dev/confirmcheck/DeviceCheckControllerTest.java
+45
-4
MockTest.java
dev-union/src/test/java/com/tykj/dev/union/MockTest.java
+18
-0
没有找到文件。
dev-device/device-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
e7640063
...
...
@@ -11,17 +11,16 @@ 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.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.bto.TaskLogBto
;
import
com.tykj.dev.device.task.subject.common.StatusEnum
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.TimestampUtil
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
...
...
@@ -36,7 +35,6 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -72,9 +70,9 @@ public class AllotBillController {
@Autowired
private
MyWebSocket
myWebSocket
;
@ApiOperation
(
value
=
"发起配发业务"
,
notes
=
"可以通过这个接口发起配发任务"
)
@ApiOperation
(
value
=
"发起配发业务"
,
notes
=
"可以通过这个接口发起配发任务"
)
@PostMapping
(
value
=
"/addAllotBill"
)
public
ResponseEntity
<
ResultObj
>
addAllotBill
(
@RequestBody
AllotBillSaveVo
allotBillSaveVo
)
{
public
ResponseEntity
addAllotBill
(
@RequestBody
AllotBillSaveVo
allotBillSaveVo
)
{
//1.添加配发单
AllotBill
a
=
allotBillSaveVo
.
toDo
();
a
.
setSendUseraId
(
userUtils
.
getCurrentUserId
());
...
...
@@ -82,7 +80,7 @@ public class AllotBillController {
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
allotBillEntity
.
getCreateTime
());
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
String
num
=
"NO:第"
+
year
+
"PF"
+
allotBillEntity
.
getId
()+
"号"
;
String
num
=
"NO:第"
+
year
+
"PF"
+
allotBillEntity
.
getId
()
+
"号"
;
allotBillEntity
.
setNum
(
num
);
allotBillService
.
update
(
allotBillEntity
);
Integer
billId
=
allotBillEntity
.
getId
();
...
...
@@ -112,19 +110,19 @@ public class AllotBillController {
return
ResponseEntity
.
ok
(
new
ResultObj
(
allotBillEntity
,
"发起成功"
));
}
@ApiOperation
(
value
=
"配发审核"
,
notes
=
"可以通过这个接口对配发审核"
)
@ApiOperation
(
value
=
"配发审核"
,
notes
=
"可以通过这个接口对配发审核"
)
@PostMapping
(
value
=
"/allotConfirm"
)
public
ResponseEntity
<
String
>
allotConfirm
(
@RequestBody
AllotBillConfirmVo
allotBillConfirmVo
)
{
public
ResponseEntity
allotConfirm
(
@RequestBody
AllotBillConfirmVo
allotBillConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
allotBillConfirmVo
.
getTaskId
());
//1.审核通过,改变装备状态,审核任务完成,发起新的配发接收任务
if
(
allotBillConfirmVo
.
getStatus
()
==
0
)
{
if
(
allotBillConfirmVo
.
getStatus
()
==
0
)
{
//更新账单状态
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
taskBto
.
getBillId
());
allotBillEntity
.
setAllotStatus
(
2
);
allotBillEntity
.
setSendTime
(
TimestampUtil
.
getCurrentTimestamp
());
allotBillService
.
update
(
allotBillEntity
);
//task推至下一阶段
TaskBto
taskBto1
=
taskService
.
moveToNext
(
taskBto
,
allotBillEntity
.
getReceiveUseraId
());
TaskBto
taskBto1
=
taskService
.
moveToNext
(
taskBto
,
allotBillEntity
.
getReceiveUseraId
());
taskBto1
.
setOwnUnit
(
userPublicService
.
findUnitIdByName
(
allotBillEntity
.
getReceiveUnit
()));
taskService
.
update
(
taskBto1
);
//存业务日志
...
...
@@ -178,18 +176,18 @@ public class AllotBillController {
}
}
@ApiOperation
(
value
=
"接收配发装备"
,
notes
=
"可以通过这个接口接收配发装备"
)
@ApiOperation
(
value
=
"接收配发装备"
,
notes
=
"可以通过这个接口接收配发装备"
)
@PostMapping
(
value
=
"/receiveDevice"
)
public
ResponseEntity
<
String
>
receiveDevice
(
@RequestBody
AllotReceiveVo
allotReceiveVo
)
{
public
ResponseEntity
receiveDevice
(
@RequestBody
AllotReceiveVo
allotReceiveVo
)
{
//获取当前任务,推至下一阶段
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveVo
.
getTaskId
());
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
allotReceiveVo
.
getReceiveUserbId
()));
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
allotReceiveVo
.
getReceiveUserbId
()));
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
taskBto
.
getBillId
());
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"配发单"
,
allotBillEntity
.
getBillFileName
(),
allotBillEntity
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
allotBillEntity
.
getReceiveFileName
(),
allotBillEntity
.
getReceiveFileUrl
()));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"接收并发起入库"
,
fileVoList
);
fileVoList
.
add
(
new
FileVo
(
"配发单"
,
allotBillEntity
.
getBillFileName
(),
allotBillEntity
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
allotBillEntity
.
getReceiveFileName
(),
allotBillEntity
.
getReceiveFileUrl
()));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"接收并发起入库"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto
);
//更新账单状态
allotBillEntity
.
setAllotStatus
(
3
);
...
...
@@ -230,19 +228,19 @@ public class AllotBillController {
return
ResponseEntity
.
ok
(
"配发接收入库"
);
}
@ApiOperation
(
value
=
"接收配发装备审核"
,
notes
=
"可以通过这个接口对接收配发装备审核"
)
@ApiOperation
(
value
=
"接收配发装备审核"
,
notes
=
"可以通过这个接口对接收配发装备审核"
)
@PostMapping
(
value
=
"/receiveConfirm"
)
public
ResponseEntity
<
String
>
receiveConfirm
(
@RequestBody
AllotReceiveConfirmVo
allotReceiveConfirmVo
)
{
public
ResponseEntity
receiveConfirm
(
@RequestBody
AllotReceiveConfirmVo
allotReceiveConfirmVo
)
{
//获取任务和账单
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveConfirmVo
.
getTaskId
());
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
taskBto
.
getBillId
());
String
deviceIdDetail
=
allotBillEntity
.
getReceiveCheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//审核通过
if
(
allotReceiveConfirmVo
.
getStatus
()==
0
)
{
if
(
allotReceiveConfirmVo
.
getStatus
()
==
0
)
{
//业务完结
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"审核成功并入库"
,
null
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"审核成功并入库"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//更新账单
allotBillEntity
.
setAllotStatus
(
5
);
...
...
dev-device/device-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillSelectController.java
浏览文件 @
e7640063
...
...
@@ -13,7 +13,6 @@ import com.tykj.dev.device.task.subject.bto.TaskBto;
import
com.tykj.dev.device.task.subject.common.BusinessEnum
;
import
com.tykj.dev.device.task.subject.vo.TaskLogUserVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -49,16 +48,16 @@ public class AllotBillSelectController {
@Autowired
private
TaskService
taskService
;
@ApiOperation
(
value
=
"查询配发单"
,
notes
=
"可以通过这个接口查询配发单"
)
@ApiOperation
(
value
=
"查询配发单"
,
notes
=
"可以通过这个接口查询配发单"
)
@PostMapping
(
value
=
"/archives/allot/summary"
)
public
ResponseEntity
<
Page
<
AllotBill
>>
selectAllotBill
(
@RequestBody
AllotBillSelectVo
allotBillSelectVo
)
{
Page
<
AllotBill
>
page
=
allotBillService
.
getPage
(
allotBillSelectVo
,
allotBillSelectVo
.
getPageable
());
public
ResponseEntity
selectAllotBill
(
@RequestBody
AllotBillSelectVo
allotBillSelectVo
)
{
Page
<
AllotBill
>
page
=
allotBillService
.
getPage
(
allotBillSelectVo
,
allotBillSelectVo
.
getPageable
());
return
ResponseEntity
.
ok
(
page
);
}
@ApiOperation
(
value
=
"查询配发单详情页"
,
notes
=
"可以通过这个接口查询配发单"
)
@ApiOperation
(
value
=
"查询配发单详情页"
,
notes
=
"可以通过这个接口查询配发单"
)
@GetMapping
(
value
=
"/archives/allot/detail/{id}"
)
public
ResponseEntity
<
AllotBillDetailVo
>
selectAllotBillDetail
(
@PathVariable
(
"id"
)
int
id
)
{
public
ResponseEntity
selectAllotBillDetail
(
@PathVariable
(
"id"
)
int
id
)
{
AllotBillDetailVo
allotBillDetailVo
=
new
AllotBillDetailVo
();
//获取taskBto
TaskBto
taskBto
=
taskService
.
get
(
id
,
BusinessEnum
.
ALLOT
.
id
);
...
...
@@ -66,7 +65,7 @@ public class AllotBillSelectController {
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
id
);
allotBillEntity
.
setSenderUserA
(
userService
.
getOne
(
allotBillEntity
.
getSendUseraId
()).
getName
());
allotBillEntity
.
setSenderUserB
(
userService
.
getOne
(
allotBillEntity
.
getSendUserbId
()).
getName
());
if
(
allotBillEntity
.
getReceiveUseraId
()
!=
null
)
{
if
(
allotBillEntity
.
getReceiveUseraId
()
!=
null
)
{
allotBillEntity
.
setReceiveUserA
(
userService
.
getOne
(
allotBillEntity
.
getReceiveUseraId
()).
getName
());
}
if
(
allotBillEntity
.
getReceiveUserbId
()!=
null
)
{
...
...
dev-device/device-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
e7640063
...
...
@@ -14,6 +14,7 @@ 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.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.packing.service.PackingLibraryService
;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.task.repository.TaskDao
;
...
...
@@ -24,7 +25,6 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import
com.tykj.dev.device.task.subject.common.BusinessEnum
;
import
com.tykj.dev.device.task.subject.common.StatusEnum
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.task.subject.vo.TaskLogUserVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
...
...
@@ -87,16 +87,16 @@ public class DeviceApplyController {
@Autowired
private
MyWebSocket
myWebSocket
;
@ApiOperation
(
value
=
"发起装备申请"
,
notes
=
"可以通过这个接口发起装备申请"
)
@ApiOperation
(
value
=
"发起装备申请"
,
notes
=
"可以通过这个接口发起装备申请"
)
@PostMapping
(
"/addDeviceApplyBill"
)
public
ResponseEntity
<
DeviceApplyBill
>
addDeviceApplyBill
(
@RequestBody
DeviceApplySaveVo
deviceApplySaveVo
)
{
public
ResponseEntity
addDeviceApplyBill
(
@RequestBody
DeviceApplySaveVo
deviceApplySaveVo
)
{
//添加申请单
DeviceApplyBill
deviceApplyBillEntity
=
deviceApplyBillService
.
addEntity
(
deviceApplySaveVo
.
toDo
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
//发起任务
TaskBto
taskBto
;
//指定批复人
if
(
deviceApplySaveVo
.
getReplyUseraId
()
!=
null
)
{
if
(
deviceApplySaveVo
.
getReplyUseraId
()
!=
null
)
{
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
deviceApplySaveVo
.
getReplyUseraId
());
...
...
@@ -117,18 +117,18 @@ public class DeviceApplyController {
return
ResponseEntity
.
ok
(
deviceApplyBillEntity
);
}
@ApiOperation
(
value
=
"装备申请批复"
,
notes
=
"可以通过这个接口批复"
)
@ApiOperation
(
value
=
"装备申请批复"
,
notes
=
"可以通过这个接口批复"
)
@PostMapping
(
"/replay"
)
public
ResponseEntity
<
TaskBto
>
addDeviceApplyBillReplay
(
@RequestBody
DeviceApplyConfirmVo
deviceApplyConfirmVo
)
{
public
ResponseEntity
addDeviceApplyBillReplay
(
@RequestBody
DeviceApplyConfirmVo
deviceApplyConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
deviceApplyConfirmVo
.
getTaskId
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
DeviceApplyBill
applyBillEntity
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
//如果修改了批复文号
if
(
deviceApplyConfirmVo
.
getReplyNumber
()
!=
null
)
{
if
(
deviceApplyConfirmVo
.
getReplyNumber
()
!=
null
)
{
applyBillEntity
.
setReplayNumber
(
deviceApplyConfirmVo
.
getReplyNumber
());
}
//批复驳回
if
(
deviceApplyConfirmVo
.
getStatus
()
==
1
)
{
if
(
deviceApplyConfirmVo
.
getStatus
()
==
1
)
{
applyBillEntity
.
setApplyStatus
(
1
);
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
deviceApplyBillService
.
update
(
applyBillEntity
);
...
...
@@ -159,9 +159,9 @@ public class DeviceApplyController {
}
}
@ApiOperation
(
value
=
"装备申请后发起配发"
,
notes
=
"可以通过这个接口装备申请后发起配发"
)
@ApiOperation
(
value
=
"装备申请后发起配发"
,
notes
=
"可以通过这个接口装备申请后发起配发"
)
@PostMapping
(
"/allot"
)
public
ResponseEntity
<
String
>
allot
(
@RequestBody
DeviceApplyAllotSaveVo
deviceApplyAllotSaveVo
)
{
public
ResponseEntity
allot
(
@RequestBody
DeviceApplyAllotSaveVo
deviceApplyAllotSaveVo
)
{
//获取配发的业务
TaskBto
taskBto
=
taskService
.
get
(
deviceApplyAllotSaveVo
.
getTaskId
());
//获取申请的业务
...
...
@@ -171,7 +171,7 @@ public class DeviceApplyController {
DeviceApplyBill
deviceApplyBillEntity
=
deviceApplyBillService
.
getOne
(
applyTask
.
getBillId
());
//添加配发单
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
taskBto
.
getBillId
());
BeanUtils
.
copyProperties
(
deviceApplyAllotSaveVo
,
allotBillEntity
);
BeanUtils
.
copyProperties
(
deviceApplyAllotSaveVo
,
allotBillEntity
);
allotBillEntity
.
setTitle
(
"申请后配发"
);
allotBillEntity
.
setSendUseraId
(
userId
);
allotBillEntity
.
setReceiveUseraId
(
applyTask
.
getCreateUserId
());
...
...
@@ -204,15 +204,15 @@ public class DeviceApplyController {
return
ResponseEntity
.
ok
(
"发起配发成功"
);
}
@ApiOperation
(
value
=
"查询申请任务详情"
,
notes
=
"可以通过这个接口查询申请任务详情"
)
@ApiOperation
(
value
=
"查询申请任务详情"
,
notes
=
"可以通过这个接口查询申请任务详情"
)
@GetMapping
(
value
=
"/detail/{billId}"
)
public
ResponseEntity
<
ApplyDetailVo
>
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
public
ResponseEntity
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
ApplyDetailVo
applyDetailVo
=
new
ApplyDetailVo
();
//获取业务
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
APPLY
.
id
);
//获取账单
DeviceApplyBill
deviceApplyBillEntity
=
deviceApplyBillService
.
getOne
(
billId
);
if
(
deviceApplyBillEntity
.
getApplyUseraId
()
!=
null
)
{
if
(
deviceApplyBillEntity
.
getApplyUseraId
()
!=
null
)
{
deviceApplyBillEntity
.
setApplyUser
(
userPublicService
.
getOne
(
deviceApplyBillEntity
.
getApplyUseraId
()).
getName
());
}
applyDetailVo
.
setDeviceApplyBill
(
deviceApplyBillEntity
);
...
...
dev-device/device-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
e7640063
...
...
@@ -80,13 +80,13 @@ public class DeviceCheckController {
@GetMapping
(
"/area/{fatherId}"
)
@ApiOperation
(
value
=
"查询指定区域下的所有区域信息"
)
public
ResponseEntity
<
ResultObj
>
findAreaUnderId
(
@PathVariable
Integer
fatherId
)
{
public
ResponseEntity
findAreaUnderId
(
@PathVariable
Integer
fatherId
)
{
return
ResponseEntity
.
ok
(
new
ResultObj
(
areaRepo
.
findByFatherId
(
fatherId
)));
}
@ApiOperation
(
value
=
"根据id查询核查统计数据"
,
notes
=
"可以通过这个接口查询核查统计数据"
)
@GetMapping
(
"/stat/{id}"
)
public
ResponseEntity
<
ResultObj
>
findStatById
(
@PathVariable
Integer
id
)
{
public
ResponseEntity
findStatById
(
@PathVariable
Integer
id
)
{
//还要查询出所有的
CheckStatVo
statVoList
=
statRepo
.
findById
(
id
)
.
map
(
DeviceCheckStat:
:
toVo
)
...
...
@@ -96,7 +96,7 @@ public class DeviceCheckController {
@ApiOperation
(
value
=
"根据id查询核查详情数据"
,
notes
=
"可以通过这个接口查询核查详情数据"
)
@GetMapping
(
"/detail/{id}"
)
public
ResponseEntity
<
ResultObj
>
findDetail
(
@PathVariable
Integer
id
)
{
public
ResponseEntity
findDetail
(
@PathVariable
Integer
id
)
{
CheckDetailVo
detailVoList
=
detailRepo
.
findById
(
id
)
.
map
(
transUtil:
:
CheckDetailDo2Vo
)
.
orElse
(
null
);
...
...
@@ -113,7 +113,7 @@ public class DeviceCheckController {
*/
@ApiOperation
(
value
=
"发起核查"
,
notes
=
"发起核查流程"
)
@PostMapping
(
"/check/bill"
)
public
ResponseEntity
<
ResultObj
>
startManualCheck
(
@RequestBody
CheckBillVo
billVo
)
{
public
ResponseEntity
startManualCheck
(
@RequestBody
CheckBillVo
billVo
)
{
// 1. 添加发起核查bill记录
DeviceCheckBillEntity
billDo
=
transUtil
.
checkBillVo2Do
(
billVo
);
billRepo
.
save
(
billDo
);
...
...
@@ -170,10 +170,10 @@ public class DeviceCheckController {
*/
@ApiOperation
(
value
=
"专管员A核查详情单"
)
@PutMapping
(
"/detail/A/{id}"
)
public
ResponseEntity
<
ResultObj
>
checkUserA
(
@PathVariable
Integer
id
,
@RequestParam
int
assignUserId
,
@RequestParam
String
checkResult
,
@RequestBody
DevLibVo
devLibVo
)
{
public
ResponseEntity
checkUserA
(
@PathVariable
Integer
id
,
@RequestParam
int
assignUserId
,
@RequestParam
String
checkResult
,
@RequestBody
DevLibVo
devLibVo
)
{
//1. 更新checkDetail
String
detailString
=
transUtil
.
devLib2String
(
devLibVo
.
getDevInLibrary
(),
devLibVo
.
getDevNotInLibrary
());
User
currentUser
=
Objects
.
requireNonNull
(
AuthenticationUtils
.
getAuthentication
()).
getCurrentUserInfo
();
...
...
@@ -191,10 +191,10 @@ public class DeviceCheckController {
*/
@ApiOperation
(
value
=
"专管员B核查详情单"
)
@PutMapping
(
"/detail/B/{id}"
)
public
ResponseEntity
<
ResultObj
>
checkUserB
(
@PathVariable
Integer
id
,
@RequestParam
int
checkStatus
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
int
checkUserAId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
int
checkUserBId
)
{
public
ResponseEntity
checkUserB
(
@PathVariable
Integer
id
,
@RequestParam
int
checkStatus
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
int
checkUserAId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
int
checkUserBId
)
{
if
(
checkStatus
==
0
)
{
return
ResponseEntity
.
status
(
400
).
body
(
new
ResultObj
(
"checkStatus不应该为0!"
));
...
...
@@ -237,8 +237,8 @@ public class DeviceCheckController {
@ApiOperation
(
value
=
"核查组A/B确认核查详情单"
)
@PutMapping
(
"/detail/C/{id}"
)
public
ResponseEntity
<
ResultObj
>
checkUserC
(
@PathVariable
Integer
id
,
@RequestParam
boolean
pass
)
{
public
ResponseEntity
checkUserC
(
@PathVariable
Integer
id
,
@RequestParam
boolean
pass
)
{
TaskBto
currentTask
=
taskService
.
get
(
id
,
CONFIRM_CHECK_DETAIL
.
id
);
DeviceCheckDetailEntity
currentDetail
=
detailRepo
.
findById
(
id
).
get
();
if
(
pass
)
{
...
...
@@ -289,7 +289,7 @@ public class DeviceCheckController {
@ApiOperation
(
value
=
"统计数据确认"
)
@PostMapping
(
"/stat/verify"
)
public
ResponseEntity
<
ResultObj
>
statConfirm
(
@RequestParam
int
statId
)
{
public
ResponseEntity
statConfirm
(
@RequestParam
int
statId
)
{
//将当前的统计task完结
TaskBto
currentTask
=
taskService
.
get
(
CONFIRM_CHECK_STAT
.
id
,
statId
);
currentTask
=
taskService
.
moveToEnd
(
currentTask
);
...
...
dev-device/device-destroy/src/main/java/com/tykj/dev/device/destroy/controller/DeviceDestroyController.java
浏览文件 @
e7640063
...
...
@@ -30,7 +30,6 @@ import io.swagger.annotations.ApiOperation;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -80,17 +79,17 @@ public class DeviceDestroyController {
@ApiOperation
(
value
=
"查询销毁单"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/summary"
)
public
ResponseEntity
<
Page
<
DeviceDestroyBill
>>
selectRepairBill
(
@RequestBody
DeviceDestroyBillSelectVo
deviceDestoryBillSelectVo
)
{
public
ResponseEntity
selectRepairBill
(
@RequestBody
DeviceDestroyBillSelectVo
deviceDestoryBillSelectVo
)
{
return
ResultUtil
.
success
(
deviceDestroyBillService
.
getPage
(
deviceDestoryBillSelectVo
,
deviceDestoryBillSelectVo
.
getPageable
()));
}
@ApiOperation
(
value
=
"提交销毁表单"
,
notes
=
"可以通过这个接口提交销毁表单发起销毁流程"
)
@PostMapping
(
value
=
"/form"
)
@Transactional
(
rollbackOn
=
Exception
.
class
)
public
ResponseEntity
<
String
>
selectRepairBill
(
@Validated
@RequestBody
DeviceDestroyFormVo
formVo
)
{
public
ResponseEntity
selectRepairBill
(
@Validated
@RequestBody
DeviceDestroyFormVo
formVo
)
{
//生成销毁账单
User
currentUserInfo
=
AuthenticationUtils
.
getAuthentication
().
getCurrentUserInfo
();
DeviceDestroyBill
destroyBill
=
DeviceDestroyBill
.
formVoToBill
(
formVo
,
currentUserInfo
);
DeviceDestroyBill
destroyBill
=
DeviceDestroyBill
.
formVoToBill
(
formVo
,
currentUserInfo
);
//保存销毁账单
DeviceDestroyBill
deviceDestroyBillEntitySaved
=
deviceDestroyBillService
.
addEntity
(
destroyBill
);
//生成日志所需的文件列表
...
...
@@ -123,7 +122,7 @@ public class DeviceDestroyController {
@ApiOperation
(
value
=
"查询销毁单详情"
,
notes
=
"可以通过这个接口查询销毁单"
)
@GetMapping
(
value
=
"/detail"
)
public
ResponseEntity
<
DeviceDestroyDetailResultVo
>
selectDestroyDetail
(
@Validated
@NotNull
Integer
destroyId
)
{
public
ResponseEntity
selectDestroyDetail
(
@Validated
@NotNull
Integer
destroyId
)
{
//装备文号
String
docNumber
;
DeviceDestroyDetailResultVo
destroyDetailResultVo
;
...
...
@@ -168,7 +167,7 @@ public class DeviceDestroyController {
@ApiOperation
(
value
=
"销毁出库单确认"
,
notes
=
"可以通过这个确认销毁单"
)
@PutMapping
(
value
=
"/confirmation"
)
@Transactional
public
ResponseEntity
<
DeviceDestroyDetailResultVo
>
confirmDestroy
(
@RequestBody
@Validated
DeviceDestroyConfirmVo
deviceDestoryConfirmVo
)
throws
ParseException
{
public
ResponseEntity
confirmDestroy
(
@RequestBody
@Validated
DeviceDestroyConfirmVo
deviceDestoryConfirmVo
)
throws
ParseException
{
//初始化需要的数据
TaskBto
task
=
taskService
.
get
(
deviceDestoryConfirmVo
.
getTaskId
());
DeviceDestroyBill
deviceDestroyBill
=
deviceDestroyBillService
.
getOne
(
task
.
getBillId
());
...
...
dev-device/device-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
e7640063
...
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.file.Controller;
import
com.itextpdf.text.Document
;
import
com.itextpdf.text.DocumentException
;
import
com.itextpdf.text.Image
;
import
com.itextpdf.text.Rectangle
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.file.entity.FileRet
;
...
...
@@ -16,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
org.springframework.web.multipart.MultipartRequest
;
import
com.itextpdf.text.Rectangle
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
...
...
@@ -39,17 +40,18 @@ public class FileController {
public
String
url
;
@Value
(
"${preview.path}"
)
public
String
preview
;
/**
* 文件上传
*/
@PostMapping
(
"/upload"
)
public
ResponseEntity
<
FileRet
>
upload
(
HttpServletRequest
request
)
{
MultipartRequest
multiRequest
=
(
MultipartRequest
)
request
;
public
ResponseEntity
upload
(
HttpServletRequest
request
)
{
MultipartRequest
multiRequest
=
(
MultipartRequest
)
request
;
MultipartFile
file
=
multiRequest
.
getFile
(
"file"
);
String
originalFilename
=
file
.
getOriginalFilename
();
System
.
out
.
println
(
originalFilename
);
File
file1
=
new
File
(
url
);
if
(!
file1
.
exists
()){
File
file1
=
new
File
(
url
);
if
(!
file1
.
exists
())
{
file1
.
mkdirs
();
}
FileOutputStream
fos
=
null
;
...
...
@@ -150,16 +152,16 @@ public class FileController {
}
@PostMapping
(
"/print/pdf"
)
public
ResponseEntity
<
FileRet
>
fileUpload
(
HttpServletRequest
request
)
throws
IOException
,
DocumentException
{
public
ResponseEntity
fileUpload
(
HttpServletRequest
request
)
throws
IOException
,
DocumentException
{
List
<
MultipartFile
>
multipartFiles
=
((
MultipartHttpServletRequest
)
request
).
getFiles
(
"file"
);
System
.
out
.
println
(
"数据条数"
+
multipartFiles
.
size
());
File
file1
=
new
File
(
url
+
"print/"
);
if
(!
file1
.
exists
()){
List
<
MultipartFile
>
multipartFiles
=
((
MultipartHttpServletRequest
)
request
).
getFiles
(
"file"
);
System
.
out
.
println
(
"数据条数"
+
multipartFiles
.
size
());
File
file1
=
new
File
(
url
+
"print/"
);
if
(!
file1
.
exists
())
{
file1
.
mkdirs
();
}
String
fileName
=
UUID
.
randomUUID
().
toString
()
+
".pdf"
;
File
file
=
new
File
(
url
+
"print/"
+
fileName
);
String
fileName
=
UUID
.
randomUUID
().
toString
()
+
".pdf"
;
File
file
=
new
File
(
url
+
"print/"
+
fileName
);
// 第一步:创建一个document对象。
Document
document
=
new
Document
();
...
...
dev-device/device-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
e7640063
...
...
@@ -232,11 +232,11 @@ public class DeviceLibraryController {
return
ResultUtil
.
success
(
deviceLibraryEntityList
);
}
@ApiOperation
(
value
=
"查询维修报废换新装备"
,
notes
=
"查询装备"
)
@ApiOperation
(
value
=
"查询维修报废换新装备"
,
notes
=
"查询装备"
)
@GetMapping
(
"/select/newChange/{id}"
)
public
ResponseEntity
<
List
<
DeviceLibrary
>>
selectNewChangeDevice
(
@PathVariable
(
"id"
)
int
id
)
{
public
ResponseEntity
selectNewChangeDevice
(
@PathVariable
(
"id"
)
int
id
)
{
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
id
);
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
getAllByTypeAndNameAndModel
(
deviceLibrary
.
getType
(),
deviceLibrary
.
getName
(),
deviceLibrary
.
getModel
());
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
getAllByTypeAndNameAndModel
(
deviceLibrary
.
getType
(),
deviceLibrary
.
getName
(),
deviceLibrary
.
getModel
());
return
ResultUtil
.
success
(
deviceLibraries
);
}
}
dev-device/device-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
e7640063
...
...
@@ -5,7 +5,6 @@ import com.tykj.dev.device.library.repository.DeviceLogDao;
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.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.vo.DeviceLogUserVo
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
...
...
@@ -21,9 +20,7 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import
com.tykj.dev.device.task.subject.common.BusinessEnum
;
import
com.tykj.dev.device.task.subject.common.StatusEnum
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
...
...
@@ -74,9 +71,9 @@ public class MatchingDeviceController {
@Autowired
private
MyWebSocket
myWebSocket
;
@ApiOperation
(
value
=
"添加配套设备"
,
notes
=
"可以通过这个接口添加配套设备"
)
@ApiOperation
(
value
=
"添加配套设备"
,
notes
=
"可以通过这个接口添加配套设备"
)
@PostMapping
(
value
=
"/add"
)
public
ResponseEntity
<
String
>
addStorageBill
(
@RequestBody
MatchingDeviceBillSaveVo
matchingDeviceBillSaveVo
)
{
public
ResponseEntity
addStorageBill
(
@RequestBody
MatchingDeviceBillSaveVo
matchingDeviceBillSaveVo
)
{
//添加账单
MatchingDeviceBill
matchingDeviceBillEntity
=
matchingDeviceBillSaveVo
.
toDo
();
MatchingDeviceBill
m
=
matchingDeviceBillService
.
addEntity
(
matchingDeviceBillEntity
);
...
...
@@ -110,15 +107,15 @@ public class MatchingDeviceController {
return
ResponseEntity
.
ok
(
"添加成功"
);
}
@ApiOperation
(
value
=
"添加配套设备审核"
,
notes
=
"可以通过这个接口添加配套设备审核"
)
@ApiOperation
(
value
=
"添加配套设备审核"
,
notes
=
"可以通过这个接口添加配套设备审核"
)
@PostMapping
(
value
=
"/confirm"
)
public
ResponseEntity
<
String
>
confirm
(
@RequestBody
MatchingDeviceBillConfirmVo
matchingDeviceBillConfirmVo
)
{
public
ResponseEntity
confirm
(
@RequestBody
MatchingDeviceBillConfirmVo
matchingDeviceBillConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
matchingDeviceBillConfirmVo
.
getTaskId
());
//1.审核成功,入库任务结束,改变装备状态
if
(
matchingDeviceBillConfirmVo
.
getStatus
()==
0
)
{
if
(
matchingDeviceBillConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//添加日业务志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"添加配套设备审核成功"
,
null
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"添加配套设备审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//更新账单状态
MatchingDeviceBill
matchingDeviceBillEntity
=
matchingDeviceBillService
.
getOne
(
taskBto
.
getBillId
());
...
...
@@ -167,32 +164,32 @@ public class MatchingDeviceController {
}
}
@ApiOperation
(
value
=
"模糊查询配套装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@ApiOperation
(
value
=
"模糊查询配套装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@PostMapping
(
"/feature/summary"
)
public
ResponseEntity
<
Page
<
MatchingDeviceLibrary
>>
getAll
(
@RequestBody
MatchingDeviceSelectVo
matchingDeviceSelectVo
)
{
Page
<
MatchingDeviceLibrary
>
page
=
matchingDeviceLibraryService
.
getPage
(
matchingDeviceSelectVo
,
matchingDeviceSelectVo
.
getPageable
());
public
ResponseEntity
getAll
(
@RequestBody
MatchingDeviceSelectVo
matchingDeviceSelectVo
)
{
Page
<
MatchingDeviceLibrary
>
page
=
matchingDeviceLibraryService
.
getPage
(
matchingDeviceSelectVo
,
matchingDeviceSelectVo
.
getPageable
());
//set关联装备的表面号
for
(
MatchingDeviceLibrary
m
:
page
.
getContent
())
{
if
(
m
.
getDeviceId
()
>
0
)
{
for
(
MatchingDeviceLibrary
m
:
page
.
getContent
())
{
if
(
m
.
getDeviceId
()
>
0
)
{
m
.
setRelateDevice
(
deviceLibraryService
.
getOne
(
m
.
getDeviceId
()).
getRfidSurfaceId
());
}
}
return
ResponseEntity
.
ok
(
page
);
}
@ApiOperation
(
value
=
"查询配套装备详情"
,
notes
=
"可以通过这个接口查询配套装备详情"
)
@ApiOperation
(
value
=
"查询配套装备详情"
,
notes
=
"可以通过这个接口查询配套装备详情"
)
@GetMapping
(
"/feature/detail/{id}"
)
public
ResponseEntity
<
MacthingDeviceDetailVo
>
getDetail
(
@PathVariable
(
"id"
)
int
id
)
{
public
ResponseEntity
getDetail
(
@PathVariable
(
"id"
)
int
id
)
{
MacthingDeviceDetailVo
macthingDeviceDetailVo
=
new
MacthingDeviceDetailVo
();
//添加配套设备详情
MatchingDeviceLibrary
m
=
matchingDeviceLibraryService
.
getOne
(
id
);
macthingDeviceDetailVo
.
setMatchingDeviceLibrary
(
m
);
//添加关联装备详情
if
(
m
.
getDeviceId
()
!=
0
)
{
if
(
m
.
getDeviceId
()
!=
0
)
{
macthingDeviceDetailVo
.
setDeviceLibrary
(
deviceLibraryService
.
getOne
(
m
.
getDeviceId
()));
}
//添加设备履历日志
List
<
DeviceLogUserVo
>
deviceLogs
=
deviceLogDao
.
getAllByDeviceIdAndType
(
id
,
1
).
stream
()
List
<
DeviceLogUserVo
>
deviceLogs
=
deviceLogDao
.
getAllByDeviceIdAndType
(
id
,
1
).
stream
()
.
map
(
DeviceLog:
:
parse2Dto
)
.
map
(
DeviceLogDto:
:
toVo
)
.
sorted
(
Comparator
.
comparing
(
DeviceLogUserVo:
:
getCreateTime
))
...
...
@@ -201,17 +198,17 @@ public class MatchingDeviceController {
return
ResponseEntity
.
ok
(
macthingDeviceDetailVo
);
}
@ApiOperation
(
value
=
"更新配套设备"
,
notes
=
"可以通过这个接口更新配套设备"
)
@ApiOperation
(
value
=
"更新配套设备"
,
notes
=
"可以通过这个接口更新配套设备"
)
@PostMapping
(
"/update"
)
public
ResponseEntity
<
String
>
update
(
@RequestBody
MatchingDeviceEditVo
matchingDeviceEditVo
)
{
public
ResponseEntity
update
(
@RequestBody
MatchingDeviceEditVo
matchingDeviceEditVo
)
{
MatchingDeviceLibrary
m
=
matchingDeviceLibraryService
.
getOne
(
matchingDeviceEditVo
.
getMatchingDeviceId
());
if
(
matchingDeviceEditVo
.
getCreateUnit
()
!=
null
)
{
if
(
matchingDeviceEditVo
.
getCreateUnit
()
!=
null
)
{
m
.
setCreateUnit
(
matchingDeviceEditVo
.
getCreateUnit
());
}
if
(
matchingDeviceEditVo
.
getLifeStatus
()
!=
null
)
{
if
(
matchingDeviceEditVo
.
getLifeStatus
()
!=
null
)
{
m
.
setLifeStatus
(
matchingDeviceEditVo
.
getLifeStatus
());
}
if
(
matchingDeviceEditVo
.
getDeviceId
()
!=
null
&&
m
.
getDeviceId
()==
0
)
{
if
(
matchingDeviceEditVo
.
getDeviceId
()
!=
null
&&
m
.
getDeviceId
()
==
0
)
{
m
.
setDeviceId
(
matchingDeviceEditVo
.
getDeviceId
());
}
if
(
matchingDeviceEditVo
.
getModel
()!=
null
){
...
...
@@ -230,9 +227,9 @@ public class MatchingDeviceController {
return
ResponseEntity
.
ok
(
"修改成功"
);
}
@ApiOperation
(
value
=
"查询新增配套任务详情"
,
notes
=
"可以通过这个接口查询新增配套任务详情"
)
@ApiOperation
(
value
=
"查询新增配套任务详情"
,
notes
=
"可以通过这个接口查询新增配套任务详情"
)
@GetMapping
(
value
=
"/detail/{billId}"
)
public
ResponseEntity
<
MacthingDetailVo
>
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
public
ResponseEntity
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
MacthingDetailVo
macthingDetailVo
=
new
MacthingDetailVo
();
//获取业务
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
ADD_MATCHING_DEVICE
.
id
);
...
...
@@ -242,7 +239,7 @@ public class MatchingDeviceController {
//获取设备
List
<
Integer
>
integerList
=
StringSplitUtil
.
userIdSplit
(
matchingDeviceBillEntity
.
getDeviceDetail
());
List
<
MatchingDeviceLibrary
>
matchingDeviceLibraryEntities
=
new
ArrayList
<>();
if
(
integerList
.
size
()
>
0
)
{
if
(
integerList
.
size
()
>
0
)
{
for
(
Integer
id:
integerList
)
{
if
(
id
>
0
){
matchingDeviceLibraryEntities
.
add
(
matchingDeviceLibraryService
.
getOne
(
id
));
...
...
dev-device/device-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
e7640063
...
...
@@ -53,18 +53,18 @@ public class PackingController {
@Autowired
MyWebSocket
myWebSocket
;
@ApiOperation
(
value
=
"新增列装"
,
notes
=
"可以通过这个接口发起列装"
)
@ApiOperation
(
value
=
"新增列装"
,
notes
=
"可以通过这个接口发起列装"
)
@PostMapping
(
"/addPackingLibrary"
)
public
ResponseEntity
<
PackingLibrary
>
addPackingLibrary
(
@RequestBody
PackingLibrarySaveVo
packingLibrarySaveVo
)
{
public
ResponseEntity
addPackingLibrary
(
@RequestBody
PackingLibrarySaveVo
packingLibrarySaveVo
)
{
//添加列装装备信息
PackingLibrary
p
=
packingLibrarySaveVo
.
toDo
();
p
.
setUseraId
(
userUtils
.
getCurrentUserId
());
PackingLibrary
packingLibraryEntity
=
packingLibraryService
.
addEntity
(
p
);
//添加列装配件信息
for
(
PartSaveVo
part
:
packingLibrarySaveVo
.
getPartList
())
{
for
(
PartSaveVo
part
:
packingLibrarySaveVo
.
getPartList
())
{
PackingLibrary
p2
=
new
PackingLibrary
();
BeanUtils
.
copyProperties
(
p
,
p2
);
BeanUtils
.
copyProperties
(
part
,
p2
);
BeanUtils
.
copyProperties
(
p
,
p2
);
BeanUtils
.
copyProperties
(
part
,
p2
);
p2
.
setId
(
null
);
p2
.
setIsPart
(
1
);
p2
.
setPartParentId
(
packingLibraryEntity
.
getId
());
...
...
@@ -84,18 +84,18 @@ public class PackingController {
return
ResultUtil
.
success
(
packingLibraryEntity
);
}
@ApiOperation
(
value
=
"列装审核"
,
notes
=
"可以通过这个接口进行列装审核"
)
@ApiOperation
(
value
=
"列装审核"
,
notes
=
"可以通过这个接口进行列装审核"
)
@PostMapping
(
"/confirmPackingLibrary"
)
public
ResponseEntity
<
String
>
confirmPackingLibrary
(
@RequestBody
PackingLibraryConfirmVo
packingLibraryConfirmVo
)
{
public
ResponseEntity
confirmPackingLibrary
(
@RequestBody
PackingLibraryConfirmVo
packingLibraryConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
packingLibraryConfirmVo
.
getTaskId
());
//审核通过
if
(
packingLibraryConfirmVo
.
getStatus
()==
0
)
{
if
(
packingLibraryConfirmVo
.
getStatus
()
==
0
)
{
//业务完结
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//更改列装装备和配件的状态
PackingLibrary
packingLibraryEntity
=
packingLibraryService
.
getOne
(
taskBto
.
getBillId
());
packingLibraryEntity
.
setPackingStatus
(
2
);
for
(
PackingLibrary
p
:
packingLibraryService
.
selectAllPart
(
taskBto
.
getBillId
()))
{
for
(
PackingLibrary
p
:
packingLibraryService
.
selectAllPart
(
taskBto
.
getBillId
()))
{
p
.
setPackingStatus
(
2
);
packingLibraryService
.
update
(
p
);
}
...
...
@@ -129,19 +129,19 @@ public class PackingController {
}
}
@ApiOperation
(
value
=
"查询列装详情"
,
notes
=
"可以通过这个接口查询列装详情"
)
@ApiOperation
(
value
=
"查询列装详情"
,
notes
=
"可以通过这个接口查询列装详情"
)
@GetMapping
(
value
=
"/detail/{billId}"
)
public
ResponseEntity
<
PackingDetailVo
>
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
public
ResponseEntity
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
PackingDetailVo
packingDetailVo
=
new
PackingDetailVo
();
//获取taskBto
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
PACKING
.
id
);
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
PACKING
.
id
);
//获取列装主件
PackingLibrary
packingLibraryEntity
=
packingLibraryService
.
getOne
(
billId
);
packingLibraryEntity
.
setUserA
(
userPublicService
.
getOne
(
packingLibraryEntity
.
getUseraId
()).
getName
());
packingLibraryEntity
.
setUserB
(
userPublicService
.
getOne
(
packingLibraryEntity
.
getUserbId
()).
getName
());
packingDetailVo
.
setPackingLibrary
(
packingLibraryEntity
);
//获取所有配件
List
<
PackingLibrary
>
packingLibraryEntities
=
packingLibraryService
.
selectAllPart
(
billId
);
List
<
PackingLibrary
>
packingLibraryEntities
=
packingLibraryService
.
selectAllPart
(
billId
);
packingDetailVo
.
setParts
(
packingLibraryEntities
);
//获取业务日志
List
<
TaskLogUserVo
>
taskLogUserVos
=
taskLogService
.
getByTaskId
(
taskBto
.
getId
());
...
...
dev-device/device-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingLibraryController.java
浏览文件 @
e7640063
...
...
@@ -30,39 +30,39 @@ public class PackingLibraryController {
@Autowired
PackingLibraryService
packingLibraryService
;
@ApiOperation
(
value
=
"列装库分页查询"
,
notes
=
"可以通过这个接口进行列装查询"
)
@ApiOperation
(
value
=
"列装库分页查询"
,
notes
=
"可以通过这个接口进行列装查询"
)
@PostMapping
(
"/serve/summary"
)
public
ResponseEntity
<
Page
<
PackingLibrary
>>
getPage
(
@RequestBody
PackingLibrarySelectVo
packingLibrarySelectVo
)
{
public
ResponseEntity
getPage
(
@RequestBody
PackingLibrarySelectVo
packingLibrarySelectVo
)
{
Page
<
PackingLibrary
>
packingLibraryEntityPage
=
packingLibraryService
.
getPage
(
packingLibrarySelectVo
,
packingLibrarySelectVo
.
getPageable
());
return
ResultUtil
.
success
(
packingLibraryEntityPage
);
}
@ApiOperation
(
value
=
"列装库退装分页查询"
,
notes
=
"可以通过这个接口进行列装查询"
)
@ApiOperation
(
value
=
"列装库退装分页查询"
,
notes
=
"可以通过这个接口进行列装查询"
)
@PostMapping
(
"/retired/summary"
)
public
ResponseEntity
<
Page
<
PackingLibrary
>>
getInvalidPage
(
@RequestBody
PackingLibrarySelectVo
packingLibrarySelectVo
)
{
public
ResponseEntity
getInvalidPage
(
@RequestBody
PackingLibrarySelectVo
packingLibrarySelectVo
)
{
Page
<
PackingLibrary
>
packingLibraryEntityPage
=
packingLibraryService
.
getInvalidPage
(
packingLibrarySelectVo
,
packingLibrarySelectVo
.
getPageable
());
return
ResultUtil
.
success
(
packingLibraryEntityPage
);
}
@ApiOperation
(
value
=
"列装库列表查询"
,
notes
=
"可以通过这个接口进行列装查询"
)
@ApiOperation
(
value
=
"列装库列表查询"
,
notes
=
"可以通过这个接口进行列装查询"
)
@PostMapping
(
"/getList"
)
public
ResponseEntity
<
List
<
PackingLibrary
>>
getList
(
@RequestBody
PackingLibrarySelectVo
packingLibrarySelectVo
)
{
public
ResponseEntity
getList
(
@RequestBody
PackingLibrarySelectVo
packingLibrarySelectVo
)
{
List
<
PackingLibrary
>
packingLibraryEntities
=
packingLibraryService
.
getList
(
packingLibrarySelectVo
);
return
ResultUtil
.
success
(
packingLibraryEntities
);
}
@ApiOperation
(
value
=
"更新列装库"
,
notes
=
"可以通过这个接口更新列装"
)
@ApiOperation
(
value
=
"更新列装库"
,
notes
=
"可以通过这个接口更新列装"
)
@PostMapping
(
"/updatePackingLibrary"
)
public
ResponseEntity
<
String
>
updatePackingLibrary
(
@RequestBody
PackingEditVo
packingEditVo
)
{
public
ResponseEntity
updatePackingLibrary
(
@RequestBody
PackingEditVo
packingEditVo
)
{
//更新列装信息
if
(
packingEditVo
.
getUpdateVoList
()
!=
null
)
{
if
(
packingEditVo
.
getUpdateVoList
()
!=
null
)
{
PackingLibrary
packingLibraryEntity
=
packingLibraryService
.
getOne
(
packingEditVo
.
getPackingId
());
PackingLibraryUpdateVo
p
=
packingEditVo
.
getUpdateVoList
();
if
(
p
.
getApplyType
()
!=
null
)
{
if
(
p
.
getApplyType
()
!=
null
)
{
packingLibraryEntity
.
setApplyType
(
p
.
getApplyType
());
}
if
(
p
.
getCreateUnit
()
!=
null
)
{
if
(
p
.
getCreateUnit
()
!=
null
)
{
packingLibraryEntity
.
setCreateUnit
(
p
.
getCreateUnit
());
}
if
(
p
.
getFileName
()!=
null
){
...
...
@@ -139,27 +139,27 @@ public class PackingLibraryController {
return
ResultUtil
.
success
(
"更新成功"
);
}
@ApiOperation
(
value
=
"查询存在的型号"
,
notes
=
"可以通过这个接口查询存在的型号"
)
@ApiOperation
(
value
=
"查询存在的型号"
,
notes
=
"可以通过这个接口查询存在的型号"
)
@GetMapping
(
"/selectAllMode"
)
public
ResponseEntity
<
List
<
String
>>
selectAllMode
()
{
public
ResponseEntity
selectAllMode
()
{
return
ResultUtil
.
success
(
packingLibraryService
.
getModelList
());
}
@ApiOperation
(
value
=
"查询存在的类型"
,
notes
=
"可以通过这个接口查询存在的类型"
)
@ApiOperation
(
value
=
"查询存在的类型"
,
notes
=
"可以通过这个接口查询存在的类型"
)
@GetMapping
(
"/selectAllType"
)
public
ResponseEntity
<
List
<
Integer
>>
selectAllType
()
{
public
ResponseEntity
selectAllType
()
{
return
ResultUtil
.
success
(
packingLibraryService
.
getTypeList
());
}
@ApiOperation
(
value
=
"查询列装库详情页"
,
notes
=
"可以通过这个接口查询存在的类型"
)
@ApiOperation
(
value
=
"查询列装库详情页"
,
notes
=
"可以通过这个接口查询存在的类型"
)
@GetMapping
(
"/serve/detail/{id}"
)
public
ResponseEntity
<
List
<
PackingLibrary
>>
selectPackingDetail
(
@PathVariable
(
"id"
)
int
id
)
{
public
ResponseEntity
selectPackingDetail
(
@PathVariable
(
"id"
)
int
id
)
{
return
ResultUtil
.
success
(
packingLibraryService
.
getPackingDetail
(
id
));
}
@ApiOperation
(
value
=
"查询退装详情页"
,
notes
=
"可以通过这个接口查询存在的类型"
)
@ApiOperation
(
value
=
"查询退装详情页"
,
notes
=
"可以通过这个接口查询存在的类型"
)
@GetMapping
(
"/retired/detail/{id}"
)
public
ResponseEntity
<
List
<
PackingLibrary
>>
selectInvalidDetail
(
@PathVariable
(
"id"
)
int
id
)
{
public
ResponseEntity
selectInvalidDetail
(
@PathVariable
(
"id"
)
int
id
)
{
return
ResultUtil
.
success
(
packingLibraryService
.
getInvalidDetail
(
id
));
}
}
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairBillSelectController.java
浏览文件 @
e7640063
...
...
@@ -2,13 +2,11 @@ package com.tykj.dev.device.repair.controller;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.repair.service.RepairBillService
;
import
com.tykj.dev.device.repair.subject.domin.RepairBill
;
import
com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -27,9 +25,9 @@ public class RepairBillSelectController {
@Autowired
private
RepairBillService
repairBillService
;
@ApiOperation
(
value
=
"查询维修单"
,
notes
=
"可以通过这个接口查询维修单"
)
@ApiOperation
(
value
=
"查询维修单"
,
notes
=
"可以通过这个接口查询维修单"
)
@PostMapping
(
value
=
"/archives/repair/summary"
)
public
ResponseEntity
<
Page
<
RepairBill
>>
selectRepairBill
(
@RequestBody
RepairBillSelectVo
repairBillSelectVo
)
{
return
ResultUtil
.
success
(
repairBillService
.
getPage
(
repairBillSelectVo
,
repairBillSelectVo
.
getPageable
()));
public
ResponseEntity
selectRepairBill
(
@RequestBody
RepairBillSelectVo
repairBillSelectVo
)
{
return
ResultUtil
.
success
(
repairBillService
.
getPage
(
repairBillSelectVo
,
repairBillSelectVo
.
getPageable
()));
}
}
dev-device/device-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
e7640063
差异被折叠。
点击展开。
dev-device/device-retired/src/main/java/com/tykj/dev/device/retired/controller/DeviceRetiredController.java
浏览文件 @
e7640063
...
...
@@ -9,7 +9,10 @@ import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
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.PackingLibrarySelectVo
;
import
com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill
;
import
com.tykj.dev.device.retired.entity.enums.RetiredStatus
;
import
com.tykj.dev.device.retired.entity.vo.*
;
import
com.tykj.dev.device.retired.service.DeviceRetiredBillService
;
import
com.tykj.dev.device.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
...
...
@@ -21,8 +24,6 @@ import com.tykj.dev.device.user.subject.entity.User;
import
com.tykj.dev.device.user.util.AuthenticationUtils
;
import
com.tykj.dev.misc.utils.ListUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill
;
import
com.tykj.dev.device.retired.entity.enums.RetiredStatus
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -31,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
com.tykj.dev.device.retired.service.DeviceRetiredBillService
;
import
javax.transaction.Transactional
;
import
java.sql.Timestamp
;
...
...
@@ -76,7 +76,7 @@ public class DeviceRetiredController {
@ApiOperation
(
value
=
"查询可退装装备"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/devices"
)
public
ResponseEntity
<
List
<
DeviceRetiredResultVo
>>
selectRepairBill
(
@RequestBody
CanRetiredDeviceSelectVo
canRetiredDeviceSelectVo
)
{
public
ResponseEntity
selectRepairBill
(
@RequestBody
CanRetiredDeviceSelectVo
canRetiredDeviceSelectVo
)
{
//最终返回的List<VO>
List
<
DeviceRetiredResultVo
>
deviceRetiredResultVos
=
new
ArrayList
<>();
//查询类构建
...
...
@@ -94,23 +94,23 @@ public class DeviceRetiredController {
@ApiOperation
(
value
=
"提交退装表单"
,
notes
=
"可以通过这个接口提交销毁表单发起退装流程"
)
@PostMapping
(
value
=
"/form"
)
@Transactional
(
rollbackOn
=
Exception
.
class
)
public
ResponseEntity
<
String
>
selectRepairBill
(
@Validated
@RequestBody
DeviceRetiredFormVo
formVo
)
{
public
ResponseEntity
selectRepairBill
(
@Validated
@RequestBody
DeviceRetiredFormVo
formVo
)
{
//生成销毁账单
User
currentUserInfo
=
Objects
.
requireNonNull
(
AuthenticationUtils
.
getAuthentication
()).
getCurrentUserInfo
();
DeviceRetiredBill
retiredBill
=
DeviceRetiredBill
.
formVoToBill
(
formVo
,
currentUserInfo
);
retiredBill
=
deviceRetiredBillService
.
addEntity
(
retiredBill
);
DeviceRetiredBill
retiredBill
=
DeviceRetiredBill
.
formVoToBill
(
formVo
,
currentUserInfo
);
retiredBill
=
deviceRetiredBillService
.
addEntity
(
retiredBill
);
//生成Task
Task
task
=
taskService
.
start
(
initTaskBto
(
retiredBill
));
//生成任务日志
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"发起退装"
,
null
));
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"退装待审核"
,
null
));
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"发起退装"
,
null
));
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"退装待审核"
,
null
));
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"退装申请成功"
);
}
@ApiOperation
(
value
=
"查询退装单详情"
,
notes
=
"可以通过这个接口查询退装单"
)
@GetMapping
(
value
=
"/detail"
)
public
ResponseEntity
<
DeviceRetiredDetailResultVo
>
selectDestoryDetail
(
Integer
retiredId
)
{
public
ResponseEntity
selectDestoryDetail
(
Integer
retiredId
)
{
DeviceRetiredDetailResultVo
deviceRetiredDetailResultVo
=
new
DeviceRetiredDetailResultVo
();
DeviceRetiredBill
deviceRetiredBillEntity
=
deviceRetiredBillService
.
getOne
(
retiredId
);
//获取销毁详情里的装备
...
...
@@ -125,15 +125,15 @@ public class DeviceRetiredController {
return
ResultUtil
.
success
(
deviceRetiredDetailResultVo
);
}
@ApiOperation
(
value
=
"退装出库单审核"
,
notes
=
"可以通过这个审核退装单"
)
@ApiOperation
(
value
=
"退装出库单审核"
,
notes
=
"可以通过这个审核退装单"
)
@PutMapping
(
value
=
"/confirmation"
)
@Transactional
public
ResponseEntity
<
DeviceRetiredDetailResultVo
>
confirmDestroy
(
@RequestBody
@Validated
DeviceRetiredConfirmVo
deviceRetiredConfirmVo
)
{
public
ResponseEntity
confirmDestroy
(
@RequestBody
@Validated
DeviceRetiredConfirmVo
deviceRetiredConfirmVo
)
{
//初始化需要的数据
TaskBto
task
=
taskService
.
get
(
deviceRetiredConfirmVo
.
getTaskId
());
DeviceRetiredBill
deviceRetiredBillEntity
=
deviceRetiredBillService
.
getOne
(
task
.
getBillId
());
//判断审核结果
if
(
deviceRetiredConfirmVo
.
getResult
()
==
1
)
{
if
(
deviceRetiredConfirmVo
.
getResult
()
==
1
)
{
//更改账单状态
deviceRetiredBillEntity
.
setRetiredStatus
(
RetiredStatus
.
CONFIRM_FAILED
.
getStatus
());
//将任务推进至封存
...
...
dev-device/device-scrap/src/main/java/DeviceScrapController.java
浏览文件 @
e7640063
...
...
@@ -17,17 +17,17 @@ import java.util.*;
public
class
DeviceScrapController
{
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"可以通过这个接口查询销毁单"
)
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/summary"
)
public
ResponseEntity
<
ScrapPage
>
selectRepairBill
(
@RequestBody
ScrapConditions
scrapConditions
)
{
List
<
ScrapListVo
>
listVos
=
new
ArrayList
<>();
Long
time
=
1598163550704L
;
listVos
.
add
(
new
ScrapListVo
(
1
,
"No2.2019号WX12"
,
"张馋"
,
"李思念"
,
"伸莎"
,
"MB-001,MC-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
2
,
"No2.2019号WX13"
,
"李生成"
,
"许仁"
,
"詹彻"
,
"MA-001,MP-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
3
,
"No2.2019号WX14"
,
"鲍若人"
,
"李奕"
,
"陈行"
,
"MC-001,M1-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
4
,
"No2.2019号WX15"
,
"李力"
,
"石彻"
,
"陈镇"
,
"MK-001,MC-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
if
(
scrapConditions
.
getDimName
()
!=
null
)
{
public
ResponseEntity
selectRepairBill
(
@RequestBody
ScrapConditions
scrapConditions
)
{
List
<
ScrapListVo
>
listVos
=
new
ArrayList
<>();
Long
time
=
1598163550704L
;
listVos
.
add
(
new
ScrapListVo
(
1
,
"No2.2019号WX12"
,
"张馋"
,
"李思念"
,
"伸莎"
,
"MB-001,MC-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
2
,
"No2.2019号WX13"
,
"李生成"
,
"许仁"
,
"詹彻"
,
"MA-001,MP-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
3
,
"No2.2019号WX14"
,
"鲍若人"
,
"李奕"
,
"陈行"
,
"MC-001,M1-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
listVos
.
add
(
new
ScrapListVo
(
4
,
"No2.2019号WX15"
,
"李力"
,
"石彻"
,
"陈镇"
,
"MK-001,MC-001"
,
"密码机"
,
new
Date
(
time
),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
if
(
scrapConditions
.
getDimName
()
!=
null
)
{
for
(
int
i
=
0
;
i
<
listVos
.
size
();
i
++)
{
if
(((
ScrapListVo
)
(
listVos
.
get
(
i
))).
getName
().
indexOf
(
scrapConditions
.
getDimName
())
<=
-
1
)
listVos
.
remove
(
i
);
...
...
@@ -50,20 +50,18 @@ public class DeviceScrapController {
}
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"可以通过这个接口查询销毁单"
)
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"可以通过这个接口查询销毁单"
)
@PostMapping
(
value
=
"/summary/{scrapId}"
)
public
ResponseEntity
<
ScrapListVo
>
selectRepairBill1
(
@PathVariable
Integer
scrapId
)
{
Map
<
Integer
,
ScrapListVo
>
map
=
new
HashMap
<>();
map
.
put
(
1
,
new
ScrapListVo
(
1
,
"No2.2019号WX12"
,
"张馋"
,
"李思念"
,
"伸莎"
,
"MB-001,MC-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
2
,
new
ScrapListVo
(
2
,
"No2.2019号WX13"
,
"李生成"
,
"许仁"
,
"詹彻"
,
"MA-001,MP-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
public
ResponseEntity
selectRepairBill1
(
@PathVariable
Integer
scrapId
)
{
Map
<
Integer
,
ScrapListVo
>
map
=
new
HashMap
<>();
map
.
put
(
1
,
new
ScrapListVo
(
1
,
"No2.2019号WX12"
,
"张馋"
,
"李思念"
,
"伸莎"
,
"MB-001,MC-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
2
,
new
ScrapListVo
(
2
,
"No2.2019号WX13"
,
"李生成"
,
"许仁"
,
"詹彻"
,
"MA-001,MP-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
3
,
new
ScrapListVo
(
3
,
"No2.2019号WX14"
,
"鲍若人"
,
"李奕"
,
"陈行"
,
"MC-001,M1-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
3
,
new
ScrapListVo
(
3
,
"No2.2019号WX14"
,
"鲍若人"
,
"李奕"
,
"陈行"
,
"MC-001,M1-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
4
,
new
ScrapListVo
(
4
,
"No2.2019号WX15"
,
"李力"
,
"石彻"
,
"陈镇"
,
"MK-001,MC-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
map
.
put
(
4
,
new
ScrapListVo
(
4
,
"No2.2019号WX15"
,
"李力"
,
"石彻"
,
"陈镇"
,
"MK-001,MC-001"
,
"密码机"
,
new
Date
(),
"国家密码局"
,
"192.168.102.211:8087/status/1.jpeg"
,
"陈龚"
,
null
));
List
<
DeviceVo
>
listVos
=
new
ArrayList
<>();
List
<
DeviceVo
>
listVos
=
new
ArrayList
<>();
Random
rand
=
new
Random
();
// nextInt is normally exclusive of the top value,
...
...
dev-device/device-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
e7640063
...
...
@@ -66,15 +66,15 @@ public class SelfCheckController {
@Autowired
private
MyWebSocket
myWebSocket
;
@ApiOperation
(
value
=
"装备比较"
,
notes
=
"可以通过这个接口发起比较装备"
)
@ApiOperation
(
value
=
"装备比较"
,
notes
=
"可以通过这个接口发起比较装备"
)
@PostMapping
(
value
=
"/compare"
)
public
ResponseEntity
<
CompareResultVo
>
compare
(
@RequestBody
CompareVo
compareVo
)
{
public
ResponseEntity
compare
(
@RequestBody
CompareVo
compareVo
)
{
List
<
Integer
>
list
=
compareVo
.
getDeivceIdList
();
List
<
String
>
list1
=
new
ArrayList
<>();
List
<
DeviceLibrary
>
deviceLibraryEntities
=
new
ArrayList
<>();
List
<
DeviceLibrary
>
newList
=
new
ArrayList
<>();
List
<
DeviceLibrary
>
resultList
=
new
ArrayList
<>();
for
(
Integer
id
:
list
)
{
for
(
Integer
id
:
list
)
{
DeviceLibrary
d
=
deviceLibraryService
.
getOne
(
id
);
//list1存应查装备rfid卡号
list1
.
add
(
d
.
getRfidCardId
());
...
...
@@ -141,16 +141,16 @@ public class SelfCheckController {
return
ResultUtil
.
success
(
compareResultVo
);
}
@ApiOperation
(
value
=
"发起自查业务"
,
notes
=
"可以通过这个接口发起自查业务"
)
@ApiOperation
(
value
=
"发起自查业务"
,
notes
=
"可以通过这个接口发起自查业务"
)
@PostMapping
(
value
=
"/addBill"
)
public
ResponseEntity
<
SelfCheckBill
>
addSelfExaminationBill
(
@RequestBody
SelfCheckSaveVo
selfCheckSaveVo
)
{
public
ResponseEntity
addSelfExaminationBill
(
@RequestBody
SelfCheckSaveVo
selfCheckSaveVo
)
{
//添加账单
SelfCheckBill
selfExaminationBillEntity
=
selfCheckSaveVo
.
toDo
();
selfExaminationBillEntity
.
setTitle
(
userUtils
.
getCurrentUserUnitName
()
+
"发起的自查任务"
);
selfExaminationBillEntity
.
setTitle
(
userUtils
.
getCurrentUserUnitName
()
+
"发起的自查任务"
);
selfExaminationBillEntity
.
setUseraId
(
userUtils
.
getCurrentUserId
());
selfExaminationBillEntity
.
setCheckUnit
(
userUtils
.
getCurrentUserUnitName
());
selfExaminationBillEntity
.
setCreateUnitId
(
userUtils
.
getCurrentUnitId
());
if
(
selfCheckSaveVo
.
getNewDeviceList
()
!=
null
)
{
if
(
selfCheckSaveVo
.
getNewDeviceList
()
!=
null
)
{
//按新增不在系统的装备按rfid卡号拼接保存
StringBuffer
stringBuffer
=
new
StringBuffer
();
stringBuffer
.
append
(
"."
);
...
...
@@ -185,17 +185,17 @@ public class SelfCheckController {
return
ResultUtil
.
success
(
selfExaminationBillEntity1
);
}
@ApiOperation
(
value
=
"自查审核"
,
notes
=
"可以通过这个接口自查审核"
)
@ApiOperation
(
value
=
"自查审核"
,
notes
=
"可以通过这个接口自查审核"
)
@PatchMapping
(
value
=
"/selfExaminationConfirm"
)
public
ResponseEntity
<
String
>
selfExaminationConfirm
(
@RequestBody
SelfCheckConfirmVo
selfCheckConfirmVo
)
{
public
ResponseEntity
selfExaminationConfirm
(
@RequestBody
SelfCheckConfirmVo
selfCheckConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
selfCheckConfirmVo
.
getTaskId
());
SelfCheckBill
selfExaminationBillEntity
=
selfExaminationBillService
.
getOne
(
taskBto
.
getBillId
());
String
deviceIdDetail
=
selfExaminationBillEntity
.
getCheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//审核通过,改变账单和任务状态,发起确认的任务
if
(
selfCheckConfirmVo
.
getStatus
()
==
0
)
{
if
(
selfCheckConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"自查审核成功"
,
null
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"自查审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
selfExaminationBillEntity
.
setCheckStatus
(
2
);
selfExaminationBillService
.
update
(
selfExaminationBillEntity
);
...
...
@@ -231,11 +231,11 @@ public class SelfCheckController {
}
}
@ApiOperation
(
value
=
"查询自查任务"
,
notes
=
"可以通过这个接口查询自查任务"
)
@ApiOperation
(
value
=
"查询自查任务"
,
notes
=
"可以通过这个接口查询自查任务"
)
@PostMapping
(
value
=
"/summary"
)
public
ResponseEntity
<
Page
<
SelfCheckBill
>>
selectSelfExaminationBill
(
@RequestBody
SelfCheckSelectVo
selfCheckSelectVo
)
{
public
ResponseEntity
selectSelfExaminationBill
(
@RequestBody
SelfCheckSelectVo
selfCheckSelectVo
)
{
Page
<
SelfCheckBill
>
page
=
selfExaminationBillService
.
getPage
(
selfCheckSelectVo
,
selfCheckSelectVo
.
getPageable
());
for
(
SelfCheckBill
s
:
page
.
getContent
())
{
for
(
SelfCheckBill
s
:
page
.
getContent
())
{
s
.
setCreateUnit
(
userPublicService
.
findByUnitsToname
(
s
.
getCreateUnitId
()));
String
user
=
userPublicService
.
getOne
(
s
.
getUseraId
()).
getName
();
String
user2
=
userPublicService
.
getOne
(
s
.
getUserbId
()).
getName
();
...
...
@@ -247,18 +247,18 @@ public class SelfCheckController {
return
ResultUtil
.
success
(
page
);
}
@ApiOperation
(
value
=
"查询自查任务详情"
,
notes
=
"可以通过这个接口查询自查任务详情"
)
@ApiOperation
(
value
=
"查询自查任务详情"
,
notes
=
"可以通过这个接口查询自查任务详情"
)
@GetMapping
(
value
=
"/detail/{billId}"
)
public
ResponseEntity
<
SelfCheckDetailVo
>
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
public
ResponseEntity
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
SelfCheckDetailVo
selfCheckDetailVo
=
new
SelfCheckDetailVo
();
//获取业务
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
SELF_CHECK
.
id
);
//获取账单
SelfCheckBill
selfExaminationBillEntity
=
selfExaminationBillService
.
getOne
(
billId
);
if
(
selfExaminationBillEntity
.
getUseraId
()
!=
0
)
{
if
(
selfExaminationBillEntity
.
getUseraId
()
!=
0
)
{
selfExaminationBillEntity
.
setCheckUser
(
userPublicService
.
getOne
(
selfExaminationBillEntity
.
getUseraId
()).
getName
());
}
if
(
selfExaminationBillEntity
.
getUserbId
()
!=
0
)
{
if
(
selfExaminationBillEntity
.
getUserbId
()
!=
0
)
{
selfExaminationBillEntity
.
setConfirmUser
(
userPublicService
.
getOne
(
selfExaminationBillEntity
.
getUserbId
()).
getName
());
}
selfCheckDetailVo
.
setSelfCheckBill
(
selfExaminationBillEntity
);
...
...
dev-device/device-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
e7640063
...
...
@@ -6,6 +6,7 @@ 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.DeviceLibrarySaveVo
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.packing.service.PackingLibraryService
;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.storage.service.StorageBillService
;
...
...
@@ -21,7 +22,6 @@ import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import
com.tykj.dev.device.task.subject.common.BusinessEnum
;
import
com.tykj.dev.device.task.subject.common.StatusEnum
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.utils.ResultUtil
;
...
...
@@ -113,9 +113,9 @@ public class StorageBillController {
return
ResultUtil
.
success
(
libraryEntities
);
}
@ApiOperation
(
value
=
"添加入库单"
,
notes
=
"可以通过这个接口发起入库业务"
)
@ApiOperation
(
value
=
"添加入库单"
,
notes
=
"可以通过这个接口发起入库业务"
)
@PostMapping
(
value
=
"/addStorageBill"
)
public
ResponseEntity
<
StorageBill
>
addStorageBill
(
@RequestBody
StorageBillSaveVo
storageBillSaveVo
)
{
public
ResponseEntity
addStorageBill
(
@RequestBody
StorageBillSaveVo
storageBillSaveVo
)
{
//1.存入库单
Integer
userId
=
userUtils
.
getCurrentUserId
();
StorageBill
storageBillEntity
=
storageBillService
.
addEntity
(
storageBillSaveVo
.
toDo
());
...
...
@@ -174,14 +174,14 @@ public class StorageBillController {
return
ResultUtil
.
success
(
storageBillService
.
update
(
storageBillEntity
));
}
@ApiOperation
(
value
=
"入库审核"
,
notes
=
"可以通过这个接口入库审核"
)
@ApiOperation
(
value
=
"入库审核"
,
notes
=
"可以通过这个接口入库审核"
)
@PostMapping
(
value
=
"/confirmStorageBill"
)
public
ResponseEntity
<
String
>
confirmStorageBill
(
@RequestBody
StorageBillConfirmVo
storageBillConfirmVo
)
{
public
ResponseEntity
confirmStorageBill
(
@RequestBody
StorageBillConfirmVo
storageBillConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
storageBillConfirmVo
.
getTaskId
());
//1.审核成功,入库任务结束,发起新的确认任务,改变装备状态
if
(
storageBillConfirmVo
.
getStatus
()==
0
)
{
if
(
storageBillConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"入库审核成功"
,
null
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"入库审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
StorageBill
storageBillEntity
=
storageBillService
.
getOne
(
taskBto
.
getBillId
());
storageBillEntity
.
setStorageStatus
(
2
);
...
...
@@ -219,9 +219,9 @@ public class StorageBillController {
}
}
@ApiOperation
(
value
=
"查询入库详情"
,
notes
=
"可以通过这个接口查询入库详情"
)
@ApiOperation
(
value
=
"查询入库详情"
,
notes
=
"可以通过这个接口查询入库详情"
)
@GetMapping
(
value
=
"/detail/{billId}"
)
public
ResponseEntity
<
StorageDetailVo
>
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
public
ResponseEntity
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
StorageDetailVo
storageDetailVo
=
new
StorageDetailVo
();
//获取taskBto和账单
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
STORAGE
.
id
);
...
...
@@ -230,7 +230,7 @@ public class StorageBillController {
storageBillEntity
.
setReceiveUserB
(
userPublicService
.
getOne
(
storageBillEntity
.
getReceiveUserbId
()).
getName
());
storageDetailVo
.
setStorageBill
(
storageBillEntity
);
String
str
=
storageBillEntity
.
getStorageDetail
();
List
<
Integer
>
list1
=
StringSplitUtil
.
userIdSplit
(
str
);
List
<
Integer
>
list1
=
StringSplitUtil
.
userIdSplit
(
str
);
//获取入库装备
List
<
DeviceLibrary
>
libraryEntities
=
new
ArrayList
<>();
for
(
Integer
deviceId:
list1
)
{
...
...
dev-device/device-task/src/main/java/com/tykj/dev/device/task/controller/TaskController.java
浏览文件 @
e7640063
...
...
@@ -17,7 +17,6 @@ import com.tykj.dev.misc.utils.ResultUtil;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -52,33 +51,33 @@ public class TaskController {
@Autowired
private
TaskDao
taskDao
;
@ApiOperation
(
value
=
"业务分页查询"
,
notes
=
"可以通过这个接口分页查询业务"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/manage/summary"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Page
<
TaskUserVo
>>
getTaskPage
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
@ApiOperation
(
value
=
"业务分页查询"
,
notes
=
"可以通过这个接口分页查询业务"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/manage/summary"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
getTaskPage
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
List
<
TaskUserVo
>
taskUserVos
=
taskService
.
getManageList
(
taskSelectVo
);
return
ResultUtil
.
success
(
PageUtil
.
getPerPage
(
taskSelectVo
.
getPage
(),
taskSelectVo
.
getSize
(),
taskUtils
.
orderByTopDescAndReadAsc
(
taskUserVos
),
taskSelectVo
.
getPageable
()));
return
ResultUtil
.
success
(
PageUtil
.
getPerPage
(
taskSelectVo
.
getPage
(),
taskSelectVo
.
getSize
(),
taskUtils
.
orderByTopDescAndReadAsc
(
taskUserVos
),
taskSelectVo
.
getPageable
()));
}
@ApiOperation
(
value
=
"业务跟踪待办列表查询"
,
notes
=
"可以通过这个接口查询业务"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getTaskList"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
TaskUserVo
>>
getTaskList
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
@ApiOperation
(
value
=
"业务跟踪待办列表查询"
,
notes
=
"可以通过这个接口查询业务"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getTaskList"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
getTaskList
(
@RequestBody
TaskSelectVo
taskSelectVo
)
{
List
<
TaskUserVo
>
taskUserVos
=
taskService
.
getList
(
taskSelectVo
);
return
ResultUtil
.
success
(
taskUtils
.
orderByTopDescAndReadAsc
(
taskUserVos
));
}
@ApiOperation
(
value
=
"置顶设置"
,
notes
=
"可以通过这个接口置顶业务"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/setTop"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
TaskUserVo
>
setTop
(
@RequestBody
TaskTopVo
taskTopVo
)
{
@ApiOperation
(
value
=
"置顶设置"
,
notes
=
"可以通过这个接口置顶业务"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/setTop"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
setTop
(
@RequestBody
TaskTopVo
taskTopVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskTopVo
.
getTaskId
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
List
<
Integer
>
userIds
=
taskBto
.
getTopFlagDetailList
();
if
(
taskTopVo
.
getTopFlag
()
==
1
)
{
if
(
userIds
!=
null
)
{
if
(
taskTopVo
.
getTopFlag
()
==
1
)
{
if
(
userIds
!=
null
)
{
taskBto
.
getTopFlagDetailList
().
add
(
userId
);
}
}
if
(
taskTopVo
.
getTopFlag
()
==
0
)
{
if
(
userIds
!=
null
&&
userIds
.
contains
(
userId
))
{
if
(
taskTopVo
.
getTopFlag
()
==
0
)
{
if
(
userIds
!=
null
&&
userIds
.
contains
(
userId
))
{
userIds
.
removeAll
(
new
ArrayList
<>(
Collections
.
singletonList
(
userId
)));
}
}
...
...
@@ -86,19 +85,19 @@ public class TaskController {
return
ResultUtil
.
success
(
task
.
parse2Bto
().
toVo
());
}
@ApiOperation
(
value
=
"是否已读设置"
,
notes
=
"可以通过这个接口设置业务的是否已读"
)
@ApiOperation
(
value
=
"是否已读设置"
,
notes
=
"可以通过这个接口设置业务的是否已读"
)
@PostMapping
(
"/setRead"
)
public
ResponseEntity
<
TaskUserVo
>
setRead
(
@RequestBody
TaskTopVo
taskTopVo
)
{
public
ResponseEntity
setRead
(
@RequestBody
TaskTopVo
taskTopVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskTopVo
.
getTaskId
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
List
<
Integer
>
userIds
=
taskBto
.
getUserReadDetailList
();
if
(
taskTopVo
.
getTopFlag
()
==
1
)
{
if
(
userIds
!=
null
)
{
if
(
taskTopVo
.
getTopFlag
()
==
1
)
{
if
(
userIds
!=
null
)
{
taskBto
.
getUserReadDetailList
().
add
(
userId
);
}
}
if
(
taskTopVo
.
getTopFlag
()
==
0
)
{
if
(
userIds
!=
null
&&
userIds
.
contains
(
userId
))
{
if
(
taskTopVo
.
getTopFlag
()
==
0
)
{
if
(
userIds
!=
null
&&
userIds
.
contains
(
userId
))
{
userIds
.
removeAll
(
new
ArrayList
<>(
Collections
.
singletonList
(
userId
)));
}
}
...
...
@@ -106,18 +105,18 @@ public class TaskController {
return
ResultUtil
.
success
(
task
.
parse2Bto
().
toVo
());
}
@ApiOperation
(
value
=
"查询业务日志"
,
notes
=
"可以通过这个接口查询查询业务日志"
)
@ApiOperation
(
value
=
"查询业务日志"
,
notes
=
"可以通过这个接口查询查询业务日志"
)
@GetMapping
(
"/manage/detail/log/{id}"
)
public
ResponseEntity
<
List
<
TaskLogUserVo
>>
selectLog
(
@PathVariable
(
"id"
)
int
taskId
)
{
public
ResponseEntity
selectLog
(
@PathVariable
(
"id"
)
int
taskId
)
{
//添加当前业务日志
List
<
TaskLogUserVo
>
taskLogUserVos
=
taskLogService
.
getByTaskId
(
taskId
);
//查询所有子业务
List
<
TaskBto
>
taskBtos
=
taskDao
.
findAll
().
stream
()
.
filter
(
task
->
task
.
getNodeIdDetail
()
!=
null
&&
task
.
getNodeIdDetail
().
contains
(
"."
+
taskId
+
"."
))
.
filter
(
task
->
task
.
getNodeIdDetail
()
!=
null
&&
task
.
getNodeIdDetail
().
contains
(
"."
+
taskId
+
"."
))
.
map
(
Task:
:
parse2Bto
)
.
collect
(
Collectors
.
toList
());
//添加子业务日志
if
(
taskBtos
.
size
()
>
0
)
{
if
(
taskBtos
.
size
()
>
0
)
{
taskBtos
.
forEach
(
taskBto
->
taskLogUserVos
.
addAll
(
taskLogService
.
getByTaskId
(
taskBto
.
getId
())));
}
//按日志时间排序
...
...
dev-device/device-taskselect/src/main/java/com/tykj/dev/device/taskselect/controller/TaskSelectController.java
浏览文件 @
e7640063
...
...
@@ -34,7 +34,6 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -79,15 +78,15 @@ public class TaskSelectController {
@ApiOperation
(
value
=
"查询业务对应页面的数据"
,
notes
=
"可以通过这个接口查询业务对应页面的数据"
)
@ApiOperation
(
value
=
"查询业务对应页面的数据"
,
notes
=
"可以通过这个接口查询业务对应页面的数据"
)
@GetMapping
(
"/manage/detail/{id}"
)
public
ResponseEntity
<
ResultObj
>
selectData
(
@PathVariable
(
"id"
)
int
taskId
)
{
public
ResponseEntity
selectData
(
@PathVariable
(
"id"
)
int
taskId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
Integer
bussinessType
=
taskBto
.
getBusinessType
();
Integer
billId
=
taskBto
.
getBillId
();
List
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
taskBto
);
switch
(
bussinessType
){
switch
(
bussinessType
)
{
case
1
:
PackingLibrary
packingLibraryEntity
=
packingLibraryService
.
getOne
(
billId
);
packingLibraryEntity
.
setUserA
(
userPublicService
.
getOne
(
packingLibraryEntity
.
getUseraId
()).
getName
());
...
...
dev-device/device-train/src/main/java/com/tykj/dev/device/train/controller/HandoverController.java
浏览文件 @
e7640063
...
...
@@ -3,7 +3,6 @@ package com.tykj.dev.device.train.controller;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.train.entity.vo.HandoverVo
;
import
com.tykj.dev.device.train.service.TrainThemeService
;
import
com.tykj.dev.device.user.base.ret.HandoverUser
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.service.MgrcertService
;
...
...
@@ -12,7 +11,6 @@ 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.scheduling.support.TaskUtils
;
import
org.springframework.security.core.annotation.AuthenticationPrincipal
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
@@ -41,14 +39,14 @@ public class HandoverController {
@GetMapping
(
value
=
"/{userId}"
)
@ApiOperation
(
value
=
"根据用户id查询交接用户详情"
,
notes
=
"成功返回handoverUser对象集合"
)
public
ResponseEntity
<
HandoverUser
>
getHandoverUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
public
ResponseEntity
getHandoverUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
return
ResponseEntity
.
ok
(
userService
.
findByIdHandoverUser
(
userId
));
}
@PostMapping
(
value
=
"/job"
)
@ApiOperation
(
value
=
"用户工作交接"
)
public
ResponseEntity
<
String
>
getHandoverUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
HandoverVo
handoverVo
)
{
public
ResponseEntity
getHandoverUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
HandoverVo
handoverVo
)
{
// jobService.findByIdsList(handoverVo.getCommissionJobIds()).forEach(
// jobEntity -> {
...
...
dev-device/device-train/src/main/java/com/tykj/dev/device/train/controller/TrainController.java
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
device
.
train
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.train.entity.TrainTheme
;
import
com.tykj.dev.device.train.entity.vo.ConditionsTrainVo
;
import
com.tykj.dev.device.train.entity.vo.TrainThemePage
;
import
com.tykj.dev.device.train.service.TrainThemeService
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.service.MgrcertService
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.scheduling.support.TaskUtils
;
import
org.springframework.web.bind.annotation.*
;
/**
...
...
@@ -40,20 +37,22 @@ public class TrainController {
/**
* 培训列表查询接口(分页)
*
* @return
*/
@PostMapping
(
"/summary/page"
)
public
ResponseEntity
<
TrainThemePage
>
trainThemeVoResponseEntity
(
@RequestBody
ConditionsTrainVo
conditionsTrainVo
)
{
public
ResponseEntity
trainThemeVoResponseEntity
(
@RequestBody
ConditionsTrainVo
conditionsTrainVo
)
{
return
ResponseEntity
.
ok
(
trainThemeService
.
findTrainPageVo
(
conditionsTrainVo
));
return
ResponseEntity
.
ok
(
trainThemeService
.
findTrainPageVo
(
conditionsTrainVo
));
}
/**
* 培训详情接口
*
* @param trainThemeId 培训id
*/
@GetMapping
(
"/detail/{trainThemeId}"
)
public
ResponseEntity
<
TrainTheme
>
trainThemeVoResponseEntity
(
@PathVariable
Integer
trainThemeId
)
{
public
ResponseEntity
trainThemeVoResponseEntity
(
@PathVariable
Integer
trainThemeId
)
{
return
ResponseEntity
.
ok
(
trainThemeService
.
findById
(
trainThemeId
));
}
...
...
dev-device/device-train/src/main/java/com/tykj/dev/device/train/controller/TrainJobController.java
浏览文件 @
e7640063
差异被折叠。
点击展开。
dev-device/device-user/src/main/java/com/tykj/dev/device/user/subject/controller/AreaController.java
浏览文件 @
e7640063
...
...
@@ -9,9 +9,6 @@ package com.tykj.dev.device.user.subject.controller;
*/
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.ret.AreaInstitutions
;
import
com.tykj.dev.device.user.base.ret.AreaVo
;
import
com.tykj.dev.device.user.base.ret.PermissionsType
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.service.AreaService
;
import
io.swagger.annotations.Api
;
...
...
@@ -20,13 +17,10 @@ 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.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
/**
* 区域视图层
*/
...
...
@@ -39,8 +33,8 @@ public class AreaController {
AreaService
areaService
;
@GetMapping
(
value
=
"/area/units"
)
@ApiOperation
(
value
=
"查询权限接口,按照类型划分,具体字段查看model"
,
notes
=
"成功返回分类的权限对象"
)
public
ResponseEntity
<
List
<
AreaVo
>>
addPermissions
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
@ApiOperation
(
value
=
"查询权限接口,按照类型划分,具体字段查看model"
,
notes
=
"成功返回分类的权限对象"
)
public
ResponseEntity
addPermissions
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
return
ResponseEntity
.
ok
(
areaService
.
findAll
(
securityUser
.
getCurrentUserInfo
().
getUnits
().
getAreaId
()));
}
...
...
dev-device/device-user/src/main/java/com/tykj/dev/device/user/subject/controller/PermissionsController.java
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.ret.PermissionsType
;
import
com.tykj.dev.device.user.subject.entity.Permissions
;
import
com.tykj.dev.device.user.subject.service.PermissionsService
;
import
io.swagger.annotations.Api
;
...
...
@@ -13,8 +12,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -30,14 +27,14 @@ public class PermissionsController {
@Autowired
PermissionsService
permissionsService
;
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
value
=
"权限添加接口"
,
notes
=
"成功返回权限对象"
)
public
ResponseEntity
<
Permissions
>
addPermissions
(
@RequestBody
Permissions
permissions
)
{
return
ResponseEntity
.
ok
(
permissionsService
.
save
(
permissions
));
@ApiOperation
(
value
=
"权限添加接口"
,
notes
=
"成功返回权限对象"
)
public
ResponseEntity
addPermissions
(
@RequestBody
Permissions
permissions
)
{
return
ResponseEntity
.
ok
(
permissionsService
.
save
(
permissions
));
}
@PostMapping
(
value
=
"/summary"
)
@ApiOperation
(
value
=
"查询权限接口,按照类型划分,具体字段查看model"
,
notes
=
"成功返回分类的权限对象"
)
public
ResponseEntity
<
List
<
PermissionsType
>>
addPermissions
()
{
@ApiOperation
(
value
=
"查询权限接口,按照类型划分,具体字段查看model"
,
notes
=
"成功返回分类的权限对象"
)
public
ResponseEntity
addPermissions
()
{
return
ResponseEntity
.
ok
(
permissionsService
.
findAllOrberPermissionsType
());
}
...
...
dev-device/device-user/src/main/java/com/tykj/dev/device/user/subject/controller/RoleController.java
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.ret.RolePage
;
import
com.tykj.dev.device.user.base.ret.RoleVo
;
import
com.tykj.dev.device.user.subject.entity.Role
;
import
com.tykj.dev.device.user.subject.entity.RolePermissions
;
...
...
@@ -35,17 +34,17 @@ public class RoleController {
RolePermissionsService
rolePermissionsService
;
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
value
=
"角色添加和修改接口,新增不需要传id,修改必须传id"
,
notes
=
"成功返回角色对象"
)
public
ResponseEntity
<
Role
>
addRole
(
@RequestBody
RoleVo
roleVo
)
{
Role
role
=
roleService
.
save
(
roleVo
.
toDo
());
if
(
rolePermissionsService
.
findAllByRoleId
(
role
.
getRoleId
()).
size
()!=
0
)
{
@ApiOperation
(
value
=
"角色添加和修改接口,新增不需要传id,修改必须传id"
,
notes
=
"成功返回角色对象"
)
public
ResponseEntity
addRole
(
@RequestBody
RoleVo
roleVo
)
{
Role
role
=
roleService
.
save
(
roleVo
.
toDo
());
if
(
rolePermissionsService
.
findAllByRoleId
(
role
.
getRoleId
()).
size
()
!=
0
)
{
rolePermissionsService
.
deleteFindRoleId
(
role
.
getRoleId
());
}
List
<
Integer
>
list
=
roleVo
.
getPermissionsIds
();
if
(
list
!=
null
&&
list
.
size
()!=
0
)
{
}
List
<
Integer
>
list
=
roleVo
.
getPermissionsIds
();
if
(
list
!=
null
&&
list
.
size
()
!=
0
)
{
list
.
forEach
(
integer
->
{
rolePermissionsService
.
save
(
new
RolePermissions
(
null
,
role
.
getRoleId
(),
integer
));
rolePermissionsService
.
save
(
new
RolePermissions
(
null
,
role
.
getRoleId
(),
integer
));
});
}
...
...
@@ -54,18 +53,18 @@ public class RoleController {
@GetMapping
(
value
=
"/detail/{roleId}"
)
@ApiOperation
(
value
=
"查询角色详情"
,
notes
=
"成功返回角色对象"
)
public
ResponseEntity
<
Role
>
selectPage
(
@PathVariable
Integer
roleId
)
{
@ApiOperation
(
value
=
"查询角色详情"
,
notes
=
"成功返回角色对象"
)
public
ResponseEntity
selectPage
(
@PathVariable
Integer
roleId
)
{
return
ResponseEntity
.
ok
(
roleService
.
findById
(
roleId
));
}
@GetMapping
(
value
=
"/summary/page/{page}/{size}"
)
@ApiOperation
(
value
=
"查询角色列表"
,
notes
=
"成功返回角色对象"
)
public
ResponseEntity
<
RolePage
>
selectPage
(
@PathVariable
Integer
page
,
@PathVariable
Integer
size
)
{
@ApiOperation
(
value
=
"查询角色列表"
,
notes
=
"成功返回角色对象"
)
public
ResponseEntity
selectPage
(
@PathVariable
Integer
page
,
@PathVariable
Integer
size
)
{
return
ResponseEntity
.
ok
(
roleService
.
findByUserRolePage
(
page
,
size
));
return
ResponseEntity
.
ok
(
roleService
.
findByUserRolePage
(
page
,
size
));
}
}
dev-device/device-user/src/main/java/com/tykj/dev/device/user/subject/controller/UnitsController.java
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.ret.AreaVo
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -13,8 +11,6 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -32,38 +28,38 @@ public class UnitsController {
@GetMapping
(
value
=
"/find/{unitsId}"
)
@ApiOperation
(
value
=
"根据单位ID查询对象"
,
notes
=
"返回单位对象"
)
public
ResponseEntity
<
Units
>
findUnits
(
@PathVariable
Integer
unitsId
)
{
public
ResponseEntity
findUnits
(
@PathVariable
Integer
unitsId
)
{
return
ResponseEntity
.
ok
(
unitsService
.
findById
(
unitsId
));
}
@GetMapping
(
value
=
"/findAll/{level}"
)
@ApiOperation
(
value
=
"根据等级查询对应等级的单位集合"
,
notes
=
"单位集合"
)
public
ResponseEntity
<
List
<
Units
>>
deleteUser
(
@PathVariable
Integer
level
)
{
public
ResponseEntity
deleteUser
(
@PathVariable
Integer
level
)
{
return
ResponseEntity
.
ok
(
unitsService
.
findListById
(
level
));
}
@GetMapping
(
value
=
"/findAll"
)
@ApiOperation
(
value
=
"查询所有单位"
,
notes
=
"单位集合"
)
public
ResponseEntity
<
List
<
Units
>>
findAlls
()
{
public
ResponseEntity
findAlls
()
{
return
ResponseEntity
.
ok
(
unitsService
.
findAll
());
}
@GetMapping
(
value
=
"/area"
)
@ApiOperation
(
value
=
"根据等级查询对应等级的单位集合"
,
notes
=
"单位集合"
)
public
ResponseEntity
<
List
<
AreaVo
>>
deleteUser
()
{
public
ResponseEntity
deleteUser
()
{
return
ResponseEntity
.
ok
(
unitsService
.
findListAreaUnitsVo
());
}
@GetMapping
(
value
=
"/findAll/GreaterThanEqual/{level}"
)
@ApiOperation
(
value
=
"根据当前用户的单位等级,查询所有的下级单位以及自己单位"
,
notes
=
"单位集合"
)
public
ResponseEntity
<
List
<
Units
>>
GreaterThanEqualLeven
(
@PathVariable
Integer
level
)
{
public
ResponseEntity
GreaterThanEqualLeven
(
@PathVariable
Integer
level
)
{
return
ResponseEntity
.
ok
(
unitsService
.
findListlevenGreaterThanEqual
(
level
));
}
@GetMapping
(
value
=
"/find/units/{unitsId}"
)
@ApiOperation
(
value
=
"根据当前用户的单位ID查询上级单位对象"
,
notes
=
"单位"
)
public
ResponseEntity
<
Units
>
findLastUnits
(
@PathVariable
Integer
unitsId
)
{
public
ResponseEntity
findLastUnits
(
@PathVariable
Integer
unitsId
)
{
return
ResponseEntity
.
ok
(
unitsService
.
findByAreaId
(
unitsId
));
}
}
dev-device/device-user/src/main/java/com/tykj/dev/device/user/subject/controller/UserArchivesController.java
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.ret.MemberThat
;
import
com.tykj.dev.device.user.base.ret.UserConditionsVo
;
import
com.tykj.dev.device.user.base.ret.UserPage
;
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.RoleService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UserRoleService
;
...
...
@@ -20,8 +17,6 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -53,21 +48,21 @@ public class UserArchivesController {
@PostMapping
(
value
=
"/archives/summary/page"
)
@ApiOperation
(
value
=
"根据单位id查询用户接口(分页)"
,
notes
=
"成功返回用户对象集合"
)
public
ResponseEntity
<
UserPage
>
findAllPage
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
UserConditionsVo
userConditionsVo
)
{
public
ResponseEntity
findAllPage
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
UserConditionsVo
userConditionsVo
)
{
return
ResponseEntity
.
ok
(
userService
.
findAllByUnitePage
(
userConditionsVo
));
}
@GetMapping
(
value
=
"/archives/summary/{unitsId}"
)
@ApiOperation
(
value
=
"根据用户ID查询用户详情"
,
notes
=
"成功返回用户对象集合"
)
public
ResponseEntity
<
List
<
User
>>
findAllUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
unitsId
)
{
public
ResponseEntity
findAllUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
unitsId
)
{
return
ResponseEntity
.
ok
(
userService
.
findAllByUnite
(
unitsId
));
}
@GetMapping
(
value
=
"/archives/detail/{userId}"
)
@ApiOperation
(
value
=
"根据单位id查询用户接口(不分页)"
,
notes
=
"成功返回用户对象集合"
)
public
ResponseEntity
<
MemberThat
>
findByIdUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
public
ResponseEntity
findByIdUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
return
ResponseEntity
.
ok
(
userService
.
findById
(
userId
));
}
...
...
dev-device/device-user/src/main/java/com/tykj/dev/device/user/subject/controller/UserController.java
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
device
.
user
.
subject
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.ret.
*
;
import
com.tykj.dev.device.user.base.ret.
UserUpdatePw
;
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.RoleService
;
...
...
@@ -18,8 +18,6 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -49,7 +47,7 @@ public class UserController {
LogoutUtil
logout
;
// @PostMapping(value = "/login")
// @ApiOperation(value = "用户新增接口", notes = "添加成功返回用户对象")
// public ResponseEntity
<UserRe>
loginUser(@RequestBody LoginUser loginUser){
// public ResponseEntity loginUser(@RequestBody LoginUser loginUser){
// User user=userService.findByUserName(loginUser.getUserName());
// if (user==null){
// return ResponseEntity.status(201).body(null);
...
...
@@ -72,32 +70,32 @@ public class UserController {
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
value
=
"用户新增接口"
,
notes
=
"添加成功返回用户对象"
)
public
ResponseEntity
<
User
>
saveUser
(
@RequestBody
User
user
)
{
public
ResponseEntity
saveUser
(
@RequestBody
User
user
)
{
return
ResponseEntity
.
ok
(
userService
.
save
(
user
));
}
@GetMapping
(
value
=
"/delete/{userId}"
)
@ApiOperation
(
value
=
"用户删除接口"
,
notes
=
"删除返回true,false"
)
public
ResponseEntity
<
Boolean
>
deleteUser
(
@PathVariable
Integer
userId
)
{
public
ResponseEntity
deleteUser
(
@PathVariable
Integer
userId
)
{
return
ResponseEntity
.
ok
(
userService
.
delete
(
userId
));
}
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
value
=
"用户更新接口"
,
notes
=
"更新成功返回用户对象"
)
public
ResponseEntity
<
User
>
updateUser
(
@RequestBody
User
user
)
{
public
ResponseEntity
updateUser
(
@RequestBody
User
user
)
{
return
ResponseEntity
.
ok
(
userService
.
update
(
user
));
}
@GetMapping
(
value
=
"/findAll"
)
@ApiOperation
(
value
=
"所有用户查询接口"
,
notes
=
"成功返回用户对象集合"
)
public
ResponseEntity
<
List
<
User
>>
findAllUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
public
ResponseEntity
findAllUser
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
// log.info("当前登入对象:{}",securityUser.getCurrentUserInfo().getUsername());
return
ResponseEntity
.
ok
(
userService
.
findAll
());
}
// @GetMapping(value = "/findAll/{userId}")
// @ApiOperation(value = "根据用户id查询同级用户信息", notes = "成功返回用户对象集合")
// public ResponseEntity
<List<UserShenRe>>
findAll(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @PathVariable Integer userId){
// public ResponseEntity findAll(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @PathVariable Integer userId){
//// log.info("当前登入对象:{}",securityUser.getCurrentUserInfo().getUsername());
// return ResponseEntity.ok(userService.findByUserId(userId));
// }
...
...
@@ -105,20 +103,20 @@ public class UserController {
@GetMapping
(
value
=
"/findAll/{unitsId}"
)
@ApiOperation
(
value
=
"根据单位查询用户(下拉)"
,
notes
=
"成功返回用户对象集合"
)
public
ResponseEntity
<
List
<
UserShenRe
>>
findAll2
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
unitsId
)
{
public
ResponseEntity
findAll2
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
unitsId
)
{
// log.info("当前登入对象:{}",securityUser.getCurrentUserInfo().getUsername());
return
ResponseEntity
.
ok
(
userService
.
findByUniteId
(
unitsId
));
}
@GetMapping
(
value
=
"/find/user"
)
@ApiOperation
(
value
=
"查询当前登入用户信息"
,
notes
=
"成功返回用户对象"
)
public
ResponseEntity
<
User
>
findUserId
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
public
ResponseEntity
findUserId
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
return
ResponseEntity
.
ok
(
securityUser
.
getCurrentUserInfo
());
}
@GetMapping
(
value
=
"/findAll/units/{userId}"
)
@ApiOperation
(
value
=
"根据用户id查询同级用户接口(下拉)"
,
notes
=
"成功返回用户对象集合"
)
public
ResponseEntity
<
List
<
UserShenRe
>>
findAll1
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
public
ResponseEntity
findAll1
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
return
ResponseEntity
.
ok
(
userService
.
findByUserId
(
userId
));
}
...
...
@@ -126,10 +124,10 @@ public class UserController {
@GetMapping
(
value
=
"/archives/update/password"
)
@ApiOperation
(
value
=
"修改用户密码"
,
notes
=
"返回修改结果"
)
public
ResponseEntity
<
String
>
updatePassword
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
UserUpdatePw
userUpdatePw
)
{
public
ResponseEntity
updatePassword
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@RequestBody
UserUpdatePw
userUpdatePw
)
{
Integer
core
=
userService
.
updatePw
(
userUpdatePw
);
switch
(
core
){
Integer
core
=
userService
.
updatePw
(
userUpdatePw
);
switch
(
core
)
{
case
-
1
:
return
ResponseEntity
.
ok
(
"原密码不对,请重新修改"
);
case
-
2
:
...
...
@@ -140,35 +138,35 @@ public class UserController {
@GetMapping
(
value
=
"/get/train/{userId}"
)
@ApiOperation
(
value
=
"根据用户id查询下级用户列表"
,
notes
=
"成功返回UserTrainVo对象集合"
)
public
ResponseEntity
<
List
<
UserTrainVo
>>
getFind
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
public
ResponseEntity
getFind
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
return
ResponseEntity
.
ok
(
userService
.
findByIdUserTarinVo
(
userId
));
}
@GetMapping
(
value
=
"/get/trainUnits/{userId}"
)
@ApiOperation
(
value
=
"根据用户id查询下级单位列表"
,
notes
=
"成功返回UnitsTrainVo对象集合"
)
public
ResponseEntity
<
List
<
UnitsTrainVo
>>
getFindTrainVo
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
public
ResponseEntity
getFindTrainVo
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
return
ResponseEntity
.
ok
(
userService
.
findByIdUnitsTrainVo
(
userId
));
}
@GetMapping
(
value
=
"/detail/{userId}"
)
@ApiOperation
(
value
=
"根据用户id查询用户详情"
,
notes
=
"成功返回UnitsTrainVo对象集合"
)
public
ResponseEntity
<
MemberThat
>
getFindMemberThatVo
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
public
ResponseEntity
getFindMemberThatVo
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
,
@PathVariable
Integer
userId
)
{
return
ResponseEntity
.
ok
(
userService
.
findById
(
userId
));
}
// @PostMapping(value = "/update")
// @ApiOperation(value = "修改用户信息", notes = "成功返回UnitsTrainVo对象集合")
// public ResponseEntity
<MemberThat>
getFindMemberThatVo(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody MemberThat memberThat){
// public ResponseEntity getFindMemberThatVo(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody MemberThat memberThat){
// userService.update(memberThat.toUserVo());
// return ResponseEntity.ok(memberThat);
// }
@GetMapping
(
"/findAll/superiorList"
)
@ApiOperation
(
value
=
"根据用户ID查询上级单位用户"
,
notes
=
"List<UserSuperiorVo>"
)
public
ResponseEntity
<
List
<
UserSuperiorVo
>>
getFindMemberThatVo
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
public
ResponseEntity
getFindMemberThatVo
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
return
ResponseEntity
.
ok
(
userService
.
findUserSuperiorVo
(
securityUser
.
getCurrentUserInfo
().
getUserId
()));
}
...
...
dev-device/device-user/src/main/java/com/tykj/dev/device/user/subject/controller/UserRoleController.java
浏览文件 @
e7640063
...
...
@@ -22,21 +22,21 @@ public class UserRoleController {
// @PostMapping(value = "/save")
// @ApiOperation(value = "用户新增接口", notes = "添加成功返回用户对象")
// public ResponseEntity
<User>
saveUser(@RequestBody User user){
// public ResponseEntity saveUser(@RequestBody User user){
// return ResponseEntity.ok(userService.save(user));
// }
// @PostMapping(value = "/delete/{userId}")
// @ApiOperation(value = "用户删除接口", notes = "删除返回true,false")
// public ResponseEntity
<Boolean>
deleteUser( @PathVariable String userId){
// public ResponseEntity deleteUser( @PathVariable String userId){
// return ResponseEntity.ok(userService.delete(userId));
// }
// @PostMapping(value = "/update")
// @ApiOperation(value = "用户更新接口", notes = "更新成功返回用户对象")
// public ResponseEntity
<User>
updateUser(@RequestBody User user){
// public ResponseEntity updateUser(@RequestBody User user){
// return ResponseEntity.ok(userService.update(user));
// }@PostMapping(value = "/findAll")
// @ApiOperation(value = "所有用户查询接口", notes = "成功返回用户对象集合")
// public ResponseEntity
<List<User>>
findAllUser(){
// public ResponseEntity findAllUser(){
// return ResponseEntity.ok(userService.findAll());
// }
...
...
dev-device/device-usereport/src/main/java/com/tykj/dev/device/usereport/controller/DeviceUseReportController.java
浏览文件 @
e7640063
...
...
@@ -30,28 +30,28 @@ public class DeviceUseReportController {
@Autowired
private
DeviceUseReportService
deviceUseReportService
;
@ApiOperation
(
value
=
"模糊查询装备使用报告分页"
,
notes
=
"可以通过这个接口模糊查询装备使用报告分页"
)
@ApiOperation
(
value
=
"模糊查询装备使用报告分页"
,
notes
=
"可以通过这个接口模糊查询装备使用报告分页"
)
@PostMapping
(
"/summary"
)
public
ResponseEntity
<
Page
<
DeviceUseReport
>>
selectDeviceUseReport
(
@RequestBody
DeviceUseReportSelectVo
deviceUseReportSelectVo
)
{
Page
<
DeviceUseReport
>
deviceUseReportEntities
=
deviceUseReportService
.
getPage
(
deviceUseReportSelectVo
,
deviceUseReportSelectVo
.
getPageable
());
public
ResponseEntity
selectDeviceUseReport
(
@RequestBody
DeviceUseReportSelectVo
deviceUseReportSelectVo
)
{
Page
<
DeviceUseReport
>
deviceUseReportEntities
=
deviceUseReportService
.
getPage
(
deviceUseReportSelectVo
,
deviceUseReportSelectVo
.
getPageable
());
return
ResultUtil
.
success
(
deviceUseReportEntities
);
}
@ApiOperation
(
value
=
"生成装备使用报告"
,
notes
=
"可以通过这个接口生成装备使用报告"
)
@ApiOperation
(
value
=
"生成装备使用报告"
,
notes
=
"可以通过这个接口生成装备使用报告"
)
@PostMapping
(
"/create"
)
public
ResponseEntity
<
DeviceUseReport
>
createDeviceUseReport
(
@RequestBody
DeviceUseReportCreateVo
deviceUseReportCreateVo
)
{
public
ResponseEntity
createDeviceUseReport
(
@RequestBody
DeviceUseReportCreateVo
deviceUseReportCreateVo
)
{
return
ResultUtil
.
success
(
deviceUseReportService
.
createReport
(
deviceUseReportCreateVo
));
}
@ApiOperation
(
value
=
"查询装备使用报告详情页"
,
notes
=
"查询装备使用报告详情页"
)
@ApiOperation
(
value
=
"查询装备使用报告详情页"
,
notes
=
"查询装备使用报告详情页"
)
@GetMapping
(
"/detail/{id}"
)
public
ResponseEntity
<
DeviceUseReportDetailVo
>
selectDetail
(
@PathVariable
(
"id"
)
int
id
)
{
public
ResponseEntity
selectDetail
(
@PathVariable
(
"id"
)
int
id
)
{
DeviceUseReport
d
=
deviceUseReportService
.
getOne
(
id
);
DeviceUseReportDetailVo
deviceUseReportDetailVo
=
new
DeviceUseReportDetailVo
();
BeanUtils
.
copyProperties
(
d
,
deviceUseReportDetailVo
);
BeanUtils
.
copyProperties
(
d
,
deviceUseReportDetailVo
);
//分解数量详情组合字段
List
<
Integer
>
list
=
StringSplitUtil
.
userIdSplit
(
d
.
getReportDetail
());
if
(
list
.
size
()
>
7
)
{
if
(
list
.
size
()
>
7
)
{
deviceUseReportDetailVo
.
setDeviceNumber
(
list
.
get
(
0
));
deviceUseReportDetailVo
.
setInLibraryNum
(
list
.
get
(
1
));
deviceUseReportDetailVo
.
setRepairNum
(
list
.
get
(
2
));
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/ResultUtil.java
浏览文件 @
e7640063
...
...
@@ -19,10 +19,10 @@ public class ResultUtil<T> {
*
* @param data 获取的数据
*/
public
static
<
T
>
ResponseEntity
<
ResultObj
>
success
(
T
data
)
{
public
static
<
T
>
ResponseEntity
success
(
T
data
)
{
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
httpHeaders
.
add
(
HttpHeaders
.
CONTENT_TYPE
,
"application/json;charset=UTF-8"
);
return
new
ResponseEntity
<>
(
new
ResultObj
(
data
),
httpHeaders
,
HttpStatus
.
OK
);
return
new
ResponseEntity
(
new
ResultObj
(
data
),
httpHeaders
,
HttpStatus
.
OK
);
}
/**
...
...
@@ -30,42 +30,42 @@ public class ResultUtil<T> {
*
* @param data 获取的数据
*/
public
static
<
T
>
ResponseEntity
<
ResultObj
>
success
(
T
data
,
HttpHeaders
headers
)
{
return
new
ResponseEntity
<>
(
new
ResultObj
(
data
),
headers
,
HttpStatus
.
OK
);
public
static
<
T
>
ResponseEntity
success
(
T
data
,
HttpHeaders
headers
)
{
return
new
ResponseEntity
(
new
ResultObj
(
data
),
headers
,
HttpStatus
.
OK
);
}
/**
* 失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
ResultObj
>
failed
()
{
return
new
ResponseEntity
<>
(
HttpStatus
.
INTERNAL_SERVER_ERROR
);
public
static
<
T
>
ResponseEntity
failed
()
{
return
new
ResponseEntity
(
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
/**
* 失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
ResultObj
>
failed
(
T
content
)
{
return
new
ResponseEntity
<>
(
new
ResultObj
(
content
),
HttpStatus
.
INTERNAL_SERVER_ERROR
);
public
static
<
T
>
ResponseEntity
failed
(
T
content
)
{
return
new
ResponseEntity
(
new
ResultObj
(
content
),
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
/**
* 失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
T
>
failed
(
HttpStatus
httpStatus
)
{
return
new
ResponseEntity
<>
(
httpStatus
);
public
static
<
T
>
ResponseEntity
failed
(
HttpStatus
httpStatus
)
{
return
new
ResponseEntity
(
httpStatus
);
}
/**
* 失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
ResultObj
>
failed
(
HttpStatus
httpStatus
,
T
content
)
{
return
new
ResponseEntity
<>
(
new
ResultObj
(
content
),
httpStatus
);
public
static
<
T
>
ResponseEntity
failed
(
HttpStatus
httpStatus
,
T
content
)
{
return
new
ResponseEntity
(
new
ResultObj
(
content
),
httpStatus
);
}
/**
* 参数验证失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
ResultObj
>
validateFailed
(
T
content
)
{
public
static
<
T
>
ResponseEntity
validateFailed
(
T
content
)
{
return
failed
(
HttpStatus
.
INTERNAL_SERVER_ERROR
,
content
);
}
...
...
@@ -73,14 +73,14 @@ public class ResultUtil<T> {
/**
* 未登录返回结果
*/
public
static
<
T
>
ResponseEntity
<
T
>
unauthorized
()
{
public
static
<
T
>
ResponseEntity
unauthorized
()
{
return
failed
(
HttpStatus
.
UNAUTHORIZED
);
}
/**
* 未授权返回结果
*/
public
static
<
T
>
ResponseEntity
<
T
>
forbidden
()
{
public
static
<
T
>
ResponseEntity
forbidden
()
{
return
failed
(
HttpStatus
.
FORBIDDEN
);
}
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/controller/RfidController.java
浏览文件 @
e7640063
差异被折叠。
点击展开。
dev-union/src/test/java/com/tykj/dev/confirmcheck/DeviceCheckControllerTest.java
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
confirmcheck
;
import
com.tykj.dev.union.BaseTest
;
import
com.google.common.collect.Lists
;
import
com.tykj.dev.device.confirmcheck.controller.DeviceCheckController
;
import
com.tykj.dev.device.confirmcheck.entity.vo.CheckBillVo
;
import
com.tykj.dev.union.MockTest
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.RequestBuilder
;
import
static
com
.
tykj
.
dev
.
misc
.
utils
.
JacksonUtil
.
toJSon
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
/**
* DeviceCheckControllerTest.
...
...
@@ -9,13 +21,42 @@ import org.junit.jupiter.api.Test;
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/15 at 11:17 上午
*/
class
DeviceCheckControllerTest
extends
BaseTest
{
@SuppressWarnings
(
"ALL"
)
@WithMockUser
(
username
=
"shena"
,
password
=
"qwer1234"
)
class
DeviceCheckControllerTest
extends
MockTest
{
@Autowired
private
DeviceCheckController
checkController
;
@Autowired
protected
MockMvc
mockMvc
;
private
@Test
void
checkUserA
()
{
void
startManualCheck
()
throws
Exception
{
CheckBillVo
param
=
new
CheckBillVo
();
param
.
setUnitId
(
1
);
param
.
setAreaRange
(
Lists
.
newArrayList
(
1
));
param
.
setCheckTitle
(
"单元测试手动核查"
);
param
.
setRemark
(
"这是一段测试用的数据"
);
param
.
setUserAId
(
1
);
param
.
setUserBId
(
2
);
// 测试
RequestBuilder
request
;
// 1、get查一下user列表,应该为空
request
=
get
(
"/check/confirm/check/bill"
)
.
contentType
(
MediaType
.
APPLICATION_JSON
)
.
content
(
toJSon
(
param
));
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
isOk
());
}
@Test
void
checkUserA
()
{
}
@Test
...
...
dev-union/src/test/java/com/tykj/dev/union/MockTest.java
0 → 100644
浏览文件 @
e7640063
package
com
.
tykj
.
dev
.
union
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
/**
* MockTest.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/15 at 1:15 下午
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
UnionApplication
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
MOCK
)
@AutoConfigureMockMvc
public
class
MockTest
{
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论