This commit is contained in:
zhangheng 2024-06-21 15:47:40 +08:00
parent c511dbfb26
commit 32fa03401e
5 changed files with 37 additions and 31 deletions

View File

@ -35,7 +35,7 @@ public interface LabelFieldInfoMapper {
* @param fieldType 标签字段信息 * @param fieldType 标签字段信息
* @return 标签字段信息集合 * @return 标签字段信息集合
*/ */
List<LabelFieldVO> selectLabelFieldList(String fieldType); List<LabelFieldVO> selectLabelFieldList(String fieldType);
/** /**
* 新增标签字段信息 * 新增标签字段信息
@ -78,4 +78,12 @@ public interface LabelFieldInfoMapper {
* 检查除当前记录外有没有同名的字段信息名称 * 检查除当前记录外有没有同名的字段信息名称
*/ */
int countByFieldNameExcludingId(@Param("id") Long id, @Param("fieldType") String fieldType, @Param("fieldName") String fieldName); int countByFieldNameExcludingId(@Param("id") Long id, @Param("fieldType") String fieldType, @Param("fieldName") String fieldName);
/**
* 分组信息
*
* @param taskPartitionDictName 分组名
* @return LabelFieldInfo
*/
List<LabelFieldInfo> taskPartitionDictIdList(String taskPartitionDictName);
} }

View File

@ -60,12 +60,4 @@ public interface TaskPartitionDictMapper {
* @return 结果 * @return 结果
*/ */
int deleteTaskPartitionDictByIds(Long[] ids); int deleteTaskPartitionDictByIds(Long[] ids);
/**
* 分组信息
*
* @param taskPartitionDictName 分组名
* @return LabelFieldInfo
*/
List<LabelFieldInfo> taskPartitionDictIdList(String taskPartitionDictName);
} }

View File

@ -9,10 +9,11 @@ import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO;
import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentDTO; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentDTO;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.taskpartitiondict.TaskPartitionDictMapper; import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper;
import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService; import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -33,7 +34,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
@Resource @Resource
private LabelFieldContentMapper labelFieldContentMapper; private LabelFieldContentMapper labelFieldContentMapper;
@Resource @Resource
private TaskPartitionDictMapper taskPartitionDictMapper; private LabelFieldInfoMapper labelFieldInfoMapper;
/** /**
* 查询标签字段内容信息 * 查询标签字段内容信息
@ -149,17 +150,21 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
@Override @Override
public AjaxResult groupingContent(String taskPartitionDictName) { public AjaxResult groupingContent(String taskPartitionDictName) {
ArrayList<LabelFieldInfo> labelFieldInfos = new ArrayList<>(); ArrayList<LabelFieldInfo> labelFieldInfos = new ArrayList<>();
LabelFieldInfo labelFieldOne = new LabelFieldInfo(); if (StringUtils.isBlank(taskPartitionDictName)) {
labelFieldOne.setTaskPartitionDictId(0L); LabelFieldInfo labelFieldOne = new LabelFieldInfo();
labelFieldOne.setTaskPartitionDictName("全部"); labelFieldOne.setTaskPartitionDictId(0L);
labelFieldInfos.add(labelFieldOne); labelFieldOne.setTaskPartitionDictName("全部");
List<LabelFieldInfo> labelFieldInfoList = taskPartitionDictMapper.taskPartitionDictIdList(taskPartitionDictName); labelFieldInfos.add(labelFieldOne);
}
List<LabelFieldInfo> labelFieldInfoList = labelFieldInfoMapper.taskPartitionDictIdList(taskPartitionDictName);
if (CollectionUtils.isNotEmpty(labelFieldInfoList)) { if (CollectionUtils.isNotEmpty(labelFieldInfoList)) {
labelFieldInfos.addAll(labelFieldInfoList); labelFieldInfos.addAll(labelFieldInfoList);
} }
LabelFieldInfo labelFieldInfo = new LabelFieldInfo(); if (StringUtils.isBlank(taskPartitionDictName)) {
labelFieldInfo.setTaskPartitionDictName("未分组"); LabelFieldInfo labelFieldInfo = new LabelFieldInfo();
labelFieldInfos.add(labelFieldInfo); labelFieldInfo.setTaskPartitionDictName("未分组");
labelFieldInfos.add(labelFieldInfo);
}
return AjaxResult.success(labelFieldInfos); return AjaxResult.success(labelFieldInfos);
} }
} }

View File

@ -213,4 +213,17 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="taskPartitionDictIdList" resultType="com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo">
select
field_code,
task_partition_dict_id,
task_partition_dict_name
from label_field_info
<where>
<if test="taskPartitionDictName != null and taskPartitionDictName != ''">
task_partition_dict_name like concat('%', #{taskPartitionDictName}, '%')
</if>
</where>
</select>
</mapper> </mapper>

View File

@ -206,16 +206,4 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="taskPartitionDictIdList" resultType="com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo">
select
id taskPartitionDictId,
task_partition_name taskPartitionDictName
from task_partition_dict
<where>
<if test="taskPartitionDictName != null and taskPartitionDictName != ''">
task_type_name like concat('%', #{taskPartitionDictName}, '%')
</if>
</where>
</select>
</mapper> </mapper>