| | |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.andon.dto.AndonButtonDTO; |
| | | import org.jeecg.modules.andon.entity.AndonResponseConfig; |
| | | import org.jeecg.modules.andon.service.IAndonResponseConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 安灯响应配置 |
| | |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送安灯消息 |
| | | * |
| | | * @param andonButtonDTO |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "安灯工单-发送飞书消息") |
| | | @ApiOperation(value = "安灯工单-发送飞书消息", notes = "安灯工单-发送飞书消息") |
| | | @PostMapping(value = "/sendMessage") |
| | | public Result<String> sendMessage(@RequestBody AndonButtonDTO andonButtonDTO) { |
| | | try { |
| | | andonButtonDTO.setBlinkingFlag(1); |
| | | // 调用服务层处理业务逻辑 |
| | | andonResponseConfigService.sendAndonNotification(andonButtonDTO); |
| | | return Result.OK("添加成功!"); |
| | | } catch (Exception e) { |
| | | log.error("安灯工单[{}]飞书通知发送失败", andonButtonDTO.getId(), e); |
| | | return Result.error("发送消息失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | |
| | | */ |
| | | @AutoLog(value = "安灯响应配置-添加") |
| | | @ApiOperation(value="安灯响应配置-添加", notes="安灯响应配置-添加") |
| | | //@RequiresPermissions("org.jeecg.modules:andon_response_config:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody AndonResponseConfig andonResponseConfig) { |
| | | andonResponseConfigService.save(andonResponseConfig); |
| | |
| | | return super.importExcel(request, response, AndonResponseConfig.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * APP安灯按钮列表查询 |
| | | * |
| | | * @param factoryId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "安灯按钮配置-列表查询", notes = "安灯按钮配置-列表查询") |
| | | @GetMapping(value = "/queryAndonButtonList") |
| | | public Result<List<AndonButtonDTO>> queryAndonButtonList(@RequestParam("factoryId") String factoryId) { |
| | | List<AndonButtonDTO> list = andonResponseConfigService.queryAndonButtonList(factoryId); |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | } |