| | |
| | | import com.mes.rawglassstation.service.RawGlassStorageStationService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.context.MessageSource; |
| | | import org.springframework.context.i18n.LocaleContextHolder; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource RawGlassStorageStationService rawGlassStorageStationService; |
| | | |
| | | // 国际语言库 |
| | | @Resource |
| | | private MessageSource messageSource; |
| | | |
| | | @ApiOperation("工位状态") |
| | | @PostMapping("/updateSlotState") |
| | | @ResponseBody |
| | | public Result<Boolean> updateSlotState(@RequestParam(value = "state")int enableState, @RequestParam(value = "slot")int slot) { |
| | | boolean result = rawGlassStorageStationService.updateSlotState(slot, enableState); |
| | | String enable = messageSource.getMessage( |
| | | "rawglass.enable", |
| | | null, |
| | | LocaleContextHolder.getLocale() |
| | | ); |
| | | String disable = messageSource.getMessage( |
| | | "rawglass.disable", |
| | | null, |
| | | LocaleContextHolder.getLocale() |
| | | ); |
| | | if (enableState == 1) { |
| | | return Result.build(200, "启用", result); |
| | | return Result.build(200, enable, result); |
| | | } else { |
| | | return Result.build(200, "禁用", result); |
| | | return Result.build(200, disable, result); |
| | | } |
| | | } |
| | | } |