Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.java
#	projects-service/src/main/java/com/rtrh/projects/modules/projects/service/SubInfoService.java
#	projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java
#	projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoQueryApiController.java
JiangPengLi 4 ay önce
ebeveyn
işleme
17006f5e19

+ 11 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/dto/BasePage.java

@@ -0,0 +1,11 @@
+package com.rtrh.projects.modules.projects.dto;
+
+import lombok.Data;
+
+@Data
+public class BasePage {
+
+    private int pageNo = 1; // 当前页码
+
+    private int pageSize = 10; // 每页显示条数
+}

+ 25 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/dto/SubFixCbSearch.java

@@ -0,0 +1,25 @@
+package com.rtrh.projects.modules.projects.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+// 重点项目-储备库查询参数
+@Data
+public class SubFixCbSearch extends BasePage{
+
+    private String year;    // 年份
+
+    private String subName; // 项目名称
+
+    private String subjectId; // 项目属地
+
+    private String indusKind; // 行业类别
+
+    private BigDecimal startAmt;    // 资金区间开始
+
+    private BigDecimal endAmt;  // 资金区间结束
+
+    private String sbdw;    // 申报单位
+
+}

+ 4 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.java

@@ -4,7 +4,9 @@ import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
+import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
 import com.rtrh.projects.modules.projects.po.SubInfo;
+import com.rtrh.projects.modules.projects.vo.SubFixCbVo;
 import com.rtrh.projects.modules.projects.po.SubInfoGxj;
 import com.rtrh.projects.modules.projects.vo.SubInfoQueryTzVO;
 import org.apache.ibatis.annotations.Param;
@@ -38,4 +40,6 @@ public interface SubInfoMapper {
     List<SubInfoGxj> queryStatistics(@Param("vo") SubInfoQueryTzVO queryVO);
 
     SubInfoGxj findById(@Param("id") String id);
+
+    List<SubFixCbVo> subFixCbAll(@Param("subFixCbSearch") SubFixCbSearch subFixCbSearch);
 }

+ 35 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml

@@ -258,4 +258,39 @@
         where id = #{id}
     </select>
 
+    <select id="subFixCbAll" resultType="com.rtrh.projects.modules.projects.vo.SubFixCbVo">
+        SELECT sub_info.id as id,
+               sub_info.sub_name as subName,
+               sub_info.subject_id as subjectId,
+               sub_info.content as content,
+               sub_info.amt_total as amtTotal,
+               sub_info.progress as progress,
+               sub_info.remark as remark
+        FROM sub_fix
+        LEFT JOIN sub_info ON sub_fix.sub_id = sub_info.id
+        WHERE sub_fix.status = 1
+        AND sub_info.logic_delete_flag = 0
+        <if test="subFixCbSearch.year != null and subFixCbSearch.year != ''">
+            AND sub_fix.year = #{subFixCbSearch.year}
+        </if>
+        <if test="subFixCbSearch.subName != null and subFixCbSearch.subName != ''">
+            AND sub_info.sub_name LIKE CONCAT('%', #{subFixCbSearch.subName}, '%')
+        </if>
+        <if test="subFixCbSearch.subjectId != null and subFixCbSearch.subjectId != ''">
+            AND sub_info.subject_id = #{subFixCbSearch.subjectId}
+        </if>
+        <if test="subFixCbSearch.indusKind != null and subFixCbSearch.indusKind != ''">
+            AND sub_info.indus_kind = #{subFixCbSearch.indusKind}
+        </if>
+        <if test="subFixCbSearch.startAmt != null">
+            AND sub_info.amt_total >= #{subFixCbSearch.startAmt}
+        </if>
+        <if test="subFixCbSearch.endAmt != null">
+            AND sub_info.amt_total &lt;= #{subFixCbSearch.endAmt}
+        </if>
+        <if test="subFixCbSearch.sbdw != null and subFixCbSearch.sbdw != ''">
+            AND sub_info.sbdw LIKE CONCAT('%', #{subFixCbSearch.sbdw}, '%')
+        </if>
+    </select>
+
 </mapper>

+ 4 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/SubInfoQueryService.java

@@ -4,7 +4,9 @@ import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
+import com.github.pagehelper.PageInfo;
 import com.rtrh.core.repository.Page;
+import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
 import com.rtrh.projects.modules.projects.vo.*;
 import com.rtrh.projects.modules.projects.vo.export.ExportQueryVO;
 import com.rtrh.projects.modules.projects.vo.export.SubInfoExportVO;
@@ -325,6 +327,8 @@ public interface SubInfoQueryService {
 
 	Map<String, Integer> getWarningBySubId(String subId);
 
+	Page subFixCbAll(SubFixCbSearch subFixCbSearch);
+
 	Page queryPage(Page page, LoginUserVO loginUser, SubInfoQueryTzVO queryVO);
 
 	StatisticsVO queryStatistics(SubInfoQueryTzVO queryVO, LoginUserVO loginUser);

+ 13 - 13
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/SubInfoService.java

@@ -44,12 +44,12 @@ public interface SubInfoService {
 	 * @return
 	 */
 	Page pageQueryReportList(Page page,LoginUserVO loginUserVO, String subName, String unitId,String kind, String status, String statusSp,
-			String propKind, String indusKind, Date beginDate, Date endDate);
+							 String propKind, String indusKind, Date beginDate, Date endDate);
 
 
 
 	Page pageQueryReportListSql(Page page,LoginUserVO loginUserVO, String subName, String unitId,String kind, String status, String statusSp,
-			String propKind, String indusKind, Date beginDate, Date endDate, List<String> subInfoIds);
+								String propKind, String indusKind, Date beginDate, Date endDate);
 
 
 
@@ -68,7 +68,7 @@ public interface SubInfoService {
 	 * @return
 	 */
 	Page pageQueryApplyList(Page page, String subName, String unitId, String departId, String kind, String propKind,
-			String indusKind, Date beginDate, Date endDate,LoginUserVO vo);
+							String indusKind, Date beginDate, Date endDate,LoginUserVO vo);
 
 	/**
 	 * 保存项目信息
@@ -150,7 +150,7 @@ public interface SubInfoService {
 	 * @return
 	 */
 	List<Map<String,Object>>  queryProjectsIndusKind(LoginUserVO vo, String subName, String kind,
-													  String propKind, String indusKind, String status, String beginDateStart, String beginDateEnd, Boolean containHide, String zjly);
+													 String propKind, String indusKind, String status, String beginDateStart, String beginDateEnd, Boolean containHide, String zjly);
 
 	/**
 	 * 查询项目核准备案
@@ -178,7 +178,7 @@ public interface SubInfoService {
 	 * @return
 	 */
 	Page pageQueryPre(Page page, LoginUserVO vo, String subName, String kind,
-					 String propKind, String indusKind);
+					  String propKind, String indusKind);
 
 	/**
 	 * 更新项目状态为关闭,当项目审批状态为未通过时
@@ -371,22 +371,22 @@ public interface SubInfoService {
 
 	void saveEditFund(EditSubInfoDataVO vo, LoginUserVO loginUser);
 
-    void saveOrUpateYgdz(SubMajorDataVO po, LoginUserVO loginUser);
+	void saveOrUpateYgdz(SubMajorDataVO po, LoginUserVO loginUser);
 
-    Page pageQueryRreDepartment(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception;
+	Page pageQueryRreDepartment(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception;
 
-	Page pageQueryRreFile(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception;
+	Page pageQueryRreFile(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception;
 
 
-	Page pageQueryRreProject(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception;
+	Page pageQueryRreProject(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception;
 
-	Object sumDepartment(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception;
+	Object sumDepartment(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception;
 
-	Object sumFile(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds)  throws Exception;
+	Object sumFile(SubinfoPreQueryVo queryVO, LoginUserVO loginUser)  throws Exception;
 
-	Object sumProject(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception;
+	Object sumProject(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception;
 
-    void saveEditFundDetail(EditSubInfoDataVO vo, LoginUserVO loginUser);
+	void saveEditFundDetail(EditSubInfoDataVO vo, LoginUserVO loginUser);
 
 	List<SubSourceDetailVO> getDetailFormById(String id, String zjlyId, String cat) throws  Exception ;
 

+ 14 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoQueryServiceImpl.java

@@ -16,6 +16,7 @@ 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.dto.SubFixCbSearch;
 import com.rtrh.projects.modules.projects.po.SubAmtPlan;
 import com.rtrh.projects.modules.projects.po.SubInfo;
 import com.rtrh.projects.modules.projects.po.SubInfoGxj;
@@ -147,6 +148,18 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
         return map;
     }
 
+    @Override
+    public Page subFixCbAll(SubFixCbSearch subFixCbSearch) {
+        // 启动分页查询,pageNum 是当前页,pageSize 是每页大小
+        PageHelper.startPage(subFixCbSearch.getPageNo(), subFixCbSearch.getPageSize());
+        List<SubFixCbVo> subFixCbVoList = subInfoMapper.subFixCbAll(subFixCbSearch);
+        PageInfo<SubFixCbVo> pageInfo = new PageInfo<>(subFixCbVoList);
+        Page page = new Page();
+        page.setList(pageInfo.getList());
+        page.setTotalCount(pageInfo.getTotal());
+        return page;
+    }
+
     @Override
     public Page queryPage(Page page, LoginUserVO loginUser, SubInfoQueryTzVO queryVO) {
         PageHelper.startPage(page.getPageNo(), page.getPageSize());
@@ -156,6 +169,7 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
             queryVO.setEndAmt(new BigDecimal(queryVO.getEndAmt()).multiply(new BigDecimal("10000")).toString());
         }
         List<SubInfoGxj> data = subInfoMapper.queryPage(queryVO);
+
         PageInfo<SubInfoGxj> pageInfo = new PageInfo<>(data);
         page.setList(data);
         List<TSystable> byKind = tSysTableService.getByKind(SysTableKind.JSDD);

+ 44 - 79
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java

@@ -20,7 +20,6 @@ import com.rtrh.projects.modules.rolemeun.po.SecRole;
 import com.rtrh.projects.modules.system.dao.TSystableDao;
 import com.rtrh.projects.modules.system.po.*;
 import com.rtrh.projects.modules.utils.DateUtils;
-import com.rtrh.projects.util.TargetDataSource;
 import com.rtrh.projects.vo.SubIdVO;
 import com.rtrh.projects.vo.subject.SubinfoPreQueryVo;
 import org.apache.commons.lang3.StringUtils;
@@ -451,7 +450,7 @@ public class SubInfoServiceImpl implements SubInfoService {
         //如果固定投资年度当前年度不做操作,否则加入对应的年度表中
         List<TSystable> listT = tSystableDao.getSysDataByKind(SysTableKind.YEAR_FIX);
         TSystable table = listT.size() > 0 ? listT.get(0) : null;
-        if (table != null && old.getIsFix() != null && old.getIsFix().equals("1")) {
+        if (table != null&&old.getIsFix()!=null&&old.getIsFix().equals("1")) {
             //保存固定投资年度到对应的年份表中
             subFixDao.saveOrUpdate(new SubFix().setId(Identities.uuid()).setStatus(old.getStatus()).setSubId(old.getId()).setStatus(old.getStatus()).setCat(old.getStateFix()).setYear(table.getCode()).setCreateUserId(currUserId).setCreateTime(new Date()));
         }
@@ -1045,11 +1044,12 @@ public class SubInfoServiceImpl implements SubInfoService {
                     .map(id -> "'" + id + "'") // 每个 ID 加单引号
                     .collect(Collectors.joining(","));
             sql.append(" and a.id in (").append(idListStr).append(") ");
-        } else {
+        }else {
             sql.append(" and a.id in ( ) ");
         }
 
 
+
         //2024-03-28客户提出admin用户需查询和储备台账一样的数据
         SecRole role = secRoleDao.findById(loginUserVO.getKind());
         String subjectId = null;
@@ -1552,6 +1552,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
     }
 
+
     @Override
     @Transactional
     public void saveEditSubInfoData(EditSubInfoDataVO vo, LoginUserVO userVO) {
@@ -1635,14 +1636,14 @@ public class SubInfoServiceImpl implements SubInfoService {
 
 
             //计划开工时间
-            if (old.getBeginDate() != null) {
+            if(old.getBeginDate()!=null) {
                 if (!simpleDateFormat.format(old.getBeginDate()).equals(simpleDateFormat.format(subInfo.getBeginDate()))) {
                     subDataLogService.saveOrUpdate(Identities.uuid(), subInfo.getId(), SubLogEnum.XMXX.getCode(), "begin_date", "计划开工时间", "", simpleDateFormat.format(old.getBeginDate()), simpleDateFormat.format(subInfo.getBeginDate()), null, userVO.getLoginName(), new Date(), "修改");
                 }
             }
 
             //计划竣工时间
-            if (old.getEndDate() != null) {
+            if(old.getEndDate()!=null) {
                 if (!simpleDateFormat.format(old.getEndDate()).equals(simpleDateFormat.format(old.getEndDate()))) {
                     subDataLogService.saveOrUpdate(Identities.uuid(), subInfo.getId(), SubLogEnum.XMXX.getCode(), "end_date", "计划竣工时间", "", simpleDateFormat.format(old.getEndDate()), simpleDateFormat.format(subInfo.getEndDate()), null, userVO.getLoginName(), new Date(), "修改");
                 }
@@ -1688,7 +1689,7 @@ public class SubInfoServiceImpl implements SubInfoService {
             }
 
             //修改建设地点 对应修改审批单位
-            DetachedCriteria detachedCriteria = DetachedCriteria.forClass(SubPreNew.class);
+   /*         DetachedCriteria detachedCriteria = DetachedCriteria.forClass(SubPreNew.class);
             Criterion criterion = Restrictions.and(Restrictions.eq("subId", old.getId()));
             detachedCriteria.add(criterion);
             List<SubPreNew> lst = subPreNewDao.find(detachedCriteria);
@@ -1704,7 +1705,8 @@ public class SubInfoServiceImpl implements SubInfoService {
                       }
                 }
                 lst.get(i).setStatus(subInfo.getStatus());
-            }
+            }*/
+
 
 
             subInfo.setLastUpdateTime(new Date());
@@ -1712,7 +1714,7 @@ public class SubInfoServiceImpl implements SubInfoService {
             BeanUtils.copyProperties(subInfo, old);
             subInfoDao.update(old);
 
-            // 资金来源
+            //资金来源
             List<SubSourceVO> amtSource = subInfo.getSubSource();
             if (CollectionUtil.isNotEmpty(amtSource)) {
                 List<SubSource> saveData = new ArrayList<>();
@@ -3099,12 +3101,7 @@ public class SubInfoServiceImpl implements SubInfoService {
     }
 
     @Override
-    public Page pageQueryRreDepartment(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
-
-        // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
-        String subIdFilter = subInfoIds.stream()
-                .map(id -> "'" + id + "'") // 每个 id 加上单引号
-                .collect(Collectors.joining(", ")); // 逗号拼接
+    public Page pageQueryRreDepartment(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
 
         if (StringUtil.isEmpty(queryVO.getBeginDate())) {
             queryVO.setBeginDate("200001");  //默认设置一个开始时间
@@ -3221,7 +3218,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >= 1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3254,7 +3251,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t\tAND o.status_conf >= 1 \n" +
                 "\t\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3281,7 +3278,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >=1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3334,12 +3331,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
 
     @Override
-    public Page pageQueryRreFile(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
-
-        // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
-        String subIdFilter = subInfoIds.stream()
-                .map(id -> "'" + id + "'") // 每个 id 加上单引号
-                .collect(Collectors.joining(", ")); // 逗号拼接
+    public Page pageQueryRreFile(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
 
         if (StringUtil.isEmpty(queryVO.getBeginDate())) {
             queryVO.setBeginDate("200001");  //默认设置一个开始时间
@@ -3430,7 +3422,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\tWHERE\n" +
                 "\t\to.`status` =1 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND o.status_conf >=1 \n" +
                 "\t\tAND o.status_conf !=3 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
@@ -3456,7 +3448,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >= 1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3488,7 +3480,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t\tAND o.status_conf >= 1 \n" +
                 "\t\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3516,7 +3508,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >=1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3534,13 +3526,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
 
     @Override
-    public Page pageQueryRreProject(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
-
-        // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
-        String subIdFilter = subInfoIds.stream()
-                .map(id -> "'" + id + "'") // 每个 id 加上单引号
-                .collect(Collectors.joining(", ")); // 逗号拼接
-
+    public Page pageQueryRreProject(Page page, SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
 
         if (StringUtil.isEmpty(queryVO.getBeginDate())) {
             queryVO.setBeginDate("200001");  //默认设置一个开始时间
@@ -3607,8 +3593,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tWHERE\n" +
                 "\t\t\to.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
-                " AND s.id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3646,8 +3631,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t\t\tAND o.status_conf != 3 \n" +
                 "\t\t\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
-                " AND s.id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3662,7 +3646,6 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t) file ON a.id = file.sub_id \n" +
                 "\tWHERE\n" +
                 "\t\ta.logic_delete_flag = 0 \n" +
-                " AND a.id IN (" + subIdFilter + ")" +
                 "\t) a \n" +
                 "WHERE\n" +
                 "\ta.sub_id IS NOT NULL");
@@ -3676,12 +3659,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
 
     @Override
-    public Object sumDepartment(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
-
-        // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
-        String subIdFilter = subInfoIds.stream()
-                .map(id -> "'" + id + "'") // 每个 id 加上单引号
-                .collect(Collectors.joining(", ")); // 逗号拼接
+    public Object sumDepartment(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
 
         if (StringUtil.isEmpty(queryVO.getBeginDate())) {
             queryVO.setBeginDate("200001");  //默认设置一个开始时间
@@ -3795,7 +3773,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\tWHERE\n" +
                 "\t\to.`status` =1 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND o.status_conf >=1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
@@ -3820,7 +3798,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >= 1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3853,7 +3831,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t\tAND o.status_conf >= 1 \n" +
                 "\t\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3880,7 +3858,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >=1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -3899,12 +3877,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
 
     @Override
-    public Object sumFile(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
-
-        // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
-        String subIdFilter = subInfoIds.stream()
-                .map(id -> "'" + id + "'") // 每个 id 加上单引号
-                .collect(Collectors.joining(", ")); // 逗号拼接
+    public Object sumFile(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
 
         if (StringUtil.isEmpty(queryVO.getBeginDate())) {
             queryVO.setBeginDate("200001");  //默认设置一个开始时间
@@ -4020,7 +3993,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >=1 \n" +
                 "\t\tAND o.status_conf !=3 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
@@ -4044,7 +4017,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >= 1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getTBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getTEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -4076,7 +4049,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t\tAND o.status_conf >= 1 \n" +
                 "\t\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -4103,7 +4076,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND o.status_conf >=1 \n" +
                 "\t\tAND o.logic_delete_flag = 0 \n" +
                 " \t\t  and o.sub_unit_id is not null" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getHBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getHEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
@@ -4121,12 +4094,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
 
     @Override
-    public Object sumProject(SubinfoPreQueryVo queryVO, LoginUserVO loginUser, List<String> subInfoIds) throws Exception {
-
-        // 将 List 转换为 SQL 中的 IN 语句---只查询工信局项目库中的数据
-        String subIdFilter = subInfoIds.stream()
-                .map(id -> "'" + id + "'") // 每个 id 加上单引号
-                .collect(Collectors.joining(", ")); // 逗号拼接
+    public Object sumProject(SubinfoPreQueryVo queryVO, LoginUserVO loginUser) throws Exception {
 
         if (StringUtil.isEmpty(queryVO.getBeginDate())) {
             queryVO.setBeginDate("200001");  //默认设置一个开始时间
@@ -4179,7 +4147,6 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
-                "\t\tAND s.id IN (" + subIdFilter + ") \n" +  // 添加筛选条件
                 "\t\t\tGROUP BY\n" +
                 "\t\t\t\tsub_id,\n" +
                 "\t\t\t\tsub_unit_id \n" +
@@ -4195,7 +4162,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t\ta.sub_name title,\n" +
                 "\t\t\tbt.cqNum,\n" +
                 "\t\t\tbt.doNum,\n" +
-                "   bt.doingCqNum,bt.doingCqjNum, " +
+                "   bt.doingCqNum,bt.doingCqjNum, "+
                 "\t\t\tbt.doTime,\n" +
                 "\t\t\tbt.finshNum,\n" +
                 "\t\t\tbt.needNum,\n" +
@@ -4255,17 +4222,15 @@ public class SubInfoServiceImpl implements SubInfoService {
                 "\t\t\tWHERE\n" +
                 "\t\t\t\to.logic_delete_flag = 0 \n" +
                 "\t\t\t\tAND o.sub_unit_id IS NOT NULL \n" +
-                " AND o.sub_id IN (" + subIdFilter + ")" +
+                " AND EXISTS ( SELECT 1 FROM sub_info s where s.id = o.sub_id ) " +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )>= \"" + queryVO.getBeginDate() + "\" \n" +
                 "\t\tAND DATE_FORMAT( o.date_plan, \"%Y%m\" )<= \"" + queryVO.getEndDate() + "\" \n" +
                 this.getWhereSql(queryVO) +
-                "\t\t\tAND s.id IN (" + subIdFilter + ") \n" +  // 添加筛选条件
                 "\t\t\tGROUP BY\n" +
                 "\t\t\t\to.sub_id \n" +
                 "\t\t\t) bt ON a.id = bt.sub_id \n" +
                 "\t\tWHERE\n" +
                 "\t\t\ta.logic_delete_flag = 0 \n" +
-                "\t\t\tAND a.id IN (" + subIdFilter + ") \n" +  // 添加筛选条件
                 "\t\t) a \n" +
                 "\tWHERE\n" +
                 "\ta.sub_id IS NOT NULL \n" +
@@ -4370,7 +4335,7 @@ public class SubInfoServiceImpl implements SubInfoService {
                     update = true;
                     subInfo = subInfoDao.getBySubName(vo.getSubName().trim());
                 }
-                if (!update) {
+                if(!update) {
                     subInfo.setSubCode(vo.getSubCode());
                     /*    subInfo.setStateFix(stateFix);*/
                     subInfo.setPropKind(stateFix);
@@ -4455,10 +4420,10 @@ public class SubInfoServiceImpl implements SubInfoService {
                     subAmtPlanDao.deleteAmtPlanBySubId(subInfo.getId());
                 }*/
                 if (update) {
-                    subAmtPlanDao.deleteAmtPlanBySubId(subInfo.getId(), fixYear);
+                    subAmtPlanDao.deleteAmtPlanBySubId(subInfo.getId(),fixYear);
                 }
                 //保存资金来源
-                if (!update) {
+                if(!update) {
                     if (StringUtils.isNotBlank(vo.getZyyszj())) {
                         SubSource subSource = new SubSource();
                         subSource.setId(Identities.uuid());
@@ -4676,9 +4641,9 @@ public class SubInfoServiceImpl implements SubInfoService {
                 labelList.add(subLabel);
             });
             subLabelDao.saveAll(labelList);
-        } else {
-            List<SubLabel> list = subLabelDao.findByCon(vo);
-            for (int i = 0; i < list.size(); i++) {
+        }else{
+            List<SubLabel> list= subLabelDao.findByCon(vo);
+            for (int i = 0; i <list.size() ; i++) {
                 list.get(i).setLogicDeleteFlag(1);
             }
             subLabelDao.saveOrUpdateAll(list);
@@ -4687,15 +4652,15 @@ public class SubInfoServiceImpl implements SubInfoService {
         return msg;
     }
 
-    public void addLabelS(SubLabelAddVO vo, List lst) {
+    public void addLabelS(SubLabelAddVO vo,List lst) {
         for (int i = 0; i < lst.size(); i++) {
-            Map<String, Object> map = (Map<String, Object>) lst.get(i);
+            Map<String, Object> map = (Map<String, Object>)lst.get(i);
             List<String> labelIdList = vo.getLabelIdList();
             if (CollectionUtil.isNotEmpty(labelIdList)) {
 
                 List<SubLabel> labelList = new ArrayList<SubLabel>();
                 labelIdList.stream().forEach(e -> {
-                    subLabelDao.delByCon(map.get("id").toString(), e);
+                    subLabelDao.delByCon(map.get("id").toString(),e);
                     SubLabel subLabel = new SubLabel();
                     subLabel.setId(Identities.uuid());
                     subLabel.setSubId(map.get("id").toString());

+ 25 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/vo/SubFixCbVo.java

@@ -0,0 +1,25 @@
+package com.rtrh.projects.modules.projects.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+// 重点项目-储备库
+@Data
+public class SubFixCbVo {
+
+    private  String id;     // id
+
+    private  String subName;    //项目名称
+
+    private  String subjectId;      //项目所在地
+
+    private  String content;   //项目建设内容
+
+    private BigDecimal amtTotal;  //计划总投资(万元)
+
+    private  String progress;     //项目进展情况
+
+    private  String remark;   //项目备注
+
+}

+ 6 - 10
projects/src/main/java/com/rtrh/projects/outapi/controller/projects/ProjectsApiController.java

@@ -1384,14 +1384,12 @@ public class ProjectsApiController extends BaseOutApiController {
     public JsonResult pageQueryRreDepartment(@RequestBody Page page, @RequestBody SubinfoPreQueryVo queryVO) {
         JsonResult result = new JsonResult();
         try {
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
             Page pageData = new Page();
             //1按部门  2 按手续 3 按项目
             List<HashMap<String, Object>> list = new ArrayList<>();
             switch (queryVO.getCat()) {
                 case "1":
-                    pageData = subInfoService.pageQueryRreDepartment(page, queryVO, getCurrUser(), subInfoIds);
+                    pageData = subInfoService.pageQueryRreDepartment(page, queryVO, getCurrUser());
                     list = pageData.getList();
                     for (int i = 0; i < list.size(); i++) {
                         List lst = new ArrayList();
@@ -1403,7 +1401,7 @@ public class ProjectsApiController extends BaseOutApiController {
                     }
                     break;
                 case "2":
-                    pageData = subInfoService.pageQueryRreFile(page, queryVO, getCurrUser(), subInfoIds);
+                    pageData = subInfoService.pageQueryRreFile(page, queryVO, getCurrUser());
                     list = pageData.getList();
                     for (int i = 0; i < list.size(); i++) {
                         List lst = new ArrayList();
@@ -1415,7 +1413,7 @@ public class ProjectsApiController extends BaseOutApiController {
                     }
                     break;
                 case "3":
-                    pageData = subInfoService.pageQueryRreProject(page, queryVO, getCurrUser(), subInfoIds);
+                    pageData = subInfoService.pageQueryRreProject(page, queryVO, getCurrUser());
                     list = pageData.getList();
                     for (int i = 0; i < list.size(); i++) {
                         List lst = new ArrayList();
@@ -1452,18 +1450,16 @@ public class ProjectsApiController extends BaseOutApiController {
         JsonResult result = new JsonResult();
         try {
             Object pageData = new Object();
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
             //1按部门  2 按手续 3 按项目
             switch (queryVO.getCat()) {
                 case "1":
-                    pageData = subInfoService.sumDepartment(queryVO, getCurrUser(), subInfoIds);
+                    pageData = subInfoService.sumDepartment(queryVO, getCurrUser());
                     break;
                 case "2":
-                    pageData = subInfoService.sumFile(queryVO, getCurrUser(), subInfoIds);
+                    pageData = subInfoService.sumFile(queryVO, getCurrUser());
                     break;
                 case "3":
-                    pageData = subInfoService.sumProject(queryVO, getCurrUser(), subInfoIds);
+                    pageData = subInfoService.sumProject(queryVO, getCurrUser());
                     break;
             }
             result.setData("list", pageData);

+ 3 - 3
projects/src/main/java/com/rtrh/projects/web/controller/subject/SubInfoController.java

@@ -219,11 +219,11 @@ public class SubInfoController extends BaseController {
             //默认为重点项目台账
             type = "1";
         }
-        model.put("HYFL", tSysTableService.getByKind(SysTableKind.HYFL));
+        model.put("HYFL", tSysTableService.getByKind(SysTableKind.HYFL));   //行业分类
         model.put("ZJLY", tSysTableService.getByKind(SysTableKind.ZJLY));
-        model.put("XMLX", tSysTableService.getByKind(SysTableKind.XMLX));
+        model.put("XMLX", tSysTableService.getByKind(SysTableKind.XMLX));   //项目类型
         model.put("JSXZ", tSysTableService.getByKind(SysTableKind.JSXZ));
-        model.put("JSDD", tSysTableService.getByKind(SysTableKind.JSDD));
+        model.put("JSDD", tSysTableService.getByKind(SysTableKind.JSDD));   //项目属地
         model.put("TZXZ", tSysTableService.getByKind(SysTableKind.TZXZ));
         model.put("HYDW", jUnitService.getUnitByKind(JUnitKind.ZFDW));
         model.put("BQ", tSysTableService.getByKind(SysTableKind.BQ));

+ 9 - 23
projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoApiController.java

@@ -157,10 +157,8 @@ public class SubInfoApiController extends BaseController {
         try {
             String currUnitId = null;
             currUnitId = getCurUser().getUnitId();
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
             Page pageData = subInfoService.pageQueryReportListSql(page, getCurUser().getLoginUser(), queryVO.getSubName(), currUnitId,
-                    null, queryVO.getStatus(), null, null, null, queryVO.getBeginDate(), queryVO.getEndDate(),  subInfoIds);
+                    null, queryVO.getStatus(), null, null, null, queryVO.getBeginDate(), queryVO.getEndDate());
             message.add(pageData.getList(), pageData.getTotalCount());
         } catch (Exception e) {
             logger.error("", e);
@@ -870,7 +868,7 @@ public class SubInfoApiController extends BaseController {
                 SubInfo subinfo = subInfoDao.findById(vo.getSubId());
 
                 subDataLogService.saveFeild("STRING", "储备库", "在建库", getCurUser().getLoginUser(), vo.getSubId(), "is_hide", "修改为在建库", SubLogEnum.XMXX.getCode());
-               // subDataLogService.saveFeild("STRING", "正常", "重点", getCurUser().getLoginUser(), vo.getSubId(), "is_hide", "修改为在建库", SubLogEnum.XMXX.getCode());
+                // subDataLogService.saveFeild("STRING", "正常", "重点", getCurUser().getLoginUser(), vo.getSubId(), "is_hide", "修改为在建库", SubLogEnum.XMXX.getCode());
 /*
                 subinfo.setIsHide("1");*/
                 subinfo.setStatus("7");
@@ -1176,9 +1174,7 @@ public class SubInfoApiController extends BaseController {
     public ListMessage pageQueryRreDepartment(@RequestBody Page page, @RequestBody SubinfoPreQueryVo queryVO) {
         ListMessage message = new ListMessage();
         try {
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
-            Page pageData = subInfoService.pageQueryRreDepartment(page, queryVO, getCurUser().getLoginUser(), subInfoIds);
+            Page pageData = subInfoService.pageQueryRreDepartment(page, queryVO, getCurUser().getLoginUser());
             message.add(pageData.getList(), pageData.getTotalCount());
         } catch (Exception e) {
             logger.error("", e);
@@ -1199,9 +1195,7 @@ public class SubInfoApiController extends BaseController {
     public Message sumDepartment(@RequestBody SubinfoPreQueryVo queryVO) {
         Message message = new Message();
         try {
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
-            Object object = subInfoService.sumDepartment(queryVO, getCurUser().getLoginUser(), subInfoIds);
+            Object object = subInfoService.sumDepartment(queryVO, getCurUser().getLoginUser());
             message.setData(object);
         } catch (Exception e) {
             logger.error("", e);
@@ -1221,9 +1215,7 @@ public class SubInfoApiController extends BaseController {
     public Message sumFile(@RequestBody SubinfoPreQueryVo queryVO) {
         Message message = new Message();
         try {
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
-            Object object = subInfoService.sumFile(queryVO, getCurUser().getLoginUser(), subInfoIds);
+            Object object = subInfoService.sumFile(queryVO, getCurUser().getLoginUser());
             message.setData(object);
         } catch (Exception e) {
             logger.error("", e);
@@ -1243,9 +1235,7 @@ public class SubInfoApiController extends BaseController {
     public Message sumProject(@RequestBody SubinfoPreQueryVo queryVO) {
         Message message = new Message();
         try {
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
-            Object object = subInfoService.sumProject(queryVO, getCurUser().getLoginUser(), subInfoIds);
+            Object object = subInfoService.sumProject(queryVO, getCurUser().getLoginUser());
             message.setData(object);
         } catch (Exception e) {
             logger.error("", e);
@@ -1265,9 +1255,7 @@ public class SubInfoApiController extends BaseController {
     public ListMessage pageQueryRreFile(@RequestBody Page page, @RequestBody SubinfoPreQueryVo queryVO) {
         ListMessage message = new ListMessage();
         try {
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
-            Page pageData = subInfoService.pageQueryRreFile(page, queryVO, getCurUser().getLoginUser(), subInfoIds);
+            Page pageData = subInfoService.pageQueryRreFile(page, queryVO, getCurUser().getLoginUser());
             message.add(pageData.getList(), pageData.getTotalCount());
         } catch (Exception e) {
             logger.error("", e);
@@ -1288,9 +1276,7 @@ public class SubInfoApiController extends BaseController {
     public ListMessage pageQueryRreProject(@RequestBody Page page, @RequestBody SubinfoPreQueryVo queryVO) {
         ListMessage message = new ListMessage();
         try {
-            // 查询工信局项目列表中所有申报项目
-            List<String> subInfoIds = subInfoService.selectAllSubInfoIds();
-            Page pageData = subInfoService.pageQueryRreProject(page, queryVO, getCurUser().getLoginUser(), subInfoIds);
+            Page pageData = subInfoService.pageQueryRreProject(page, queryVO, getCurUser().getLoginUser());
             message.add(pageData.getList(), pageData.getTotalCount());
         } catch (Exception e) {
             logger.error("", e);
@@ -1352,7 +1338,7 @@ public class SubInfoApiController extends BaseController {
         Message message = new Message();
         Page pageData = subInfoQueryService.pageAll(null, getCurUser().getLoginUser(), vo.getParam());
         if(pageData.getList().size()>0){
-             subInfoService.addLabelS(vo,pageData.getList());
+            subInfoService.addLabelS(vo,pageData.getList());
         }
 /*        List<SubLabel> subLabels = subInfoService.getSubLabels(vo);
         List<String> collect = new ArrayList<>();

+ 37 - 27
projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoQueryApiController.java

@@ -3,12 +3,15 @@ package com.rtrh.projects.web.controller.subject.api;
 import java.math.BigDecimal;
 import java.util.*;
 
+import com.github.pagehelper.PageInfo;
 import com.rtrh.common.util.StringUtil;
 import com.rtrh.projects.modules.projects.dao.SubCompletedPicDao;
 import com.rtrh.projects.modules.projects.dao.SubSourceDao;
+import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
 import com.rtrh.projects.modules.projects.po.SubCompletedPic;
 import com.rtrh.projects.modules.projects.po.SubSource;
 import com.rtrh.projects.modules.projects.vo.StatisticsVO;
+import com.rtrh.projects.modules.projects.vo.SubFixCbVo;
 import com.rtrh.projects.modules.projects.vo.SubSourceVO;
 import com.rtrh.projects.modules.system.enums.SysTableKind;
 import com.rtrh.projects.modules.system.po.TSystable;
@@ -63,39 +66,30 @@ public class SubInfoQueryApiController extends BaseController {
         ListMessage message = new ListMessage();
         try {
             Page pageData = subInfoQueryService.pageAll(page, getCurUser().getLoginUser(), queryVO);
+         /*   for (int i = 0; i < pageData.getList().size(); i++) {
+
+                Map<String, Object> map = (Map<String, Object>) pageData.getList().get(i);
+                //查询资金来源
+                String subId = map.get("id") == null ? "" : map.get("id") + "";
+                map.put("zjlyName", "--");
+                if (StringUtil.isNotEmpty(subId)) {
+                    List<SubSourceVO> list = subSourceDao.findBySubId(subId);
+                    String name = "";
+
+                    for (SubSourceVO subSourceVO : list) {
+                        name = name + (subSourceVO.getSourceName()==null?"--":subSourceVO.getSourceName()) + "</br>";
+                    }
+
+                    map.put("zjlyName", name);
+                }
+            }*/
+
             message.add(pageData.getList(), pageData.getTotalCount());
         } catch (Exception e) {
             logger.error("", e);
             message.add("查询失败");
         }
         return message;
-        // ListMessage message = new ListMessage();
-        // try {
-        //     Page pageData = subInfoQueryService.pageAll(page, getCurUser().getLoginUser(), queryVO);
-        //  /*   for (int i = 0; i < pageData.getList().size(); i++) {
-        //
-        //         Map<String, Object> map = (Map<String, Object>) pageData.getList().get(i);
-        //         //查询资金来源
-        //         String subId = map.get("id") == null ? "" : map.get("id") + "";
-        //         map.put("zjlyName", "--");
-        //         if (StringUtil.isNotEmpty(subId)) {
-        //             List<SubSourceVO> list = subSourceDao.findBySubId(subId);
-        //             String name = "";
-        //
-        //             for (SubSourceVO subSourceVO : list) {
-        //                 name = name + (subSourceVO.getSourceName()==null?"--":subSourceVO.getSourceName()) + "</br>";
-        //             }
-        //
-        //             map.put("zjlyName", name);
-        //         }
-        //     }*/
-        //
-        //     message.add(pageData.getList(), pageData.getTotalCount());
-        // } catch (Exception e) {
-        //     logger.error("", e);
-        //     message.add("查询失败");
-        // }
-        // return message;
     }
 
     // 查询项目
@@ -112,6 +106,22 @@ public class SubInfoQueryApiController extends BaseController {
         return message;
     }
 
+
+    // 获取重点项目-储备库列表数据
+    @PostMapping("subFixCbAll")
+    public ListMessage subFixCbAll(@RequestBody SubFixCbSearch subFixCbSearch) {
+        ListMessage message = new ListMessage();
+        try {
+            Page pageData = subInfoQueryService.subFixCbAll(subFixCbSearch);
+            message.add(pageData.getList(), pageData.getTotalCount());
+        } catch (Exception e) {
+            logger.error("", e);
+            message.add("查询失败");
+        }
+        return message;
+    }
+
+
     @PostMapping("getSubCompletedPicBySubId")
     public ListMessage getSubCompletedPicBySubId(@RequestBody List<String> subIds) {
         ListMessage message = new ListMessage();

+ 9 - 6
projects/src/main/resources/dbconfig.properties

@@ -1,8 +1,5 @@
 #datasource config
-jdbc.secondary.driver=com.mysql.jdbc.Driver
-jdbc.secondary.url=jdbc:mysql://139.155.7.62:3306/subject_old?useUnicode=true&useSSL=false&characterEncoding=UTF-8&autoReconnect=true
-jdbc.secondary.username=root
-jdbc.secondary.password=Chaoliu@0917!@#
+
 #jdbc.url=jdbc:mysql://8.137.121.180:3306/subject?useUnicode=true&useSSL=false&characterEncoding=UTF-8&autoReconnect=true
 #jdbc.password=287988448lp5421
 
@@ -13,8 +10,14 @@ jdbc.secondary.password=Chaoliu@0917!@#
 #jdbc.password=123456
 ##rtrhcrmdb
 
-#??????
+#\u4E3B\u6570\u636E\u6E90\uFF0C\u9ED8\u8BA4\u67E5\u8BE2\u8FD9\u4E2A\u5E93
 jdbc.driver=com.mysql.jdbc.Driver
 jdbc.url=jdbc:mysql://139.155.7.62:3306/subject_gxj?useUnicode=true&useSSL=false&characterEncoding=UTF-8&autoReconnect=true
 jdbc.username=root
-jdbc.password=Chaoliu@0917!@#
+jdbc.password=Chaoliu@0917!@#
+
+#\u4ECE\u6570\u636E\u6E90\uFF0C\u5728mybatis\u67E5\u8BE2\u7684\u65B9\u6CD5\u4E0A\u6DFB\u52A0\u6CE8\u89E3@TargetDataSource("secondary")\u5219\u4F7F\u7528\u8BE5\u6570\u636E\u6E90\u8FDB\u884C\u67E5\u8BE2
+jdbc.secondary.driver=com.mysql.jdbc.Driver
+jdbc.secondary.url=jdbc:mysql://139.155.7.62:3306/subject_old?useUnicode=true&useSSL=false&characterEncoding=UTF-8&autoReconnect=true
+jdbc.secondary.username=root
+jdbc.secondary.password=Chaoliu@0917!@#