| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | |
| | | |
| | | @Override |
| | | public IPage<TaskPlaceSelfCheckVO> selectTaskPlaceSelfCheckPage(IPage<TaskPlaceSelfCheckVO> page, TaskPlaceSelfCheckVO taskPlaceSelfCheck) { |
| | | return page.setRecords(baseMapper.selectTaskPlaceSelfCheckPage(page, taskPlaceSelfCheck)); |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class,taskPlaceSelfCheck); |
| | | List<TaskPlaceSelfCheckVO> placeCheckVOS = baseMapper.selectTaskPlaceSelfCheckPage(page, |
| | | taskPlaceSelfCheck, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList()); |
| | | for (TaskPlaceSelfCheckVO placeCheckVO : placeCheckVOS) { |
| | | int number = 0; |
| | | for (TaskPlaceRecordVO patrolRecord : placeCheckVO.getTaskPlaceRecordVOList()) { |
| | | if (patrolRecord.getState().equals(0)) { |
| | | number++; |
| | | } |
| | | } |
| | | placeCheckVO.setNumber(number); |
| | | } |
| | | return page.setRecords(placeCheckVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception { |
| | | // 1.更新任务表 |
| | | ITaskService bean2 = SpringUtils.getBean(ITaskService.class); |
| | | Long aLong = bean2.updateTask(null, null, null, taskPlaceSelfCheck.getReasonFailure(), AuthUtil.getUserId(), taskPlaceSelfCheck.getTaskId(), taskPlaceSelfCheck.getStatus()); |
| | | ITaskService taskService = SpringUtils.getBean(ITaskService.class); |
| | | Long aLong = taskService.updateTask(null, null, null, taskPlaceSelfCheck.getReasonFailure(), AuthUtil.getUserId(), taskPlaceSelfCheck.getTaskId(), taskPlaceSelfCheck.getStatus()); |
| | | if (aLong <= 0) { |
| | | return false; |
| | | } |
| | |
| | | if (taskPlaceRecordList != null && taskPlaceRecordList.size() > 0) { |
| | | ITaskPlaceRecordService bean = SpringUtil.getBean(ITaskPlaceRecordService.class); |
| | | List<TaskPlaceRecordEntity> copy = BeanUtil.copy(taskPlaceRecordList, TaskPlaceRecordEntity.class); |
| | | boolean b = bean.updateBatchById(copy); |
| | | boolean b = bean.saveOrUpdateBatch(copy); |
| | | if (b) { |
| | | return b; |
| | | } |