package com.ltkj.web.controller.system;
|
|
import java.util.Arrays;
|
import java.util.List;
|
import javax.servlet.http.HttpServletResponse;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import com.ltkj.common.annotation.Log;
|
import com.ltkj.common.core.controller.BaseController;
|
import com.ltkj.common.core.domain.AjaxResult;
|
import com.ltkj.common.enums.BusinessType;
|
import com.ltkj.hosp.domain.TjGroupingPro;
|
import com.ltkj.hosp.service.ITjGroupingProService;
|
import com.ltkj.common.utils.poi.ExcelUtil;
|
import com.ltkj.common.core.page.TableDataInfo;
|
|
/**
|
* 体检项目分组Controller
|
*
|
* @author ltkj_赵佳豪&李格
|
* @date 2023-08-07
|
*/
|
@RestController
|
@RequestMapping("/hosp/dwpro")
|
@Api(tags = "PC端--团体--体检分组项目接口")
|
public class TjGroupingProController extends BaseController {
|
@Autowired
|
private ITjGroupingProService tjGroupingProService;
|
|
/**
|
* 查询体检项目分组列表
|
*/
|
//@PreAuthorize("@ss.hasPermi('hosp:pro:list')")
|
@GetMapping("/list")
|
@ApiOperation(value = "查询单位分组项目列表")
|
public TableDataInfo list(TjGroupingPro tjGroupingPro) {
|
startPage();
|
List<TjGroupingPro> list = tjGroupingProService.selectTjGroupingProList(tjGroupingPro);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出体检项目分组列表
|
*/
|
// @PreAuthorize("@ss.hasPermi('hosp:pro:export')")
|
@Log(title = "体检项目分组", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, TjGroupingPro tjGroupingPro) {
|
List<TjGroupingPro> list = tjGroupingProService.selectTjGroupingProList(tjGroupingPro);
|
ExcelUtil<TjGroupingPro> util = new ExcelUtil<TjGroupingPro>(TjGroupingPro. class);
|
util.exportExcel(response, list, "体检项目分组数据");
|
}
|
|
/**
|
* 获取体检项目分组详细信息
|
*/
|
// @PreAuthorize("@ss.hasPermi('hosp:pro:query')")
|
@GetMapping(value = "/{id}")
|
@ApiOperation(value = "查询单位分组项目详细信息")
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
return success(tjGroupingProService.selectTjGroupingProById(id));
|
}
|
|
/**
|
* 新增体检项目分组
|
*/
|
// @PreAuthorize("@ss.hasPermi('hosp:pro:add')")
|
// @Log(title = "体检项目分组", businessType = BusinessType.INSERT)
|
@PostMapping
|
@ApiOperation(value = "新增单位分组项目")
|
public AjaxResult add(@RequestBody TjGroupingPro tjGroupingPro) {
|
return toAjax(tjGroupingProService.save(tjGroupingPro));
|
}
|
|
/**
|
* 修改体检项目分组
|
*/
|
// @PreAuthorize("@ss.hasPermi('hosp:pro:edit')")
|
// @Log(title = "体检项目分组", businessType = BusinessType.UPDATE)
|
@PutMapping
|
@ApiOperation(value = "修改单位分组项目详细信息")
|
public AjaxResult edit(@RequestBody TjGroupingPro tjGroupingPro) {
|
return toAjax(tjGroupingProService.updateById(tjGroupingPro));
|
}
|
|
/**
|
* 删除体检项目分组
|
*/
|
// @PreAuthorize("@ss.hasPermi('hosp:pro:remove')")
|
// @Log(title = "体检项目分组", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
@ApiOperation(value = "删除单位分组项目")
|
public AjaxResult remove(@PathVariable String[] ids) {
|
return toAjax(tjGroupingProService.removeByIds(Arrays.asList(ids)));
|
}
|
}
|