zhongrj
2024-01-08 ae935b68e75e7c90e27aecedefa971106927c38d
src/main/java/org/springblade/modules/task/service/impl/TaskLabelReportingEventServiceImpl.java
@@ -20,6 +20,7 @@
import org.springblade.common.constant.DictConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.task.dto.TaskLabelReportingEventDTO;
import org.springblade.modules.task.entity.TaskLabelReportingEventEntity;
import org.springblade.modules.task.mapper.TaskLabelReportingEventMapper;
import org.springblade.modules.task.service.ITaskLabelReportingEventService;
@@ -28,6 +29,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
/**
 * 打金店报事 服务实现类
@@ -47,7 +49,7 @@
   }
   @Override
   public Boolean saveReportingEven(TaskLabelReportingEventEntity taskLabelReportingEvent) {
   public Boolean saveReportingEven(TaskLabelReportingEventDTO taskLabelReportingEvent) {
      String name;
      switch (taskLabelReportingEvent.getEventType()) {
         case "1":
@@ -62,22 +64,30 @@
         default:
            name = "";
      }
      Long aLong = taskService.saveTask(1, name, 1, "", AuthUtil.getUserId());
      Long aLong = taskService.saveTask(1, name, 1, "", AuthUtil.getUserId(),taskLabelReportingEvent.getHouseCode(),taskLabelReportingEvent.getReportType());
      if (aLong > 0) {
         taskLabelReportingEvent.setTaskId(aLong);
         taskLabelReportingEvent.setUserId(AuthUtil.getUserId());
         return baseMapper.insert(taskLabelReportingEvent) > 0 ? true : false;
         taskLabelReportingEvent.setLabelName(name);
         return baseMapper.insert(taskLabelReportingEvent) > 0;
      }
      return false;
   }
   @Override
   public Boolean updateLabelReporting(TaskLabelReportingEventEntity taskLabelReportingEvent) {
   public Boolean updateLabelReporting(TaskLabelReportingEventEntity taskLabelReportingEvent) throws Exception {
      Long aLong = taskService.updateTask(null, null, null, "", AuthUtil.getUserId(),
         taskLabelReportingEvent.getTaskId(), taskLabelReportingEvent.getStatus());
      if (aLong > 0) {
         return baseMapper.updateById(taskLabelReportingEvent) > 0 ? true : false;
         taskLabelReportingEvent.setConfirmFlag(taskLabelReportingEvent.getStatus().toString());
         taskLabelReportingEvent.setConfirmUserId(AuthUtil.getUserId());
         taskLabelReportingEvent.setConfirmTime(new Date());
         Boolean b = baseMapper.updateById(taskLabelReportingEvent) > 0;
         if (b) {
            return b;
         }
         throw new Exception("更新失败!");
      }
      return false;
   }