|
|
|
@@ -29,83 +29,83 @@ import cn.iocoder.yudao.module.farm.controller.admin.indicatorname.vo.*;
|
|
|
|
import cn.iocoder.yudao.module.farm.dal.dataobject.indicatorname.IndicatorNameDO;
|
|
|
|
import cn.iocoder.yudao.module.farm.dal.dataobject.indicatorname.IndicatorNameDO;
|
|
|
|
import cn.iocoder.yudao.module.farm.service.indicatorname.IndicatorNameService;
|
|
|
|
import cn.iocoder.yudao.module.farm.service.indicatorname.IndicatorNameService;
|
|
|
|
|
|
|
|
|
|
|
|
@Tag(name = "管理后台 - 指标名称")
|
|
|
|
//@Tag(name = "管理后台 - 指标名称")
|
|
|
|
@RestController
|
|
|
|
//@RestController
|
|
|
|
@RequestMapping("/farm/indicator-name")
|
|
|
|
//@RequestMapping("/farm/indicator-name")
|
|
|
|
@Validated
|
|
|
|
//@Validated
|
|
|
|
public class IndicatorNameController {
|
|
|
|
public class IndicatorNameController {
|
|
|
|
|
|
|
|
//
|
|
|
|
@Resource
|
|
|
|
// @Resource
|
|
|
|
private IndicatorNameService indicatorNameService;
|
|
|
|
// private IndicatorNameService indicatorNameService;
|
|
|
|
|
|
|
|
//
|
|
|
|
@PostMapping("/create")
|
|
|
|
// @PostMapping("/create")
|
|
|
|
@Operation(summary = "创建指标名称")
|
|
|
|
// @Operation(summary = "创建指标名称")
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:create')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:create')")
|
|
|
|
public CommonResult<Long> createIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO createReqVO) {
|
|
|
|
// public CommonResult<Long> createIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO createReqVO) {
|
|
|
|
return success(indicatorNameService.createIndicatorName(createReqVO));
|
|
|
|
// return success(indicatorNameService.createIndicatorName(createReqVO));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
@PutMapping("/update")
|
|
|
|
// @PutMapping("/update")
|
|
|
|
@Operation(summary = "更新指标名称")
|
|
|
|
// @Operation(summary = "更新指标名称")
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:update')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:update')")
|
|
|
|
public CommonResult<Boolean> updateIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO updateReqVO) {
|
|
|
|
// public CommonResult<Boolean> updateIndicatorName(@Valid @RequestBody IndicatorNameSaveReqVO updateReqVO) {
|
|
|
|
indicatorNameService.updateIndicatorName(updateReqVO);
|
|
|
|
// indicatorNameService.updateIndicatorName(updateReqVO);
|
|
|
|
return success(true);
|
|
|
|
// return success(true);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
@DeleteMapping("/delete")
|
|
|
|
// @DeleteMapping("/delete")
|
|
|
|
@Operation(summary = "删除指标名称")
|
|
|
|
// @Operation(summary = "删除指标名称")
|
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
|
// @Parameter(name = "id", description = "编号", required = true)
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
|
|
|
public CommonResult<Boolean> deleteIndicatorName(@RequestParam("id") Long id) {
|
|
|
|
// public CommonResult<Boolean> deleteIndicatorName(@RequestParam("id") Long id) {
|
|
|
|
indicatorNameService.deleteIndicatorName(id);
|
|
|
|
// indicatorNameService.deleteIndicatorName(id);
|
|
|
|
return success(true);
|
|
|
|
// return success(true);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
@DeleteMapping("/delete-list")
|
|
|
|
// @DeleteMapping("/delete-list")
|
|
|
|
@Parameter(name = "ids", description = "编号", required = true)
|
|
|
|
// @Parameter(name = "ids", description = "编号", required = true)
|
|
|
|
@Operation(summary = "批量删除指标名称")
|
|
|
|
// @Operation(summary = "批量删除指标名称")
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:delete')")
|
|
|
|
public CommonResult<Boolean> deleteIndicatorNameList(@RequestParam("ids") List<Long> ids) {
|
|
|
|
// public CommonResult<Boolean> deleteIndicatorNameList(@RequestParam("ids") List<Long> ids) {
|
|
|
|
indicatorNameService.deleteIndicatorNameListByIds(ids);
|
|
|
|
// indicatorNameService.deleteIndicatorNameListByIds(ids);
|
|
|
|
return success(true);
|
|
|
|
// return success(true);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
@GetMapping("/get")
|
|
|
|
// @GetMapping("/get")
|
|
|
|
@Operation(summary = "获得指标名称")
|
|
|
|
// @Operation(summary = "获得指标名称")
|
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
|
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
|
|
|
public CommonResult<IndicatorNameRespVO> getIndicatorName(@RequestParam("id") Long id) {
|
|
|
|
// public CommonResult<IndicatorNameRespVO> getIndicatorName(@RequestParam("id") Long id) {
|
|
|
|
IndicatorNameDO indicatorName = indicatorNameService.getIndicatorName(id);
|
|
|
|
// IndicatorNameDO indicatorName = indicatorNameService.getIndicatorName(id);
|
|
|
|
return success(BeanUtils.toBean(indicatorName, IndicatorNameRespVO.class));
|
|
|
|
// return success(BeanUtils.toBean(indicatorName, IndicatorNameRespVO.class));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
@GetMapping("/page")
|
|
|
|
// @GetMapping("/page")
|
|
|
|
@Operation(summary = "获得指标名称分页")
|
|
|
|
// @Operation(summary = "获得指标名称分页")
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
|
|
|
public CommonResult<PageResult<IndicatorNameRespVO>> getIndicatorNamePage(@Valid IndicatorNamePageReqVO pageReqVO) {
|
|
|
|
// public CommonResult<PageResult<IndicatorNameRespVO>> getIndicatorNamePage(@Valid IndicatorNamePageReqVO pageReqVO) {
|
|
|
|
PageResult<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNamePage(pageReqVO);
|
|
|
|
// PageResult<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNamePage(pageReqVO);
|
|
|
|
return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
|
|
|
// return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
@GetMapping("/list")
|
|
|
|
// @GetMapping("/list")
|
|
|
|
@Operation(summary = "获得指标名称全量")
|
|
|
|
// @Operation(summary = "获得指标名称全量")
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
|
|
|
public CommonResult<List<IndicatorNameRespVO>> getIndicatorNameList(@Valid IndicatorNamePageReqVO pageReqVO) {
|
|
|
|
// public CommonResult<List<IndicatorNameRespVO>> getIndicatorNameList(@Valid IndicatorNamePageReqVO pageReqVO) {
|
|
|
|
List<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNameList(pageReqVO);
|
|
|
|
// List<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNameList(pageReqVO);
|
|
|
|
return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
|
|
|
// return success(BeanUtils.toBean(pageResult, IndicatorNameRespVO.class));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
@GetMapping("/export-excel")
|
|
|
|
// @GetMapping("/export-excel")
|
|
|
|
@Operation(summary = "导出指标名称 Excel")
|
|
|
|
// @Operation(summary = "导出指标名称 Excel")
|
|
|
|
@PreAuthorize("@ss.hasPermission('farm:indicator-name:export')")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('farm:indicator-name:export')")
|
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
|
// @ApiAccessLog(operateType = EXPORT)
|
|
|
|
public void exportIndicatorNameExcel(@Valid IndicatorNamePageReqVO pageReqVO,
|
|
|
|
// public void exportIndicatorNameExcel(@Valid IndicatorNamePageReqVO pageReqVO,
|
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
|
// HttpServletResponse response) throws IOException {
|
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
List<IndicatorNameDO> list = indicatorNameService.getIndicatorNamePage(pageReqVO).getList();
|
|
|
|
// List<IndicatorNameDO> list = indicatorNameService.getIndicatorNamePage(pageReqVO).getList();
|
|
|
|
// 导出 Excel
|
|
|
|
// // 导出 Excel
|
|
|
|
ExcelUtils.write(response, "指标名称.xls", "数据", IndicatorNameRespVO.class,
|
|
|
|
// ExcelUtils.write(response, "指标名称.xls", "数据", IndicatorNameRespVO.class,
|
|
|
|
BeanUtils.toBean(list, IndicatorNameRespVO.class));
|
|
|
|
// BeanUtils.toBean(list, IndicatorNameRespVO.class));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|