Commit 6b99ab2b authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents 621ec2b3 8fe49413
......@@ -35,4 +35,6 @@ public interface TaskMapper extends BaseMapper<Task> {
Task getByUserIdTemporary(@Param("userId") Long userId);
Task getBySubtaskId(@Param("subId") Long subId);
Long findTaskName(@Param("taskName") String taskName);
}
......@@ -5,8 +5,10 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.DataStatisticsUtils;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
......@@ -17,6 +19,7 @@ import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.DataStatisticsResponse;
import com.ruoyi.web.response.ResultCountResponse;
import com.ruoyi.web.response.TaskFindResponse;
import com.ruoyi.web.response.TaskGetInfoResponse;
import org.apache.poi.ss.formula.functions.T;
......@@ -105,6 +108,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
@Override
public void createTask(TaskCreateRequest request) {
Long sum = taskMapper.findTaskName(request.getTaskName());
if (sum > 0) {
throw new ServiceException("任务名称重复,请检查", HttpStatus.ERROR);
} else {
// 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser initiator = sysUserService.selectUserById(loginUser.getUserId());
......@@ -171,6 +179,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
taskMapper.deleteById(temporaryStorageTask.getId());
}
}
}
@Override
public List<TaskFindResponse> findPending(TaskFindPendingRequest request,Long userId) {
......
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("计算问卷结果VO")
public class ResultCountResponse {
@ApiModelProperty("任务id")
private Long taskId;
@ApiModelProperty("任务状态")
private String taskStatus;
@ApiModelProperty("进度")
private Double schedule;
}
......@@ -277,6 +277,10 @@
FROM t_task
WHERE system_review_task_id = #{subId} OR car_review_task_id = #{subId}
</select>
<select id="findTaskName" resultType="java.lang.Long">
select COUNT(*) sum from t_task
where task_name = #{taskName}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment