wukai 9 сар өмнө
parent
commit
98c3d8d029

+ 20 - 34
jjt-biz/src/main/java/com/jjt/push/controller/PushRecordController.java

@@ -1,40 +1,32 @@
 package com.jjt.push.controller;
 
-import java.util.List;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.security.access.prepost.PreAuthorize;
-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.jjt.common.annotation.Log;
 import com.jjt.common.core.controller.BaseController;
 import com.jjt.common.core.domain.AjaxResult;
+import com.jjt.common.core.page.TableDataInfo;
 import com.jjt.common.enums.BusinessType;
+import com.jjt.common.utils.poi.ExcelUtil;
 import com.jjt.push.domain.PushRecord;
 import com.jjt.push.service.IPushRecordService;
-import com.jjt.common.utils.poi.ExcelUtil;
-import com.jjt.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * 推送记录Controller
  *
  * @author jjt
- * @date 2024-10-08
+ * @date 2024-10-11
  */
-@Api(tags="推送记录")
+@Api(tags = "推送记录")
 @RestController
 @RequestMapping("/push/pushRecord")
-public class PushRecordController extends BaseController
-{
+public class PushRecordController extends BaseController {
     @Resource
     private IPushRecordService pushRecordService;
 
@@ -44,8 +36,7 @@ public class PushRecordController extends BaseController
     @ApiOperation("查询推送记录列表")
     @PreAuthorize("@ss.hasPermi('push:pushRecord:list')")
     @GetMapping("/list")
-    public TableDataInfo list(PushRecord pushRecord)
-    {
+    public TableDataInfo list(PushRecord pushRecord) {
         startPage();
         List<PushRecord> list = pushRecordService.selectPushRecordList(pushRecord);
         return getDataTable(list);
@@ -58,8 +49,7 @@ public class PushRecordController extends BaseController
     @PreAuthorize("@ss.hasPermi('push:pushRecord:export')")
     @Log(title = "推送记录", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, PushRecord pushRecord)
-    {
+    public void export(HttpServletResponse response, PushRecord pushRecord) {
         List<PushRecord> list = pushRecordService.selectPushRecordList(pushRecord);
         ExcelUtil<PushRecord> util = new ExcelUtil<PushRecord>(PushRecord.class);
         util.exportExcel(response, list, "推送记录数据");
@@ -71,8 +61,7 @@ public class PushRecordController extends BaseController
     @ApiOperation("获取推送记录详细信息")
     @PreAuthorize("@ss.hasPermi('push:pushRecord:query')")
     @GetMapping(value = "/{prId}")
-    public AjaxResult getInfo(@PathVariable("prId") Long prId)
-    {
+    public AjaxResult getInfo(@PathVariable("prId") Long prId) {
         return success(pushRecordService.selectPushRecordByPrId(prId));
     }
 
@@ -83,8 +72,7 @@ public class PushRecordController extends BaseController
     @PreAuthorize("@ss.hasPermi('push:pushRecord:add')")
     @Log(title = "推送记录", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody PushRecord pushRecord)
-    {
+    public AjaxResult add(@RequestBody PushRecord pushRecord) {
         return toAjax(pushRecordService.insertPushRecord(pushRecord));
     }
 
@@ -95,8 +83,7 @@ public class PushRecordController extends BaseController
     @PreAuthorize("@ss.hasPermi('push:pushRecord:edit')")
     @Log(title = "推送记录", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody PushRecord pushRecord)
-    {
+    public AjaxResult edit(@RequestBody PushRecord pushRecord) {
         return toAjax(pushRecordService.updatePushRecord(pushRecord));
     }
 
@@ -106,9 +93,8 @@ public class PushRecordController extends BaseController
     @ApiOperation("删除推送记录")
     @PreAuthorize("@ss.hasPermi('push:pushRecord:remove')")
     @Log(title = "推送记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{prIds}")
-    public AjaxResult remove(@PathVariable Long[] prIds)
-    {
+    @DeleteMapping("/{prIds}")
+    public AjaxResult remove(@PathVariable Long[] prIds) {
         return toAjax(pushRecordService.deletePushRecordByPrIds(prIds));
     }
 }

+ 78 - 56
jjt-biz/src/main/java/com/jjt/push/domain/PushRecord.java

@@ -1,137 +1,159 @@
 package com.jjt.push.domain;
 
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
-import com.jjt.common.annotation.Excel;
-import com.jjt.common.core.domain.BaseEntity;
+
+import java.util.Date;
 
 /**
  * 推送记录对象 push_record
  *
  * @author jjt
- * @date 2024-10-08
+ * @date 2024-10-11
  */
 @ApiModel(value = "PushRecord", description = "推送记录")
-public class PushRecord extends BaseEntity
-{
+public class PushRecord extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 记录ID */
+    /**
+     * 记录ID
+     */
     @ApiModelProperty("记录ID")
     @TableId
     private Long prId;
 
-    /** 推送类型 */
+    /**
+     * 推送类型
+     */
     @ApiModelProperty("推送类型")
     @Excel(name = "推送类型")
     private String pushType;
 
-    /** 告警级别 */
+    /**
+     * 告警级别
+     */
     @ApiModelProperty("告警级别")
     @Excel(name = "告警级别")
     private String alarmLevel;
 
-    /** 发送对象 */
+    /**
+     * 发送对象
+     */
     @ApiModelProperty("发送对象")
     @Excel(name = "发送对象")
     private String sendObj;
 
-    /** 发送内容 */
+    /**
+     * 发送标题
+     */
+    @ApiModelProperty("发送标题")
+    @Excel(name = "发送标题")
+    private String sendTitle;
+
+    /**
+     * 发送内容
+     */
     @ApiModelProperty("发送内容")
     @Excel(name = "发送内容")
     private String sendContent;
 
-    /** 成功状态 */
+    /**
+     * 成功状态
+     */
     @ApiModelProperty("成功状态")
     @Excel(name = "成功状态")
-    private String snedSuccess;
+    private String sendSuccess;
 
-    /** 发送时间 */
+    /**
+     * 发送时间
+     */
     @ApiModelProperty("发送时间")
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date sendTime;
 
-    public void setPrId(Long prId)
-    {
+    public void setPrId(Long prId) {
         this.prId = prId;
     }
 
-    public Long getPrId()
-    {
+    public Long getPrId() {
         return prId;
     }
-    public void setPushType(String pushType)
-    {
+
+    public void setPushType(String pushType) {
         this.pushType = pushType;
     }
 
-    public String getPushType()
-    {
+    public String getPushType() {
         return pushType;
     }
-    public void setAlarmLevel(String alarmLevel)
-    {
+
+    public void setAlarmLevel(String alarmLevel) {
         this.alarmLevel = alarmLevel;
     }
 
-    public String getAlarmLevel()
-    {
+    public String getAlarmLevel() {
         return alarmLevel;
     }
-    public void setSendObj(String sendObj)
-    {
+
+    public void setSendObj(String sendObj) {
         this.sendObj = sendObj;
     }
 
-    public String getSendObj()
-    {
+    public String getSendObj() {
         return sendObj;
     }
-    public void setSendContent(String sendContent)
-    {
+
+    public void setSendTitle(String sendTitle) {
+        this.sendTitle = sendTitle;
+    }
+
+    public String getSendTitle() {
+        return sendTitle;
+    }
+
+    public void setSendContent(String sendContent) {
         this.sendContent = sendContent;
     }
 
-    public String getSendContent()
-    {
+    public String getSendContent() {
         return sendContent;
     }
-    public void setSnedSuccess(String snedSuccess)
-    {
-        this.snedSuccess = snedSuccess;
+
+    public void setSendSuccess(String sendSuccess) {
+        this.sendSuccess = sendSuccess;
     }
 
-    public String getSnedSuccess()
-    {
-        return snedSuccess;
+    public String getSendSuccess() {
+        return sendSuccess;
     }
-    public void setSendTime(Date sendTime)
-    {
+
+    public void setSendTime(Date sendTime) {
         this.sendTime = sendTime;
     }
 
-    public Date getSendTime()
-    {
+    public Date getSendTime() {
         return sendTime;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("prId", getPrId())
-            .append("pushType", getPushType())
-            .append("alarmLevel", getAlarmLevel())
-            .append("sendObj", getSendObj())
-            .append("sendContent", getSendContent())
-            .append("snedSuccess", getSnedSuccess())
-            .append("sendTime", getSendTime())
-            .append("remark", getRemark())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("prId", getPrId())
+                .append("pushType", getPushType())
+                .append("alarmLevel", getAlarmLevel())
+                .append("sendObj", getSendObj())
+                .append("sendTitle", getSendTitle())
+                .append("sendContent", getSendContent())
+                .append("sendSuccess", getSendSuccess())
+                .append("sendTime", getSendTime())
+                .append("remark", getRemark())
+                .toString();
     }
 }

+ 1 - 1
jjt-biz/src/main/java/com/jjt/push/mapper/PushRecordMapper.java

@@ -8,7 +8,7 @@ import com.jjt.push.domain.PushRecord;
  * 推送记录Mapper接口
  * 
  * @author jjt
- * @date 2024-10-08
+ * @date 2024-10-11
  */
 public interface PushRecordMapper extends BaseMapper<PushRecord>
 {

+ 1 - 1
jjt-biz/src/main/java/com/jjt/push/service/IPushRecordService.java

@@ -7,7 +7,7 @@ import com.jjt.push.domain.PushRecord;
  * 推送记录Service接口
  * 
  * @author jjt
- * @date 2024-10-08
+ * @date 2024-10-11
  */
 public interface IPushRecordService 
 {

+ 1 - 1
jjt-biz/src/main/java/com/jjt/push/service/impl/PushRecordServiceImpl.java

@@ -11,7 +11,7 @@ import javax.annotation.Resource;
  * 推送记录Service业务层处理
  *
  * @author jjt
- * @date 2024-10-08
+ * @date 2024-10-11
  */
 @Service
 public class PushRecordServiceImpl implements IPushRecordService {

+ 22 - 8
jjt-biz/src/main/resources/mapper/push/PushRecordMapper.xml

@@ -9,14 +9,15 @@
             <result property="pushType" column="PUSH_TYPE"/>
             <result property="alarmLevel" column="ALARM_LEVEL"/>
             <result property="sendObj" column="SEND_OBJ"/>
+            <result property="sendTitle" column="SEND_TITLE"/>
             <result property="sendContent" column="SEND_CONTENT"/>
-            <result property="snedSuccess" column="SNED_SUCCESS"/>
+            <result property="sendSuccess" column="SEND_SUCCESS"/>
             <result property="sendTime" column="SEND_TIME"/>
             <result property="remark" column="REMARK"/>
     </resultMap>
 
     <sql id="selectPushRecordVo">
-        select PR_ID, PUSH_TYPE, ALARM_LEVEL, SEND_OBJ, SEND_CONTENT, SNED_SUCCESS, SEND_TIME, REMARK
+        select PR_ID, PUSH_TYPE, ALARM_LEVEL, SEND_OBJ, SEND_TITLE, SEND_CONTENT, SEND_SUCCESS, SEND_TIME, REMARK
         from push_record
     </sql>
 
@@ -32,8 +33,14 @@
                         <if test="sendObj != null  and sendObj != ''">
                             and SEND_OBJ like concat('%', #{sendObj}, '%')
                         </if>
-                        <if test="snedSuccess != null  and snedSuccess != ''">
-                            and SNED_SUCCESS = #{snedSuccess}
+                        <if test="sendTitle != null  and sendTitle != ''">
+                            and SEND_TITLE like concat('%', #{sendTitle}, '%')
+                        </if>
+                        <if test="sendContent != null  and sendContent != ''">
+                            and SEND_CONTENT like concat('%', #{sendContent}, '%')
+                        </if>
+                        <if test="sendSuccess != null  and sendSuccess != ''">
+                            and SEND_SUCCESS = #{sendSuccess}
                         </if>
                         <if test="params.beginSendTime != null and params.beginSendTime != '' and params.endSendTime != null and params.endSendTime != ''">
                             and SEND_TIME between #{params.beginSendTime} and #{params.endSendTime}
@@ -60,9 +67,11 @@
                     </if>
                     <if test="sendObj != null">SEND_OBJ,
                     </if>
+                    <if test="sendTitle != null">SEND_TITLE,
+                    </if>
                     <if test="sendContent != null">SEND_CONTENT,
                     </if>
-                    <if test="snedSuccess != null">SNED_SUCCESS,
+                    <if test="sendSuccess != null">SEND_SUCCESS,
                     </if>
                     <if test="sendTime != null">SEND_TIME,
                     </if>
@@ -76,9 +85,11 @@
                     </if>
                     <if test="sendObj != null">#{sendObj},
                     </if>
+                    <if test="sendTitle != null">#{sendTitle},
+                    </if>
                     <if test="sendContent != null">#{sendContent},
                     </if>
-                    <if test="snedSuccess != null">#{snedSuccess},
+                    <if test="sendSuccess != null">#{sendSuccess},
                     </if>
                     <if test="sendTime != null">#{sendTime},
                     </if>
@@ -99,11 +110,14 @@
                     <if test="sendObj != null">SEND_OBJ =
                         #{sendObj},
                     </if>
+                    <if test="sendTitle != null">SEND_TITLE =
+                        #{sendTitle},
+                    </if>
                     <if test="sendContent != null">SEND_CONTENT =
                         #{sendContent},
                     </if>
-                    <if test="snedSuccess != null">SNED_SUCCESS =
-                        #{snedSuccess},
+                    <if test="sendSuccess != null">SEND_SUCCESS =
+                        #{sendSuccess},
                     </if>
                     <if test="sendTime != null">SEND_TIME =
                         #{sendTime},