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

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents adf5a655 329111dc
...@@ -22,4 +22,6 @@ public interface TaskSampleRelationMapper extends BaseMapper<TaskSampleRelation> ...@@ -22,4 +22,6 @@ public interface TaskSampleRelationMapper extends BaseMapper<TaskSampleRelation>
/** /**
* 根据样品id查询*/ * 根据样品id查询*/
List<SampleTaskVo> selectTaskBysampleId(@Param("idList") List<Long> idList); List<SampleTaskVo> selectTaskBysampleId(@Param("idList") List<Long> idList);
public int selectTaskSumBySampleId(@Param("sampleId") Long sampleId);
} }
...@@ -3,7 +3,9 @@ package com.ruoyi.web; ...@@ -3,7 +3,9 @@ package com.ruoyi.web;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.Sample; import com.ruoyi.domain.Sample;
import com.ruoyi.mapper.TaskSampleRelationMapper;
import com.ruoyi.service.SampleManagementService; import com.ruoyi.service.SampleManagementService;
import com.ruoyi.web.request.SampleManagementGetInfoRequest; import com.ruoyi.web.request.SampleManagementGetInfoRequest;
import com.ruoyi.web.request.SampleManagementRequest; import com.ruoyi.web.request.SampleManagementRequest;
...@@ -35,6 +37,9 @@ public class SampleManagementController extends BaseController ...@@ -35,6 +37,9 @@ public class SampleManagementController extends BaseController
@Autowired @Autowired
private SampleManagementService sampleManagementService; private SampleManagementService sampleManagementService;
@Autowired
private TaskSampleRelationMapper taskSampleRelationMapper;
/** /**
* 查询样品管理列表 * 查询样品管理列表
*/ */
...@@ -99,6 +104,10 @@ public class SampleManagementController extends BaseController ...@@ -99,6 +104,10 @@ public class SampleManagementController extends BaseController
@PostMapping ("/del") @PostMapping ("/del")
public AjaxResult remove(@Validated @RequestBody SampleManagementGetInfoRequest request) public AjaxResult remove(@Validated @RequestBody SampleManagementGetInfoRequest request)
{ {
int num = taskSampleRelationMapper.selectTaskSumBySampleId(request.getId());
if(num>0){
throw new ServiceException("已有相关任务,不允许删除");
}
return toAjax(sampleManagementService.removeById(request.getId())); return toAjax(sampleManagementService.removeById(request.getId()));
} }
......
...@@ -39,4 +39,12 @@ ...@@ -39,4 +39,12 @@
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="selectTaskSumBySampleId">
select
count(task_id)
FROM
t_task_sample_relation
where sample_id = #{sampleId}
</select>
</mapper> </mapper>
\ No newline at end of file
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