瀏覽代碼

Merge remote-tracking branch 'origin/master'

panhui 7 年之前
父節點
當前提交
52d03be680

+ 113 - 103
src/main/java/com/izouma/awesomeadmin/dao/FacedInfoMapper.xml

@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.izouma.awesomeadmin.dao.FacedInfoMapper" >
-    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.FacedInfo" >
-                <id column="id" property="id" jdbcType="INTEGER" />
-                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
-                                <result column="faced_name" property="facedName" jdbcType="VARCHAR" />
-                                <result column="rank" property="rank" jdbcType="INTEGER" />
-            </resultMap>
-    <sql id="Base_Column_List" >
-        <trim  suffixOverrides="," >
+<mapper namespace="com.izouma.awesomeadmin.dao.FacedInfoMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.FacedInfo">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="faced_name" property="facedName" jdbcType="VARCHAR"/>
+        <result column="rank" property="rank" jdbcType="INTEGER"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <trim suffixOverrides=",">
             id,
 
             del_flag,
@@ -17,89 +17,93 @@
 
             rank,
 
-            </trim>
+        </trim>
     </sql>
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
         select
-        <include refid="Base_Column_List" />
+        <include refid="Base_Column_List"/>
         from faced_info
         where id = #{id,jdbcType=INTEGER}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
         delete from faced_info
         where id = #{id,jdbcType=INTEGER}
     </delete>
-    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.FacedInfo" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.FacedInfo" useGeneratedKeys="true"
+            keyProperty="id">
         insert into faced_info
-        <trim prefix="(" suffix=")" suffixOverrides="," >
-                <if test="id!= null" >
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!= null">
                 id,
             </if>
-                <if test="delFlag!= null" >
+            <if test="delFlag!= null">
                 del_flag,
             </if>
-                <if test="facedName!= null" >
+            <if test="facedName!= null">
                 faced_name,
             </if>
-                <if test="rank!= null" >
+            <if test="rank!= null">
                 rank,
             </if>
-            </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides="," >
-                    <if test="id != null" >
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
                 #{id,jdbcType=INTEGER},
             </if>
-                    <if test="delFlag != null" >
+            <if test="delFlag != null">
                 #{delFlag,jdbcType=CHAR},
             </if>
-                    <if test="facedName != null" >
+            <if test="facedName != null">
                 #{facedName,jdbcType=VARCHAR},
             </if>
-                    <if test="rank != null" >
+            <if test="rank != null">
                 #{rank,jdbcType=INTEGER},
             </if>
-                </trim>
+        </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.FacedInfo" >
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.FacedInfo">
         update faced_info
-        <set >
-                    <if test="id != null" >
-               id= #{id,jdbcType=INTEGER},
+        <set>
+            <if test="id != null">
+                id= #{id,jdbcType=INTEGER},
             </if>
-                     <if test="delFlag != null" >
-               del_flag= #{delFlag,jdbcType=CHAR},
+            <if test="delFlag != null">
+                del_flag= #{delFlag,jdbcType=CHAR},
             </if>
-                     <if test="facedName != null" >
-               faced_name= #{facedName,jdbcType=VARCHAR},
+            <if test="facedName != null">
+                faced_name= #{facedName,jdbcType=VARCHAR},
             </if>
-                     <if test="rank != null" >
-               rank= #{rank,jdbcType=INTEGER},
+            <if test="rank != null">
+                rank= #{rank,jdbcType=INTEGER},
             </if>
-                 </set>
+        </set>
         where id = #{id,jdbcType=INTEGER}
     </update>
-    <select id="queryFacedInfoByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.FacedInfo">
-        select <include refid="Base_Column_List"/> from faced_info
+    <select id="queryFacedInfoByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.FacedInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from faced_info
         <where>
             and del_flag = 'N'
-                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
-                and  id = #{record.id}
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
             </if>
-                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
-                and  del_flag = #{record.delFlag}
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
             </if>
-                     <if test="record.facedName != null and !&quot;&quot;.equals(record.facedName)">
-                and  faced_name = #{record.facedName}
+            <if test="record.facedName != null and !&quot;&quot;.equals(record.facedName)">
+                and faced_name = #{record.facedName}
             </if>
-                     <if test="record.rank != null and !&quot;&quot;.equals(record.rank)">
-                and  rank = #{record.rank}
+            <if test="record.rank != null and !&quot;&quot;.equals(record.rank)">
+                and rank = #{record.rank}
+            </if>
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR faced_name LIKE concat('%',#{record.searchKey},'%')
+                    OR rank LIKE concat('%',#{record.searchKey},'%')
+                </trim>
             </if>
-                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
-             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                OR  faced_name LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  rank LIKE concat('%',#{record.searchKey},'%')
-                                                             </trim>
-         </if>
 
             <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
                 <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
@@ -137,84 +141,88 @@
             </if>
 
         </where>
-        order by id desc
+        order by rank desc ,id desc
     </select>
     <select id="queryAllFacedInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.FacedInfo">
-        select <include refid="Base_Column_List"/> from faced_info
+        select
+        <include refid="Base_Column_List"/>
+        from faced_info
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
-                and  id = #{id}
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
             </if>
-                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-                and  del_flag = #{delFlag}
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
             </if>
-                    <if test="facedName != null and !&quot;&quot;.equals(facedName)">
-                and  faced_name = #{facedName}
+            <if test="facedName != null and !&quot;&quot;.equals(facedName)">
+                and faced_name = #{facedName}
             </if>
-                    <if test="rank != null and !&quot;&quot;.equals(rank)">
-                and  rank = #{rank}
+            <if test="rank != null and !&quot;&quot;.equals(rank)">
+                and rank = #{rank}
             </if>
-                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
-                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                OR  faced_name LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  rank LIKE concat('%',#{searchKey},'%')
-                                                                                        </trim>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR faced_name LIKE concat('%',#{searchKey},'%')
+                    OR rank LIKE concat('%',#{searchKey},'%')
+                </trim>
             </if>
-<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
-    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
-        <choose>
-            <when test="item.indexOf('like') != -1">
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        concat('%',#{itemDetail},'%')
-                    </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
 
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
-                </foreach>
-            </when>
-            <otherwise>
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        #{itemDetail}
-                    </if>
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
 
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
-                </foreach>
-            </otherwise>
-        </choose>
+                            </foreach>
+                        </otherwise>
+                    </choose>
 
 
-    </foreach>
+                </foreach>
 
 
-</if>
+            </if>
         </where>
-        order by id desc
+        order by rank desc , id desc
     </select>
     <select id="queryFacedInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.FacedInfo">
-        select <include refid="Base_Column_List"/> from faced_info
+        select
+        <include refid="Base_Column_List"/>
+        from faced_info
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
+            <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>
-                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                 and del_flag = #{delFlag}
             </if>
-                     <if test="facedName != null and !&quot;&quot;.equals(facedName)">
+            <if test="facedName != null and !&quot;&quot;.equals(facedName)">
                 and faced_name = #{facedName}
             </if>
-                     <if test="rank != null and !&quot;&quot;.equals(rank)">
+            <if test="rank != null and !&quot;&quot;.equals(rank)">
                 and rank = #{rank}
             </if>
-         
+
         </where>
         LIMIT 1
     </select>
@@ -225,10 +233,12 @@
         </where>
     </update>
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.FacedInfo">
-        select <include refid="Base_Column_List"/> from faced_info
+        select
+        <include refid="Base_Column_List"/>
+        from faced_info
         <where>
             and del_flag = 'N'
-                                                                                                                                    </where>
+        </where>
         order by id desc
     </select>
 </mapper>

+ 22 - 4
src/main/vue/src/pages/ContactRecords.vue

@@ -38,13 +38,14 @@
             </el-table-column>
             <el-table-column v-if="isColumnShow('showFlag')" prop="showFlag" label="用户显示" min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('createTime')" prop="createTime" :formatter="DateTimeFormatter" label="创建时间" min-width="100">
+            <el-table-column v-if="isColumnShow('createTime')" prop="createTime" :formatter="DateTimeFormatter" label="创建时间" min-width="140">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('updateTime')" prop="updateTime" :formatter="DateTimeFormatter" label="更新时间" min-width="100">
+            <el-table-column v-if="isColumnShow('updateTime')" prop="updateTime" :formatter="DateTimeFormatter" label="更新时间" min-width="140">
             </el-table-column>
-            <el-table-column label="操作" align="center" fixed="right">
+            <el-table-column label="操作" align="center" fixed="right" min-width="150">
                 <template slot-scope="scope">
                     <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -189,7 +190,24 @@ export default {
         searchData() {
             this.currentPage = 1;
             this.getData();
-        }
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/contactRecord/del',
+                    data: { id: row.id }
+                })
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.getData();
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
     }
 }
 </script>

+ 21 - 8
src/main/vue/src/pages/HouseInfo.vue

@@ -38,7 +38,7 @@
             </el-form-item>
             <el-form-item prop="faced" label="朝向">
                 <el-select placeholder="朝向" size="small" v-model="formData.faced" class="filter-item">
-                    <el-option v-for="item in faceds" :key="item.value" :label="item.label" :value="item.value">
+                    <el-option v-for="item in faceds" :key="item.facedName" :label="item.facedName" :value="item.facedName">
                     </el-option>
                 </el-select>
             </el-form-item>
@@ -49,7 +49,12 @@
                 <el-input v-model="formData.checkIn"></el-input>
             </el-form-item>
             <el-form-item prop="elevator" label="电梯">
-                <el-input v-model="formData.elevator"></el-input>
+                <el-select placeholder="电梯" size="small" v-model="formData.elevator" class="filter-item">
+                    <el-option label="有" value="有">
+                    </el-option>
+                    <el-option label="无" value="无">
+                    </el-option>
+                </el-select>
             </el-form-item>
             <el-form-item prop="rentingType" label="出租类型">
 
@@ -283,6 +288,14 @@ export default {
             }
         });
 
+        this.$http.get({
+            url: '/facedInfo/all'
+        }).then(res => {
+            if (res.success) {
+                this.faceds = res.data;
+            }
+        });
+
 
 
 
@@ -340,11 +353,11 @@ export default {
             businessCircles: [],
             mapDialogVisible: false,
             faceds: [
-                { value: '东', label: '东' },
-                { value: '南', label: '南' },
-                { value: '西', label: '西' },
-                { value: '北', label: '北' },
-                { value: '南北', label: '南北' },
+                { facedName: '东' },
+                { facedName: '南' },
+                { facedName: '西' },
+                { facedName: '北' },
+                { facedName: '南北' },
             ],
             lineCodes: [],
             stationCodes: [],
@@ -364,7 +377,7 @@ export default {
             var data = JSON.parse(JSON.stringify(this.formData));
             delete data.houseImages;
             delete data.houseFeatures;
-            
+
             this.$http.post({
                 url: this.formData.id ? '/houseInfo/update' : '/houseInfo/save',
                 data: data

+ 25 - 7
src/main/vue/src/pages/SeeOrders.vue

@@ -26,7 +26,7 @@
             </el-table-column>
             <el-table-column v-if="isColumnShow('userId')" prop="userId" label="用户ID" min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('userInfo.nickname')" prop="userInfo.nickname" label="用户" min-width="100">
+            <el-table-column v-if="isColumnShow('userInfo.nickname')" prop="userInfo.nickname" label="用户" min-width="120">
             </el-table-column>
             <el-table-column v-if="isColumnShow('houseId')" prop="houseId" label="房源" min-width="100">
             </el-table-column>
@@ -38,23 +38,24 @@
             </el-table-column>
             <el-table-column v-if="isColumnShow('orderStatus')" prop="orderStatus" :formatter="orderStatusFormatter" label="状态" min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('contact')" prop="contact" label="联系人" min-width="100">
+            <el-table-column v-if="isColumnShow('contact')" prop="contact" label="联系人" min-width="120">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('telephone')" prop="telephone" label="手机号" min-width="100">
+            <el-table-column v-if="isColumnShow('telephone')" prop="telephone" label="手机号" min-width="120">
             </el-table-column>
             <el-table-column v-if="isColumnShow('leaveMessage')" prop="leaveMessage" label="留言" min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('orderTime')" :formatter="DateTimeFormatter" prop="orderTime" label="预约时间" min-width="100">
+            <el-table-column v-if="isColumnShow('orderTime')" :formatter="DateTimeFormatter" prop="orderTime" label="预约时间" min-width="140">
             </el-table-column>
             <el-table-column v-if="isColumnShow('timeInterval')" prop="timeInterval" label="预约时段" min-width="100">
             </el-table-column>
-            <el-table-column v-if="isColumnShow('seeTime')" :formatter="DateTimeFormatter" prop="seeTime" label="看房时间" min-width="100">
+            <el-table-column v-if="isColumnShow('seeTime')" :formatter="DateTimeFormatter" prop="seeTime" label="看房时间" min-width="140">
             </el-table-column>
             <el-table-column v-if="isColumnShow('showFlag')" prop="showFlag" label="用户查看" min-width="100">
             </el-table-column>
-            <el-table-column label="操作" align="center" fixed="right">
+            <el-table-column label="操作" align="center" fixed="right" min-width="150">
                 <template slot-scope="scope">
                     <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -246,7 +247,24 @@ export default {
         searchData() {
             this.currentPage = 1;
             this.getData();
-        }
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/seeOrder/del',
+                    data: { id: row.id }
+                })
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.getData();
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
     }
 }
 </script>

+ 20 - 2
src/main/vue/src/pages/UserCollections.vue

@@ -36,9 +36,10 @@
             </el-table-column>
             <el-table-column v-if="isColumnShow('showFlag')" prop="showFlag" label="用户显示" min-width="100">
             </el-table-column>
-            <el-table-column label="操作" align="center" fixed="right">
+            <el-table-column label="操作" align="center" fixed="right" min-width="140">
                 <template slot-scope="scope">
                     <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -160,7 +161,24 @@ export default {
         searchData() {
             this.currentPage = 1;
             this.getData();
-        }
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/userCollection/del',
+                    data: { id: row.id }
+                })
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.getData();
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
     }
 }
 </script>