Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
91b2b287
提交
91b2b287
authored
9月 15, 2020
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改了装备模块不兼容的泛型部分
上级
de6f5485
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
45 行增加
和
42 行删除
+45
-42
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+20
-20
DeviceDestroyController.java
...ev/device/destroy/controller/DeviceDestroyController.java
+5
-5
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+0
-0
ResultUtil.java
...isc/src/main/java/com/tykj/dev/misc/utils/ResultUtil.java
+12
-11
RfidController.java
...ain/java/com/tykj/dev/rfid/controller/RfidController.java
+8
-6
没有找到文件。
dev-device/device-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
91b2b287
...
...
@@ -80,27 +80,27 @@ public class DeviceCheckController {
@GetMapping
(
"/area/{fatherId}"
)
@ApiOperation
(
value
=
"查询指定区域下的所有区域信息"
)
public
Res
ultObj
findAreaUnderId
(
@PathVariable
Integer
fatherId
)
{
return
new
ResultObj
(
areaRepo
.
findByFatherId
(
fatherId
));
public
Res
ponseEntity
<
ResultObj
>
findAreaUnderId
(
@PathVariable
Integer
fatherId
)
{
return
ResponseEntity
.
ok
(
new
ResultObj
(
areaRepo
.
findByFatherId
(
fatherId
)
));
}
@ApiOperation
(
value
=
"根据id查询核查统计数据"
,
notes
=
"可以通过这个接口查询核查统计数据"
)
@GetMapping
(
"/stat/{id}"
)
public
Res
ultObj
findStatById
(
@PathVariable
Integer
id
)
{
public
Res
ponseEntity
<
ResultObj
>
findStatById
(
@PathVariable
Integer
id
)
{
//还要查询出所有的
CheckStatVo
statVoList
=
statRepo
.
findById
(
id
)
.
map
(
DeviceCheckStat:
:
toVo
)
.
orElse
(
CheckStatVo
.
empty
());
return
new
ResultObj
(
statVoList
);
return
ResponseEntity
.
ok
(
new
ResultObj
(
statVoList
)
);
}
@ApiOperation
(
value
=
"根据id查询核查详情数据"
,
notes
=
"可以通过这个接口查询核查详情数据"
)
@GetMapping
(
"/detail/{id}"
)
public
Res
ultObj
findDetail
(
@PathVariable
Integer
id
)
{
public
Res
ponseEntity
<
ResultObj
>
findDetail
(
@PathVariable
Integer
id
)
{
CheckDetailVo
detailVoList
=
detailRepo
.
findById
(
id
)
.
map
(
transUtil:
:
CheckDetailDo2Vo
)
.
orElse
(
null
);
return
new
ResultObj
(
detailVoList
);
return
ResponseEntity
.
ok
(
new
ResultObj
(
detailVoList
)
);
}
/**
...
...
@@ -113,7 +113,7 @@ public class DeviceCheckController {
*/
@ApiOperation
(
value
=
"发起核查"
,
notes
=
"发起核查流程"
)
@PostMapping
(
"/check/bill"
)
public
Res
ultObj
startManualCheck
(
@RequestBody
CheckBillVo
billVo
)
{
public
Res
ponseEntity
<
ResultObj
>
startManualCheck
(
@RequestBody
CheckBillVo
billVo
)
{
// 1. 添加发起核查bill记录
DeviceCheckBillEntity
billDo
=
transUtil
.
checkBillVo2Do
(
billVo
);
billRepo
.
save
(
billDo
);
...
...
@@ -156,7 +156,7 @@ public class DeviceCheckController {
taskService
.
start
(
checkedTask
);
}
return
new
ResultObj
(
String
.
format
(
"[%s]单位成功发起对 %s 单位的核查任务分发"
,
startUnit
.
getName
(),
checkedUnitNames
));
return
ResponseEntity
.
ok
(
new
ResultObj
(
String
.
format
(
"[%s]单位成功发起对 %s 单位的核查任务分发"
,
startUnit
.
getName
(),
checkedUnitNames
)
));
}
...
...
@@ -170,10 +170,10 @@ public class DeviceCheckController {
*/
@ApiOperation
(
value
=
"专管员A核查详情单"
)
@PutMapping
(
"/detail/A/{id}"
)
public
ResponseEntity
checkUserA
(
@PathVariable
Integer
id
,
@RequestParam
int
assignUserId
,
@RequestParam
String
checkResult
,
@RequestBody
DevLibVo
devLibVo
)
{
public
ResponseEntity
<
ResultObj
>
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,13 +191,13 @@ public class DeviceCheckController {
*/
@ApiOperation
(
value
=
"专管员B核查详情单"
)
@PutMapping
(
"/detail/B/{id}"
)
public
ResponseEntity
checkUserB
(
@PathVariable
Integer
id
,
@RequestParam
int
checkStatus
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
int
checkUserAId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
int
checkUserBId
)
{
public
ResponseEntity
<
ResultObj
>
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
(
"checkStatus不应该为0!"
);
return
ResponseEntity
.
status
(
400
).
body
(
new
ResultObj
(
"checkStatus不应该为0!"
)
);
}
//先更新checkUser
...
...
@@ -237,8 +237,8 @@ public class DeviceCheckController {
@ApiOperation
(
value
=
"核查组A/B确认核查详情单"
)
@PutMapping
(
"/detail/C/{id}"
)
public
ResponseEntity
checkUserC
(
@PathVariable
Integer
id
,
@RequestParam
boolean
pass
)
{
public
ResponseEntity
<
ResultObj
>
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
statConfirm
(
@RequestParam
int
statId
)
{
public
ResponseEntity
<
ResultObj
>
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
浏览文件 @
91b2b287
package
com
.
tykj
.
dev
.
device
.
destroy
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.destroy.entity.enums.DestroyStatus
;
import
com.tykj.dev.device.destroy.entity.vo.*
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyBillService
;
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.DeviceLibrarySelectVo
;
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
;
...
...
@@ -14,15 +18,12 @@ 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.entity.User
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
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.misc.utils.StringSplitUtil
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.destroy.entity.enums.DestroyStatus
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -33,7 +34,6 @@ import org.springframework.data.domain.Page;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyBillService
;
import
javax.transaction.Transactional
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -113,7 +113,7 @@ public class DeviceDestroyController {
@ApiOperation
(
value
=
"查询可销毁装备列表"
,
notes
=
"通过这个接口查询可销毁装备接口"
)
@PostMapping
(
value
=
"/devices"
)
public
ResponseEntity
<
List
<
DeviceLibrary
>>
selectDevices
(
@RequestBody
CanDestroyDeviceSelectVo
canDestoryDeviceSelectVo
)
{
public
ResponseEntity
selectDevices
(
@RequestBody
CanDestroyDeviceSelectVo
canDestoryDeviceSelectVo
)
{
DeviceLibrarySelectVo
deviceLibrarySelectVo
=
new
DeviceLibrarySelectVo
();
BeanUtils
.
copyProperties
(
canDestoryDeviceSelectVo
,
deviceLibrarySelectVo
);
deviceLibrarySelectVo
.
setLifeStatus
(
Arrays
.
asList
(
2
,
5
,
12
));
...
...
dev-device/device-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
91b2b287
差异被折叠。
点击展开。
dev-misc/src/main/java/com/tykj/dev/misc/utils/ResultUtil.java
浏览文件 @
91b2b287
package
com
.
tykj
.
dev
.
misc
.
utils
;
import
com.tykj.dev.misc.base.ResultObj
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -18,10 +19,10 @@ public class ResultUtil<T> {
*
* @param data 获取的数据
*/
public
static
<
T
>
ResponseEntity
<
T
>
success
(
T
data
)
{
public
static
<
T
>
ResponseEntity
<
ResultObj
>
success
(
T
data
)
{
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
httpHeaders
.
add
(
HttpHeaders
.
CONTENT_TYPE
,
"application/json;charset=UTF-8"
);
return
new
ResponseEntity
<>(
data
,
httpHeaders
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
new
ResultObj
(
data
),
httpHeaders
,
HttpStatus
.
OK
);
}
/**
...
...
@@ -29,22 +30,22 @@ public class ResultUtil<T> {
*
* @param data 获取的数据
*/
public
static
<
T
>
ResponseEntity
<
T
>
success
(
T
data
,
HttpHeaders
headers
)
{
return
new
ResponseEntity
<>(
data
,
headers
,
HttpStatus
.
OK
);
public
static
<
T
>
ResponseEntity
<
ResultObj
>
success
(
T
data
,
HttpHeaders
headers
)
{
return
new
ResponseEntity
<>(
new
ResultObj
(
data
),
headers
,
HttpStatus
.
OK
);
}
/**
* 失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
T
>
failed
()
{
public
static
<
T
>
ResponseEntity
<
ResultObj
>
failed
()
{
return
new
ResponseEntity
<>(
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
/**
* 失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
T
>
failed
(
T
content
)
{
return
new
ResponseEntity
<>(
content
,
HttpStatus
.
INTERNAL_SERVER_ERROR
);
public
static
<
T
>
ResponseEntity
<
ResultObj
>
failed
(
T
content
)
{
return
new
ResponseEntity
<>(
new
ResultObj
(
content
),
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
/**
...
...
@@ -57,15 +58,15 @@ public class ResultUtil<T> {
/**
* 失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
T
>
failed
(
HttpStatus
httpStatus
,
T
content
)
{
return
new
ResponseEntity
<>(
content
,
httpStatus
);
public
static
<
T
>
ResponseEntity
<
ResultObj
>
failed
(
HttpStatus
httpStatus
,
T
content
)
{
return
new
ResponseEntity
<>(
new
ResultObj
(
content
),
httpStatus
);
}
/**
* 参数验证失败返回结果
*/
public
static
<
T
>
ResponseEntity
<
T
>
validateFailed
(
T
content
)
{
return
failed
(
HttpStatus
.
INTERNAL_SERVER_ERROR
,
content
);
public
static
<
T
>
ResponseEntity
<
ResultObj
>
validateFailed
(
T
content
)
{
return
failed
(
HttpStatus
.
INTERNAL_SERVER_ERROR
,
content
);
}
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/controller/RfidController.java
浏览文件 @
91b2b287
...
...
@@ -7,6 +7,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.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
...
...
@@ -14,7 +15,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.entity.User
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.AuthenticationUtils
;
...
...
@@ -26,15 +26,14 @@ import com.tykj.dev.rfid.entity.domin.RfidChangeLog;
import
com.tykj.dev.rfid.entity.enums.RfidChangeStatus
;
import
com.tykj.dev.rfid.entity.vo.*
;
import
com.tykj.dev.rfid.service.LibraryWarningLogService
;
import
com.tykj.dev.rfid.service.RfidService
;
import
com.tykj.dev.rfid.service.RfidChangeBillService
;
import
com.tykj.dev.rfid.service.RfidChangeLogService
;
import
com.tykj.dev.rfid.service.RfidService
;
import
com.tykj.dev.rfid.timeTask.InventoryScheduled
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
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
;
...
...
@@ -45,7 +44,10 @@ import javax.transaction.Transactional;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Objects
;
/**
* @author huangxiahao
...
...
@@ -187,9 +189,9 @@ public class RfidController {
return
selectRfidChangeDetail
(
rfidChangeBill
.
getId
());
}
@ApiOperation
(
value
=
"标签管理概览"
,
notes
=
"通过这个借口可以查看标签管理的概览"
)
@ApiOperation
(
value
=
"标签管理概览"
,
notes
=
"通过这个借口可以查看标签管理的概览"
)
@PostMapping
(
value
=
"/summary"
)
public
ResponseEntity
<
Page
<
DeviceLibrary
>>
getTagSummary
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
public
ResponseEntity
getTagSummary
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
Page
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryService
.
getPage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
());
return
ResultUtil
.
success
(
deviceLibraryEntities
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论