pms国网上送代码提交
This commit is contained in:
@@ -231,10 +231,7 @@ public class Monitor extends BaseEntity {
|
|||||||
* 0.未上送 1.已上送 2.取消上送 3.待重新上送
|
* 0.未上送 1.已上送 2.取消上送 3.待重新上送
|
||||||
*/
|
*/
|
||||||
private Integer isUploadHead;
|
private Integer isUploadHead;
|
||||||
/**
|
|
||||||
* 行业分类
|
|
||||||
*/
|
|
||||||
private String tradeCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 牵引站id
|
* 牵引站id
|
||||||
|
|||||||
@@ -121,7 +121,24 @@ 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("/queryAll")
|
||||||
|
@ApiOperation("查询所有树形字典")
|
||||||
|
public HttpResult<List<SysDicTreePO>> queryAll() {
|
||||||
|
String methodDescribe = getMethodDescribe("queryAll");
|
||||||
|
List<SysDicTreePO> result = sysDicTreePOService.queryAll();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@GetMapping("/queryTree")
|
||||||
|
@ApiOperation("树形字典树结构展示")
|
||||||
|
public HttpResult<List<SysDicTreePO>> queryTree() {
|
||||||
|
String methodDescribe = getMethodDescribe("queryTree");
|
||||||
|
List<SysDicTreePO> result = sysDicTreePOService.queryTree();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import com.njcn.system.pojo.vo.DictTreeVO;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/6/9 14:00【需求编号】
|
* Date: 2023/6/9 14:00【需求编号】
|
||||||
*
|
*
|
||||||
@@ -32,4 +32,13 @@ public interface SysDicTreePOService extends IService<SysDicTreePO>{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SysDicTreePO queryById(String id);
|
SysDicTreePO queryById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有树形字典
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/12/18
|
||||||
|
*/
|
||||||
|
List<SysDicTreePO> queryAll();
|
||||||
|
|
||||||
|
List<SysDicTreePO> queryTree();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.system.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.system.pojo.param.DictTreeParam;
|
import com.njcn.system.pojo.param.DictTreeParam;
|
||||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -18,7 +19,7 @@ import com.njcn.system.service.SysDicTreePOService;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/6/9 14:00【需求编号】
|
* Date: 2023/6/9 14:00【需求编号】
|
||||||
*
|
*
|
||||||
@@ -45,7 +46,7 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
|||||||
}else{
|
}else{
|
||||||
sysDicTreePO.setPids("0");
|
sysDicTreePO.setPids("0");
|
||||||
}
|
}
|
||||||
sysDicTreePO.setStatus("0");
|
sysDicTreePO.setStatus(0);
|
||||||
boolean save = this.save(sysDicTreePO);
|
boolean save = this.save(sysDicTreePO);
|
||||||
|
|
||||||
return save;
|
return save;
|
||||||
@@ -100,4 +101,25 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
|||||||
return this.lambdaQuery().eq(SysDicTreePO::getId,id).eq(SysDicTreePO::getStatus,0).one();
|
return this.lambdaQuery().eq(SysDicTreePO::getId,id).eq(SysDicTreePO::getStatus,0).one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysDicTreePO> queryAll() {
|
||||||
|
LambdaQueryWrapper<SysDicTreePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(SysDicTreePO::getStatus, 0);
|
||||||
|
return this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysDicTreePO> queryTree() {
|
||||||
|
LambdaQueryWrapper<SysDicTreePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(SysDicTreePO::getStatus, 0);
|
||||||
|
List<SysDicTreePO> sysDicTreePOList = this.list(lambdaQueryWrapper);
|
||||||
|
List<SysDicTreePO> parent = sysDicTreePOList.stream().filter(item->item.getPid().equals("0") && !item.getCode().equals("Device_Unit")).peek(item->item.setChildren(getChildren(item,sysDicTreePOList))).collect(Collectors.toList());
|
||||||
|
return parent.stream().peek(item->item.setChildren(getChildren(item,sysDicTreePOList))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private List<SysDicTreePO> getChildren(SysDicTreePO sysDicTreePO,List<SysDicTreePO> all){
|
||||||
|
return all.stream().filter(item->item.getPid().equals(sysDicTreePO.getId())).peek(item->item.setChildren(getChildren(item,all))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user