|
@@ -8,7 +8,6 @@ import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import cn.hutool.core.map.MapUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
@@ -19,7 +18,6 @@ import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
|
|
|
import com.rtrh.projects.modules.projects.enums.RptContKindEnum;
|
|
|
import com.rtrh.projects.modules.projects.po.*;
|
|
|
import com.rtrh.projects.modules.projects.service.SubPreNewService;
|
|
|
-import com.rtrh.projects.modules.projects.service.SubRptContService;
|
|
|
import com.rtrh.projects.modules.projects.vo.*;
|
|
|
import com.rtrh.projects.modules.projects.vo.export.SubInfoFixVO;
|
|
|
import com.rtrh.projects.modules.system.dao.JUnitDao;
|
|
@@ -27,14 +25,12 @@ import com.rtrh.projects.modules.system.enums.SysTableKind;
|
|
|
import com.rtrh.projects.modules.system.po.JUnit;
|
|
|
import com.rtrh.projects.modules.system.po.TSystable;
|
|
|
import com.rtrh.projects.modules.system.service.TSysTableService;
|
|
|
-import com.rtrh.projects.modules.system.vo.PersonInfoVO;
|
|
|
import com.rtrh.projects.modules.utils.DateUtils;
|
|
|
import com.rtrh.projects.vo.statics.OtherQueryVO;
|
|
|
import com.rtrh.projects.vo.statics.ProjectQueryVO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.hibernate.Query;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.google.common.base.CaseFormat;
|
|
@@ -164,6 +160,47 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<SubInfoGxj> queryAll(LoginUserVO loginUser, SubInfoQueryTzVO queryVO) {
|
|
|
+ List<SubInfoGxj> data = subInfoMapper.queryPage(queryVO);
|
|
|
+ List<TSystable> byKind = tSysTableService.getByKind(SysTableKind.JSDD);
|
|
|
+ if (CollectionUtil.isNotEmpty(data)) {
|
|
|
+ for (SubInfoGxj e : data) {
|
|
|
+ // 查询月报中的建设进度
|
|
|
+ if (!Lists.newArrayList("1", "2").contains(e.getStatus())) {
|
|
|
+ String hql = "FROM RptCont WHERE logicDeleteFlag = 0 AND subId = :subId AND kind = :kind AND content IS NOT NULL ORDER BY kjMonth DESC";
|
|
|
+ Query query = rptContDao.createQuery(hql);
|
|
|
+ query.setParameter("subId", e.getSubId());
|
|
|
+ query.setParameter("kind", RptContKindEnum.MONTH.getCode());
|
|
|
+ query.setMaxResults(1);
|
|
|
+ Object result = query.uniqueResult();
|
|
|
+ Optional.ofNullable(result).map(o -> (RptCont) o).ifPresent(o -> e.setProgress(o.getContent()));
|
|
|
+ }
|
|
|
+
|
|
|
+ byKind.stream()
|
|
|
+ .filter(k -> e.getSubjectId().equals(k.getCode()))
|
|
|
+ .findFirst()
|
|
|
+ .ifPresent(k -> e.setSubjectName(k.getTitle()));
|
|
|
+ if ("2".equals(e.getStatus())) {
|
|
|
+ // 新建库查询前期手续
|
|
|
+ List<SubPreNewResultVO> preList = subPreNewService.listBySubId(e.getSubId());
|
|
|
+ Map<String, Long> numMap = preList.stream().collect(Collectors.groupingBy(SubPreNewResultVO::getStatusConf, Collectors.counting()));
|
|
|
+ e.setPreProceNum(numMap.getOrDefault("1", 0L) + "");
|
|
|
+ e.setPreEndNum(numMap.getOrDefault("2", 0L) + "");
|
|
|
+ }
|
|
|
+ // 在建项目年度投资
|
|
|
+ if ("3".equals(e.getStatus())) {
|
|
|
+ Object o = rptContDao.queryForObjectBySql("SELECT sum(src.amt) AS yearAmtSj FROM sub_rpt_cont src WHERE src.logic_delete_flag = 0 AND src.kj_month >= ? AND src.sub_id=? GROUP BY src.sub_id", DateUtil.thisYear() + "01", e.getSubId());
|
|
|
+ if (o != null) {
|
|
|
+ Object o1 = ((Map<String, Object>) o).get("yearAmtSj");
|
|
|
+ e.setYearAmtSj(o1 != null ? o1.toString() : "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Page queryPage(Page page, LoginUserVO loginUser, SubInfoQueryTzVO queryVO) {
|
|
|
if (StringUtils.isBlank(queryVO.getAbc())) {
|
|
@@ -178,8 +215,7 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
|
}
|
|
|
|
|
|
List<SubInfoGxj> data = subInfoMapper.queryPage(queryVO);
|
|
|
- PageInfo<SubInfoGxj> pageInfo = new PageInfo<>(data);
|
|
|
- page.setList(data);
|
|
|
+
|
|
|
|
|
|
List<TSystable> byKind = tSysTableService.getByKind(SysTableKind.JSDD);
|
|
|
if (CollectionUtil.isNotEmpty(data)) {
|
|
@@ -216,6 +252,8 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ PageInfo<SubInfoGxj> pageInfo = new PageInfo<>(data);
|
|
|
+ page.setList(data);
|
|
|
page.setTotalCount(pageInfo.getTotal());
|
|
|
return page;
|
|
|
}
|