liwen 8 months ago
parent
commit
d66187c40c
  1. 25
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/SearchStationTypeEnum.java
  2. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java
  3. 14
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java
  4. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/feign/GenerateClient.java
  5. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java
  6. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  7. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java

25
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/SearchStationTypeEnum.java

@ -11,17 +11,20 @@ import java.util.Arrays;
*/
@AllArgsConstructor
public enum SearchStationTypeEnum {
TOTAL("站点总数量",null,"运维平台目前接入站点总数为:%s"),
HYDROPOWER_TOTAL("水电站总数量","0","运维平台目前接入水电站总数为:%s"),
WIND_POWER_TOTAL("风电场总数量","1","运维平台目前接入风电场总数为:%s"),
ENERGY_STORAGE_TOTAL("储能站总数量","3","运维平台目前接入储能站总数为:%s"),
PHOTOVOLTAIC_TOTAL("光伏站总数量","5","运维平台目前接入光伏站总数为:%s"),
CHARGE_TOTAL("充电站总数量","7","运维平台目前接入充电站总数为:%s"),
HYDROPOWER_NUM("水电站接入量","0","运维平台目前接入水电站接入量为:%s"),
WIND_POWER_NUM("风电场接入量","1","运维平台目前接入风电场接入量为:%s"),
ENERGY_STORAGE_NUM("储能站接入量","3","运维平台目前接入储能站接入量为:%s"),
PHOTOVOLTAIC_NUM("光伏站接入量","5","运维平台目前接入光伏站接入量为:%s"),
CHARGE_NUM("充电站接入量","7","运维平台目前接入充电站接入量为:%s"),
STATION_TOTAL("电站总数量",null,"智能运维平台接入电站总数为:%s"),
SET_TOTAL("站点总数量",null,"智能运维平台接入站点总数为:%s"),
HYDROPOWER_TOTAL("水电站总数量","0","智能运维平台接入水电站总数为:%s"),
WIND_POWER_TOTAL("风电场总数量","1","智能运维平台接入风电场总数为:%s"),
ENERGY_STORAGE_TOTAL("储能站总数量","3","智能运维平台接入储能站总数为:%s"),
PHOTOVOLTAIC_TOTAL("光伏站总数量","5","智能运维平台接入光伏站总数为:%s"),
CHARGE_TOTAL("充电站总数量","7","智能运维平台接入充电站总数为:%s"),
STATION_NUM("电站接入量",null,"智能运维平台接入电站总数为:%s"),
SET_NUM("站点接入量",null,"智能运维平台接入站点总数为:%s"),
HYDROPOWER_NUM("水电站接入量","0","智能运维平台接入水电站接入量为:%s"),
WIND_POWER_NUM("风电场接入量","1","智能运维平台接入风电场接入量为:%s"),
ENERGY_STORAGE_NUM("储能站接入量","3","智能运维平台接入储能站接入量为:%s"),
PHOTOVOLTAIC_NUM("光伏站接入量","5","智能运维平台接入光伏站接入量为:%s"),
CHARGE_NUM("充电站接入量","7","智能运维平台接入充电站接入量为:%s"),
;
@Getter

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java

@ -90,6 +90,6 @@ public class InteractiveController {
@RequestParam @ApiParam("结束时间")String endTime) {
double generate = interactiveService.generation(stationId,startTime,endTime);
DecimalFormat format = new DecimalFormat("0.00");
return R.data(format.format(generate) + "kwh");
return R.data(format.format(generate) + "kWh");
}
}

14
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java

@ -117,6 +117,8 @@ public class InteractiveHandler extends TextWebSocketHandler {
case CHOOSE_FAULT:
this.handleFaultChoose(messageContext,sessionId);
break;
case CHOOSE_YC:
this.handleDataChoose(messageContext,sessionId);
default:
break;
}
@ -209,4 +211,16 @@ public class InteractiveHandler extends TextWebSocketHandler {
extra.put("data",data);
interactiveService.specialAsk(sessionId,userId,extra);
}
private void handleDataChoose(JSONObject messageContext,String sessionId) {
IInteractiveService interactiveService = SpringUtil.getBean(IInteractiveService.class);
String userId = messageContext.getString("userId");
String funcCode = messageContext.getString("funcCode");
FaultSelectionVO selectionVO = messageContext.getObject("selection",FaultSelectionVO.class);
Map<String, Object> extra = new HashMap<>(2);
extra.put("func",funcCode);
extra.put("data",selectionVO);
interactiveService.specialAsk(sessionId,userId,extra);
}
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/feign/GenerateClient.java

@ -6,10 +6,12 @@ import com.hnac.hzims.operational.fill.service.GenerateService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
@ -28,9 +30,10 @@ public class GenerateClient implements IGenerateClient {
public Double stationGenerateByTime(@RequestParam("stationId") String stationId,
@RequestParam("startTime") String startTime,
@RequestParam("endTime") String endTime) {
Date start = DateUtil.parse(startTime,DateUtil.PATTERN_DATETIME);
List<GenerateEntity> generates = generateService.list(Wrappers.<GenerateEntity>lambdaQuery()
.eq(GenerateEntity::getStationCode,stationId)
.ge(GenerateEntity::getFillDate,startTime)
.ge(GenerateEntity::getFillDate,DateUtil.format(start,DateUtil.PATTERN_DATE))
.le(GenerateEntity::getFillDate,endTime)
);
if(CollectionUtil.isEmpty(generates)){

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java

@ -258,7 +258,7 @@ public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, Generat
while (end.compareTo(start) > 0){
entity.setId(null);
entity.setFillDate(DateUtil.format(start,DateUtil.PATTERN_DATE));
entity.setGenerate((random.nextDouble() * 10000) + 50000);
entity.setGenerate((random.nextDouble() * 1360) + 19000);
this.save(entity);
calendar.add(Calendar.DAY_OF_MONTH,1);
start = calendar.getTime();

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -631,6 +631,8 @@ public class HydropowerServiceImpl implements HydropowerService {
// 年发电量
kpi.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum());
// 月发电量
kpi.setGenerateMon(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum());
// 日发电量
kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java

@ -144,7 +144,7 @@ public class StationClient implements IStationClient {
@RequestParam(required = false) String endTime,
@RequestParam(required = false) String type) {
LambdaQueryWrapper<StationEntity> wrapper = Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getType, type)
.eq(StringUtil.isNotBlank(type) && Func.isNotEmpty(type),StationEntity::getType, type)
.le(StringUtil.isNotBlank(endTime) && Func.isNotEmpty(endTime),StationEntity::getCreateTime, endTime)
.ge(StringUtil.isNotBlank(startTime) && Func.isNotEmpty(startTime),StationEntity::getCreateTime, startTime);
return R.data(stationService.list(wrapper));

Loading…
Cancel
Save