Commit 78feec66 authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.添加easy excel配置,增加转换器,增加全局excel导出样式,增加场站下拉选解析器;
2.开发光伏电站模板导出接口,增加模板导出类,并完成接口冒烟测试及接口文档;
3.间开制度管理模块新增设为基础制度开关接口,添加线上接口文档并完成接口冒烟测试;
4.开发井口配置模板导出接口,增加模板导出类,并完成接口冒烟测试及接口文档;
5.开发第三方有功功率历史数据导入接口,增加模板配置类,添加线上接口文档并完成接口冒烟测试;
6.开发给长庆使用的获取第三方认证token接口,验证获取token后是否能正常跳转指定页面,创建长庆用演示用户及角色;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent e4ce941a
package pps.cloud.system.service;
import pps.cloud.system.service.data.sys_dictionary.CreateSysDictionaryInput;
import pps.cloud.system.service.data.sys_dictionary.QuerySysDictionaryViewInput;
import pps.cloud.system.service.data.sys_dictionary.QuerySysDictionaryViewOutput;
import pps.cloud.system.service.data.sys_dictionary.*;
import xstartup.annotation.XService;
import xstartup.annotation.XText;
import xstartup.base.XContext;
......@@ -15,7 +13,16 @@ public interface SystemDictionaryService {
@XText("根据alias获取字典")
XListResult<QuerySysDictionaryViewOutput> querySysDictionarysByAlias(XContext context, CreateSysDictionaryInput input);
@XText("根据父级alias获取子级字典列表")
XListResult<QuerySysDictionaryViewOutput> queryChildSysDictionarysByParentAlias(XContext context, QuerySysDictionaryViewInput input);
/**
* 条件查询字典列表
*
* @param context 上下文
* @param input 输入
* @return {@link XListResult}<{@link GetSysDictionaryViewOutput}>
*/
@XText("条件查询字典列表")
XListResult<GetSysDictionaryViewOutput> querySysDictionaryByParam(XContext context, GetSysDictionaryViewInput input);
}
package pps.cloud.system.service.data.sys_dictionary;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import xstartup.annotation.XText;
/**
* 获取sys字典视图输入
*
* @author ZWT
* @date 2024/05/09
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class GetSysDictionaryViewInput {
@XText("父级ID")
private String pid;
@XText("父级编码")
private String alias;
}
package pps.cloud.system.service.data.sys_dictionary;
import lombok.Data;
import xstartup.annotation.XText;
@Data
public class GetSysDictionaryViewOutput {
@XText("父级ID")
private String pid;
@XText("名称")
private String dicName;
@XText("缩写")
private String shortName;
@XText("备注")
private String remark;
@XText("排序")
private Integer sort;
@XText("层级")
private Integer levels;
@XText("是否默认值")
private Integer beDefault;
@XText("是否含有下级")
private Integer beHasChildren;
@XText("0为系统字典,1应用字典")
private Integer dicType;
}
package pps.core.system.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import xstartup.annotation.XText;
import java.io.Serializable;
import java.util.Date;
/**
* 字典视图
*
* @author ZWT
* @date 2024/05/09
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SysDictionaryView implements Serializable {
@XText("主键")
@TableField
......
......@@ -36,4 +36,12 @@ public interface SysDictionaryViewMapper {
Integer selectListByConditionByCount(SysDictionaryView recordView);
List<SysDictionaryView> selectTreeList(SysDictionaryView record);
/**
* 条件查询字典列表
*
* @param record 记录
* @return {@link List}<{@link SysDictionaryView}>
*/
List<SysDictionaryView> selectListByParam(SysDictionaryView record);
}
......@@ -4,15 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import pps.cloud.system.service.SystemDictionaryService;
import pps.cloud.system.service.data.sys_dictionary.CreateSysDictionaryInput;
import pps.cloud.system.service.data.sys_dictionary.QuerySysDictionaryViewInput;
import pps.cloud.system.service.data.sys_dictionary.QuerySysDictionaryViewOutput;
import pps.cloud.system.service.data.sys_dictionary.*;
import pps.core.common.pattern.Builder;
import pps.core.system.cache.SysDictionaryCache;
import pps.core.system.entity.SysDictionaryEnt;
import pps.core.system.entity.SysDictionaryView;
import pps.core.system.entity.SysOrganizationDictionaryEnt;
import pps.core.system.entity.SysOrganizationRelEnt;
import pps.core.system.mapper.SysDictionaryMapper;
import pps.core.system.mapper.SysDictionaryViewMapper;
import pps.core.system.mapper.SysOrganizationDictionaryMapper;
import pps.core.system.mapper.SysOrganizationRelMapper;
import xstartup.annotation.XService;
......@@ -155,4 +155,14 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
resultList = XCopyUtils.copyNewList(list, QuerySysDictionaryViewOutput.class);
return XListResult.success(resultList);
}
@Override
public XListResult<GetSysDictionaryViewOutput> querySysDictionaryByParam(XContext context, GetSysDictionaryViewInput input) {
SysDictionaryViewMapper mapper = context.getBean(SysDictionaryViewMapper.class);
List<SysDictionaryView> list = mapper.selectListByParam(SysDictionaryView.builder()
.pid(input.getPid())
.alias(input.getAlias())
.build());
return XListResult.success(XCopyUtils.copyNewList(list, GetSysDictionaryViewOutput.class));
}
}
\ No newline at end of file
......@@ -282,4 +282,26 @@
)
select temps.* from temps;
</select>
<select id="selectListByParam" resultMap="BaseResultMap" parameterType="pps.core.system.entity.SysDictionaryView">
SELECT
*
FROM
sys_dictionary
<where>
<if test="pid != null and pid != ''">
and pid = #{pid}
</if>
<if test="alias != null and alias != ''">
and pid = (SELECT
id
FROM
sys_dictionary
WHERE
alias = #{alias})
</if>
</where>
ORDER BY
sort
</select>
</mapper>
......@@ -2,8 +2,10 @@ package pps.core.base.excel;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.CharSequenceUtil;
import pps.cloud.system.service.SysOrganizationCloudService;
import pps.cloud.system.service.data.sys_organization.GetSysOrganizationViewOutput;
import pps.cloud.system.service.SystemDictionaryService;
import pps.cloud.system.service.data.sys_dictionary.GetSysDictionaryViewInput;
import pps.cloud.system.service.data.sys_dictionary.GetSysDictionaryViewOutput;
import pps.core.common.constant.BusinessConstant;
import pps.core.common.excel.ExcelDynamicSelect;
import xstartup.base.XSelfServiceContext;
import xstartup.data.XListResult;
......@@ -21,14 +23,16 @@ public class RunTypeImpl implements ExcelDynamicSelect {
@Override
public String[] getSource() {
XSelfServiceContext build = XSelfServiceContext.build(SysOrganizationCloudService.class);
SysOrganizationCloudService bean = build.getBean(SysOrganizationCloudService.class);
XListResult<GetSysOrganizationViewOutput> result = bean.getPlantList(build);
XSelfServiceContext build = XSelfServiceContext.build(SystemDictionaryService.class);
SystemDictionaryService bean = build.getBean(SystemDictionaryService.class);
XListResult<GetSysDictionaryViewOutput> result = bean.querySysDictionaryByParam(build, GetSysDictionaryViewInput.builder()
.alias(BusinessConstant.RUN_TYPE)
.build());
result.throwIfFail();
List<GetSysOrganizationViewOutput> list = result.getResult();
List<GetSysDictionaryViewOutput> list = result.getResult();
if (CollUtil.isNotEmpty(list)) {
return CharSequenceUtil.splitToArray(list.stream()
.map(GetSysOrganizationViewOutput::getOuName)
.map(GetSysDictionaryViewOutput::getDicName)
.collect(Collectors.joining(",")), ",");
}
return new String[0];
......
......@@ -10,6 +10,7 @@ import pps.cloud.system.service.SystemAreaService;
import pps.cloud.system.service.data.sys_area.QuerySysAreaInput;
import pps.cloud.system.service.data.sys_area.QuerySysAreaOutput;
import pps.core.base.service.data.base_excel.ExcelPhotovoltaicPlantTemplate;
import pps.core.base.service.data.base_excel.ExcelWellheadTemplate;
import pps.core.base.utils.EasyExcelUtil;
import pps.core.common.excel.CascadeWriteHandler;
import pps.core.common.excel.ExcelStyleTool;
......@@ -80,4 +81,27 @@ public class ExcelService {
excelWriter.finish();
return XFileResult.success(XFileType.APPLICATION_XLSX, fileSavePath);
}
/**
* 井口配置模板导出
*
* @param context 上下文
* @return {@link XFileResult}
*/
@XText("井口配置模板导出")
@XApiGet
public XFileResult templateWellhead(XContext context) {
String fileSavePath = XStorageTool.getAbsolutePath("/temp/excel/井口配置模板.xlsx");
File file = FileUtil.touch(fileSavePath);
//生成模板
ExcelWriter excelWriter = EasyExcelFactory.write(file)
.registerWriteHandler(ExcelStyleTool.getStyleStrategy())
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.autoCloseStream(Boolean.TRUE)
.build();
WriteSheet writeSheet = EasyExcelUtil.writeSelectedSheet(ExcelWellheadTemplate.class, 0, "井口配置");
excelWriter.write(new ArrayList<String>(), writeSheet);
excelWriter.finish();
return XFileResult.success(XFileType.APPLICATION_XLSX, fileSavePath);
}
}
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