Commit a0c2da41 authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents f6fd3269 e200ebf3
......@@ -13,4 +13,7 @@ public interface StandardMapper extends BaseMapper<Standard> {
// 分页查询
List<Standard> findList(@Param("params") StandardListRequest request);
// 根据id查询
Standard findListById(@Param("id") Long Id);
}
......@@ -10,4 +10,7 @@ import java.util.List;
@Repository
public interface SystemReviewTaskMapper extends BaseMapper<SystemReviewTask> {
List<SystemReviewTask> findListByStatus(@Param("status") String status);
// 查询处理中的任务
List<SystemReviewTask> findListInProcess();
}
......@@ -13,4 +13,7 @@ public interface StandardService extends IService<Standard> {
// 分页查询
List<Standard> findList(StandardListRequest request);
//根据id查询
Standard findListById(Long id);
}
......@@ -40,4 +40,10 @@ public interface SystemReviewTaskService extends IService<SystemReviewTask> {
*/
List<SystemReviewTask> findListByStatus(String status);
/**
* 查询处理中的任务
* @return
*/
List<SystemReviewTask> findListInProcess();
}
......@@ -25,4 +25,14 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
public List<Standard> findList(StandardListRequest request) {
return standardMapper.findList(request);
}
/**
* 根据id查询
* @param id
* @return
*/
@Override
public Standard findListById(Long id) {
return standardMapper.findListById(id);
}
}
......@@ -42,6 +42,9 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
@Autowired
private ISysUserService sysUserService;
@Autowired
private StandardService standardService;
@Override
public void createTaskTest(SystemReviewTaskCreateRequest request) {
......@@ -49,6 +52,7 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
// 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser initiator = sysUserService.selectUserById(loginUser.getUserId());
Standard standard = standardService.findListById(request.getStandardId());
// 找到审查组长
SystemReviewTaskUserRelation leader = null;
......@@ -69,7 +73,11 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
.setBizInfo(request.getBizInfo())
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
.setCreateTime(new Date());
.setCreateTime(new Date())
.setStandardId(standard.getId())
.setName(standard.getName())
.setStandardNo(standard.getStandardNo())
.setFile(standard.getFile());
systemReviewTaskService.save(task);
......@@ -98,6 +106,11 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
return systemReviewTaskMapper.findListByStatus(status);
}
@Override
public List<SystemReviewTask> findListInProcess() {
return systemReviewTaskMapper.findListInProcess();
}
}
......
......@@ -4,11 +4,11 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.SystemReviewTask;
import com.ruoyi.service.SystemReviewTaskService;
import com.ruoyi.web.request.SystemReviewTaskCreateRequest;
import com.ruoyi.web.request.SystemReviewTaskStartRequest;
import com.ruoyi.web.request.SystemReviewTaskViewRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -22,6 +22,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@Api("体系审查任务")
@RestController
@RequestMapping("/system/review/task")
......@@ -57,4 +60,22 @@ public class SystemReviewTaskController extends BaseController {
systemReviewTaskService.start(request);
return R.ok();
}
@ApiOperation("查询处理中的任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findInProcess")
public TableDataInfo<SystemReviewTask> findInProcess(@Validated @RequestBody SystemReviewTaskFindInProcessRequest request) {
startPage(request);
return getDataTable(systemReviewTaskService.findListInProcess());
}
@ApiOperation("查询处理完成的任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findInFinish")
public TableDataInfo<SystemReviewTask> findInFinish(@Validated @RequestBody SystemReviewTaskFindFinishRequest request) {
startPage(request);
return getDataTable(systemReviewTaskService.findListByStatus(SystemReviewTask.STATUS_FINISH));
}
}
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
@ApiModel
public class SystemReviewTaskFindFinishRequest extends PageDomain {
}
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
@ApiModel
public class SystemReviewTaskFindInProcessRequest extends PageDomain {
}
......@@ -24,4 +24,9 @@
</where>
</select>
<select id="findListById" resultMap="BaseResultMap">
SELECT id, name, standard_no, file
FROM t_standard WHERE id = #{id}
</select>
</mapper>
......@@ -25,6 +25,13 @@
<select id="findListByStatus" resultMap="BaseResultMap">
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file
FROM t_system_review_task WHERE task_status = #{status}
ORDER BY create_time DESC
</select>
<select id="findListInProcess" resultMap="BaseResultMap">
SELECT id, task_no, task_status, task_initiator, task_initiator_dept, task_result, task_begin_time, task_end_time, standard, biz_info, create_time, standard_id, name, standard_no, file
FROM t_system_review_task WHERE task_status IN ('NEW','PENDING')
ORDER BY create_time DESC
</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