anderx hace 2 años
padre
commit
54a6015f1f

+ 15 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -8,6 +8,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.file.MimeTypeUtils;
 import com.ruoyi.project.bo.ProjectListInput;
+import com.ruoyi.project.bo.ProjectStaffRecordInput;
+import com.ruoyi.project.bo.ProjectStaffRecordOut;
 import com.ruoyi.project.bo.ProjectTaskListOut;
 import com.ruoyi.project.domain.ProjectStaff;
 import com.ruoyi.project.domain.ProjectStaffRecord;
@@ -20,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.awt.print.Pageable;
 import java.util.List;
 
 /**
@@ -98,6 +101,18 @@ public class ProjectTaskController extends BaseController {
     }
 
     /**
+     * 审核成员打卡
+     * @param in
+     * @return
+     */
+    @PostMapping("/listRecord")
+    public TableDataInfo listRecord( @RequestBody ProjectStaffRecordInput in){
+        startPage();
+        List<ProjectStaffRecordOut> list = projectStaffRecordService.listRecord(in);
+        return getDataTable(list);
+    }
+
+    /**
      * 删除项目成员
      * @param in
      * @return

+ 22 - 0
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectStaffRecordInput.java

@@ -0,0 +1,22 @@
+package com.ruoyi.project.bo;
+
+public class ProjectStaffRecordInput {
+    private Long roleId;
+    private Long aid;
+
+    public Long getAid() {
+        return aid;
+    }
+
+    public void setAid(Long aid) {
+        this.aid = aid;
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+}

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectStaffRecordOut.java

@@ -0,0 +1,6 @@
+package com.ruoyi.project.bo;
+
+import com.ruoyi.project.domain.ProjectStaffRecord;
+
+public class ProjectStaffRecordOut extends ProjectStaffRecord {
+}

+ 7 - 1
ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectStaffRecordMapper.java

@@ -1,7 +1,11 @@
 package com.ruoyi.project.mapper;
 
+import com.ruoyi.project.bo.ProjectStaffRecordInput;
+import com.ruoyi.project.bo.ProjectStaffRecordOut;
 import com.ruoyi.project.domain.ProjectStaffRecord;
 
+import java.util.List;
+
 public interface ProjectStaffRecordMapper {
     int deleteByPrimaryKey(Long id);
 
@@ -14,4 +18,6 @@ public interface ProjectStaffRecordMapper {
     int updateByPrimaryKeySelective(ProjectStaffRecord record);
 
     int updateByPrimaryKey(ProjectStaffRecord record);
-}
+
+    List<ProjectStaffRecordOut> selectList(ProjectStaffRecordInput in);
+}

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/ProjectStaffRecordService.java

@@ -1,12 +1,18 @@
 package com.ruoyi.project.service;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.project.bo.ProjectStaffRecordInput;
+import com.ruoyi.project.bo.ProjectStaffRecordOut;
 import com.ruoyi.project.domain.ProjectStaffRecord;
 
+import java.util.List;
+
 public interface ProjectStaffRecordService {
     AjaxResult add(ProjectStaffRecord in);
 
     AjaxResult update(ProjectStaffRecord in);
 
     AjaxResult examineRecord(ProjectStaffRecord in);
+
+    List<ProjectStaffRecordOut> listRecord(ProjectStaffRecordInput in);
 }

+ 19 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -1,7 +1,10 @@
 package com.ruoyi.project.service.impl;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.UserRolesType;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.project.bo.ProjectStaffRecordInput;
+import com.ruoyi.project.bo.ProjectStaffRecordOut;
 import com.ruoyi.project.domain.ProjectStaffRecord;
 import com.ruoyi.project.domain.ProjectStaffRecordLog;
 import com.ruoyi.project.mapper.ProjectStaffRecordLogMapper;
@@ -10,6 +13,8 @@ import com.ruoyi.project.service.ProjectStaffRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService {
     @Autowired
@@ -78,4 +83,18 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
         addRecordLog(in);
         return AjaxResult.success();
     }
+
+    @Override
+    public List<ProjectStaffRecordOut> listRecord(ProjectStaffRecordInput in) {
+        if (SecurityUtils.hashRoles(UserRolesType.COMMON.getCode())){
+            in.setRoleId(UserRolesType.COMMON.getCode());
+            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());
+        }
+        return projectStaffRecordMapper.selectList(in);
+    }
 }

+ 21 - 7
ruoyi-system/src/main/resources/mapper/project/ProjectStaffRecordMapper.xml

@@ -14,26 +14,27 @@
     <result column="duration" jdbcType="DOUBLE" property="duration" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, pid, aid, `name`, project_status, content, annex_url, create_time, process_status, 
+    id, pid, aid, `name`, project_status, content, annex_url, create_time, process_status,
     duration
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from project_staff_record
     where id = #{id,jdbcType=BIGINT}
   </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from project_staff_record
     where id = #{id,jdbcType=BIGINT}
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectStaffRecord" useGeneratedKeys="true">
-    insert into project_staff_record (pid, aid, `name`, 
-      project_status, content, annex_url, 
+    insert into project_staff_record (pid, aid, `name`,
+      project_status, content, annex_url,
       create_time, process_status, duration
       )
-    values (#{pid,jdbcType=BIGINT}, #{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, 
-      #{projectStatus,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, 
+    values (#{pid,jdbcType=BIGINT}, #{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
+      #{projectStatus,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR},
       #{createTime,jdbcType=TIMESTAMP}, #{processStatus,jdbcType=INTEGER}, #{duration,jdbcType=DOUBLE}
       )
   </insert>
@@ -144,4 +145,17 @@
       duration = #{duration,jdbcType=DOUBLE}
     where id = #{id,jdbcType=BIGINT}
   </update>
-</mapper>
+  <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 createTime,a.process_status processStatus ,
+           a.duration
+    from project_staff_record a left join project_task b on a.pid=b.id
+    where 1=1
+    <if test="roleId==2">
+      and a.aid =#{aid}
+    </if>
+    <if test="roleId==3">
+      and b.aid =#{aid}
+    </if>
+  </select>
+</mapper>