anderx преди 2 години
родител
ревизия
803e8478a3

+ 2 - 2
ruoyi-admin/src/main/resources/application.yml

@@ -131,7 +131,7 @@ xss:
   urlPatterns: /system/*,/monitor/*,/tool/*
 
 wx:
-  appId: wxff2f5720ed7d7f63
-  appSecret: 081744369d42405be58fe37f892631f7
+  appId: wx4f6bec93d9863623
+  appSecret: 89557cb97e2a716732666583ceb89c22
   #developer为开发版;trial为体验版;formal为正式版;
   state: trial

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectListInput.java

@@ -14,7 +14,7 @@ public class ProjectListInput {
     private Integer projectStatus;
 
     /**
-     * 0=我的项目 1=All
+     * 0=我的项目 1=项目负责人审核 2=技术总监审核
      */
     private Integer roleType;
 

+ 19 - 5
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectStaffRecordInput.java

@@ -1,8 +1,21 @@
 package com.ruoyi.project.bo;
 
 public class ProjectStaffRecordInput {
-    private Long roleId;
+
     private Long aid;
+    private Integer roleType;
+    /**
+     * 审核状态 0=未发起,1=待审核,2=已审核,3=驳回
+     */
+    private Integer processStatus;
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
 
     public Long getAid() {
         return aid;
@@ -12,11 +25,12 @@ public class ProjectStaffRecordInput {
         this.aid = aid;
     }
 
-    public Long getRoleId() {
-        return roleId;
+
+    public Integer getRoleType() {
+        return roleType;
     }
 
-    public void setRoleId(Long roleId) {
-        this.roleId = roleId;
+    public void setRoleType(Integer roleType) {
+        this.roleType = roleType;
     }
 }

+ 14 - 5
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectStaffRecordOut.java

@@ -4,13 +4,22 @@ import com.ruoyi.project.domain.ProjectStaffRecord;
 
 public class ProjectStaffRecordOut extends ProjectStaffRecord {
 
-    private String createTimeStr;
+    private  String projectName;
+    private String adminName;
 
-    public String getCreateTimeStr() {
-        return createTimeStr;
+    public String getProjectName() {
+        return projectName;
     }
 
-    public void setCreateTimeStr(String createTimeStr) {
-        this.createTimeStr = createTimeStr;
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
     }
 }

+ 9 - 7
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -104,15 +104,17 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
 
     @Override
     public List<ProjectStaffRecordOut> listRecord(ProjectStaffRecordInput in) {
-        if (SecurityUtils.hashRoles(UserRolesType.COMMON.getCode())){
-            in.setRoleId(UserRolesType.COMMON.getCode());
+        if (in.getRoleType()==null)in.setRoleType(0);
+        if (in.getRoleType()==0){
             in.setAid(SecurityUtils.getUserId());
-        }else if (SecurityUtils.hashRoles(UserRolesType.MANAGE.getCode())){
-            in.setRoleId(UserRolesType.MANAGE.getCode());
-            in.setAid(SecurityUtils.getUserId());
-        }else {
-            in.setRoleId(UserRolesType.ADMIN.getCode());
+        }else if (in.getRoleType()==1){
+        //判定1=经理审核成员2=技术总监审核经理
+            if (SecurityUtils.hashRoles(UserRolesType.INSPECTORS.getCode())){
+                in.setRoleType(2);
+            }
         }
+
+
         return projectStaffRecordMapper.selectList(in);
     }
 }

+ 16 - 1
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectTaskServiceImpl.java

@@ -71,7 +71,7 @@ public class ProjectTaskServiceImpl   implements ProjectTaskService {
 
     @Override
     public List<ProjectTaskListOut> list(ProjectListInput in) {
-        if (in.getRoleType()==null)in.setRoleType(0);
+        pushRoleType(in);
         in.setUid(SecurityUtils.getUserId());
         Long companyId = deptService.selectCompanyByDeptId();
         if (companyId!=null)in.setCompanyId(companyId);
@@ -79,6 +79,21 @@ public class ProjectTaskServiceImpl   implements ProjectTaskService {
         return projectTaskMapper.selectList(in);
     }
 
+    private void pushRoleType(ProjectListInput in) {
+        if (in.getRoleType()==null)in.getRoleType();
+        if (in.getRoleType()==1)in.setRoleType(getRoleType());
+    }
+
+    private Integer getRoleType() {
+        if (SecurityUtils.hashRoles(UserRolesType.MANAGE.getCode())){
+            return 1;
+        }else if (SecurityUtils.hashRoles(UserRolesType.INSPECTORS.getCode())){
+            return 2;
+        }else {
+            return 0;
+        }
+    }
+
     @Override
     public String importProject(List<ProjectTaskListOut> list, boolean isUpdateSupport, String operName) {
         if (StringUtils.isNull(list) || list.size() == 0)

+ 11 - 5
ruoyi-system/src/main/resources/mapper/project/ProjectStaffRecordMapper.xml

@@ -146,15 +146,21 @@
   </update>
   <select id="selectList" resultType="com.ruoyi.project.bo.ProjectStaffRecordOut">
     select a.id,a.pid ,a.aid ,a.name ,a.project_status projectStatus,a.content ,
-           a.annex_url annexUrl,a.create_time createTimeStr,a.process_status processStatus ,
-           a.duration
+           a.annex_url annexUrl,a.create_time createTime,a.process_status processStatus ,
+           a.duration,b.name projectName,b.admin_name adminName
     from project_staff_record a left join project_task b on a.pid=b.id
     where 1=1
-    <if test="roleId==2">
+    <if test="roleType==0">
       and a.aid =#{aid}
     </if>
-    <if test="roleId==3">
-      and b.aid =#{aid}
+    <if test="roleType==1">
+      and a.aid in (select user_id from sys_user_role where role_id=2)
+    </if>
+    <if test="roleType==2">
+      and a.aid in (select user_id from sys_user_role where role_id=3)
+    </if>
+    <if test="processStatus  !=null">
+      and a.process_status= #{processStatus}
     </if>
   </select>
 </mapper>