gt пре 3 година
родитељ
комит
8ebb1a606f

+ 4 - 0
wxdks/src/main/java/com/c3/wxdks/entity/OrgInfo.java

@@ -86,4 +86,8 @@ public class OrgInfo {
      * 修改时间
      */
     private Date updateTime;
+    /**
+     * 排序号
+     */
+    private Integer sort;
 }

+ 15 - 2
wxdks/src/main/java/com/c3/wxdks/service/impl/OrgInfoServiceImpl.java

@@ -44,6 +44,11 @@ public class OrgInfoServiceImpl implements OrgInfoService {
         if (count > 0) {
             return SendUtil.send(false, Constants.NOT_SAME, "");
         }
+
+        // 设置排序号默认值
+        if (Blank.isEmpty(orgInfo.getSort())) {
+            orgInfo.setSort(0);
+        }
         Boolean falg = orgInfoMapper.addOrgInfo(orgInfo);
         return SendUtil.send(falg);
     }
@@ -61,6 +66,11 @@ public class OrgInfoServiceImpl implements OrgInfoService {
         if (count > 0) {
             return SendUtil.send(false, Constants.NOT_SAME, "");
         }
+
+        // 设置排序号默认值
+        if (Blank.isEmpty(orgInfo.getSort())) {
+            orgInfo.setSort(0);
+        }
         Boolean falg = orgInfoMapper.updateOrgInfo(orgInfo);
         return SendUtil.send(falg);
     }
@@ -116,7 +126,10 @@ public class OrgInfoServiceImpl implements OrgInfoService {
             String columnIdData = Convert.toStr(orgInfo.get("columnId"));
             String classificationData = Convert.toStr(orgInfo.get("classification"));
             // 服务类型
-            String[] typeDataArr = typeData.split(",");
+            String[] typeDataArr = new String[16];
+            if (Blank.isNotEmpty(typeData)) {
+                typeDataArr = typeData.split(",");
+            }
             String key = "five_modules";
             Map<String, Object> basicData = basicDataMapper.getOneBasicDataByType(key);
             if (Blank.isNotEmpty(basicData)) {
@@ -129,7 +142,7 @@ public class OrgInfoServiceImpl implements OrgInfoService {
                     userTypeMap.put("name", name);
                     userTypeMap.put("value", value);
                     for (String type : typeDataArr) {
-                        if ( type.equals(value)) {
+                        if ( value.equals(type)) {
                             userTypeMap.put("selected", true);
                         }
                     }

+ 10 - 4
wxdks/src/main/resources/com/c3/wxdks/mapper/OrgInfoMapper.xml

@@ -21,7 +21,8 @@
             org_book,
             longitude,
             latitude,
-            create_time
+            create_time,
+            sort
         ) VALUES (
              #{type},
              #{columnId},
@@ -39,7 +40,8 @@
              #{orgBook},
              #{longitude},
              #{latitude},
-             NOW()
+             NOW(),
+             #{sort}
          )
     </insert>
 
@@ -68,7 +70,8 @@
             org_book = #{orgBook},
             longitude = #{longitude},
             latitude = #{latitude},
-            update_time = NOW()
+            update_time = NOW(),
+            sort = #{sort}
         </set>
         WHERE id = #{id}
     </update>
@@ -146,7 +149,8 @@
             org_book,
             longitude,
             latitude,
-            create_time
+            create_time,
+            sort
         FROM
             t_org_info toi
                 LEFT JOIN t_column tc ON toi.column_id = tc.id
@@ -201,6 +205,8 @@
             <if test="type != null and type!= ''">
                 and CONCAT(type, ',') like concat('%', #{type}, ',', '%')
             </if>
+        order by
+            sort desc
         <if test="page != null and limit != null">
             limit #{page}, #{limit}
         </if>

+ 1 - 1
wxdks/src/main/resources/static/ftl/wxdks/public/css/index.css

@@ -454,7 +454,7 @@
 .register_password .register_box {
 	width: 624px;
 	/* height: 485px; */
-	background-color: rgba(255, 255, 255, .3);
+	/*background-color: rgba(255, 255, 255, .3);
 	margin: 20px auto;
 	padding: 40px 60px;
 	box-sizing: border-box;

+ 8 - 0
wxdks/src/main/resources/static/page/companyManage.html

@@ -293,6 +293,14 @@
                        autocomplete="off">
             </div>
         </div>
+        <div class="layui-form-item layui-input-inline">
+            <label class="layui-form-label">排序号:</label>
+            <div class="layui-input-inline">
+                <input type="text" name="sort" id="sort" maxlength="500"
+                        class="layui-input" placeholder="排序号" onkeyup="this.value=this.value.replace(/[^0-9]|^0/g,'')"
+                       autocomplete="off">
+            </div>
+        </div>
 <!--        <div class="layui-form-item layui-input-inline">-->
 <!--            <label class="layui-form-label">坐标:</label>-->
 <!--            <div class="layui-input-inline">-->