创建检查套餐时验证套餐ID
This commit is contained in:
parent
0c2c8e84a8
commit
12025f2d4e
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.inspect.service.exammodule;
|
package cn.iocoder.yudao.module.inspect.service.exammodule;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.inspect.dal.dataobject.inspectitems.InspectitemsDO;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -31,6 +32,15 @@ public class ExammoduleServiceImpl implements ExammoduleService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer createExammodule(ExammoduleSaveReqVO createReqVO) {
|
public Integer createExammodule(ExammoduleSaveReqVO createReqVO) {
|
||||||
|
|
||||||
|
//验证itemCode是否存在
|
||||||
|
QueryWrapper<ExammoduleDO> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("examModuleID", createReqVO.getExamModuleID());
|
||||||
|
boolean exists = exammoduleMapper.selectCount(wrapper) > 0;
|
||||||
|
if(exists)
|
||||||
|
{
|
||||||
|
return 999;
|
||||||
|
}
|
||||||
// 插入
|
// 插入
|
||||||
ExammoduleDO exammodule = BeanUtils.toBean(createReqVO, ExammoduleDO.class);
|
ExammoduleDO exammodule = BeanUtils.toBean(createReqVO, ExammoduleDO.class);
|
||||||
exammoduleMapper.insert(exammodule);
|
exammoduleMapper.insert(exammodule);
|
||||||
|
Loading…
Reference in New Issue
Block a user