|
|
|
@ -7,6 +7,7 @@ import com.ktg.common.constant.UserConstants;
|
|
|
|
|
import com.ktg.common.core.domain.entity.SysUser;
|
|
|
|
|
import com.ktg.common.utils.StringUtils;
|
|
|
|
|
import com.ktg.framework.message.MessageProvider;
|
|
|
|
|
import com.ktg.system.domain.dto.AgvArrivedDto;
|
|
|
|
|
import com.ktg.system.service.ISysUserService;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -35,8 +36,7 @@ import com.ktg.common.core.page.TableDataInfo;
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/system/message")
|
|
|
|
|
public class SysMessageController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
public class SysMessageController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysMessageService sysMessageService;
|
|
|
|
|
@Autowired
|
|
|
|
@ -49,8 +49,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<SysMessage> list = sysMessageService.selectSysMessageList(sysMessage);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
@ -62,8 +61,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<SysMessage> list = sysMessageService.selectSysMessageList(sysMessage);
|
|
|
|
|
ExcelUtil<SysMessage> util = new ExcelUtil<SysMessage>(SysMessage.class);
|
|
|
|
|
util.exportExcel(response, list, "消息数据");
|
|
|
|
@ -74,8 +72,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 +82,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 AgvArrivedDto agvArrivedDto) {
|
|
|
|
|
sysMessageService.insertSysPromptMessage("AGV小车已到达", "订单号: " + agvArrivedDto.getOrderNo());
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -108,8 +113,7 @@ public class SysMessageController extends BaseController
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:message:remove')")
|
|
|
|
|
@Log(title = "消息", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{messageIds}")
|
|
|
|
|
public AjaxResult remove(@PathVariable Long[] messageIds)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult remove(@PathVariable Long[] messageIds) {
|
|
|
|
|
for (Long messageId : messageIds
|
|
|
|
|
) {
|
|
|
|
|
SysMessage sysMessage = sysMessageService.selectSysMessageByMessageId(messageId);
|
|
|
|
|