Explorar o código

模糊查询修改

anderx %!s(int64=2) %!d(string=hai) anos
pai
achega
8fa69f2e1c

+ 9 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -172,7 +172,7 @@ public class ProjectTaskController extends BaseController {
 
 
     /**
-     * 导出项目列表
+     * 导出项目打卡列表
      * @param response
      */
     @PostMapping("/listRecord/export")
@@ -367,4 +367,12 @@ public class ProjectTaskController extends BaseController {
     public AjaxResult myDurationMonth(Long id){
         return projectStaffRecordService.myDurationMonth(id);
     }
+
+    @GetMapping("/selectProjectImg")
+    public AjaxResult selectProjectImg(Long pid){
+        if (pid==null){
+            return AjaxResult.error("项目编号不能为空!");
+        }
+        return projectTaskService.selectProjectImg(pid);
+    }
 }

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/enums/UserRolesType.java

@@ -10,7 +10,7 @@ public enum UserRolesType {
     MANAGE(3l,"manage"),
     CEO(4l,"ceo"),
     INSPECTORS(5l,"inspectors"),
-    ERROR(99l,"inspectors"),;
+    ERROR(99l,"error"),;
 
     private final String desc;
     private final Long code;

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

@@ -12,6 +12,69 @@ public class ProjectStaffRecordInput extends BaseEntity {
      */
     private Integer processStatus;
     private Long companyId;
+    private Integer projectStatus;
+    private String projectNumber;
+    private String projectName;
+    private String startTime;
+    private String endTime;
+    private Integer fullJob;
+    private Long deptId;
+
+    public Integer getProjectStatus() {
+        return projectStatus;
+    }
+
+    public void setProjectStatus(Integer projectStatus) {
+        this.projectStatus = projectStatus;
+    }
+
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getFullJob() {
+        return fullJob;
+    }
+
+    public void setFullJob(Integer fullJob) {
+        this.fullJob = fullJob;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
 
     public Long getCompanyId() {
         return companyId;

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

@@ -26,6 +26,7 @@ public class ProjectStaffRecordOut extends ProjectStaffRecord {
     @JsonFormat(pattern = "MM")
     private Date createMonth;
     @Excel(name = "项目编号")
+    private Long  projectNumber;
     private Long pid;
     @Excel(name = "项目名称")
     private String projectName;
@@ -48,6 +49,14 @@ public class ProjectStaffRecordOut extends ProjectStaffRecord {
     private Long aid;
 
 
+    public Long getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(Long projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
     @Override
     public Long getId() {
         return id;

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectTaskMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.project.mapper;
 
 import com.ruoyi.project.bo.ProjectListInput;
 import com.ruoyi.project.bo.ProjectTaskListOut;
+import com.ruoyi.project.domain.ProjectStaffRecord;
 import com.ruoyi.project.domain.ProjectTask;
 import org.apache.ibatis.annotations.Param;
 
@@ -25,4 +26,6 @@ public interface ProjectTaskMapper {
     List<ProjectTaskListOut> selectList(ProjectListInput in);
 
     void projectAddDuration(@Param("pid") Long pid, @Param("duration") Double duration);
+
+    List<ProjectStaffRecord> selectProjectImg(Long pid);
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/ProjectTaskService.java

@@ -19,4 +19,6 @@ public interface ProjectTaskService {
     String importProject(List<ProjectTaskListOut> list, boolean updateSupport, String operName);
 
     AjaxResult updateProjectTask(ProjectTask projectTask);
+
+    AjaxResult selectProjectImg(Long pid);
 }

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -327,12 +327,13 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
         //判定1=经理审核成员2=技术总监审核经理
             if (SecurityUtils.hashRoles(UserRolesType.INSPECTORS.getCode())){
                 in.setRoleType(2);
+            }else if (SecurityUtils.hashRoles(UserRolesType.CEO.getCode())||SecurityUtils.hashRoles(UserRolesType.ADMIN.getCode())){
+                in.setRoleType(3);
             }
-        }else if (in.getRoleType()==3){
-
         }
         Long companyId = deptService.selectCompanyByDeptId();
         if (companyId!=null)in.setCompanyId(companyId);
+        if (in.getEndTime()!=null)in.setEndTime(in.getEndTime()+" 23:59:59");
         return projectStaffRecordMapper.selectList(in);
     }
 

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

@@ -222,6 +222,12 @@ public class ProjectTaskServiceImpl   implements ProjectTaskService {
         return AjaxResult.success(projectTaskMapper.updateByPrimaryKeySelective(in));
     }
 
+    @Override
+    public AjaxResult selectProjectImg(Long pid) {
+        projectTaskMapper.selectProjectImg(pid);
+        return null;
+    }
+
     private void addStaffAndDelete(  ProjectTaskListOut p) {
         String[] split = p.getStaffName().split(",");
         List<ProjectStaff> projectStaffs = projectStaffMapper.selectByPid(p.getId());

+ 12 - 1
ruoyi-system/src/main/resources/mapper/project/ProjectStaffRecordMapper.xml

@@ -192,7 +192,7 @@
   </update>
   <select id="selectList" resultType="com.ruoyi.project.bo.ProjectStaffRecordOut">
     select a.id,c.job_number jobNumber,a.name   ,d.dept_id deptId ,d.dept_name deptName ,c.create_time createMonth,
-    b.name projectName,b.admin_name adminName ,a.project_status projectStatus,a.content ,
+    b.name projectName,b.admin_name adminName ,a.project_status projectStatus,a.content ,b.project_number projectNumber,
     a.pid ,a.aid ,a.examine_id examineId ,a.examine_name examineName ,a.examine_time examineTime,
     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
@@ -213,7 +213,18 @@
     <if test="companyId !=null">
       and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
     </if>
+    <if test="projectStatus != null"> and a.project_status =#{projectStatus}</if>
+    <if test="projectNumber != null"> and b.project_number like concat ('%',#{projectNumber},'%')</if>
+    <if test="projectName != null"> and b.name like concat ('%',#{projectName},'%')</if>
+    <if test="startTime != null and endTime != null">
+      and a.record_time between #{startTime} and #{endTime}
+    </if>
+    <if test="fullJob != null">and c.full_job= #{fullJob}</if>
+    <if test="deptId != null">and c.dept_id= #{deptId}</if>
   </select>
+
+
+
     <select id="selectById" resultType="java.lang.Integer">
       select count(*)
       from project_staff_record a left join project_staff ps on a.aid = ps.aid

+ 5 - 0
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -272,4 +272,9 @@
     set duration=duration+#{duration}
     where id =#{pid}
   </select>
+  <select id="selectProjectImg" resultType="com.ruoyi.project.domain.ProjectStaffRecord">
+    select *
+    from project_staff_record a
+    where a.pid=#{pid}
+  </select>
 </mapper>