| | |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.repackaged.org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.task.service.ITaskService; |
| | | import org.springblade.modules.task.entity.TaskPlaceRecordEntity; |
| | | import org.springblade.modules.task.service.ITaskPlaceRecordService; |
| | | import org.springblade.modules.task.vo.TaskPlaceRecordVO; |
| | | import org.springblade.modules.task.dto.TaskPlaceSelfCheckDTO; |
| | | import org.springblade.modules.task.entity.TaskEntity; |
| | | import org.springblade.modules.task.entity.TaskPlaceRecordEntity; |
| | | import org.springblade.modules.task.entity.TaskPlaceSelfCheckEntity; |
| | | import org.springblade.modules.task.excel.TaskPlaceSelfCheckExcel; |
| | | import org.springblade.modules.task.vo.TaskPlaceSelfCheckVO; |
| | | import org.springblade.modules.task.mapper.TaskPlaceSelfCheckMapper; |
| | | import org.springblade.modules.task.service.ITaskPlaceRecordService; |
| | | import org.springblade.modules.task.service.ITaskPlaceSelfCheckService; |
| | | import org.springblade.modules.task.service.ITaskService; |
| | | import org.springblade.modules.task.vo.TaskPlaceRecordVO; |
| | | import org.springblade.modules.task.vo.TaskPlaceSelfCheckVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | isState.set(true); |
| | | } |
| | | } |
| | | if (StringUtils.isNotBlank(taskPlaceSelfCheck.getType()) && taskPlaceSelfCheck.getType().equals("2")) { |
| | | // 不存在隐患。状态直接为已审核 |
| | | if (!isState.get()) { |
| | | taskPlaceSelfCheck.setStatus(2); |
| | | taskPlaceSelfCheck.setRectificationFlag(3); |
| | | if (taskPlaceSelfCheck.getTaskId() == null) { |
| | | if (StringUtils.isNotBlank(taskPlaceSelfCheck.getType()) && taskPlaceSelfCheck.getType().equals("2")) { |
| | | // 不存在隐患。状态直接为已审核 |
| | | if (!isState.get()) { |
| | | taskPlaceSelfCheck.setStatus(2); |
| | | taskPlaceSelfCheck.setRectificationFlag(3); |
| | | } else { |
| | | taskPlaceSelfCheck.setStatus(1); |
| | | taskPlaceSelfCheck.setRectificationFlag(1); |
| | | } |
| | | restults = iTaskService.saveTask(CommonConstant.NUMBER_ONE, DictConstant.FIRE_SCHOOL_CHECK_NOTICE, 1, |
| | | "", AuthUtil.getUserId(), taskPlaceSelfCheck.getHouseCode(), CommonConstant.NUMBER_FOUR, taskPlaceSelfCheck.getStatus()); |
| | | } else { |
| | | restults = iTaskService.saveTask(CommonConstant.NUMBER_ONE, DictConstant.FIRE_SELF_CHECK_NOTICE, 1, |
| | | "", AuthUtil.getUserId(), taskPlaceSelfCheck.getHouseCode(), CommonConstant.NUMBER_SEVEN, 1); |
| | | } |
| | | restults = iTaskService.saveTask(CommonConstant.NUMBER_ONE, DictConstant.FIRE_SCHOOL_CHECK_NOTICE, 1, |
| | | "", AuthUtil.getUserId(), taskPlaceSelfCheck.getHouseCode(), CommonConstant.NUMBER_FOUR, taskPlaceSelfCheck.getStatus()); |
| | | if (restults <= 0) { |
| | | return false; |
| | | } |
| | | taskPlaceSelfCheck.setTaskId(restults); |
| | | } else { |
| | | restults = iTaskService.saveTask(CommonConstant.NUMBER_ONE, DictConstant.FIRE_SELF_CHECK_NOTICE, 1, |
| | | "", AuthUtil.getUserId(), taskPlaceSelfCheck.getHouseCode(), CommonConstant.NUMBER_SEVEN, 1); |
| | | iTaskService.update(Wrappers.<TaskEntity>lambdaUpdate() |
| | | .set(TaskEntity::getStatus, taskPlaceSelfCheck.getStatus()) |
| | | .eq(TaskEntity::getId, taskPlaceSelfCheck.getTaskId())); |
| | | } |
| | | if (restults <= 0) { |
| | | return false; |
| | | } |
| | | taskPlaceSelfCheck.setTaskId(restults); |
| | | |
| | | // 2.保存任务详情 |
| | | boolean save = save(taskPlaceSelfCheck); |
| | | boolean save = saveOrUpdate(taskPlaceSelfCheck); |
| | | if (save) { |
| | | // 3.保存题目记录 |
| | | taskPlaceRecordList.stream().forEach(item -> { |