瀏覽代碼

Merge branch 'v3' of http://git.ycjcjy.com/zhiyuxing/estateagents into v3

张延森 5 年之前
父節點
當前提交
b9ac7570e6

+ 4
- 3
src/main/java/com/huiju/estateagents/controller/TaBuildingDynamicController.java 查看文件

@@ -226,6 +226,8 @@ public class TaBuildingDynamicController extends BaseController {
226 226
     public ResponseBean taActivityDynamicEnlist(@RequestBody TaActivityDynamicEnlist taActivityDynamicEnlist,
227 227
                                                 HttpServletRequest request){
228 228
         String openid = getOpenId(request);
229
+        Integer orgId = getOrgId(request);
230
+
229 231
         List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
230 232
         if (null == taPersons || taPersons.size() != 1) {
231 233
             return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
@@ -236,7 +238,7 @@ public class TaBuildingDynamicController extends BaseController {
236 238
         // 携带的报名人数(是已经包括自己了),不能超过活动总人数
237 239
 
238 240
         // 当前活动已报名的总人数
239
-        Integer enlistCount = taActivityDynamicEnlistMapper.selectEnlistCount(taActivityDynamicEnlist.getDynamicId(), getOrgId(request));
241
+        Integer enlistCount = taActivityDynamicEnlistMapper.selectEnlistCount(taActivityDynamicEnlist.getDynamicId(), orgId);
240 242
         if ((enlistCount + taActivityDynamicEnlist.getAttendNum()) > buildingDynamic.getEnlistNum().intValue()) {
241 243
             return ResponseBean.error("报名失败,超过活动报名的最大人数!", ResponseBean.ERROR_UNAVAILABLE);
242 244
         }
@@ -257,10 +259,9 @@ public class TaBuildingDynamicController extends BaseController {
257 259
 
258 260
 
259 261
         TaPerson person = taPersons.get(0);
260
-        Integer orgId = getOrgId(request);
261 262
         taActivityDynamicEnlist.setPersonId(person.getPersonId());
262 263
         taActivityDynamicEnlist.setOrgId(orgId);
263
-        ResponseBean  responseBean = iBuildingDynamicService.taActivityDynamicEnlistAdd(taActivityDynamicEnlist);
264
+        ResponseBean  responseBean = iBuildingDynamicService.taActivityDynamicEnlistAdd(taActivityDynamicEnlist, orgId);
264 265
         return responseBean;
265 266
     }
266 267
     

+ 13
- 0
src/main/java/com/huiju/estateagents/entity/TaActivityDynamicEnlist.java 查看文件

@@ -1,6 +1,7 @@
1 1
 package com.huiju.estateagents.entity;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import com.baomidou.mybatisplus.annotation.TableName;
6 7
 import lombok.Data;
@@ -61,4 +62,16 @@ public class TaActivityDynamicEnlist implements Serializable {
61 62
      */
62 63
     private Integer attendNum;
63 64
 
65
+    /**
66
+     * 分享人
67
+     */
68
+    @TableField(exist = false)
69
+    private String sharePersonName;
70
+
71
+    /**
72
+     * 公司名称
73
+     */
74
+    @TableField(exist = false)
75
+    private String orgName;
76
+
64 77
 }

+ 5
- 0
src/main/java/com/huiju/estateagents/entity/TdPointsRules.java 查看文件

@@ -64,4 +64,9 @@ public class TdPointsRules implements Serializable {
64 64
      * 停用启用状态
65 65
      */
66 66
     private Integer status;
67
+    
68
+    /**
69
+     * 积分说明
70
+     */
71
+    private String remark;
67 72
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java 查看文件

@@ -46,7 +46,7 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
46 46
      * @param sex
47 47
      * @return
48 48
      */
49
-    IPage<TaRecommendCustomer> getPublicCustomerList(IPage<TaPerson> page, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId);
49
+    IPage<TaRecommendCustomer> getPublicCustomerList(IPage<TaPerson> page, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
50 50
 
51 51
     /**
52 52
      * 获取推荐用户数据

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaBuildingDynamicService.java 查看文件

@@ -72,7 +72,7 @@ public interface ITaBuildingDynamicService extends IService<TaBuildingDynamic> {
72 72
      * 报名活动
73 73
      * @return
74 74
      */
75
-    ResponseBean taActivityDynamicEnlistAdd(TaActivityDynamicEnlist taActivityDynamicEnlist);
75
+    ResponseBean taActivityDynamicEnlistAdd(TaActivityDynamicEnlist taActivityDynamicEnlist, Integer orgId);
76 76
 
77 77
     /**
78 78
      * 报名列表

+ 16
- 7
src/main/java/com/huiju/estateagents/service/impl/TaBuildingDynamicServiceImpl.java 查看文件

@@ -156,6 +156,9 @@ public class TaBuildingDynamicServiceImpl extends ServiceImpl<TaBuildingDynamicM
156 156
         Integer enlistCount = taActivityDynamicEnlistMapper.selectEnlistCount(buildingDynamic.getDynamicId(), orgId);
157 157
         buildingDynamic.setEnlisted(enlistCount);
158 158
 
159
+        // 活动海报
160
+        buildingDynamic.setPosters(taPosterService.getPostersForTarget(buildingDynamic.getDynamicId(), CommConstant.POSTER_CONTENT_TYPE_ACTIVITY));
161
+
159 162
         return ResponseBean.success(buildingDynamic);
160 163
     }
161 164
 
@@ -216,23 +219,29 @@ public class TaBuildingDynamicServiceImpl extends ServiceImpl<TaBuildingDynamicM
216 219
     }
217 220
 
218 221
     @Override
219
-    public ResponseBean taActivityDynamicEnlistAdd(TaActivityDynamicEnlist taActivityDynamicEnlist) {
222
+    public ResponseBean taActivityDynamicEnlistAdd(TaActivityDynamicEnlist taActivityDynamicEnlist, Integer orgId) {
220 223
         ResponseBean responseBean= new ResponseBean<>();
221 224
         // 查询当前活动属于哪个楼盘
222 225
         TaBuildingDynamic taBuildingDynamic= buildingDynamicMapper.selectById(taActivityDynamicEnlist.getDynamicId());
223
-        // 判断当前活动是否满
224
-        QueryWrapper<TaActivityDynamicEnlist> taBuildingDynamicQuery=  new QueryWrapper<>();
225
-        taBuildingDynamicQuery.eq("dynamic_id",taBuildingDynamic.getDynamicId());
226
-        int contActivity = taActivityDynamicEnlistMapper.selectCount(taBuildingDynamicQuery);
227
-        int personNum= Integer.parseInt(null == taBuildingDynamic.getPersonNum()?"0": taBuildingDynamic.getPersonNum());
226
+
227
+        /**
228
+         * 判断当前活动是否满
229
+         */
230
+
231
+        TaBuildingDynamic buildingDynamic = this.getById(taActivityDynamicEnlist.getDynamicId());
232
+        // 已报名人数
233
+        Integer enlistCount = taActivityDynamicEnlistMapper.selectEnlistCount(taActivityDynamicEnlist.getDynamicId(), orgId);
234
+
228 235
         // 当报名人数已满时,活动为已结束
229
-        if (contActivity >= personNum){
236
+        if ((enlistCount + taActivityDynamicEnlist.getAttendNum()) > buildingDynamic.getEnlistNum().intValue()) {
230 237
             taBuildingDynamic.setIsEnlist("2");
231 238
             buildingDynamicMapper.updateById(taBuildingDynamic);
232 239
             responseBean.addError("当前报名人数已满");
233 240
             return responseBean;
234 241
         }
235 242
         // 判断是否报名根据电话号码校验
243
+        QueryWrapper<TaActivityDynamicEnlist> taBuildingDynamicQuery=  new QueryWrapper<>();
244
+        taBuildingDynamicQuery.eq("dynamic_id",taBuildingDynamic.getDynamicId());
236 245
         taBuildingDynamicQuery.eq("phone",taActivityDynamicEnlist.getPhone());
237 246
         TaActivityDynamicEnlist activityDynamicEnlist = taActivityDynamicEnlistMapper.selectOne(taBuildingDynamicQuery);
238 247
         if (null !=activityDynamicEnlist){

+ 1
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java 查看文件

@@ -649,6 +649,7 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
649 649
             QueryWrapper<TaRecommendCustomer> taRecommendCustomerQuery= new QueryWrapper<>();
650 650
             taRecommendCustomerQuery.eq("recommend_person",taPerson.getPersonId());
651 651
             taRecommendCustomerQuery.eq("status",1);
652
+            taRecommendCustomerQuery.eq("org_id", orgid);
652 653
             /*推荐客户总数*/
653 654
             int recommendCount= taRecommendCustomerMapper.selectCount(taRecommendCustomerQuery);
654 655
             taPerson.setRecommendCount(recommendCount);

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

@@ -339,7 +339,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
339 339
         if (CommConstant.CUTOMER_TYPE_PUBLIC.equals(customerType)) {
340 340
             // 公客
341 341
             IPage<TaPerson>page = new Page<>(pageNumber,pageSize);
342
-            return taRecommendCustomerMapper.getPublicCustomerList(page, name, tel,  entryType, verifyStatus, sex, orgId);
342
+            return taRecommendCustomerMapper.getPublicCustomerList(page, name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
343 343
         } else {
344 344
             // 私客
345 345
             IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);

+ 3
- 3
src/main/resources/application-v3.yml 查看文件

@@ -5,9 +5,9 @@ spring:
5 5
     name: estateagents
6 6
   datasource:
7 7
     username: estateagents
8
-      password: DQ@0lW##kBb2+-jPZ
9
-      url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/estateagents3.0?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
10
-      driver-class-name: com.mysql.cj.jdbc.Driver
8
+    password: DQ@0lW##kBb2+-jPZ
9
+    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/estateagents3.0?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
10
+    driver-class-name: com.mysql.cj.jdbc.Driver
11 11
     initial-size: 10 # 初始化连接数
12 12
     max-active: 20 # 最大连接数
13 13
     min-idle: 8 # 最小空闲数

+ 12
- 2
src/main/resources/mapper/TaActivityDynamicEnlistMapper.xml 查看文件

@@ -2,10 +2,20 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaActivityDynamicEnlistMapper">
4 4
         <select id="signList" resultType="com.huiju.estateagents.entity.TaActivityDynamicEnlist">
5
-            select * from ta_activity_dynamic_enlist where dynamic_id = #{dynamicId} and org_id = #{orgId}
5
+             SELECT
6
+                tade.*,
7
+                tp.name as sharePersonName,
8
+                tao.name as orgName
9
+            FROM
10
+                ta_activity_dynamic_enlist tade LEFT JOIN ta_person tp on tade.share_person = tp.person_id
11
+                LEFT JOIN ta_org tao on tade.org_id = tao.org_id
12
+            WHERE
13
+                tade.dynamic_id = #{dynamicId}
14
+                AND tade.org_id = #{orgId}
15
+
6 16
         </select>
7 17
 
8 18
         <select id="selectEnlistCount" resultType="Integer" >
9
-            select sum(attend_num) from ta_activity_dynamic_enlist where dynamic_id = #{dynamicId} and org_id = #{orgId}
19
+            select ifnull(sum( attend_num ), 0) from ta_activity_dynamic_enlist where dynamic_id = #{dynamicId} and org_id = #{orgId}
10 20
         </select>
11 21
 </mapper>

+ 38
- 37
src/main/resources/mapper/TaPersonMapper.xml 查看文件

@@ -10,9 +10,10 @@
10 10
             t.post,
11 11
             t.tel AS phone,
12 12
             t.avatarurl AS avatar,
13
-            t.photo
13
+            t.photo,
14
+            u.description as description
14 15
         FROM
15
-            ta_person t
16
+            ta_person t left join ta_user u on t.user_id = u.user_id
16 17
         LEFT JOIN ta_person_building p ON t.person_id = p.person_id
17 18
         WHERE
18 19
             t.person_type = #{personType}
@@ -27,7 +28,7 @@
27 28
 
28 29
     <select id="selectBuildingConsultants" resultType="java.util.HashMap">
29 30
         SELECT
30
-            u.user_id AS id,
31
+            t.person_id AS id,
31 32
             u.user_name,
32 33
             u.org_name,
33 34
             u.department,
@@ -131,9 +132,10 @@ FROM
131 132
         t.post,
132 133
         t.tel AS phone,
133 134
         t.avatarurl AS avatar,
134
-        t.photo
135
+        t.photo,
136
+        u.description as description
135 137
         FROM
136
-        ta_person t
138
+        ta_person t left join ta_user u on t.user_id = u.user_id
137 139
         WHERE
138 140
         t.person_type = #{personType}
139 141
         AND t.status = #{status}
@@ -471,52 +473,51 @@ FROM
471 473
 
472 474
     <select id="getPersonList" resultType="com.huiju.estateagents.entity.TaPerson">
473 475
         SELECT
474
-	a.*
475
-FROM
476
-	ta_person a
477
-	LEFT JOIN ta_person_building b ON a.person_id = b.person_id
478
-	<where>
479
-        1=1
480
-        <if test="personType != null and personType!= ''">
481
-            and a.person_type = #{personType}
482
-        </if>
483
-        <if test="name != null and name!= ''">
484
-            and a.name like CONCAT('%',#{name}, '%')
485
-        </if>
486
-        <if test="personTags != null and personTags!= ''">
487
-            and a.person_tags like CONCAT('%',#{personTags}, '%')
488
-        </if>
489
-        <if test="phone != null and phone!= ''">
490
-            and a.tel = #{phone}
491
-        </if>
492
-        <if test="buildingId != null and buildingId!= ''">
493
-            and b.building_id = #{buildingId}
494
-        </if>
495
-        <if test="status != null">
496
-            and a.status = #{status}
497
-        </if>
498
-    </where>
499
-	GROUP BY a.person_id
476
+            a.*
477
+        FROM
478
+            ta_person a
479
+            LEFT JOIN ta_person_building b ON a.person_id = b.person_id
480
+            <where>
481
+                1=1
482
+                <if test="personType != null and personType!= ''">
483
+                    and a.person_type = #{personType}
484
+                </if>
485
+                <if test="name != null and name!= ''">
486
+                    and a.name like CONCAT('%',#{name}, '%')
487
+                </if>
488
+                <if test="personTags != null and personTags!= ''">
489
+                    and a.person_tags like CONCAT('%',#{personTags}, '%')
490
+                </if>
491
+                <if test="phone != null and phone!= ''">
492
+                    and a.tel = #{phone}
493
+                </if>
494
+                <if test="buildingId != null and buildingId!= ''">
495
+                    and b.building_id = #{buildingId}
496
+                </if>
497
+                <if test="status != null">
498
+                    and a.status = #{status}
499
+                </if>
500
+            </where>
501
+            GROUP BY a.person_id
500 502
     </select>
501 503
 
502 504
     <select id="channelBrokerList" resultType="com.huiju.estateagents.entity.TaPerson">
503 505
         select
504 506
         p.person_id,
505 507
         p.avatarurl,
506
-        p.tel,
507 508
         p.sex,
508
-        rc.`name`,
509
-        rc.phone,
509
+        rc.`name` as name,
510
+        rc.phone as tel,
510 511
         COUNT(rc.person_id) as recommendCount
511 512
         from ta_channel_person tch
512 513
         left join  ta_person p on  tch.person_id = p.person_id
513
-        LEFT JOIN ta_recommend_customer rc ON p.person_id = rc.person_id and rc.report_recommend_status = 1
514
+        LEFT JOIN ta_recommend_customer rc ON p.person_id = rc.person_id
514 515
         <where>
515 516
         <if test="name !=null and name !=''">
516
-            and rc.`name` = #{name}
517
+            and rc.name like CONCAT('%',#{name}, '%')
517 518
         </if>
518 519
         <if test="phone !=null and phone !=''">
519
-            and rc.phone = #{phone}
520
+            and rc.phone like CONCAT('%',#{phone}, '%')
520 521
         </if>
521 522
             and p.org_id= #{orgid}
522 523
             and tch.channel_id = #{channelId}

+ 9
- 6
src/main/resources/mapper/TaRecommendCustomerMapper.xml 查看文件

@@ -83,7 +83,7 @@ FROM
83 83
             left join ta_channel_person tcp on a.person_id = tcp.person_id
84 84
             left join ta_channel tc on tc.channel_id = tcp.channel_id
85 85
         <where>
86
-            a.person_type = 'estate agent'
86
+            a.person_type in ('estate agent', 'channel agent')
87 87
             and a.status >0
88 88
             <if test="name != null and name !=''">
89 89
                 and a.nickname = #{name}
@@ -166,16 +166,16 @@ FROM
166 166
                 and a.building_id = #{building}
167 167
             </if>
168 168
             <if test="name != null and name !=''">
169
-                and a.name = #{name}
169
+                and a.name like CONCAT('%',#{name}, '%')
170 170
             </if>
171 171
             <if test="tel != null and tel!=''">
172
-                and a.phone = #{tel}
172
+                and a.phone like CONCAT('%',#{tel}, '%')
173 173
             </if>
174 174
             <if test="consultName != null and consultName !=''">
175 175
                 and b.name like CONCAT('%',#{consultName}, '%')
176 176
             </if>
177 177
             <if test="consultTel != null and consultTel !=''">
178
-                and b.tel = #{consultTel}
178
+                and b.tel like CONCAT('%',#{consultTel}, '%')
179 179
             </if>
180 180
             <if test="entryType != null and entryType !=''">
181 181
                 and a.entry_type = #{entryType}
@@ -208,10 +208,10 @@ FROM
208 208
             b.status > 0
209 209
             AND IFNULL(b.person_type, '') in ('estate agent', 'customer')
210 210
             <if test="name != null and name !=''">
211
-                and b.nickname = #{name}
211
+                and b.nickname like CONCAT('%',#{name}, '%')
212 212
             </if>
213 213
             <if test="tel != null and tel!=''">
214
-                and b.phone = #{tel}
214
+                and b.phone like CONCAT('%',#{tel}, '%')
215 215
             </if>
216 216
             <if test="entryType != null and entryType !=''">
217 217
                 and b.entry_type = #{entryType}
@@ -222,6 +222,9 @@ FROM
222 222
             <if test="orgId != null">
223 223
                 and b.org_id = #{orgId}
224 224
             </if>
225
+            <if test="consultTel != null and consultTel !=''">
226
+                and b.tel like CONCAT('%',#{consultTel}, '%')
227
+            </if>
225 228
             and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
226 229
         </where>
227 230
         order by b.create_date desc