| | |
| | | @Operation(summary = "添加电价时段配置列表") |
| | | Boolean createElectricityPrice(@RequestBody List<ElectricityPriceSegmentedDTO> list); |
| | | |
| | | @PostMapping(PREFIX + "/schedule/model/setting/update") |
| | | @Operation(summary = "修改调度模型配置") |
| | | Boolean updateScheduleModelSetting(@RequestParam("modelCode") String modelCode, @RequestParam("key") String key, @RequestParam("value") String value); |
| | | |
| | | } |
| | |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemOutputRespVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleRecordService; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; |
| | | import com.iailab.module.model.mcs.sche.service.*; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import com.iailab.module.model.mpk.service.ChartParamService; |
| | |
| | | |
| | | @Autowired |
| | | private ElectricityPriceSegmentedService electricityPriceSegmentedService; |
| | | |
| | | @Autowired |
| | | private StScheduleModelService stScheduleModelService; |
| | | |
| | | @Autowired |
| | | private StScheduleModelSettingService stScheduleModelSettingService; |
| | | |
| | | |
| | | private int HOUR_MINS = 60; |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateScheduleModelSetting(String modelCode, String key, String value) { |
| | | StScheduleModelEntity model = stScheduleModelService.getByModelCode(modelCode); |
| | | stScheduleModelSettingService.updateByModelIdAndKey(model.getId(), key, value); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 计算功率因数 p²/(根号:p²+Q²) |
| | | **/ |
| | |
| | | List<ElectricityPriceSegmentedDTO> electricityPriceSegmentedList = mcsApi.getElectricityPriceList(year, time); |
| | | return CommonResult.success(electricityPriceSegmentedList); |
| | | } |
| | | |
| | | @GetMapping("/schedule/model/setting/update") |
| | | @Operation(summary = "修改调度模型配置") |
| | | public CommonResult<Boolean> updateScheduleModelSetting(@RequestParam("modelCode") String modelCode, @RequestParam("key") String key, @RequestParam("value") String value){ |
| | | mcsApi.updateScheduleModelSetting(modelCode, key, value); |
| | | return success( true); |
| | | } |
| | | } |
| | |
| | | @Mapper |
| | | public interface StScheduleModelSettingDao extends BaseMapperX<StScheduleModelSettingEntity> { |
| | | void updatePyFile(@Param("likeValue") String likeValue, @Param("value") String value); |
| | | |
| | | void updateByModelIdAndKey(@Param("modelId") String modelId, @Param("key") String key, @Param("value") String value); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.service; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleModelSaveReqVO; |
| | |
| | | Long check(StScheduleModelSaveReqVO reqVO); |
| | | |
| | | Long count(); |
| | | |
| | | StScheduleModelEntity getByModelCode(String modelCode); |
| | | } |
| | |
| | | void saveList(String modelId, List<StScheduleModelSettingSaveReqVO> saveList); |
| | | |
| | | void updatePyFile(String pyModule, String fileName); |
| | | |
| | | void updateByModelIdAndKey(String modelId, String key, String value); |
| | | } |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | QueryWrapper<StScheduleModelEntity> wrapper = new QueryWrapper<>(); |
| | | return stScheduleModelDao.selectCount(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public StScheduleModelEntity getByModelCode(String modelCode) { |
| | | return stScheduleModelDao.selectOne("model_code", modelCode); |
| | | } |
| | | } |
| | |
| | | public void updatePyFile(String pyModule, String fileName) { |
| | | baseDao.updatePyFile(pyModule + "." + fileName.substring(0,fileName.lastIndexOf("_")+1),pyModule + "." + fileName); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByModelIdAndKey(String modelId, String key, String value) { |
| | | baseDao.updateByModelIdAndKey(modelId, key, value); |
| | | } |
| | | } |
| | |
| | | <update id="updatePyFile"> |
| | | update t_st_schedule_model_setting set value = #{value} where `key` = 'pyFile' and `value` like CONCAT(#{likeValue},'%') |
| | | </update> |
| | | |
| | | <update id="updateByModelIdAndKey"> |
| | | update t_st_schedule_model_setting set value = #{value} where `modelid` = #{modelId} and `key` = #{key} |
| | | </update> |
| | | </mapper> |