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.module.pms.coalquality.modules.detection.dto.QualityDetectionDTO; import com.iailab.module.pms.coalquality.modules.detection.service.QualityDetectionService; import com.iailab.module.pms.coalquality.modules.detection.vo.DetectionPageReqVO; 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日 13:15:00 */ @Slf4j @RestController @RequestMapping("/coal-quality/quality/detection") @Tag(name = "煤质检测") public class QualityDetectionController { @Autowired private QualityDetectionService qualityDetectionService; private String DICT_CODE = "mzzb"; @GetMapping("page") @Operation(summary = "分页") public CommonResult> page(DetectionPageReqVO reqVO) { PageResult page = qualityDetectionService.page(reqVO); return success(page); } @GetMapping("/get") @Operation(summary ="信息") public CommonResult get(String id) { QualityDetectionDTO data = qualityDetectionService.get(id); return success(data); } @PostMapping("/create") @Operation(summary ="保存") public CommonResult create(@RequestBody QualityDetectionDTO dto) { // if (qualityDetectionService.cheack(dto) > 0) { // return new CommonResult().error("编号重复"); // } qualityDetectionService.save(dto); return success(true); } @PutMapping("/update") @Operation(summary ="修改") public CommonResult update(@RequestBody QualityDetectionDTO dto) { // if (qualityDetectionService.cheack(dto) > 0) { // return new CommonResult().error("编号重复"); // } qualityDetectionService.update(dto); return success(true); } @DeleteMapping("/delete") @Operation(summary ="删除") public CommonResult delete(@RequestBody String[] ids) { qualityDetectionService.delete(ids); return success(true); } }