添加服务指令树接口

This commit is contained in:
yangjun 2025-03-28 17:28:29 +08:00
parent e0c501e144
commit df164fdb69
14 changed files with 129 additions and 26 deletions

View File

@ -40,7 +40,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: nu_config_service_category
* @Description: 服务指令
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: nu_config_service_category
* @Description: 服务类别
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
@ -30,7 +30,6 @@ import lombok.experimental.Accessors;
@TableName("nu_config_service_category")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_config_service_category对象", description="nu_config_service_category")
public class NuConfigServiceCategory implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -4,10 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
@ -21,7 +19,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: nu_config_service_directive
* @Description: 服务指令
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
@ -30,7 +28,6 @@ import lombok.experimental.Accessors;
@TableName("nu_config_service_directive")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_config_service_directive对象", description="nu_config_service_directive")
public class NuConfigServiceDirective implements Serializable {
private static final long serialVersionUID = 1L;
@ -126,4 +123,7 @@ public class NuConfigServiceDirective implements Serializable {
@Excel(name = "视频文件", width = 15)
@ApiModelProperty(value = "视频文件")
private java.lang.String mp4File;
@TableField(exist = false)
private String tagName;
}

View File

@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: nu_config_service_type
* @Description: 服务类型
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
@ -30,7 +30,6 @@ import lombok.experimental.Accessors;
@TableName("nu_config_service_type")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_config_service_type对象", description="nu_config_service_type")
public class NuConfigServiceType implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -7,7 +7,7 @@ import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: nu_config_service_category
* @Description: 服务类别
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -7,7 +7,7 @@ import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceDirective;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: nu_config_service_directive
* @Description: 服务指令
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -7,7 +7,7 @@ import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: nu_config_service_type
* @Description: 服务类型
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -2,4 +2,39 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceDirectiveMapper">
<select id="selectList" resultType="com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceDirective">
select * from (
SELECT
csd.id AS id,
csd.directive_name,
csd.category_id,
csd.type_id,
csd.instruction_tag_id,
csd.toll_price,
csd.com_price,
csd.iz_reimbursement,
csd.iz_preferential,
csd.charging_frequency,
csd.cycle_type,
csd.service_content,
csd.service_duration,
csd.iz_enabled,
csd.del_flag,
csd.create_by,
csd.create_time,
csd.update_by,
csd.update_time,
csd.sys_org_code,
csd.mp3_file,
csd.mp4_file,
cdt.id AS tag_id,
cdt.tag_name
FROM nu_config_service_directive csd
LEFT JOIN nu_directive_tag dt ON csd.id = dt.directive_id
LEFT JOIN nu_config_directive_tag cdt ON dt.tag_id = cdt.id
) a
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -7,7 +7,7 @@ import java.util.List;
import java.util.Map;
/**
* @Description: nu_config_service_category
* @Description: 服务类别
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -4,7 +4,7 @@ import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceDirective;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: nu_config_service_directive
* @Description: 服务指令
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -4,7 +4,7 @@ import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceType;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: nu_config_service_type
* @Description: 服务类型
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -1,16 +1,25 @@
package com.nu.modules.nuApiServiceCategory.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceCategory;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceDirective;
import com.nu.modules.nuApiServiceCategory.entity.NuConfigServiceType;
import com.nu.modules.nuApiServiceCategory.mapper.NuConfigServiceCategoryMapper;
import com.nu.modules.nuApiServiceCategory.service.INuConfigServiceCategoryService;
import com.nu.modules.nuApiServiceCategory.service.INuConfigServiceDirectiveService;
import com.nu.modules.nuApiServiceCategory.service.INuConfigServiceTypeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: nu_config_service_category
* @Description: 服务类别
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0
@ -18,12 +27,73 @@ import java.util.*;
@Service
public class NuConfigServiceCategoryServiceImpl extends ServiceImpl<NuConfigServiceCategoryMapper, NuConfigServiceCategory> implements INuConfigServiceCategoryService {
@Autowired
private INuConfigServiceTypeService nuConfigServiceTypeService;
@Autowired
private INuConfigServiceDirectiveService nuConfigServiceDirectiveService;
@Override
public List<Map<String, Object>> getServiceTree(NuConfigServiceCategory nuConfigServiceCategory) {
//查询服务类别数据
QueryWrapper<NuConfigServiceCategory> categoryQueryWrapper = new QueryWrapper<>();
categoryQueryWrapper.eq("iz_enabled","0");
categoryQueryWrapper.eq("del_flag","0");
List<NuConfigServiceCategory> categoryList = baseMapper.selectList(categoryQueryWrapper);
//查询服务类型数据
QueryWrapper<NuConfigServiceType> typeQueryWrapper = new QueryWrapper<>();
typeQueryWrapper.eq("iz_enabled","0");
typeQueryWrapper.eq("del_flag","0");
List<NuConfigServiceType> typeList = nuConfigServiceTypeService.list(typeQueryWrapper);
//查询服务指令数据
QueryWrapper<NuConfigServiceDirective> directiveQueryWrapper = new QueryWrapper<>();
directiveQueryWrapper.eq("iz_enabled","0");
directiveQueryWrapper.eq("del_flag","0");
List<NuConfigServiceDirective> directiveList = nuConfigServiceDirectiveService.list(directiveQueryWrapper);
//封装服务指令和服务类型tree集合
List<Map<String, Object>> typeMapList = new ArrayList<>();
for(NuConfigServiceType par : typeList){
Map<String,Object> wllxMap = new HashMap<String,Object>();
List<Map<String,Object>> directiceMapList = new ArrayList<Map<String,Object>>();
for(NuConfigServiceDirective directicePar:directiveList){
if(StringUtils.equals(directicePar.getTypeId(),par.getId())){
Map<String,Object> directiceMap = new HashMap<String,Object>();
directiceMap.put("key",directicePar.getId());
directiceMap.put("levle","3");
directiceMap.put("title",directicePar.getDirectiveName());
directiceMap.put("serviceDuration",directicePar.getServiceDuration());
directiceMap.put("tagName",directicePar.getTagName());
directiceMapList.add(directiceMap);
}
}
wllxMap.put("key",par.getId());
wllxMap.put("parentId",par.getCategoryId());
wllxMap.put("title",par.getTypeName());
wllxMap.put("levle","2");
wllxMap.put("children",directiceMapList);
typeMapList.add(wllxMap);
}
//封装服务类别服务类型tree集合
List<Map<String, Object>> treeList = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
map.put("key","123");
treeList.add(map);
int index = 0;
for(NuConfigServiceCategory par : categoryList){
index++;
Map<String,Object> infoMap = new HashMap<String,Object>();
List<Map<String,Object>> wllxMap2List = new ArrayList<Map<String,Object>>();
for(Map<String,Object> wllxPar : typeMapList){
if(StringUtils.equals(par.getId(),wllxPar.get("parentId").toString())){
wllxMap2List.add(wllxPar);
}
}
infoMap.put("key",par.getId());
infoMap.put("title",index + " " +par.getCategoryName());
infoMap.put("levle","1");
infoMap.put("children",wllxMap2List);
treeList.add(infoMap);
}
return treeList;
}
}

View File

@ -8,7 +8,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: nu_config_service_directive
* @Description: 服务指令
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0

View File

@ -8,7 +8,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: nu_config_service_type
* @Description: 服务类型
* @Author: jeecg-boot
* @Date: 2025-03-28
* @Version: V1.0