|
@@ -2,6 +2,7 @@ package com.platform.service.store.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.github.pagehelper.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.platform.common.bean.AbstractPageResultBean;
|
|
|
import com.platform.common.enums.DataFilterTypeEnum;
|
|
@@ -33,6 +34,9 @@ import com.platform.dao.vo.query.store.InStoreFormVO;
|
|
|
import com.platform.dao.vo.query.store.SpareBackDetailVO;
|
|
|
import com.platform.dao.vo.query.store.StoreCheckJobVO;
|
|
|
import com.platform.dao.vo.query.store.StoreVO;
|
|
|
+import com.platform.dao.vo.repair.RepairApplicationFormVO;
|
|
|
+import com.platform.dao.vo.report.InStoreFormReportVO;
|
|
|
+import com.platform.dao.vo.report.RepairReport24VO;
|
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
|
import com.platform.service.business.PurchaseBusinessService;
|
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
@@ -47,9 +51,11 @@ import tk.mybatis.mapper.weekend.Weekend;
|
|
|
import tk.mybatis.mapper.weekend.WeekendCriteria;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -230,6 +236,64 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<InStoreFormReportVO> getInStoreFormReport(InStoreFormDTO dto, Integer searchYear, LocalDate startMonth, LocalDate endMonth) {
|
|
|
+ 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();
|
|
|
+
|
|
|
+ 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.setSearchTimeStart(searchStartTime);
|
|
|
+ dto.setSearchTimeEnd(searchEndTime);
|
|
|
+ List<InStoreFormVO> list = mapper.selectList(dto);
|
|
|
+ List<InStoreFormReportVO> result = new ArrayList();
|
|
|
+ int i = 0;
|
|
|
+ for (Map<String, LocalDateTime> map : monthStartAndEndList) {
|
|
|
+ InStoreFormReportVO vo = new InStoreFormReportVO();
|
|
|
+ List<InStoreFormVO> detailList = new ArrayList();
|
|
|
+ vo.setYear(map.get("searchStartTimeMonth").getYear());
|
|
|
+ vo.setMonth(map.get("searchStartTimeMonth").getMonthValue());
|
|
|
+ for (InStoreFormVO inStoreFormVO : list) {
|
|
|
+
|
|
|
+
|
|
|
+ if (inStoreFormVO.getCreatedTime().isAfter(map.get("searchStartTimeMonth")) && inStoreFormVO.getCreatedTime().isBefore(map.get("searchEndTimeMonth"))) {
|
|
|
+ i++;
|
|
|
+ detailList.add(inStoreFormVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setNum(i);
|
|
|
+ vo.setDetailList(detailList);
|
|
|
+ result.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AbstractPageResultBean<InStoreFormVO> getInStoreForm(InStoreFormDTO dto,Integer pageNum,Integer pageSize) {
|
|
|
+ PageHelper.startPage(pageNum,pageSize);
|
|
|
+ return new MyPage<>(mapper.getInStoreForm(dto));
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void spareInStore(InStoreFormDTO model) {
|