|
@@ -14,11 +14,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.ruoyi.common.core.enums.FacTypes;
|
|
|
+import com.ruoyi.common.core.utils.DateTimeUtil;
|
|
|
import com.ruoyi.common.core.utils.DateUtils;
|
|
|
import com.ruoyi.common.core.utils.ExpressUtil;
|
|
|
import com.ruoyi.common.core.utils.StreamUtils;
|
|
|
-import com.ruoyi.ems.domain.AdmEmsElecPgIndex;
|
|
|
-import com.ruoyi.ems.domain.AdmEmsIndexRange;
|
|
|
import com.ruoyi.ems.domain.EmsFacs;
|
|
|
import com.ruoyi.ems.domain.EmsFacsAbility;
|
|
|
import com.ruoyi.ems.domain.EmsFacsAttr;
|
|
@@ -32,7 +31,6 @@ import com.ruoyi.ems.service.IEmsFacsAttrService;
|
|
|
import com.ruoyi.ems.service.IEmsFacsEventService;
|
|
|
import com.ruoyi.ems.service.IEmsFacsService;
|
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
@@ -211,6 +209,7 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
|
|
|
return emsFacsMapper.deleteEmsFacsById(id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public List<String> inspectFacIndex() {
|
|
|
List<Map<String, Object>> admEmsIndexRanges = admEmsIndexRangeMapper.selectAdmEmsIndexRange();
|
|
|
Map<String, List<Map<String, Object>>> facTypeRangeMap = StreamUtils.groupByKey(admEmsIndexRanges,
|
|
@@ -234,6 +233,11 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
|
|
|
return errorReport;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Map<String, Object>> qryAreaDayPowerIndex(String areaCode) {
|
|
|
+ String firstDayOfRecentMonth = DateTimeUtil.getFirstDayOfRecentMonth();
|
|
|
+ return admEmsElecPgIndexMapper.qryAreaDayPowerIndex(areaCode, firstDayOfRecentMonth);
|
|
|
+ }
|
|
|
private void pgIndexInspection(List<String> errorReport,
|
|
|
Map.Entry<String, List<Map<String, Object>>> facTypeRange) {
|
|
|
Map<String, List<Map<String, Object>>> objCodeRangeMap = StreamUtils.groupByKey(facTypeRange.getValue(),
|
|
@@ -267,31 +271,6 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- List<Map<String, Object>> admEmsIndexRanges = new ArrayList<>();
|
|
|
- admEmsIndexRanges.add(BeanUtil.beanToMap(new AdmEmsIndexRange() {
|
|
|
- {
|
|
|
- setFacsType(FacTypes.PRODUCT.getCode());
|
|
|
- setIndexName("voltage");
|
|
|
- setIndexUpperLimit(225.0D);
|
|
|
- setIndexLowerLimit(220.1D);
|
|
|
- }
|
|
|
- }, "facsType", "indexName", "indexUpperLimit", "indexLowerLimit"));
|
|
|
- admEmsIndexRanges.add(BeanUtil.beanToMap(new AdmEmsIndexRange() {
|
|
|
- {
|
|
|
- setFacsType(FacTypes.PRODUCT.getCode());
|
|
|
- setIndexName("electricity");
|
|
|
- setIndexUpperLimit(225.0D);
|
|
|
- setIndexLowerLimit(220.1D);
|
|
|
- }
|
|
|
- }, "facsType", "indexName", "indexUpperLimit", "indexLowerLimit"));
|
|
|
- System.out.println(ExpressUtil.hitExpress(new AdmEmsElecPgIndex() {
|
|
|
- {
|
|
|
- setVoltage(220.1D);
|
|
|
- setElectricity(1.1D);
|
|
|
- }
|
|
|
- }, admEmsIndexRanges));
|
|
|
- }
|
|
|
|
|
|
private List<EmsFacsAttr> getFacsAttrs(EmsFacs emsFacs) {
|
|
|
EmsFacsAttr param = new EmsFacsAttr(emsFacs.getFacsCode());
|