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
7adb7f00
Commit
7adb7f00
authored
Aug 13, 2020
by
张祺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改规则判断同名的方法
parent
1038ba8a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
TaskRuleCtrl.java
.../com/keymobile/indicators/api/hytobacco/TaskRuleCtrl.java
+1
-1
TaskRuleMapper.java
...le/indicators/model/mapper/indicators/TaskRuleMapper.java
+2
-2
TaskRuleService.java
...ymobile/indicators/service/dataenter/TaskRuleService.java
+2
-1
TaskRuleServiceImpl.java
...ndicators/service/dataenter/impl/TaskRuleServiceImpl.java
+2
-2
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 @
7adb7f00
...
...
@@ -74,7 +74,7 @@ public class TaskRuleCtrl {
@PostMapping
(
"save"
)
public
Result
save
(
@RequestBody
TaskRule
rule
)
{
Result
result
=
null
;
TaskRule
temp
=
taskRuleService
.
findRuleByName
(
rule
.
getRule
Type
(),
rule
.
getName
());
TaskRule
temp
=
taskRuleService
.
findRuleByName
(
rule
.
getRule
Level
(),
rule
.
getName
());
if
(
temp
!=
null
&&
!
temp
.
getId
().
equals
(
rule
.
getId
()))
{
result
=
Result
.
genFailedResult
(
"已经存在同名任务规则定义!"
);
}
else
{
...
...
src/main/java/com/keymobile/indicators/model/mapper/indicators/TaskRuleMapper.java
View file @
7adb7f00
...
...
@@ -25,11 +25,11 @@ public interface TaskRuleMapper extends BaseMapper<TaskRule> {
/**
* 根据类型和名字获取任务规则
* @param rule
Type
* @param rule
Level
* @param name
* @return
*/
TaskRule
findRuleByName
(
@Param
(
"rule
Type"
)
Integer
ruleType
,
@Param
(
"name"
)
String
name
);
TaskRule
findRuleByName
(
@Param
(
"rule
Level"
)
String
ruleLevel
,
@Param
(
"name"
)
String
name
);
/**
* 分页查询填报任务规则
...
...
src/main/java/com/keymobile/indicators/service/dataenter/TaskRuleService.java
View file @
7adb7f00
...
...
@@ -27,10 +27,11 @@ public interface TaskRuleService {
/**
* 根据名字获取规则
* @param ruleLevel
* @param name
* @return
*/
TaskRule
findRuleByName
(
Integer
ruleType
,
String
name
);
TaskRule
findRuleByName
(
String
ruleLevel
,
String
name
);
/**
* 创建规则
...
...
src/main/java/com/keymobile/indicators/service/dataenter/impl/TaskRuleServiceImpl.java
View file @
7adb7f00
...
...
@@ -50,8 +50,8 @@ public class TaskRuleServiceImpl implements TaskRuleService {
}
@Override
public
TaskRule
findRuleByName
(
Integer
ruleType
,
String
name
)
{
return
taskRuleMapper
.
findRuleByName
(
rule
Type
,
name
);
public
TaskRule
findRuleByName
(
String
ruleLevel
,
String
name
)
{
return
taskRuleMapper
.
findRuleByName
(
rule
Level
,
name
);
}
@Override
...
...
src/main/resources/mybatis/mapping/TaskRuleMapper.xml
View file @
7adb7f00
...
...
@@ -19,7 +19,7 @@
select *
from data_enter_task_rule
where state = 1
and rule_
type = #{ruleType
}
and rule_
level = #{ruleLevel
}
and name = #{name}
limit 1
</select>
...
...
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