Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TCM
tcm-system
Commits
e26af96c
Commit
e26af96c
authored
Oct 27, 2020
by
tangf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增公司消息
parent
bf0c48e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
DevideController.java
...m/pangding/web/authority/controller/DevideController.java
+8
-1
DeviceDaoImpl.java
...va/com/pangding/web/authority/dao/impl/DeviceDaoImpl.java
+1
-0
DeviceServiceImpl.java
...angding/web/authority/service/impl/DeviceServiceImpl.java
+10
-3
No files found.
src/main/java/com/pangding/web/authority/controller/DevideController.java
View file @
e26af96c
...
@@ -6,6 +6,7 @@ import com.pangding.web.vo.system.res.DeviceResVo;
...
@@ -6,6 +6,7 @@ import com.pangding.web.vo.system.res.DeviceResVo;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author tangfang
* @author tangfang
* @date 2020-08-19
* @date 2020-08-19
*/
*/
@Api
()
@Api
(
value
=
"设备类"
,
description
=
"设备的查询,新增,修改,删除等相关操作"
)
@RestController
@RestController
@RequestMapping
(
"/device"
)
@RequestMapping
(
"/device"
)
public
class
DevideController
{
public
class
DevideController
{
...
@@ -26,6 +27,7 @@ public class DevideController {
...
@@ -26,6 +27,7 @@ public class DevideController {
private
DeviceService
deviceService
;
private
DeviceService
deviceService
;
@RequestMapping
(
value
=
"/findDeviceList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/findDeviceList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"获取设备列表"
,
notes
=
"返回设备列表"
)
public
ResponseResult
<
PageSizeData
<
DeviceResVo
>>
findDeviceList
(
@RequestBody
DeviceReqVo
req
){
public
ResponseResult
<
PageSizeData
<
DeviceResVo
>>
findDeviceList
(
@RequestBody
DeviceReqVo
req
){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
return
deviceService
.
findDeviceList
(
req
);
return
deviceService
.
findDeviceList
(
req
);
...
@@ -33,30 +35,35 @@ public class DevideController {
...
@@ -33,30 +35,35 @@ public class DevideController {
@RequestMapping
(
value
=
"/findDeviceInfo"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/findDeviceInfo"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"获取设备信息"
,
notes
=
"返回设备信息"
)
public
ResponseResult
<
DeviceResVo
>
findDeviceInfo
(
@RequestBody
DeviceReqVo
req
){
public
ResponseResult
<
DeviceResVo
>
findDeviceInfo
(
@RequestBody
DeviceReqVo
req
){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
return
deviceService
.
findDeviceInfo
(
req
);
return
deviceService
.
findDeviceInfo
(
req
);
}
}
@RequestMapping
(
value
=
"/findDeviceInfoByCode"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/findDeviceInfoByCode"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"根据设备编号获取设备信息"
,
notes
=
"返回设备信息"
)
public
ResponseResult
<
DeviceResVo
>
findDeviceInfoByCode
(
@RequestBody
DeviceReqVo
req
){
public
ResponseResult
<
DeviceResVo
>
findDeviceInfoByCode
(
@RequestBody
DeviceReqVo
req
){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
return
deviceService
.
findDeviceInfoByCode
(
req
);
return
deviceService
.
findDeviceInfoByCode
(
req
);
}
}
@RequestMapping
(
value
=
"/saveDevice"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/saveDevice"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"保存设备信息"
,
notes
=
"返回保存结果"
)
public
ResponseResult
saveDevice
(
@RequestBody
DeviceReqVo
req
){
public
ResponseResult
saveDevice
(
@RequestBody
DeviceReqVo
req
){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
return
deviceService
.
saveDevice
(
req
);
return
deviceService
.
saveDevice
(
req
);
}
}
@RequestMapping
(
value
=
"/updateDevice"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/updateDevice"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"修改设备信息"
,
notes
=
"返回修改结果"
)
public
ResponseResult
updateDevice
(
@RequestBody
DeviceReqVo
req
){
public
ResponseResult
updateDevice
(
@RequestBody
DeviceReqVo
req
){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
return
deviceService
.
updateDevice
(
req
);
return
deviceService
.
updateDevice
(
req
);
}
}
@RequestMapping
(
value
=
"/delDevice"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/delDevice"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"删除设备信息"
,
notes
=
"返回删除结果"
)
public
ResponseResult
delDevice
(
@RequestBody
DeviceReqVo
req
){
public
ResponseResult
delDevice
(
@RequestBody
DeviceReqVo
req
){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
return
deviceService
.
delDevice
(
req
);
return
deviceService
.
delDevice
(
req
);
...
...
src/main/java/com/pangding/web/authority/dao/impl/DeviceDaoImpl.java
View file @
e26af96c
...
@@ -25,6 +25,7 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao {
...
@@ -25,6 +25,7 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao {
table
.
add
(
QUERY_LIST
,
"SELECT * FROM pd_device WHERE 1=1 {WHERE}"
)
table
.
add
(
QUERY_LIST
,
"SELECT * FROM pd_device WHERE 1=1 {WHERE}"
)
.
add
(
"deviceId"
,
" AND device_id = ? "
)
.
add
(
"deviceId"
,
" AND device_id = ? "
)
.
add
(
"deviceCode"
,
"AND device_code = ? "
)
.
add
(
"deviceName"
,
" AND device_name = ? "
)
.
add
(
"deviceName"
,
" AND device_name = ? "
)
.
add
(
"deviceType"
,
" AND device_type = ? "
)
.
add
(
"deviceType"
,
" AND device_type = ? "
)
.
add
(
"companyId"
,
" AND company_id = ? "
)
.
add
(
"companyId"
,
" AND company_id = ? "
)
...
...
src/main/java/com/pangding/web/authority/service/impl/DeviceServiceImpl.java
View file @
e26af96c
...
@@ -6,6 +6,7 @@ import com.pangding.web.vo.system.pd.device.DeviceVo;
...
@@ -6,6 +6,7 @@ import com.pangding.web.vo.system.pd.device.DeviceVo;
import
com.pangding.web.vo.system.req.DeviceReqVo
;
import
com.pangding.web.vo.system.req.DeviceReqVo
;
import
com.pangding.web.vo.system.res.DeviceResVo
;
import
com.pangding.web.vo.system.res.DeviceResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
com.yanzuoguang.util.vo.ResponseResult
;
...
@@ -30,6 +31,7 @@ public class DeviceServiceImpl implements DeviceService {
...
@@ -30,6 +31,7 @@ public class DeviceServiceImpl implements DeviceService {
return
ResponseResult
.
result
(
deviceResVo
);
return
ResponseResult
.
result
(
deviceResVo
);
}
}
@Override
public
ResponseResult
<
DeviceResVo
>
findDeviceInfoByCode
(
DeviceReqVo
req
)
{
public
ResponseResult
<
DeviceResVo
>
findDeviceInfoByCode
(
DeviceReqVo
req
)
{
DeviceResVo
deviceResVo
=
deviceDao
.
findDeviceInfo
(
req
);
DeviceResVo
deviceResVo
=
deviceDao
.
findDeviceInfo
(
req
);
return
ResponseResult
.
result
(
deviceResVo
);
return
ResponseResult
.
result
(
deviceResVo
);
...
@@ -37,13 +39,18 @@ public class DeviceServiceImpl implements DeviceService {
...
@@ -37,13 +39,18 @@ public class DeviceServiceImpl implements DeviceService {
@Override
@Override
public
ResponseResult
saveDevice
(
DeviceReqVo
req
)
{
public
ResponseResult
saveDevice
(
DeviceReqVo
req
)
{
return
ResponseResult
.
result
(
null
);
DeviceVo
deviceVo
=
new
DeviceVo
();
ObjectHelper
.
writeWithFrom
(
deviceVo
,
req
);
deviceVo
.
setDeviceId
(
StringHelper
.
getNewID
());
deviceVo
.
setCreateTime
(
DateHelper
.
getNow
());
deviceDao
.
create
(
deviceVo
);
return
ResponseResult
.
result
(
deviceVo
);
}
}
@Override
@Override
public
ResponseResult
<
DeviceVo
>
updateDevice
(
DeviceReqVo
req
)
{
public
ResponseResult
<
DeviceVo
>
updateDevice
(
DeviceReqVo
req
)
{
DeviceVo
deviceVo
=
deviceDao
.
load
(
req
.
getDeviceId
(),
DeviceVo
.
class
);
DeviceVo
deviceVo
=
deviceDao
.
load
(
req
.
getDeviceId
(),
DeviceVo
.
class
);
if
(
StringHelper
.
isEmpty
(
deviceVo
))
{
if
(
StringHelper
.
isEmpty
(
deviceVo
))
{
return
ResponseResult
.
error
(
"99"
,
"设备编号有误"
);
return
ResponseResult
.
error
(
"99"
,
"设备编号有误"
);
}
}
ObjectHelper
.
writeWithFrom
(
deviceVo
,
req
);
ObjectHelper
.
writeWithFrom
(
deviceVo
,
req
);
...
@@ -54,6 +61,6 @@ public class DeviceServiceImpl implements DeviceService {
...
@@ -54,6 +61,6 @@ public class DeviceServiceImpl implements DeviceService {
@Override
@Override
public
ResponseResult
delDevice
(
DeviceReqVo
req
)
{
public
ResponseResult
delDevice
(
DeviceReqVo
req
)
{
deviceDao
.
remove
(
req
);
deviceDao
.
remove
(
req
);
return
ResponseResult
.
result
(
null
);
return
ResponseResult
.
result
(
"删除成功"
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment