部门接口,字典树接口调整
This commit is contained in:
@@ -31,6 +31,10 @@ public interface DictTreeFeignClient {
|
|||||||
@GetMapping("/queryAll")
|
@GetMapping("/queryAll")
|
||||||
HttpResult<List<SysDicTreePO>> queryAll() ;
|
HttpResult<List<SysDicTreePO>> queryAll() ;
|
||||||
|
|
||||||
|
@GetMapping("/queryAllByType")
|
||||||
|
HttpResult<List<SysDicTreePO>> queryAllByType(@RequestParam("type")Integer type) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/queryTree")
|
@GetMapping("/queryTree")
|
||||||
HttpResult<List<SysDicTreePO>> queryTree() ;
|
HttpResult<List<SysDicTreePO>> queryTree() ;
|
||||||
|
|||||||
@@ -58,6 +58,11 @@ public class DictTreeFeignClientFallbackFactory implements FallbackFactory<DictT
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<SysDicTreePO>> queryAllByType(Integer type) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","分类获取所有字典树数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<SysDicTreePO>> queryTree() {
|
public HttpResult<List<SysDicTreePO>> queryTree() {
|
||||||
log.error("{}异常,降级处理,异常为:{}","获取树形数据",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取树形数据",cause.toString());
|
||||||
|
|||||||
@@ -19,16 +19,26 @@ public enum DicTreeEnum {
|
|||||||
Wind_Farms("风电场","1401"),
|
Wind_Farms("风电场","1401"),
|
||||||
Power_Station("光伏电站","1402"),
|
Power_Station("光伏电站","1402"),
|
||||||
//其实对应其他非线性负荷
|
//其实对应其他非线性负荷
|
||||||
Smelting_Load("冶炼负荷","2300"),
|
Smelting_Load("其他非线性负荷","2300"),
|
||||||
Imp_Users("敏感/重要/高危用户","2400"),
|
Imp_Users("敏感/重要/高危用户","2400"),
|
||||||
|
|
||||||
//冶炼负荷->小类
|
//冶炼负荷->小类(以下5个对应主网测点中的所属场站的冶炼负荷)
|
||||||
Electric_Heating_Load("电加热负荷(含电弧炉、中频炉、电热炉、单/多晶硅生产设备)","2301"),
|
Electric_Heating_Load("电加热负荷(含电弧炉、中频炉、电热炉、单/多晶硅生产设备)","2301"),
|
||||||
Rolling_Mill("轧机","2303"),
|
Rolling_Mill("轧机","2303"),
|
||||||
Welding_Load("电焊负荷","2306"),
|
Welding_Load("电焊负荷","2306"),
|
||||||
Lifting_Load("起重负荷(含电铲、升降机、门吊等吊装设备)","2308"),
|
Lifting_Load("起重负荷(含电铲、升降机、门吊等吊装设备)","2308"),
|
||||||
Electrolytic_Load("电解负荷","2309"),
|
Electrolytic_Load("电解负荷","2309"),
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
rail_traffic("轨道交通","2304"),
|
||||||
|
electric_vehicle("电动汽车充电站","2305"),
|
||||||
|
inverter_motor("变频调速负荷(变频电机、变频水泵等)","2312"),
|
||||||
|
Commercial_civil_use("商业/市政/民用/电子通讯负荷(含变频空调、大型电梯、节能照明设备、UPS、开关电源、逆变电源等)","2315"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//冀北主要非线性设备类型
|
//冀北主要非线性设备类型
|
||||||
/**
|
/**
|
||||||
* 类型 类别 名称 所属行业 主要关注的电能质量指标
|
* 类型 类别 名称 所属行业 主要关注的电能质量指标
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
package com.njcn.system.pojo.param;
|
//package com.njcn.system.pojo.param;
|
||||||
|
//
|
||||||
import com.njcn.common.pojo.constant.PatternRegex;
|
//import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
import com.njcn.web.constant.ValidMessage;
|
//import com.njcn.web.constant.ValidMessage;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
//import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
//import lombok.EqualsAndHashCode;
|
||||||
import org.hibernate.validator.constraints.Range;
|
//import org.hibernate.validator.constraints.Range;
|
||||||
|
//
|
||||||
import javax.validation.constraints.NotBlank;
|
//import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
//import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Pattern;
|
//import javax.validation.constraints.Pattern;
|
||||||
|
//
|
||||||
@Data
|
//@Data
|
||||||
public class DicParam {
|
//public class DicParam {
|
||||||
|
//
|
||||||
@ApiModelProperty("节点")
|
// @ApiModelProperty("节点")
|
||||||
@NotBlank(message = ValidMessage.PID_NOT_BLANK)
|
// @NotBlank(message = ValidMessage.PID_NOT_BLANK)
|
||||||
private String pid;
|
// private String pid;
|
||||||
|
//
|
||||||
@ApiModelProperty("名称")
|
// @ApiModelProperty("名称")
|
||||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
// @NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||||
@Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
// @Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||||
private String name;
|
// private String name;
|
||||||
|
//
|
||||||
@ApiModelProperty("编号")
|
// @ApiModelProperty("编号")
|
||||||
@NotBlank(message = ValidMessage.CODE_NOT_BLANK)
|
// @NotBlank(message = ValidMessage.CODE_NOT_BLANK)
|
||||||
private String code;
|
// private String code;
|
||||||
|
//
|
||||||
@ApiModelProperty("排序")
|
// @ApiModelProperty("排序")
|
||||||
@NotNull(message = ValidMessage.SORT_NOT_NULL)
|
// @NotNull(message = ValidMessage.SORT_NOT_NULL)
|
||||||
@Range(min = 0, max = 999, message = ValidMessage.PARAM_FORMAT_ERROR)
|
// @Range(min = 0, max = 999, message = ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private Integer sort;
|
// private Integer sort;
|
||||||
|
//
|
||||||
@ApiModelProperty("描述")
|
// @ApiModelProperty("描述")
|
||||||
private String remark;
|
// private String remark;
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 更新操作实体
|
// * 更新操作实体
|
||||||
* 需要填写的参数:id
|
// * 需要填写的参数:id
|
||||||
*/
|
// */
|
||||||
@Data
|
// @Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
// @EqualsAndHashCode(callSuper = true)
|
||||||
public static class UpdateParam extends DicParam {
|
// public static class UpdateParam extends DicParam {
|
||||||
|
//
|
||||||
@ApiModelProperty("Id")
|
// @ApiModelProperty("Id")
|
||||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
// @NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
// @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
private String id;
|
// private String id;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -41,6 +41,16 @@ public class DictTreeParam {
|
|||||||
@NotBlank(message = ValidMessage.CODE_NOT_BLANK)
|
@NotBlank(message = ValidMessage.CODE_NOT_BLANK)
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于区分多种类型的字典树 0.台账对象类型 1.自定义报表指标类型
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据type自定义内容,type:0用于区分对象类型是101电网侧 102用户侧
|
||||||
|
*/
|
||||||
|
private String extend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
package com.njcn.system.pojo.po;
|
//package com.njcn.system.pojo.po;
|
||||||
|
//
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
//import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
//import com.njcn.db.bo.BaseEntity;
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
//import lombok.EqualsAndHashCode;
|
||||||
|
//
|
||||||
@Data
|
//@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
//@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName("sys_dic_tree")
|
//@TableName("sys_dic_tree")
|
||||||
public class Dic extends BaseEntity {
|
//public class Dic extends BaseEntity {
|
||||||
|
//
|
||||||
private static final long serialVersionUID = 1L;
|
// private static final long serialVersionUID = 1L;
|
||||||
|
//
|
||||||
private String id;
|
// private String id;
|
||||||
|
//
|
||||||
private String pid;
|
// private String pid;
|
||||||
|
//
|
||||||
private String pids;
|
// private String pids;
|
||||||
|
//
|
||||||
private String name;
|
// private String name;
|
||||||
|
//
|
||||||
private String code;
|
// private String code;
|
||||||
|
//
|
||||||
private Integer sort;
|
// private Integer sort;
|
||||||
|
//
|
||||||
private String remark;
|
// private String remark;
|
||||||
|
//
|
||||||
private Integer status;
|
// private Integer status;
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -51,6 +51,16 @@ public class SysDicTreePO extends BaseEntity {
|
|||||||
@TableField(value = "code")
|
@TableField(value = "code")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于区分多种类型的字典树 0.台账对象类型 1.自定义报表指标类型
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据type自定义内容,type:0用于区分对象类型是101电网侧 102用户侧
|
||||||
|
*/
|
||||||
|
private String extend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
package com.njcn.system.pojo.vo;
|
//package com.njcn.system.pojo.vo;
|
||||||
|
//
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
//import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
|
//
|
||||||
import java.io.Serializable;
|
//import java.io.Serializable;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
@Data
|
//@Data
|
||||||
public class DicVO implements Serializable {
|
//public class DicVO implements Serializable {
|
||||||
|
//
|
||||||
@ApiModelProperty("Id")
|
// @ApiModelProperty("Id")
|
||||||
private String id;
|
// private String id;
|
||||||
|
//
|
||||||
@ApiModelProperty("父节点")
|
// @ApiModelProperty("父节点")
|
||||||
private String pid;
|
// private String pid;
|
||||||
|
//
|
||||||
@ApiModelProperty("名称")
|
// @ApiModelProperty("名称")
|
||||||
private String name;
|
// private String name;
|
||||||
|
//
|
||||||
@ApiModelProperty("编码")
|
// @ApiModelProperty("编码")
|
||||||
private String code;
|
// private String code;
|
||||||
|
//
|
||||||
@ApiModelProperty("排序")
|
// @ApiModelProperty("排序")
|
||||||
private Integer sort;
|
// private Integer sort;
|
||||||
|
//
|
||||||
@ApiModelProperty("描述")
|
// @ApiModelProperty("描述")
|
||||||
private String remark;
|
// private String remark;
|
||||||
|
//
|
||||||
@ApiModelProperty("状态")
|
// @ApiModelProperty("状态")
|
||||||
private Integer status;
|
// private Integer status;
|
||||||
|
//
|
||||||
@ApiModelProperty("子级")
|
// @ApiModelProperty("子级")
|
||||||
List<DicVO> children;
|
// List<DicVO> children;
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -42,6 +42,16 @@ public class DictTreeVO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于区分多种类型的字典树 0.台账对象类型 1.自定义报表指标类型
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据type自定义内容,type:0用于区分对象类型是101电网侧 102用户侧
|
||||||
|
*/
|
||||||
|
private String extend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,137 +1,137 @@
|
|||||||
package com.njcn.system.controller;
|
//package com.njcn.system.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
//import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
//import com.njcn.common.pojo.constant.OperateType;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
//import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
//import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
//import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
//import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.common.utils.LogUtil;
|
//import com.njcn.common.utils.LogUtil;
|
||||||
import com.njcn.system.pojo.param.DicParam;
|
//import com.njcn.system.pojo.param.DicParam;
|
||||||
import com.njcn.system.pojo.po.Dic;
|
//import com.njcn.system.pojo.po.Dic;
|
||||||
import com.njcn.system.pojo.vo.DicVO;
|
//import com.njcn.system.pojo.vo.DicVO;
|
||||||
import com.njcn.system.service.IDicService;
|
//import com.njcn.system.service.IDicService;
|
||||||
import com.njcn.user.pojo.param.FunctionParam;
|
//import com.njcn.user.pojo.param.FunctionParam;
|
||||||
import com.njcn.user.pojo.po.Function;
|
//import com.njcn.user.pojo.po.Function;
|
||||||
import com.njcn.web.controller.BaseController;
|
//import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
//import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
//import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
//import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
//import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
//import org.springframework.web.bind.annotation.*;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author hany
|
// * @author hany
|
||||||
* @date 2022/10/18
|
// * @date 2022/10/18
|
||||||
*/
|
// */
|
||||||
@Validated
|
//@Validated
|
||||||
@Slf4j
|
//@Slf4j
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/dic")
|
//@RequestMapping("/dic")
|
||||||
@Api(tags = "树型字典管理")
|
//@Api(tags = "树型字典管理")
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
public class DicController extends BaseController {
|
//public class DicController extends BaseController {
|
||||||
|
//
|
||||||
private final IDicService dicService;
|
// private final IDicService dicService;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取树
|
// * 获取树
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@GetMapping("/dicTree")
|
// @GetMapping("/dicTree")
|
||||||
@ApiOperation("获取字典树")
|
// @ApiOperation("获取字典树")
|
||||||
public HttpResult<List<DicVO>> getDicTree(){
|
// public HttpResult<List<DicVO>> getDicTree(){
|
||||||
String methodDescribe = getMethodDescribe("getDicTree");
|
// String methodDescribe = getMethodDescribe("getDicTree");
|
||||||
List<DicVO> list = dicService.getDicTree(null);
|
// List<DicVO> list = dicService.getDicTree(null);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@GetMapping("/codeDicTree")
|
// @GetMapping("/codeDicTree")
|
||||||
@ApiOperation("根据code获取字典树")
|
// @ApiOperation("根据code获取字典树")
|
||||||
public HttpResult<List<DicVO>> getCodeDicTree(String code){
|
// public HttpResult<List<DicVO>> getCodeDicTree(String code){
|
||||||
String methodDescribe = getMethodDescribe("getCodeDicTree");
|
// String methodDescribe = getMethodDescribe("getCodeDicTree");
|
||||||
List<DicVO> list = dicService.getDicTree(code);
|
// List<DicVO> list = dicService.getDicTree(code);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||||
}
|
// }
|
||||||
/**
|
// /**
|
||||||
* 新增
|
// * 新增
|
||||||
* @param dicParam
|
// * @param dicParam
|
||||||
*/
|
// */
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/add")
|
// @PostMapping("/add")
|
||||||
@ApiOperation("新增")
|
// @ApiOperation("新增")
|
||||||
@ApiImplicitParam(name = "dicParam", value = "新增数据", required = true)
|
// @ApiImplicitParam(name = "dicParam", value = "新增数据", required = true)
|
||||||
public HttpResult<Boolean> add(@RequestBody @Validated DicParam dicParam) {
|
// public HttpResult<Boolean> add(@RequestBody @Validated DicParam dicParam) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
// String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},数据为:{}", methodDescribe, dicParam);
|
// LogUtil.njcnDebug(log, "{},数据为:{}", methodDescribe, dicParam);
|
||||||
boolean result = dicService.addDic(dicParam);
|
// boolean result = dicService.addDic(dicParam);
|
||||||
if (result) {
|
// if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
// } else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改
|
// * 修改
|
||||||
* @param dicParam
|
// * @param dicParam
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||||
@PutMapping("/update")
|
// @PutMapping("/update")
|
||||||
@ApiOperation("修改")
|
// @ApiOperation("修改")
|
||||||
@ApiImplicitParam(name = "dicParam", value = "数据", required = true)
|
// @ApiImplicitParam(name = "dicParam", value = "数据", required = true)
|
||||||
public HttpResult<Boolean> update(@RequestBody @Validated DicParam.UpdateParam dicParam) {
|
// public HttpResult<Boolean> update(@RequestBody @Validated DicParam.UpdateParam dicParam) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
// String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},更新的信息为:{}", methodDescribe,dicParam);
|
// LogUtil.njcnDebug(log, "{},更新的信息为:{}", methodDescribe,dicParam);
|
||||||
boolean result = dicService.updateDic(dicParam);
|
// boolean result = dicService.updateDic(dicParam);
|
||||||
if (result){
|
// if (result){
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
// } else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 删除
|
// * 删除
|
||||||
* @param id
|
// * @param id
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||||
@DeleteMapping("/delete")
|
// @DeleteMapping("/delete")
|
||||||
@ApiOperation("删除")
|
// @ApiOperation("删除")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true)
|
// @ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
public HttpResult<Boolean> delete(@RequestParam @Validated String id) {
|
// public HttpResult<Boolean> delete(@RequestParam @Validated String id) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
// String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除的id为:{}", methodDescribe,id);
|
// LogUtil.njcnDebug(log, "{},删除的id为:{}", methodDescribe,id);
|
||||||
boolean result = dicService.deleteDic(id);
|
// boolean result = dicService.deleteDic(id);
|
||||||
if (result){
|
// if (result){
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
// } else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 查询
|
// * 查询
|
||||||
* @param id
|
// * @param id
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@GetMapping("/getDicById")
|
// @GetMapping("/getDicById")
|
||||||
@ApiOperation("查看详情")
|
// @ApiOperation("查看详情")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true)
|
// @ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
public HttpResult<Dic> getDicById(String id){
|
// public HttpResult<Dic> getDicById(String id){
|
||||||
String methodDescribe = getMethodDescribe("getDicById");
|
// String methodDescribe = getMethodDescribe("getDicById");
|
||||||
LogUtil.njcnDebug(log, "{},id为:{}", methodDescribe,id);
|
// LogUtil.njcnDebug(log, "{},id为:{}", methodDescribe,id);
|
||||||
Dic dic = dicService.getDicById(id);
|
// Dic dic = dicService.getDicById(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,dic,methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,dic,methodDescribe);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -130,6 +130,15 @@ public class DictTreeController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@GetMapping("/queryAllByType")
|
||||||
|
@ApiOperation("分类查询所有树形字典")
|
||||||
|
public HttpResult<List<SysDicTreePO>> queryAllByType(@RequestParam("type")Integer type) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryAll");
|
||||||
|
List<SysDicTreePO> result = sysDicTreePOService.queryAllByType(type);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@GetMapping("/queryTree")
|
@GetMapping("/queryTree")
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.njcn.system.mapper;
|
//package com.njcn.system.mapper;
|
||||||
|
//
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.system.pojo.po.Dic;
|
//import com.njcn.system.pojo.po.Dic;
|
||||||
import com.njcn.system.pojo.vo.DicVO;
|
//import com.njcn.system.pojo.vo.DicVO;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
public interface DicMapper extends BaseMapper<Dic> {
|
//public interface DicMapper extends BaseMapper<Dic> {
|
||||||
|
//
|
||||||
List<DicVO> getAllDic();
|
// List<DicVO> getAllDic();
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<?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">
|
|
||||||
<mapper namespace="com.njcn.system.mapper.DicMapper">
|
|
||||||
|
|
||||||
<select id="getAllDic" resultType="DicVO">
|
|
||||||
SELECT * from sys_dic_tree WHERE status = 0
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
@@ -1,52 +1,52 @@
|
|||||||
package com.njcn.system.service;
|
//package com.njcn.system.service;
|
||||||
|
//
|
||||||
|
//
|
||||||
import com.njcn.system.pojo.param.DicParam;
|
//import com.njcn.system.pojo.param.DicParam;
|
||||||
import com.njcn.system.pojo.po.Dic;
|
//import com.njcn.system.pojo.po.Dic;
|
||||||
import com.njcn.system.pojo.vo.DicVO;
|
//import com.njcn.system.pojo.vo.DicVO;
|
||||||
import com.njcn.user.pojo.param.FunctionParam;
|
//import com.njcn.user.pojo.param.FunctionParam;
|
||||||
import com.njcn.user.pojo.po.Function;
|
//import com.njcn.user.pojo.po.Function;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author hany
|
// * @author hany
|
||||||
* @date 2022/10/18
|
// * @date 2022/10/18
|
||||||
*/
|
// */
|
||||||
public interface IDicService {
|
//public interface IDicService {
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取树
|
// * 获取树
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
List<DicVO> getDicTree(String code);
|
// List<DicVO> getDicTree(String code);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 功能描述:新增
|
// * 功能描述:新增
|
||||||
*
|
// *
|
||||||
* @param dicParam 资源参数
|
// * @param dicParam 资源参数
|
||||||
*/
|
// */
|
||||||
boolean addDic(DicParam dicParam);
|
// boolean addDic(DicParam dicParam);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 功能描述: 修改
|
// * 功能描述: 修改
|
||||||
*
|
// *
|
||||||
* @param dicParam
|
// * @param dicParam
|
||||||
*/
|
// */
|
||||||
boolean updateDic(DicParam.UpdateParam dicParam);
|
// boolean updateDic(DicParam.UpdateParam dicParam);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 功能描述:删除
|
// * 功能描述:删除
|
||||||
*
|
// *
|
||||||
* @param id
|
// * @param id
|
||||||
* @return boolean
|
// * @return boolean
|
||||||
*/
|
// */
|
||||||
boolean deleteDic(String id);
|
// boolean deleteDic(String id);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 功能描述: 根据id获取菜单详情
|
// * 功能描述: 根据id获取菜单详情
|
||||||
*
|
// *
|
||||||
* @param id
|
// * @param id
|
||||||
*/
|
// */
|
||||||
Dic getDicById(String id);
|
// Dic getDicById(String id);
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -40,5 +40,12 @@ public interface SysDicTreePOService extends IService<SysDicTreePO>{
|
|||||||
*/
|
*/
|
||||||
List<SysDicTreePO> queryAll();
|
List<SysDicTreePO> queryAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类查询所有树形字典
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/12/18
|
||||||
|
*/
|
||||||
|
List<SysDicTreePO> queryAllByType(Integer type);
|
||||||
|
|
||||||
List<SysDicTreePO> queryTree();
|
List<SysDicTreePO> queryTree();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,25 +8,20 @@ import com.njcn.system.pojo.po.*;
|
|||||||
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
||||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||||
import com.njcn.system.service.IDicService;
|
|
||||||
import com.njcn.system.service.IEleEpdPqdService;
|
import com.njcn.system.service.IEleEpdPqdService;
|
||||||
import com.njcn.system.service.SysDicTreePOService;
|
import com.njcn.system.service.SysDicTreePOService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njcn.system.mapper.CsStatisticalSetPOMapper;
|
import com.njcn.system.mapper.CsStatisticalSetPOMapper;
|
||||||
import com.njcn.system.service.CsStatisticalSetPOService;
|
import com.njcn.system.service.CsStatisticalSetPOService;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/6/9 16:17【需求编号】
|
* Date: 2023/6/9 16:17【需求编号】
|
||||||
*
|
*
|
||||||
@@ -38,7 +33,6 @@ import org.springframework.util.CollectionUtils;
|
|||||||
public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalSetPOMapper, CsStatisticalSetPO> implements CsStatisticalSetPOService{
|
public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalSetPOMapper, CsStatisticalSetPO> implements CsStatisticalSetPOService{
|
||||||
|
|
||||||
private final IEleEpdPqdService epdPqdService;
|
private final IEleEpdPqdService epdPqdService;
|
||||||
private final IDicService dicService;
|
|
||||||
|
|
||||||
private final SysDicTreePOService sysDicTreePOService;
|
private final SysDicTreePOService sysDicTreePOService;
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,130 +1,130 @@
|
|||||||
package com.njcn.system.service.impl;
|
//package com.njcn.system.service.impl;
|
||||||
|
//
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
//import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
//import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.system.enums.EventResponseEnum;
|
//import com.njcn.system.enums.EventResponseEnum;
|
||||||
import com.njcn.system.enums.TemplateTreeEnum;
|
//import com.njcn.system.enums.TemplateTreeEnum;
|
||||||
import com.njcn.system.mapper.DicMapper;
|
//import com.njcn.system.mapper.DicMapper;
|
||||||
import com.njcn.system.pojo.constant.DicState;
|
//import com.njcn.system.pojo.constant.DicState;
|
||||||
import com.njcn.system.pojo.param.DicParam;
|
//import com.njcn.system.pojo.param.DicParam;
|
||||||
import com.njcn.system.pojo.po.Dic;
|
//import com.njcn.system.pojo.po.Dic;
|
||||||
import com.njcn.system.pojo.vo.DicVO;
|
//import com.njcn.system.pojo.vo.DicVO;
|
||||||
import com.njcn.system.service.IDicService;
|
//import com.njcn.system.service.IDicService;
|
||||||
import lombok.RequiredArgsConstructor;
|
//import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
//import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
import java.util.Comparator;
|
//import java.util.Comparator;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
import java.util.Objects;
|
//import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
//import java.util.stream.Collectors;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author hany
|
// * @author hany
|
||||||
* @date 2022/10/18
|
// * @date 2022/10/18
|
||||||
*/
|
// */
|
||||||
@Slf4j
|
//@Slf4j
|
||||||
@Service
|
//@Service
|
||||||
@RequiredArgsConstructor
|
//@RequiredArgsConstructor
|
||||||
public class DicServiceImpl extends ServiceImpl<DicMapper, Dic> implements IDicService {
|
//public class DicServiceImpl extends ServiceImpl<DicMapper, Dic> implements IDicService {
|
||||||
|
//
|
||||||
private final DicMapper dicMapper;
|
// private final DicMapper dicMapper;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public boolean addDic(DicParam dicParam) {
|
// public boolean addDic(DicParam dicParam) {
|
||||||
checkDicParam(dicParam,false);
|
// checkDicParam(dicParam,false);
|
||||||
Dic dic = new Dic();
|
// Dic dic = new Dic();
|
||||||
BeanUtil.copyProperties(dicParam, dic);
|
// BeanUtil.copyProperties(dicParam, dic);
|
||||||
dic.setStatus(DicState.ENABLE);
|
// dic.setStatus(DicState.ENABLE);
|
||||||
if (Objects.equals(dicParam.getPid(),DicState.FATHER_PID)){
|
// if (Objects.equals(dicParam.getPid(),DicState.FATHER_PID)){
|
||||||
dic.setPids(DicState.FATHER_PID);
|
// dic.setPids(DicState.FATHER_PID);
|
||||||
} else {
|
// } else {
|
||||||
Dic fatherFaction = this.lambdaQuery().eq(Dic::getId,dicParam.getPid()).one();
|
// Dic fatherFaction = this.lambdaQuery().eq(Dic::getId,dicParam.getPid()).one();
|
||||||
if (Objects.equals(fatherFaction.getPid(),DicState.FATHER_PID)){
|
// if (Objects.equals(fatherFaction.getPid(),DicState.FATHER_PID)){
|
||||||
dic.setPids(dicParam.getPid());
|
// dic.setPids(dicParam.getPid());
|
||||||
} else {
|
// } else {
|
||||||
String pidS = fatherFaction.getPids();
|
// String pidS = fatherFaction.getPids();
|
||||||
dic.setPids(pidS+","+dicParam.getPid());
|
// dic.setPids(pidS+","+dicParam.getPid());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return this.save(dic);
|
// return this.save(dic);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public boolean updateDic(DicParam.UpdateParam dicParam) {
|
// public boolean updateDic(DicParam.UpdateParam dicParam) {
|
||||||
checkDicParam(dicParam,true);
|
// checkDicParam(dicParam,true);
|
||||||
Dic dic = new Dic();
|
// Dic dic = new Dic();
|
||||||
BeanUtil.copyProperties(dicParam, dic);
|
// BeanUtil.copyProperties(dicParam, dic);
|
||||||
return this.updateById(dic);
|
// return this.updateById(dic);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public boolean deleteDic(String id) {
|
// public boolean deleteDic(String id) {
|
||||||
return this.lambdaUpdate().set(Dic::getStatus, DicState.DELETE).in(Dic::getId, id).update();
|
// return this.lambdaUpdate().set(Dic::getStatus, DicState.DELETE).in(Dic::getId, id).update();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Dic getDicById(String id) {
|
// public Dic getDicById(String id) {
|
||||||
return this.lambdaQuery().eq(Dic::getId,id).one();
|
// return this.lambdaQuery().eq(Dic::getId,id).one();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取树
|
// * 获取树
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public List<DicVO> getDicTree(String code) {
|
// public List<DicVO> getDicTree(String code) {
|
||||||
List<DicVO> list = dicMapper.getAllDic();
|
// List<DicVO> list = dicMapper.getAllDic();
|
||||||
return list.stream()
|
// return list.stream()
|
||||||
.filter(fun -> {
|
// .filter(fun -> {
|
||||||
boolean flag =true;
|
// boolean flag =true;
|
||||||
boolean flag1 =true;
|
// boolean flag1 =true;
|
||||||
flag = Objects.equals(TemplateTreeEnum.FATHER_PID,fun.getPid());
|
// flag = Objects.equals(TemplateTreeEnum.FATHER_PID,fun.getPid());
|
||||||
if(!StringUtils.isEmpty(code)){
|
// if(!StringUtils.isEmpty(code)){
|
||||||
flag1 = fun.getCode().equals(code);
|
// flag1 = fun.getCode().equals(code);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return flag&&flag1;
|
// return flag&&flag1;
|
||||||
|
//
|
||||||
})
|
// })
|
||||||
.peek(funS -> funS.setChildren(getChildList(funS, list)))
|
// .peek(funS -> funS.setChildren(getChildList(funS, list)))
|
||||||
.sorted(Comparator.comparingInt(DicVO::getSort))
|
// .sorted(Comparator.comparingInt(DicVO::getSort))
|
||||||
.collect(Collectors.toList());
|
// .collect(Collectors.toList());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 递归组装
|
// * 递归组装
|
||||||
*/
|
// */
|
||||||
private List<DicVO> getChildList(DicVO dictMenu, List<DicVO> categories) {
|
// private List<DicVO> getChildList(DicVO dictMenu, List<DicVO> categories) {
|
||||||
return categories.stream().filter(o -> Objects.equals(o.getPid(),dictMenu.getId()))
|
// return categories.stream().filter(o -> Objects.equals(o.getPid(),dictMenu.getId()))
|
||||||
.peek(o -> o.setChildren(getChildList(o, categories)))
|
// .peek(o -> o.setChildren(getChildList(o, categories)))
|
||||||
.sorted(Comparator.comparingInt(DicVO::getSort))
|
// .sorted(Comparator.comparingInt(DicVO::getSort))
|
||||||
.collect(Collectors.toList());
|
// .collect(Collectors.toList());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 校验参数,
|
// * 校验参数,
|
||||||
* 1.检查是否存在相同名称的菜单
|
// * 1.检查是否存在相同名称的菜单
|
||||||
*/
|
// */
|
||||||
private void checkDicParam(DicParam dicParam, boolean isExcludeSelf) {
|
// private void checkDicParam(DicParam dicParam, boolean isExcludeSelf) {
|
||||||
LambdaQueryWrapper<Dic> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<Dic> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper
|
// lambdaQueryWrapper
|
||||||
.eq(Dic::getName,dicParam.getName())
|
// .eq(Dic::getName,dicParam.getName())
|
||||||
.eq(Dic::getStatus, DicState.ENABLE);
|
// .eq(Dic::getStatus, DicState.ENABLE);
|
||||||
//更新的时候,需排除当前记录
|
// //更新的时候,需排除当前记录
|
||||||
if (isExcludeSelf) {
|
// if (isExcludeSelf) {
|
||||||
if (dicParam instanceof DicParam.UpdateParam) {
|
// if (dicParam instanceof DicParam.UpdateParam) {
|
||||||
lambdaQueryWrapper.ne(Dic::getId, ((DicParam.UpdateParam) dicParam).getId());
|
// lambdaQueryWrapper.ne(Dic::getId, ((DicParam.UpdateParam) dicParam).getId());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
int countByAccount = this.count(lambdaQueryWrapper);
|
// int countByAccount = this.count(lambdaQueryWrapper);
|
||||||
//大于等于1个则表示重复
|
// //大于等于1个则表示重复
|
||||||
if (countByAccount >= 1) {
|
// if (countByAccount >= 1) {
|
||||||
throw new BusinessException(EventResponseEnum.NAME_REPEAT);
|
// throw new BusinessException(EventResponseEnum.NAME_REPEAT);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -108,6 +108,13 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
|||||||
return this.list(lambdaQueryWrapper);
|
return this.list(lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysDicTreePO> queryAllByType(Integer type) {
|
||||||
|
LambdaQueryWrapper<SysDicTreePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(SysDicTreePO::getStatus, 0).eq(SysDicTreePO::getType,type);
|
||||||
|
return this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysDicTreePO> queryTree() {
|
public List<SysDicTreePO> queryTree() {
|
||||||
LambdaQueryWrapper<SysDicTreePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysDicTreePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ public class PvTerminalTreeVO {
|
|||||||
@ApiModelProperty(name = "code",value = "单位编号")
|
@ApiModelProperty(name = "code",value = "单位编号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "level",value = "层级 1.全国 2.省级 3.市级 4.县级")
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(name = "children",value = "子级")
|
@ApiModelProperty(name = "children",value = "子级")
|
||||||
|
|||||||
@@ -166,7 +166,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="allDeptList" resultType="PvTerminalTreeVO">
|
<select id="allDeptList" resultType="PvTerminalTreeVO">
|
||||||
select id,name,pid,pids,code from sys_dept where state = 1 order by sort
|
select
|
||||||
|
id,name,pid,pids,code,
|
||||||
|
LENGTH( pids ) - LENGTH(REPLACE ( pids, ',', '' )) +1 as `level`
|
||||||
|
from sys_dept where state = 1 order by sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user