Commit d0f4db97 authored by ZWT's avatar ZWT

得到的

parent 8d95f85a
...@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import pps.core.base.entity.BaseDataEnt; import pps.core.base.entity.BaseDataEnt;
import pps.core.base.entity.BaseDataImportLogEnt; import pps.core.base.entity.BaseDataImportLogEnt;
import pps.core.base.entity.BaseModelValEnt; import pps.core.base.entity.BaseModelValEnt;
import pps.core.base.enums.ImportFieldDic;
import pps.core.base.mapper.BaseDataImportLogMapper; import pps.core.base.mapper.BaseDataImportLogMapper;
import pps.core.base.mapper.BaseDataMapper; import pps.core.base.mapper.BaseDataMapper;
import pps.core.base.mapper.BaseModelValMapper; import pps.core.base.mapper.BaseModelValMapper;
...@@ -34,7 +33,6 @@ import xstartup.feature.mybatis.helper.XMapperHelper; ...@@ -34,7 +33,6 @@ import xstartup.feature.mybatis.helper.XMapperHelper;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@XService @XService
public class BaseDataService { public class BaseDataService {
...@@ -192,83 +190,6 @@ public class BaseDataService { ...@@ -192,83 +190,6 @@ public class BaseDataService {
return XMapperHelper.query(mapper, input, BaseDataEnt.class, QueryBaseDataOutput.class); return XMapperHelper.query(mapper, input, BaseDataEnt.class, QueryBaseDataOutput.class);
} }
// @XText("下载导入模板")
// @XApiGet
// public XFileResult downloadImportTemplate(XContext context) {
// String fileSavePath = XStorageTool.getAbsolutePath("/temp/excel/导入模板_" + DateUtil.formatDate(new Date()) + ".xlsx");
// String templateFilePath = "template/import_template.xlsx";
// InputStream templateInputStream = this.getClass().getClassLoader().getResourceAsStream(templateFilePath);
// byte[] excelContent = ExportExcelUtils.genSingleExcelFileData(templateInputStream, null);
// try {
// ExportExcelUtils.outputFileData(excelContent, fileSavePath);
// } catch (Exception e) {
// context.getLogger().error(e);
// }
// return XFileResult.success(XFileType.APPLICATION_XLSX, fileSavePath);
// }
//
// @XText("新增导入")
// @XApiUpload
// public XServiceResult importFile(XContext context, ImportFileInput input) {
// List<String> headerList = getExcelHeaderList();
// List<Map<String, Object>> mapList = ExcelUtils.readExcel(input.getFile().getInputStream(), input.getFile().getFileName(), headerList, 0);
// try {
// List<BaseDataView> dataList = new ArrayList<>(mapList.size());
// Date minDate = null;
// Date maxDate = null;
// for (Map<String, Object> objectMap : mapList) {
// BaseDataView dataView = BeanUtil.toBean(objectMap, BaseDataView.class);
// dataView.setOuId(input.getWellOuId());
// dataView.setLineId(input.getLineId());
// if (ObjectUtil.isNotNull(dataView.getDataDate())) {
// if (ObjectUtil.isNull(minDate)) {
// minDate = dataView.getDataDate();
// maxDate = dataView.getDataDate();
// }
// if (DateUtil.compare(minDate, dataView.getDataDate()) > 0) {
// minDate = dataView.getDataDate();
// } else if (DateUtil.compare(maxDate, dataView.getDataDate()) < 0) {
// maxDate = dataView.getDataDate();
// }
// }
// dataList.add(dataView);
// }
// if (ObjectUtil.isNull(minDate)) {
// return XServiceResult.error(1000, "日期错误");
// }
// BaseDataMapper mapper = context.getBean(BaseDataMapper.class);
// mapper.delete(new LambdaQueryWrapper<BaseDataEnt>()
// .eq(BaseDataEnt::getLineId, input.getLineId())
// .ge(BaseDataEnt::getDataDate, minDate)
// .le(BaseDataEnt::getDataDate, maxDate));
// BaseDataViewMapper viewMapper = context.getBean(BaseDataViewMapper.class);
// viewMapper.batchInsert(dataList);
// BaseDataImportLogMapper logMapper = context.getBean(BaseDataImportLogMapper.class);
// BaseDataImportLogEnt ent = new BaseDataImportLogEnt();
// ent.setOuId(input.getWellOuId());
// ent.setLineId(input.getLineId());
// ent.setBeginDate(minDate);
// ent.setEndDate(maxDate);
// ent.setCreateTime(new Date());
// logMapper.insert(ent);
// } catch (Exception e) {
// return XServiceResult.error(-1, e.getMessage());
// }
// return XServiceResult.OK;
// }
private List<String> getExcelHeaderList() {
List<Map<String, Object>> fieldList = new ArrayList<>();
for (ImportFieldDic value : ImportFieldDic.values()) {
Map<String, Object> map = new HashMap<>();
map.put("col", value.getCol());
map.put("sort", value.getSort());
fieldList.add(map);
}
fieldList.sort(Comparator.comparing(o -> ((Integer) o.get("sort"))));
return fieldList.stream().map(x -> ((String) x.get("col"))).collect(Collectors.toList());
}
@XText("获取预算") @XText("获取预算")
@XApiGet @XApiGet
public XServiceResult calcBaseData(XContext context, CalcBaseDataInput calcBaseDataInput) { public XServiceResult calcBaseData(XContext context, CalcBaseDataInput calcBaseDataInput) {
......
...@@ -239,10 +239,10 @@ public class BasePowerLineCloudServiceImpl implements IBasePowerLineCloudService ...@@ -239,10 +239,10 @@ public class BasePowerLineCloudServiceImpl implements IBasePowerLineCloudService
BaseWellheadMapper mapper = context.getBean(BaseWellheadMapper.class); BaseWellheadMapper mapper = context.getBean(BaseWellheadMapper.class);
BaseWellheadEnt baseWellheadEnt = mapper.selectOne( BaseWellheadEnt baseWellheadEnt = mapper.selectOne(
new QueryWrapper<BaseWellheadEnt>() new QueryWrapper<BaseWellheadEnt>()
.select("IFNULL( SUM( service_rating ), 0 ) AS service_rating") .select("IFNULL( SUM( SERVICE_RATING ), 0 ) AS SERVICE_RATING")
.lambda() .lambda()
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE) .eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.apply("id IN ( SELECT wellhead_id FROM base_power_line_wellhead WHERE line_id = {0} AND is_deleted = 1 )", input.getLineId()) .apply("ID IN ( SELECT WELLHEAD_ID FROM BASE_POWER_LINE_WELLHEAD WHERE LINE_ID = {0} AND IS_DELETED = 1 )", input.getLineId())
); );
return XSingleResult.success(GetBasePowerLineWellheadViewOutput.builder() return XSingleResult.success(GetBasePowerLineWellheadViewOutput.builder()
.serviceRating(Optional.ofNullable(baseWellheadEnt) .serviceRating(Optional.ofNullable(baseWellheadEnt)
......
...@@ -196,7 +196,7 @@ public class BasePriceStrategyService { ...@@ -196,7 +196,7 @@ public class BasePriceStrategyService {
.select(BasePriceStrategyMonthEnt::getId, BasePriceStrategyMonthEnt::getStrategyMonth) .select(BasePriceStrategyMonthEnt::getId, BasePriceStrategyMonthEnt::getStrategyMonth)
.eq(BasePriceStrategyMonthEnt::getStrategyId, strategyId) .eq(BasePriceStrategyMonthEnt::getStrategyId, strategyId)
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE) .eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.last(" ORDER BY strategy_month + 0 ") .last(" ORDER BY STRATEGY_MONTH + 0 ")
); );
if (CollUtil.isNotEmpty(monthEntList)) { if (CollUtil.isNotEmpty(monthEntList)) {
List<GetBasePriceStrategyMonthOutput> months = XCopyUtils.copyNewList(monthEntList, GetBasePriceStrategyMonthOutput.class); List<GetBasePriceStrategyMonthOutput> months = XCopyUtils.copyNewList(monthEntList, GetBasePriceStrategyMonthOutput.class);
......
...@@ -195,8 +195,8 @@ public class WindPredictionFutureService { ...@@ -195,8 +195,8 @@ public class WindPredictionFutureService {
//实际发电量 //实际发电量
ThirdWindPowerGenerationMapper generationMapper = context.getBean(ThirdWindPowerGenerationMapper.class); ThirdWindPowerGenerationMapper generationMapper = context.getBean(ThirdWindPowerGenerationMapper.class);
List<ThirdWindPowerGenerationEnt> generationList = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationEnt>() List<ThirdWindPowerGenerationEnt> generationList = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationEnt>()
.select("IFNULL( SUM( actual_power ), 0 ) AS actual_power", "collect_time") .select("IFNULL( SUM( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER", "COLLECT_TIME")
.groupBy("collect_time") .groupBy("COLLECT_TIME")
.lambda() .lambda()
.in(ThirdWindPowerGenerationEnt::getStationId, stationIds) .in(ThirdWindPowerGenerationEnt::getStationId, stationIds)
.eq(ThirdWindPowerGenerationEnt::getSystemSource, ServiceUtil.getOilFieldCode(context)) .eq(ThirdWindPowerGenerationEnt::getSystemSource, ServiceUtil.getOilFieldCode(context))
...@@ -278,8 +278,8 @@ public class WindPredictionFutureService { ...@@ -278,8 +278,8 @@ public class WindPredictionFutureService {
beginTime = DateUtil.beginOfMonth(now); beginTime = DateUtil.beginOfMonth(now);
endTime = DateUtil.endOfMonth(now); endTime = DateUtil.endOfMonth(now);
map = mapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>() map = mapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>()
.select("DAY( collect_time ) AS actual_wind_direction", "IFNULL( AVG( actual_wind_speed ), 0 ) AS actual_wind_speed") .select("DAY( COLLECT_TIME ) AS ACTUAL_WIND_DIRECTION", "IFNULL( AVG( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED")
.groupBy("DAY( collect_time )") .groupBy("DAY( COLLECT_TIME )")
.lambda() .lambda()
.between(ThirdWindPowerGenerationUpdateEnt::getCollectTime, beginTime, endTime) .between(ThirdWindPowerGenerationUpdateEnt::getCollectTime, beginTime, endTime)
.in(ThirdWindPowerGenerationUpdateEnt::getStationId, collect) .in(ThirdWindPowerGenerationUpdateEnt::getStationId, collect)
...@@ -300,8 +300,8 @@ public class WindPredictionFutureService { ...@@ -300,8 +300,8 @@ public class WindPredictionFutureService {
beginTime = DateUtil.beginOfYear(now); beginTime = DateUtil.beginOfYear(now);
endTime = DateUtil.endOfYear(now); endTime = DateUtil.endOfYear(now);
map = mapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>() map = mapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>()
.select("MONTH( collect_time ) AS actual_wind_direction", "IFNULL( AVG( actual_wind_speed ), 0 ) AS actual_wind_speed") .select("MONTH( COLLECT_TIME ) AS ACTUAL_WIND_DIRECTION", "IFNULL( AVG( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED")
.groupBy("MONTH( collect_time )") .groupBy("MONTH( COLLECT_TIME )")
.lambda() .lambda()
.between(ThirdWindPowerGenerationUpdateEnt::getCollectTime, beginTime, endTime) .between(ThirdWindPowerGenerationUpdateEnt::getCollectTime, beginTime, endTime)
.in(ThirdWindPowerGenerationUpdateEnt::getStationId, collect) .in(ThirdWindPowerGenerationUpdateEnt::getStationId, collect)
...@@ -321,9 +321,9 @@ public class WindPredictionFutureService { ...@@ -321,9 +321,9 @@ public class WindPredictionFutureService {
} }
//风速统计 //风速统计
ThirdWindPowerGenerationUpdateEnt windSpeed = mapper.selectOne(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>() ThirdWindPowerGenerationUpdateEnt windSpeed = mapper.selectOne(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>()
.select("IFNULL( ROUND( MAX( actual_wind_speed ), 2 ), 0 ) AS max_wind_speed", .select("IFNULL( ROUND( MAX( ACTUAL_WIND_SPEED ), 2 ), 0 ) AS MAX_WIND_SPEED",
"IFNULL( ROUND( MIN( actual_wind_speed ), 2 ), 0 ) AS min_wind_speed", "IFNULL( ROUND( MIN( ACTUAL_WIND_SPEED ), 2 ), 0 ) AS MIN_WIND_SPEED",
"IFNULL( ROUND( AVG( actual_wind_speed ), 2 ), 0 ) AS avg_wind_speed") "IFNULL( ROUND( AVG( ACTUAL_WIND_SPEED ), 2 ), 0 ) AS AVG_WIND_SPEED")
.lambda() .lambda()
.between(ThirdWindPowerGenerationUpdateEnt::getCollectTime, beginTime, endTime) .between(ThirdWindPowerGenerationUpdateEnt::getCollectTime, beginTime, endTime)
.eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode) .eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode)
...@@ -369,7 +369,7 @@ public class WindPredictionFutureService { ...@@ -369,7 +369,7 @@ public class WindPredictionFutureService {
//分组查询风向 //分组查询风向
ThirdWindPowerGenerationMapper futureMapper = context.getBean(ThirdWindPowerGenerationMapper.class); ThirdWindPowerGenerationMapper futureMapper = context.getBean(ThirdWindPowerGenerationMapper.class);
List<ThirdWindPowerGenerationEnt> list = futureMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationEnt>() List<ThirdWindPowerGenerationEnt> list = futureMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationEnt>()
.select("actual_wind_direction", "COUNT( 1 ) AS actual_wind_speed") .select("ACTUAL_WIND_DIRECTION", "COUNT( 1 ) AS ACTUAL_WIND_SPEED")
.lambda() .lambda()
.between(ThirdWindPowerGenerationEnt::getCollectTime, beginTime, endTime) .between(ThirdWindPowerGenerationEnt::getCollectTime, beginTime, endTime)
.in(ThirdWindPowerGenerationEnt::getStationId, turbineList.stream() .in(ThirdWindPowerGenerationEnt::getStationId, turbineList.stream()
...@@ -538,7 +538,7 @@ public class WindPredictionFutureService { ...@@ -538,7 +538,7 @@ public class WindPredictionFutureService {
output.setActualWindSpeed(selectOne.getActualWindSpeed()); output.setActualWindSpeed(selectOne.getActualWindSpeed());
//总计数据 //总计数据
selectOne = bean.selectOne(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>() selectOne = bean.selectOne(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>()
.select("SUM( actual_generation ) AS actual_generation") .select("SUM( ACTUAL_GENERATION ) AS ACTUAL_GENERATION")
.lambda() .lambda()
.eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode) .eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode)
.eq(ThirdWindPowerGenerationUpdateEnt::getStationId, input.getStationId()) .eq(ThirdWindPowerGenerationUpdateEnt::getStationId, input.getStationId())
...@@ -573,7 +573,7 @@ public class WindPredictionFutureService { ...@@ -573,7 +573,7 @@ public class WindPredictionFutureService {
//查数据 //查数据
ThirdWindPowerGenerationMapper generationMapper = context.getBean(ThirdWindPowerGenerationMapper.class); ThirdWindPowerGenerationMapper generationMapper = context.getBean(ThirdWindPowerGenerationMapper.class);
List<ThirdWindPowerGenerationEnt> list = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationEnt>() List<ThirdWindPowerGenerationEnt> list = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationEnt>()
.select("collect_time", "IFNULL( SUM( actual_power ), 0 ) AS actual_power") .select("COLLECT_TIME", "IFNULL( SUM( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER")
.lambda() .lambda()
.between(ThirdWindPowerGenerationEnt::getCollectTime, beginTime, endTime) .between(ThirdWindPowerGenerationEnt::getCollectTime, beginTime, endTime)
.eq(ThirdWindPowerGenerationEnt::getStationId, input.getStationId()) .eq(ThirdWindPowerGenerationEnt::getStationId, input.getStationId())
...@@ -619,8 +619,8 @@ public class WindPredictionFutureService { ...@@ -619,8 +619,8 @@ public class WindPredictionFutureService {
//查本年发电 //查本年发电
ThirdWindPowerGenerationUpdateMapper generationMapper = context.getBean(ThirdWindPowerGenerationUpdateMapper.class); ThirdWindPowerGenerationUpdateMapper generationMapper = context.getBean(ThirdWindPowerGenerationUpdateMapper.class);
List<ThirdWindPowerGenerationUpdateEnt> list = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>() List<ThirdWindPowerGenerationUpdateEnt> list = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>()
.select("IFNULL( SUM( actual_generation ), 0 ) AS actual_generation", "MONTH ( collect_time ) AS actual_wind_direction") .select("IFNULL( SUM( ACTUAL_GENERATION ), 0 ) AS ACTUAL_GENERATION", "MONTH ( COLLECT_TIME ) AS ACTUAL_WIND_DIRECTION")
.groupBy("MONTH ( collect_time )") .groupBy("MONTH ( COLLECT_TIME )")
.lambda() .lambda()
.eq(ThirdWindPowerGenerationUpdateEnt::getStationId, input.getStationId()) .eq(ThirdWindPowerGenerationUpdateEnt::getStationId, input.getStationId())
.eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode) .eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode)
...@@ -654,8 +654,8 @@ public class WindPredictionFutureService { ...@@ -654,8 +654,8 @@ public class WindPredictionFutureService {
beginOfYear = DateUtil.offset(beginOfYear, DateField.YEAR, -1); beginOfYear = DateUtil.offset(beginOfYear, DateField.YEAR, -1);
endOfYear = DateUtil.offset(endOfYear, DateField.YEAR, -1); endOfYear = DateUtil.offset(endOfYear, DateField.YEAR, -1);
list = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>() list = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>()
.select("IFNULL( SUM( actual_generation ), 0 ) AS actual_generation", "MONTH ( collect_time ) AS actual_wind_direction") .select("IFNULL( SUM( ACTUAL_GENERATION ), 0 ) AS ACTUAL_GENERATION", "MONTH ( COLLECT_TIME ) AS ACTUAL_WIND_DIRECTION")
.groupBy("MONTH ( collect_time )") .groupBy("MONTH ( COLLECT_TIME )")
.lambda() .lambda()
.eq(ThirdWindPowerGenerationUpdateEnt::getStationId, input.getStationId()) .eq(ThirdWindPowerGenerationUpdateEnt::getStationId, input.getStationId())
.eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode) .eq(ThirdWindPowerGenerationUpdateEnt::getSystemSource, oilFieldCode)
......
...@@ -405,8 +405,8 @@ public class SpaceOptimizeBaseService { ...@@ -405,8 +405,8 @@ public class SpaceOptimizeBaseService {
SpaceInstitutionDurationMapper durationMapper = context.getBean(SpaceInstitutionDurationMapper.class); SpaceInstitutionDurationMapper durationMapper = context.getBean(SpaceInstitutionDurationMapper.class);
List<SpaceInstitutionDurationEnt> durationList = durationMapper.selectList(new QueryWrapper<SpaceInstitutionDurationEnt>() List<SpaceInstitutionDurationEnt> durationList = durationMapper.selectList(new QueryWrapper<SpaceInstitutionDurationEnt>()
.select("*", .select("*",
"STR_TO_DATE( CONCAT( open_well_time, ':00' ), '%H:%i:%s' ) AS openTime", "STR_TO_DATE( CONCAT( OPEN_WELL_TIME, ':00' ), '%H:%i:%s' ) AS openTime",
"STR_TO_DATE( CONCAT( close_well_time, ':00' ), '%H:%i:%s' ) AS closeTime" "STR_TO_DATE( CONCAT( CLOSE_WELL_TIME, ':00' ), '%H:%i:%s' ) AS closeTime"
) )
.lambda() .lambda()
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE) .eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
...@@ -2326,9 +2326,7 @@ public class SpaceOptimizeBaseService { ...@@ -2326,9 +2326,7 @@ public class SpaceOptimizeBaseService {
} }
} }
//保存结果 //保存结果
for (SpaceOptimizeDurationDTO dto : tempDurationDTOList) { CollUtil.addAll(durationDTOList, tempDurationDTOList);
durationDTOList.add(dto);
}
} }
} }
} }
...@@ -2508,9 +2506,7 @@ public class SpaceOptimizeBaseService { ...@@ -2508,9 +2506,7 @@ public class SpaceOptimizeBaseService {
} }
} }
//保存结果 //保存结果
for (SpaceOptimizeDurationDTO dto : tempDurationDTOList) { CollUtil.addAll(durationDTOList, tempDurationDTOList);
durationDTOList.add(dto);
}
} }
} }
} }
...@@ -3567,9 +3563,7 @@ public class SpaceOptimizeBaseService { ...@@ -3567,9 +3563,7 @@ public class SpaceOptimizeBaseService {
} }
} }
if (CollUtil.isNotEmpty(tempList)) { if (CollUtil.isNotEmpty(tempList)) {
for (SpaceOptimizeDurationDTO temp : tempList) { CollUtil.addAll(optimizeDurationDTOList, tempList);
optimizeDurationDTOList.add(temp);
}
} }
} }
} }
......
package pps.core.middle.service; package pps.core.middle.service;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import pps.core.middle.entity.StationMappingEnt;
import pps.core.middle.mapper.StationMappingMapper;
import pps.core.middle.service.data.station_mapping.GetStationMappingInput;
import pps.core.middle.service.data.station_mapping.GetStationMappingOutput;
import xstartup.annotation.XService; import xstartup.annotation.XService;
import xstartup.base.XContext; import xstartup.base.XContext;
import xstartup.base.XStartup;
import xstartup.data.XServiceResult; import xstartup.data.XServiceResult;
import xstartup.data.XSingleResult;
import xstartup.feature.api.annotation.XApiAnonymous; import xstartup.feature.api.annotation.XApiAnonymous;
import xstartup.feature.api.annotation.XApiGet; import xstartup.feature.api.annotation.XApiGet;
...@@ -106,30 +95,6 @@ public class StationMappingService { ...@@ -106,30 +95,6 @@ public class StationMappingService {
} }
} }
@XApiAnonymous
@XApiGet(anonymous = true)
public XSingleResult<GetStationMappingOutput> getStationMapping(XContext context, GetStationMappingInput input) {
StationMappingMapper mapper = context.getBean(StationMappingMapper.class);
List<StationMappingEnt> list = mapper.selectList(new LambdaQueryWrapper<>());
for (StationMappingEnt stationMappingEnt : list) {
context.getLogger().info(JSONUtil.toJsonStr(stationMappingEnt));
}
try {
String storeDir = XStartup.getCurrent().getProperty("weather.file.temp.path");
StringBuilder stringBuilder = new StringBuilder(storeDir)
.append(File.separator)
.append(DateTime.now().toString("yyyyMMdd"));
String filePath = stringBuilder.append(File.separator).append("test.json").toString();
String url = "http://192.168.100.128/tqfj/202410181200天气预测数据SY.json";
HttpUtil.downloadFile(url, filePath);
context.getLogger().info(filePath);
context.getLogger().info(FileUtil.readUtf8String(filePath));
} catch (Exception e) {
context.getLogger().error(e.getMessage(), e);
}
return XSingleResult.success();
}
@XApiAnonymous @XApiAnonymous
@XApiGet(anonymous = true) @XApiGet(anonymous = true)
public XServiceResult test(XContext context) throws SQLException { public XServiceResult test(XContext context) throws SQLException {
......
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