张延森 2 年之前
父節點
當前提交
6156ee567b

+ 3
- 3
src/main/java/com/yunzhi/marketing/base/BaseController.java 查看文件

137
         TaUser taUser = taUserService.getById(getUserId(request));
137
         TaUser taUser = taUserService.getById(getUserId(request));
138
         List<Institution> list = iInstitutionService.getAllByUser(taUser);
138
         List<Institution> list = iInstitutionService.getAllByUser(taUser);
139
         List<String> institutions = list.stream().map(Institution::getInstitutionId).collect(Collectors.toList());
139
         List<String> institutions = list.stream().map(Institution::getInstitutionId).collect(Collectors.toList());
140
-        if (institutions.contains(CommConstant.ROOT_INSTITUTION)) {
141
-            return null;
142
-        }
140
+//        if (institutions.contains(CommConstant.ROOT_INSTITUTION)) {
141
+//            return null;
142
+//        }
143
         return institutions;
143
         return institutions;
144
     }
144
     }
145
 
145
 

+ 14
- 1
src/main/java/com/yunzhi/marketing/broker/controller/BkFirstScreenController.java 查看文件

24
 
24
 
25
 import javax.servlet.http.HttpServletRequest;
25
 import javax.servlet.http.HttpServletRequest;
26
 import java.util.List;
26
 import java.util.List;
27
+import java.util.UUID;
27
 
28
 
28
 /**
29
 /**
29
  * <p>
30
  * <p>
85
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
86
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
86
     public ResponseBean bkFirstScreenAdd(@ApiParam("保存内容") @RequestBody BkFirstScreen bkFirstScreen,
87
     public ResponseBean bkFirstScreenAdd(@ApiParam("保存内容") @RequestBody BkFirstScreen bkFirstScreen,
87
                                          HttpServletRequest request) throws Exception{
88
                                          HttpServletRequest request) throws Exception{
88
-
89
+        String uuid = UUID.randomUUID().toString().replaceAll("-","");
90
+        bkFirstScreen.setScreenId(uuid);
89
         bkFirstScreen.setInstitutionId(CommConstant.ROOT_INSTITUTION);
91
         bkFirstScreen.setInstitutionId(CommConstant.ROOT_INSTITUTION);
90
         bkFirstScreen.setOrgId(getOrgId(request).toString());
92
         bkFirstScreen.setOrgId(getOrgId(request).toString());
91
 
93
 
94
+        if (!StringUtils.isEmpty(bkFirstScreen.getPageParam())) {
95
+            if (bkFirstScreen.getPageParam().contains("{id}")) {
96
+                bkFirstScreen.setPageParam(bkFirstScreen.getPageParam().replace("{id}", uuid));
97
+            }
98
+        }
99
+
92
         if (iBkFirstScreenService.save(bkFirstScreen)){
100
         if (iBkFirstScreenService.save(bkFirstScreen)){
93
             return ResponseBean.success(bkFirstScreen);
101
             return ResponseBean.success(bkFirstScreen);
94
         }else {
102
         }else {
122
                                         @ApiParam("更新内容") @RequestBody BkFirstScreen bkFirstScreen) throws Exception{
130
                                         @ApiParam("更新内容") @RequestBody BkFirstScreen bkFirstScreen) throws Exception{
123
 
131
 
124
         bkFirstScreen.setScreenId(id);
132
         bkFirstScreen.setScreenId(id);
133
+        if (!StringUtils.isEmpty(bkFirstScreen.getPageParam())) {
134
+            if (bkFirstScreen.getPageParam().contains("{id}")) {
135
+                bkFirstScreen.setPageParam(bkFirstScreen.getPageParam().replace("{id}", id));
136
+            }
137
+        }
125
 
138
 
126
         if (iBkFirstScreenService.updateById(bkFirstScreen)){
139
         if (iBkFirstScreenService.updateById(bkFirstScreen)){
127
             return ResponseBean.success(iBkFirstScreenService.getById(id));
140
             return ResponseBean.success(iBkFirstScreenService.getById(id));

+ 23
- 0
src/main/java/com/yunzhi/marketing/broker/controller/BrokerController.java 查看文件

11
 import com.yunzhi.marketing.common.CommConstant;
11
 import com.yunzhi.marketing.common.CommConstant;
12
 import com.yunzhi.marketing.common.StringUtils;
12
 import com.yunzhi.marketing.common.StringUtils;
13
 import com.yunzhi.marketing.entity.TaPerson;
13
 import com.yunzhi.marketing.entity.TaPerson;
14
+import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
15
+import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
14
 import io.swagger.annotations.Api;
16
 import io.swagger.annotations.Api;
15
 import io.swagger.annotations.ApiOperation;
17
 import io.swagger.annotations.ApiOperation;
16
 import io.swagger.annotations.ApiParam;
18
 import io.swagger.annotations.ApiParam;
34
     @Autowired
36
     @Autowired
35
     IBkInviteRecordService iBkInviteRecordService;
37
     IBkInviteRecordService iBkInviteRecordService;
36
 
38
 
39
+    @Autowired
40
+    IChannelCustomerService iChannelCustomerService;
41
+
37
 
42
 
38
     @RequestMapping(value="/admin/broker",method= RequestMethod.GET)
43
     @RequestMapping(value="/admin/broker",method= RequestMethod.GET)
39
     @ApiOperation(value="经纪人列表", notes = "经纪人列表", httpMethod = "GET", response = ResponseBean.class)
44
     @ApiOperation(value="经纪人列表", notes = "经纪人列表", httpMethod = "GET", response = ResponseBean.class)
51
     }
56
     }
52
 
57
 
53
 
58
 
59
+    @RequestMapping(value="/admin/broker/customer",method= RequestMethod.GET)
60
+    @ApiOperation(value="经纪人客户列表", notes = "经纪人客户列表", httpMethod = "GET", response = ResponseBean.class)
61
+    public ResponseBean getCustomerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
62
+                                      @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
63
+                                      @ApiParam("手机号") @RequestParam(value ="phone", required = false) String phone,
64
+                                      @ApiParam("姓名") @RequestParam(value ="name", required = false) String name,
65
+                                      @ApiParam("推荐人") @RequestParam(value ="recommendPerson", required = false) String recommendPerson) throws Exception {
66
+
67
+        if (StringUtils.isEmpty(recommendPerson)) {
68
+            return ResponseBean.error("请选择推荐经纪人", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+
71
+        IPage<ChannelCustomer> page = new Page<>(pageNum, pageSize);
72
+        IPage<ChannelCustomer> result = iChannelCustomerService.getPageByBroker(page, recommendPerson, name, phone);
73
+        return ResponseBean.success(result);
74
+    }
75
+
76
+
54
     @RequestMapping(value="/wx/broker",method= RequestMethod.GET)
77
     @RequestMapping(value="/wx/broker",method= RequestMethod.GET)
55
     @ApiOperation(value="小程序端经纪人列表", notes = "小程序端经纪人列表", httpMethod = "GET", response = ResponseBean.class)
78
     @ApiOperation(value="小程序端经纪人列表", notes = "小程序端经纪人列表", httpMethod = "GET", response = ResponseBean.class)
56
     public ResponseBean getWxBrokerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
79
     public ResponseBean getWxBrokerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,

+ 1
- 1
src/main/java/com/yunzhi/marketing/broker/entity/BkFirstScreen.java 查看文件

27
     private static final long serialVersionUID = 1L;
27
     private static final long serialVersionUID = 1L;
28
 
28
 
29
     @ApiModelProperty(value = "ID")
29
     @ApiModelProperty(value = "ID")
30
-    @TableId(value = "screen_id", type = IdType.UUID)
30
+    @TableId(value = "screen_id", type = IdType.INPUT)
31
     private String screenId;
31
     private String screenId;
32
 
32
 
33
     @ApiModelProperty(value = "标题")
33
     @ApiModelProperty(value = "标题")

+ 1
- 1
src/main/java/com/yunzhi/marketing/controller/ExtendContentController.java 查看文件

97
             queryWrapper.ne("status",9);
97
             queryWrapper.ne("status",9);
98
             queryWrapper.eq(status != null, "status", status);
98
             queryWrapper.eq(status != null, "status", status);
99
             queryWrapper.eq( "org_id", getOrgId(request));
99
             queryWrapper.eq( "org_id", getOrgId(request));
100
-            queryWrapper.in("institution_id",getInstitutionIds(request));
100
+            queryWrapper.in("institution_id", getInstitutionIds(request));
101
             queryWrapper.and(taPersonBuildingList.size() > 0, wapper -> wapper.in("building_id",taPersonBuildingList.stream().map(TaPersonBuilding::getBuildingId).collect(Collectors.toList())).or().eq("create_user",getUserId(request)));
101
             queryWrapper.and(taPersonBuildingList.size() > 0, wapper -> wapper.in("building_id",taPersonBuildingList.stream().map(TaPersonBuilding::getBuildingId).collect(Collectors.toList())).or().eq("create_user",getUserId(request)));
102
             queryWrapper.orderByDesc("order_no");
102
             queryWrapper.orderByDesc("order_no");
103
             queryWrapper.orderByDesc("create_date");
103
             queryWrapper.orderByDesc("create_date");

+ 0
- 1
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

666
             return ResponseBean.error("已存在的客户报备失败", ResponseBean.ERROR_UNAVAILABLE);
666
             return ResponseBean.error("已存在的客户报备失败", ResponseBean.ERROR_UNAVAILABLE);
667
         }
667
         }
668
 
668
 
669
-
670
         // 如果是全民经纪人
669
         // 如果是全民经纪人
671
         if (CommConstant.PERSON_BROKER.equals(person.getPersonType())) {
670
         if (CommConstant.PERSON_BROKER.equals(person.getPersonType())) {
672
             TaBuilding taBuilding = taBuildingMapper.selectById(buildingId);
671
             TaBuilding taBuilding = taBuildingMapper.selectById(buildingId);

+ 2
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/ChannelCustomerMapper.java 查看文件

60
     ChannelCustomer getMoreInfoById(@Param("channelCustomerId") String channelCustomerId, @Param("customerId") String customerId);
60
     ChannelCustomer getMoreInfoById(@Param("channelCustomerId") String channelCustomerId, @Param("customerId") String customerId);
61
 
61
 
62
     List<ChannelCustomer> getRecommendedOrExpired(@Param("buildingId") String buildingId,@Param("phone") String phone);
62
     List<ChannelCustomer> getRecommendedOrExpired(@Param("buildingId") String buildingId,@Param("phone") String phone);
63
+
64
+    IPage<ChannelCustomer> getPageByBroker(IPage<ChannelCustomer> page, @Param("recommendPerson") String recommendPerson, @Param("name") String name, @Param("phone") String phone);
63
 }
65
 }

+ 2
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IChannelCustomerService.java 查看文件

93
      * @throws Exception
93
      * @throws Exception
94
      */
94
      */
95
     void updateBizNode(MarkingSignatoryCustomerDTO params, Integer bizStatus, String bizType) throws Exception;
95
     void updateBizNode(MarkingSignatoryCustomerDTO params, Integer bizStatus, String bizType) throws Exception;
96
+
97
+    IPage<ChannelCustomer> getPageByBroker(IPage<ChannelCustomer> page, String recommendPerson, String name, String phone);
96
 }
98
 }

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java 查看文件

661
         }
661
         }
662
     }
662
     }
663
 
663
 
664
+    @Override
665
+    public IPage<ChannelCustomer> getPageByBroker(IPage<ChannelCustomer> page, String recommendPerson, String name, String phone) {
666
+        return baseMapper.getPageByBroker(page, recommendPerson, name, phone);
667
+    }
668
+
664
     private Integer intIfNvl(Integer i) {
669
     private Integer intIfNvl(Integer i) {
665
         return i == null ? 0 : i;
670
         return i == null ? 0 : i;
666
     }
671
     }

+ 45
- 1
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml 查看文件

78
             b.avatarurl ,
78
             b.avatarurl ,
79
             ifnull(c.`status`, 1) as customer_status,
79
             ifnull(c.`status`, 1) as customer_status,
80
             if(c.customer_id is null, "report", "customer") as type,
80
             if(c.customer_id is null, "report", "customer") as type,
81
-            d.expiration_date,
81
+            IF(a.recommend_person_type = 'broker', m.expiration_days, d.expiration_date) as expiration_date,
82
             d.building_name
82
             d.building_name
83
         FROM
83
         FROM
84
             xlk_channel_customer a
84
             xlk_channel_customer a
85
         LEFT JOIN ta_person b ON a.person_id = b.person_id
85
         LEFT JOIN ta_person b ON a.person_id = b.person_id
86
         left join ta_recommend_customer c on a.customer_id = c.customer_id
86
         left join ta_recommend_customer c on a.customer_id = c.customer_id
87
         LEFT JOIN ta_building d on a.building_id = d.building_id
87
         LEFT JOIN ta_building d on a.building_id = d.building_id
88
+        LEFT JOIN bk_agreement m ON a.building_id = m.building_id
88
         WHERE
89
         WHERE
89
         a.recommend_person = #{params.personId}
90
         a.recommend_person = #{params.personId}
90
         and a.org_id = #{params.orgId}
91
         and a.org_id = #{params.orgId}
221
                 )
222
                 )
222
             )
223
             )
223
     </select>
224
     </select>
225
+    <select id="getPageByBroker" resultType="com.yunzhi.marketing.xlk.entity.ChannelCustomer">
226
+        SELECT
227
+            t.channel_customer_id,
228
+            t.create_date,
229
+            t.org_id,
230
+            t.building_id,
231
+            fun_mix_str ( t.phone, 4 ) AS phone,
232
+            t.`name`,
233
+            t.picture,
234
+            t.sex,
235
+            t.person_id,
236
+            t.`status`,
237
+            t.channel_id,
238
+            t.recommend_person,
239
+            t.realty_consultant,
240
+            t.remark,
241
+            t.customer_id,
242
+            t.visit_date,
243
+            t.preparatory_date,
244
+            t.signed_date,
245
+            t.commission_date,
246
+            t.institution_id,
247
+            t.recommend_person_type,
248
+            t.total_commission,
249
+            t.unsettled_commission,
250
+            t.settled_commission,
251
+            s.building_name
252
+        FROM
253
+            xlk_channel_customer t
254
+                INNER JOIN ta_building s ON t.building_id = s.building_id
255
+        WHERE
256
+            t.recommend_person = #{recommendPerson}
257
+          <if test="name != null and name != ''">
258
+              AND t.`name` LIKE CONCAT( '%', #{name}, '%' )
259
+          </if>
260
+          <if test="phone != null and phone != ''">
261
+              AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
262
+          </if>
263
+            AND t.`status` = 2
264
+--           AND t.`status` &gt; -1
265
+        ORDER BY
266
+            t.create_date DESC
267
+    </select>
224
 </mapper>
268
 </mapper>