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
1ba5481a
Commit
1ba5481a
authored
Jul 09, 2020
by
张祺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改在线填报相关数据
parent
631560aa
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
183 additions
and
47 deletions
+183
-47
DataEnterCtrl.java
...com/keymobile/indicators/api/hytobacco/DataEnterCtrl.java
+31
-11
TaskCtrl.java
...java/com/keymobile/indicators/api/hytobacco/TaskCtrl.java
+1
-2
TaskRuleCtrl.java
.../com/keymobile/indicators/api/hytobacco/TaskRuleCtrl.java
+5
-2
TaskRuleGroupObjCtrl.java
...mobile/indicators/api/hytobacco/TaskRuleGroupObjCtrl.java
+73
-4
AuthModel.java
...java/com/keymobile/indicators/model/entity/AuthModel.java
+1
-1
TaskRuleMapper.java
...le/indicators/model/mapper/indicators/TaskRuleMapper.java
+7
-0
TaskRuleObjMapper.java
...indicators/model/mapper/indicators/TaskRuleObjMapper.java
+4
-1
SystemAuthService.java
...a/com/keymobile/indicators/service/SystemAuthService.java
+8
-0
TaskRuleGroupObjService.java
...indicators/service/dataenter/TaskRuleGroupObjService.java
+11
-1
TaskRuleService.java
...ymobile/indicators/service/dataenter/TaskRuleService.java
+2
-1
TaskRuleGroupObjServiceImpl.java
...s/service/dataenter/impl/TaskRuleGroupObjServiceImpl.java
+6
-1
TaskRuleServiceImpl.java
...ndicators/service/dataenter/impl/TaskRuleServiceImpl.java
+4
-2
TaskRuleMapper.xml
src/main/resources/mybatis/mapping/TaskRuleMapper.xml
+21
-21
TaskRuleObjMapper.xml
src/main/resources/mybatis/mapping/TaskRuleObjMapper.xml
+9
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/DataEnterCtrl.java
View file @
1ba5481a
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
com.alibaba.fastjson.JSONObject
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.AuthModel
;
import
com.keymobile.indicators.model.entity.dataenter.*
;
import
com.keymobile.indicators.model.entity.dataenter.*
;
import
com.keymobile.indicators.result.Result
;
import
com.keymobile.indicators.result.Result
;
import
com.keymobile.indicators.service.SystemAuthService
;
import
com.keymobile.indicators.service.dataenter.ExcelTemplateService
;
import
com.keymobile.indicators.service.dataenter.ExcelTemplateService
;
import
com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService
;
import
com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService
;
import
com.keymobile.indicators.service.dataenter.TaskService
;
import
com.keymobile.indicators.service.dataenter.TaskService
;
...
@@ -24,10 +27,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -24,10 +27,7 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
@Api
(
tags
={
"数据填报-在线填报、excel导入"
})
@Api
(
tags
={
"数据填报-在线填报、excel导入"
})
@RestController
@RestController
...
@@ -44,6 +44,9 @@ public class DataEnterCtrl {
...
@@ -44,6 +44,9 @@ public class DataEnterCtrl {
@Autowired
@Autowired
private
TaskRuleGroupObjService
taskRuleGroupObjService
;
private
TaskRuleGroupObjService
taskRuleGroupObjService
;
@Autowired
private
SystemAuthService
systemAuthService
;
@ApiOperation
(
"获取需要在线填报的数据项"
)
@ApiOperation
(
"获取需要在线填报的数据项"
)
@GetMapping
(
"findToEdit"
)
@GetMapping
(
"findToEdit"
)
public
List
<
TaskIndValue
>
findToEdit
(
@RequestParam
(
"taskId"
)
String
taskId
)
{
public
List
<
TaskIndValue
>
findToEdit
(
@RequestParam
(
"taskId"
)
String
taskId
)
{
...
@@ -55,7 +58,21 @@ public class DataEnterCtrl {
...
@@ -55,7 +58,21 @@ public class DataEnterCtrl {
List
<
TaskIndicator
>
taskIndicators
=
task
.
getIndicators
();
List
<
TaskIndicator
>
taskIndicators
=
task
.
getIndicators
();
if
(
CollectionUtils
.
isNotEmpty
(
taskIndicators
))
{
if
(
CollectionUtils
.
isNotEmpty
(
taskIndicators
))
{
TaskRuleGroupObj
groupObj
=
taskRuleGroupObjService
.
getById
(
task
.
getGroupId
());
TaskRuleGroupObj
groupObj
=
taskRuleGroupObjService
.
getById
(
task
.
getGroupId
());
if
(
groupObj
!=
null
)
{
List
<
AuthModel
>
objs
=
new
ArrayList
<>();
String
[]
ids
=
StringUtils
.
split
(
groupObj
.
getDetail
(),
Constants
.
SEP_COMMA
);
List
<
String
>
idList
=
Arrays
.
asList
(
ids
);
switch
(
groupObj
.
getObjType
())
{
case
Constants
.
OBJ_TYPE_ORG
:
List
<
JSONObject
>
orgs
=
systemAuthService
.
getOrgByIds
(
idList
);
for
(
JSONObject
jo
:
orgs
)
{
}
break
;
}
if
(
objs
.
isEmpty
())
{
log
.
error
(
"没有可用的填报单位信息"
);
}
else
{
List
<
TaskIndValue
>
oldValues
=
taskService
.
findValues
(
taskId
,
Constants
.
INPUT_ONLINE
);
List
<
TaskIndValue
>
oldValues
=
taskService
.
findValues
(
taskId
,
Constants
.
INPUT_ONLINE
);
if
(
CollectionUtils
.
isEmpty
(
oldValues
))
{
if
(
CollectionUtils
.
isEmpty
(
oldValues
))
{
//新增
//新增
...
@@ -64,9 +81,11 @@ public class DataEnterCtrl {
...
@@ -64,9 +81,11 @@ public class DataEnterCtrl {
indIds
.
add
(
indicator
.
getIndId
());
indIds
.
add
(
indicator
.
getIndId
());
}
}
List
<
TaskIndValue
>
defaultValues
=
taskService
.
findDefaultValues
(
task
.
getValueTime
(),
indIds
);
List
<
TaskIndValue
>
defaultValues
=
taskService
.
findDefaultValues
(
task
.
getValueTime
(),
indIds
);
list
=
genernateEditObjects
(
task
,
defaultValues
,
orgId
,
orgName
,
Constants
.
OBJ_TYPE_ORG
);
list
=
genernateEditObjects
(
task
,
defaultValues
,
objs
,
groupObj
.
getObjType
()
);
}
else
{
}
else
{
list
=
genernateEditObjects
(
task
,
oldValues
,
orgId
,
orgName
,
Constants
.
OBJ_TYPE_ORG
);
list
=
genernateEditObjects
(
task
,
oldValues
,
objs
,
groupObj
.
getObjType
());
}
}
}
}
}
}
return
list
;
return
list
;
...
@@ -76,13 +95,12 @@ public class DataEnterCtrl {
...
@@ -76,13 +95,12 @@ public class DataEnterCtrl {
* 生成填写对象
* 生成填写对象
* @param task
* @param task
* @param oldValues
* @param oldValues
* @param objId
* @param objs
* @param objName
* @param objType
* @param objType
* @return
* @return
*/
*/
private
List
<
TaskIndValue
>
genernateEditObjects
(
Task
task
,
List
<
TaskIndValue
>
oldValues
,
private
List
<
TaskIndValue
>
genernateEditObjects
(
Task
task
,
List
<
TaskIndValue
>
oldValues
,
String
objId
,
String
objName
,
Integer
objType
)
{
List
<
AuthModel
>
objs
,
Integer
objType
)
{
List
<
TaskIndValue
>
list
=
new
ArrayList
<>();
List
<
TaskIndValue
>
list
=
new
ArrayList
<>();
List
<
TaskIndicator
>
taskIndicators
=
task
.
getIndicators
();
List
<
TaskIndicator
>
taskIndicators
=
task
.
getIndicators
();
for
(
TaskIndicator
indicator
:
taskIndicators
)
{
for
(
TaskIndicator
indicator
:
taskIndicators
)
{
...
@@ -91,13 +109,14 @@ public class DataEnterCtrl {
...
@@ -91,13 +109,14 @@ public class DataEnterCtrl {
continue
;
continue
;
}
}
if
(
indicator
.
getIndSource
()
==
Constants
.
INPUT_ONLINE
)
{
if
(
indicator
.
getIndSource
()
==
Constants
.
INPUT_ONLINE
)
{
for
(
AuthModel
obj
:
objs
)
{
TaskIndValue
value
=
new
TaskIndValue
();
TaskIndValue
value
=
new
TaskIndValue
();
value
.
setIndId
(
indicator
.
getIndId
());
value
.
setIndId
(
indicator
.
getIndId
());
value
.
setIndName
(
indicator
.
getIndName
());
value
.
setIndName
(
indicator
.
getIndName
());
value
.
setValueTime
(
task
.
getValueTime
());
value
.
setValueTime
(
task
.
getValueTime
());
value
.
setIndUnit
(
indicator
.
getIndUnit
());
value
.
setIndUnit
(
indicator
.
getIndUnit
());
value
.
setObjId
(
objId
);
value
.
setObjId
(
obj
.
getId
()
);
value
.
setObjName
(
objName
);
value
.
setObjName
(
obj
.
getName
()
);
value
.
setObjType
(
objType
);
value
.
setObjType
(
objType
);
for
(
TaskIndValue
old
:
oldValues
)
{
for
(
TaskIndValue
old
:
oldValues
)
{
if
(
old
.
getIndId
().
equals
(
value
.
getIndId
())
if
(
old
.
getIndId
().
equals
(
value
.
getIndId
())
...
@@ -110,6 +129,7 @@ public class DataEnterCtrl {
...
@@ -110,6 +129,7 @@ public class DataEnterCtrl {
list
.
add
(
value
);
list
.
add
(
value
);
}
}
}
}
}
return
list
;
return
list
;
}
}
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/TaskCtrl.java
View file @
1ba5481a
...
@@ -51,7 +51,7 @@ public class TaskCtrl {
...
@@ -51,7 +51,7 @@ public class TaskCtrl {
public
Result
generateTaskByRule
(
@ApiParam
(
"规则id"
)
@RequestParam
(
"ruleId"
)
Integer
ruleId
,
public
Result
generateTaskByRule
(
@ApiParam
(
"规则id"
)
@RequestParam
(
"ruleId"
)
Integer
ruleId
,
@ApiParam
(
"收数月份, 格式: 2020-03、2020-06、2020-09、2020-12"
)
@RequestParam
(
"valueTime"
)
String
valueTime
)
{
@ApiParam
(
"收数月份, 格式: 2020-03、2020-06、2020-09、2020-12"
)
@RequestParam
(
"valueTime"
)
String
valueTime
)
{
Result
result
=
null
;
Result
result
=
null
;
TaskRule
rule
=
taskRuleService
.
getById
(
ruleId
);
TaskRule
rule
=
taskRuleService
.
getById
(
ruleId
,
true
);
if
(
rule
!=
null
)
{
if
(
rule
!=
null
)
{
String
roleIdStr
=
rule
.
getToRoleIds
();
String
roleIdStr
=
rule
.
getToRoleIds
();
if
(
StringUtils
.
isNotBlank
(
roleIdStr
))
{
if
(
StringUtils
.
isNotBlank
(
roleIdStr
))
{
...
@@ -71,7 +71,6 @@ public class TaskCtrl {
...
@@ -71,7 +71,6 @@ public class TaskCtrl {
if
(
StringUtils
.
isBlank
(
refIndDept
))
{
if
(
StringUtils
.
isBlank
(
refIndDept
))
{
continue
;
continue
;
}
}
if
(!
users
.
contains
(
user
))
{
if
(!
users
.
contains
(
user
))
{
users
.
add
(
user
);
users
.
add
(
user
);
}
}
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/TaskRuleCtrl.java
View file @
1ba5481a
...
@@ -44,7 +44,7 @@ public class TaskRuleCtrl {
...
@@ -44,7 +44,7 @@ public class TaskRuleCtrl {
@ApiOperation
(
"根据规则类型和关键字分页查找任务规则"
)
@ApiOperation
(
"根据规则类型和关键字分页查找任务规则"
)
@GetMapping
(
"findByPage"
)
@GetMapping
(
"findByPage"
)
public
Page
<
TaskRule
>
findByPage
(
@ApiParam
(
"规则类型:1 省级 2 市级 3 县级"
)
public
Page
<
TaskRule
>
findByPage
(
@ApiParam
(
"规则类型:1 省级 2 市级 3 县级"
)
@RequestParam
(
value
=
"ruleType"
,
defaultValue
=
"1"
)
int
ruleType
,
@RequestParam
(
value
=
"ruleType"
,
defaultValue
=
"1"
,
required
=
false
)
int
ruleType
,
@ApiParam
(
"任务层级:省对市、省对县、市对县"
)
@ApiParam
(
"任务层级:省对市、省对县、市对县"
)
@RequestParam
(
value
=
"ruleLevel"
,
required
=
false
)
String
ruleLevel
,
@RequestParam
(
value
=
"ruleLevel"
,
required
=
false
)
String
ruleLevel
,
@ApiParam
(
"搜索关键字(名字)"
)
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@ApiParam
(
"搜索关键字(名字)"
)
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
...
@@ -57,7 +57,7 @@ public class TaskRuleCtrl {
...
@@ -57,7 +57,7 @@ public class TaskRuleCtrl {
@ApiOperation
(
"根据id获取任务规则"
)
@ApiOperation
(
"根据id获取任务规则"
)
@GetMapping
(
"getById"
)
@GetMapping
(
"getById"
)
public
TaskRule
getById
(
@ApiParam
(
"id"
)
@RequestParam
(
"id"
)
Integer
id
)
{
public
TaskRule
getById
(
@ApiParam
(
"id"
)
@RequestParam
(
"id"
)
Integer
id
)
{
return
taskRuleService
.
getById
(
id
);
return
taskRuleService
.
getById
(
id
,
true
);
}
}
@ApiOperation
(
"根据id删除任务规则"
)
@ApiOperation
(
"根据id删除任务规则"
)
...
@@ -87,6 +87,9 @@ public class TaskRuleCtrl {
...
@@ -87,6 +87,9 @@ public class TaskRuleCtrl {
taskRuleService
.
createRule
(
rule
);
taskRuleService
.
createRule
(
rule
);
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"创建了规则name={}"
,
rule
.
getName
());
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"创建了规则name={}"
,
rule
.
getName
());
}
else
{
}
else
{
TaskRule
t
=
taskRuleService
.
getById
(
rule
.
getId
(),
false
);
rule
.
setCreator
(
t
.
getCreator
());
rule
.
setCreateTime
(
t
.
getCreateTime
());
taskRuleService
.
updateRule
(
rule
);
taskRuleService
.
updateRule
(
rule
);
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"修改id={}, name={} 的任务规则"
,
rule
.
getId
(),
rule
.
getName
());
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"修改id={}, name={} 的任务规则"
,
rule
.
getId
(),
rule
.
getName
());
}
}
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/TaskRuleGroupObjCtrl.java
View file @
1ba5481a
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj
;
import
com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj
;
import
com.keymobile.indicators.result.Result
;
import
com.keymobile.indicators.result.Result
;
import
com.keymobile.indicators.service.dataenter.TaskRuleGroupObjService
;
import
com.keymobile.indicators.utils.SystemUserUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.web.bind.annotation.*
;
@Api
(
tags
={
"数据填报-任务单位管理"
})
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@Api
(
tags
=
{
"数据填报-任务单位管理"
})
@RestController
@RestController
@RequestMapping
(
value
=
"/taskRuleGroupObj"
)
@RequestMapping
(
value
=
"/taskRuleGroupObj"
)
@Slf4j
@Slf4j
public
class
TaskRuleGroupObjCtrl
{
public
class
TaskRuleGroupObjCtrl
{
@Autowired
private
TaskRuleGroupObjService
taskRuleGroupObjService
;
@ApiOperation
(
"保存任务单位对象"
)
@PostMapping
(
"save"
)
public
Result
save
(
@RequestBody
TaskRuleGroupObj
obj
)
{
Date
now
=
new
Date
();
String
userId
=
SystemUserUtil
.
getCurrentUserId
();
TaskRuleGroupObj
nt
=
taskRuleGroupObjService
.
getByName
(
obj
.
getRuleType
(),
obj
.
getRuleLevel
(),
obj
.
getName
());
if
(
nt
!=
null
&&
!
nt
.
getId
().
equals
(
obj
.
getId
()))
{
return
Result
.
genFailedResult
(
"同名任务单位已经存在"
);
}
if
(
obj
.
getId
()
==
null
||
obj
.
getId
()
==
0
)
{
obj
.
setCreateTime
(
now
);
obj
.
setCreator
(
userId
);
}
else
{
TaskRuleGroupObj
temp
=
taskRuleGroupObjService
.
getById
(
obj
.
getId
());
obj
.
setCreator
(
temp
.
getCreator
());
obj
.
setCreateTime
(
temp
.
getCreateTime
());
}
obj
.
setState
(
Constants
.
DATA_STATE_A
);
obj
.
setUpdateTime
(
now
);
obj
.
setUpdater
(
userId
);
taskRuleGroupObjService
.
save
(
obj
);
return
Result
.
genOkResult
();
}
public
Result
save
(
TaskRuleGroupObj
obj
)
{
@ApiOperation
(
"删除任务单位对象"
)
@PostMapping
(
"delete"
)
public
Result
delete
(
@RequestParam
(
"id"
)
Integer
id
)
{
taskRuleGroupObjService
.
deleteById
(
id
);
return
Result
.
genOkResult
();
return
Result
.
genOkResult
();
}
}
@ApiOperation
(
"根据id获取任务单位"
)
@GetMapping
(
"getById"
)
public
TaskRuleGroupObj
getById
(
@RequestParam
(
"id"
)
Integer
id
)
{
return
taskRuleGroupObjService
.
getById
(
id
);
}
@ApiOperation
(
"分页查找任务单位对象信息"
)
@PostMapping
(
"find"
)
public
Page
<
TaskRuleGroupObj
>
find
(
@ApiParam
(
"规则类型:1 省级 2 市级 3 县级"
)
@RequestParam
(
value
=
"ruleType"
,
defaultValue
=
"1"
,
required
=
false
)
int
ruleType
,
@ApiParam
(
"任务层级:省对市、省对县、市对县"
)
@RequestParam
(
value
=
"ruleLevel"
,
required
=
false
)
String
ruleLevel
,
@ApiParam
(
"数据对象类型:1、组织机构 2、人员 3、岗位"
)
@RequestParam
(
value
=
"objType"
,
required
=
false
)
Integer
objType
,
@ApiParam
(
"搜索关键字(名字)"
)
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@ApiParam
(
"页码,从1开始"
)
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@ApiParam
(
"每页条数"
)
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
)
{
long
total
=
taskRuleGroupObjService
.
findCount
(
ruleType
,
ruleLevel
,
objType
,
keyword
);
PageRequest
request
=
PageRequest
.
of
(
page
-
1
,
pageSize
);
List
<
TaskRuleGroupObj
>
list
=
new
ArrayList
<>();
if
(
total
>
0
)
{
list
=
taskRuleGroupObjService
.
find
(
ruleType
,
ruleLevel
,
objType
,
keyword
,
request
.
getOffset
(),
pageSize
);
}
Page
<
TaskRuleGroupObj
>
pageResult
=
new
PageImpl
<>(
list
,
request
,
total
);
return
pageResult
;
}
}
}
src/main/java/com/keymobile/indicators/model/entity/AuthModel.java
View file @
1ba5481a
...
@@ -6,7 +6,7 @@ import lombok.Data;
...
@@ -6,7 +6,7 @@ import lombok.Data;
import
java.util.Objects
;
import
java.util.Objects
;
@Data
@Data
@ApiModel
(
"权限对象(角色、用户)"
)
@ApiModel
(
"权限对象(角色、
机构、
用户)"
)
public
class
AuthModel
{
public
class
AuthModel
{
private
String
id
;
private
String
id
;
...
...
src/main/java/com/keymobile/indicators/model/mapper/indicators/TaskRuleMapper.java
View file @
1ba5481a
...
@@ -11,6 +11,13 @@ import java.util.List;
...
@@ -11,6 +11,13 @@ import java.util.List;
public
interface
TaskRuleMapper
extends
BaseMapper
<
TaskRule
>
{
public
interface
TaskRuleMapper
extends
BaseMapper
<
TaskRule
>
{
/**
/**
* 根据id获取
* @param id
* @return
*/
TaskRule
getById
(
Integer
id
);
/**
* 逻辑删除任务规则
* 逻辑删除任务规则
* @param id
* @param id
*/
*/
...
...
src/main/java/com/keymobile/indicators/model/mapper/indicators/TaskRuleObjMapper.java
View file @
1ba5481a
...
@@ -46,7 +46,7 @@ public interface TaskRuleObjMapper extends BaseMapper<TaskRuleGroupObj> {
...
@@ -46,7 +46,7 @@ public interface TaskRuleObjMapper extends BaseMapper<TaskRuleGroupObj> {
List
<
TaskRuleGroupObj
>
find
(
@Param
(
"ruleType"
)
Integer
ruleType
,
@Param
(
"ruleLevel"
)
String
ruleLevel
,
List
<
TaskRuleGroupObj
>
find
(
@Param
(
"ruleType"
)
Integer
ruleType
,
@Param
(
"ruleLevel"
)
String
ruleLevel
,
@Param
(
"objType"
)
Integer
objType
,
@Param
(
"objType"
)
Integer
objType
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"start"
)
int
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"size"
)
int
size
);
@Param
(
"size"
)
int
size
);
/**
/**
...
@@ -60,4 +60,7 @@ public interface TaskRuleObjMapper extends BaseMapper<TaskRuleGroupObj> {
...
@@ -60,4 +60,7 @@ public interface TaskRuleObjMapper extends BaseMapper<TaskRuleGroupObj> {
long
findCount
(
@Param
(
"ruleType"
)
Integer
ruleType
,
@Param
(
"ruleLevel"
)
String
ruleLevel
,
long
findCount
(
@Param
(
"ruleType"
)
Integer
ruleType
,
@Param
(
"ruleLevel"
)
String
ruleLevel
,
@Param
(
"objType"
)
Integer
objType
,
@Param
(
"objType"
)
Integer
objType
,
@Param
(
"keyword"
)
String
keyword
);
@Param
(
"keyword"
)
String
keyword
);
TaskRuleGroupObj
findByName
(
@Param
(
"ruleType"
)
Integer
ruleType
,
@Param
(
"ruleLevel"
)
String
ruleLevel
,
@Param
(
"name"
)
String
name
);
}
}
src/main/java/com/keymobile/indicators/service/SystemAuthService.java
View file @
1ba5481a
...
@@ -39,4 +39,12 @@ public interface SystemAuthService {
...
@@ -39,4 +39,12 @@ public interface SystemAuthService {
@GetMapping
(
"/role/getByIds"
)
@GetMapping
(
"/role/getByIds"
)
List
<
JSONObject
>
getRolesByIds
(
@RequestParam
(
"roleIds"
)
List
<
String
>
roleIds
);
List
<
JSONObject
>
getRolesByIds
(
@RequestParam
(
"roleIds"
)
List
<
String
>
roleIds
);
/**
* 根据机构id列表获取角色列表
* @param orgIds
* @return
*/
@GetMapping
(
"/org/getByIds"
)
List
<
JSONObject
>
getOrgByIds
(
@RequestParam
(
"orgIds"
)
List
<
String
>
orgIds
);
}
}
src/main/java/com/keymobile/indicators/service/dataenter/TaskRuleGroupObjService.java
View file @
1ba5481a
...
@@ -23,6 +23,16 @@ public interface TaskRuleGroupObjService {
...
@@ -23,6 +23,16 @@ public interface TaskRuleGroupObjService {
TaskRuleGroupObj
getById
(
Integer
id
);
TaskRuleGroupObj
getById
(
Integer
id
);
/**
/**
* 根据ruleType、ruleLevel、objType和name获取获取任务单位
* @param ruleType
* @param ruleLevel
* @param name
* @return
*/
TaskRuleGroupObj
getByName
(
Integer
ruleType
,
String
ruleLevel
,
String
name
);
/**
* 根据id删除任务单位定义(逻辑删除)
* 根据id删除任务单位定义(逻辑删除)
* @param id
* @param id
*/
*/
...
@@ -39,7 +49,7 @@ public interface TaskRuleGroupObjService {
...
@@ -39,7 +49,7 @@ public interface TaskRuleGroupObjService {
* @return
* @return
*/
*/
List
<
TaskRuleGroupObj
>
find
(
Integer
ruleType
,
String
ruleLevel
,
Integer
objType
,
List
<
TaskRuleGroupObj
>
find
(
Integer
ruleType
,
String
ruleLevel
,
Integer
objType
,
String
keyword
,
int
start
,
int
size
);
String
keyword
,
long
start
,
int
size
);
/**
/**
* 查找任务单位列表总数
* 查找任务单位列表总数
...
...
src/main/java/com/keymobile/indicators/service/dataenter/TaskRuleService.java
View file @
1ba5481a
...
@@ -20,9 +20,10 @@ public interface TaskRuleService {
...
@@ -20,9 +20,10 @@ public interface TaskRuleService {
/**
/**
* 根据id获取规则
* 根据id获取规则
* @param ruleId
* @param ruleId
* @param needInd
* @return
* @return
*/
*/
TaskRule
getById
(
Integer
ruleId
);
TaskRule
getById
(
Integer
ruleId
,
boolean
needInd
);
/**
/**
* 根据名字获取规则
* 根据名字获取规则
...
...
src/main/java/com/keymobile/indicators/service/dataenter/impl/TaskRuleGroupObjServiceImpl.java
View file @
1ba5481a
...
@@ -29,12 +29,17 @@ public class TaskRuleGroupObjServiceImpl implements TaskRuleGroupObjService {
...
@@ -29,12 +29,17 @@ public class TaskRuleGroupObjServiceImpl implements TaskRuleGroupObjService {
}
}
@Override
@Override
public
TaskRuleGroupObj
getByName
(
Integer
ruleType
,
String
ruleLevel
,
String
name
)
{
return
taskRuleObjMapper
.
findByName
(
ruleType
,
ruleLevel
,
name
);
}
@Override
public
void
deleteById
(
Integer
id
)
{
public
void
deleteById
(
Integer
id
)
{
taskRuleObjMapper
.
deleteById
(
id
);
taskRuleObjMapper
.
deleteById
(
id
);
}
}
@Override
@Override
public
List
<
TaskRuleGroupObj
>
find
(
Integer
ruleType
,
String
ruleLevel
,
Integer
objType
,
String
keyword
,
int
start
,
int
size
)
{
public
List
<
TaskRuleGroupObj
>
find
(
Integer
ruleType
,
String
ruleLevel
,
Integer
objType
,
String
keyword
,
long
start
,
int
size
)
{
return
taskRuleObjMapper
.
find
(
ruleType
,
ruleLevel
,
objType
,
keyword
,
start
,
size
);
return
taskRuleObjMapper
.
find
(
ruleType
,
ruleLevel
,
objType
,
keyword
,
start
,
size
);
}
}
...
...
src/main/java/com/keymobile/indicators/service/dataenter/impl/TaskRuleServiceImpl.java
View file @
1ba5481a
...
@@ -40,10 +40,12 @@ public class TaskRuleServiceImpl implements TaskRuleService {
...
@@ -40,10 +40,12 @@ public class TaskRuleServiceImpl implements TaskRuleService {
}
}
@Override
@Override
public
TaskRule
getById
(
Integer
ruleId
)
{
public
TaskRule
getById
(
Integer
ruleId
,
boolean
needInd
)
{
TaskRule
rule
=
taskRuleMapper
.
selectByPrimaryKey
(
ruleId
);
TaskRule
rule
=
taskRuleMapper
.
getById
(
ruleId
);
if
(
needInd
)
{
List
<
TaskRuleIndicator
>
indicators
=
taskRuleIndicatorMapper
.
getByRuleId
(
ruleId
);
List
<
TaskRuleIndicator
>
indicators
=
taskRuleIndicatorMapper
.
getByRuleId
(
ruleId
);
rule
.
setIndicators
(
indicators
);
rule
.
setIndicators
(
indicators
);
}
return
rule
;
return
rule
;
}
}
...
...
src/main/resources/mybatis/mapping/TaskRuleMapper.xml
View file @
1ba5481a
...
@@ -2,6 +2,12 @@
...
@@ -2,6 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indicators.TaskRuleMapper"
>
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indicators.TaskRuleMapper"
>
<select
id=
"getById"
parameterType=
"java.lang.Integer"
>
select rule.*, obj.name as group_name
from data_enter_task_rule rule left join data_enter_rule_obj obj
on rule.group_id = obj.id
where rule.id = #{id}
</select>
<delete
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
<delete
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
update data_enter_task_rule
update data_enter_task_rule
...
@@ -19,34 +25,27 @@
...
@@ -19,34 +25,27 @@
</select>
</select>
<select
id=
"findRuleByPage"
resultType=
"com.keymobile.indicators.model.entity.dataenter.TaskRule"
>
<select
id=
"findRuleByPage"
resultType=
"com.keymobile.indicators.model.entity.dataenter.TaskRule"
>
select *
select rule.*, obj.name as group_name
from data_enter_task_rule
from data_enter_task_rule rule left join data_enter_rule_obj obj
where state = 1
on rule.group_id = obj.id
<if
test=
"ruleType != null"
>
order by rule.update_time desc, name asc
and rule_type = #{ruleType}
</if>
<if
test=
"ruleLevel != null and ruleLevel !=''"
>
and rule_level = #{ruleLevel}
</if>
<if
test=
"keyword != null and keyword != ''"
>
and name like concat('%', keyword, '%')
</if>
order by update_time desc, name asc
limit #{start}, #{pageSize}
limit #{start}, #{pageSize}
</select>
</select>
<sql
id=
"findWhereSql"
>
<select
id=
"findRuleCount"
resultType=
"long"
>
where rule.state = 1
select count(id)
from data_enter_task_rule
where state = 1
<if
test=
"ruleType != null"
>
<if
test=
"ruleType != null"
>
and rule_type = #{ruleType}
and rule
.rule
_type = #{ruleType}
</if>
</if>
<if
test=
"ruleLevel != null and ruleLevel !=''"
>
<if
test=
"ruleLevel != null and ruleLevel !=''"
>
and rule_level = #{ruleLevel}
and rule
.rule
_level = #{ruleLevel}
</if>
</if>
<if
test=
"keyword != null and keyword != ''"
>
<if
test=
"keyword != null and keyword != ''"
>
and
name
name like concat('%', keyword, '%')
and
rule.
name like concat('%', keyword, '%')
</if>
</if>
</sql>
<select
id=
"findRuleCount"
resultType=
"long"
>
select count(id)
from data_enter_task_rule rule
<include
refid=
"findWhereSql"
></include>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/TaskRuleObjMapper.xml
View file @
1ba5481a
...
@@ -55,4 +55,13 @@
...
@@ -55,4 +55,13 @@
and name like concat('%', keyword, '%')
and name like concat('%', keyword, '%')
</if>
</if>
</sql>
</sql>
<select
id=
"findByName"
resultType=
"com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj"
>
select *
from data_enter_rule_obj
where state = 1
and rule_type = #{ruleType}
and rule_level = #{ruleLevel}
and name =#{name}
limit 1
</select>
</mapper>
</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