linwei
2024-01-08 ad2ec97fe0c60eee4bb7c8cdacff7c876f280ea7
src/main/java/org/springblade/modules/task/service/impl/TaskHotelReportingServiceImpl.java
@@ -27,8 +27,10 @@
import org.springblade.modules.task.service.ITaskService;
import org.springblade.modules.task.vo.TaskHotelReportingVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
/**
 * 旅馆安全自查任务 服务实现类
@@ -50,21 +52,29 @@
   @Override
   public boolean saveHotelReporting(TaskHotelReportingDTO taskHotelReporting) {
      Long aLong = taskService.saveTask(2, DictConstant.HOTEL_SECURITY, 1, "", AuthUtil.getUserId(),taskHotelReporting.getHouseCode(),taskHotelReporting.getReportType());
      Long aLong = taskService.saveTask(2, DictConstant.HOTEL_SECURITY, 1, "", AuthUtil.getUserId(), taskHotelReporting.getHouseCode(), taskHotelReporting.getReportType());
      if (aLong > 0) {
         taskHotelReporting.setTaskId(aLong);
         taskHotelReporting.setCheckUserId(AuthUtil.getUserId());
         return baseMapper.insert(taskHotelReporting) > 0 ? true : false;
         return baseMapper.insert(taskHotelReporting) > 0;
      }
      return false;
   }
   @Override
   public Boolean updateHotelReporting(TaskHotelReportingEntity taskHotelReporting) {
   @Transactional(rollbackFor = Exception.class)
   public Boolean updateHotelReporting(TaskHotelReportingEntity taskHotelReporting) throws Exception {
      Long aLong = taskService.updateTask(null, null, null, "", AuthUtil.getUserId(), taskHotelReporting.getTaskId(), taskHotelReporting.getStatus());
      if (aLong > 0) {
         return baseMapper.updateById(taskHotelReporting) > 0 ? true : false;
         taskHotelReporting.setConfirmFlag(taskHotelReporting.getStatus().toString());
         taskHotelReporting.setConfirmUserId(AuthUtil.getUserId());
         taskHotelReporting.setConfirmTime(new Date());
         boolean b = baseMapper.updateById(taskHotelReporting) > 0;
         if (b) {
            return b;
         }
         throw new Exception("更新失败!");
      }
      return false;
   }