feat(消息通知): 增加agv小车到达通知
This commit is contained in:
parent
a425fd5ea4
commit
888335a5bc
@ -35,8 +35,7 @@ import com.ktg.common.core.page.TableDataInfo;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/message")
|
@RequestMapping("/system/message")
|
||||||
public class SysMessageController extends BaseController
|
public class SysMessageController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysMessageService sysMessageService;
|
private ISysMessageService sysMessageService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -49,8 +48,7 @@ public class SysMessageController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:message:list')")
|
@PreAuthorize("@ss.hasPermi('system:message:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysMessage sysMessage)
|
public TableDataInfo list(SysMessage sysMessage) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<SysMessage> list = sysMessageService.selectSysMessageList(sysMessage);
|
List<SysMessage> list = sysMessageService.selectSysMessageList(sysMessage);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -62,8 +60,7 @@ public class SysMessageController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('system:message:export')")
|
@PreAuthorize("@ss.hasPermi('system:message:export')")
|
||||||
@Log(title = "消息", businessType = BusinessType.EXPORT)
|
@Log(title = "消息", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, SysMessage sysMessage)
|
public void export(HttpServletResponse response, SysMessage sysMessage) {
|
||||||
{
|
|
||||||
List<SysMessage> list = sysMessageService.selectSysMessageList(sysMessage);
|
List<SysMessage> list = sysMessageService.selectSysMessageList(sysMessage);
|
||||||
ExcelUtil<SysMessage> util = new ExcelUtil<SysMessage>(SysMessage.class);
|
ExcelUtil<SysMessage> util = new ExcelUtil<SysMessage>(SysMessage.class);
|
||||||
util.exportExcel(response, list, "消息数据");
|
util.exportExcel(response, list, "消息数据");
|
||||||
@ -74,8 +71,7 @@ public class SysMessageController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:message:query')")
|
@PreAuthorize("@ss.hasPermi('system:message:query')")
|
||||||
@GetMapping(value = "/{messageId}")
|
@GetMapping(value = "/{messageId}")
|
||||||
public AjaxResult getInfo(@PathVariable("messageId") Long messageId)
|
public AjaxResult getInfo(@PathVariable("messageId") Long messageId) {
|
||||||
{
|
|
||||||
return AjaxResult.success(sysMessageService.selectSysMessageByMessageId(messageId));
|
return AjaxResult.success(sysMessageService.selectSysMessageByMessageId(messageId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,20 +81,28 @@ public class SysMessageController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('system:message:add')")
|
@PreAuthorize("@ss.hasPermi('system:message:add')")
|
||||||
@Log(title = "消息", businessType = BusinessType.INSERT)
|
@Log(title = "消息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SysMessage sysMessage)
|
public AjaxResult add(@RequestBody SysMessage sysMessage) {
|
||||||
{
|
|
||||||
messageProvider.sendMessage(sysMessage);
|
messageProvider.sendMessage(sysMessage);
|
||||||
return AjaxResult.success();
|
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')")
|
@PreAuthorize("@ss.hasPermi('system:message:edit')")
|
||||||
@Log(title = "消息", businessType = BusinessType.UPDATE)
|
@Log(title = "消息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody SysMessage sysMessage)
|
public AjaxResult edit(@RequestBody SysMessage sysMessage) {
|
||||||
{
|
|
||||||
return toAjax(sysMessageService.updateSysMessage(sysMessage));
|
return toAjax(sysMessageService.updateSysMessage(sysMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,11 +111,10 @@ public class SysMessageController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:message:remove')")
|
@PreAuthorize("@ss.hasPermi('system:message:remove')")
|
||||||
@Log(title = "消息", businessType = BusinessType.DELETE)
|
@Log(title = "消息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{messageIds}")
|
@DeleteMapping("/{messageIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] messageIds)
|
public AjaxResult remove(@PathVariable Long[] messageIds) {
|
||||||
{
|
for (Long messageId : messageIds
|
||||||
for (Long messageId: messageIds
|
) {
|
||||||
) {
|
|
||||||
SysMessage sysMessage = sysMessageService.selectSysMessageByMessageId(messageId);
|
SysMessage sysMessage = sysMessageService.selectSysMessageByMessageId(messageId);
|
||||||
sysMessage.setDeletedFlag(UserConstants.YES);
|
sysMessage.setDeletedFlag(UserConstants.YES);
|
||||||
sysMessageService.updateSysMessage(sysMessage);
|
sysMessageService.updateSysMessage(sysMessage);
|
||||||
|
@ -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;
|
||||||
|
}
|
@ -1,25 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ktg.system.mapper.SysNoticeMapper">
|
<mapper namespace="com.ktg.system.mapper.SysNoticeMapper">
|
||||||
|
|
||||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
<resultMap type="SysNotice" id="SysNoticeResult">
|
||||||
<result property="noticeId" column="notice_id" />
|
<result property="noticeId" column="notice_id"/>
|
||||||
<result property="noticeTitle" column="notice_title" />
|
<result property="noticeTitle" column="notice_title"/>
|
||||||
<result property="noticeType" column="notice_type" />
|
<result property="noticeType" column="notice_type"/>
|
||||||
<result property="noticeContent" column="notice_content" />
|
<result property="noticeContent" column="notice_content"/>
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status"/>
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time"/>
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectNoticeVo">
|
<sql id="selectNoticeVo">
|
||||||
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
|
SELECT notice_id,
|
||||||
from sys_notice
|
notice_title,
|
||||||
|
notice_type,
|
||||||
|
notice_content
|
||||||
|
status,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time,
|
||||||
|
remark
|
||||||
|
FROM sys_notice
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
||||||
@ -30,53 +39,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||||
<include refid="selectNoticeVo"/>
|
<include refid="selectNoticeVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="noticeTitle != null and noticeTitle != ''">
|
<if test="noticeTitle != null and noticeTitle != ''">
|
||||||
AND notice_title like concat('%', #{noticeTitle}, '%')
|
AND notice_title like concat('%', #{noticeTitle}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="noticeType != null and noticeType != ''">
|
<if test="noticeType != null and noticeType != ''">
|
||||||
AND notice_type = #{noticeType}
|
AND notice_type = #{noticeType}
|
||||||
</if>
|
</if>
|
||||||
<if test="createBy != null and createBy != ''">
|
<if test="createBy != null and createBy != ''">
|
||||||
AND create_by like concat('%', #{createBy}, '%')
|
AND create_by like concat('%', #{createBy}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertNotice" parameterType="SysNotice">
|
<insert id="insertNotice" parameterType="SysNotice">
|
||||||
insert into sys_notice (
|
insert into sys_notice (
|
||||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
<if test="noticeTitle != null and noticeTitle != '' ">notice_title,</if>
|
||||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
<if test="noticeType != null and noticeType != '' ">notice_type,</if>
|
||||||
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
|
<if test="noticeContent != null and noticeContent != '' ">notice_content,</if>
|
||||||
<if test="status != null and status != '' ">status, </if>
|
<if test="status != null and status != '' ">status,</if>
|
||||||
<if test="remark != null and remark != ''">remark,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
|
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
||||||
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
<if test="noticeType != null and noticeType != ''">#{noticeType},</if>
|
||||||
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
|
<if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
|
||||||
<if test="status != null and status != ''">#{status}, </if>
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateNotice" parameterType="SysNotice">
|
<update id="updateNotice" parameterType="SysNotice">
|
||||||
update sys_notice
|
update sys_notice
|
||||||
<set>
|
<set>
|
||||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
|
||||||
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
|
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
|
||||||
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
|
<if test="noticeContent != null">notice_content = #{noticeContent},</if>
|
||||||
<if test="status != null and status != ''">status = #{status}, </if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
update_time = sysdate()
|
update_time = sysdate()
|
||||||
</set>
|
</set>
|
||||||
where notice_id = #{noticeId}
|
where notice_id = #{noticeId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteNoticeById" parameterType="Long">
|
<delete id="deleteNoticeById" parameterType="Long">
|
||||||
delete from sys_notice where notice_id = #{noticeId}
|
delete
|
||||||
|
from sys_notice
|
||||||
|
where notice_id = #{noticeId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteNoticeByIds" parameterType="Long">
|
<delete id="deleteNoticeByIds" parameterType="Long">
|
||||||
|
Loading…
Reference in New Issue
Block a user