JiangPengLi 3 mesiacov pred
rodič
commit
b0a3b867ec
16 zmenil súbory, kde vykonal 481 pridanie a 319 odobranie
  1. 1 1
      projects-service/src/main/java/com/rtrh/projects/modules/projects/enums/SubInfoStatusEnum.java
  2. 3 2
      projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/LogOperateMapper.xml
  3. 12 1
      projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml
  4. 5 1
      projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java
  5. 308 307
      projects-service/src/main/java/com/rtrh/projects/modules/projects/vo/SubInfoQueryTzVO.java
  6. 43 0
      projects-service/src/main/java/com/rtrh/projects/modules/rolemeun/dao/SecUserAuthDao.java
  7. 16 0
      projects-service/src/main/java/com/rtrh/projects/modules/rolemeun/po/SecUserAuth.hbm.xml
  8. 27 0
      projects-service/src/main/java/com/rtrh/projects/modules/rolemeun/po/SecUserAuth.java
  9. 1 0
      projects-service/src/main/java/com/rtrh/projects/modules/system/po/SecUser.hbm.xml
  10. 14 0
      projects-service/src/main/java/com/rtrh/projects/modules/system/po/SecUser.java
  11. 5 0
      projects-service/src/main/java/com/rtrh/projects/modules/system/vo/LoginUserVO.java
  12. 20 0
      projects/src/main/java/com/rtrh/projects/web/controller/BaseController.java
  13. 9 7
      projects/src/main/java/com/rtrh/projects/web/controller/passport/LoginController.java
  14. 8 0
      projects/src/main/java/com/rtrh/projects/web/controller/subject/SubInfoExportController.java
  15. 8 0
      projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoQueryApiController.java
  16. 1 0
      projects/src/main/java/com/team/security/TeamShiroUser.java

+ 1 - 1
projects-service/src/main/java/com/rtrh/projects/modules/projects/enums/SubInfoStatusEnum.java

@@ -25,7 +25,7 @@ public enum SubInfoStatusEnum {
     public static SubInfoStatusEnum getEnum(String code) {
         return Arrays.stream(values()).filter(x -> x.code.equals(code)).findFirst().orElse(null);
     }
-    public static String getMessage(String code) {
+    public static String getDesc(String code) {
         SubInfoStatusEnum anEnum = getEnum(code);
         return anEnum != null ? getEnum(code).desc : null;
     }

+ 3 - 2
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/LogOperateMapper.xml

@@ -7,7 +7,7 @@
     </sql>
     <insert id="save">
         insert into t_log_operate
-            (create_time,create_user_id,create_user_name,status_after,status_first,kind,sub_id,zh_date,logic_delete_flag)
+            (create_time,create_user_id,create_user_name,status_after,status_first,kind,sub_id,zh_date,logic_delete_flag,title)
             values (now(),
                    #{log.createUserId},
                    #{log.createUserName},
@@ -16,7 +16,8 @@
                    #{log.kind},
                    #{log.subId},
                    now(),
-                    0
+                    0,
+                    #{log.title}
                     )
     </insert>
 

+ 12 - 1
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml

@@ -187,6 +187,12 @@
             <if test="vo.subjectId!=null and vo.subjectId!=''">
                 and s.subject_id = #{vo.subjectId}
             </if>
+            <if test="vo.subjectAuthIds!=null and vo.subjectAuthIds.size()>0">
+                and s.subject_id in
+                <foreach collection="vo.subjectAuthIds" item="id" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+            </if>
             <if test="vo.indusKind!=null and vo.indusKind!=''">
                 <if test='vo.indusKind != "UNKNOWN_INDUS_KIND"'>
                     and s.indus_kind like CONCAT(#{vo.indusKind}, '%')
@@ -195,7 +201,6 @@
                     AND ISNULL(s.indus_kind)
                 </if>
             </if>
-
             <if test="vo.startAmt!=null and vo.startAmt!=''">
                 and s.amt_total >= #{vo.startAmt}
             </if>
@@ -274,6 +279,12 @@
             <if test="vo.status!=null and vo.status!=''">
                 and status = #{vo.status}
             </if>
+            <if test="vo.subjectAuthIds!=null and vo.subjectAuthIds.size()>0">
+                and subject_id in
+                <foreach collection="vo.subjectAuthIds" item="id" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+            </if>
             <if test="vo.abc!=null and vo.abc!=''">
                 <choose>
                     <when test='vo.abc.toString() =="UNKNOWN_CATEGORY"'>

+ 5 - 1
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java

@@ -5324,13 +5324,16 @@ public class SubInfoServiceImpl implements SubInfoService {
     @Override
     public boolean moveDb(MoveDbParamVo vo,LoginUserVO userVO) {
         SubInfo subinfo = subInfoDao.findById(vo.getId());
+        if (vo.getStatus().equals(subinfo.getStatus())){
+            return false;
+        }
         if (StringUtils.isNotBlank(subinfo.getStatus())){
             Map<String,String> map = new HashMap<String,String>(){{
                 put(SubInfoStatusEnum.XJ.getCode(),"xj_date");
                 put(SubInfoStatusEnum.ZJ.getCode(),"zj_date");
                 put(SubInfoStatusEnum.TC.getCode(),"tc_date");
             }};
-            // todo 移库日志
+            // 移库日志
             LogOperate logOperate = new LogOperate();
             logOperate.setCreateUserId(userVO.getId());
             logOperate.setCreateUserName(userVO.getLoginName());
@@ -5338,6 +5341,7 @@ public class SubInfoServiceImpl implements SubInfoService {
             logOperate.setStatusFirst(subinfo.getStatus());
             logOperate.setSubId(vo.getId());
             logOperate.setKind(Integer.parseInt(vo.getStatus()) > Integer.parseInt(subinfo.getStatus()) ? "1" : "0");
+            logOperate.setTitle(String.format("%s转%s",SubInfoStatusEnum.getDesc(subinfo.getStatus()),SubInfoStatusEnum.getDesc(vo.getStatus())));
             logOperateService.save(logOperate);
             if (!SubInfoStatusEnum.CB.getCode().equals(vo.getStatus())){
                 String sql = String.format("update sub_info set status='%s',%s=now() where id='%s'", vo.getStatus(), map.get(vo.getStatus()), vo.getId());

+ 308 - 307
projects-service/src/main/java/com/rtrh/projects/modules/projects/vo/SubInfoQueryTzVO.java

@@ -8,359 +8,360 @@ import lombok.Setter;
 
 /**
  * 查询台账条件
- * @author PENG
  *
+ * @author PENG
  */
 @Setter
 @Getter
 public class SubInfoQueryTzVO {
 
-	/**
-	 * 项目名称
-	 */
-	private String subName;
-	/**
-	 * 项目类型
-	 */
-	private String kind;
-	/**
-	 * 建设地址
-	 */
-	private String subjectId;
-
-	/**
-	 * 项目编号
-	 */
-	private String amtTo;
-	/**
-	 * 申请投向
-	 */
-	private String applyCode;
-	/**
-	 * 建设性质
-	 */
-	private String propKind;
-	/**
-	 * 所属行业
-	 */
-	private String indusKind;
-	/**
-	 * 项目状态
-	 */
-	private String status;
-	/**
-	 * 查询时间类型
-	 */
-	private String queryTimeType;
-	/**
-	 * 开始时间
-	 */
-	private String beginDate;
-	/**
-	 * 结束时间
-	 */
-	private String endDate;
-	/**
-	 * 最小金额
-	 */
-	private String startAmt;
-	/**
-	 * 最大金额
-	 */
-	private String endAmt;
-	/**
-	 * 行业单位
-	 */
-	private String hydw;
-	/**
-	 * 项目单位
-	 */
-	private String sbdw;
-	/**
-	 * 是否去除临存项目
-	 */
-	private Boolean neTemp;
-	/**
-	 * 是否在建
-	 */
-	private String isZj;
-	/**
-	 * 其他项目状态
-	 */
-	private String otherStatus;
-	/**
-	 * 完成金额占比起始
-	 */
-	private BigDecimal endBl;
-	/**
-	 * 完成金额占比结束
-	 */
-	private BigDecimal endBlPlus;
-	/**
-	 * 年份
-	 */
-	private String year;
-
-	/**
-	 * 年固定投资类型
-	 */
-	private String fixCat;
-
-	/**
-	 * 资金申报年份
-	 */
-	private String zjYear;
-
-	/**
-	 * 资金来源
-	 */
-	private String zjly;
-	/**
-	 * 灯色
-	 */
-	private String light;
-	/**
-	 * 建设内容
-	 */
-	private String content;
-
-	/**
-	 * 是否分管项目
-	 */
-	private Boolean blSub;
-
-	/**
-	 * 投资类型
-	 */
-	private String kindNature;
-
-	/**
-	 * 是否是app查询
-	 */
-	private Boolean app;
-
-	/**
-	 * 是否关注
-	 */
-	private Boolean attention;
-
-	/**
-	 * 查询类型
-	 * 0-全部项目 1-重点项目 2-在建项目 3-储备项目 4-竣工项目
-	 */
-	private String queryType;
-	/**
-	 *
-	 * 是否隐藏   1隐藏  0不隐藏
-	 */
-	private String isHide;
-
-
-	/**
-	 * 排序类型
-	 */
-	private String sortField;
-
-
-	/**
-	 * 排序方式
-	 */
-	private String sortType;
-
-
-	/**
-	 * 领导姓名
-	 */
-	private String leaderName;
-
-
-	/**
-	 * abc
-	 */
-	private String abc;
-
-
-	/**
-	 * 项 目进度范围 最小
-	 */
-	private BigDecimal numBlMin;
-
-
-	/**
-	 * 项 目进度范围 最大
-	 */
-	private BigDecimal numBlMax;
-
-	/**
-	 * 不是本年度内的项目
-	 */
-	private Boolean notTargetYear;
-
-
-	/**
-	 * 最小偏离度 判断红黄灯
-	 */
-	private BigDecimal offsetMin;
-
-	/**
-	 * 最大偏离度 判断红黄灯
-	 */
-	private BigDecimal offsetMax;
-
-
-	/**
-	 * 开工红黄灯  判断是否 判断开工红黄灯
-	 */
-	private Boolean openDate;
+    /**
+     * 项目名称
+     */
+    private String subName;
+    /**
+     * 项目类型
+     */
+    private String kind;
+    /**
+     * 建设地址
+     */
+    private String subjectId;
+
+    /**
+     * 项目编号
+     */
+    private String amtTo;
+    /**
+     * 申请投向
+     */
+    private String applyCode;
+    /**
+     * 建设性质
+     */
+    private String propKind;
+    /**
+     * 所属行业
+     */
+    private String indusKind;
+    /**
+     * 项目状态
+     */
+    private String status;
+    /**
+     * 查询时间类型
+     */
+    private String queryTimeType;
+    /**
+     * 开始时间
+     */
+    private String beginDate;
+    /**
+     * 结束时间
+     */
+    private String endDate;
+    /**
+     * 最小金额
+     */
+    private String startAmt;
+    /**
+     * 最大金额
+     */
+    private String endAmt;
+    /**
+     * 行业单位
+     */
+    private String hydw;
+    /**
+     * 项目单位
+     */
+    private String sbdw;
+    /**
+     * 是否去除临存项目
+     */
+    private Boolean neTemp;
+    /**
+     * 是否在建
+     */
+    private String isZj;
+    /**
+     * 其他项目状态
+     */
+    private String otherStatus;
+    /**
+     * 完成金额占比起始
+     */
+    private BigDecimal endBl;
+    /**
+     * 完成金额占比结束
+     */
+    private BigDecimal endBlPlus;
+    /**
+     * 年份
+     */
+    private String year;
+
+    /**
+     * 年固定投资类型
+     */
+    private String fixCat;
+
+    /**
+     * 资金申报年份
+     */
+    private String zjYear;
+
+    /**
+     * 资金来源
+     */
+    private String zjly;
+    /**
+     * 灯色
+     */
+    private String light;
+    /**
+     * 建设内容
+     */
+    private String content;
+
+    /**
+     * 是否分管项目
+     */
+    private Boolean blSub;
+
+    /**
+     * 投资类型
+     */
+    private String kindNature;
+
+    /**
+     * 是否是app查询
+     */
+    private Boolean app;
+
+    /**
+     * 是否关注
+     */
+    private Boolean attention;
+
+    /**
+     * 查询类型
+     * 0-全部项目 1-重点项目 2-在建项目 3-储备项目 4-竣工项目
+     */
+    private String queryType;
+    /**
+     * 是否隐藏   1隐藏  0不隐藏
+     */
+    private String isHide;
+
+
+    /**
+     * 排序类型
+     */
+    private String sortField;
+
+
+    /**
+     * 排序方式
+     */
+    private String sortType;
+
+
+    /**
+     * 领导姓名
+     */
+    private String leaderName;
+
+
+    /**
+     * abc
+     */
+    private String abc;
+
+
+    /**
+     * 项 目进度范围 最小
+     */
+    private BigDecimal numBlMin;
+
+
+    /**
+     * 项 目进度范围 最大
+     */
+    private BigDecimal numBlMax;
+
+    /**
+     * 不是本年度内的项目
+     */
+    private Boolean notTargetYear;
+
+
+    /**
+     * 最小偏离度 判断红黄灯
+     */
+    private BigDecimal offsetMin;
 
+    /**
+     * 最大偏离度 判断红黄灯
+     */
+    private BigDecimal offsetMax;
 
-	/***
-	 * 开始月
-	 */
-	private String beginMonth;
 
-	/**
-	 * 结束月
-	 */
-	private String endMonth;
+    /**
+     * 开工红黄灯  判断是否 判断开工红黄灯
+     */
+    private Boolean openDate;
+
+
+    /***
+     * 开始月
+     */
+    private String beginMonth;
+
+    /**
+     * 结束月
+     */
+    private String endMonth;
 
-	/***
-	 * 是否逾期
-	 */
-	private String isYq;
+    /***
+     * 是否逾期
+     */
+    private String isYq;
 
-	/**
-	 * 查询资金类型 amtType 1资金来源  2总金额 3 计划投资 4 实际投资
-	 */
-	private String amtType;
+    /**
+     * 查询资金类型 amtType 1资金来源  2总金额 3 计划投资 4 实际投资
+     */
+    private String amtType;
 
-	/***
-	 * 问题关闭原因 1-约谈企业,2-发督办函,3-专题推进会
-	 */
-	private String closeReason;
+    /***
+     * 问题关闭原因 1-约谈企业,2-发督办函,3-专题推进会
+     */
+    private String closeReason;
 
-	/***
-	 * 问题状态 是否关闭
-	 */
-	private String problemStatus;
+    /***
+     * 问题状态 是否关闭
+     */
+    private String problemStatus;
 
 
-	/***
-	 * 问题类型  项目单位,监管单位
-	 */
-	private String problemType;
+    /***
+     * 问题类型  项目单位,监管单位
+     */
+    private String problemType;
 
-	/**
-	 * 大屏查询   储备项目
-	 */
-	private  Boolean isCb;
+    /**
+     * 大屏查询   储备项目
+     */
+    private Boolean isCb;
 
-	/**
-	 * 项目id  专项查询
-	 */
-	private String subId;
+    /**
+     * 项目id  专项查询
+     */
+    private String subId;
 
 
-	/***
-	 * 月份  在建项目库
-	 */
-	private  String month;
+    /***
+     * 月份  在建项目库
+     */
+    private String month;
 
 
-	/***
-	 * zjlyid  //资金来源id
-	 */
-	private  String zjlyId;
+    /***
+     * zjlyid  //资金来源id
+     */
+    private String zjlyId;
 
 
+    /***
+     * zjlyid  //资金来源id
+     */
+    private Integer dateCat;
 
-	/***
-	 * zjlyid  //资金来源id
-	 */
-	private  Integer  dateCat;
+    /***
+     * isPay  //资金下达情况
+     */
+    private Integer isPay;
 
-	/***
-	 * isPay  //资金下达情况
-	 */
-	private  Integer  isPay;
+    /***
+     * isMajor  //1重点项目  2非重点项目  0或者null 查询全部
+     */
+    private String isMajor;
 
-	/***
-	 * isMajor  //1重点项目  2非重点项目  0或者null 查询全部
-	 */
-	private  String  isMajor;
+    /***
+     * 完成投资
+     */
+    private String finishRate;
 
-	/***
-	 * 完成投资
-	 */
-	private  String  finishRate;
 
+    /***
+     * 项目库  1 储备项目 2 新建项目  3在建项目  4竣工项目
+     */
+    private String subType;
 
-	/***
-	 * 项目库  1 储备项目 2 新建项目  3在建项目  4竣工项目
-	 */
-	private  String  subType;
 
+    /***
+     *  投资查询开始月
+     */
+    private String startMonthTz;
 
-	/***
-	 *  投资查询开始月
-	 */
-	private String startMonthTz;
+    /***
+     * 投资查询结束
+     */
+    private String endMonthTz;
 
-	/***
-	 * 投资查询结束
-	 */
-	private String endMonthTz;
+    /***
+     *  任务查询开始
+     */
+    private String startMonthTask;
 
-	/***
-	 *  任务查询开始
-	 */
-	private String startMonthTask;
+    /***
+     * 任务查询结束
+     */
+    private String endMonthTask;
 
-	/***
-	 * 任务查询结束月
-	 */
-	private String endMonthTask;
+    /***
+     * 申报状态 1未申报 2已申报 3已下达
+     */
+    private String statusSource;
 
-	/***
-	 * 申报状态 1未申报 2已申报 3已下达
-	 */
-	private String statusSource;
+    /***
+     * 申报状态 1申报状态以上的
+     */
+    private String stateZj;
 
-	/***
-	 * 申报状态 1申报状态以上的
-	 */
-	private String stateZj;
+    /**
+     * 年度固定资产项目库项目性质 1新建  2续建 3 储备
+     */
+    private String stateFix;
 
-	/**
-	 * 年度固定资产项目库项目性质 1新建  2续建 3 储备
-	 */
-	private String stateFix;
+    private String isFix;
 
-	private String isFix;
+    private String subLabel;
 
-	private String subLabel;
+    private String subCat;
 
-	private String subCat;
+    private String subYear;
 
-	private String subYear;
+    //穿透数据查询字段
 
-	//穿透数据查询字段
+    //abc类
+    private String abcs;
 
-	//abc类
-	private   String  abcs;
 
+    //投资类型
+    private String kindNatures;
 
-	//投资类型
-	private   String  kindNatures;
 
+    //所属行业
+    private String indusKinds;
+    private List<String> iks;
 
-	//所属行业
-	private  String  indusKinds;
-	private List<String> iks;
+    //建设地点
+    private String subjects;
+    // 年度投资查询
+    private String yearMixAmt;
+    private String yearMaxAmt;
 
-	//建设地点
-	private   String  subjects;
-	// 年度投资查询
-	private   String  yearMixAmt;
-	private   String  yearMaxAmt;
+    // 数据权限
+    private List<String> subjectAuthIds;
 }

+ 43 - 0
projects-service/src/main/java/com/rtrh/projects/modules/rolemeun/dao/SecUserAuthDao.java

@@ -0,0 +1,43 @@
+package com.rtrh.projects.modules.rolemeun.dao;
+
+import com.rtrh.core.repository.hibernate.EntityServiceImpl;
+import com.rtrh.projects.modules.rolemeun.po.SecUserAuth;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.DetachedCriteria;
+import org.hibernate.criterion.Restrictions;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * @author wangsheng
+ * @version 1.0
+ * @description: TODO
+ * @date 2023/6/13 10:04
+ */
+@Service
+public class SecUserAuthDao extends EntityServiceImpl<SecUserAuth> {
+    @Transactional
+    public void deleteByUser(String userId, String cat) {
+        String sql = "update  sec_user_auth set logic_delete_flag=1 where user_id=? and cat=?";
+        this.updateBySql(sql, userId, cat);
+    }
+
+    /**
+     * 查询用户数据权限
+     *
+     * @param userId  用户id
+     * @param cat     类型 1 市区县 2 行业
+     * @return
+     */
+    // public List<SecUserAuth> findListByUserId(String userId, String cat) {
+    public List<SecUserAuth> findListByUserId(String userId) {
+        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(SecUserAuth.class);
+        Criterion criterion = Restrictions.eq("logicDeleteFlag", 0);
+        // criterion = Restrictions.and(criterion, Restrictions.eq("cat", cat));
+        criterion = Restrictions.and(criterion, Restrictions.eq("userId", userId));
+        detachedCriteria.add(criterion);
+        return this.find(detachedCriteria);
+    }
+}

+ 16 - 0
projects-service/src/main/java/com/rtrh/projects/modules/rolemeun/po/SecUserAuth.hbm.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="gb2312"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping package="com.rtrh.projects.modules.rolemeun.po">
+    <class name="SecUserAuth" table="sec_user_auth">
+        <id column="id" name="id" type="java.lang.String"><generator class="assigned"/></id>
+        <property column="user_id" name="userId" not-null="false" type="java.lang.String" />
+        <property column="subject_id" name="subjectId" not-null="false" type="java.lang.String" />
+        <property column="create_time" name="createTime" not-null="false" type="java.util.Date"/>
+        <property column="cat" name="cat" not-null="false" type="java.lang.String" />
+        <property column="remark" name="remark" not-null="false" type="java.lang.String" />
+        <property column="create_user_id" name="createUserId" not-null="false" type="java.lang.String"/>
+        <property column="last_update_user_id" name="lastUpdateUserId" not-null="false" type="java.lang.String"/>
+        <property column="last_update_time" name="lastUpdateTime" not-null="false" type="java.util.Date"/>
+        <property column="logic_delete_flag" name="logicDeleteFlag" not-null="false" type="java.lang.Integer"/>
+    </class>
+</hibernate-mapping>

+ 27 - 0
projects-service/src/main/java/com/rtrh/projects/modules/rolemeun/po/SecUserAuth.java

@@ -0,0 +1,27 @@
+package com.rtrh.projects.modules.rolemeun.po;
+
+import com.rtrh.projects.modules.system.po.TableBaseColomn;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @author wangsheng
+ * @version 1.0
+ * @description: TODO 角色
+ * @date 2023/6/13 9:45
+ */
+@Data
+@Accessors(chain = true)
+public class SecUserAuth extends TableBaseColomn implements Serializable {
+    /**
+     *
+     */
+    private static final long serialVersionUID = 2404365616191805742L;
+    private String id;
+    private String userId;
+    private String remark;
+    private String cat; // 1 区县权限  2ha
+    private String subjectId;
+}

+ 1 - 0
projects-service/src/main/java/com/rtrh/projects/modules/system/po/SecUser.hbm.xml

@@ -26,5 +26,6 @@
         <property column="last_update_user_name" name="lastUpdateUserName" not-null="false" type="java.lang.String" />
         <property column="update_time" name="updateTime" not-null="false" type="java.util.Date" />
         <property column="logic_delete_flag" name="logicDeleteFlag" not-null="false" type="java.lang.Boolean" />
+		<property column="status_subject" name="statusSubject" not-null="false" type="java.lang.String"/>
 	</class>
 </hibernate-mapping>

+ 14 - 0
projects-service/src/main/java/com/rtrh/projects/modules/system/po/SecUser.java

@@ -115,6 +115,20 @@ public class SecUser implements Serializable {
 	 */
 	private Boolean isLead;
 
+	/**
+	 * 工信局数据权限 1 查看所有区域项目
+	 */
+	private String statusSubject;
+
+
+	public String getStatusSubject() {
+		return statusSubject;
+	}
+
+	public void setStatusSubject(String statusSubject) {
+		this.statusSubject = statusSubject;
+	}
+
 
 	/**
 	 * 职务

+ 5 - 0
projects-service/src/main/java/com/rtrh/projects/modules/system/vo/LoginUserVO.java

@@ -59,4 +59,9 @@ public class LoginUserVO implements Serializable {
 	 * 是否可编辑
 	 */
 	private Boolean edit;
+
+	/**
+	 * 工信局数据权限 1 查看所有区域项目
+	 */
+	private String statusSubject;
 }

+ 20 - 0
projects/src/main/java/com/rtrh/projects/web/controller/BaseController.java

@@ -1,10 +1,17 @@
 package com.rtrh.projects.web.controller;
 
 import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import cn.hutool.core.collection.CollUtil;
+import com.rtrh.projects.modules.rolemeun.dao.SecUserAuthDao;
+import com.rtrh.projects.modules.rolemeun.po.SecUserAuth;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.shiro.SecurityUtils;
@@ -14,6 +21,8 @@ import org.springframework.web.bind.annotation.ModelAttribute;
 import com.team.security.TeamShiroUser;
 
 public abstract class BaseController {
+	@Resource
+	private SecUserAuthDao userAuthDao;
 
 	/**
 	 * 当前用户的session
@@ -41,6 +50,17 @@ public abstract class BaseController {
 	public TeamShiroUser getCurUser() {
 		return (TeamShiroUser) SecurityUtils.getSubject().getPrincipal();
 	}
+
+	// 区域数据权限
+	public List<String> getSubjectIds() {
+		TeamShiroUser principal = (TeamShiroUser)SecurityUtils.getSubject().getPrincipal();
+		if ("1".equals(principal.getStatusSubject())){
+			List<SecUserAuth> list = userAuthDao.findListByUserId(principal.getId());
+			return CollUtil.isEmpty(list)? new ArrayList<>():list.stream().map(SecUserAuth::getSubjectId).collect(Collectors.toList());
+		}else {
+			return new ArrayList<>();
+		}
+	}
 	
 	@ModelAttribute
 	public void setReqAndRes(HttpServletRequest request, HttpServletResponse response){

+ 9 - 7
projects/src/main/java/com/rtrh/projects/web/controller/passport/LoginController.java

@@ -164,13 +164,15 @@ public class LoginController extends BaseController {
 
 		//查询资金来源
 		List<MeunInfo> listMenu=roleservice.queryMenuByParent();
-		if(Objects.equals("admin", curUser.getLoginName())) {
-			List<String> list = roleservice.queryAllMenuCode(MenuType.PC);
-			model.put("menuCode", CollectionUtil.isNotEmpty(list)?String.join(",", list):"");
-		}else if(StringUtil.isNotEmpty(curUser.getKind())) {
-			List<String> list = roleservice.queryMenuCodesByRoleId(curUser.getKind(), MenuType.PC);
-			model.put("menuCode", CollectionUtil.isNotEmpty(list)?String.join(",", list):"");
-		}
+		// if(Objects.equals("admin", curUser.getLoginName())) {
+		// 	List<String> list = roleservice.queryAllMenuCode(MenuType.PC);
+		// 	model.put("menuCode", CollectionUtil.isNotEmpty(list)?String.join(",", list):"");
+		// }else if(StringUtil.isNotEmpty(curUser.getKind())) {
+		// 	List<String> list = roleservice.queryMenuCodesByRoleId(curUser.getKind(), MenuType.PC);
+		// 	model.put("menuCode", CollectionUtil.isNotEmpty(list)?String.join(",", list):"");
+		// }
+		List<String> list = roleservice.queryMenuCodesByRoleId(curUser.getKind(), MenuType.PC);
+		model.put("menuCode", CollectionUtil.isNotEmpty(list)?String.join(",", list):"");
 		model.put("zjlyList", listMenu);
 		return new ModelAndView("/vmodules/index.jsp");
 	}

+ 8 - 0
projects/src/main/java/com/rtrh/projects/web/controller/subject/SubInfoExportController.java

@@ -873,6 +873,10 @@ public class SubInfoExportController extends BaseController {
      */
     @PostMapping("/exportDetailExcel")
     public void exportDetailExcel(HttpServletResponse response, @RequestBody SubInfoQueryTzVO queryVO) {
+        if ("1".equals(getCurUser().getStatusSubject())){
+            List<String> subjectIds = getSubjectIds();
+            queryVO.setSubjectAuthIds(subjectIds);
+        }
         List<SubInfoGxj> list = subInfoQueryService.queryAll(getCurUser().getLoginUser(), queryVO);
         // 行业字典
         Map<String, String> hyDictMap = subInduService.queryParentAll().stream().collect(Collectors.toMap(SubIndu::getCode, SubIndu::getTitle));
@@ -1110,6 +1114,10 @@ public class SubInfoExportController extends BaseController {
      */
     @PostMapping("/exportTotalExcelByStatus")
     public void exportTotalExcelByStatus(HttpServletResponse response, @RequestBody SubInfoQueryTzVO vo) {
+        if ("1".equals(getCurUser().getStatusSubject())){
+            List<String> subjectIds = getSubjectIds();
+            vo.setSubjectAuthIds(subjectIds);
+        }
         // 查询数据以及字典
         List<SubInfoTotalExcel> list = subInfoService.exportTotalExcelByStatus(vo);
         List<TSystable> jsddDict = tSysTableService.getByKind(SysTableKind.JSDD);

+ 8 - 0
projects/src/main/java/com/rtrh/projects/web/controller/subject/api/SubInfoQueryApiController.java

@@ -133,6 +133,10 @@ public class SubInfoQueryApiController extends BaseController {
     // 查询项目
     @PostMapping("queryPage")
     public ListMessage queryPage(@RequestBody Page page, @RequestBody SubInfoQueryTzVO queryVO) {
+        if ("1".equals(getCurUser().getStatusSubject())){
+            List<String> subjectIds = getSubjectIds();
+            queryVO.setSubjectAuthIds(subjectIds);
+        }
         ListMessage message = new ListMessage();
         try {
             Page pageData = subInfoQueryService.queryPage(page, getCurUser().getLoginUser(), queryVO);
@@ -593,6 +597,10 @@ public class SubInfoQueryApiController extends BaseController {
     @PostMapping("statistics")
     public Message statistics(@RequestBody SubInfoQueryTzVO queryVO) {
         Message message = new Message();
+        if ("1".equals(getCurUser().getStatusSubject())){
+            List<String> subjectIds = getSubjectIds();
+            queryVO.setSubjectAuthIds(subjectIds);
+        }
         StatisticsVO vo = subInfoQueryService.queryStatistics(queryVO, getCurUser().getLoginUser());
         message.setData(vo);
         return message;

+ 1 - 0
projects/src/main/java/com/team/security/TeamShiroUser.java

@@ -23,6 +23,7 @@ public class TeamShiroUser extends LoginUserVO implements Serializable {
 		this.password = commUser.getPassword();
 		this.userLocale = userLocale;
 		vo = new LoginUserVO();
+		setStatusSubject(secUser.getStatusSubject());
 		setEmail(secUser.getEmail());
 		setLoginName(commUser.getLoginname());
 		setId(commUser.getId());