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
ea527b1a
Commit
ea527b1a
authored
Jan 25, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: “场站”、“片区”等下拉列表接口查询增加权限控制
parent
25eeef38
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
2 deletions
+111
-2
IdxBizFanPointProcessVariableClassificationController.java
...dxBizFanPointProcessVariableClassificationController.java
+8
-2
IdxBizTableController.java
...ot/module/jxiop/biz/controller/IdxBizTableController.java
+16
-0
IdxBizTableMapper.java
...amos/boot/module/jxiop/biz/mapper2/IdxBizTableMapper.java
+19
-0
IIdxBizTableService.java
...os/boot/module/jxiop/biz/service/IIdxBizTableService.java
+13
-0
IdxBizTableServiceImpl.java
...module/jxiop/biz/service/impl/IdxBizTableServiceImpl.java
+23
-0
IdxBizTableMapper.xml
...z/src/main/resources/mapper/cluster/IdxBizTableMapper.xml
+32
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizFanPointProcessVariableClassificationController.java
View file @
ea527b1a
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanPointProcessVariableClassificationDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizTableService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanPointProcessVariableClassificationServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -18,7 +19,7 @@ import java.util.List;
import
java.util.Map
;
/**
*
*
*
* @author system_generator
* @date 2023-08-15
...
...
@@ -31,6 +32,9 @@ public class IdxBizFanPointProcessVariableClassificationController extends BaseC
@Autowired
IdxBizFanPointProcessVariableClassificationServiceImpl
idxBizFanPointProcessVariableClassificationServiceImpl
;
@Autowired
private
IIdxBizTableService
idxBizTableService
;
/**
* 新增
*
...
...
@@ -125,7 +129,9 @@ public class IdxBizFanPointProcessVariableClassificationController extends BaseC
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@GetMapping
(
value
=
"/selectParams"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
selectParams
(
String
tableName
,
String
column
,
@RequestParam
(
required
=
false
)
String
isFx
)
{
return
ResponseHelper
.
buildResponse
(
idxBizFanPointProcessVariableClassificationServiceImpl
.
selectParams
(
column
,
tableName
,
isFx
));
// return ResponseHelper.buildResponse(idxBizFanPointProcessVariableClassificationServiceImpl.selectParams(column,tableName,isFx));
List
<
Map
<
String
,
Object
>>
selectOptions
=
idxBizTableService
.
getSelectOptions
(
tableName
,
column
,
null
,
null
,
null
,
isFx
);
return
ResponseHelper
.
buildResponse
(
selectOptions
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizTableController.java
View file @
ea527b1a
...
...
@@ -14,6 +14,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.Map
;
@RestController
...
...
@@ -30,4 +31,19 @@ public class IdxBizTableController {
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTablePage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
idxBizTableService
.
getPage
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表下拉框选项数据"
,
notes
=
"列表下拉框选项数据"
)
@GetMapping
(
value
=
"/select-options"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getSelectOptions
(
@RequestParam
(
value
=
"tableName"
)
String
tableName
,
@RequestParam
(
value
=
"column"
)
String
column
,
@RequestParam
(
value
=
"valueColumn"
,
required
=
false
)
String
valueColumn
,
@RequestParam
(
value
=
"conditionColumn"
,
required
=
false
)
String
conditionColumn
,
@RequestParam
(
value
=
"conditionValue"
,
required
=
false
)
String
conditionValue
,
@RequestParam
(
value
=
"isFx"
,
required
=
false
)
String
isFx
)
{
List
<
Map
<
String
,
Object
>>
selectOptions
=
idxBizTableService
.
getSelectOptions
(
tableName
,
column
,
valueColumn
,
conditionColumn
,
conditionValue
,
isFx
);
return
ResponseHelper
.
buildResponse
(
selectOptions
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizTableMapper.java
0 → 100644
View file @
ea527b1a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
mapper2
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
IdxBizTableMapper
extends
BaseMapper
{
List
<
Map
<
String
,
Object
>>
getSelectOptions
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"column"
)
String
column
,
@Param
(
"valueColumn"
)
String
valueColumn
,
@Param
(
"conditionColumn"
)
String
conditionColumn
,
@Param
(
"conditionValue"
)
String
conditionValue
,
@Param
(
"isFx"
)
String
isFx
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/IIdxBizTableService.java
View file @
ea527b1a
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
import
java.util.Map
;
public
interface
IIdxBizTableService
{
...
...
@@ -11,4 +12,16 @@ public interface IIdxBizTableService {
* @param map 查询参数
*/
Page
<
Map
<
String
,
Object
>>
getPage
(
Map
<
String
,
Object
>
map
);
/**
* 获取下拉列表参数
*
* @param tableName 表名
* @param column 列名
* @param valueColumn 数据值列
* @param conditionColumn 条件列名
* @param conditionValue 条件值
* @param isFx 是否是"分析变量"
*/
List
<
Map
<
String
,
Object
>>
getSelectOptions
(
String
tableName
,
String
column
,
String
valueColumn
,
String
conditionColumn
,
String
conditionValue
,
String
isFx
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/IdxBizTableServiceImpl.java
View file @
ea527b1a
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.IdxFeign
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizTableMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizTableService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -22,6 +23,9 @@ public class IdxBizTableServiceImpl implements IIdxBizTableService {
private
IPermissionService
permissionService
;
@Autowired
private
IdxBizTableMapper
idxBizTableMapper
;
@Autowired
private
IdxFeign
idxFeign
;
/**
...
...
@@ -41,4 +45,23 @@ public class IdxBizTableServiceImpl implements IIdxBizTableService {
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
idxFeign
.
getPage
(
map
);
return
page
.
getResult
();
}
/**
* 获取下拉列表参数
*
* @param tableName 表名
* @param column 列名
* @param valueColumn 数据值列
* @param conditionColumn 条件列名
* @param conditionValue 条件值
* @param isFx 是否是"分析变量"
*/
@Override
public
List
<
Map
<
String
,
Object
>>
getSelectOptions
(
String
tableName
,
String
column
,
String
valueColumn
,
String
conditionColumn
,
String
conditionValue
,
String
isFx
)
{
List
<
String
>
permissions
=
permissionService
.
getCurrentUserPermissions
();
if
(
Objects
.
isNull
(
permissions
))
{
permissions
=
new
ArrayList
<>();
}
return
idxBizTableMapper
.
getSelectOptions
(
tableName
,
column
,
valueColumn
,
conditionColumn
,
conditionValue
,
isFx
,
permissions
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizTableMapper.xml
0 → 100644
View file @
ea527b1a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizTableMapper"
>
<select
id=
"getSelectOptions"
resultType=
"java.util.Map"
>
SELECT
DISTINCT ${column} AS text,
<if
test=
"valueColumn != null and valueColumn != ''"
>
${valueColumn} AS value
</if>
<if
test=
"valueColumn == null or valueColumn == ''"
>
${column} AS value
</if>
FROM
${tableName}
WHERE
${column} IS NOT NULL AND ${column} != ''
<if
test=
"isFx != null and isFx != ''"
>
AND TAG_CODE = '分析变量'
</if>
<if
test=
"conditionColumn != null and conditionColumn != '' and conditionValue != null and conditionValue != ''"
>
AND ${conditionColumn} = #{conditionValue}
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
AND GATEWAY_ID IN
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</if>
GROUP BY
${column}
</select>
</mapper>
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