|
@@ -26,6 +26,9 @@ import com.platform.dao.vo.SysRoleVO;
|
|
|
import com.platform.dao.vo.query.fill.FillGatherTaskDetailVO;
|
|
|
import com.platform.dao.vo.query.fill.FillGatherTaskVO;
|
|
|
import com.platform.dao.vo.query.fill.FillInfoVO;
|
|
|
+import com.platform.dao.vo.repair.RepairApplicationFormVO;
|
|
|
+import com.platform.dao.vo.report.FillGatherTaskReportVO;
|
|
|
+import com.platform.dao.vo.report.RepairReport24VO;
|
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
|
import com.platform.service.fill.FillGatherTaskService;
|
|
@@ -36,9 +39,11 @@ import org.springframework.stereotype.Service;
|
|
|
import tk.mybatis.mapper.weekend.Weekend;
|
|
|
import tk.mybatis.mapper.weekend.WeekendCriteria;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
@@ -67,6 +72,69 @@ public class FillGatherTaskServiceImpl extends BaseServiceImpl<FillGatherTaskMap
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FillGatherTaskReportVO> getMonthReport(FillGatherTaskDTO dto, Integer searchYear, LocalDate startMonth, LocalDate endMonth, Integer searchType) {
|
|
|
+ List<Map<String, LocalDateTime>> monthStartAndEndList = new ArrayList<Map<String, LocalDateTime>>();
|
|
|
+ LocalDateTime searchStartTime = null;
|
|
|
+ LocalDateTime searchEndTime = null;
|
|
|
+ if (searchYear != null) {
|
|
|
+ LocalDate localDate = LocalDate.now();
|
|
|
+ int year = localDate.getYear();
|
|
|
+ // 如2021-10-15号码,则month=10,需要计算到11月份,需要加1
|
|
|
+ int month = localDate.getMonthValue();
|
|
|
+ if (searchYear < year) {
|
|
|
+ month = 12;
|
|
|
+ year = searchYear;
|
|
|
+ }
|
|
|
+ monthStartAndEndList = DateUtils.getMonthStartAndEndByYear(year, month);
|
|
|
+ // 当前年份只统计到当前月,历史年份统计全年
|
|
|
+ searchStartTime = DateUtils.getFirstDayOfThisYear(year);
|
|
|
+ searchEndTime = DateUtils.getLastDayOfMonth(year, month);
|
|
|
+ } else {
|
|
|
+ monthStartAndEndList = DateUtils.getMonthStartAndEndByYear(startMonth, endMonth);
|
|
|
+ searchStartTime = DateUtils.getFirstDayOfMonth(startMonth);
|
|
|
+ searchEndTime = DateUtils.getLastDayOfMonth(endMonth);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 选择非计划性的订单
|
|
|
+ dto.setStatus(2);//已完成
|
|
|
+ dto.setUpdateTimeStart(searchStartTime);
|
|
|
+ dto.setUpdateTimeEnd(searchEndTime);
|
|
|
+ List<FillGatherTaskVO> list = mapper.selectList(dto);
|
|
|
+ List<FillGatherTaskReportVO> result = new ArrayList();
|
|
|
+
|
|
|
+ for (Map<String, LocalDateTime> map : monthStartAndEndList) {
|
|
|
+ int i = 0;
|
|
|
+ FillGatherTaskReportVO vo = new FillGatherTaskReportVO();
|
|
|
+ List<FillGatherTaskVO> detailList = new ArrayList();
|
|
|
+ vo.setYear(map.get("searchStartTimeMonth").getYear());
|
|
|
+ vo.setMonth(map.get("searchStartTimeMonth").getMonthValue());
|
|
|
+ for (FillGatherTaskVO fillGatherTaskVO : list) {
|
|
|
+// if (repairApplicationForm.getDealMinutes() == null) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+ /* if (type == 1) {
|
|
|
+ double minutes = repairApplicationForm.getDealMinutes();
|
|
|
+ if (minutes < 24.0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ if (fillGatherTaskVO.getUpdateTime().isAfter(map.get("searchStartTimeMonth")) && fillGatherTaskVO.getUpdateTime().isBefore(map.get("searchEndTimeMonth"))) {
|
|
|
+ i++;
|
|
|
+ detailList.add(fillGatherTaskVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setNum(i);
|
|
|
+ vo.setDetailList(detailList);
|
|
|
+ result.add(vo);
|
|
|
+ /*if (type == 2) {
|
|
|
+ i = 0;
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int updateDetails(FillGatherTaskDTO dto) {
|
|
|
//先获取勾选设备,更新
|