Browse Source

首页报表-缺陷报表修正bug

zhongwei
tyty 1 year ago
parent
commit
7032ffffd6
  1. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainReportController.java

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainReportController.java

@ -9,14 +9,12 @@ import com.hnac.hzims.operational.access.constants.AccessConstants;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.main.bo.OperationalReportBO;
import com.hnac.hzims.operational.main.service.IMainReportService;
import com.hnac.hzims.operational.main.vo.DefectReportVO;
import com.hnac.hzims.operational.main.vo.OperationalReportVO;
import com.hnac.hzims.operational.report.vo.PersonalMonthReportVO;
import com.hnac.hzims.operational.report.vo.StationReportAllVO;
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
@ -55,7 +53,7 @@ public class MainReportController extends BladeController {
private final IOperMaintenanceTaskService maintenanceTaskService;
private final IOperAccessTaskService accessTaskService;
private final IOperPhenomenonService operPhenomenonService;
@ApiLog
@ApiOperationSupport(order = 10)
@ -68,16 +66,16 @@ public class MainReportController extends BladeController {
Date startTime = DateUtil.parse(startDate, DateUtil.PATTERN_DATE);
Date endTime = DateUtil.plusDays(DateUtil.parse(endDate, DateUtil.PATTERN_DATE), 1);
List<OperDefectEntity> list = defectService.list(new LambdaQueryWrapper<OperDefectEntity>() {{
gt(OperDefectEntity::getCreateTime, startTime);
le(OperDefectEntity::getCreateTime, endTime);
List<OperPhenomenonEntity> list = operPhenomenonService.list(new LambdaQueryWrapper<OperPhenomenonEntity>() {{
ge(OperPhenomenonEntity::getCreateTime, startTime);
le(OperPhenomenonEntity::getCreateTime, endTime);
}});
if (CollectionUtil.isEmpty(list)) {
return R.data(new HashMap<>());
}
//按照日期将查询结果分类
Map<String, List<OperDefectEntity>> map = list.stream().collect(Collectors.groupingBy(o -> DateUtil.formatDate(o.getCreateTime())));
Map<String, List<OperPhenomenonEntity>> map = list.stream().collect(Collectors.groupingBy(o -> DateUtil.formatDate(o.getCreateTime())));
Map<String, DefectReportVO> data = new TreeMap<>();
Date date = DateUtil.plusDays(startTime, 0);
do {

Loading…
Cancel
Save