|
@@ -56,11 +56,9 @@ import tk.mybatis.mapper.weekend.WeekendCriteria;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.time.format.TextStyle;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -879,6 +877,35 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<RepairApplicationFormVO> getCurrentlyList(String userId) {
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ List<LocalDateTime> currentWeekStartAndEndList = DateUtils.currentWeek();
|
|
|
+ LocalDateTime searchStartTime = now.plusDays(-6).withHour(0).withMinute(0).withSecond(0);
|
|
|
+ LocalDateTime searchEndTime = now.withHour(23).withMinute(59).withSecond(59);
|
|
|
+ // 总数
|
|
|
+ RepairApplicationFormDTO queryDTO = new RepairApplicationFormDTO();
|
|
|
+ queryDTO.setSearchStartTime(searchStartTime);
|
|
|
+ queryDTO.setSearchEndTime(searchEndTime);
|
|
|
+ queryDTO.setRepairUserId(userId);
|
|
|
+ List<RepairApplicationFormVO> list = mapper.getCurrentlyList(queryDTO) == null ? new ArrayList<>() : mapper.getCurrentlyList(queryDTO);
|
|
|
+
|
|
|
+ List<RepairApplicationFormVO> result = new ArrayList<>();
|
|
|
+ for(LocalDateTime tempDate: currentWeekStartAndEndList){
|
|
|
+ RepairApplicationFormVO vo = new RepairApplicationFormVO();
|
|
|
+ int tempTotalNum = 0;
|
|
|
+ vo.setWeekDayName(tempDate.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.CHINA));
|
|
|
+ for(RepairApplicationFormVO useVO: list){
|
|
|
+ if(useVO.getRepairStartTime().toLocalDate().isEqual(tempDate.toLocalDate())){
|
|
|
+ tempTotalNum+=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setTempTotalNum(new BigDecimal(tempTotalNum));
|
|
|
+ result.add(vo);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 数据封装
|
|
|
* @param type 工单维修类型 内部还是外部
|