Ver Fonte

项目前期管理回滚到之前的状态

Wayne há 4 meses atrás
pai
commit
b8424f04da

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

@@ -43,12 +43,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);
 
 
 
@@ -67,7 +67,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);
 
 	/**
 	 * 保存项目信息
@@ -149,7 +149,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);
 
 	/**
 	 * 查询项目核准备案
@@ -177,7 +177,7 @@ public interface SubInfoService {
 	 * @return
 	 */
 	Page pageQueryPre(Page page, LoginUserVO vo, String subName, String kind,
-					 String propKind, String indusKind);
+					  String propKind, String indusKind);
 
 	/**
 	 * 更新项目状态为关闭,当项目审批状态为未通过时
@@ -370,22 +370,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 ;
 
@@ -395,6 +395,4 @@ public interface SubInfoService {
 	List<SubLabel> getSubLabels(SubLabelAddVO vo);
 
 	void addLabelS(SubLabelAddVO vo, List list);
-
-	List<String> selectAllSubInfoIds();
 }

+ 26 - 81
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;
@@ -1025,7 +1024,7 @@ public class SubInfoServiceImpl implements SubInfoService {
 
     @Override
     public 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) {
 
         StringBuffer sql = new StringBuffer();
         sql.append(" select a.id,a.status ,a.sub_name subName,a.amt_total amtTotal,a.begin_date beginDate,a.end_date endDate,ju.title unitName,ts.title subjectName, ts1.title indusKindName   ");
@@ -1039,17 +1038,6 @@ public class SubInfoServiceImpl implements SubInfoService {
 
         sql.append(" where a.logic_delete_flag =0 ");
 
-        // 处理 subInfoIds 参数
-        if (subInfoIds != null && !subInfoIds.isEmpty()) {
-            String idListStr = subInfoIds.stream()
-                    .map(id -> "'" + id + "'") // 每个 ID 加单引号
-                    .collect(Collectors.joining(","));
-            sql.append(" and a.id in (").append(idListStr).append(") ");
-        }else {
-            sql.append(" and a.id in ( ) ");
-        }
-
-
 
         //2024-03-28客户提出admin用户需查询和储备台账一样的数据
         SecRole role = secRoleDao.findById(loginUserVO.getKind());
@@ -3102,12 +3090,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");  //默认设置一个开始时间
@@ -3198,7 +3181,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" +
@@ -3224,7 +3207,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) +
@@ -3257,7 +3240,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) +
@@ -3284,7 +3267,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) +
@@ -3337,12 +3320,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");  //默认设置一个开始时间
@@ -3433,7 +3411,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" +
@@ -3459,7 +3437,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) +
@@ -3491,7 +3469,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) +
@@ -3519,7 +3497,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) +
@@ -3537,13 +3515,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");  //默认设置一个开始时间
@@ -3610,8 +3582,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) +
@@ -3649,8 +3620,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) +
@@ -3665,7 +3635,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");
@@ -3679,12 +3648,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");  //默认设置一个开始时间
@@ -3798,7 +3762,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" +
@@ -3823,7 +3787,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) +
@@ -3856,7 +3820,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) +
@@ -3883,7 +3847,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) +
@@ -3902,12 +3866,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");  //默认设置一个开始时间
@@ -4023,7 +3982,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" +
@@ -4047,7 +4006,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) +
@@ -4079,7 +4038,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) +
@@ -4106,7 +4065,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) +
@@ -4124,12 +4083,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");  //默认设置一个开始时间
@@ -4182,7 +4136,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" +
@@ -4258,17 +4211,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" +
@@ -4712,12 +4663,6 @@ public class SubInfoServiceImpl implements SubInfoService {
         }
     }
 
-    @TargetDataSource("secondary")
-    @Override
-    public List<String> selectAllSubInfoIds() {
-        return subInfoMapper.selectAllSubInfoIds();
-    }
-
 
     public List<SubLabel> getSubLabels(SubLabelAddVO vo) {
         List<SubLabel> labelList = subLabelDao.findByCon(vo);

+ 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<>();

+ 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!@#