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
76d9f242
Commit
76d9f242
authored
Jul 10, 2020
by
张祺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改任务审批接口
parent
6fcbdfd8
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
221 additions
and
77 deletions
+221
-77
DataEnterCtrl.java
...com/keymobile/indicators/api/hytobacco/DataEnterCtrl.java
+5
-4
TaskCtrl.java
...java/com/keymobile/indicators/api/hytobacco/TaskCtrl.java
+2
-3
TaskRuleCtrl.java
.../com/keymobile/indicators/api/hytobacco/TaskRuleCtrl.java
+3
-1
Constants.java
...ain/java/com/keymobile/indicators/constant/Constants.java
+12
-1
OrgModel.java
.../java/com/keymobile/indicators/model/entity/OrgModel.java
+1
-1
QueryAllTaskParam.java
.../indicators/model/entity/dataenter/QueryAllTaskParam.java
+8
-5
QueryTaskParam.java
...ile/indicators/model/entity/dataenter/QueryTaskParam.java
+10
-7
Task.java
...com/keymobile/indicators/model/entity/dataenter/Task.java
+8
-0
TaskMapper.java
...mobile/indicators/model/mapper/indicators/TaskMapper.java
+12
-0
SystemAuthService.java
...a/com/keymobile/indicators/service/SystemAuthService.java
+10
-10
TaskService.java
...m/keymobile/indicators/service/dataenter/TaskService.java
+1
-1
TaskServiceImpl.java
...le/indicators/service/dataenter/impl/TaskServiceImpl.java
+139
-44
TaskMapper.xml
src/main/resources/mybatis/mapping/TaskMapper.xml
+10
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/DataEnterCtrl.java
View file @
76d9f242
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
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.AuthModel
;
...
@@ -64,10 +65,10 @@ public class DataEnterCtrl {
...
@@ -64,10 +65,10 @@ public class DataEnterCtrl {
List
<
String
>
idList
=
Arrays
.
asList
(
ids
);
List
<
String
>
idList
=
Arrays
.
asList
(
ids
);
switch
(
groupObj
.
getObjType
())
{
switch
(
groupObj
.
getObjType
())
{
case
Constants
.
OBJ_TYPE_ORG
:
case
Constants
.
OBJ_TYPE_ORG
:
List
<
JSONObject
>
orgs
=
systemAuthService
.
getOrgBy
Id
s
(
idList
);
List
<
JSONObject
>
orgs
=
systemAuthService
.
getOrgBy
No
s
(
idList
);
for
(
JSONObject
jo
:
orgs
)
{
//
for (JSONObject jo : orgs) {
//
}
//
}
break
;
break
;
}
}
if
(
objs
.
isEmpty
())
{
if
(
objs
.
isEmpty
())
{
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/TaskCtrl.java
View file @
76d9f242
...
@@ -42,7 +42,7 @@ public class TaskCtrl {
...
@@ -42,7 +42,7 @@ public class TaskCtrl {
@ApiOperation
(
"(启动)根据规则生成相关填报任务"
)
@ApiOperation
(
"(启动)根据规则生成相关填报任务"
)
@GetMapping
(
"generateTaskByRule"
)
@GetMapping
(
"generateTaskByRule"
)
public
Result
generateTaskByRule
(
@ApiParam
(
"规则id"
)
@RequestParam
(
"ruleId"
)
List
<
Integer
>
ruleIds
,
public
Result
generateTaskByRule
(
@ApiParam
(
"规则id"
)
@RequestParam
(
"ruleId
s
"
)
List
<
Integer
>
ruleIds
,
@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
;
if
(
CollectionUtils
.
isNotEmpty
(
ruleIds
))
{
if
(
CollectionUtils
.
isNotEmpty
(
ruleIds
))
{
...
@@ -90,8 +90,7 @@ public class TaskCtrl {
...
@@ -90,8 +90,7 @@ public class TaskCtrl {
@ApiOperation
(
"提交任务去审核"
)
@ApiOperation
(
"提交任务去审核"
)
@GetMapping
(
"toSubmit"
)
@GetMapping
(
"toSubmit"
)
public
Result
toSubmit
(
@ApiParam
(
"任务id"
)
@RequestParam
(
"taskId"
)
String
id
)
{
public
Result
toSubmit
(
@ApiParam
(
"任务id"
)
@RequestParam
(
"taskId"
)
String
id
)
{
taskService
.
submitTask
(
id
,
SystemUserUtil
.
getCurrentUserId
());
return
taskService
.
submitTask
(
id
,
SystemUserUtil
.
getCurrentUserId
());
return
Result
.
genOkResult
();
}
}
@ApiOperation
(
"审核任务"
)
@ApiOperation
(
"审核任务"
)
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/TaskRuleCtrl.java
View file @
76d9f242
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.ConfigInfo
;
import
com.keymobile.indicators.model.entity.ConfigInfo
;
...
@@ -133,7 +134,8 @@ public class TaskRuleCtrl {
...
@@ -133,7 +134,8 @@ public class TaskRuleCtrl {
String
value
=
configInfo
.
getCfValue
();
String
value
=
configInfo
.
getCfValue
();
List
<
String
>
ids
=
Arrays
.
asList
(
StringUtils
.
split
(
value
,
Constants
.
SEP_COMMA
));
List
<
String
>
ids
=
Arrays
.
asList
(
StringUtils
.
split
(
value
,
Constants
.
SEP_COMMA
));
List
<
JSONObject
>
roles
=
systemAuthService
.
getRolesByIds
(
ids
);
List
<
JSONObject
>
roles
=
systemAuthService
.
getRolesByIds
(
ids
);
for
(
JSONObject
role
:
roles
)
{
for
(
int
i
=
0
;
i
<
roles
.
size
();
i
++)
{
JSONObject
role
=
roles
.
get
(
i
);
RoleModel
r
=
new
RoleModel
();
RoleModel
r
=
new
RoleModel
();
r
.
setId
(
role
.
getString
(
"id"
));
r
.
setId
(
role
.
getString
(
"id"
));
r
.
setName
(
role
.
getString
(
"disname"
));
r
.
setName
(
role
.
getString
(
"disname"
));
...
...
src/main/java/com/keymobile/indicators/constant/Constants.java
View file @
76d9f242
...
@@ -139,5 +139,16 @@ public class Constants {
...
@@ -139,5 +139,16 @@ public class Constants {
*/
*/
public
static
final
String
RULE_COUNTY_AUDIT_ROLE
=
"COUNTY_AUDIT_ROLE"
;
public
static
final
String
RULE_COUNTY_AUDIT_ROLE
=
"COUNTY_AUDIT_ROLE"
;
/**
* ruleType=1 省级对标
*/
public
static
final
int
RULE_TYPE_PROVINCE
=
1
;
/**
* ruleType=2 市级对标
*/
public
static
final
int
RULE_TYPE_CITY
=
2
;
/**
* ruleType=3 县级对标
*/
public
static
final
int
RULE_TYPE_COUNTY
=
3
;
}
}
src/main/java/com/keymobile/indicators/model/entity/OrgModel.java
View file @
76d9f242
...
@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
@ApiModel
(
"
角色
对象"
)
@ApiModel
(
"
组织
对象"
)
public
class
OrgModel
{
public
class
OrgModel
{
private
String
id
;
private
String
id
;
...
...
src/main/java/com/keymobile/indicators/model/entity/dataenter/QueryAllTaskParam.java
View file @
76d9f242
...
@@ -8,7 +8,7 @@ import lombok.Data;
...
@@ -8,7 +8,7 @@ import lombok.Data;
@Data
@Data
public
class
QueryAllTaskParam
{
public
class
QueryAllTaskParam
{
@ApiModelProperty
(
name
=
"规则类型:1 省级 2 市级 3 县级"
)
@ApiModelProperty
(
"规则类型:1 省级 2 市级 3 县级"
)
private
Integer
ruleType
;
private
Integer
ruleType
;
/**
/**
* 任务级别:省对市 省对县 市对县
* 任务级别:省对市 省对县 市对县
...
@@ -19,15 +19,18 @@ public class QueryAllTaskParam {
...
@@ -19,15 +19,18 @@ public class QueryAllTaskParam {
/**
/**
* 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部
* 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部
*/
*/
@ApiModelProperty
(
name
=
"查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部"
)
@ApiModelProperty
(
"查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部"
)
private
int
queryType
=
1
;
private
int
queryType
=
1
;
@ApiModelProperty
(
name
=
"搜索关键字(名字)"
)
@ApiModelProperty
(
"搜索关键字(名字)"
)
private
String
keyword
;
private
String
keyword
;
@ApiModelProperty
(
name
=
"填报时间"
)
@ApiModelProperty
(
"填报时间"
)
private
String
valueTime
;
private
String
valueTime
;
@ApiModelProperty
(
name
=
"任务状态:1、填报中 2、审批中 3、审核通过 4、驳回"
)
@ApiModelProperty
(
"任务状态:1、填报中 2、审批中 3、审核通过 4、驳回"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
"归属部门,对应数据项的归属部门"
)
private
String
refIndDept
;
@ApiModelProperty
(
"当前用户id,不用传"
)
@ApiModelProperty
(
"当前用户id,不用传"
)
private
String
userId
;
private
String
userId
;
}
}
src/main/java/com/keymobile/indicators/model/entity/dataenter/QueryTaskParam.java
View file @
76d9f242
...
@@ -8,7 +8,7 @@ import lombok.Data;
...
@@ -8,7 +8,7 @@ import lombok.Data;
@Data
@Data
public
class
QueryTaskParam
{
public
class
QueryTaskParam
{
@ApiModelProperty
(
name
=
"规则类型:1 省级 2 市级 3 县级"
)
@ApiModelProperty
(
"规则类型:1 省级 2 市级 3 县级"
)
private
Integer
ruleType
;
private
Integer
ruleType
;
/**
/**
...
@@ -19,20 +19,23 @@ public class QueryTaskParam {
...
@@ -19,20 +19,23 @@ public class QueryTaskParam {
/**
/**
* 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部
* 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部
*/
*/
@ApiModelProperty
(
name
=
"查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部"
)
@ApiModelProperty
(
"查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部"
)
private
int
queryType
=
1
;
private
int
queryType
=
1
;
private
String
userId
;
private
String
userId
;
@ApiModelProperty
(
name
=
"搜索关键字(名字)"
)
@ApiModelProperty
(
"搜索关键字(名字)"
)
private
String
keyword
;
private
String
keyword
;
@ApiModelProperty
(
name
=
"填报时间"
)
@ApiModelProperty
(
"填报时间"
)
private
String
valueTime
;
private
String
valueTime
;
@ApiModelProperty
(
name
=
"任务状态:1、填报中 2、审批中 3、审核通过 4、驳回"
)
@ApiModelProperty
(
"任务状态:1、填报中 2、审批中 3、审核通过 4、驳回"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
name
=
"页码,从1开始"
)
@ApiModelProperty
(
"归属部门,对应数据项的归属部门"
)
private
String
refIndDept
;
@ApiModelProperty
(
"页码,从1开始"
)
private
int
page
=
1
;
private
int
page
=
1
;
@ApiModelProperty
(
name
=
"每页条数"
)
@ApiModelProperty
(
"每页条数"
)
private
int
pageSize
=
10
;
private
int
pageSize
=
10
;
/**
/**
...
...
src/main/java/com/keymobile/indicators/model/entity/dataenter/Task.java
View file @
76d9f242
...
@@ -56,6 +56,9 @@ public class Task extends BaseModel {
...
@@ -56,6 +56,9 @@ public class Task extends BaseModel {
@ApiModelProperty
(
"任务规则名称"
)
@ApiModelProperty
(
"任务规则名称"
)
private
String
ruleName
;
private
String
ruleName
;
@ApiModelProperty
(
"归属部门(指标归属部门)"
)
private
String
refIndDept
;
/**
/**
* 任务单位id
* 任务单位id
*/
*/
...
@@ -94,6 +97,11 @@ public class Task extends BaseModel {
...
@@ -94,6 +97,11 @@ public class Task extends BaseModel {
private
String
auditUsers
;
private
String
auditUsers
;
/**
/**
* 审核人员名字,多个用,分割
*/
private
String
auditUserNames
;
/**
* 填报角色名称,多个用,分割
* 填报角色名称,多个用,分割
*/
*/
@ApiModelProperty
(
"填报对象,多个用,分割"
)
@ApiModelProperty
(
"填报对象,多个用,分割"
)
...
...
src/main/java/com/keymobile/indicators/model/mapper/indicators/TaskMapper.java
View file @
76d9f242
...
@@ -58,5 +58,17 @@ public interface TaskMapper extends BaseMapper<Task> {
...
@@ -58,5 +58,17 @@ public interface TaskMapper extends BaseMapper<Task> {
*/
*/
List
<
Task
>
findAllTask
(
QueryAllTaskParam
param
);
List
<
Task
>
findAllTask
(
QueryAllTaskParam
param
);
/**
* 根据审批状态统计任务
* @param param
* @return
*/
List
<
TaskStatusCountResult
>
countTask
(
QueryTaskParam
param
);
List
<
TaskStatusCountResult
>
countTask
(
QueryTaskParam
param
);
/**
* 根据id获取任务
* @param taskId
* @return
*/
Task
getById
(
String
taskId
);
}
}
src/main/java/com/keymobile/indicators/service/SystemAuthService.java
View file @
76d9f242
...
@@ -24,12 +24,12 @@ public interface SystemAuthService {
...
@@ -24,12 +24,12 @@ public interface SystemAuthService {
* @return
* @return
*/
*/
@GetMapping
(
"/user/list"
)
@GetMapping
(
"/user/list"
)
List
<
JSONObject
>
findUserList
(
@RequestParam
(
value
=
"roleId"
,
required
=
false
)
String
roleId
,
JSONObject
findUserList
(
@RequestParam
(
value
=
"roleId"
,
required
=
false
)
String
roleId
,
@RequestParam
(
value
=
"filter"
)
boolean
filter
,
@RequestParam
(
value
=
"filter"
)
boolean
filter
,
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
,
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
,
@RequestParam
(
value
=
"orgNo"
,
required
=
false
)
String
orgNo
,
@RequestParam
(
value
=
"orgNo"
,
required
=
false
)
String
orgNo
,
@RequestParam
(
value
=
"disname"
,
required
=
false
)
String
disname
,
@RequestParam
(
value
=
"disname"
,
required
=
false
)
String
disname
,
@RequestParam
(
value
=
"page"
)
int
page
,
@RequestParam
(
value
=
"size"
)
int
size
);
@RequestParam
(
value
=
"page"
)
int
page
,
@RequestParam
(
value
=
"size"
)
int
size
);
/**
/**
* 根据角色id列表获取角色列表
* 根据角色id列表获取角色列表
...
@@ -40,11 +40,11 @@ public interface SystemAuthService {
...
@@ -40,11 +40,11 @@ public interface SystemAuthService {
List
<
JSONObject
>
getRolesByIds
(
@RequestParam
(
"roleIds"
)
List
<
String
>
roleIds
);
List
<
JSONObject
>
getRolesByIds
(
@RequestParam
(
"roleIds"
)
List
<
String
>
roleIds
);
/**
/**
* 根据机构
id
列表获取角色列表
* 根据机构
编号
列表获取角色列表
* @param
orgId
s
* @param
no
s
* @return
* @return
*/
*/
@GetMapping
(
"/org/getBy
Id
s"
)
@GetMapping
(
"/org/getBy
No
s"
)
List
<
JSONObject
>
getOrgBy
Ids
(
@RequestParam
(
"orgIds"
)
List
<
String
>
orgId
s
);
List
<
JSONObject
>
getOrgBy
Nos
(
@RequestParam
(
"nos"
)
List
<
String
>
no
s
);
}
}
src/main/java/com/keymobile/indicators/service/dataenter/TaskService.java
View file @
76d9f242
...
@@ -121,7 +121,7 @@ public interface TaskService {
...
@@ -121,7 +121,7 @@ public interface TaskService {
* @param taskId
* @param taskId
* @param userId 提交人id
* @param userId 提交人id
*/
*/
void
submitTask
(
String
taskId
,
String
userId
);
Result
submitTask
(
String
taskId
,
String
userId
);
/**
/**
* 审批任务
* 审批任务
...
...
src/main/java/com/keymobile/indicators/service/dataenter/impl/TaskServiceImpl.java
View file @
76d9f242
package
com
.
keymobile
.
indicators
.
service
.
dataenter
.
impl
;
package
com
.
keymobile
.
indicators
.
service
.
dataenter
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.ImmutableListMultimap
;
import
com.google.common.collect.ImmutableListMultimap
;
import
com.google.common.collect.Multimaps
;
import
com.google.common.collect.Multimaps
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.ConfigInfo
;
import
com.keymobile.indicators.model.entity.RoleRefUserModel
;
import
com.keymobile.indicators.model.entity.RoleRefUserModel
;
import
com.keymobile.indicators.model.entity.dataenter.*
;
import
com.keymobile.indicators.model.entity.dataenter.*
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDef
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDef
;
import
com.keymobile.indicators.model.mapper.indicators.*
;
import
com.keymobile.indicators.model.mapper.indicators.*
;
import
com.keymobile.indicators.result.Result
;
import
com.keymobile.indicators.result.Result
;
import
com.keymobile.indicators.service.ConfigInfoService
;
import
com.keymobile.indicators.service.SystemAuthService
;
import
com.keymobile.indicators.service.SystemAuthService
;
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
;
...
@@ -17,6 +21,7 @@ import com.keymobile.indicators.utils.DateUtils;
...
@@ -17,6 +21,7 @@ import com.keymobile.indicators.utils.DateUtils;
import
com.keymobile.indicators.utils.IdWorker
;
import
com.keymobile.indicators.utils.IdWorker
;
import
com.keymobile.indicators.utils.LogManager
;
import
com.keymobile.indicators.utils.LogManager
;
import
com.keymobile.indicators.utils.SystemUserUtil
;
import
com.keymobile.indicators.utils.SystemUserUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -32,6 +37,7 @@ import java.util.Date;
...
@@ -32,6 +37,7 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
@Slf4j
public
class
TaskServiceImpl
implements
TaskService
{
public
class
TaskServiceImpl
implements
TaskService
{
@Autowired
@Autowired
...
@@ -58,6 +64,12 @@ public class TaskServiceImpl implements TaskService {
...
@@ -58,6 +64,12 @@ public class TaskServiceImpl implements TaskService {
@Autowired
@Autowired
private
IndicatorsRelService
indRelService
;
private
IndicatorsRelService
indRelService
;
@Autowired
private
ConfigInfoService
configInfoService
;
@Autowired
private
TaskRuleObjMapper
taskRuleObjMapper
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Task
createTask
(
Task
task
)
{
public
Task
createTask
(
Task
task
)
{
...
@@ -199,11 +211,13 @@ public class TaskServiceImpl implements TaskService {
...
@@ -199,11 +211,13 @@ public class TaskServiceImpl implements TaskService {
//角色
//角色
List
<
RoleRefUserModel
>
users
=
new
ArrayList
<>();
List
<
RoleRefUserModel
>
users
=
new
ArrayList
<>();
for
(
String
obj
:
objIds
)
{
for
(
String
obj
:
objIds
)
{
List
<
JSONObject
>
list
=
JSONObject
rolePage
=
systemAuthService
.
findUserList
(
obj
,
true
,
systemAuthService
.
findUserList
(
obj
,
true
,
null
,
null
,
null
,
1
,
100
);
null
,
null
,
null
,
1
,
100
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
JSONArray
list
=
rolePage
.
getJSONArray
(
"content"
);
for
(
JSONObject
jo
:
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
JSONObject
jo
=
list
.
getJSONObject
(
i
);
RoleRefUserModel
user
=
new
RoleRefUserModel
();
RoleRefUserModel
user
=
new
RoleRefUserModel
();
user
.
setId
(
jo
.
getString
(
"id"
));
user
.
setId
(
jo
.
getString
(
"id"
));
user
.
setDisName
(
jo
.
getString
(
"disname"
));
user
.
setDisName
(
jo
.
getString
(
"disname"
));
...
@@ -222,32 +236,81 @@ public class TaskServiceImpl implements TaskService {
...
@@ -222,32 +236,81 @@ public class TaskServiceImpl implements TaskService {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
submitTask
(
String
taskId
,
String
userId
)
{
public
Result
submitTask
(
String
taskId
,
String
userId
)
{
Result
result
=
null
;
Date
now
=
new
Date
();
Date
now
=
new
Date
();
Task
task
=
taskMapper
.
selectByPrimaryKey
(
taskId
);
Task
task
=
taskMapper
.
getById
(
taskId
);
//TODO
Integer
ruleType
=
task
.
getRuleType
();
task
.
setAuditUsers
(
",1,"
);
ConfigInfo
configInfo
=
null
;
task
.
setUpdater
(
userId
);
switch
(
ruleType
)
{
task
.
setUpdateTime
(
now
);
case
Constants
.
RULE_TYPE_PROVINCE
:
task
.
setStatus
(
Constants
.
APPLY_STATE_AUDITING
);
configInfo
=
configInfoService
.
getConfigInfoById
(
Constants
.
RULE_PROVINCE_AUDIT_ROLE
);
taskMapper
.
updateByPrimaryKey
(
task
);
break
;
AuditRecord
auditRecord
=
new
AuditRecord
();
case
Constants
.
RULE_TYPE_CITY
:
auditRecord
.
setRecordType
(
"提交"
);
configInfo
=
configInfoService
.
getConfigInfoById
(
Constants
.
RULE_CITY_AUDIT_ROLE
);
auditRecord
.
setTaskId
(
taskId
);
break
;
auditRecord
.
setId
(
IdWorker
.
getStrId
());
case
Constants
.
RULE_TYPE_COUNTY
:
auditRecord
.
setPTaskId
(
task
.
getPId
());
configInfo
=
configInfoService
.
getConfigInfoById
(
Constants
.
RULE_COUNTY_AUDIT_ROLE
);
auditRecord
.
setCreator
(
userId
);
break
;
auditRecord
.
setUpdater
(
userId
);
default
:
auditRecord
.
setUpdateTime
(
now
);
configInfo
=
configInfoService
.
getConfigInfoById
(
Constants
.
RULE_PROVINCE_AUDIT_ROLE
);
auditRecord
.
setCreateTime
(
now
);
break
;
taskAuditRecordMapper
.
insert
(
auditRecord
);
}
if
(
configInfo
!=
null
)
{
String
indDept
=
task
.
getRefIndDept
();
List
<
RoleRefUserModel
>
users
=
getUserByRoleIdStr
(
configInfo
.
getCfValue
());
if
(
CollectionUtils
.
isNotEmpty
(
users
))
{
StringBuilder
userIds
=
new
StringBuilder
(
Constants
.
SEP_COMMA
);
StringBuilder
userNames
=
new
StringBuilder
(
Constants
.
SEP_COMMA
);
boolean
found
=
false
;
for
(
RoleRefUserModel
userModel
:
users
)
{
if
(
StringUtils
.
equals
(
userModel
.
getRefIndDept
(),
indDept
))
{
found
=
true
;
userIds
.
append
(
userModel
.
getId
());
userIds
.
append
(
Constants
.
SEP_COMMA
);
userNames
.
append
(
userModel
.
getDisName
());
userNames
.
append
(
Constants
.
SEP_COMMA
);
}
}
if
(
found
)
{
task
.
setAuditUsers
(
userIds
.
toString
());
task
.
setAuditUserNames
(
userNames
.
toString
());
task
.
setUpdater
(
userId
);
task
.
setUpdateTime
(
now
);
task
.
setStatus
(
Constants
.
APPLY_STATE_AUDITING
);
taskMapper
.
updateByPrimaryKey
(
task
);
AuditRecord
auditRecord
=
new
AuditRecord
();
auditRecord
.
setRecordType
(
"提交"
);
auditRecord
.
setTaskId
(
taskId
);
auditRecord
.
setId
(
IdWorker
.
getStrId
());
auditRecord
.
setPTaskId
(
task
.
getPId
());
auditRecord
.
setCreator
(
userId
);
auditRecord
.
setUpdater
(
userId
);
auditRecord
.
setUpdateTime
(
now
);
auditRecord
.
setCreateTime
(
now
);
taskAuditRecordMapper
.
insert
(
auditRecord
);
result
=
Result
.
genOkResult
();
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"提交任务id:{},name:{}到审核"
,
taskId
,
task
.
getRuleName
());
}
else
{
result
=
Result
.
genFailedResult
(
"此配置此任务审批人,ruleType="
+
ruleType
+
",归属部门="
+
indDept
);
}
}
else
{
result
=
Result
.
genFailedResult
(
"系统配置的角色没有用户,ruleType="
+
ruleType
);
}
}
else
{
result
=
Result
.
genFailedResult
(
"系统没有配置此任务的审批角色,ruleType="
+
ruleType
);
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"提交任务taskId={}失败没有配置ruleType={}的审批角色"
,
taskId
,
ruleType
);
}
return
result
;
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
auditTask
(
TaskAuditResult
auditResult
,
String
auditUserId
)
{
public
void
auditTask
(
TaskAuditResult
auditResult
,
String
auditUserId
)
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
Task
task
=
taskMapper
.
selectByPrimaryKey
(
auditResult
.
getTaskId
());
Task
task
=
taskMapper
.
getById
(
auditResult
.
getTaskId
());
task
.
setUpdateTime
(
now
);
task
.
setUpdateTime
(
now
);
int
status
=
Constants
.
APPLY_STATE_REJECTED
;
int
status
=
Constants
.
APPLY_STATE_REJECTED
;
String
recordType
=
"审批拒绝"
;
String
recordType
=
"审批拒绝"
;
...
@@ -255,11 +318,13 @@ public class TaskServiceImpl implements TaskService {
...
@@ -255,11 +318,13 @@ public class TaskServiceImpl implements TaskService {
status
=
Constants
.
APPLY_STATE_PASSED
;
status
=
Constants
.
APPLY_STATE_PASSED
;
recordType
=
"审批通过"
;
recordType
=
"审批通过"
;
taskIndValueMapper
.
updateTaskValueToPass
(
task
.
getId
());
taskIndValueMapper
.
updateTaskValueToPass
(
task
.
getId
());
createCountIndValues
(
task
);
}
}
task
.
setStatus
(
status
);
task
.
setStatus
(
status
);
taskMapper
.
updateByPrimaryKey
(
task
);
taskMapper
.
updateByPrimaryKey
(
task
);
AuditRecord
auditRecord
=
new
AuditRecord
();
AuditRecord
auditRecord
=
new
AuditRecord
();
auditRecord
.
setRecordType
(
recordType
);
auditRecord
.
setRecordType
(
recordType
);
auditRecord
.
setDescription
(
auditResult
.
getDescription
());
auditRecord
.
setTaskId
(
task
.
getId
());
auditRecord
.
setTaskId
(
task
.
getId
());
auditRecord
.
setId
(
IdWorker
.
getStrId
());
auditRecord
.
setId
(
IdWorker
.
getStrId
());
auditRecord
.
setPTaskId
(
task
.
getPId
());
auditRecord
.
setPTaskId
(
task
.
getPId
());
...
@@ -268,6 +333,23 @@ public class TaskServiceImpl implements TaskService {
...
@@ -268,6 +333,23 @@ public class TaskServiceImpl implements TaskService {
auditRecord
.
setUpdateTime
(
now
);
auditRecord
.
setUpdateTime
(
now
);
auditRecord
.
setCreateTime
(
now
);
auditRecord
.
setCreateTime
(
now
);
taskAuditRecordMapper
.
insert
(
auditRecord
);
taskAuditRecordMapper
.
insert
(
auditRecord
);
LogManager
.
logInfo
(
Constants
.
LOG_CONTEXT_API
,
"{}任务:{}Id:{},ruleId:{}, ruleLevel:{}"
,
recordType
,
task
.
getRuleName
(),
task
.
getId
(),
task
.
getRuleId
(),
task
.
getRuleLevel
());
}
/**
* 通过填报值计算出包含公式的数据项值
* @param task
*/
private
void
createCountIndValues
(
Task
task
)
{
List
<
TaskIndicator
>
inds
=
taskIndicatorMapper
.
getByTaskId
(
task
.
getId
());
List
<
TaskIndValue
>
values
=
taskIndValueMapper
.
getByTaskId
(
task
.
getId
());
for
(
TaskIndicator
taskIndicator
:
inds
)
{
if
(
StringUtils
.
isNotBlank
(
taskIndicator
.
getIndFormula
()))
{
//TODO
taskRuleObjMapper
.
getById
(
task
.
getGroupId
());
}
}
}
}
@Override
@Override
...
@@ -309,6 +391,39 @@ public class TaskServiceImpl implements TaskService {
...
@@ -309,6 +391,39 @@ public class TaskServiceImpl implements TaskService {
}
}
}
}
/**
* 根据角色id字符串获取关联的用户信息
* @param roleIdStr
* @return
*/
private
List
<
RoleRefUserModel
>
getUserByRoleIdStr
(
String
roleIdStr
)
{
List
<
RoleRefUserModel
>
users
=
new
ArrayList
<>();
String
[]
roleIds
=
StringUtils
.
split
(
roleIdStr
,
Constants
.
SEP_COMMA
);
for
(
String
roleId
:
roleIds
)
{
JSONObject
rolePage
=
systemAuthService
.
findUserList
(
roleId
,
true
,
null
,
null
,
null
,
1
,
100
);
JSONArray
list
=
rolePage
.
getJSONArray
(
"content"
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
JSONObject
jo
=
list
.
getJSONObject
(
i
);
RoleRefUserModel
user
=
new
RoleRefUserModel
();
user
.
setId
(
jo
.
getString
(
"id"
));
user
.
setDisName
(
jo
.
getString
(
"disname"
));
user
.
setRefIndDept
(
jo
.
getString
(
"refIndDept"
));
String
refIndDept
=
user
.
getRefIndDept
();
if
(
StringUtils
.
isBlank
(
refIndDept
))
{
continue
;
}
if
(!
users
.
contains
(
user
))
{
users
.
add
(
user
);
}
}
}
}
return
users
;
}
@Override
@Override
public
Result
createTaskByRule
(
Integer
ruleId
,
String
valueTime
)
{
public
Result
createTaskByRule
(
Integer
ruleId
,
String
valueTime
)
{
Result
result
=
null
;
Result
result
=
null
;
...
@@ -316,28 +431,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -316,28 +431,7 @@ public class TaskServiceImpl implements TaskService {
if
(
rule
!=
null
)
{
if
(
rule
!=
null
)
{
String
roleIdStr
=
rule
.
getToRoleIds
();
String
roleIdStr
=
rule
.
getToRoleIds
();
if
(
StringUtils
.
isNotBlank
(
roleIdStr
))
{
if
(
StringUtils
.
isNotBlank
(
roleIdStr
))
{
String
[]
roleIds
=
StringUtils
.
split
(
roleIdStr
,
Constants
.
SEP_COMMA
);
List
<
RoleRefUserModel
>
users
=
getUserByRoleIdStr
(
roleIdStr
);
List
<
RoleRefUserModel
>
users
=
new
ArrayList
<>();
for
(
String
roleId
:
roleIds
)
{
List
<
JSONObject
>
list
=
systemAuthService
.
findUserList
(
roleId
,
true
,
null
,
null
,
null
,
1
,
100
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
JSONObject
jo
:
list
)
{
RoleRefUserModel
user
=
new
RoleRefUserModel
();
user
.
setId
(
jo
.
getString
(
"id"
));
user
.
setDisName
(
jo
.
getString
(
"disname"
));
user
.
setRefIndDept
(
jo
.
getString
(
"refIndDept"
));
String
refIndDept
=
user
.
getRefIndDept
();
if
(
StringUtils
.
isBlank
(
refIndDept
))
{
continue
;
}
if
(!
users
.
contains
(
user
))
{
users
.
add
(
user
);
}
}
}
}
if
(
users
.
size
()
>
0
)
{
if
(
users
.
size
()
>
0
)
{
List
<
TaskRuleIndicator
>
indicators
=
rule
.
getIndicators
();
List
<
TaskRuleIndicator
>
indicators
=
rule
.
getIndicators
();
if
(
CollectionUtils
.
isNotEmpty
(
indicators
))
{
if
(
CollectionUtils
.
isNotEmpty
(
indicators
))
{
...
@@ -386,6 +480,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -386,6 +480,7 @@ public class TaskServiceImpl implements TaskService {
task
.
setRuleId
(
rule
.
getId
());
task
.
setRuleId
(
rule
.
getId
());
task
.
setRuleLevel
(
rule
.
getRuleLevel
());
task
.
setRuleLevel
(
rule
.
getRuleLevel
());
task
.
setGroupId
(
rule
.
getGroupId
());
task
.
setGroupId
(
rule
.
getGroupId
());
task
.
setRefIndDept
(
dept
);
task
.
setDescription
(
rule
.
getDescription
());
task
.
setDescription
(
rule
.
getDescription
());
StringBuilder
userNames
=
new
StringBuilder
(
Constants
.
SEP_COMMA
);
StringBuilder
userNames
=
new
StringBuilder
(
Constants
.
SEP_COMMA
);
StringBuilder
userIds
=
new
StringBuilder
(
Constants
.
SEP_COMMA
);
StringBuilder
userIds
=
new
StringBuilder
(
Constants
.
SEP_COMMA
);
...
...
src/main/resources/mybatis/mapping/TaskMapper.xml
View file @
76d9f242
...
@@ -3,6 +3,12 @@
...
@@ -3,6 +3,12 @@
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indicators.TaskMapper"
>
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indicators.TaskMapper"
>
<select
id=
"getById"
resultType=
"com.keymobile.indicators.model.entity.dataenter.Task"
>
select *
from data_enter_task
where id = #{taskId}
</select>
<select
id=
"getByRuleIdAndValueTime"
parameterType=
"java.lang.Object"
<select
id=
"getByRuleIdAndValueTime"
parameterType=
"java.lang.Object"
resultType=
"com.keymobile.indicators.model.entity.dataenter.Task"
>
resultType=
"com.keymobile.indicators.model.entity.dataenter.Task"
>
select *
select *
...
@@ -52,6 +58,10 @@
...
@@ -52,6 +58,10 @@
<if
test=
"ruleLevel != null and ruleLevel !=''"
>
<if
test=
"ruleLevel != null and ruleLevel !=''"
>
and rule_level = #{ruleLevel}
and rule_level = #{ruleLevel}
</if>
</if>
<if
test=
"refIndDept != null and refIndDept !=''"
>
and ref_ind_dept = #{refIndDept}
</if>
<if
test=
"userId != null"
>
<if
test=
"userId != null"
>
<choose>
<choose>
<when
test=
"queryType == 1"
>
<when
test=
"queryType == 1"
>
...
...
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