|
@@ -13,10 +13,10 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.google.common.base.Strings;
|
|
|
-import com.rtrh.projects.modules.projects.dao.SubAmtPlanDao;
|
|
|
-import com.rtrh.projects.modules.projects.dao.SubLabelDao;
|
|
|
-import com.rtrh.projects.modules.projects.dao.SubSourceDao;
|
|
|
+import com.rtrh.projects.modules.projects.dao.*;
|
|
|
import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
|
|
|
+import com.rtrh.projects.modules.projects.enums.RptContKindEnum;
|
|
|
+import com.rtrh.projects.modules.projects.po.RptCont;
|
|
|
import com.rtrh.projects.modules.projects.po.SubAmtPlan;
|
|
|
import com.rtrh.projects.modules.projects.po.SubInfo;
|
|
|
import com.rtrh.projects.modules.projects.po.SubInfoGxj;
|
|
@@ -33,14 +33,15 @@ 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;
|
|
|
import com.rtrh.common.util.StringUtil;
|
|
|
import com.rtrh.core.repository.Page;
|
|
|
import com.rtrh.projects.modules.hik.service.IHikApiService;
|
|
|
-import com.rtrh.projects.modules.projects.dao.SubInfoDao;
|
|
|
import com.rtrh.projects.modules.projects.enums.ProjectStatusEnum;
|
|
|
import com.rtrh.projects.modules.projects.enums.SubIsHideStatusEnum;
|
|
|
import com.rtrh.projects.modules.projects.mapper.StaticsMapper;
|
|
@@ -84,6 +85,8 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
|
private TSysTableService tSysTableService;
|
|
|
@Autowired
|
|
|
private SubLabelDao subLabelDao;
|
|
|
+ @Autowired
|
|
|
+ private RptContDao rptContDao;
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Integer> getWarningBySubId(String subId) {
|
|
@@ -162,6 +165,10 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
|
|
|
|
@Override
|
|
|
public Page queryPage(Page page, LoginUserVO loginUser, SubInfoQueryTzVO queryVO) {
|
|
|
+ if (StringUtils.isBlank(queryVO.getAbc())) {
|
|
|
+ String abcs = queryVO.getAbcs();
|
|
|
+ queryVO.setAbc(abcs);
|
|
|
+ }
|
|
|
PageHelper.startPage(page.getPageNo(), page.getPageSize());
|
|
|
if (StringUtils.isNotBlank(queryVO.getStartAmt()))
|
|
|
queryVO.setStartAmt(new BigDecimal(queryVO.getStartAmt()).multiply(new BigDecimal("10000")).toString());
|
|
@@ -170,16 +177,25 @@ 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)) {
|
|
|
- data.forEach(e ->
|
|
|
- byKind.stream()
|
|
|
- .filter(k -> e.getSubjectId().equals(k.getCode()))
|
|
|
- .findFirst()
|
|
|
- .ifPresent(k -> e.setSubjectName(k.getTitle()))
|
|
|
- );
|
|
|
+ for (SubInfoGxj e : data) {
|
|
|
+ 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()));
|
|
|
+ }
|
|
|
}
|
|
|
page.setTotalCount(pageInfo.getTotal());
|
|
|
return page;
|