package com.iailab.module.pms.coalquality.modules.detection.controller.admin;
|
|
|
import com.iailab.framework.common.pojo.CommonResult;
|
import com.iailab.framework.common.pojo.PageResult;
|
import com.iailab.iems.common.validator.AssertUtils;
|
import com.iailab.module.pms.coalquality.modules.detection.dto.QualityTailingDTO;
|
import com.iailab.module.pms.coalquality.modules.detection.service.QualityTailingService;
|
import com.iailab.module.pms.coalquality.modules.detection.vo.TailingPageReqVO;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import static com.iailab.framework.common.pojo.CommonResult.success;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2023年02月07日 17:37:00
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/xmcpms/quality/tailing")
|
@Tag(name = "尾矿检测")
|
public class QualityTailingController {
|
@Autowired
|
private QualityTailingService qualityTailingService;
|
|
@GetMapping("page")
|
@Operation(summary = "分页")
|
public CommonResult<PageResult<QualityTailingDTO>> page(TailingPageReqVO tailingPageReqVO){
|
PageResult<QualityTailingDTO> page = qualityTailingService.page(tailingPageReqVO);
|
|
return success(page);
|
}
|
|
@GetMapping("{id}")
|
@Operation(summary ="信息")
|
public CommonResult<QualityTailingDTO> get(@PathVariable("id") String id){
|
QualityTailingDTO data = qualityTailingService.get(id);
|
return success(data);
|
}
|
|
@PostMapping
|
@Operation(summary ="保存")
|
public CommonResult<Boolean> save(@RequestBody QualityTailingDTO dto){
|
|
qualityTailingService.save(dto);
|
|
return success(true);
|
}
|
|
@PutMapping
|
@Operation(summary ="修改")
|
public CommonResult<Boolean> update(@RequestBody QualityTailingDTO dto){
|
//
|
// if (qualityTailingService.cheack(dto) > 0) {
|
// return new CommonResult().error("编号重复");
|
// }
|
|
qualityTailingService.update(dto);
|
|
return success(true);
|
}
|
|
@DeleteMapping
|
@Operation(summary ="删除")
|
public CommonResult<Boolean> delete(@RequestBody String[] ids){
|
//效验数据
|
AssertUtils.isArrayEmpty(ids, "id");
|
|
qualityTailingService.delete(ids);
|
|
return success(true);
|
}
|
|
}
|