|
@@ -1,5 +1,7 @@
|
|
|
package com.persagy.apm.energy.report.manualfilling.service.impl;
|
|
|
|
|
|
+import com.persagy.apm.common.context.poems.PoemsContext;
|
|
|
+import com.persagy.apm.energy.report.common.DataConstants;
|
|
|
import com.persagy.apm.energy.report.common.utils.DateUtils;
|
|
|
import com.persagy.apm.energy.report.manualfilling.model.dto.QueryEnergyItemDataDTO;
|
|
|
import com.persagy.apm.energy.report.manualfilling.model.dto.SaveEnergyItemDataDTO;
|
|
@@ -17,6 +19,7 @@ import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
|
|
|
import com.persagy.apm.energy.report.saasweb.service.ISaasWebService;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.assertj.core.util.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -41,6 +44,7 @@ public class IEnergyItemDataServiceImpl implements IEnergyItemDataService {
|
|
|
@Override
|
|
|
public List<EnergyItemInfoVo> queryEnergyItemDataList(QueryEnergyItemDataDTO queryEnergyItemDataDTO) {
|
|
|
try {
|
|
|
+ PoemsContext.setContext(DataConstants.USER_ID, DataConstants.LOGIN_DEVICE, DataConstants.PD);
|
|
|
ReportProjectVO projectVO = iSaasWebService.getReportProjectInfo(queryEnergyItemDataDTO.getProjectId());
|
|
|
if (null == projectVO || StringUtils.isEmpty(projectVO.getFunctionType())) {
|
|
|
return new ArrayList<>();
|
|
@@ -99,12 +103,13 @@ public class IEnergyItemDataServiceImpl implements IEnergyItemDataService {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- return null;
|
|
|
+ return Lists.newArrayList();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void saveEnergyItemData(SaveEnergyItemDataDTO saveEnergyItemDataDTO) {
|
|
|
try {
|
|
|
+ PoemsContext.setContext(DataConstants.USER_ID, DataConstants.LOGIN_DEVICE, DataConstants.PD);
|
|
|
ReportProjectVO projectVO = iSaasWebService.getReportProjectInfo(saveEnergyItemDataDTO.getProjectId());
|
|
|
if (null == projectVO || StringUtils.isEmpty(projectVO.getFunctionType())) {
|
|
|
throw new Exception("获取不到项目信息");
|