Просмотр исходного кода

公出详情查看权限设置

anderx лет назад: 2
Родитель
Сommit
d71e7e3dd5

+ 5 - 1
src/main/java/com/goafanti/common/dao/PublicExamineMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PublicExamine;
 
+import java.util.List;
+
 public interface PublicExamineMapper {
     int deleteByPrimaryKey(Integer id);
 
@@ -14,4 +16,6 @@ public interface PublicExamineMapper {
     int updateByPrimaryKeySelective(PublicExamine record);
 
     int updateByPrimaryKey(PublicExamine record);
-}
+
+    List<PublicExamine> selectByPrid(Integer id);
+}

+ 16 - 18
src/main/java/com/goafanti/common/mapper/PublicExamineMapper.xml

@@ -5,28 +5,28 @@
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="prid" jdbcType="INTEGER" property="prid" />
     <result column="aid" jdbcType="VARCHAR" property="aid" />
-    <result column="aname" jdbcType="VARCHAR" property="aname" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, prid, aid, aname, `status`, create_time
+    id, prid, aid, `status`, create_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from public_examine
     where id = #{id,jdbcType=INTEGER}
   </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from public_examine
     where id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicExamine" useGeneratedKeys="true">
-    insert into public_examine (prid, aid, aname, 
-      `status`, create_time)
-    values (#{prid,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{aname,jdbcType=VARCHAR}, 
-      #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
+    insert into public_examine (prid, aid, `status`,
+      create_time)
+    values (#{prid,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
+      #{createTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicExamine" useGeneratedKeys="true">
     insert into public_examine
@@ -37,9 +37,6 @@
       <if test="aid != null">
         aid,
       </if>
-      <if test="aname != null">
-        aname,
-      </if>
       <if test="status != null">
         `status`,
       </if>
@@ -54,9 +51,6 @@
       <if test="aid != null">
         #{aid,jdbcType=VARCHAR},
       </if>
-      <if test="aname != null">
-        #{aname,jdbcType=VARCHAR},
-      </if>
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
@@ -74,9 +68,6 @@
       <if test="aid != null">
         aid = #{aid,jdbcType=VARCHAR},
       </if>
-      <if test="aname != null">
-        aname = #{aname,jdbcType=VARCHAR},
-      </if>
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
       </if>
@@ -90,9 +81,16 @@
     update public_examine
     set prid = #{prid,jdbcType=INTEGER},
       aid = #{aid,jdbcType=VARCHAR},
-      aname = #{aname,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=INTEGER}
   </update>
-</mapper>
+
+
+  <select id="selectByPrid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from public_examine
+    where prid = #{id,jdbcType=INTEGER}
+  </select>
+</mapper>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -631,7 +631,7 @@
     a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.aid ,c.superior_id suprId,
     a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,c.reviewer,a.type,a.order_no orderNo,d.contract_no contractNo,
     date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_Status updateStatus,a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,
-    a.main_name mainName,a.assistant_aid assistantAid,a.assistant_name assistantName,a.public_again publicAhain,x.uids
+    a.main_name mainName,a.assistant_aid assistantAid,a.assistant_name assistantName,a.public_again publicAhain,x.uids,a.public_type publicType
     from public_release a  left join admin c on a.aid =c.id
     left join (select prid ,GROUP_CONCAT(uid)uids from public_release_details where prid= #{id} group by prid)x on a.id=x.prid
     left join t_order_new d on a.order_no=d.order_no

+ 0 - 13
src/main/java/com/goafanti/common/model/PublicExamine.java

@@ -21,11 +21,6 @@ public class PublicExamine implements Serializable {
     private String aid;
 
     /**
-     * 审核人名称
-     */
-    private String aname;
-
-    /**
      * 0未审核 ,1已审核
      */
     private Integer status;
@@ -61,14 +56,6 @@ public class PublicExamine implements Serializable {
         this.aid = aid;
     }
 
-    public String getAname() {
-        return aname;
-    }
-
-    public void setAname(String aname) {
-        this.aname = aname;
-    }
-
     public Integer getStatus() {
         return status;
     }

+ 22 - 6
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -794,25 +794,41 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 	@Override
 	public OutPublicRelease dtails(Integer id) {
+		String aid=TokenManager.getAdminId();
 		//如果不是本人和审核人员则不返回信息
 		OutPublicRelease out=publicReleaseMapper.selectDtails(id);
+		List<PublicExamine> ps = publicExamineMapper.selectByPrid(out.getId());
 		if(out!=null){
 			boolean flag=false;
 			//自己、审核人员与部门负责人可以查看
 			AdminListBo ab=adminMapper.getDeptNameByAid(out.getAid());
-			if (!TokenManager.getAdminId().equals( out.getAid())&&
-					!TokenManager.getAdminId().equals(out.getReviewer())&&
-					!TokenManager.getAdminId().equals(ab.getDepManager())&&
+			if (!aid.equals( out.getAid())&&
+					!aid.equals(out.getReviewer())&&
+					!aid.equals(ab.getDepManager())&&
 					!TokenManager.hasRole(AFTConstants.TECH_FINANCE_DIRECTOR)){
 				flag=true;
 			}
+			//是否可以查看
+			if (!ps.isEmpty()){
+				for (PublicExamine p : ps) {
+					if (p.getAid().equals(aid)){
+						flag=false;
+						break;
+					}
+				}
+			}
 			if(flag){
 				out=null;
+				return out;
 			}else {
-				if(TokenManager.getAdminId().equals(out.getAid())) {
-					out.setPermission(0);
-				}else {
+				if (out.getPublicType()==1){
 					out.setPermission(1);
+				}else {
+					if(aid.equals(out.getAid())) {
+						out.setPermission(0);
+					}else {
+						out.setPermission(1);
+					}
 				}
 			}
 		}