新增方法: 增加 创建体检套餐和项目接口以及按照套餐ID删除套餐接口
This commit is contained in:
parent
bf96597c85
commit
0c2c8e84a8
@ -44,6 +44,12 @@ public class ExammoduleController {
|
|||||||
public CommonResult<Integer> createExammodule(@Valid @RequestBody ExammoduleSaveReqVO createReqVO) {
|
public CommonResult<Integer> createExammodule(@Valid @RequestBody ExammoduleSaveReqVO createReqVO) {
|
||||||
return success(exammoduleService.createExammodule(createReqVO));
|
return success(exammoduleService.createExammodule(createReqVO));
|
||||||
}
|
}
|
||||||
|
@Operation(summary = "创建体检套餐和项目")
|
||||||
|
public CommonResult<Boolean> ListcreateExammodule(@Valid @RequestBody List<ExammoduleSaveReqVO> createReqVO)
|
||||||
|
{
|
||||||
|
return success(exammoduleService.ListcreateExammodule(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新体检套餐")
|
@Operation(summary = "更新体检套餐")
|
||||||
@ -59,6 +65,13 @@ public class ExammoduleController {
|
|||||||
exammoduleService.deleteExammodule(id);
|
exammoduleService.deleteExammodule(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
@DeleteMapping("/deleteModuleid")
|
||||||
|
@Operation(summary = "按照套餐ID删除体检套餐")
|
||||||
|
public CommonResult<Boolean> deleteExammoduleModuleID(@RequestParam("examModuleID") Integer ModuleID)
|
||||||
|
{
|
||||||
|
exammoduleService.deleteExammoduleModuleID(ModuleID);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得体检套餐")
|
@Operation(summary = "获得体检套餐")
|
||||||
|
@ -22,6 +22,10 @@ public interface ExammoduleService {
|
|||||||
* @return 编号
|
* @return 编号
|
||||||
*/
|
*/
|
||||||
Integer createExammodule(@Valid ExammoduleSaveReqVO createReqVO);
|
Integer createExammodule(@Valid ExammoduleSaveReqVO createReqVO);
|
||||||
|
/**
|
||||||
|
* 创建体检套餐 加项目
|
||||||
|
* **/
|
||||||
|
Boolean ListcreateExammodule(List<ExammoduleSaveReqVO> createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新体检套餐
|
* 更新体检套餐
|
||||||
@ -36,6 +40,10 @@ public interface ExammoduleService {
|
|||||||
* @param id 编号
|
* @param id 编号
|
||||||
*/
|
*/
|
||||||
void deleteExammodule(Integer id);
|
void deleteExammodule(Integer id);
|
||||||
|
/*
|
||||||
|
* 按照体检套餐ID删除数据
|
||||||
|
* */
|
||||||
|
void deleteExammoduleModuleID(Integer moduleid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得体检套餐
|
* 获得体检套餐
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package cn.iocoder.yudao.module.inspect.service.exammodule;
|
package cn.iocoder.yudao.module.inspect.service.exammodule;
|
||||||
|
|
||||||
|
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;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import cn.iocoder.yudao.module.inspect.controller.admin.exammodule.vo.*;
|
import cn.iocoder.yudao.module.inspect.controller.admin.exammodule.vo.*;
|
||||||
import cn.iocoder.yudao.module.inspect.dal.dataobject.exammodule.ExammoduleDO;
|
import cn.iocoder.yudao.module.inspect.dal.dataobject.exammodule.ExammoduleDO;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.inspect.dal.mysql.exammodule.ExammoduleMapper;
|
import cn.iocoder.yudao.module.inspect.dal.mysql.exammodule.ExammoduleMapper;
|
||||||
@ -38,6 +37,13 @@ public class ExammoduleServiceImpl implements ExammoduleService {
|
|||||||
// 返回
|
// 返回
|
||||||
return exammodule.getId();
|
return exammodule.getId();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public Boolean ListcreateExammodule(List<ExammoduleSaveReqVO> createReqVO)
|
||||||
|
{
|
||||||
|
List<ExammoduleDO> exammodule = BeanUtils.toBean(createReqVO, ExammoduleDO.class);
|
||||||
|
return exammoduleMapper.insertBatch(exammodule);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateExammodule(ExammoduleSaveReqVO updateReqVO) {
|
public void updateExammodule(ExammoduleSaveReqVO updateReqVO) {
|
||||||
@ -55,6 +61,13 @@ public class ExammoduleServiceImpl implements ExammoduleService {
|
|||||||
// 删除
|
// 删除
|
||||||
exammoduleMapper.deleteById(id);
|
exammoduleMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void deleteExammoduleModuleID(Integer moduleid)
|
||||||
|
{
|
||||||
|
QueryWrapper<ExammoduleDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("examModuleID", moduleid);
|
||||||
|
exammoduleMapper.delete(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
private void validateExammoduleExists(Integer id) {
|
private void validateExammoduleExists(Integer id) {
|
||||||
if (exammoduleMapper.selectById(id) == null) {
|
if (exammoduleMapper.selectById(id) == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user