Browse Source

Merge remote-tracking branch 'origin/uploadFile-alert810' into uat

njs 2 years ago
parent
commit
4df9490cfc

+ 3 - 2
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/add.html

@@ -61,7 +61,7 @@
         <div class="form-group">
         <div class="form-group">
             <label class="col-sm-3 control-label">用户类型:</label>
             <label class="col-sm-3 control-label">用户类型:</label>
             <div class="col-sm-8">
             <div class="col-sm-8">
-                <select title="请选择" id="userType" name="userType" class="form-control m-b selectpicker" th:with="type=${@dict.getType('sys_lantern_permission')}" multiple>
+                <select title="请选择" id="userType" name="userType" class="form-control m-b selectpicker" th:with="type=${@dict.getType('sys_alert_permission')}">
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                 </select>
                 </select>
             </div>
             </div>
@@ -122,6 +122,7 @@
         }
         }
         $("#alertContentItem").hide();
         $("#alertContentItem").hide();
         $("#alertImageItem").hide();
         $("#alertImageItem").hide();
+        $("#userType").selectpicker('val','1');
         getCompanyList(obj);
         getCompanyList(obj);
         $('#avatar').on('change', function () {
         $('#avatar').on('change', function () {
             var reader = new FileReader();
             var reader = new FileReader();
@@ -241,7 +242,7 @@
             var startTime = $('#alertStartTime').val();
             var startTime = $('#alertStartTime').val();
             var endTime = $('#alertEndTime').val();
             var endTime = $('#alertEndTime').val();
             var alertNum = $('#alertNum').val();
             var alertNum = $('#alertNum').val();
-            var userType = $('#userType').val().join();
+            var userType = $('#userType').val();
             var objSubmit = {
             var objSubmit = {
                 alertType:alertType,
                 alertType:alertType,
                 photoUrl:photoUrl,
                 photoUrl:photoUrl,

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

@@ -141,14 +141,14 @@
                     field : 'userType',
                     field : 'userType',
                     title : '用户类型',
                     title : '用户类型',
                     formatter: function(value, row, index) {
                     formatter: function(value, row, index) {
-                        if (value.indexOf('1') != -1 && value.indexOf('0') != -1){
+                        if (value.indexOf('2') != -1){
                             return '立邦人员、经销商';
                             return '立邦人员、经销商';
                         }
                         }
-                        if (value.indexOf('1') != -1 && value.indexOf('0') == -1) {
+                        if (value.indexOf('1') != -1) {
                             return '经销商';
                             return '经销商';
                         }
                         }
-                        if (value.indexOf('1') == -1 && value.indexOf('0') != -1) {
-                            return '立邦员';
+                        if (value.indexOf('0') != -1) {
+                            return '立邦员';
                         }
                         }
                     }
                     }
                 },
                 },

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

@@ -63,7 +63,7 @@
             <div class="form-group">
             <div class="form-group">
                 <label class="col-sm-3 control-label">用户类型:</label>
                 <label class="col-sm-3 control-label">用户类型:</label>
                 <div class="col-sm-8">
                 <div class="col-sm-8">
-                    <select title="请选择" id="userType" name="userType" class="form-control m-b selectpicker" th:with="type=${@dict.getType('sys_lantern_permission')}" multiple>
+                    <select title="请选择" id="userType" name="userType" class="form-control m-b selectpicker" th:with="type=${@dict.getType('sys_alert_permission')}">
                         <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userType}"></option>
                         <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userType}"></option>
                     </select>
                     </select>
                 </div>
                 </div>
@@ -137,7 +137,7 @@
                 $("#alertContentItem").hide();
                 $("#alertContentItem").hide();
                 $("#div-bgUrl").html("<img src='" + formData.photoUrl + "' style='width:300px;margin-bottom: 5px;'>");
                 $("#div-bgUrl").html("<img src='" + formData.photoUrl + "' style='width:300px;margin-bottom: 5px;'>");
             }
             }
-            $("#userType").selectpicker('val',formData.userType.split(','));
+            $("#userType").selectpicker('val',formData.userType);
             if (formData.salesLevel == 'company_level'){
             if (formData.salesLevel == 'company_level'){
                 var objhx1 = {
                 var objhx1 = {
                     parType: 'company_level',
                     parType: 'company_level',
@@ -270,7 +270,7 @@
                 var startTime = $('#alertStartTime').val();
                 var startTime = $('#alertStartTime').val();
                 var endTime = $('#alertEndTime').val();
                 var endTime = $('#alertEndTime').val();
                 var alertNum = $('#alertNum').val();
                 var alertNum = $('#alertNum').val();
-                var userType = $('#userType').val().join();
+                var userType = $('#userType').val();
                 var objSubmit = {
                 var objSubmit = {
                     alertId:alertId,
                     alertId:alertId,
                     alertType:alertType,
                     alertType:alertType,

+ 1 - 2
suishenbang-system/src/main/java/com/dgtly/system/domain/AlertConfiguration.java

@@ -64,8 +64,7 @@ public class AlertConfiguration extends BaseEntity
     private String photoUrl;
     private String photoUrl;
 
 
 
 
-
-    public void setAlertId(Long alertId) 
+    public void setAlertId(Long alertId)
     {
     {
         this.alertId = alertId;
         this.alertId = alertId;
     }
     }

+ 5 - 6
suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertConfigurationServiceImpl.java

@@ -1,9 +1,6 @@
 package com.dgtly.system.service.impl;
 package com.dgtly.system.service.impl;
 
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 import com.dgtly.common.utils.DateUtils;
 import com.dgtly.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -88,11 +85,13 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
             }
             }
             while (it.hasNext()) {
             while (it.hasNext()) {
                 AlertConfiguration alert = it.next();
                 AlertConfiguration alert = it.next();
-                    if(orgCodes !=null && orgCodes.size()>0){
+                    if(orgCodes !=null && orgCodes.size()>0 && alert.getOrgCode() !=null && !("null").equals(alert.getOrgCode())){
                         if(orgCodes.contains(alert.getOrgCode())){
                         if(orgCodes.contains(alert.getOrgCode())){
                             return 1;
                             return 1;
                         }
                         }
-                }
+                }else{
+                        return 1;
+                    }
             }
             }
         }else{
         }else{
                     return 0;
                     return 0;

+ 3 - 2
suishenbang-system/src/main/resources/mapper/system/AlertConfigurationMapper.xml

@@ -44,9 +44,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectAlertConfigurationListFilter" parameterType="Long" resultMap="AlertConfigurationResult">
     <select id="selectAlertConfigurationListFilter" parameterType="Long" resultMap="AlertConfigurationResult">
         <include refid="selectAlertConfigurationVo"/>
         <include refid="selectAlertConfigurationVo"/>
         WHERE alert_status = 1
         WHERE alert_status = 1
-        <if test="userType !=null and userType !='' and orgCode !='null' ">
-            and user_type =#{userType}
+        <if test="userType !=null and userType !='' and userType !='2'.toString() ">
+          and ( user_type =#{userType}  or user_type ='2')
         </if>
         </if>
+
     </select>
     </select>
     
     
     <select id="selectAlertConfigurationById" parameterType="Long" resultMap="AlertConfigurationResult">
     <select id="selectAlertConfigurationById" parameterType="Long" resultMap="AlertConfigurationResult">