package com.qianwen.smartman.modules.andon.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.List; import javax.validation.Valid; import com.qianwen.smartman.common.cache.RegionCache; import com.qianwen.core.boot.ctrl.BladeController; import com.qianwen.core.scanner.modular.annotation.DeleteResource; import com.qianwen.core.scanner.modular.annotation.GetResource; import com.qianwen.core.scanner.modular.annotation.PostResource; import com.qianwen.core.scanner.modular.annotation.PutResource; import com.qianwen.core.scanner.modular.stereotype.ApiResource; import com.qianwen.core.secure.annotation.PreAuth; import com.qianwen.core.tool.api.R; import com.qianwen.core.tool.utils.Func; import com.qianwen.smartman.modules.andon.service.IAndonTypeService; import com.qianwen.smartman.modules.andon.vo.AndonTypeDetailVO; import com.qianwen.smartman.modules.andon.vo.AndonTypeSaveVO; import com.qianwen.smartman.modules.andon.vo.AndonTypeUpdateVO; import com.qianwen.smartman.modules.andon.vo.AndonTypeVO; import com.qianwen.smartman.modules.andon.vo.BindingDeviceTypeVO; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @Api(value = "安灯类型", tags = {"安灯类型"}) @ApiResource({"blade-andon/andon-type"}) @RestController /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/andon/controller/AndonTypeController.class */ public class AndonTypeController extends BladeController { private final IAndonTypeService typeService; public AndonTypeController(final IAndonTypeService typeService) { this.typeService = typeService; } @ApiOperationSupport(order = 1) @PostResource({""}) @ApiOperation("新增安灯类型") @PreAuth public R saveAndonType(@Valid @RequestBody AndonTypeSaveVO vo) { return R.data(this.typeService.saveAndonType(vo)); } @ApiOperationSupport(order = 2) @PutResource({""}) @ApiOperation("修改安灯类型") @PreAuth public R updateAndonType(@RequestBody AndonTypeUpdateVO vo) { return R.data(this.typeService.updateAndonType(vo)); } @ApiOperationSupport(order = 3) @ApiOperation("删除安灯类型") @PreAuth @DeleteResource({""}) public R removeAndonType(@RequestParam("typeId") String typeId) { return R.data(this.typeService.removeAndonType(Long.valueOf(Func.toLong(typeId)))); } @ApiOperationSupport(order = 4) @GetResource({""}) @ApiOperation("安灯类型列表") public R> andonTypeList(@RequestParam("keyword") String keyword) { return R.data(this.typeService.andonTypeList(keyword)); } @ApiOperationSupport(order = RegionCache.VILLAGE_LEVEL) @GetResource({"/detail"}) @ApiOperation("安灯类型详情") public R detail(@RequestParam("typeId") String typeId) { return R.data(this.typeService.detail(Long.valueOf(Func.toLong(typeId)))); } @ApiOperationSupport(order = 6) @GetResource({"/all-device-types"}) @ApiOperation("查看当前类型绑定的机器类型") public R> allDeviceTypes(@RequestParam("typeId") String typeId) { return R.data(this.typeService.allDeviceTypes(typeId)); } @ApiOperationSupport(order = 7) @GetResource({"/work-banding"}) @ApiOperation("查看当前工位绑定的机器类型") public R> workBanding(@RequestParam("workstationId") String workstationId) { return R.data(this.typeService.workBanding(Long.valueOf(Func.toLong(workstationId)))); } }