浏览代码

刑侦案件添加部门管理

lyhzzz 1 年之前
父节点
当前提交
b713585cc7

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/CaseEntity.java

@@ -58,4 +58,7 @@ public class CaseEntity implements Serializable {
 
     @TableField("tm_project_id")
     private String tmProjectId;
+
+    @TableField("dept_id")
+    private String deptId;
 }

+ 13 - 1
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.Model;
+import com.fdkankan.fusion.entity.TmUser;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.entity.CaseEntity;
@@ -46,6 +47,10 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
     IFusionNumService fusionNumService;
     @Autowired
     ITmProjectService tmProjectService;
+    @Autowired
+    ITmDepartmentService tmDepartmentService;
+    @Autowired
+    ITmUserService tmUserService;
 
     @Override
     public PageInfo pageList(CaseParam param,String userName) {
@@ -53,7 +58,12 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
         if(StringUtils.isNotBlank(param.getCaseTitle())){
             wrapper.like(CaseEntity::getCaseTitle,param.getCaseTitle());
         }
-        wrapper.eq(CaseEntity::getUserName,userName);
+        List<String> deptIds = tmDepartmentService.getDeptIds();
+        if(deptIds.size() >0){
+            return PageInfo.PageInfo(new Page<>(param.getPageNum(),param.getPageSize()));
+        }
+        wrapper.in(CaseEntity::getDeptId,deptIds);
+        //wrapper.eq(CaseEntity::getUserName,userName);
         wrapper.eq(CaseEntity::getType,0);
         wrapper.orderByDesc(CaseEntity::getCreateTime);
         Page<CaseEntity> page = this.page( new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
@@ -160,6 +170,8 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
         if(param.getCaseId() == null){
             caseEntity = new CaseEntity();
             caseEntity.setUserName(userName);
+            TmUser tmUser = tmUserService.getByUserName(userName);
+            caseEntity.setDeptId(tmUser.getDeptId());
         }else {
             caseEntity = this.getById(param.getCaseId());
         }