Commit f783e718 authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.系统管理模块,查询线路及组织机构树接口修改,增加查询逻辑,通过线路名称模糊查询树列表,完成接口冒烟测试并同步线上接口文档;
2.系统管理模块,查询光伏电站及组织机构树接口修改,增加查询逻辑,通过电站名称模糊查询树列表,完成接口冒烟测试并同步线上接口文档;
3.基础信息配置模块,新增市电峰谷导入模板下载接口,完成接口冒烟测试并同步线上接口文档;
4.基础信息配置模块,市电峰谷模板下载接口修改,增加多选月份导出配置数据逻辑,修改线上接口文档并完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 98eea9f1
......@@ -3,6 +3,7 @@ package pps.core.base.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
......@@ -24,6 +25,7 @@ import pps.core.base.service.data.base_price_strategy.GetBasePriceStrategyViewIn
import pps.core.base.service.data.base_wellhead.QueryBaseWellheadInput;
import pps.core.base.service.data.base_wellhead.QueryBaseWellheadOutput;
import pps.core.base.service.data.excel.ImportExcelInput;
import pps.core.base.service.data.excel.ImportPriceStrategyExcelInput;
import pps.core.base.utils.ServiceUtil;
import pps.core.common.constant.BusinessConstant;
import pps.core.common.entity.BaseModel;
......@@ -579,6 +581,22 @@ public class ExcelService {
});
}
/**
* 市电峰谷配置导入
*
* @param context 上下文
* @param input 输入
* @return {@link XServiceResult }
*/
@XText("市电峰谷配置导入")
@XApiUpload(anonymous = true)
public XServiceResult importPriceStrategy(XContext context, ImportPriceStrategyExcelInput input) {
List<ExcelPriceStrategyTemplate> list = this.getExcelDataAndCheck(input.getFile(), ExcelPriceStrategyTemplate.class,
null, null);
return XServiceResult.OK;
}
/*------------------------------------ private ------------------------------------*/
/**
......@@ -598,6 +616,7 @@ public class ExcelService {
this.checkExcelDataSize(dataList);
ValidationUtil.doValidate(dataList);
//检查某个名称字段是否重复
if (ObjectUtil.isNotNull(classifier) || CharSequenceUtil.isBlank(headerName)) {
List<String> duplicate = dataList.stream()
.collect(Collectors.groupingBy(classifier, Collectors.counting()))
.entrySet()
......@@ -609,6 +628,7 @@ public class ExcelService {
String join = CharSequenceUtil.join(",", duplicate);
throw new XServiceException("表格内[" + headerName + "]列, 名称为[" + join + "]重复");
}
}
return dataList;
}
......
package pps.core.base.service.data.excel;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import xstartup.annotation.XText;
import xstartup.data.XUploadFile;
/**
* Excel导入市电峰谷策略
*
* @author ZWT
* @date 2024/05/13
*/
@Data
public class ImportPriceStrategyExcelInput {
@NotBlank(message = "缺少市电峰谷策略ID")
@XText("市电峰谷策略ID")
private String strategyId;
@XText("excel文件")
private XUploadFile file;
}
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