| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.system.applet.dto.AppealListDTO; |
| | | import com.ruoyi.system.applet.query.AppealListQuery; |
| | | import com.ruoyi.system.applet.vo.TaskListAllVO; |
| | | import com.ruoyi.system.mapper.TAppealMapper; |
| | | import com.ruoyi.system.mapper.TDeptMapper; |
| | | import com.ruoyi.system.mapper.TTaskDetailMapper; |
| | | import com.ruoyi.system.mapper.TTaskMapper; |
| | | import com.ruoyi.system.model.TAppeal; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TTask; |
| | | import com.ruoyi.system.model.TTaskDetail; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.InsepectorListQuery; |
| | | import com.ruoyi.system.service.TAppealService; |
| | | import com.ruoyi.system.vo.system.AppealListVO; |
| | |
| | | @Autowired |
| | | private TDeptMapper deptMapper; |
| | | @Autowired |
| | | private TProjectDeptMapper projectDeptMapper; |
| | | @Autowired |
| | | private TTaskDetailMapper taskDetailMapper; |
| | | @Autowired |
| | | private TTaskMapper taskMapper; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | @Override |
| | | public PageInfo<AppealListVO> pageList(InsepectorListQuery query) { |
| | | PageInfo<AppealListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<AppealListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | List<TTask> tTasks = taskMapper.selectList(null); |
| | | List<SysUser> sysUsers = sysUserMapper.selectAllList(); |
| | | |
| | | for (AppealListVO taskListVO : list) { |
| | | TTask tTask = tTasks.stream().filter(e -> e.getId().equals(taskListVO.getTaskId())).findFirst().orElse(null); |
| | | if (tTask!=null){ |
| | | TDept tDept = deptMapper.selectById(tTask.getPatrolInspectorDept()); |
| | | taskListVO.setDeptName(tDept.getDeptName()); |
| | | SysUser sysUser = sysUsers.stream().filter(e -> e.getUserId().equals(Long.valueOf(tTask.getPatrolInspector()))).findFirst().orElse(null); |
| | | if (sysUser!=null){ |
| | | if (sysUser.getDeptType()==2){ |
| | | TDept tDept = deptMapper.selectById(tTask.getPatrolInspectorDept()); |
| | | if (tDept!=null){ |
| | | taskListVO.setDeptName(tDept.getDeptName()); |
| | | } |
| | | }else{ |
| | | TProjectDept tProjectDept = projectDeptMapper.selectById(tTask.getPatrolInspectorDept()); |
| | | if (tProjectDept!=null){ |
| | | taskListVO.setDeptName(tProjectDept.getProjectName()); |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | |
| | | List<TaskListAllVO> list = this.baseMapper.listAllTask(query,pageInfo); |
| | | for (TaskListAllVO taskListAllVO : list) { |
| | | taskListAllVO.setDistance(taskListAllVO.getDistance().divide(new BigDecimal(1000),2, RoundingMode.HALF_UP)); |
| | | if (taskListAllVO.getStatus()==1 || taskListAllVO.getStatus()==2 || taskListAllVO.getStatus()==3){ |
| | | if (taskListAllVO.getStatus()==1 || taskListAllVO.getStatus()==2 ){ |
| | | taskListAllVO.setStatus(1); |
| | | }else{ |
| | | taskListAllVO.setStatus(2); |