标签修改

This commit is contained in:
zhangheng 2024-07-03 15:45:30 +08:00
parent 86a96c3769
commit 8775d6fe01
10 changed files with 103 additions and 12 deletions

View File

@ -10,7 +10,6 @@ import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO;
import com.xinelu.manage.service.labelfieldinfo.ILabelFieldInfoService;
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldTreeVO;
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@ -116,4 +115,9 @@ public class LabelFieldInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(labelFieldInfoService.deleteLabelFieldInfoByIds(ids));
}
@GetMapping("/taskTypeGrouping")
public AjaxResult taskTypeGrouping() {
return labelFieldInfoService.taskTypeGrouping();
}
}

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.mapper.taskpartitiondict;
import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -59,4 +60,6 @@ public interface TaskPartitionDictMapper {
* @return 结果
*/
int deleteTaskPartitionDictByIds(Long[] ids);
List<TaskPartitionDict> selectTaskPartitionList( List<Long> ids);
}

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.mapper.tasktypedict;
import com.xinelu.manage.domain.tasktypedict.TaskTypeDict;
import com.xinelu.manage.vo.tasktypedict.TaskTypeDictVO;
import java.util.List;
@ -59,4 +60,11 @@ public interface TaskTypeDictMapper {
* @return 结果
*/
public int deleteTaskTypeDictByIds(Long[] ids);
/**
* 查询任务类型字典列表
*
* @return 任务类型字典集合
*/
List<TaskTypeDictVO> selectTaskTypeDicts();
}

View File

@ -4,7 +4,6 @@ import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO;
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldTreeVO;
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldVO;
import java.util.List;
@ -75,4 +74,11 @@ public interface ILabelFieldInfoService {
* 批量新增标签字段信息
*/
int insertLabelFieldInfoList(LabelFieldInfoAddDTO labelFieldInfoAddDTO);
/**
* 查询任务类型
*
* @return AjaxResult
*/
AjaxResult taskTypeGrouping();
}

View File

@ -1,14 +1,18 @@
package com.xinelu.manage.service.labelfieldinfo.impl;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict;
import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper;
import com.xinelu.manage.mapper.taskpartitiondict.TaskPartitionDictMapper;
import com.xinelu.manage.mapper.tasktypedict.TaskTypeDictMapper;
import com.xinelu.manage.service.labelfieldinfo.ILabelFieldInfoService;
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldTreeVO;
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldVO;
import com.xinelu.manage.vo.tasktypedict.TaskTypeDictVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -32,9 +36,10 @@ import java.util.stream.Collectors;
public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
@Resource
private LabelFieldInfoMapper labelFieldInfoMapper;
@Resource
private LabelFieldContentMapper labelFieldContentMapper;
private TaskTypeDictMapper taskTypeDictMapper;
@Resource
private TaskPartitionDictMapper taskPartitionDictMapper;
/**
* 查询标签字段信息
@ -172,4 +177,21 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
}
return 1;
}
@Override
public AjaxResult taskTypeGrouping() {
List<TaskTypeDictVO> taskTypeDictList = taskTypeDictMapper.selectTaskTypeDicts();
List<Long> ids = taskTypeDictList.stream().filter(Objects::nonNull).map(TaskTypeDictVO::getTaskTypeId).filter(Objects::nonNull).collect(Collectors.toList());
List<TaskPartitionDict> taskPartitionDicts = taskPartitionDictMapper.selectTaskPartitionList(ids);
if (CollectionUtils.isEmpty(taskPartitionDicts)) {
return AjaxResult.success(taskPartitionDicts);
}
for (TaskTypeDictVO taskTypeDictVO : taskTypeDictList) {
List<TaskPartitionDict> collect = taskPartitionDicts.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getTaskTypeId()) && taskTypeDictVO.getTaskTypeId().equals(item.getTaskTypeId())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
taskTypeDictVO.setTaskPartitionDictList(collect);
}
}
return AjaxResult.success(taskTypeDictList);
}
}

View File

@ -27,4 +27,6 @@ public class SpecialDiseaseNodeVO extends SpecialDiseaseNode {
private String taskStatusName;
private String taskSubdivisiontemplateType;
private String flowScheme;
}

View File

@ -0,0 +1,30 @@
package com.xinelu.manage.vo.tasktypedict;
import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 任务类型字典对象 task_type_dict
*
* @author xinelu
* @date 2024-03-11
*/
@Data
public class TaskTypeDictVO {
/**
* 主键id
*/
private Long taskTypeId;
/**
* 任务类型名称
*/
@ApiModelProperty(value = "任务类型名称")
private String taskTypeName;
private List<TaskPartitionDict> taskPartitionDictList;
}

View File

@ -125,6 +125,7 @@
<result property="taskSubdivisionName" column="taskSubdivisionName"/>
<result property="taskStatusName" column="taskStatusName"/>
<result property="nodeContent" column="node_content"/>
<result property="flowScheme" column="flowScheme"/>
</resultMap>
<sql id="selectSpecialDiseaseNodeVo">
@ -807,7 +808,7 @@
<select id="selectSpecialDiseaseByRouteId"
resultType="com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO"
resultMap="SpecialDiseaseRouteResult">
select sdr.id specialDiseaseRouteId,
select sdr.id specialDiseaseRouteId,
sdr.department_id,
sdr.department_name,
sdr.disease_type_id,
@ -818,7 +819,7 @@
sdr.route_classify,
sdr.release_status,
sdr.suit_range,
sdn.id as specialDiseaseNodeId,
sdn.id as specialDiseaseNodeId,
sdn.route_id,
sdn.route_name,
sdn.route_node_name,
@ -865,16 +866,17 @@
sdn.route_check_remark,
sdn.node_content,
sdn.phone_dial_method,
(select flow_scheme from script_info where id = sdn.phone_template_id) flowScheme,
(select COUNT(1)
from special_disease_node
where route_id = specialDiseaseRouteId) totalNumber,
where route_id = specialDiseaseRouteId) totalNumber,
(select COUNT(1)
from special_disease_node
where route_id = specialDiseaseRouteId
and route_check_status = 'AGREE') agreeNumber,
ttd.task_type_name taskTypeName,
tpd.task_partition_name taskSubdivisionName,
tsd.task_status_name taskStatusName
and route_check_status = 'AGREE') agreeNumber,
ttd.task_type_name taskTypeName,
tpd.task_partition_name taskSubdivisionName,
tsd.task_status_name taskStatusName
from special_disease_route sdr
left join special_disease_node sdn ON sdn.route_id = sdr.id
left join task_type_dict ttd ON ttd.task_type_code = sdn.task_type

View File

@ -206,4 +206,12 @@
#{id}
</foreach>
</delete>
<select id="selectTaskPartitionList"
resultType="com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict">
select * from task_partition_dict where task_type_id in
<foreach item="ids" collection="list" open="(" separator="," close=")">
#{ids}
</foreach>
</select>
</mapper>

View File

@ -137,4 +137,10 @@
#{id}
</foreach>
</delete>
<select id="selectTaskTypeDicts" resultType="com.xinelu.manage.vo.tasktypedict.TaskTypeDictVO">
select id taskTypeId,
task_type_name
from task_type_dict
</select>
</mapper>