Przeglądaj źródła

项目进度列表新增权限查询

anderx 11 miesięcy temu
rodzic
commit
099806bf5c

+ 66 - 54
src/main/java/com/goafanti/common/mapper/TaskDetailsMapper.xml

@@ -1221,66 +1221,78 @@ project_id = values(project_id)
         <if test="serviceYear !=null">
             left join t_task_member f on b.id=f.tid
         </if>
-        where (c.superior_id= #{aid} or c.id= #{aid})
-        <if test="userName != null and userName != ''">
-            and d.buyer_name like concat('%',#{userName},'%')
-        </if>
-        <if test="consultantName !=null">
-            and (a.technology_name like concat('%',#{consultantName},'%')
+        <where>
+            <if test="roleStatus ==1">
+                and c.id= #{aid}
+            </if>
+            <if test="roleStatus ==2">
+                and c.superior_id= #{aid}
+            </if>
+            <if test="roleStatus == 3">
+                and a.project_id=#{aid}
+            </if>
+            <if test="userName != null and userName != ''">
+                and d.buyer_name like concat('%',#{userName},'%')
+            </if>
+            <if test="consultantName !=null">
+                and (a.technology_name like concat('%',#{consultantName},'%')
                 or a.finance_taxation_name like concat('%',#{consultantName},'%'))
-        </if>
-        <if test="contractNo !=null">
-            and e.contract_no like concat('%',#{contractNo},'%')
-        </if>
-        <if test="serviceYear !=null">
-            and f.service_year like concat('%',#{serviceYear},'%')
-        </if>
-        <if test="projectDebtorId !=null">
-            and b.task_receiver = #{projectDebtorId}
-        </if>
-        <if test="projectStatus !=null">
-            and b.project_status = #{projectStatus}
-        </if>
-        <if test="outSourcingStatus !=null">
-            and b.outsource= #{outSourcingStatus}
-        </if>
-        <if test="updateTime !=null">
-            and a.update_time between #{updateTime} and #{updateTime} + interval 1 day
-        </if>
-        <if test="progress !=null">
-            and a.progress = #{progress}
-        </if>
-        <if test="applicationLevel !=null">
-            <if test="applicationLevel == 0">
-                and e.total_amount &lt; 3
             </if>
-            <if test="applicationLevel == 1">
-                and e.total_amount &gt; 3 and e.total_amount &lt; 8
+            <if test="contractNo !=null">
+                and e.contract_no like concat('%',#{contractNo},'%')
             </if>
-            <if test="applicationLevel == 2">
-                and e.total_amount &gt; 8
+            <if test="serviceYear !=null">
+                and f.service_year like concat('%',#{serviceYear},'%')
             </if>
-        </if>
-        <if test="reviewProvince !=null">
-            and (a.review_province = #{reviewProvince}
+            <if test="projectDebtorId !=null">
+                and b.task_receiver = #{projectDebtorId}
+            </if>
+            <if test="projectStatus !=null">
+                and b.project_status = #{projectStatus}
+            </if>
+            <if test="outSourcingStatus !=null">
+                and b.outsource= #{outSourcingStatus}
+            </if>
+            <if test="updateTime !=null">
+                and a.update_time between #{updateTime} and #{updateTime} + interval 1 day
+            </if>
+            <if test="progress !=null">
+                and a.progress = #{progress}
+            </if>
+            <if test="applicationLevel !=null">
+                <if test="applicationLevel == 0">
+                    and e.total_amount &lt; 3
+                </if>
+                <if test="applicationLevel == 1">
+                    and e.total_amount &gt; 3 and e.total_amount &lt; 8
+                </if>
+                <if test="applicationLevel == 2">
+                    and e.total_amount &gt; 8
+                </if>
+            </if>
+            <if test="reviewProvince !=null">
+                and (a.review_province = #{reviewProvince}
                 or a.review_country = #{reviewProvince})
-        </if>
-        <if test="finalSettlementStatus !=null">
-            and a.final_settlement_status = #{finalSettlementStatus}
-        </if>
-        <if test="adDeliverStatus !=null">
-            and (a.ad_prepare_july_status = #{adDeliverStatus}
+            </if>
+            <if test="finalSettlementStatus !=null">
+                and a.final_settlement_status = #{finalSettlementStatus}
+            </if>
+            <if test="adDeliverStatus !=null">
+                and (a.ad_prepare_july_status = #{adDeliverStatus}
                 or a.ad_prepare_october_status = #{adDeliverStatus})
-        </if>
-        <if test="torchStatus !=null">
-            and a.torch_status = #{torchStatus}
-        </if>
-        <if test="statisticsStatus !=null">
-            and a.statistics_status = #{statisticsStatus}
-        </if>
-        <if test="chStatus !=null">
-            and a.ch_status = #{chStatus}
-        </if>
+            </if>
+            <if test="torchStatus !=null">
+                and a.torch_status = #{torchStatus}
+            </if>
+            <if test="statisticsStatus !=null">
+                and a.statistics_status = #{statisticsStatus}
+            </if>
+            <if test="chStatus !=null">
+                and a.ch_status = #{chStatus}
+            </if>
+        </where>
+
+
     </sql>
     <select id="selectTaskDetailsCount" resultType="java.lang.Integer">
         select

+ 10 - 0
src/main/java/com/goafanti/techproject/bo/InputTaskDetailsBo.java

@@ -65,11 +65,21 @@ public class InputTaskDetailsBo {
      */
     private Integer chStatus;
 
+    private Integer roleStatus;
+
 
     private Integer pageSize;
     private Integer pageNo;
 
 
+    public Integer getRoleStatus() {
+        return roleStatus;
+    }
+
+    public void setRoleStatus(Integer roleStatus) {
+        this.roleStatus = roleStatus;
+    }
+
     public String getConsultantName() {
         return consultantName;
     }

+ 16 - 2
src/main/java/com/goafanti/techproject/service/impl/TaskDetailsServiceImpl.java

@@ -1,6 +1,7 @@
 package com.goafanti.techproject.service.impl;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.model.*;
 import com.goafanti.common.utils.DateUtils;
@@ -97,7 +98,16 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
 
     @Override
     public Pagination<TaskDetailsBo> pushDetailsList(InputTaskDetailsBo in) {
-        in.setAid(TokenManager.getUserId());
+
+        // 0=查询所有,1=查询自己,2=查询下级,3=负责人查询
+        if (TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)){
+            in.setRoleStatus(0);
+        } else  {
+            in.setAid(TokenManager.getAdminId());
+            if (in.getRoleStatus()==null){
+                in.setRoleStatus(1);
+            }
+        }
         Pagination<?> page = findPage("selectTaskDetailsList", "selectTaskDetailsCount", in);
         List<TaskDetails> list = (List<TaskDetails>) page.getList();
         List<TaskDetailsBo> list2=new ArrayList<>();
@@ -514,7 +524,11 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
             update.setId(bo.getId());
             update.setFinanceTaxationName(bo.getFinanceTaxationName());
             update.setTechnologyName(bo.getTechnologyName());
-            taskDetailsMapper.update(update);
+            if (update.getFinanceTaxationName()!=null||
+                update.getTechnologyName()!=null){
+                taskDetailsMapper.update(update);
+            }
+
         }
         bo.setTaskList(list);
     }