Commit 4b246629 authored by tianchao's avatar tianchao

1.菜单保存

2.组织机构保存
3.线路保存
parent 1200c03f
...@@ -27,11 +27,6 @@ public class BaseLineAllView implements Serializable { ...@@ -27,11 +27,6 @@ public class BaseLineAllView implements Serializable {
@TableField @TableField
private BigDecimal elevation; private BigDecimal elevation;
@XText("组织id")
@TableField
private String ouId;
@XText("油田ouid") @XText("油田ouid")
private String oilOuId; private String oilOuId;
...@@ -84,13 +79,6 @@ public class BaseLineAllView implements Serializable { ...@@ -84,13 +79,6 @@ public class BaseLineAllView implements Serializable {
this.elevation = elevation; this.elevation = elevation;
} }
public String getOuId() {
return ouId;
}
public void setOuId(String ouId) {
this.ouId = ouId;
}
public String getOilOuId() { public String getOilOuId() {
return oilOuId; return oilOuId;
......
...@@ -24,11 +24,11 @@ public class BaseLineEnt implements Serializable { ...@@ -24,11 +24,11 @@ public class BaseLineEnt implements Serializable {
@XText("线路类型") @XText("线路类型")
@TableField @TableField
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
@TableField @TableField
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
@TableField @TableField
...@@ -44,7 +44,7 @@ public class BaseLineEnt implements Serializable { ...@@ -44,7 +44,7 @@ public class BaseLineEnt implements Serializable {
@XText("组织id") @XText("组织id")
@TableField @TableField
private String ouId; private String wellOuId;
@TableField @TableField
private String createById; private String createById;
...@@ -88,20 +88,20 @@ public class BaseLineEnt implements Serializable { ...@@ -88,20 +88,20 @@ public class BaseLineEnt implements Serializable {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
...@@ -128,12 +128,12 @@ public class BaseLineEnt implements Serializable { ...@@ -128,12 +128,12 @@ public class BaseLineEnt implements Serializable {
this.arrayToward = value; this.arrayToward = value;
} }
public String getOuId() { public String getWellOuId() {
return this.ouId; return wellOuId;
} }
public void setOuId(String value) { public void setWellOuId(String wellOuId) {
this.ouId = value; this.wellOuId = wellOuId;
} }
public String getCreateById() { public String getCreateById() {
......
...@@ -20,11 +20,11 @@ public class BaseLineView implements Serializable { ...@@ -20,11 +20,11 @@ public class BaseLineView implements Serializable {
@XText("线路类型") @XText("线路类型")
@TableField @TableField
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
@TableField @TableField
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
@TableField @TableField
...@@ -38,10 +38,6 @@ public class BaseLineView implements Serializable { ...@@ -38,10 +38,6 @@ public class BaseLineView implements Serializable {
@TableField @TableField
private BigDecimal arrayToward; private BigDecimal arrayToward;
@XText("组织id")
@TableField
private String ouId;
@TableField @TableField
private String createById; private String createById;
...@@ -95,20 +91,20 @@ public class BaseLineView implements Serializable { ...@@ -95,20 +91,20 @@ public class BaseLineView implements Serializable {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
...@@ -135,14 +131,6 @@ public class BaseLineView implements Serializable { ...@@ -135,14 +131,6 @@ public class BaseLineView implements Serializable {
this.arrayToward = value; this.arrayToward = value;
} }
public String getOuId() {
return this.ouId;
}
public void setOuId(String value) {
this.ouId = value;
}
public String getCreateById() { public String getCreateById() {
return this.createById; return this.createById;
} }
......
package pps.core.base.service; package pps.core.base.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import pps.cloud.system.service.SysOrganizationCloudService;
import pps.cloud.system.service.SystemDictionaryService; import pps.cloud.system.service.SystemDictionaryService;
import pps.cloud.system.service.data.QuerySysDictionaryViewInput; import pps.cloud.system.service.data.*;
import pps.cloud.system.service.data.QuerySysDictionaryViewOutput;
import pps.core.base.entity.BaseLineAllView; import pps.core.base.entity.BaseLineAllView;
import pps.core.base.entity.BaseLineEnt; import pps.core.base.entity.BaseLineEnt;
import pps.core.base.entity.BaseLineView; import pps.core.base.entity.BaseLineView;
...@@ -17,6 +18,7 @@ import xstartup.annotation.XService; ...@@ -17,6 +18,7 @@ import xstartup.annotation.XService;
import xstartup.base.XContext; import xstartup.base.XContext;
import xstartup.base.data.CustomQueryInput; import xstartup.base.data.CustomQueryInput;
import xstartup.base.util.XCopyUtils; import xstartup.base.util.XCopyUtils;
import xstartup.base.util.XStringUtils;
import xstartup.data.XListResult; import xstartup.data.XListResult;
import xstartup.data.XPageResult; import xstartup.data.XPageResult;
import xstartup.data.XServiceResult; import xstartup.data.XServiceResult;
...@@ -27,7 +29,9 @@ import xstartup.feature.api.annotation.XApiPost; ...@@ -27,7 +29,9 @@ import xstartup.feature.api.annotation.XApiPost;
import xstartup.feature.api.annotation.XApiPost; import xstartup.feature.api.annotation.XApiPost;
import xstartup.feature.mybatis.helper.XMapperHelper; import xstartup.feature.mybatis.helper.XMapperHelper;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@XService @XService
public class BaseLineService { public class BaseLineService {
...@@ -87,17 +91,62 @@ public class BaseLineService { ...@@ -87,17 +91,62 @@ public class BaseLineService {
@XApiAnonymous @XApiAnonymous
@XApiPost @XApiPost
public XListResult<QueryBaseLineOutput> queryBaseLineList(XContext context, QueryBaseLineListInput input){ public XPageResult<QueryBaseLineOutput> queryBaseLineList(XContext context, QueryBaseLineListInput input){
PageHelper.startPage(input.getPage(), input.getLimit());
//获取组织机构下的子集
SysOrganizationCloudService cloudService = context.getBean(SysOrganizationCloudService.class);
GetAllOuListByOuIdInput ouIdInput = new GetAllOuListByOuIdInput();
if(XStringUtils.isNotEmpty(input.getOuId()))
ouIdInput.setOuId(input.getOuId());
else
ouIdInput.setOuId("00000000-0000-0000-0000-000000000000");
XListResult<GetOuListTreeOutput> outputXListResult = cloudService.getAllOuListByOuId(context , ouIdInput);
outputXListResult.throwIfFail();
List<GetOuListTreeOutput> ouList = outputXListResult.getResult();
List<String> ouIdList = new ArrayList<>();
if(CollectionUtils.isEmpty(ouList)){
ouIdList.add(input.getOuId());
}else {
ouIdList = ouList.stream().map(GetOuListTreeOutput::getOuId).collect(Collectors.toList());
}
BaseLineMapper mapper = context.getBean(BaseLineMapper.class); BaseLineMapper mapper = context.getBean(BaseLineMapper.class);
List<BaseLineEnt> list = mapper.selectList(new QueryWrapper<>()); QueryWrapper<BaseLineEnt> queryWrapper = new QueryWrapper<>();
List<QueryBaseLineOutput> outputs = XCopyUtils.copyNewList(list, QueryBaseLineOutput.class); queryWrapper.lambda().in(BaseLineEnt::getWellOuId , ouIdList);
List<BaseLineEnt> list = mapper.selectList(queryWrapper);
PageInfo<BaseLineEnt> pageInfo = new PageInfo<>(list);
List<QueryBaseLineOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QueryBaseLineOutput.class);
//获取线路、电网字典
List<QuerySysDictionaryViewOutput> gridTypeList = getDictList(context , "grid_type"); List<QuerySysDictionaryViewOutput> gridTypeList = getDictList(context , "grid_type");
List<QuerySysDictionaryViewOutput> lineTypeList = getDictList(context , "line_type"); List<QuerySysDictionaryViewOutput> lineTypeList = getDictList(context , "line_type");
outputs.stream().forEach(item->{ //获取上级线路
item.setGridTypeName(getDictName(item.getGridType() + "", gridTypeList)); List<Integer> parenIds = list.stream().filter(item->item.getParentId() != null).map(BaseLineEnt::getParentId).collect(Collectors.toList());
item.setLineTypeName(getDictName(item.getGridType() + "", lineTypeList)); List<BaseLineEnt> parentList = new ArrayList<>();
}); if(!CollectionUtils.isEmpty(parenIds)){
return XListResult.success(outputs); queryWrapper.clear();
queryWrapper.lambda().in(BaseLineEnt::getId , parenIds);
parentList = mapper.selectList(queryWrapper);
}
for(QueryBaseLineOutput item : outputs){
item.setGridTypeName(getDictName(item.getGridType(), gridTypeList));
item.setLineTypeName(getDictName(item.getLineType(), lineTypeList));
GetOuListTreeOutput treeOutput = ouList.stream().filter(tree->tree.getOuId().equals(item.getWellOuId())).findFirst().orElse(null);
if(null != treeOutput){
//设置井场
item.setWellOuName(treeOutput.getOuName());
//根据井场,设置油田
GetOuListTreeOutput oilTreeOutput = ouList.stream().filter(tree->tree.getOuId().equals(treeOutput.getParentOuId())).findFirst().orElse(null);
if(null != oilTreeOutput){
item.setOilOuName(oilTreeOutput.getOuName());
}
}
if(item.getParentId() != null){
//设置父级线路
BaseLineEnt parent = parentList.stream().filter(p->p.getId() == item.getParentId()).findFirst().orElse(null);
if(parent != null)
item.setPLineName(parent.getLineName());
}
}
return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
@XApiAnonymous @XApiAnonymous
......
...@@ -13,10 +13,10 @@ public class CreateBaseLineInput { ...@@ -13,10 +13,10 @@ public class CreateBaseLineInput {
private String lineName; private String lineName;
@XText("线路类型") @XText("线路类型")
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
private BigDecimal installCapacity; private BigDecimal installCapacity;
...@@ -28,7 +28,7 @@ public class CreateBaseLineInput { ...@@ -28,7 +28,7 @@ public class CreateBaseLineInput {
private BigDecimal arrayToward; private BigDecimal arrayToward;
@XText("组织id") @XText("组织id")
private String ouId; private String wellOuId;
private String createById; private String createById;
...@@ -59,20 +59,20 @@ public class CreateBaseLineInput { ...@@ -59,20 +59,20 @@ public class CreateBaseLineInput {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
...@@ -99,12 +99,12 @@ public class CreateBaseLineInput { ...@@ -99,12 +99,12 @@ public class CreateBaseLineInput {
this.arrayToward = value; this.arrayToward = value;
} }
public String getOuId() { public String getWellOuId() {
return this.ouId; return wellOuId;
} }
public void setOuId(String value) { public void setWellOuId(String wellOuId) {
this.ouId = value; this.wellOuId = wellOuId;
} }
public String getCreateById() { public String getCreateById() {
......
...@@ -14,10 +14,10 @@ public class CreateBaseLineOutput { ...@@ -14,10 +14,10 @@ public class CreateBaseLineOutput {
private String lineName; private String lineName;
@XText("线路类型") @XText("线路类型")
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
private BigDecimal installCapacity; private BigDecimal installCapacity;
...@@ -67,20 +67,20 @@ public class CreateBaseLineOutput { ...@@ -67,20 +67,20 @@ public class CreateBaseLineOutput {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
......
...@@ -14,10 +14,10 @@ public class DeleteBaseLineOutput { ...@@ -14,10 +14,10 @@ public class DeleteBaseLineOutput {
private String lineName; private String lineName;
@XText("线路类型") @XText("线路类型")
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
private BigDecimal installCapacity; private BigDecimal installCapacity;
...@@ -67,20 +67,20 @@ public class DeleteBaseLineOutput { ...@@ -67,20 +67,20 @@ public class DeleteBaseLineOutput {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
......
...@@ -14,10 +14,10 @@ public class GetBaseLineOutput { ...@@ -14,10 +14,10 @@ public class GetBaseLineOutput {
private String lineName; private String lineName;
@XText("线路类型") @XText("线路类型")
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
private BigDecimal installCapacity; private BigDecimal installCapacity;
...@@ -29,7 +29,7 @@ public class GetBaseLineOutput { ...@@ -29,7 +29,7 @@ public class GetBaseLineOutput {
private BigDecimal arrayToward; private BigDecimal arrayToward;
@XText("组织id") @XText("组织id")
private String ouId; private String wellOuId;
private String createById; private String createById;
...@@ -67,20 +67,20 @@ public class GetBaseLineOutput { ...@@ -67,20 +67,20 @@ public class GetBaseLineOutput {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
...@@ -107,12 +107,12 @@ public class GetBaseLineOutput { ...@@ -107,12 +107,12 @@ public class GetBaseLineOutput {
this.arrayToward = value; this.arrayToward = value;
} }
public String getOuId() { public String getWellOuId() {
return this.ouId; return wellOuId;
} }
public void setOuId(String value) { public void setWellOuId(String wellOuId) {
this.ouId = value; this.wellOuId = wellOuId;
} }
public String getCreateById() { public String getCreateById() {
......
...@@ -28,11 +28,6 @@ public class QueryBaseLineAllOutput extends XPageInput { ...@@ -28,11 +28,6 @@ public class QueryBaseLineAllOutput extends XPageInput {
private BigDecimal elevation; private BigDecimal elevation;
@XText("组织id")
private String ouId;
@XText("油田ouid") @XText("油田ouid")
private String oilOuId; private String oilOuId;
...@@ -85,14 +80,6 @@ public class QueryBaseLineAllOutput extends XPageInput { ...@@ -85,14 +80,6 @@ public class QueryBaseLineAllOutput extends XPageInput {
this.elevation = elevation; this.elevation = elevation;
} }
public String getOuId() {
return ouId;
}
public void setOuId(String ouId) {
this.ouId = ouId;
}
public String getOilOuId() { public String getOilOuId() {
return oilOuId; return oilOuId;
} }
......
...@@ -3,7 +3,7 @@ package pps.core.base.service.data.base_line; ...@@ -3,7 +3,7 @@ package pps.core.base.service.data.base_line;
import xstartup.annotation.XText; import xstartup.annotation.XText;
import xstartup.base.data.XPageInput; import xstartup.base.data.XPageInput;
public class QueryBaseLineListInput { public class QueryBaseLineListInput extends XPageInput {
@XText("组织id") @XText("组织id")
private String ouId; private String ouId;
......
...@@ -19,13 +19,13 @@ public class QueryBaseLineOutput extends XPageInput { ...@@ -19,13 +19,13 @@ public class QueryBaseLineOutput extends XPageInput {
private String lineName; private String lineName;
@XText("线路类型") @XText("线路类型")
private Integer lineType; private String lineType;
@XText("线路类型") @XText("线路类型")
private String lineTypeName; private String lineTypeName;
@XText("电网类型") @XText("电网类型")
private Integer gridType; private String gridType;
@XText("电网类型") @XText("电网类型")
private String gridTypeName; private String gridTypeName;
...@@ -42,9 +42,6 @@ public class QueryBaseLineOutput extends XPageInput { ...@@ -42,9 +42,6 @@ public class QueryBaseLineOutput extends XPageInput {
private BigDecimal arrayToward; private BigDecimal arrayToward;
@XText("组织id")
private String ouId;
@XText("油田ouid") @XText("油田ouid")
private String oilOuId; private String oilOuId;
...@@ -102,19 +99,19 @@ public class QueryBaseLineOutput extends XPageInput { ...@@ -102,19 +99,19 @@ public class QueryBaseLineOutput extends XPageInput {
this.lineName = lineName; this.lineName = lineName;
} }
public Integer getLineType() { public String getLineType() {
return lineType; return lineType;
} }
public void setLineType(Integer lineType) { public void setLineType(String lineType) {
this.lineType = lineType; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return gridType; return gridType;
} }
public void setGridType(Integer gridType) { public void setGridType(String gridType) {
this.gridType = gridType; this.gridType = gridType;
} }
...@@ -142,13 +139,6 @@ public class QueryBaseLineOutput extends XPageInput { ...@@ -142,13 +139,6 @@ public class QueryBaseLineOutput extends XPageInput {
this.arrayToward = arrayToward; this.arrayToward = arrayToward;
} }
public String getOuId() {
return ouId;
}
public void setOuId(String ouId) {
this.ouId = ouId;
}
public String getOilOuId() { public String getOilOuId() {
return oilOuId; return oilOuId;
......
...@@ -14,10 +14,10 @@ public class UpdateBaseLineInput { ...@@ -14,10 +14,10 @@ public class UpdateBaseLineInput {
private String lineName; private String lineName;
@XText("线路类型") @XText("线路类型")
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
private BigDecimal installCapacity; private BigDecimal installCapacity;
...@@ -29,7 +29,7 @@ public class UpdateBaseLineInput { ...@@ -29,7 +29,7 @@ public class UpdateBaseLineInput {
private BigDecimal arrayToward; private BigDecimal arrayToward;
@XText("组织id") @XText("组织id")
private String ouId; private String wellOuId;
private String createById; private String createById;
...@@ -67,20 +67,20 @@ public class UpdateBaseLineInput { ...@@ -67,20 +67,20 @@ public class UpdateBaseLineInput {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
...@@ -107,12 +107,12 @@ public class UpdateBaseLineInput { ...@@ -107,12 +107,12 @@ public class UpdateBaseLineInput {
this.arrayToward = value; this.arrayToward = value;
} }
public String getOuId() { public String getWellOuId() {
return this.ouId; return wellOuId;
} }
public void setOuId(String value) { public void setWellOuId(String wellOuId) {
this.ouId = value; this.wellOuId = wellOuId;
} }
public String getCreateById() { public String getCreateById() {
......
...@@ -14,10 +14,10 @@ public class UpdateBaseLineOutput { ...@@ -14,10 +14,10 @@ public class UpdateBaseLineOutput {
private String lineName; private String lineName;
@XText("线路类型") @XText("线路类型")
private Integer lineType; private String lineType;
@XText("电网类型") @XText("电网类型")
private Integer gridType; private String gridType;
@XText("装机容量") @XText("装机容量")
private BigDecimal installCapacity; private BigDecimal installCapacity;
...@@ -67,20 +67,20 @@ public class UpdateBaseLineOutput { ...@@ -67,20 +67,20 @@ public class UpdateBaseLineOutput {
this.lineName = value; this.lineName = value;
} }
public Integer getLineType() { public String getLineType() {
return this.lineType; return lineType;
} }
public void setLineType(Integer value) { public void setLineType(String lineType) {
this.lineType = value; this.lineType = lineType;
} }
public Integer getGridType() { public String getGridType() {
return this.gridType; return gridType;
} }
public void setGridType(Integer value) { public void setGridType(String gridType) {
this.gridType = value; this.gridType = gridType;
} }
public BigDecimal getInstallCapacity() { public BigDecimal getInstallCapacity() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment