Commit 519ea399 by 张祺

修改任务下发规则相关模型

parent 323bf45b
...@@ -96,8 +96,10 @@ public class TaskRuleCtrl { ...@@ -96,8 +96,10 @@ public class TaskRuleCtrl {
@ApiOperation("根据规则类型获取任务单位列表") @ApiOperation("根据规则类型获取任务单位列表")
@GetMapping("findGroupObjs") @GetMapping("findGroupObjs")
public List<TaskRuleGroupObj> findGroupObjs(@ApiParam("规则类型:1 省 2 市 3 县") public List<TaskRuleGroupObj> findGroupObjs(@ApiParam("规则类型:1 省 2 市 3 县")
@RequestParam(value = "ruleType", required = false) Integer ruleType) { @RequestParam(value = "ruleType", required = false) Integer ruleType,
return taskRuleService.findRuleGroupObj(ruleType); @ApiParam("任务级别:省对市 省对县 市对县")
@RequestParam(value = "ruleLevel", required = false) String ruleLevel) {
return taskRuleService.findRuleGroupObj(ruleType, ruleLevel);
} }
@ApiOperation("根据规则类型获取可配置的角色") @ApiOperation("根据规则类型获取可配置的角色")
......
...@@ -43,6 +43,12 @@ public class ExcelTemplate extends BaseModel { ...@@ -43,6 +43,12 @@ public class ExcelTemplate extends BaseModel {
private Integer ruleType; private Integer ruleType;
/** /**
* 任务级别:省对市 省对县 市对县
*/
@ApiModelProperty("任务级别:省对市 省对县 市对县")
private String ruleLevel;
/**
* 所属任务id * 所属任务id
*/ */
@ApiModelProperty("所属任务id") @ApiModelProperty("所属任务id")
......
...@@ -10,6 +10,11 @@ public class QueryAllTaskParam { ...@@ -10,6 +10,11 @@ public class QueryAllTaskParam {
@ApiModelProperty(name = "规则类型:1 省级 2 市级 3 县级") @ApiModelProperty(name = "规则类型:1 省级 2 市级 3 县级")
private Integer ruleType; private Integer ruleType;
/**
* 任务级别:省对市 省对县 市对县
*/
@ApiModelProperty("任务级别:省对市 省对县 市对县")
private String ruleLevel;
/** /**
* 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部 * 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部
......
...@@ -12,6 +12,11 @@ public class QueryTaskParam { ...@@ -12,6 +12,11 @@ public class QueryTaskParam {
private Integer ruleType; private Integer ruleType;
/** /**
* 任务级别:省对市 省对县 市对县
*/
@ApiModelProperty("任务级别:省对市 省对县 市对县")
private String ruleLevel;
/**
* 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部 * 查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部
*/ */
@ApiModelProperty(name = "查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部") @ApiModelProperty(name = "查询类型:1 查找填报人任务 2 查找审核人任务 3 查找全部")
......
...@@ -45,6 +45,12 @@ public class Task extends BaseModel { ...@@ -45,6 +45,12 @@ public class Task extends BaseModel {
private Integer ruleType; private Integer ruleType;
/** /**
* 任务级别:省对市 省对县 市对县
*/
@ApiModelProperty("任务级别:省对市 省对县 市对县")
private String ruleLevel;
/**
* 任务规则名称 * 任务规则名称
*/ */
@ApiModelProperty("任务规则名称") @ApiModelProperty("任务规则名称")
......
...@@ -31,8 +31,14 @@ public class TaskRule extends BaseModel { ...@@ -31,8 +31,14 @@ public class TaskRule extends BaseModel {
/** /**
* 任务规则所属类型:1、省 2、市 3、县 * 任务规则所属类型:1、省 2、市 3、县
*/ */
@ApiModelProperty("规则类型") @ApiModelProperty("任务规则类型")
private Integer ruleType; private Integer ruleType;
/**
* 任务级别:省对市 省对县 市对县
*/
@ApiModelProperty("任务级别:省对市 省对县 市对县")
private String ruleLevel;
/** /**
* 触发类型:1、手动 2、定时 * 触发类型:1、手动 2、定时
*/ */
......
...@@ -25,6 +25,12 @@ public class TaskRuleGroupObj extends BaseModel { ...@@ -25,6 +25,12 @@ public class TaskRuleGroupObj extends BaseModel {
@ApiModelProperty("规则类型") @ApiModelProperty("规则类型")
private Integer ruleType; private Integer ruleType;
/**
* 任务级别:省对市 省对县 市对县
*/
@ApiModelProperty("任务级别:省对市 省对县 市对县")
private String ruleLevel;
@ApiModelProperty("数据对象类型:1、组织机构 2、人员 3、岗位") @ApiModelProperty("数据对象类型:1、组织机构 2、人员 3、岗位")
private Integer objType; private Integer objType;
......
...@@ -2,6 +2,7 @@ package com.keymobile.indicators.model.mapper.indicators; ...@@ -2,6 +2,7 @@ package com.keymobile.indicators.model.mapper.indicators;
import com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj; import com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper; import tk.mybatis.mapper.common.BaseMapper;
import java.util.List; import java.util.List;
...@@ -9,5 +10,6 @@ import java.util.List; ...@@ -9,5 +10,6 @@ import java.util.List;
@Mapper @Mapper
public interface TaskRuleObjMapper extends BaseMapper<TaskRuleGroupObj> { public interface TaskRuleObjMapper extends BaseMapper<TaskRuleGroupObj> {
List<TaskRuleGroupObj> findAllByRuleType(Integer ruleType); List<TaskRuleGroupObj> findAllByRuleType(@Param("ruleType") Integer ruleType,
@Param("ruleLevel") String ruleLevel);
} }
...@@ -57,8 +57,9 @@ public interface TaskRuleService { ...@@ -57,8 +57,9 @@ public interface TaskRuleService {
/** /**
* 规则类型 * 规则类型
* @param ruleType * @param ruleType
* @param ruleLevel
* @return * @return
*/ */
List<TaskRuleGroupObj> findRuleGroupObj(Integer ruleType); List<TaskRuleGroupObj> findRuleGroupObj(Integer ruleType,String ruleLevel);
} }
...@@ -104,8 +104,8 @@ public class TaskRuleServiceImpl implements TaskRuleService { ...@@ -104,8 +104,8 @@ public class TaskRuleServiceImpl implements TaskRuleService {
} }
@Override @Override
public List<TaskRuleGroupObj> findRuleGroupObj(Integer ruleType) { public List<TaskRuleGroupObj> findRuleGroupObj(Integer ruleType,String ruleLevel) {
return taskRuleObjMapper.findAllByRuleType(ruleType); return taskRuleObjMapper.findAllByRuleType(ruleType, ruleLevel);
} }
......
...@@ -263,11 +263,23 @@ public class TaskServiceImpl implements TaskService { ...@@ -263,11 +263,23 @@ public class TaskServiceImpl implements TaskService {
List<TaskStatusCountResult> countResults = taskMapper.countTask(param); List<TaskStatusCountResult> countResults = taskMapper.countTask(param);
TaskAnalysisResult result = new TaskAnalysisResult(); TaskAnalysisResult result = new TaskAnalysisResult();
if (CollectionUtils.isNotEmpty(countResults)) { if (CollectionUtils.isNotEmpty(countResults)) {
int count = 0;
for (TaskStatusCountResult countResult : countResults) { for (TaskStatusCountResult countResult : countResults) {
if (Constants.APPLY_STATE_DRAFT == countResult.getStatus()) { switch (countResult.getStatus()) {
case Constants.APPLY_STATE_DRAFT :
result.setToEditCount(countResult.getCount()); result.setToEditCount(countResult.getCount());
count += countResult.getCount();
break;
case Constants.APPLY_STATE_AUDITING :
result.setToAuditCount(countResult.getCount());
count += countResult.getCount();
break;
default:
count += countResult.getCount();
break;
} }
} }
result.setTotalCount(count);
} }
return result; return result;
} }
......
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
<if test="ruleType != null"> <if test="ruleType != null">
and rule_type = #{ruleType} and rule_type = #{ruleType}
</if> </if>
<if test="ruleLevel != null and ruleLevel !=''">
and rule_level = #{ruleLevel}
</if>
<if test="userId != null"> <if test="userId != null">
<choose> <choose>
<when test="queryType == 1"> <when test="queryType == 1">
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
<if test="ruleType != null"> <if test="ruleType != null">
and rule_type = #{ruleType} and rule_type = #{ruleType}
</if> </if>
<if test="ruleLevel != null and ruleLevel !=''">
and rule_level = #{ruleLevel}
</if>
<if test="keyword != null and keyword != ''"> <if test="keyword != null and keyword != ''">
and name like concat('%', keyword, '%') and name like concat('%', keyword, '%')
</if> </if>
...@@ -39,6 +42,9 @@ ...@@ -39,6 +42,9 @@
<if test="ruleType != null"> <if test="ruleType != null">
and rule_type = #{ruleType} and rule_type = #{ruleType}
</if> </if>
<if test="ruleLevel != null and ruleLevel !=''">
and rule_level = #{ruleLevel}
</if>
<if test="keyword != null and keyword != ''"> <if test="keyword != null and keyword != ''">
and name name like concat('%', keyword, '%') and name name like concat('%', keyword, '%')
</if> </if>
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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.TaskRuleObjMapper"> <mapper namespace="com.keymobile.indicators.model.mapper.indicators.TaskRuleObjMapper">
<select id="findAllByRuleType" parameterType="java.lang.Integer" resultType="com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj"> <select id="findAllByRuleType" resultType="com.keymobile.indicators.model.entity.dataenter.TaskRuleGroupObj">
select * select *
from data_enter_rule_obj from data_enter_rule_obj
where state = 1 where state = 1
<if test="ruleType != null and ruleType != ''"> <if test="ruleType != null and ruleType != ''">
and rule_type = #{ruleType} and rule_type = #{ruleType}
</if> </if>
<if test="ruleLevel != null and ruleLevel !=''">
and rule_level = #{ruleLevel}
</if>
order by update_time desc order by update_time desc
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment