|
|
|
@ -3,8 +3,11 @@ package com.hxhq.business.controller; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import com.hxhq.business.form.study.StudyMethodForm; |
|
|
|
import com.hxhq.common.security.utils.SecurityUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import com.hxhq.business.domain.StudyMethod; |
|
|
|
import com.hxhq.business.service.IStudyMethodService; |
|
|
|
@ -21,8 +24,7 @@ import com.hxhq.common.core.web.page.TableDataInfo; |
|
|
|
*/ |
|
|
|
@RestController |
|
|
|
@RequestMapping("/business/studyMethod") |
|
|
|
public class StudyMethodController extends BaseController |
|
|
|
{ |
|
|
|
public class StudyMethodController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private IStudyMethodService studyMethodService; |
|
|
|
|
|
|
|
@ -30,10 +32,9 @@ public class StudyMethodController extends BaseController |
|
|
|
* 查询试验-试验方法列表 |
|
|
|
*/ |
|
|
|
@GetMapping("/list") |
|
|
|
public TableDataInfo list(StudyMethod studyMethod) |
|
|
|
{ |
|
|
|
public TableDataInfo list(StudyMethodForm form) { |
|
|
|
startPage(); |
|
|
|
List<StudyMethod> list = studyMethodService.queryList(studyMethod); |
|
|
|
List<StudyMethod> list = studyMethodService.queryList(form); |
|
|
|
return getDataTable(list); |
|
|
|
} |
|
|
|
|
|
|
|
@ -41,8 +42,7 @@ public class StudyMethodController extends BaseController |
|
|
|
* 获取试验-试验方法详细信息 |
|
|
|
*/ |
|
|
|
@GetMapping(value = "/info") |
|
|
|
public AjaxResult getInfo(Long id) |
|
|
|
{ |
|
|
|
public AjaxResult getInfo(Long id) { |
|
|
|
return AjaxResult.success(studyMethodService.getById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -50,17 +50,10 @@ public class StudyMethodController extends BaseController |
|
|
|
* 新增试验-试验方法信息 |
|
|
|
*/ |
|
|
|
@PostMapping("/save") |
|
|
|
public AjaxResult save(@RequestBody StudyMethod studyMethod) |
|
|
|
{ |
|
|
|
return toAjax(studyMethodService.saveOrUpdate(studyMethod)); |
|
|
|
public AjaxResult save(@RequestBody @Validated StudyMethodForm form) { |
|
|
|
form.setQmrId(SecurityUtils.getUserId()); |
|
|
|
studyMethodService.save(form); |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除试验-试验方法信息 |
|
|
|
*/ |
|
|
|
@PostMapping("/delete") |
|
|
|
public AjaxResult delete(@RequestBody Long[] ids) |
|
|
|
{ |
|
|
|
return toAjax(studyMethodService.removeByIds(Arrays.asList(ids))); |
|
|
|
} |
|
|
|
} |