diff --git a/ktg-admin/src/main/java/com/ktg/web/controller/system/SysMessageController.java b/ktg-admin/src/main/java/com/ktg/web/controller/system/SysMessageController.java index 71219f9..deca42e 100644 --- a/ktg-admin/src/main/java/com/ktg/web/controller/system/SysMessageController.java +++ b/ktg-admin/src/main/java/com/ktg/web/controller/system/SysMessageController.java @@ -29,14 +29,13 @@ import com.ktg.common.core.page.TableDataInfo; /** * 消息Controller - * + * * @author yinjinlu * @date 2023-03-06 */ @RestController @RequestMapping("/system/message") -public class SysMessageController extends BaseController -{ +public class SysMessageController extends BaseController { @Autowired private ISysMessageService sysMessageService; @Autowired @@ -49,8 +48,7 @@ public class SysMessageController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:message:list')") @GetMapping("/list") - public TableDataInfo list(SysMessage sysMessage) - { + public TableDataInfo list(SysMessage sysMessage) { startPage(); List list = sysMessageService.selectSysMessageList(sysMessage); return getDataTable(list); @@ -62,8 +60,7 @@ public class SysMessageController extends BaseController @PreAuthorize("@ss.hasPermi('system:message:export')") @Log(title = "消息", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, SysMessage sysMessage) - { + public void export(HttpServletResponse response, SysMessage sysMessage) { List list = sysMessageService.selectSysMessageList(sysMessage); ExcelUtil util = new ExcelUtil(SysMessage.class); util.exportExcel(response, list, "消息数据"); @@ -74,8 +71,7 @@ public class SysMessageController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:message:query')") @GetMapping(value = "/{messageId}") - public AjaxResult getInfo(@PathVariable("messageId") Long messageId) - { + public AjaxResult getInfo(@PathVariable("messageId") Long messageId) { return AjaxResult.success(sysMessageService.selectSysMessageByMessageId(messageId)); } @@ -85,20 +81,28 @@ public class SysMessageController extends BaseController @PreAuthorize("@ss.hasPermi('system:message:add')") @Log(title = "消息", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody SysMessage sysMessage) - { + public AjaxResult add(@RequestBody SysMessage sysMessage) { messageProvider.sendMessage(sysMessage); return AjaxResult.success(); } + /** + * 通知用户agv小车到达 + */ + @Log(title = "消息", businessType = BusinessType.INSERT) + @PostMapping("/open/agv-arrived") + public AjaxResult addAgv(@RequestBody SysMessage sysMessage) { + sysMessageService.insertSysPromptMessage("AGV小车已到达",""); + return AjaxResult.success(); + } + /** * 修改消息 */ @PreAuthorize("@ss.hasPermi('system:message:edit')") @Log(title = "消息", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody SysMessage sysMessage) - { + public AjaxResult edit(@RequestBody SysMessage sysMessage) { return toAjax(sysMessageService.updateSysMessage(sysMessage)); } @@ -107,11 +111,10 @@ public class SysMessageController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:message:remove')") @Log(title = "消息", businessType = BusinessType.DELETE) - @DeleteMapping("/{messageIds}") - public AjaxResult remove(@PathVariable Long[] messageIds) - { - for (Long messageId: messageIds - ) { + @DeleteMapping("/{messageIds}") + public AjaxResult remove(@PathVariable Long[] messageIds) { + for (Long messageId : messageIds + ) { SysMessage sysMessage = sysMessageService.selectSysMessageByMessageId(messageId); sysMessage.setDeletedFlag(UserConstants.YES); sysMessageService.updateSysMessage(sysMessage); diff --git a/ktg-system/src/main/java/com/ktg/system/domain/dto/AgvArrivedDto.java b/ktg-system/src/main/java/com/ktg/system/domain/dto/AgvArrivedDto.java new file mode 100644 index 0000000..d60a4f4 --- /dev/null +++ b/ktg-system/src/main/java/com/ktg/system/domain/dto/AgvArrivedDto.java @@ -0,0 +1,13 @@ +package com.ktg.system.domain.dto; + +import lombok.Getter; +import lombok.Setter; + +import javax.validation.constraints.NotBlank; + +@Getter +@Setter +public class AgvArrivedDto { + @NotBlank(message = "订单号不能为空") + String orderNo; +} diff --git a/ktg-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ktg-system/src/main/resources/mapper/system/SysNoticeMapper.xml index 68cc233..b795261 100644 --- a/ktg-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/ktg-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -1,89 +1,100 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - + + + + + + + + + + - + - select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark - from sys_notice + SELECT notice_id, + notice_title, + notice_type, + notice_content + status, + create_by, + create_time, + update_by, + update_time, + remark + FROM sys_notice - + - + - + insert into sys_notice ( - notice_title, - notice_type, - notice_content, - status, - remark, - create_by, - create_time - )values( - #{noticeTitle}, - #{noticeType}, - #{noticeContent}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) + notice_title, + notice_type, + notice_content, + status, + remark, + create_by, + create_time + )values( + #{noticeTitle}, + #{noticeType}, + #{noticeContent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) - + - update sys_notice + update sys_notice - notice_title = #{noticeTitle}, - notice_type = #{noticeType}, - notice_content = #{noticeContent}, - status = #{status}, + notice_title = #{noticeTitle}, + notice_type = #{noticeType}, + notice_content = #{noticeContent}, + status = #{status}, update_by = #{updateBy}, - update_time = sysdate() + update_time = sysdate() where notice_id = #{noticeId} - + - delete from sys_notice where notice_id = #{noticeId} + delete + from sys_notice + where notice_id = #{noticeId} - + - delete from sys_notice where notice_id in + delete from sys_notice where notice_id in #{noticeId} - + \ No newline at end of file