Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
a06b44b0
Commit
a06b44b0
authored
May 06, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12290 【web-场站管理】场站删除未校验该场站是否关联人员,直接删除
parent
1c35497f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
92 deletions
+98
-92
StationBasicMapper.java
...amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
+2
-1
StationBasicMapper.xml
...xiop-api/src/main/resources/mapper/StationBasicMapper.xml
+11
-9
StationBasicController.java
...t/module/jxiop/biz/controller/StationBasicController.java
+78
-76
StationBasicServiceImpl.java
...odule/jxiop/biz/service/impl/StationBasicServiceImpl.java
+7
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/StationBasicMapper.java
View file @
a06b44b0
...
...
@@ -30,7 +30,7 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> {
@Param
(
"stationType"
)
String
stationType
,
@Param
(
"orgCode"
)
String
orgCode
);
//删除
int
deleteList
(
String
[]
ids
);
int
deleteList
(
String
ids
);
//导出
List
<
ExStationBasicDto
>
getExStationBasicDto
(
@Param
(
"stationMasterName"
)
String
stationMasterName
,
@Param
(
"stationName"
)
String
stationName
,
...
...
@@ -40,6 +40,7 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> {
//获取场站列表信息
List
<
StationInfoDto
>
getStationList
(
@Param
(
"areaCode"
)
String
areaCode
);
int
deleteStationCoordinateByStationid
(
@Param
(
"sequence_nbr"
)
Long
sequence_nbr
);
int
getStationPersonByStationID
(
@Param
(
"sequence_nbr"
)
String
sequence_nbr
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/StationBasicMapper.xml
View file @
a06b44b0
...
...
@@ -57,14 +57,8 @@
</select>
<delete
id=
"deleteList"
parameterType=
"int"
>
delete from station_basic where sequence_nbr in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
;
delete from station_coordinate where station_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
delete from station_basic where sequence_nbr = #{id};
delete from station_coordinate where station_id = #{id}
</delete>
<delete
id =
"deleteStationCoordinateByStationid"
>
delete from station_coordinate where station_id = #{sequence_nbr}
...
...
@@ -129,6 +123,14 @@
AND station_basic.area_code like concat('%',#{areaCode},'%')
</if>
</select>
<select
id=
"getStationPersonByStationID"
resultType=
"int"
>
SELECT
COUNT( 1 )
FROM
person_account
LEFT JOIN station_basic ON person_account.project_id = station_basic.platform_station_id
WHERE
station_basic.sequence_nbr = #{sequence_nbr}
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/StationBasicController.java
View file @
a06b44b0
...
...
@@ -10,12 +10,16 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
...
...
@@ -35,23 +39,25 @@ public class StationBasicController extends BaseController {
@Autowired
StationBasicServiceImpl
stationBasicServiceImpl
;
/**
* 新增场站基础信息表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增场站基础信息表"
,
notes
=
"新增场站基础信息表"
)
public
ResponseModel
<
Object
>
save
(
@RequestBody
StationBasic
model
)
{
try
{
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增场站基础信息表"
,
notes
=
"新增场站基础信息表"
)
public
ResponseModel
<
Object
>
save
(
@RequestBody
StationBasic
model
)
{
try
{
stationBasicServiceImpl
.
add
(
model
);
return
ResponseHelper
.
buildResponse
(
null
);
}
catch
(
InnerInvokException
e
)
{
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
catch
(
InnerInvokException
e
)
{
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
}
public
ResponseModel
buildResponseFalse
(
String
message
)
{
}
public
ResponseModel
buildResponseFalse
(
String
message
)
{
ResponseModel
response
=
new
ResponseModel
();
response
.
setResult
(
null
);
response
.
setDevMessage
(
"FAILURE"
);
...
...
@@ -60,30 +66,29 @@ public class StationBasicController extends BaseController {
response
.
setDevMessage
(
message
);
return
response
;
}
/**
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新场站基础信息表"
,
notes
=
"根据sequenceNbr更新场站基础信息表"
)
public
ResponseModel
<
StationBasicDto
>
updateBySequenceNbrStationBasic
(
@RequestBody
StationBasic
model
,
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
try
{
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新场站基础信息表"
,
notes
=
"根据sequenceNbr更新场站基础信息表"
)
public
ResponseModel
<
StationBasicDto
>
updateBySequenceNbrStationBasic
(
@RequestBody
StationBasic
model
,
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
try
{
model
.
setSequenceNbr
(
sequenceNbr
);
stationBasicServiceImpl
.
update
(
model
);
return
ResponseHelper
.
buildResponse
(
null
);
}
catch
(
InnerInvokException
e
)
{
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
catch
(
InnerInvokException
e
)
{
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
}
}
/**
/**
* 根据sequenceNbr删除
*
* @param ids 主键
...
...
@@ -92,80 +97,77 @@ public class StationBasicController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/delete"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除场站基础信息表"
,
notes
=
"根据sequenceNbr删除场站基础信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"ids"
)
String
ids
){
try
{
String
[]
idss
=
ids
.
split
(
","
);
int
num
=
stationBasicServiceImpl
.
deleteList
(
idss
);
return
ResponseHelper
.
buildResponse
(
num
>
0
?
true
:
false
);
}
catch
(
InnerInvokException
e
){
return
this
.
buildResponseFalse
(
e
.
getMessage
());
}
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"ids"
)
String
ids
)
{
if
(
stationBasicServiceImpl
.
getStationPersonByStationID
(
ids
)
>
0
)
{
return
this
.
buildResponseFalse
(
"请删除场站下的人员后再删除场站!"
);
}
int
num
=
stationBasicServiceImpl
.
deleteList
(
ids
);
return
ResponseHelper
.
buildResponse
(
num
>
0
?
true
:
false
);
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr
主键
* @param sequenceNbr
主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getById"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个场站基础信息表"
,
notes
=
"根据sequenceNbr查询单个场站基础信息表"
)
public
ResponseModel
<
StationBasic
>
selectOne
(
@RequestParam
Long
sequenceNbr
)
{
StationBasic
stationBasic
=
stationBasicServiceImpl
.
getById
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
stationBasic
);
}
/**
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getById"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个场站基础信息表"
,
notes
=
"根据sequenceNbr查询单个场站基础信息表"
)
public
ResponseModel
<
StationBasic
>
selectOne
(
@RequestParam
Long
sequenceNbr
)
{
StationBasic
stationBasic
=
stationBasicServiceImpl
.
getById
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
stationBasic
);
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站基础信息表分页查询"
,
notes
=
"场站基础信息表分页查询"
)
public
ResponseModel
<
Page
<
StationBasicDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站基础信息表分页查询"
,
notes
=
"场站基础信息表分页查询"
)
public
ResponseModel
<
Page
<
StationBasicDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"stationMasterName"
,
required
=
false
)
String
stationMasterName
,
@RequestParam
(
value
=
"stationName"
,
required
=
false
)
String
stationName
,
@RequestParam
(
value
=
"stationType"
,
required
=
false
)
String
stationType
,
@RequestParam
(
value
=
"orgCode"
,
required
=
false
)
String
orgCode
@RequestParam
(
value
=
"stationMasterName"
,
required
=
false
)
String
stationMasterName
,
@RequestParam
(
value
=
"stationName"
,
required
=
false
)
String
stationName
,
@RequestParam
(
value
=
"stationType"
,
required
=
false
)
String
stationType
,
@RequestParam
(
value
=
"orgCode"
,
required
=
false
)
String
orgCode
)
{
Page
<
StationBasicDto
>
page
=
new
Page
<
StationBasicDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
stationBasicServiceImpl
.
queryPage
(
page
,
stationMasterName
,
Page
<
StationBasicDto
>
page
=
new
Page
<
StationBasicDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
stationBasicServiceImpl
.
queryPage
(
page
,
stationMasterName
,
stationName
,
stationType
,
orgCode
));
}
orgCode
));
}
/**
* 场站地图接口
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站基础信息表列表全部数据查询"
,
notes
=
"场站基础信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
StationBasicDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
stationBasicServiceImpl
.
queryForStationBasicList
());
}
/**
* 场站地图接口
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站基础信息表列表全部数据查询"
,
notes
=
"场站基础信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
StationBasicDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
stationBasicServiceImpl
.
queryForStationBasicList
());
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站地图数据"
,
notes
=
"场站地图数据"
)
@GetMapping
(
value
=
"/listforMap"
)
public
ResponseModel
<
List
<
StationInfoDto
>>
getStationList
(
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
)
{
return
ResponseHelper
.
buildResponse
(
stationBasicServiceImpl
.
getStationList
(
areaCode
));
}
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站地图数据"
,
notes
=
"场站地图数据"
)
@GetMapping
(
value
=
"/listforMap"
)
public
ResponseModel
<
List
<
StationInfoDto
>>
getStationList
(
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
)
{
return
ResponseHelper
.
buildResponse
(
stationBasicServiceImpl
.
getStationList
(
areaCode
));
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/StationBasicServiceImpl.java
View file @
a06b44b0
...
...
@@ -28,6 +28,8 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -238,9 +240,7 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
}
public
int
deleteList
(
String
[]
ids
){
public
int
deleteList
(
String
ids
){
QueryWrapper
<
StationBasic
>
wrapper
=
new
QueryWrapper
();
wrapper
.
in
(
"sequence_nbr"
,
ids
);
List
<
StationBasic
>
list
=
this
.
list
(
wrapper
);
...
...
@@ -250,9 +250,8 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
}
//删除平台
this
.
deleteCompany
(
String
.
join
(
","
,
idscom
));
return
stationBasicMapper
.
deleteList
(
ids
);
}
return
stationBasicMapper
.
deleteList
(
ids
);
}
public
StationBasic
getById
(
Long
sequenceNbr
){
...
...
@@ -276,5 +275,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
public
List
<
StationInfoDto
>
getStationList
(
String
areaCode
){
return
stationBasicMapper
.
getStationList
(
areaCode
);
}
public
int
getStationPersonByStationID
(
String
id
)
{
return
stationBasicMapper
.
getStationPersonByStationID
(
id
);};
}
\ No newline at end of file
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