|
@@ -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());
|
|
|
}
|