|
@@ -4,13 +4,21 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.qhse.report.vo.QhseMonthReportPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.qhse.report.vo.QhseMonthReportPageReqVO;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.qhse.report.vo.QhseMonthReportRespVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.qhse.report.vo.QhseMonthReportSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.qhse.report.vo.QhseMonthReportSaveReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.report.QhseMonthReportDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.report.QhseMonthReportDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.qhse.report.QhseMonthReportMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.qhse.report.QhseMonthReportMapper;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.util.HashSet;
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
|
|
|
|
@@ -25,6 +33,8 @@ public class QhseMonthReportServiceImpl implements QhseMonthReportService {
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private QhseMonthReportMapper qhseMonthReportMapper;
|
|
private QhseMonthReportMapper qhseMonthReportMapper;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DeptService deptService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Long createQhseMonthReport(QhseMonthReportSaveReqVO createReqVO) {
|
|
public Long createQhseMonthReport(QhseMonthReportSaveReqVO createReqVO) {
|
|
@@ -69,4 +79,16 @@ public class QhseMonthReportServiceImpl implements QhseMonthReportService {
|
|
|
return qhseMonthReportMapper.selectPage(pageReqVO);
|
|
return qhseMonthReportMapper.selectPage(pageReqVO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public PageResult<QhseMonthReportRespVO> getDistinctPage(QhseMonthReportPageReqVO pageReqVO) {
|
|
|
|
|
+ IPage<QhseMonthReportRespVO> page;
|
|
|
|
|
+ Set<Long> ids = new HashSet<>();
|
|
|
|
|
+ if (Objects.nonNull(pageReqVO.getDeptId())) {
|
|
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
|
|
|
|
|
+ ids.add(pageReqVO.getDeptId());
|
|
|
|
|
+ }
|
|
|
|
|
+ page = qhseMonthReportMapper.getDistinctYearMonths(
|
|
|
|
|
+ new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO, ids);
|
|
|
|
|
+ return new PageResult<>(page.getRecords(), page.getTotal());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|