Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhny
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
王夏晖
zhny
Commits
ca7c917c
Commit
ca7c917c
authored
Jun 06, 2018
by
王夏晖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目回收站功能,拓扑图节点维护功能
parent
7cbda16e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
17 deletions
+21
-17
MaintenanceController.java
.../device/maintenance/controller/MaintenanceController.java
+2
-5
MaintenanceRepository.java
...usiness/device/maintenance/dao/MaintenanceRepository.java
+3
-2
MaintenanceService.java
...siness/device/maintenance/service/MaintenanceService.java
+1
-1
MaintenanceServiceImpl.java
...vice/maintenance/service/impl/MaintenanceServiceImpl.java
+2
-2
ProjectRepository.java
...va/org/rcisoft/business/manage/dao/ProjectRepository.java
+2
-1
BusProject.java
...n/java/org/rcisoft/business/manage/entity/BusProject.java
+2
-0
BusProjectServiceImpl.java
...t/business/manage/service/impl/BusProjectServiceImpl.java
+8
-6
application-prod.yml
src/main/resources/application-prod.yml
+1
-0
No files found.
src/main/java/org/rcisoft/business/device/maintenance/controller/MaintenanceController.java
View file @
ca7c917c
...
@@ -76,15 +76,12 @@ public class MaintenanceController {
...
@@ -76,15 +76,12 @@ public class MaintenanceController {
}
}
@ApiOperation
(
value
=
"根据设备种类id查询该种类的设备"
,
notes
=
"根据设备种类id查询该种类的设备"
)
@ApiOperation
(
value
=
"根据设备种类id查询该种类的设备"
,
notes
=
"根据设备种类id查询该种类的设备"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"tpId"
,
value
=
"tpId"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"varchar"
),
})
@GetMapping
(
value
=
"/listDeviceByTpId"
)
@GetMapping
(
value
=
"/listDeviceByTpId"
)
public
Result
listDeviceByTpId
(
@RequestParam
String
tpId
)
{
public
Result
listDeviceByTpId
(
@RequestParam
String
tpId
,
@RequestParam
String
proId
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
maintenanceService
.
listDeviceByTpId
(
tpId
));
maintenanceService
.
listDeviceByTpId
(
tpId
,
proId
));
}
}
...
...
src/main/java/org/rcisoft/business/device/maintenance/dao/MaintenanceRepository.java
View file @
ca7c917c
...
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Delete;
...
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Delete;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.business.device.maintenance.entity.BusDevService
;
import
org.rcisoft.business.device.maintenance.entity.BusDevService
;
import
org.springframework.security.access.method.P
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
tk.mybatis.mapper.common.BaseMapper
;
import
tk.mybatis.mapper.common.BaseMapper
;
...
@@ -36,8 +37,8 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> {
...
@@ -36,8 +37,8 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> {
* @param tpID the tp id
* @param tpID the tp id
* @return the list
* @return the list
*/
*/
@Select
(
"SELECT * FROM bus_device WHERE DEV_TP_ID = #{tpID}"
)
@Select
(
"SELECT * FROM bus_device WHERE DEV_TP_ID = #{tpID}
and pro_id = #{proId}
"
)
List
<
Map
<
String
,
Object
>>
listDeviceByTpId
(
@Param
(
"tpID"
)
String
tpID
);
List
<
Map
<
String
,
Object
>>
listDeviceByTpId
(
@Param
(
"tpID"
)
String
tpID
,
@Param
(
"proId"
)
String
proId
);
/**
/**
...
...
src/main/java/org/rcisoft/business/device/maintenance/service/MaintenanceService.java
View file @
ca7c917c
...
@@ -55,7 +55,7 @@ public interface MaintenanceService {
...
@@ -55,7 +55,7 @@ public interface MaintenanceService {
* @param tpID the tp id
* @param tpID the tp id
* @return the list
* @return the list
*/
*/
List
<
Map
<
String
,
Object
>>
listDeviceByTpId
(
String
tpID
);
List
<
Map
<
String
,
Object
>>
listDeviceByTpId
(
String
tpID
,
String
proId
);
/**
/**
* List bus device service by date list.
* List bus device service by date list.
...
...
src/main/java/org/rcisoft/business/device/maintenance/service/impl/MaintenanceServiceImpl.java
View file @
ca7c917c
...
@@ -84,8 +84,8 @@ public class MaintenanceServiceImpl implements MaintenanceService {
...
@@ -84,8 +84,8 @@ public class MaintenanceServiceImpl implements MaintenanceService {
* @return busDevices
* @return busDevices
*/
*/
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
listDeviceByTpId
(
String
tpID
)
{
public
List
<
Map
<
String
,
Object
>>
listDeviceByTpId
(
String
tpID
,
String
proId
)
{
List
<
Map
<
String
,
Object
>>
busDevices
=
maintenanceRepository
.
listDeviceByTpId
(
tpID
);
List
<
Map
<
String
,
Object
>>
busDevices
=
maintenanceRepository
.
listDeviceByTpId
(
tpID
,
proId
);
return
busDevices
;
return
busDevices
;
}
}
...
...
src/main/java/org/rcisoft/business/manage/dao/ProjectRepository.java
View file @
ca7c917c
...
@@ -30,7 +30,7 @@ public interface ProjectRepository extends BaseMapper<BusProject> {
...
@@ -30,7 +30,7 @@ public interface ProjectRepository extends BaseMapper<BusProject> {
* @return
* @return
*/
*/
@Select
(
"<script>select a.* from bus_project a left join sys_user_project b on a.PRO_ID = b.PRO_ID\n"
+
@Select
(
"<script>select a.* from bus_project a left join sys_user_project b on a.PRO_ID = b.PRO_ID\n"
+
"where b.USER_ID = #{user_id}"
+
"where b.USER_ID = #{user_id}
and a.online = '1'
"
+
"</script>"
)
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryBusProjectByUser
(
Map
<
String
,
Object
>
map
);
List
<
Map
<
String
,
Object
>>
queryBusProjectByUser
(
Map
<
String
,
Object
>
map
);
...
@@ -53,6 +53,7 @@ public interface ProjectRepository extends BaseMapper<BusProject> {
...
@@ -53,6 +53,7 @@ public interface ProjectRepository extends BaseMapper<BusProject> {
"<if test =' proId != null '> and a.pro_id = #{proId}</if>"
+
"<if test =' proId != null '> and a.pro_id = #{proId}</if>"
+
"<if test =' jwnum != null '> and a.jwnum = #{jwnum}</if>"
+
"<if test =' jwnum != null '> and a.jwnum = #{jwnum}</if>"
+
"<if test =' saveFlag != null '> and a.SAVE_FLAG = #{saveFlag}</if>"
+
"<if test =' saveFlag != null '> and a.SAVE_FLAG = #{saveFlag}</if>"
+
"<if test =' online != null '> and a.ONLINE = #{online}</if>"
+
"</script>"
)
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryBusProjects
(
BusProject
busProject
);
List
<
Map
<
String
,
Object
>>
queryBusProjects
(
BusProject
busProject
);
}
}
...
...
src/main/java/org/rcisoft/business/manage/entity/BusProject.java
View file @
ca7c917c
...
@@ -81,5 +81,7 @@ public class BusProject{
...
@@ -81,5 +81,7 @@ public class BusProject{
private
String
saveingEnergy
;
private
String
saveingEnergy
;
private
String
sysNm
;
private
String
sysNm
;
private
String
online
;
}
}
src/main/java/org/rcisoft/business/manage/service/impl/BusProjectServiceImpl.java
View file @
ca7c917c
...
@@ -59,6 +59,7 @@ public class BusProjectServiceImpl implements BusProjectService {
...
@@ -59,6 +59,7 @@ public class BusProjectServiceImpl implements BusProjectService {
BusProject
bus
=
new
BusProject
();
BusProject
bus
=
new
BusProject
();
bus
.
setProId
(
busProject
.
getProId
());
bus
.
setProId
(
busProject
.
getProId
());
bus
.
setSysNm
(
"暖通空调"
);
bus
.
setSysNm
(
"暖通空调"
);
bus
.
setOnline
(
"1"
);
if
(
findByParam
(
bus
)!=
null
&&
findByParam
(
bus
).
size
()>
0
){
if
(
findByParam
(
bus
)!=
null
&&
findByParam
(
bus
).
size
()>
0
){
line
=
0
;
line
=
0
;
message
=
"网关编号重复,项目新增失败"
;
message
=
"网关编号重复,项目新增失败"
;
...
@@ -154,14 +155,15 @@ public class BusProjectServiceImpl implements BusProjectService {
...
@@ -154,14 +155,15 @@ public class BusProjectServiceImpl implements BusProjectService {
map
.
put
(
"pro_id"
,
busProject
.
getProId
());
map
.
put
(
"pro_id"
,
busProject
.
getProId
());
if
(
busProject
.
getProId
()!=
null
&&
!
busProject
.
getProId
().
equals
(
""
)){
if
(
busProject
.
getProId
()!=
null
&&
!
busProject
.
getProId
().
equals
(
""
)){
//项目下没有关联的设备,可以删除
//项目下没有关联的设备,可以删除
if
(
projectRepository
.
queryDeivceByProject
(
map
)==
null
||
projectRepository
.
queryDeivceByProject
(
map
).
size
()<
1
){
/*if(projectRepository.queryDeivceByProject(map)==null || projectRepository.queryDeivceByProject(map).size()<1){
Example
example
=
new
Example
(
BusProject
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"proId"
,
busProject
.
getProId
());
line
=
projectRepository
.
deleteByExample
(
example
);
}else{
}else{
message = "项目下有关联设备,无法删除";
message = "项目下有关联设备,无法删除";
}
}*/
Example
example
=
new
Example
(
BusProject
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"proId"
,
busProject
.
getProId
());
line
=
projectRepository
.
deleteByExample
(
example
);
}
else
{
}
else
{
message
=
"ID为空,删除失败"
;
message
=
"ID为空,删除失败"
;
}
}
...
...
src/main/resources/application-prod.yml
View file @
ca7c917c
...
@@ -101,6 +101,7 @@ filepath:
...
@@ -101,6 +101,7 @@ filepath:
analysis
:
/home/zhny/filepath/analysis/
analysis
:
/home/zhny/filepath/analysis/
equipment
:
/home/zhny/filepath/equipment/
equipment
:
/home/zhny/filepath/equipment/
devicetp
:
/home/zhny/dist/devicetp/
devicetp
:
/home/zhny/dist/devicetp/
topologynode
:
/home/zhny/dist/topologynode/
loginimg
:
/home/zhny/filepath/loginimg/
loginimg
:
/home/zhny/filepath/loginimg/
qrcode
:
/home/zhny/filepath/qrcode/
qrcode
:
/home/zhny/filepath/qrcode/
...
...
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