Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
Details
Activity
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
zhangkb
indicators
Commits
66f29aea
Commit
66f29aea
authored
Aug 27, 2020
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询规则类别名称
parent
71c0d3fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
15 deletions
+30
-15
TaskRuleCtrl.java
.../com/keymobile/indicators/api/hytobacco/TaskRuleCtrl.java
+25
-0
TaskRuleServiceImpl.java
...ndicators/service/dataenter/impl/TaskRuleServiceImpl.java
+4
-14
TaskRuleMapper.xml
src/main/resources/mybatis/mapping/TaskRuleMapper.xml
+1
-1
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/TaskRuleCtrl.java
View file @
66f29aea
...
@@ -100,6 +100,31 @@ public class TaskRuleCtrl {
...
@@ -100,6 +100,31 @@ public class TaskRuleCtrl {
}
}
return
result
;
return
result
;
}
}
@ApiOperation
(
"根据机构编号获取对应的规则名类别"
)
@GetMapping
(
"findRuleLevelsByOrgNo"
)
public
List
<
String
>
findRuleLevelsByOrgNo
(
@RequestParam
(
"orgNo"
)
String
orgNo
){
List
<
String
>
levels
=
new
ArrayList
<>();
String
key
=
""
;
if
(
StringUtils
.
isNotBlank
(
orgNo
)){
switch
(
orgNo
.
length
()){
case
2
:
key
=
"RULE_NAME_PRINVINCE"
;
break
;
case
4
:
key
=
"RULE_NAME_CITY"
;
break
;
case
6
:
key
=
"RULE_NAME_COUNTY"
;
break
;
default
:
key
=
null
;
}
if
(
key
!=
null
){
ConfigInfo
configInfoById
=
configInfoService
.
getConfigInfoById
(
key
);
String
cfValue
=
configInfoById
.
getCfValue
();
String
[]
split
=
cfValue
.
split
(
Constants
.
SEP_COMMA
);
levels
=
Arrays
.
asList
(
split
);
}
}
return
levels
;
}
@ApiOperation
(
"根据规则类型获取任务单位列表"
)
@ApiOperation
(
"根据规则类型获取任务单位列表"
)
@GetMapping
(
"findGroupObjs"
)
@GetMapping
(
"findGroupObjs"
)
...
...
src/main/java/com/keymobile/indicators/service/dataenter/impl/TaskRuleServiceImpl.java
View file @
66f29aea
...
@@ -9,6 +9,7 @@ import com.keymobile.indicators.model.mapper.indicators.TaskRuleMapper;
...
@@ -9,6 +9,7 @@ import com.keymobile.indicators.model.mapper.indicators.TaskRuleMapper;
import
com.keymobile.indicators.model.mapper.indicators.TaskRuleObjMapper
;
import
com.keymobile.indicators.model.mapper.indicators.TaskRuleObjMapper
;
import
com.keymobile.indicators.service.dataenter.TaskRuleService
;
import
com.keymobile.indicators.service.dataenter.TaskRuleService
;
import
com.keymobile.indicators.service.dataenter.TaskService
;
import
com.keymobile.indicators.service.dataenter.TaskService
;
import
com.keymobile.indicators.utils.SystemUserUtil
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.BooleanUtils
;
import
org.apache.commons.lang.BooleanUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -102,21 +103,10 @@ public class TaskRuleServiceImpl implements TaskRuleService {
...
@@ -102,21 +103,10 @@ public class TaskRuleServiceImpl implements TaskRuleService {
@Override
@Override
public
Page
<
TaskRule
>
findRuleByPage
(
Integer
ruleType
,
String
ruleLevel
,
String
keyword
,
int
page
,
int
pageSize
,
String
orgNo
,
Boolean
sysAdmin
)
{
public
Page
<
TaskRule
>
findRuleByPage
(
Integer
ruleType
,
String
ruleLevel
,
String
keyword
,
int
page
,
int
pageSize
,
String
orgNo
,
Boolean
sysAdmin
)
{
// Integer oryType = null;
if
(
BooleanUtils
.
isTrue
(
sysAdmin
)){
boolean
tmp
=
true
;
orgNo
=
null
;
// if(!BooleanUtils.isTrue(sysAdmin)){
// if(StringUtils.isNotBlank(orgNo)){
// oryType = orgNo.length()/2;
// }else{
// //不是省市县任何一种类型且不是管理员
// tmp = false;
// }
// }
orgNo
=
null
;
long
total
=
0
;
if
(
tmp
){
total
=
taskRuleMapper
.
findRuleCount
(
ruleType
,
ruleLevel
,
keyword
,
orgNo
);
}
}
long
total
=
taskRuleMapper
.
findRuleCount
(
ruleType
,
ruleLevel
,
keyword
,
orgNo
);
PageRequest
request
=
PageRequest
.
of
(
page
-
1
,
pageSize
);
PageRequest
request
=
PageRequest
.
of
(
page
-
1
,
pageSize
);
List
<
TaskRule
>
list
=
new
ArrayList
<>();
List
<
TaskRule
>
list
=
new
ArrayList
<>();
...
...
src/main/resources/mybatis/mapping/TaskRuleMapper.xml
View file @
66f29aea
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
and rule.name like concat('%', #{keyword}, '%')
and rule.name like concat('%', #{keyword}, '%')
</if>
</if>
<if
test=
"orgNo != null and orgNo != ''"
>
<if
test=
"orgNo != null and orgNo != ''"
>
and rule.org
N
o = #{orgNo}
and rule.org
_n
o = #{orgNo}
</if>
</if>
</sql>
</sql>
<select
id=
"findRuleCount"
resultType=
"long"
>
<select
id=
"findRuleCount"
resultType=
"long"
>
...
...
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