Browse Source

【修改】企微弹框配置增加弹框标题字段,弹框点赞日志增加员工组织架构,岗位,员工号等字段

lichen 1 month ago
parent
commit
7b1f145d6a

+ 9 - 0
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/add.html

@@ -9,6 +9,12 @@
 <body class="white-bg">
 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
     <form class="form-horizontal m" id="form-configuration-add">
+        <div class="form-group">
+            <label class="col-sm-3 control-label">弹框标题:</label>
+            <div class="col-sm-8">
+                <input id="alertTitle" name="alertTitle" class="form-control" type="text" required>
+            </div>
+        </div>
         <div class="form-group">
             <label class="col-sm-3 control-label">弹框类型:</label>
             <div class="col-sm-3">
@@ -259,6 +265,8 @@
 
     function submitHandler() {
         if ($.validate.form()) {
+            debugger
+            var alertTitle = $('#alertTitle').val();
             var alertType = $('#alertType').val();
             var contentVal = $('#alertContent').val();
             var startTime = $('#alertStartTime').val().replace('T',' ');
@@ -269,6 +277,7 @@
                 $.modal.alertWarning("弹框结束时间不能小于开始时间");
             }else {
                 var objSubmit = {
+                    alertTitle:alertTitle,
                     alertType:alertType,
                     photoUrl:photoUrl,
                     alertContent:contentVal,

+ 4 - 0
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/configuration.html

@@ -125,6 +125,10 @@
                     title : 'id',
                     visible: false
                 },
+                {
+                    field : 'alertTitle',
+                    title : '弹框标题'
+                },
                 {
                     field : 'alertContent', 
                     title : '弹框内容',

+ 8 - 0
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/edit.html

@@ -9,6 +9,12 @@
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
         <form class="form-horizontal m" id="form-configuration-edit" th:object="${alertConfiguration}">
             <input name="alertId" th:field="*{alertId}" type="hidden">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">弹框标题:</label>
+                <div class="col-sm-8">
+                    <input id="alertTitle" name="alertTitle" th:field="*{alertTitle}" class="form-control" type="text" required>
+                </div>
+            </div>
             <div class="form-group">
                 <label class="col-sm-3 control-label">弹框类型:</label>
                 <div class="col-sm-8">
@@ -266,6 +272,7 @@
 
         function submitHandler() {
             if ($.validate.form()) {
+                var alertTitle = $('#alertTitle').val();
                 var alertId = $('#alertId').val();
                 var alertType = $('#alertType').val();
                 var contentVal = $('#alertContent').val();
@@ -277,6 +284,7 @@
                     $.modal.alertWarning("弹框结束时间不能小于开始时间");
                 }else {
                     var objSubmit = {
+                        alertTitle:alertTitle,
                         alertId:alertId,
                         alertType:alertType,
                         photoUrl:photoUrl,

+ 20 - 6
suishenbang-admin/src/main/resources/templates/system/upvoteLog/upvoteLog.html

@@ -105,6 +105,19 @@
                     field : 'loginName',
                     title : '用户账号',
                 },
+                {
+                    field : 'orgName',
+                    title : '组织架构',
+                },
+                {
+                    field : 'postName',
+                    title : '岗位',
+                },
+                {
+                    field : 'sapEmployeeId',
+                    title : '员工号',
+                },
+
                 {
                     field : 'status',
                     title : '点赞状态',
@@ -117,6 +130,10 @@
                     title : '弹框配置id',
                     visible: false
                 },
+                {
+                    field : 'alertTitle',
+                    title : '弹框标题'
+                },
                 {
                     field : 'alertContent',
                     title : '弹框内容',
@@ -126,7 +143,8 @@
                         }else {
                             return $.table.tooltip(value); // 使用tooltip显示完整内容
                         }
-                    }
+                    },
+                    visible: false
                 },
                 {
                     field : 'photoUrl',
@@ -140,11 +158,7 @@
                             console.log('url2',valueStr);
                             return '<img width="24" height="22" src="' + value + '" onclick="imgPreview(\'' + valueStr + '\')"/>'
                         }
-                    }
-                },
-                {
-                    field : 'isDelete', 
-                    title : '是否删除',
+                    },
                     visible: false
                 },
                 {

+ 5 - 0
suishenbang-system/src/main/java/com/dgtly/system/domain/AlertConfiguration.java

@@ -1,5 +1,6 @@
 package com.dgtly.system.domain;
 
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.dgtly.common.annotation.Excel;
@@ -12,6 +13,7 @@ import java.util.Date;
  * @author chenyn
  * @date 2023-06-13
  */
+@Data
 public class AlertConfiguration extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -23,6 +25,9 @@ public class AlertConfiguration extends BaseEntity
     @Excel(name = "是否删除")
     private Long isDelete;
 
+    /** 弹框标题 */
+    @Excel(name = "弹框标题")
+    private String alertTitle;
     /** 弹框内容 */
     @Excel(name = "弹框内容")
     private String alertContent;

+ 16 - 4
suishenbang-system/src/main/java/com/dgtly/system/domain/AlertUpvoteLog.java

@@ -1,5 +1,6 @@
 package com.dgtly.system.domain;
 
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.dgtly.common.annotation.Excel;
@@ -13,6 +14,7 @@ import java.util.Date;
  * @author dgtly
  * @date 2024-12-24
  */
+@Data
 public class AlertUpvoteLog extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -39,13 +41,24 @@ public class AlertUpvoteLog extends BaseEntity
     /** 用户名称 */
     @Excel(name = "用户名称")
     private String userName;
-
+    /** 员工号 */
+    @Excel(name = "员工号")
+    private String sapEmployeeId;
+    /** 组织架构 */
+    @Excel(name = "组织架构")
+    private String orgName;
+    /** 岗位 */
+    @Excel(name = "岗位")
+    private String postName;
+    /** 弹框标题 */
+    @Excel(name = "弹框标题")
+    private String alertTitle;
     /** 弹框内容 */
-    @Excel(name = "弹框内容")
+//    @Excel(name = "弹框内容")
     private String alertContent;
 
     /** 弹框图片地址 */
-    @Excel(name = "弹框图片url")
+//    @Excel(name = "弹框图片url")
     private String photoUrl;
 
     /** 点赞状态。0: 无;1:赞;2:踩 */
@@ -54,7 +67,6 @@ public class AlertUpvoteLog extends BaseEntity
     /** 点赞状态。0: 无;1:赞;2:踩 */
     @Excel(name = "点赞状态")
     private String statusName;
-
     //用于查询
     private Date startTime;
     private Date endTime;

+ 11 - 2
suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertUpvoteLogServiceImpl.java

@@ -55,7 +55,12 @@ public class AlertUpvoteLogServiceImpl implements IAlertUpvoteLogService
     public int insertAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog)
     {
         alertUpvoteLog.setCreateTime(DateUtils.getNowDate());
-        return alertUpvoteLogMapper.insertAlertUpvoteLog(alertUpvoteLog);
+        if (alertUpvoteLog.getStatus()==0){
+            return 0;
+        }else {
+            return alertUpvoteLogMapper.insertAlertUpvoteLog(alertUpvoteLog);
+        }
+
     }
 
     /**
@@ -68,7 +73,11 @@ public class AlertUpvoteLogServiceImpl implements IAlertUpvoteLogService
     public int updateAlertUpvoteLog(AlertUpvoteLog alertUpvoteLog)
     {
         alertUpvoteLog.setUpdateTime(DateUtils.getNowDate());
-        return alertUpvoteLogMapper.updateAlertUpvoteLog(alertUpvoteLog);
+        if (alertUpvoteLog.getStatus()==0){
+            return 0;
+        }else {
+            return alertUpvoteLogMapper.updateAlertUpvoteLog(alertUpvoteLog);
+        }
     }
 
     /**

+ 5 - 1
suishenbang-system/src/main/resources/mapper/system/AlertConfigurationMapper.xml

@@ -22,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="orgName"    column="org_name"    />
         <result property="alertType"    column="alert_type"    />
         <result property="photoUrl"    column="photo_url"    />
+        <result property="alertTitle"    column="alert_title"    />
     </resultMap>
 
     <sql id="selectAlertConfigurationVo">
-        select alert_id, create_by, create_time, update_by, update_time, is_delete, alert_content, alert_start_time, alert_end_time, alert_num, user_type, alert_status,sales_level,org_code,org_name,alert_type,photo_url from alert_configuration
+        select alert_id, create_by, create_time, update_by, update_time, is_delete,alert_title, alert_content, alert_start_time, alert_end_time, alert_num, user_type, alert_status,sales_level,org_code,org_name,alert_type,photo_url from alert_configuration
     </sql>
 
     <select id="selectAlertConfigurationList" parameterType="AlertConfiguration" resultMap="AlertConfigurationResult">
@@ -85,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orgName != null  and orgName != ''">org_name,</if>
             <if test="alertType != null  and alertType != ''">alert_type,</if>
             <if test="photoUrl != null  and photoUrl != ''">photo_url,</if>
+            <if test="alertTitle != null  and alertTitle != ''">alert_title,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="createBy != null  and createBy != ''">#{createBy},</if>
@@ -103,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orgName != null  and orgName != ''">#{orgName},</if>
             <if test="alertType != null  and alertType != ''">#{alertType},</if>
             <if test="photoUrl != null  and photoUrl != ''">#{photoUrl},</if>
+            <if test="alertTitle != null  and alertTitle != ''">#{alertTitle},</if>
          </trim>
     </insert>
 
@@ -125,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orgName != null  and orgName != ''">org_name = #{orgName},</if>
             <if test="alertType != null  and alertType != ''">alert_type = #{alertType},</if>
             <if test="photoUrl != null  and photoUrl != ''">photo_url = #{photoUrl},</if>
+            <if test="alertTitle != null  and alertTitle != ''">alert_title = #{alertTitle},</if>
         </trim>
         where alert_id = #{alertId}
     </update>

+ 29 - 39
suishenbang-system/src/main/resources/mapper/system/AlertUpvoteLogMapper.xml

@@ -26,35 +26,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select alert_upvote_id, alert_id, create_by, create_time, update_by, update_time, is_delete, user_id, status,login_name,user_name,alert_content,photo_url from alert_upvote_log
     </sql>
 
-    <select id="selectAlertUpvoteLogList" parameterType="AlertUpvoteLog" resultMap="AlertUpvoteLogResult">
-        select alert_upvote_id,
-               alert_id,
-               create_by,
-               create_time,
-               update_by,
-               update_time,
-               is_delete,
-               user_id,
-               status,
-               login_name,
-               user_name,
-               IF(alert_content!='null', alert_content, "") alert_content,
-               photo_url,
+    <select id="selectAlertUpvoteLogList"  resultType="com.dgtly.system.domain.AlertUpvoteLog">
+        select aul.alert_upvote_id as alertUpvoteId,
+               aul.alert_id as alertId,
+               aul.create_time as createTime,
+               aul.user_id as userId,
+               aul.status as status,
+               su.login_name as loginName,
+               su.user_name as userName,
+               sue.sap_employee_id as sapEmployeeId,
+               sue.org_name as orgName,
+               sue.post_name as postName,
+               ac.alert_content as alertContent,
+               ac.photo_url as photoUrl,
+               ac.alert_title as alertTitle,
                CASE
-                WHEN status = '0' THEN '无'
-                WHEN status = '1' THEN '赞'
-                WHEN status = '2' THEN '踩'
+                WHEN aul.status = '0' THEN '无'
+                WHEN aul.status = '1' THEN '赞'
+                WHEN aul.status = '2' THEN '踩'
                 END statusName
-        from alert_upvote_log
-        <where>
-            <if test="userName != null "> and user_name like concat('%', #{userName}, '%')</if>
-            <if test="loginName != null "> and login_name like concat('%', #{loginName}, '%')</if>
-            <if test="alertContent != null "> and alert_content like concat('%', #{alertContent}, '%')</if>
-            <if test="status != null "> and status = #{status}</if>
-            <if test="startTime != null "> and create_time &gt;= #{startTime}</if>
-            <if test="endTime != null "> and create_time &lt; #{endTime}</if>
-        </where>
-        order by create_time desc
+        from alert_upvote_log aul
+            left join alert_configuration ac on ac.alert_id=aul.alert_id
+            left join sys_user su on su.user_id=aul.user_id
+            left join sys_user_ext sue on sue.user_id=aul.user_id
+         where aul.status != '0'
+            <if test="userName != null and userName != ''"> and su.user_name like concat('%', #{userName}, '%')</if>
+            <if test="loginName != null and loginName != '' "> and su.login_name like concat('%', #{loginName}, '%')</if>
+            <if test="alertContent != null and alertContent != '' "> and ac.alert_content like concat('%', #{alertContent}, '%')</if>
+            <if test="status != null"> and aul.status = #{status}</if>
+            <if test="startTime != null "> and aul.create_time &gt;= #{startTime}</if>
+            <if test="endTime != null "> and aul.create_time &lt; #{endTime}</if>
+        order by aul.create_time desc
     </select>
     
     <select id="selectAlertUpvoteLogById" parameterType="Long" resultMap="AlertUpvoteLogResult">
@@ -73,10 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDelete != null ">is_delete,</if>
             <if test="userId != null ">user_id,</if>
             <if test="status != null ">status,</if>
-            <if test="loginName != null ">login_name,</if>
-            <if test="userName != null ">user_name,</if>
-            <if test="alertContent != null ">alert_content,</if>
-            <if test="photoUrl != null ">photo_url,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="alertId != null ">#{alertId},</if>
@@ -87,10 +85,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDelete != null ">#{isDelete},</if>
             <if test="userId != null ">#{userId},</if>
             <if test="status != null ">#{status},</if>
-            <if test="loginName != null ">#{loginName},</if>
-            <if test="userName != null ">#{userName},</if>
-            <if test="alertContent != null ">#{alertContent},</if>
-            <if test="photoUrl != null ">#{photoUrl},</if>
          </trim>
     </insert>
 
@@ -105,10 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDelete != null ">is_delete = #{isDelete},</if>
             <if test="userId != null ">user_id = #{userId},</if>
             <if test="status != null ">status = #{status},</if>
-            <if test="loginName != null ">login_name = #{loginName},</if>
-            <if test="userName != null ">user_name = #{userName},</if>
-            <if test="alertContent != null ">alert_content = #{alertContent},</if>
-            <if test="photoUrl != null ">photo_url = #{photoUrl},</if>
         </trim>
         where alert_upvote_id = #{alertUpvoteId}
     </update>