Compare commits
2 Commits
5718b856fc
...
d822d0098b
Author | SHA1 | Date |
---|---|---|
|
d822d0098b | |
|
b0832f29e4 |
|
@ -34,6 +34,19 @@ public class DictModel implements Serializable{
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DictModel(String value, String text, Integer status) {
|
||||||
|
this.value = value;
|
||||||
|
this.text = text;
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DictModel(String value, String text, String color, Integer status) {
|
||||||
|
this.value = value;
|
||||||
|
this.text = text;
|
||||||
|
this.color = color;
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典value
|
* 字典value
|
||||||
*/
|
*/
|
||||||
|
@ -46,14 +59,20 @@ public class DictModel implements Serializable{
|
||||||
* 字典颜色
|
* 字典颜色
|
||||||
*/
|
*/
|
||||||
private String color;
|
private String color;
|
||||||
|
/**
|
||||||
|
* 是否启用 1启用 0不启用
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特殊用途: JgEditableTable
|
* 特殊用途: JgEditableTable
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return this.text;
|
return this.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特殊用途: vue3 Select组件
|
* 特殊用途: vue3 Select组件
|
||||||
*/
|
*/
|
||||||
|
@ -61,7 +80,6 @@ public class DictModel implements Serializable{
|
||||||
return this.text;
|
return this.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于表单设计器 关联记录表数据存储
|
* 用于表单设计器 关联记录表数据存储
|
||||||
* QQYUN-5595【表单设计器】他表字段 导入没有翻译
|
* QQYUN-5595【表单设计器】他表字段 导入没有翻译
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
@ -56,8 +57,23 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
IPage<ConfigServiceDirective> pageList = service.pageList(configServiceDirective, pageNo, pageSize);
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
return Result.OK(pageList);
|
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
|
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("typeId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("instructionTagId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("izReimbursement", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("izPreferential", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("chargingFrequency", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
||||||
|
queryWrapper.select("id");
|
||||||
|
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
||||||
|
IPage<ConfigServiceDirective> list = configServiceDirectiveService.page(page, queryWrapper);
|
||||||
|
List<ConfigServiceDirective> pageList = service.pageList(configServiceDirective, list);
|
||||||
|
list.setRecords(pageList);
|
||||||
|
return Result.OK(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,6 +88,9 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@RequestBody ConfigServiceDirective configServiceDirective) {
|
public Result<String> add(@RequestBody ConfigServiceDirective configServiceDirective) {
|
||||||
configServiceDirectiveService.save(configServiceDirective);
|
configServiceDirectiveService.save(configServiceDirective);
|
||||||
|
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
||||||
|
configServiceDirectiveService.saveTags(configServiceDirective);
|
||||||
|
}
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,6 +106,9 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody ConfigServiceDirective configServiceDirective) {
|
public Result<String> edit(@RequestBody ConfigServiceDirective configServiceDirective) {
|
||||||
configServiceDirectiveService.updateById(configServiceDirective);
|
configServiceDirectiveService.updateById(configServiceDirective);
|
||||||
|
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
||||||
|
configServiceDirectiveService.saveTags(configServiceDirective);
|
||||||
|
}
|
||||||
return Result.OK("编辑成功!");
|
return Result.OK("编辑成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,9 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
@ApiModelProperty(value = "服务类型")
|
@ApiModelProperty(value = "服务类型")
|
||||||
@Dict(dicCode = "id" , dictTable = "config_service_type" , dicText = "type_name")
|
@Dict(dicCode = "id" , dictTable = "config_service_type" , dicText = "type_name")
|
||||||
private java.lang.String typeId;
|
private java.lang.String typeId;
|
||||||
/**指令标签id*/
|
/**分类标签*/
|
||||||
@Excel(name = "指令标签", width = 15)
|
@Excel(name = "分类标签", width = 15)
|
||||||
@ApiModelProperty(value = "指令标签")
|
@ApiModelProperty(value = "分类标签")
|
||||||
@Dict(dicCode = "instruction_tag" )
|
@Dict(dicCode = "instruction_tag" )
|
||||||
private java.lang.String instructionTagId;
|
private java.lang.String instructionTagId;
|
||||||
/**服务指令名称*/
|
/**服务指令名称*/
|
||||||
|
@ -137,6 +137,8 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
private Integer typeRowSpan;
|
private Integer typeRowSpan;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer instructionRowSpan;
|
private Integer instructionRowSpan;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String tags;
|
||||||
|
|
||||||
//服务指令标签
|
//服务指令标签
|
||||||
List<DirectiveTag> tagList;
|
List<DirectiveTag> tagList;
|
||||||
|
|
|
@ -22,8 +22,16 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
||||||
* @param directive 主查询对象(包含搜索条件)
|
* @param directive 主查询对象(包含搜索条件)
|
||||||
* @return 分页结果
|
* @return 分页结果
|
||||||
*/
|
*/
|
||||||
IPage<ConfigServiceDirective> pageList(
|
List<ConfigServiceDirective> pageList(
|
||||||
@Param("page") Page<ConfigServiceDirective> page,
|
@Param("directive") ConfigServiceDirective directive,
|
||||||
@Param("directive") ConfigServiceDirective directive
|
@Param("ids") List<ConfigServiceDirective> records
|
||||||
);
|
);
|
||||||
|
// IPage<ConfigServiceDirective> pageList(
|
||||||
|
// @Param("page") Page<ConfigServiceDirective> page,
|
||||||
|
// @Param("directive") ConfigServiceDirective directive
|
||||||
|
// );
|
||||||
|
|
||||||
|
int deleteTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||||
|
|
||||||
|
int saveTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
</collection>
|
</collection>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<!-- 分页查询SQL -->
|
<!-- 分页查询SQL -->
|
||||||
<select id="pageList" resultMap="ConfigServiceDirectiveResultMap" parameterType="map">
|
<select id="pageList" resultMap="ConfigServiceDirectiveResultMap" parameterType="map">
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -67,37 +68,87 @@
|
||||||
LEFT JOIN directive_tag d ON c.id = d.directive_id
|
LEFT JOIN directive_tag d ON c.id = d.directive_id
|
||||||
LEFT JOIN config_directive_tag tag ON d.tag_id = tag.id
|
LEFT JOIN config_directive_tag tag ON d.tag_id = tag.id
|
||||||
<where>
|
<where>
|
||||||
<!-- 动态条件拼接 -->
|
c.id IN
|
||||||
<if test="directive.categoryId != null and directive.categoryId != ''">
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||||
AND c.category_id = #{directive.categoryId}
|
#{item.id}
|
||||||
</if>
|
</foreach>
|
||||||
<if test="directive.typeId != null and directive.typeId != ''">
|
|
||||||
AND c.type_id = #{directive.typeId}
|
|
||||||
</if>
|
|
||||||
<if test="directive.instructionTagId != null and directive.instructionTagId != ''">
|
|
||||||
AND d.tag_id = #{directive.instructionTagId}
|
|
||||||
</if>
|
|
||||||
<if test="directive.directiveName != null and directive.directiveName != ''">
|
|
||||||
AND c.directive_name LIKE CONCAT('%', #{directive.directiveName}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="directive.izReimbursement != null and directive.izReimbursement != ''">
|
|
||||||
AND c.iz_reimbursement = #{directive.izReimbursement}
|
|
||||||
</if>
|
|
||||||
<if test="directive.izPreferential != null and directive.izPreferential != ''">
|
|
||||||
AND c.iz_preferential = #{directive.izPreferential}
|
|
||||||
</if>
|
|
||||||
<if test="directive.chargingFrequency != null and directive.chargingFrequency != ''">
|
|
||||||
AND c.charging_frequency = #{directive.chargingFrequency}
|
|
||||||
</if>
|
|
||||||
<if test="directive.cycleType != null and directive.cycleType != ''">
|
|
||||||
AND c.cycle_type = #{directive.cycleType}
|
|
||||||
</if>
|
|
||||||
<if test="directive.izEnabled != null and directive.izEnabled != ''">
|
|
||||||
AND c.iz_enabled = #{directive.izEnabled}
|
|
||||||
</if>
|
|
||||||
AND c.del_flag = '0'
|
|
||||||
</where>
|
</where>
|
||||||
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc
|
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
<!-- <select id="pageList" resultMap="ConfigServiceDirectiveResultMap" parameterType="map">-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- c.id,-->
|
||||||
|
<!-- c.category_id,-->
|
||||||
|
<!-- c.type_id,-->
|
||||||
|
<!-- c.instruction_tag_id,-->
|
||||||
|
<!-- c.directive_name,-->
|
||||||
|
<!-- c.toll_price,-->
|
||||||
|
<!-- c.com_price,-->
|
||||||
|
<!-- c.iz_reimbursement,-->
|
||||||
|
<!-- c.iz_preferential,-->
|
||||||
|
<!-- c.charging_frequency,-->
|
||||||
|
<!-- c.cycle_type,-->
|
||||||
|
<!-- c.sort,-->
|
||||||
|
<!-- c.service_content,-->
|
||||||
|
<!-- c.service_duration,-->
|
||||||
|
<!-- c.iz_enabled,-->
|
||||||
|
<!-- c.del_flag,-->
|
||||||
|
<!-- c.create_by,-->
|
||||||
|
<!-- c.create_time,-->
|
||||||
|
<!-- c.update_by,-->
|
||||||
|
<!-- c.update_time,-->
|
||||||
|
<!-- c.sys_org_code,-->
|
||||||
|
<!-- c.mp3_file,-->
|
||||||
|
<!-- c.mp4_file,-->
|
||||||
|
<!-- tag.id as tagId,-->
|
||||||
|
<!-- tag.tag_name as tagName-->
|
||||||
|
<!-- FROM config_service_directive c-->
|
||||||
|
<!-- LEFT JOIN directive_tag d ON c.id = d.directive_id-->
|
||||||
|
<!-- LEFT JOIN config_directive_tag tag ON d.tag_id = tag.id-->
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- <!– 动态条件拼接 –>-->
|
||||||
|
<!-- <if test="directive.categoryId != null and directive.categoryId != ''">-->
|
||||||
|
<!-- AND c.category_id = #{directive.categoryId}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.typeId != null and directive.typeId != ''">-->
|
||||||
|
<!-- AND c.type_id = #{directive.typeId}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.instructionTagId != null and directive.instructionTagId != ''">-->
|
||||||
|
<!-- AND d.tag_id = #{directive.instructionTagId}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.directiveName != null and directive.directiveName != ''">-->
|
||||||
|
<!-- AND c.directive_name LIKE CONCAT('%', #{directive.directiveName}, '%')-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.izReimbursement != null and directive.izReimbursement != ''">-->
|
||||||
|
<!-- AND c.iz_reimbursement = #{directive.izReimbursement}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.izPreferential != null and directive.izPreferential != ''">-->
|
||||||
|
<!-- AND c.iz_preferential = #{directive.izPreferential}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.chargingFrequency != null and directive.chargingFrequency != ''">-->
|
||||||
|
<!-- AND c.charging_frequency = #{directive.chargingFrequency}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.cycleType != null and directive.cycleType != ''">-->
|
||||||
|
<!-- AND c.cycle_type = #{directive.cycleType}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="directive.izEnabled != null and directive.izEnabled != ''">-->
|
||||||
|
<!-- AND c.iz_enabled = #{directive.izEnabled}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- AND c.del_flag = '0'-->
|
||||||
|
<!-- </where>-->
|
||||||
|
<!-- ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<delete id="deleteTags">
|
||||||
|
delete
|
||||||
|
from directive_tag
|
||||||
|
where directive_id = #{directive.id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="saveTags">
|
||||||
|
insert into directive_tag (directive_id,tag_id) values
|
||||||
|
<foreach collection="directive.tags.split(',')" item="tagId" separator=",">
|
||||||
|
(#{directive.id}, #{tagId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -19,5 +19,11 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
||||||
|
|
||||||
void merge(List<ConfigServiceDirective> records);
|
void merge(List<ConfigServiceDirective> records);
|
||||||
|
|
||||||
IPage<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, Integer pageNo, Integer pageSize);
|
List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective,IPage<ConfigServiceDirective> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储指令标签数据
|
||||||
|
* @param configServiceDirective
|
||||||
|
*/
|
||||||
|
void saveTags(ConfigServiceDirective configServiceDirective);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||||
import com.nu.modules.serviceDirective.mapper.ConfigServiceDirectiveMapper;
|
import com.nu.modules.serviceDirective.mapper.ConfigServiceDirectiveMapper;
|
||||||
import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
||||||
|
import org.apache.commons.compress.utils.Lists;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -15,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 服务指令
|
* @Description: 服务指令
|
||||||
|
@ -27,33 +30,22 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, Integer pageNo, Integer pageSize) {
|
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective,IPage<ConfigServiceDirective> list_) {
|
||||||
Page<ConfigServiceDirective> page = new Page<>(pageNo, pageSize);
|
if(list_.getRecords() == null || list_.getRecords().isEmpty()){
|
||||||
IPage<ConfigServiceDirective> pageList = baseMapper.pageList(page, configServiceDirective);
|
return list_.getRecords();
|
||||||
//处理单元格合并所需数据
|
}
|
||||||
merge(pageList.getRecords());
|
List<ConfigServiceDirective> list = baseMapper.pageList(configServiceDirective, list_.getRecords());
|
||||||
return pageList;
|
//处理服务标签字段
|
||||||
|
if (list != null && !list.isEmpty()) {
|
||||||
|
list.stream().forEach(record -> {
|
||||||
|
List<DirectiveTag> tagList = record.getTagList();
|
||||||
|
record.setTags(tagList.stream().map(DirectiveTag::getId).collect(Collectors.joining(",")));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//处理单元格合并所需数据
|
||||||
|
merge(list);
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
// @Override
|
|
||||||
// public IPage<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
|
||||||
// // 自定义查询规则
|
|
||||||
// Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
|
||||||
// // 自定义多选的查询规则为:LIKE_WITH_OR
|
|
||||||
// customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// customeRuleMap.put("typeId", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// customeRuleMap.put("instructionTagId", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// customeRuleMap.put("izReimbursement", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// customeRuleMap.put("izPreferential", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// customeRuleMap.put("chargingFrequency", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
// QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
|
||||||
// Page<ConfigServiceDirective> page = new Page<>(pageNo, pageSize);
|
|
||||||
// IPage<ConfigServiceDirective> pageList = page(page, queryWrapper);
|
|
||||||
// //处理单元格合并所需数据
|
|
||||||
// merge(pageList.getRecords());
|
|
||||||
// return pageList;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主合并方法
|
* 主合并方法
|
||||||
|
@ -167,4 +159,15 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储指令标签数据
|
||||||
|
*
|
||||||
|
* @param configServiceDirective
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void saveTags(ConfigServiceDirective configServiceDirective) {
|
||||||
|
baseMapper.deleteTags(configServiceDirective);
|
||||||
|
baseMapper.saveTags(configServiceDirective);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
IPage<DictModel> queryPageTableDictWithFilter(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
|
IPage<DictModel> queryPageTableDictWithFilter(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql,@Param("ena") String ena);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询 字典表数据 支持查询条件 查询所有
|
* 查询 字典表数据 支持查询条件 查询所有
|
||||||
|
@ -170,7 +170,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
List<DictModel> queryTableDictWithFilter(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
|
List<DictModel> queryTableDictWithFilter(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql,@Param("ena") String ena);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询字典表的数据
|
* 查询字典表的数据
|
||||||
|
|
|
@ -70,7 +70,8 @@
|
||||||
dict.dict_code,
|
dict.dict_code,
|
||||||
item.item_text AS "text",
|
item.item_text AS "text",
|
||||||
item.item_value AS "value",
|
item.item_value AS "value",
|
||||||
item.item_color AS "color"
|
item.item_color AS "color",
|
||||||
|
item.status AS "status"
|
||||||
FROM
|
FROM
|
||||||
sys_dict_item item
|
sys_dict_item item
|
||||||
INNER JOIN sys_dict dict ON dict.id = item.dict_id
|
INNER JOIN sys_dict dict ON dict.id = item.dict_id
|
||||||
|
@ -82,7 +83,6 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
AND item.status =1
|
|
||||||
order by dict.dict_code, item.sort_order
|
order by dict.dict_code, item.sort_order
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -179,7 +179,11 @@
|
||||||
|
|
||||||
<!--查询表字典数据,支持关键字和自定义查询条件【已加入SQL注入check】 -->
|
<!--查询表字典数据,支持关键字和自定义查询条件【已加入SQL注入check】 -->
|
||||||
<sql id="queryTableDictWithFilterSqlFragment">
|
<sql id="queryTableDictWithFilterSqlFragment">
|
||||||
select ${text} as "text", ${code} as "value" from ${table}
|
select ${text} as "text", ${code} as "value"
|
||||||
|
<if test="'1'.equals(ena) || ena == 1 || ena == '1'">
|
||||||
|
,iz_enabled as status
|
||||||
|
</if>
|
||||||
|
from ${table}
|
||||||
<if test="filterSql != null and filterSql != ''">
|
<if test="filterSql != null and filterSql != ''">
|
||||||
where ${filterSql}
|
where ${filterSql}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import org.jeecg.modules.system.security.DictQueryBlackListHandler;
|
import org.jeecg.modules.system.security.DictQueryBlackListHandler;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
@ -127,6 +128,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过查询指定code 获取字典
|
* 通过查询指定code 获取字典
|
||||||
|
*
|
||||||
* @param code
|
* @param code
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -180,7 +182,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
// 使用groupingBy根据dictCode分组
|
// 使用groupingBy根据dictCode分组
|
||||||
sysAllDictItems = sysDictItemList.stream()
|
sysAllDictItems = sysDictItemList.stream()
|
||||||
.collect(Collectors.groupingBy(DictModelMany::getDictCode,
|
.collect(Collectors.groupingBy(DictModelMany::getDictCode,
|
||||||
Collectors.mapping(d -> new DictModel(d.getValue(), d.getText(), d.getColor()), Collectors.toList())));
|
Collectors.mapping(d -> new DictModel(d.getValue(), d.getText(), d.getColor(), d.getStatus()), Collectors.toList())));
|
||||||
log.info(" >>> 1 获取系统字典项耗时(SQL):" + (System.currentTimeMillis() - start) + "毫秒");
|
log.info(" >>> 1 获取系统字典项耗时(SQL):" + (System.currentTimeMillis() - start) + "毫秒");
|
||||||
|
|
||||||
Map<String, List<DictModel>> enumRes = ResourceUtil.getEnumDictData();
|
Map<String, List<DictModel>> enumRes = ResourceUtil.getEnumDictData();
|
||||||
|
@ -196,6 +198,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过查询指定code 获取字典值text
|
* 通过查询指定code 获取字典值text
|
||||||
|
*
|
||||||
* @param code
|
* @param code
|
||||||
* @param key
|
* @param key
|
||||||
* @return
|
* @return
|
||||||
|
@ -226,6 +229,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
/**
|
/**
|
||||||
* 通过查询指定table的 text code 获取字典
|
* 通过查询指定table的 text code 获取字典
|
||||||
* dictTableCache采用redis缓存有效期10分钟
|
* dictTableCache采用redis缓存有效期10分钟
|
||||||
|
*
|
||||||
* @param tableFilterSql
|
* @param tableFilterSql
|
||||||
* @param text
|
* @param text
|
||||||
* @param code
|
* @param code
|
||||||
|
@ -263,9 +267,13 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
table = SqlInjectionUtil.getSqlInjectTableName(table);
|
table = SqlInjectionUtil.getSqlInjectTableName(table);
|
||||||
text = SqlInjectionUtil.getSqlInjectField(text);
|
text = SqlInjectionUtil.getSqlInjectField(text);
|
||||||
code = SqlInjectionUtil.getSqlInjectField(code);
|
code = SqlInjectionUtil.getSqlInjectField(code);
|
||||||
|
List<DictModel> dictModels = Lists.newArrayList();
|
||||||
//return sysDictMapper.queryTableDictItemsByCode(tableFilterSql,text,code);
|
try {
|
||||||
return sysDictMapper.queryTableDictWithFilter(table,text,code,filterSql);
|
dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, "1");
|
||||||
|
} catch (Exception e) {
|
||||||
|
dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, null);
|
||||||
|
}
|
||||||
|
return dictModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -290,13 +298,19 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
table = SqlInjectionUtil.getSqlInjectTableName(table);
|
table = SqlInjectionUtil.getSqlInjectTableName(table);
|
||||||
text = SqlInjectionUtil.getSqlInjectField(text);
|
text = SqlInjectionUtil.getSqlInjectField(text);
|
||||||
code = SqlInjectionUtil.getSqlInjectField(code);
|
code = SqlInjectionUtil.getSqlInjectField(code);
|
||||||
|
List<DictModel> dictModels = Lists.newArrayList();
|
||||||
return sysDictMapper.queryTableDictWithFilter(table,text,code,filterSql);
|
try {
|
||||||
|
dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, "1");
|
||||||
|
} catch (Exception e) {
|
||||||
|
dictModels = sysDictMapper.queryTableDictWithFilter(table, text, code, filterSql, null);
|
||||||
|
}
|
||||||
|
return dictModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过查询指定table的 text code 获取字典值text
|
* 通过查询指定table的 text code 获取字典值text
|
||||||
* dictTableCache采用redis缓存有效期10分钟
|
* dictTableCache采用redis缓存有效期10分钟
|
||||||
|
*
|
||||||
* @param table
|
* @param table
|
||||||
* @param text
|
* @param text
|
||||||
* @param code
|
* @param code
|
||||||
|
@ -402,6 +416,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
/**
|
/**
|
||||||
* 通过查询指定table的 text code 获取字典,包含text和value
|
* 通过查询指定table的 text code 获取字典,包含text和value
|
||||||
* dictTableCache采用redis缓存有效期10分钟
|
* dictTableCache采用redis缓存有效期10分钟
|
||||||
|
*
|
||||||
* @param table
|
* @param table
|
||||||
* @param text
|
* @param text
|
||||||
* @param code
|
* @param code
|
||||||
|
@ -524,7 +539,12 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
String filterSql = getFilterSql(tableSql, text, code, condition, keyword);
|
String filterSql = getFilterSql(tableSql, text, code, condition, keyword);
|
||||||
|
|
||||||
// 3. 返回表字典数据
|
// 3. 返回表字典数据
|
||||||
IPage<DictModel> pageList = baseMapper.queryPageTableDictWithFilter(page, table, text, code, filterSql);
|
IPage<DictModel> pageList = new Page<>();
|
||||||
|
try {
|
||||||
|
pageList = baseMapper.queryPageTableDictWithFilter(page, table, text, code, filterSql, "1");
|
||||||
|
} catch (Exception e) {
|
||||||
|
pageList = baseMapper.queryPageTableDictWithFilter(page, table, text, code, filterSql, null);
|
||||||
|
}
|
||||||
return pageList.getRecords();
|
return pageList.getRecords();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,8 +636,12 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
table = SqlInjectionUtil.getSqlInjectTableName(table);
|
table = SqlInjectionUtil.getSqlInjectTableName(table);
|
||||||
text = SqlInjectionUtil.getSqlInjectField(text);
|
text = SqlInjectionUtil.getSqlInjectField(text);
|
||||||
code = SqlInjectionUtil.getSqlInjectField(code);
|
code = SqlInjectionUtil.getSqlInjectField(code);
|
||||||
|
List<DictModel> ls = Lists.newArrayList();
|
||||||
List<DictModel> ls = baseMapper.queryTableDictWithFilter(table, text, code, filterSql);
|
try {
|
||||||
|
ls = baseMapper.queryTableDictWithFilter(table, text, code, filterSql, "1");
|
||||||
|
} catch (Exception e) {
|
||||||
|
ls = baseMapper.queryTableDictWithFilter(table, text, code, filterSql, null);
|
||||||
|
}
|
||||||
return ls;
|
return ls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -842,6 +866,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 还原逻辑删除
|
* 还原逻辑删除
|
||||||
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -851,6 +876,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 彻底删除
|
* 彻底删除
|
||||||
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -866,6 +892,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加字典
|
* 添加字典
|
||||||
|
*
|
||||||
* @param dictName
|
* @param dictName
|
||||||
*/
|
*/
|
||||||
private String[] addDict(String dictName, String lowAppId, Integer tenantId) {
|
private String[] addDict(String dictName, String lowAppId, Integer tenantId) {
|
||||||
|
@ -882,6 +909,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加字典子项
|
* 添加字典子项
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @param dictItemList
|
* @param dictItemList
|
||||||
*/
|
*/
|
||||||
|
@ -900,6 +928,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新字典子项
|
* 更新字典子项
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @param dictItemList
|
* @param dictItemList
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue