|
|
|
|
@ -21,10 +21,13 @@ import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.lims.entry.*; |
|
|
|
|
import org.springblade.lims.mapper.InspectionTaskMapper; |
|
|
|
|
import org.springblade.lims.service.*; |
|
|
|
|
import org.springblade.system.cache.SysCache; |
|
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
@ -78,10 +81,24 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
if(CollectionUtils.isNotEmpty(entry.getGroupIdList())){ |
|
|
|
|
wrapper.in(InspectionTask::getGroupId,entry.getGroupIdList()); |
|
|
|
|
} |
|
|
|
|
if(entry.getCreateDept() != null){ |
|
|
|
|
wrapper.eq(BaseEntity::getCreateDept,entry.getCreateDept()); |
|
|
|
|
List<String> roles = Arrays.asList(AuthUtil.getUserRole().split(",")); |
|
|
|
|
if(!roles.contains("admin") && !roles.contains("政府")){ |
|
|
|
|
/*if(roles.contains("巡检管理")){ |
|
|
|
|
entry.setCreateDept(Long.parseLong(AuthUtil.getDeptId())); |
|
|
|
|
}*/ |
|
|
|
|
if(roles.contains("巡检人员")){ |
|
|
|
|
List<String> groupIdList = Arrays.asList(AuthUtil.getDeptId().split(",")); |
|
|
|
|
entry.setGroupIdList(groupIdList); |
|
|
|
|
}else{ |
|
|
|
|
List<Long> deptIds = new ArrayList<>(); |
|
|
|
|
List<Dept> depts = SysCache.getDeptChild(Long.parseLong(AuthUtil.getDeptId())); |
|
|
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(depts)){ |
|
|
|
|
deptIds = depts.stream().map(Dept::getId).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
deptIds.add(Long.parseLong(AuthUtil.getDeptId())); |
|
|
|
|
wrapper.in(BaseEntity::getCreateDept,deptIds); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
wrapper.eq(BaseEntity::getIsDeleted,0); |
|
|
|
|
wrapper.orderByDesc(InspectionTask::getCreateTime); |
|
|
|
|
IPage<InspectionTask> page = this.page(Condition.getPage(query), wrapper); |
|
|
|
|
|