|
@ -4,7 +4,6 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.elink.esua.epdc.commons.tools.constant.EpmetConstant; |
|
|
import com.elink.esua.epdc.commons.tools.constant.EpmetConstant; |
|
|
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.form.ScreenJobFormDTO; |
|
|
|
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.GridManagerUploadDataResultDTO; |
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.GridManagerUploadDataResultDTO; |
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.GridManagerUploadEventResultDTO; |
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.GridManagerUploadEventResultDTO; |
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenBaseReportResultDTO; |
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenBaseReportResultDTO; |
|
@ -19,9 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
import java.util.Calendar; |
|
|
|
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
@ -60,71 +56,15 @@ public class ScreenGridManagerServiceImpl extends BaseServiceImpl<ScreenGridMana |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result selectGridManagerUploadEvent(ScreenJobFormDTO paramDto) { |
|
|
public Result selectGridManagerUploadEvent(String yearMonthDay) { |
|
|
paramDto.setCustomId(customerId); |
|
|
// 如果统计年月日为空,则统计当前天的数据
|
|
|
|
|
|
yearMonthDay = StringUtils.isEmpty(yearMonthDay) ? DateUtils.format(new Date()) : yearMonthDay; |
|
|
|
|
|
List<GridManagerUploadEventResultDTO> gridManagerUploadEventResultDTOS = baseDao.selectGridManagerUploadEvent(customerId, yearMonthDay); |
|
|
if (StringUtils.isBlank(paramDto.getEndTime())) { |
|
|
if(gridManagerUploadEventResultDTOS.size()>0){ |
|
|
|
|
|
String dataJson = ScreenDataUtils.getScreenDateJson(gridManagerUploadEventResultDTOS,true); |
|
|
// 如果统计年月日为空,则统计当前天的数据
|
|
|
// 数据上报
|
|
|
String yearMonthDay = paramDto.getYearMonth(); |
|
|
epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_STATS_USER_GRID_MANAGER_UPLOAD_EVENT, dataJson); |
|
|
yearMonthDay = StringUtils.isEmpty(yearMonthDay) ? DateUtils.format(new Date()) : yearMonthDay; |
|
|
|
|
|
paramDto.setYearMonthDay(yearMonthDay); |
|
|
|
|
|
List<GridManagerUploadEventResultDTO> gridManagerUploadEventResultDTOS = baseDao.selectGridManagerUploadEvent(paramDto); |
|
|
|
|
|
if(gridManagerUploadEventResultDTOS.size()>0){ |
|
|
|
|
|
String dataJson = ScreenDataUtils.getScreenDateJson(gridManagerUploadEventResultDTOS,true); |
|
|
|
|
|
// 数据上报
|
|
|
|
|
|
epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_STATS_USER_GRID_MANAGER_UPLOAD_EVENT, dataJson); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
// 推送所有日期
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
Calendar ca = Calendar.getInstance(); |
|
|
|
|
|
Date curDate = null; |
|
|
|
|
|
Date endDate = null; |
|
|
|
|
|
try { |
|
|
|
|
|
curDate = sdf.parse(paramDto.getStartTime()); |
|
|
|
|
|
endDate = sdf.parse(paramDto.getEndTime()); |
|
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
int i =curDate.compareTo(endDate); |
|
|
|
|
|
while (curDate.compareTo(endDate) <= 0) { |
|
|
|
|
|
ca.setTime(curDate); |
|
|
|
|
|
paramDto.setEndTime(sdf.format(curDate)); |
|
|
|
|
|
ca.add(Calendar.DAY_OF_MONTH, 1); |
|
|
|
|
|
curDate = ca.getTime(); |
|
|
|
|
|
|
|
|
|
|
|
// 如果统计年月日为空,则统计当前天的数据
|
|
|
|
|
|
String yearMonthDay = paramDto.getYearMonth(); |
|
|
|
|
|
yearMonthDay = StringUtils.isEmpty(yearMonthDay) ? DateUtils.format(new Date()) : yearMonthDay; |
|
|
|
|
|
paramDto.setYearMonthDay(yearMonthDay); |
|
|
|
|
|
List<GridManagerUploadEventResultDTO> gridManagerUploadEventResultDTOS = baseDao.selectGridManagerUploadEvent(paramDto); |
|
|
|
|
|
if(gridManagerUploadEventResultDTOS.size()>0){ |
|
|
|
|
|
String dataJson = ScreenDataUtils.getScreenDateJson(gridManagerUploadEventResultDTOS,true); |
|
|
|
|
|
// 数据上报
|
|
|
|
|
|
epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_STATS_USER_GRID_MANAGER_UPLOAD_EVENT, dataJson); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
return new Result(); |
|
|
return new Result<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 如果统计年月日为空,则统计当前天的数据
|
|
|
|
|
|
// String yearMonthDay = paramDto.getYearMonth();
|
|
|
|
|
|
// yearMonthDay = StringUtils.isEmpty(yearMonthDay) ? DateUtils.format(new Date()) : yearMonthDay;
|
|
|
|
|
|
// List<GridManagerUploadEventResultDTO> gridManagerUploadEventResultDTOS = baseDao.selectGridManagerUploadEvent(customerId, yearMonthDay);
|
|
|
|
|
|
// if(gridManagerUploadEventResultDTOS.size()>0){
|
|
|
|
|
|
// String dataJson = ScreenDataUtils.getScreenDateJson(gridManagerUploadEventResultDTOS,true);
|
|
|
|
|
|
// // 数据上报
|
|
|
|
|
|
// epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_STATS_USER_GRID_MANAGER_UPLOAD_EVENT, dataJson);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// return new Result<>();
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|