Your Name 3 years ago
parent
commit
6dd3f377c6

+ 6
- 0
src/main/java/com/yunzhi/marketing/entity/TaBuilding.java View File

77
      */
77
      */
78
     private String dynamic;
78
     private String dynamic;
79
 
79
 
80
+    /**
81
+     * 有效期
82
+     */
83
+    private Integer expirationDate;
84
+
85
+
80
     /**
86
     /**
81
      * 电话
87
      * 电话
82
      */
88
      */

+ 21
- 0
src/main/java/com/yunzhi/marketing/po/MineRecommendCustomerPO.java View File

1
+package com.yunzhi.marketing.po;
2
+
3
+import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
4
+import lombok.Data;
5
+
6
+import java.time.LocalDateTime;
7
+
8
+@Data
9
+public class MineRecommendCustomerPO extends ChannelCustomer {
10
+
11
+    private String avatarurl;
12
+
13
+    private String type;
14
+
15
+    private String customerStatus;
16
+
17
+    /**
18
+     * 过了保护期的时间
19
+     */
20
+    private Integer expirationDate;
21
+}

+ 10
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/BuildingChannelController.java View File

3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
 import com.yunzhi.marketing.base.BaseController;
4
 import com.yunzhi.marketing.base.BaseController;
5
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.base.ResponseBean;
6
+import com.yunzhi.marketing.entity.TaBuilding;
6
 import com.yunzhi.marketing.entity.TaPerson;
7
 import com.yunzhi.marketing.entity.TaPerson;
8
+import com.yunzhi.marketing.service.ITaBuildingService;
7
 import com.yunzhi.marketing.service.ITaPersonService;
9
 import com.yunzhi.marketing.service.ITaPersonService;
8
 import com.yunzhi.marketing.xlk.dto.BuildingChannelDTO;
10
 import com.yunzhi.marketing.xlk.dto.BuildingChannelDTO;
9
 import com.yunzhi.marketing.xlk.dto.MarkingChannelCustomerDTO;
11
 import com.yunzhi.marketing.xlk.dto.MarkingChannelCustomerDTO;
44
     @Autowired
46
     @Autowired
45
     ITaPersonService iTaPersonService;
47
     ITaPersonService iTaPersonService;
46
 
48
 
49
+    @Autowired
50
+    private ITaBuildingService taBuildingService;
51
+
47
     /**
52
     /**
48
      * 保存对象
53
      * 保存对象
49
      * @param buildingChannelDTO 实体对象
54
      * @param buildingChannelDTO 实体对象
113
             buildingChannelList.add(buildingChannel);
118
             buildingChannelList.add(buildingChannel);
114
         });
119
         });
115
 
120
 
121
+        // 楼盘中冗余一份
122
+        TaBuilding building = taBuildingService.getById(buildingChannelDTO.getBuildingId());
123
+        building.setExpirationDate(buildingChannelDTO.getExpirationDate());
124
+        taBuildingService.updateById(building);
125
+
116
         return iBuildingChannelService.saveBatch(buildingChannelList);
126
         return iBuildingChannelService.saveBatch(buildingChannelList);
117
     }
127
     }
118
 
128
 

+ 38
- 3
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java View File

6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.yunzhi.marketing.base.BaseController;
7
 import com.yunzhi.marketing.base.BaseController;
8
 import com.yunzhi.marketing.base.ResponseBean;
8
 import com.yunzhi.marketing.base.ResponseBean;
9
+import com.yunzhi.marketing.entity.TaPerson;
10
+import com.yunzhi.marketing.service.ITaPersonService;
9
 import com.yunzhi.marketing.xlk.dto.*;
11
 import com.yunzhi.marketing.xlk.dto.*;
10
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
12
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
11
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
13
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
14
 import org.slf4j.Logger;
16
 import org.slf4j.Logger;
15
 import org.slf4j.LoggerFactory;
17
 import org.slf4j.LoggerFactory;
16
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.format.annotation.DateTimeFormat;
17
 import org.springframework.web.bind.annotation.*;
20
 import org.springframework.web.bind.annotation.*;
18
 
21
 
19
 import javax.servlet.http.HttpServletRequest;
22
 import javax.servlet.http.HttpServletRequest;
23
+import java.time.LocalDateTime;
20
 
24
 
21
 /**
25
 /**
22
  * <p>
26
  * <p>
36
     @Autowired
40
     @Autowired
37
     public IChannelCustomerService iChannelCustomerService;
41
     public IChannelCustomerService iChannelCustomerService;
38
 
42
 
43
+    @Autowired
44
+    private ITaPersonService taPersonService;
45
+
39
 
46
 
40
     /**
47
     /**
41
      * 分页查询列表
48
      * 分页查询列表
170
         return responseBean;
177
         return responseBean;
171
     }
178
     }
172
 
179
 
180
+
173
     /**
181
     /**
174
      * 根据id查询对象
182
      * 根据id查询对象
175
      * @param id  实体ID
183
      * @param id  实体ID
176
      */
184
      */
177
     @RequestMapping(value="/wx/channelCustomer/{id}",method= RequestMethod.GET)
185
     @RequestMapping(value="/wx/channelCustomer/{id}",method= RequestMethod.GET)
178
-    public ResponseBean wxGetCust(@PathVariable String id){
186
+    public ResponseBean wxGetCust(@PathVariable String id) {
179
         ResponseBean responseBean = new ResponseBean();
187
         ResponseBean responseBean = new ResponseBean();
180
         try {
188
         try {
181
             responseBean.addSuccess(iChannelCustomerService.getById(id));
189
             responseBean.addSuccess(iChannelCustomerService.getById(id));
182
-        }catch (Exception e){
190
+        } catch (Exception e) {
183
             e.printStackTrace();
191
             e.printStackTrace();
184
-            logger.error("channelCustomerDelete -=- {}",e.toString());
192
+            logger.error("channelCustomerDelete -=- {}", e.toString());
185
             responseBean.addError(e.getMessage());
193
             responseBean.addError(e.getMessage());
186
         }
194
         }
187
         return responseBean;
195
         return responseBean;
188
     }
196
     }
197
+
198
+
199
+    @ApiOperation(value = "森哥看这里-wx-查询经纪人的我的客户列表", notes = "森哥看这里-wx-查询经纪人的我的客户列表")
200
+    @GetMapping("/wx/channelCustomer/recommend/mine")
201
+    public ResponseBean getWxCustomersIRecommended(@RequestParam int pageNumber, @RequestParam int pageSize,
202
+                                                   @RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
203
+                                                   @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate,
204
+                                                   @RequestParam(value = "status", required = false) Integer status,
205
+                                                   @RequestParam(value = "name", required = false) String name,
206
+                                                   HttpServletRequest request) {
207
+        Integer orgId = getOrgId(request);
208
+        String personId = getPersonId(request);
209
+        TaPerson person = taPersonService.getById(personId);
210
+        try {
211
+            RecommendCustomerDTO recommendCustomerDTO = new RecommendCustomerDTO();
212
+            recommendCustomerDTO.setEndDate(endDate);
213
+            recommendCustomerDTO.setStartDate(startDate);
214
+            recommendCustomerDTO.setOrgId(orgId);
215
+            recommendCustomerDTO.setPersonId(personId);
216
+            recommendCustomerDTO.setStatus(status);
217
+            recommendCustomerDTO.setName(name);
218
+            return iChannelCustomerService.getCustomersIRecommended(pageNumber, pageSize, recommendCustomerDTO);
219
+        } catch (Exception e) {
220
+            e.printStackTrace();
221
+            return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
222
+        }
223
+    }
189
 }
224
 }

+ 1
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerStatisticsController.java View File

49
         statisticsDTo.setBuildingId(buildingId);
49
         statisticsDTo.setBuildingId(buildingId);
50
         statisticsDTo.setStartDate(startDate);
50
         statisticsDTo.setStartDate(startDate);
51
         statisticsDTo.setEndDate(endDate);
51
         statisticsDTo.setEndDate(endDate);
52
+        statisticsDTo.setOrgId(orgId);
52
         statisticsDTo.setPersonId(person.getPersonId());
53
         statisticsDTo.setPersonId(person.getPersonId());
53
         return  channelCustomerStatisticsService.getRanklist(statisticsDTo);
54
         return  channelCustomerStatisticsService.getRanklist(statisticsDTo);
54
     }
55
     }

+ 21
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/RecommendCustomerDTO.java View File

1
+package com.yunzhi.marketing.xlk.dto;
2
+
3
+import lombok.Data;
4
+
5
+import java.time.LocalDateTime;
6
+
7
+@Data
8
+public class RecommendCustomerDTO {
9
+
10
+    private String personId;
11
+
12
+    private Integer orgId;
13
+
14
+    private LocalDateTime startDate;
15
+
16
+    private LocalDateTime endDate;
17
+
18
+    private Integer status;
19
+
20
+    private String name;
21
+}

+ 26
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/ChannelCustomer.java View File

34
     @TableId(value = "channel_customer_id", type = IdType.UUID)
34
     @TableId(value = "channel_customer_id", type = IdType.UUID)
35
     private String channelCustomerId;
35
     private String channelCustomerId;
36
 
36
 
37
+    /**
38
+     * 客户id
39
+     */
40
+    private String customerId;
41
+
37
     /**
42
     /**
38
      * 创建时间
43
      * 创建时间
39
      */
44
      */
40
     private LocalDateTime createDate;
45
     private LocalDateTime createDate;
41
 
46
 
47
+    /**
48
+     * 到访时间
49
+     */
50
+    private LocalDateTime visitDate ;
51
+    /** 认筹时间 */
52
+    private LocalDateTime preparatoryDate ;
53
+    /** 签约时间 */
54
+    private LocalDateTime signedDate ;
55
+    /** 结佣时间 */
56
+    private LocalDateTime commissionDate ;
57
+
42
     /**
58
     /**
43
      * 公司id
59
      * 公司id
44
      */
60
      */
96
      */
112
      */
97
     private Integer channelId;
113
     private Integer channelId;
98
 
114
 
115
+    /**
116
+     * 置业顾问
117
+     */
118
+    private String realtyConsultant;
119
+
120
+    /**
121
+     * 备注
122
+     */
123
+    private String remark;
124
+
99
     /**
125
     /**
100
      * 推荐人姓名
126
      * 推荐人姓名
101
      */
127
      */

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/ChannelCustomerMapper.java View File

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.yunzhi.marketing.dto.StatisticsDTO;
5
 import com.yunzhi.marketing.dto.StatisticsDTO;
6
 import com.yunzhi.marketing.po.CustomerRankListVO;
6
 import com.yunzhi.marketing.po.CustomerRankListVO;
7
+import com.yunzhi.marketing.po.MineRecommendCustomerPO;
8
+import com.yunzhi.marketing.po.TaRecommendCustomerPO;
9
+import com.yunzhi.marketing.xlk.dto.RecommendCustomerDTO;
7
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
10
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
8
 import org.apache.ibatis.annotations.Mapper;
11
 import org.apache.ibatis.annotations.Mapper;
9
 import org.apache.ibatis.annotations.Param;
12
 import org.apache.ibatis.annotations.Param;
31
                                           @Param("status") String status,@Param("type") String type);
34
                                           @Param("status") String status,@Param("type") String type);
32
 
35
 
33
     List<CustomerRankListVO> getRanklist(@Param("params") StatisticsDTO statisticsDTo);
36
     List<CustomerRankListVO> getRanklist(@Param("params") StatisticsDTO statisticsDTo);
37
+
38
+    IPage<MineRecommendCustomerPO>  getCustomersIRecommended(IPage<MineRecommendCustomerPO> page,@Param("params") RecommendCustomerDTO recommendCustomerDTO);
34
 }
39
 }

+ 9
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IChannelCustomerService.java View File

69
      * @return
69
      * @return
70
      */
70
      */
71
     ResponseBean signatoryCustomer(MarkingSignatoryCustomerDTO params);
71
     ResponseBean signatoryCustomer(MarkingSignatoryCustomerDTO params);
72
+
73
+    /**
74
+     * 查询经纪人的我的客户列表
75
+     * @param pageNumber
76
+     * @param pageSize
77
+     * @param recommendCustomerDTO
78
+     * @return
79
+     */
80
+    ResponseBean getCustomersIRecommended(int pageNumber, int pageSize, RecommendCustomerDTO recommendCustomerDTO);
72
 }
81
 }

+ 49
- 6
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java View File

2
 
2
 
3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
3
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.base.ResponseBean;
7
 import com.yunzhi.marketing.common.CommConstant;
8
 import com.yunzhi.marketing.common.CommConstant;
8
 import com.yunzhi.marketing.common.StringUtils;
9
 import com.yunzhi.marketing.common.StringUtils;
9
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
10
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
10
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
11
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
12
+import com.yunzhi.marketing.po.MineRecommendCustomerPO;
13
+import com.yunzhi.marketing.po.TaRecommendCustomerPO;
11
 import com.yunzhi.marketing.xlk.dto.*;
14
 import com.yunzhi.marketing.xlk.dto.*;
12
 import com.yunzhi.marketing.xlk.entity.*;
15
 import com.yunzhi.marketing.xlk.entity.*;
13
 import com.yunzhi.marketing.xlk.mapper.*;
16
 import com.yunzhi.marketing.xlk.mapper.*;
65
         queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
68
         queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
66
         TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
69
         TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
67
         if (null == recommendCustomer) {
70
         if (null == recommendCustomer) {
68
-            // 审核通过
69
-            customer.setStatus("2");
70
-            channelCustomerMapper.updateById(customer);
71
             // 进业务客户表
71
             // 进业务客户表
72
             TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
72
             TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
73
             taRecommendCustomer.setName(customer.getName());
73
             taRecommendCustomer.setName(customer.getName());
87
             taRecommendCustomer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
87
             taRecommendCustomer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
88
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
88
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
89
             taRecommendCustomerMapper.insert(taRecommendCustomer);
89
             taRecommendCustomerMapper.insert(taRecommendCustomer);
90
+            // 审核通过
91
+            customer.setStatus("2");
92
+            customer.setCustomerId(taRecommendCustomer.getCustomerId());
93
+            customer.setVisitDate(LocalDateTime.now());
94
+            channelCustomerMapper.updateById(customer);
90
             return ResponseBean.success("审核成功");
95
             return ResponseBean.success("审核成功");
91
         }
96
         }
92
 
97
 
94
                 (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
99
                 (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
95
             // 审核通过
100
             // 审核通过
96
             customer.setStatus("2");
101
             customer.setStatus("2");
102
+            customer.setCustomerId(recommendCustomer.getCustomerId());
103
+            customer.setVisitDate(LocalDateTime.now());
97
             channelCustomerMapper.updateById(customer);
104
             channelCustomerMapper.updateById(customer);
98
             return ResponseBean.success("审核成功");
105
             return ResponseBean.success("审核成功");
99
         }
106
         }
119
             queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
126
             queryWrapper.eq(TaRecommendCustomer::getBuildingId,customer.getBuildingId());
120
             TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
127
             TaRecommendCustomer recommendCustomer = taRecommendCustomerMapper.selectOne(queryWrapper);
121
             if (null == recommendCustomer) {
128
             if (null == recommendCustomer) {
122
-                // 审核通过
123
-                customer.setStatus("2");
124
-                channelCustomerMapper.updateById(customer);
125
                 // 进业务客户表
129
                 // 进业务客户表
126
                 TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
130
                 TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
127
                 taRecommendCustomer.setName(customer.getName());
131
                 taRecommendCustomer.setName(customer.getName());
141
                 taRecommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
145
                 taRecommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
142
                 taRecommendCustomer.setCirculationTime(LocalDateTime.now());
146
                 taRecommendCustomer.setCirculationTime(LocalDateTime.now());
143
                 taRecommendCustomerMapper.insert(taRecommendCustomer);
147
                 taRecommendCustomerMapper.insert(taRecommendCustomer);
148
+
149
+                // 审核通过
150
+                customer.setStatus("2");
151
+                customer.setVisitDate(LocalDateTime.now());
152
+                customer.setCustomerId(taRecommendCustomer.getCustomerId());
153
+                channelCustomerMapper.updateById(customer);
144
             }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
154
             }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
145
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
155
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
146
                 // 审核通过
156
                 // 审核通过
147
                 customer.setStatus("2");
157
                 customer.setStatus("2");
158
+                customer.setVisitDate(LocalDateTime.now());
159
+                customer.setCustomerId(recommendCustomer.getCustomerId());
148
                 channelCustomerMapper.updateById(customer);
160
                 channelCustomerMapper.updateById(customer);
149
 
161
 
150
                 // 修改状态为确认到访状态
162
                 // 修改状态为确认到访状态
234
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_PREPARATORY);
246
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_PREPARATORY);
235
         taRecommendCustomerMapper.updateById(taRecommendCustomer);
247
         taRecommendCustomerMapper.updateById(taRecommendCustomer);
236
 
248
 
249
+        LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
250
+        channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
251
+        ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
252
+        customer.setPreparatoryDate(LocalDateTime.now());
253
+
237
         CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
254
         CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
238
         customerPreparatory.setCreateDate(LocalDateTime.now());
255
         customerPreparatory.setCreateDate(LocalDateTime.now());
239
         customerPreparatoryMapper.insert(customerPreparatory);
256
         customerPreparatoryMapper.insert(customerPreparatory);
251
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getCustomerId());
268
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getCustomerId());
252
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_COMMISSION);
269
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_COMMISSION);
253
         taRecommendCustomerMapper.updateById(taRecommendCustomer);
270
         taRecommendCustomerMapper.updateById(taRecommendCustomer);
271
+
272
+        LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
273
+        channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
274
+        ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
275
+        customer.setCommissionDate(LocalDateTime.now());
276
+
254
         return ResponseBean.success("审核成功");
277
         return ResponseBean.success("审核成功");
255
     }
278
     }
256
 
279
 
266
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_SIGNED);
289
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_SIGNED);
267
         taRecommendCustomerMapper.updateById(taRecommendCustomer);
290
         taRecommendCustomerMapper.updateById(taRecommendCustomer);
268
 
291
 
292
+        LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
293
+        channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
294
+        ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
295
+        customer.setSignedDate(LocalDateTime.now());
296
+
269
         CustomerSignatory customerSignatory = params.getCustomerSignatory();
297
         CustomerSignatory customerSignatory = params.getCustomerSignatory();
270
         customerSignatory.setCreateDate(LocalDateTime.now());
298
         customerSignatory.setCreateDate(LocalDateTime.now());
271
         customerSignatoryMapper.insert(customerSignatory);
299
         customerSignatoryMapper.insert(customerSignatory);
272
         return ResponseBean.success("审核成功");
300
         return ResponseBean.success("审核成功");
273
     }
301
     }
302
+
303
+    /**
304
+     * 查询经纪人的我的客户列表
305
+     *
306
+     * @param pageNumber
307
+     * @param pageSize
308
+     * @param recommendCustomerDTO
309
+     * @return
310
+     */
311
+    @Override
312
+    public ResponseBean getCustomersIRecommended(int pageNumber, int pageSize, RecommendCustomerDTO recommendCustomerDTO) {
313
+        IPage<MineRecommendCustomerPO> page = new Page<MineRecommendCustomerPO>(pageNumber, pageSize);
314
+        IPage<MineRecommendCustomerPO> customersIRecommended = channelCustomerMapper.getCustomersIRecommended(page, recommendCustomerDTO);
315
+        return ResponseBean.success(customersIRecommended);
316
+    }
274
 }
317
 }

+ 33
- 1
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml View File

53
             xlk_channel_customer t
53
             xlk_channel_customer t
54
         LEFT JOIN ta_person p on t.recommend_person = p.person_id
54
         LEFT JOIN ta_person p on t.recommend_person = p.person_id
55
         WHERE t.channel_id  = #{params.channelId}
55
         WHERE t.channel_id  = #{params.channelId}
56
-        and `status` = 2
56
+        and `status` != 3
57
         <if test="params.startDate != null or params.endDate != null">
57
         <if test="params.startDate != null or params.endDate != null">
58
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
58
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
59
         </if>
59
         </if>
64
         ORDER BY number desc
64
         ORDER BY number desc
65
         LIMIT 3
65
         LIMIT 3
66
     </select>
66
     </select>
67
+
68
+    <select id="getCustomersIRecommended" resultType="com.yunzhi.marketing.po.MineRecommendCustomerPO">
69
+        SELECT
70
+            a.*,
71
+            b.avatarurl ,
72
+            ifnull(c.`status`, 1) as customer_status,
73
+            if(c.customer_id is null, "report", "customer") as type,
74
+            d.expiration_date
75
+        FROM
76
+            xlk_channel_customer a
77
+        LEFT JOIN ta_person b ON a.person_id = b.person_id
78
+        left join ta_recommend_customer c on a.customer_id = c.customer_id
79
+        LEFT JOIN ta_building d on a.building_id = d.building_id
80
+        WHERE
81
+        a.recommend_person = #{params.personId}
82
+        and a.`status` != 3
83
+        and a.org_id = #{params.orgId}
84
+        <if test="params.status != null and params.status !=''">
85
+            and c.status = #{params.status}
86
+        </if>
87
+        <if test="params.name != null and params.name !=''">
88
+            and a.name like CONCAT('%',#{params.name}, '%')
89
+        </if>
90
+        <if test="params.startDate != null and params.startDate != null">
91
+            AND a.create_date >= #{params.startDate}
92
+        </if>
93
+        <if test="params.endDate != null and params.endDate != null">
94
+            AND (a.visit_date &lt;= #{params.endDate} or a.preparatory_date &lt;= #{params.endDate} or a.signed_date &lt;= #{params.endDate} or a.commission_date &lt;= #{params.endDate})
95
+        </if>
96
+        ORDER BY
97
+        a.create_date desc
98
+    </select>
67
 </mapper>
99
 </mapper>