|
@@ -13,14 +13,13 @@ import cn.hutool.core.util.StrUtil;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.google.common.base.Strings;
|
|
import com.google.common.base.Strings;
|
|
-import com.google.common.collect.Lists;
|
|
|
|
import com.rtrh.projects.modules.projects.dao.*;
|
|
import com.rtrh.projects.modules.projects.dao.*;
|
|
import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
|
|
import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
|
|
import com.rtrh.projects.modules.projects.enums.*;
|
|
import com.rtrh.projects.modules.projects.enums.*;
|
|
|
|
+import com.rtrh.projects.modules.projects.mapper.SubInfoQueryMapper;
|
|
import com.rtrh.projects.modules.projects.po.*;
|
|
import com.rtrh.projects.modules.projects.po.*;
|
|
import com.rtrh.projects.modules.projects.service.SubPreNewService;
|
|
import com.rtrh.projects.modules.projects.service.SubPreNewService;
|
|
import com.rtrh.projects.modules.projects.vo.*;
|
|
import com.rtrh.projects.modules.projects.vo.*;
|
|
-import com.rtrh.projects.modules.projects.vo.export.SubInfoFixDetail;
|
|
|
|
import com.rtrh.projects.modules.projects.vo.export.SubInfoFixVO;
|
|
import com.rtrh.projects.modules.projects.vo.export.SubInfoFixVO;
|
|
import com.rtrh.projects.modules.system.dao.JUnitDao;
|
|
import com.rtrh.projects.modules.system.dao.JUnitDao;
|
|
import com.rtrh.projects.modules.system.enums.SysTableKind;
|
|
import com.rtrh.projects.modules.system.enums.SysTableKind;
|
|
@@ -28,14 +27,12 @@ import com.rtrh.projects.modules.system.po.JUnit;
|
|
import com.rtrh.projects.modules.system.po.TSystable;
|
|
import com.rtrh.projects.modules.system.po.TSystable;
|
|
import com.rtrh.projects.modules.system.service.ISubInduService;
|
|
import com.rtrh.projects.modules.system.service.ISubInduService;
|
|
import com.rtrh.projects.modules.system.service.TSysTableService;
|
|
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.modules.utils.DateUtils;
|
|
import com.rtrh.projects.util.TargetDataSource;
|
|
import com.rtrh.projects.util.TargetDataSource;
|
|
import com.rtrh.projects.vo.projects.SubFixGetBeginRateVo;
|
|
import com.rtrh.projects.vo.projects.SubFixGetBeginRateVo;
|
|
import com.rtrh.projects.vo.statics.OtherQueryVO;
|
|
import com.rtrh.projects.vo.statics.OtherQueryVO;
|
|
import com.rtrh.projects.vo.statics.ProjectQueryVO;
|
|
import com.rtrh.projects.vo.statics.ProjectQueryVO;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
-import org.hibernate.Query;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -80,6 +77,9 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
@Autowired
|
|
@Autowired
|
|
private JUnitDao jUnitDao;
|
|
private JUnitDao jUnitDao;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private SubInfoQueryMapper subInfoQueryMapper;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private TSysTableService tSysTableService;
|
|
private TSysTableService tSysTableService;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -1377,9 +1377,23 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
page.setList(subInfoDao.queryForObjListBySql(sql.toString()));
|
|
page.setList(subInfoDao.queryForObjListBySql(sql.toString()));
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
|
|
+ @Override
|
|
|
|
+ @TargetDataSource("secondary")
|
|
|
|
+ public Page pageZkTwo(Page page, LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
|
|
+ PageHelper.startPage(page.getPageNo(), page.getPageSize());
|
|
|
|
+ // 使用 MyBatis 进行查询
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("subName","");
|
|
|
|
+ List<Map<String, Object>> data = subInfoQueryMapper.selectPageZk(map);
|
|
|
|
|
|
|
|
+ PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(data);
|
|
|
|
+ page.setList(data);
|
|
|
|
+ page.setTotalCount(pageInfo.getTotal());
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @TargetDataSource("secondary")
|
|
public Page pageZk(Page page, LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
public Page pageZk(Page page, LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
StringBuffer paramSql = new StringBuffer();
|
|
StringBuffer paramSql = new StringBuffer();
|
|
paramSql.append(" and (a.`status` = '1' or a.`status` = 6 or a.`status` = 7 or a.`status` = 8 or a.`status` = 'A' ) ");
|
|
paramSql.append(" and (a.`status` = '1' or a.`status` = 6 or a.`status` = 7 or a.`status` = 8 or a.`status` = 'A' ) ");
|
|
@@ -1426,6 +1440,7 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Page pageEnd(Page page, LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
public Page pageEnd(Page page, LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
StringBuffer sql = buildSql(loginUserVO, queryTzVO);
|
|
StringBuffer sql = buildSql(loginUserVO, queryTzVO);
|
|
@@ -2596,113 +2611,30 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
|
|
+ @TargetDataSource(value = "secondary")
|
|
public Page pageGraphicProgress(Page page, LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
public Page pageGraphicProgress(Page page, LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
|
|
|
|
- StringBuffer sql = new StringBuffer();
|
|
|
|
- sql.append(" select * from ( select a.id, a.is_hide isHide,sa.yearAmt yearAmt,src2.yearAmtSj yearAmtSj, ");
|
|
|
|
- sql.append(" a.prop_kind AS propKind,a.indus_kind indusKind,a.status_fgw,a.sub_name subName,");
|
|
|
|
- sql.append(" a.amt_total amtTotal, DATE_FORMAT(a.begin_date, '%Y-%m-%d') AS beginDate, DATE_FORMAT(a.end_date, '%Y-%m-%d') AS endDate,");
|
|
|
|
- sql.append(" a.`status` ,b.title unitName ");
|
|
|
|
- sql.append(" ,(SELECT num_bl\tFROM\tsub_rpt_cont src\tWHERE \tsrc.sub_id = a.id\tAND src.logic_delete_flag = 0\tORDER BY\t\t last_update_time DESC,create_time DESC\tLIMIT 1 ) num_bl");
|
|
|
|
- sql.append(" from week_and_month_file wamf ");
|
|
|
|
- sql.append(" LEFT JOIN sub_rpt_cont src ON src.id=wamf.main_id ");
|
|
|
|
- sql.append(" LEFT JOIN sub_info a ON a.id=src.sub_id ");
|
|
|
|
- sql.append(" LEFT JOIN j_unit b ON a.unit_id = b.id ");
|
|
|
|
- sql.append(" LEFT JOIN sub_manage d ON a.id = d.sub_id AND d.logic_delete_flag = 0 ");
|
|
|
|
- sql.append(" LEFT JOIN sub_verify e ON a.id = e.sub_id AND e.logic_delete_flag = 0 ");
|
|
|
|
-
|
|
|
|
- //20231205 增加项目 今年 年度计划投资,年度实际投资
|
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
|
|
|
|
- Date date = new Date();
|
|
|
|
- String year = simpleDateFormat.format(date);
|
|
|
|
-
|
|
|
|
- sql.append(" LEFT JOIN ( SELECT sum(amt) yearAmt, sa.sub_id FROM sub_amtplan sa WHERE sa.logic_delete_flag = 0 AND sa.y_month like '" + year + "%' GROUP BY sa.sub_id ) sa ON sa.sub_id=a.id ");
|
|
|
|
- sql.append(" LEFT JOIN ( SELECT sum(amt) yearAmtSj, src.sub_id FROM sub_rpt_cont src WHERE src.logic_delete_flag = 0 AND src.kj_month like '" + year + "%' GROUP BY src.sub_id ) src2 ON src2.sub_id=a.id ");
|
|
|
|
-
|
|
|
|
- sql.append(" WHERE wamf.logic_delete_flag=0 and src.logic_delete_flag = 0 ");
|
|
|
|
- //限制文件只查图片101-jpg,102-png,视频203-MP4
|
|
|
|
- sql.append(" AND (wamf.file_type = '101' or wamf.file_type='102' or wamf.file_type='203') ");
|
|
|
|
-
|
|
|
|
- if (Objects.equals(loginUserVO.getKindUnit(), UserKindUnitEnum.SBDW.getCode())) {
|
|
|
|
- //项目单位
|
|
|
|
- sql.append(" AND a.unit_id = '" + loginUserVO.getUnitId() + "' ");
|
|
|
|
- if (Boolean.TRUE.equals(loginUserVO.getIsUnit())) {
|
|
|
|
- //单位用户,看单位全部的
|
|
|
|
- } else {
|
|
|
|
- //个人用户,看自己申报的
|
|
|
|
- sql.append(" AND a.create_user_id = '" + loginUserVO.getId() + "' ");
|
|
|
|
- }
|
|
|
|
- } else if (Objects.equals(loginUserVO.getKindUnit(), UserKindUnitEnum.ZFDW.getCode())) {
|
|
|
|
- //政府单位
|
|
|
|
- if (Objects.equals("0", loginUserVO.getStatusProj())) {
|
|
|
|
- //看自己部门监管的或者监管单位或审批的
|
|
|
|
- //sql.append(" AND ( a.unit_id = '"+ vo.getUnitId()+"' or a.main_id = '"+vo.getUnitId()+"' or d.depart_id = '"+vo.getDepartId()+"' or e.depart_id = '"+vo.getDepartId()+"' ) ");
|
|
|
|
- sql.append(" AND ( a.unit_id = '" + loginUserVO.getUnitId() + "' or a.main_id = '" + loginUserVO.getUnitId() + "' or d.manage_id = '" + loginUserVO.getUnitId() + "' or e.unit_id = '" + loginUserVO.getUnitId() + "' ) ");
|
|
|
|
- } else {
|
|
|
|
- //看所有的
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getHydw())) {
|
|
|
|
- sql.append(" AND ( a.unit_id = '" + queryTzVO.getHydw() + "' or a.main_id = '" + queryTzVO.getHydw() + "' or d.manage_id = '" + queryTzVO.getHydw() + "' or e.unit_id = '" + queryTzVO.getHydw() + "' ) ");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getKindNature())) {
|
|
|
|
- sql.append(" AND a.kind_nature = '" + queryTzVO.getKindNature() + "' ");
|
|
|
|
|
|
+ // 设置 ProjectStatusEnum.TEMPSAVE 的值
|
|
|
|
+ if (queryTzVO.getStatus() == null) {
|
|
|
|
+ queryTzVO.setStatus(ProjectStatusEnum.TEMPSAVE.getKey());
|
|
}
|
|
}
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getStatus())) {
|
|
|
|
- sql.append(" and a.`status` = '" + queryTzVO.getStatus() + "' ");
|
|
|
|
- } else {
|
|
|
|
- sql.append(" AND a.status != '" + ProjectStatusEnum.TEMPSAVE.getKey() + "' ");
|
|
|
|
- }
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getSubName())) {
|
|
|
|
- sql.append(" and a.sub_name like '%" + queryTzVO.getSubName() + "%' ");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getKind())) {
|
|
|
|
- //遍历
|
|
|
|
- String[] kinds = queryTzVO.getKind().split(",");
|
|
|
|
- String sqlTemp = "";
|
|
|
|
- for (String temp : kinds) {
|
|
|
|
-
|
|
|
|
- sqlTemp = sqlTemp + " INSTR (a.kind,'" + temp + "')>0 OR ";
|
|
|
|
- }
|
|
|
|
- //去掉最后的 OR
|
|
|
|
- String sqlCheck = sqlTemp.substring(0, sqlTemp.length() - 3);
|
|
|
|
|
|
+ queryTzVO.setYear("2025");
|
|
|
|
+ queryTzVO.setStatus(null);
|
|
|
|
+ PageHelper.startPage(page.getPageNo(), page.getPageSize());
|
|
|
|
+ // 使用 MyBatis 进行查询
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("year","2025");
|
|
|
|
+ List<Map<String, Object>> data = subInfoQueryMapper.pageGraphicProgress(map);
|
|
|
|
|
|
- sql.append(" AND ( " + sqlCheck + " )");
|
|
|
|
- }
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getIndusKind())) {
|
|
|
|
- sql.append(" and a.indus_kind = '" + queryTzVO.getIndusKind() + "' ");
|
|
|
|
- }
|
|
|
|
|
|
+ PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(data);
|
|
|
|
+ page.setList(data);
|
|
|
|
+ page.setTotalCount(pageInfo.getTotal());
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getSubjectId())) {
|
|
|
|
- sql.append(" and a.subject_id = '" + queryTzVO.getSubjectId() + "' ");
|
|
|
|
- }
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getSbdw())) {
|
|
|
|
- sql.append(" AND b.title like '%" + queryTzVO.getSbdw() + "%' ");
|
|
|
|
- }
|
|
|
|
- if (StringUtil.isNotEmpty(queryTzVO.getPropKind())) {
|
|
|
|
- sql.append(" AND a.prop_kind = '" + queryTzVO.getPropKind() + "' ");
|
|
|
|
- }
|
|
|
|
- sql.append(" group by a.id ");
|
|
|
|
- if (page.getOrderType() != null) {
|
|
|
|
- if ("asc".equals(page.getOrderType().name())) {
|
|
|
|
- sql.append(" ORDER BY yearAmt ");
|
|
|
|
- } else if ("desc".equals(page.getOrderType().name())) {
|
|
|
|
- sql.append(" ORDER BY yearAmt desc ");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
- sql.append(" ) t where 1= 1 ");
|
|
|
|
- if (queryTzVO.getNumBlMin() != null) {
|
|
|
|
- sql.append(" and num_bl >= '" + queryTzVO.getNumBlMin() + "' ");
|
|
|
|
- }
|
|
|
|
- if (queryTzVO.getNumBlMax() != null) {
|
|
|
|
- sql.append(" and num_bl <= '" + queryTzVO.getNumBlMax() + "' ");
|
|
|
|
- }
|
|
|
|
- Page pageData = subInfoDao.queryForListBySql(sql.toString(), page);
|
|
|
|
- return pageData;
|
|
|
|
- }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Map<String, Object> getAllAmtRt(LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|
|
public Map<String, Object> getAllAmtRt(LoginUserVO loginUserVO, SubInfoQueryTzVO queryTzVO) {
|