|
|
@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotattachment.vo.IotAttachmentSaveReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotrddailyreport.vo.IotRdDailyReportPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotrddailyreport.vo.IotRdDailyReportSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrddailyreport.vo.IotRdDailyReportStatisticsRespVO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotattachment.IotAttachmentDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotrddailyreport.IotRdDailyReportDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotattachment.IotAttachmentMapper;
|
|
|
@@ -14,14 +15,15 @@ import cn.iocoder.yudao.module.pms.dal.mysql.iotrddailyreport.IotRdDailyReportMa
|
|
|
import cn.iocoder.yudao.module.pms.enums.AttachmentCategoryEnum;
|
|
|
import cn.iocoder.yudao.module.pms.enums.AttachmentTypeEnum;
|
|
|
import cn.iocoder.yudao.module.supplier.enums.common.SupplierAuditStatusEnum;
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|
|
+import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_RD_DAILY_REPORT_NOT_EXISTS;
|
|
|
@@ -40,6 +42,8 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
|
|
|
@Resource
|
|
|
private IotAttachmentMapper iotAttachmentMapper;
|
|
|
+ @Resource
|
|
|
+ private DeptService deptService;
|
|
|
|
|
|
@Override
|
|
|
public Long createIotRdDailyReport(IotRdDailyReportSaveReqVO createReqVO) {
|
|
|
@@ -139,4 +143,32 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
iotRdDailyReportMapper.insertBatch(reports);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<IotRdDailyReportStatisticsRespVO> statistics(IotRdDailyReportPageReqVO pageReqVO) {
|
|
|
+ // 按照项目部统计日报
|
|
|
+ // 先查询瑞都所有部门 163l
|
|
|
+ Set<Long> rdChildDeptIds = deptService.getChildDeptIdListFromCache(163l);
|
|
|
+ List<DeptDO> depts =deptService.getDeptList(rdChildDeptIds);
|
|
|
+ // key队伍id value队伍所属项目部id
|
|
|
+ Map<Long, Long> teamProjectPair = new HashMap<>();
|
|
|
+ Set<Long> projectDeptIds = new HashSet<>();
|
|
|
+ Map<Long, String> projectDeptPair = new HashMap<>();
|
|
|
+ if (CollUtil.isNotEmpty(depts)) {
|
|
|
+ depts.forEach(dept -> {
|
|
|
+ if (dept.getName().contains("项目部")) {
|
|
|
+ projectDeptIds.add(dept.getId());
|
|
|
+ projectDeptPair.put(dept.getId(), dept.getName());
|
|
|
+ } else {
|
|
|
+ teamProjectPair.put(dept.getId(), dept.getParentId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ // 查询所有瑞都日报
|
|
|
+ IotRdDailyReportPageReqVO reqVO = new IotRdDailyReportPageReqVO();
|
|
|
+ List<IotRdDailyReportDO> dailyReports = iotRdDailyReportMapper.dailyReports(reqVO);
|
|
|
+
|
|
|
+ return List.of();
|
|
|
+ }
|
|
|
+
|
|
|
}
|