|
@@ -1,17 +1,23 @@
|
|
package com.ruoyi.ems.service.impl;
|
|
package com.ruoyi.ems.service.impl;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
-import com.ruoyi.ems.domain.vo.QueryIndex;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import com.ruoyi.ems.mapper.ElecPgSupplyHMapper;
|
|
|
|
|
|
+
|
|
|
|
+import com.ruoyi.common.core.utils.DateTimeUtil;
|
|
|
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
import com.ruoyi.ems.domain.ElecPgSupplyH;
|
|
import com.ruoyi.ems.domain.ElecPgSupplyH;
|
|
|
|
+import com.ruoyi.ems.domain.vo.QueryIndex;
|
|
|
|
+import com.ruoyi.ems.mapper.ElecPgSupplyHMapper;
|
|
|
|
+import com.ruoyi.ems.mapper.PvSupplyHMapper;
|
|
import com.ruoyi.ems.service.IElecPgSupplyHService;
|
|
import com.ruoyi.ems.service.IElecPgSupplyHService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 电网供应计量-小时Service业务层处理
|
|
* 电网供应计量-小时Service业务层处理
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @author ruoyi
|
|
* @author ruoyi
|
|
* @date 2024-08-09
|
|
* @date 2024-08-09
|
|
*/
|
|
*/
|
|
@@ -21,9 +27,11 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
|
|
@Autowired
|
|
@Autowired
|
|
private ElecPgSupplyHMapper emsPgSupplyHMapper;
|
|
private ElecPgSupplyHMapper emsPgSupplyHMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private PvSupplyHMapper pvSupplyHMapper;
|
|
/**
|
|
/**
|
|
* 查询电网供应计量-小时
|
|
* 查询电网供应计量-小时
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param id 电网供应计量-小时主键
|
|
* @param id 电网供应计量-小时主键
|
|
* @return 电网供应计量-小时
|
|
* @return 电网供应计量-小时
|
|
*/
|
|
*/
|
|
@@ -35,24 +43,49 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询电网供应计量-小时列表
|
|
* 查询电网供应计量-小时列表
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param admEmsPgSupplyH 电网供应计量-小时
|
|
* @param admEmsPgSupplyH 电网供应计量-小时
|
|
* @return 电网供应计量-小时
|
|
* @return 电网供应计量-小时
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH admEmsPgSupplyH)
|
|
|
|
- {
|
|
|
|
- return emsPgSupplyHMapper.selectPgSupplyHList(admEmsPgSupplyH);
|
|
|
|
|
|
+ public List<ElecPgSupplyH> selectPgSupplyHList(ElecPgSupplyH admEmsPgSupplyH) {
|
|
|
|
+ if (StringUtils.isNotEmpty(admEmsPgSupplyH.getAreaCode())) {
|
|
|
|
+ return emsPgSupplyHMapper.selectPgSupplyHList(admEmsPgSupplyH);
|
|
|
|
+ }
|
|
|
|
+ return emsPgSupplyHMapper.selectPgSupplyHAllArea(admEmsPgSupplyH);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<ElecPgSupplyH> selectPgSupplyH(QueryIndex queryIndex) {
|
|
public List<ElecPgSupplyH> selectPgSupplyH(QueryIndex queryIndex) {
|
|
return emsPgSupplyHMapper.selectPgSupplyH(queryIndex);
|
|
return emsPgSupplyHMapper.selectPgSupplyH(queryIndex);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, Object> selectSupplyPvByH() {
|
|
|
|
+ String thisDay = DateTimeUtil.currentDateTime(DateTimeUtil.DateFormatter.yyyy_MM_dd);
|
|
|
|
+ Map<String, Map<String, Object>> supplyByHMap = emsPgSupplyHMapper.calThisDaySupplyByH(thisDay);
|
|
|
|
+ Map<String, Map<String, Object>> pvByHMap = pvSupplyHMapper.calThisDayPvByH(thisDay);
|
|
|
|
+ return new HashMap<String, Object>() {{
|
|
|
|
+ put("supply", supplyByHMap);
|
|
|
|
+ put("pv", pvByHMap);
|
|
|
|
+ }};
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, Object> selectSupplyPvByDay() {
|
|
|
|
+ String thisDay = DateTimeUtil.currentDateTime(DateTimeUtil.DateFormatter.yyyy_MM_dd);
|
|
|
|
+ Map<String, Object> thisDaySupply = emsPgSupplyHMapper.calThisDaySupply(thisDay);
|
|
|
|
+ Map<String, Object> thisDayPv = pvSupplyHMapper.calThisDayPv(thisDay);
|
|
|
|
+ return new HashMap<String, Object>() {{
|
|
|
|
+ put("supply", thisDaySupply);
|
|
|
|
+ put("pv", thisDayPv);
|
|
|
|
+ }};
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 新增电网供应计量-小时
|
|
* 新增电网供应计量-小时
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param admEmsPgSupplyH 电网供应计量-小时
|
|
* @param admEmsPgSupplyH 电网供应计量-小时
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@@ -64,7 +97,7 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改电网供应计量-小时
|
|
* 修改电网供应计量-小时
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param admEmsPgSupplyH 电网供应计量-小时
|
|
* @param admEmsPgSupplyH 电网供应计量-小时
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@@ -76,7 +109,7 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量删除电网供应计量-小时
|
|
* 批量删除电网供应计量-小时
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param ids 需要删除的电网供应计量-小时主键
|
|
* @param ids 需要删除的电网供应计量-小时主键
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@@ -88,7 +121,7 @@ public class EmsPgSupplyHServiceImpl implements IElecPgSupplyHService
|
|
|
|
|
|
/**
|
|
/**
|
|
* 删除电网供应计量-小时信息
|
|
* 删除电网供应计量-小时信息
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param id 电网供应计量-小时主键
|
|
* @param id 电网供应计量-小时主键
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|