From 3849263b31a16a91ff08acaa42786ecfde76f33c Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期四, 27 十一月 2025 20:18:08 +0800
Subject: [PATCH] 提交
---
tms/src/main/java/com/ruoyi/tms/controller/TmsMessageNotifyController.java | 144 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 144 insertions(+), 0 deletions(-)
diff --git a/tms/src/main/java/com/ruoyi/tms/controller/TmsMessageNotifyController.java b/tms/src/main/java/com/ruoyi/tms/controller/TmsMessageNotifyController.java
new file mode 100644
index 0000000..09c51bb
--- /dev/null
+++ b/tms/src/main/java/com/ruoyi/tms/controller/TmsMessageNotifyController.java
@@ -0,0 +1,144 @@
+package com.ruoyi.tms.controller;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.utils.file.DownloadExportUtil;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.tms.domain.TmsMessageNotify;
+import com.ruoyi.tms.service.ITmsMessageNotifyService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 娑堟伅閫氱煡Controller
+ *
+ * @author ruoyi
+ * @date 2025-11-26
+ */
+@RestController
+@RequestMapping("/tms/tmsMessageNotify")
+public class TmsMessageNotifyController extends BaseController
+{
+ @Autowired
+ private ITmsMessageNotifyService tmsMessageNotifyService;
+
+ @GetMapping("noCount")
+ public AjaxResult noCount(){
+ Long l = tmsMessageNotifyService.getBaseMapper().selectCount(new LambdaQueryWrapper<TmsMessageNotify>()
+ .eq(TmsMessageNotify::getReadStatus, 0));
+
+ List<TmsMessageNotify> messageNotifies = tmsMessageNotifyService.getBaseMapper().selectList(new LambdaQueryWrapper<TmsMessageNotify>()
+ .eq(TmsMessageNotify::getReadStatus, 0)
+ .orderByDesc(TmsMessageNotify::getId)
+ .last("limit 5")
+ );
+
+
+ Map<String,Object> has = new HashMap<>();
+ has.put("count",l);
+ has.put("list",messageNotifies);
+
+ return AjaxResult.success(has);
+ }
+
+ /**
+ * 鑾峰彇娑堟伅閫氱煡璇︾粏淇℃伅
+ */
+ @GetMapping(value = "/read/{id}")
+ public AjaxResult read(@PathVariable("id") Integer id)
+ {
+ tmsMessageNotifyService.updateById(new TmsMessageNotify(){{
+ setId(id);
+ setReadStatus(1);
+ setReadTime(new Date());
+ }});
+ return AjaxResult.success(tmsMessageNotifyService.selectTmsMessageNotifyById(id));
+ }
+
+ /**
+ * 鏌ヨ娑堟伅閫氱煡鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('tms:tmsMessageNotify:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(TmsMessageNotify tmsMessageNotify)
+ {
+ startPage();
+ List<TmsMessageNotify> list = tmsMessageNotifyService.selectTmsMessageNotifyList(tmsMessageNotify);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭娑堟伅閫氱煡鍒楄〃
+ * @param tmsMessageNotify 鏌ヨ鏉′欢瀵硅薄
+ */
+ @PreAuthorize("@ss.hasPermi('tms:tmsMessageNotify:export')")
+ @Log(title = "娑堟伅閫氱煡", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(TmsMessageNotify tmsMessageNotify,String exportKey)
+ {
+ tmsMessageNotifyService.export(tmsMessageNotify,exportKey);
+ return AjaxResult.success("瀵煎嚭璇锋眰鎴愬姛锛岃绋嶅悗鐐瑰嚮涓嬭浇...!");
+ }
+
+
+
+ /**
+ * 鑾峰彇娑堟伅閫氱煡璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('tms:tmsMessageNotify:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Integer id)
+ {
+ return AjaxResult.success(tmsMessageNotifyService.selectTmsMessageNotifyById(id));
+ }
+
+ /**
+ * 鏂板娑堟伅閫氱煡
+ */
+ @PreAuthorize("@ss.hasPermi('tms:tmsMessageNotify:add')")
+ @Log(title = "娑堟伅閫氱煡", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody TmsMessageNotify tmsMessageNotify)
+ {
+ return toAjax(tmsMessageNotifyService.insertTmsMessageNotify(tmsMessageNotify));
+ }
+
+ /**
+ * 淇敼娑堟伅閫氱煡
+ */
+ @PreAuthorize("@ss.hasPermi('tms:tmsMessageNotify:edit')")
+ @Log(title = "娑堟伅閫氱煡", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody TmsMessageNotify tmsMessageNotify)
+ {
+ return toAjax(tmsMessageNotifyService.updateTmsMessageNotify(tmsMessageNotify));
+ }
+
+ /**
+ * 鍒犻櫎娑堟伅閫氱煡
+ */
+ @PreAuthorize("@ss.hasPermi('tms:tmsMessageNotify:remove')")
+ @Log(title = "娑堟伅閫氱煡", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Integer[] ids)
+ {
+ return toAjax(tmsMessageNotifyService.deleteTmsMessageNotifyByIds(ids));
+ }
+}
--
Gitblit v1.8.0