anderx 2 lat temu
rodzic
commit
8192c24879

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

@@ -112,7 +112,7 @@ public class ProjectTaskController extends BaseController {
     public TableDataInfo listRecord( ProjectStaffRecordInput in){
         startPage();
         List<ProjectStaffRecordOut> list = projectStaffRecordService.listRecord(in);
-        return getDataTable(list,in.getPageNum());
+        return getDataTable(list);
     }
 
 
@@ -194,7 +194,7 @@ public class ProjectTaskController extends BaseController {
     public TableDataInfo list(ProjectListInput in){
         startPage();
         List<ProjectTaskListOut> list=projectTaskService.list(in);
-        return getDataTable(list,in.getPageNum());
+        return getDataTable(list);
     }
 
     /**

+ 6 - 16
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@@ -86,29 +86,19 @@ public class BaseController
         rspData.setCode(HttpStatus.SUCCESS);
         rspData.setMsg("查询成功");
         rspData.setRows(list);
-        rspData.setTotal(new PageInfo(list).getTotal());
-        return rspData;
-    }
-
-    /**
-     * 响应请求分页数据
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    protected TableDataInfo getDataTable(List<?> list,Integer page)
-    {
-        TableDataInfo rspData = new TableDataInfo();
-        rspData.setCode(HttpStatus.SUCCESS);
-        rspData.setMsg("查询成功");
-        rspData.setRows(list);
-        if (page==null){
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        Integer pageNum = pageDomain.getPageNum();
+        if (pageNum==null){
             rspData.setNext(2);
         }else {
-            rspData.setNext(page+1);
+            rspData.setNext(pageNum+1);
         }
         rspData.setTotal(new PageInfo(list).getTotal());
         return rspData;
     }
 
+
+
     /**
      * 返回成功
      */

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

@@ -11,8 +11,15 @@ public class ProjectStaffRecordInput extends BaseEntity {
      * 审核状态 0=未发起,1=待审核,2=已审核,3=驳回
      */
     private Integer processStatus;
+    private Long companyId;
 
+    public Long getCompanyId() {
+        return companyId;
+    }
 
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
 
     public Integer getProcessStatus() {
         return processStatus;

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

@@ -18,6 +18,7 @@ import com.ruoyi.project.mapper.ProjectStaffRecordMapper;
 import com.ruoyi.project.mapper.ProjectTaskMapper;
 import com.ruoyi.project.service.ProjectStaffRecordService;
 import com.ruoyi.system.mapper.SysUserMapper;
+import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.weChat.service.WeChatService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -44,6 +45,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
     protected Validator validator;
     @Autowired
     private WeChatService weChatService;
+    @Autowired
+    private ISysDeptService deptService;
 
     @Override
     public AjaxResult add(ProjectStaffRecord in) {
@@ -136,6 +139,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
         }else if (in.getRoleType()==3){
 
         }
+        Long companyId = deptService.selectCompanyByDeptId();
+        if (companyId!=null)in.setCompanyId(companyId);
         return projectStaffRecordMapper.selectList(in);
     }
 

+ 3 - 0
ruoyi-system/src/main/resources/mapper/project/ProjectStaffRecordMapper.xml

@@ -199,6 +199,9 @@
     <if test="processStatus  !=null">
       and a.process_status= #{processStatus}
     </if>
+    <if test="companyId !=null">
+      and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
+    </if>
   </select>
     <select id="selectById" resultType="java.lang.Integer">
       select count(*)

Plik diff jest za duży
+ 930 - 929
ruoyi-ui/src/views/index.vue