傅行帆 3 年前
父节点
当前提交
1f830edf36

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

572
                 // 如果是项目公客, 则直接绑定为当前置业的私客
572
                 // 如果是项目公客, 则直接绑定为当前置业的私客
573
                 orign.setRealtyConsultant(consultantUser);
573
                 orign.setRealtyConsultant(consultantUser);
574
                 orign.setVerifyStatus(CommConstant.VERIFY_AGREE);
574
                 orign.setVerifyStatus(CommConstant.VERIFY_AGREE);
575
-                orign.setStatus(CommConstant.CUSTOMER_REPORT);
576
-                orign.setEntryType(CommConstant.ENTRY_INPUT);
575
+                orign.setStatus(CommConstant.CUSTOMER_VISITE);
576
+                orign.setEntryType(CommConstant.ENTRY_VERIFY);
577
                 orign.setReportDate(LocalDateTime.now());
577
                 orign.setReportDate(LocalDateTime.now());
578
                 recommendCustomer = orign;
578
                 recommendCustomer = orign;
579
 //                updateById(orign);
579
 //                updateById(orign);
596
             recommendCustomer.setCreateDate(LocalDateTime.now());
596
             recommendCustomer.setCreateDate(LocalDateTime.now());
597
             recommendCustomer.setReportDate(LocalDateTime.now());
597
             recommendCustomer.setReportDate(LocalDateTime.now());
598
             recommendCustomer.setPersonId(null != custPerson ? custPerson.getPersonId() : null);
598
             recommendCustomer.setPersonId(null != custPerson ? custPerson.getPersonId() : null);
599
-            recommendCustomer.setEntryType(CommConstant.ENTRY_INPUT);
599
+            recommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
600
             recommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
600
             recommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
601
-            recommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
601
+            recommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
602
             recommendCustomer.setRecommendPerson(consultant.getPersonId());
602
             recommendCustomer.setRecommendPerson(consultant.getPersonId());
603
             recommendCustomer.setCirculationTime(LocalDateTime.now());
603
             recommendCustomer.setCirculationTime(LocalDateTime.now());
604
             recommendCustomer.setInstitutionId(building.getInstitutionId());
604
             recommendCustomer.setInstitutionId(building.getInstitutionId());

+ 4
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/PcIndexStatisticsController.java 查看文件

111
     public ResponseBean selectActivityList(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
111
     public ResponseBean selectActivityList(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
112
                                           @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)  LocalDateTime endDate,
112
                                           @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)  LocalDateTime endDate,
113
                                           @RequestParam(value = "buildingId", required = false) String buildingId,
113
                                           @RequestParam(value = "buildingId", required = false) String buildingId,
114
+                                          @RequestParam(value = "sortField", required = false) String sortField,
115
+                                          @RequestParam(value = "sortType", required = false) String sortType,
114
                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
116
                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
115
                                            @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
117
                                            @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
116
                                           HttpServletRequest request) {
118
                                           HttpServletRequest request) {
123
         pcStatisticsDTO.setBuildingId(buildingId);
125
         pcStatisticsDTO.setBuildingId(buildingId);
124
         pcStatisticsDTO.setPageNum(pageNum);
126
         pcStatisticsDTO.setPageNum(pageNum);
125
         pcStatisticsDTO.setPageSize(pageSize);
127
         pcStatisticsDTO.setPageSize(pageSize);
128
+        pcStatisticsDTO.setSortField(sortField);
129
+        pcStatisticsDTO.setSortType(sortType);
126
         return pcStatisticsService.selectActivityList(taUser, pcStatisticsDTO);
130
         return pcStatisticsService.selectActivityList(taUser, pcStatisticsDTO);
127
     }
131
     }
128
 }
132
 }

+ 4
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/PcStatisticsDTO.java 查看文件

44
     private Integer pageSize;
44
     private Integer pageSize;
45
 
45
 
46
     private Integer pageNum;
46
     private Integer pageNum;
47
+
48
+    private String sortField;
49
+
50
+    private String sortType;
47
 }
51
 }

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

347
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
347
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
348
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
348
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
349
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
349
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
350
-        customer.setPreparatoryDate(LocalDateTime.now());
351
-        channelCustomerMapper.updateById(customer);
350
+        if (null != customer) {
351
+            customer.setPreparatoryDate(LocalDateTime.now());
352
+            channelCustomerMapper.updateById(customer);
353
+        }
352
 
354
 
353
         CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
355
         CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
354
         customerPreparatory.setCreateDate(LocalDateTime.now());
356
         customerPreparatory.setCreateDate(LocalDateTime.now());
355
-        customerPreparatory.setBuildingId(customer.getBuildingId());
356
-        customerPreparatory.setRecommendPerson(customer.getRecommendPerson());
357
-        TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
357
+        customerPreparatory.setBuildingId(taRecommendCustomer.getBuildingId());
358
+        customerPreparatory.setRecommendPerson(taRecommendCustomer.getRecommendPerson());
359
+        TaPerson recommendPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
358
         if (null != recommendPerson) {
360
         if (null != recommendPerson) {
359
             customerPreparatory.setRealtyConsultantName(recommendPerson.getName());
361
             customerPreparatory.setRealtyConsultantName(recommendPerson.getName());
360
         }
362
         }
363
         if (null != channelPerson) {
365
         if (null != channelPerson) {
364
             customerPreparatory.setRealtyConsultantName(channelPerson.getName());
366
             customerPreparatory.setRealtyConsultantName(channelPerson.getName());
365
         }
367
         }
366
-        customerPreparatory.setOrgId(customer.getOrgId());
368
+        customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
369
+        customerPreparatory.setCustomerId(taRecommendCustomer.getCustomerId());
367
         customerPreparatoryMapper.insert(customerPreparatory);
370
         customerPreparatoryMapper.insert(customerPreparatory);
368
         return ResponseBean.success("审核成功");
371
         return ResponseBean.success("审核成功");
369
     }
372
     }
384
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
387
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
385
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
388
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
386
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
389
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
387
-        customer.setCommissionDate(LocalDateTime.now());
388
-        channelCustomerMapper.updateById(customer);
390
+        if (null != customer) {
391
+            customer.setCommissionDate(LocalDateTime.now());
392
+            channelCustomerMapper.updateById(customer);
393
+        }
389
 
394
 
390
-        customerSignatory.setBuildingId(customer.getBuildingId());
391
-        customerSignatory.setRecommendPerson(customer.getRecommendPerson());
392
-        TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
395
+        customerSignatory.setBuildingId(taRecommendCustomer.getBuildingId());
396
+        customerSignatory.setRecommendPerson(taRecommendCustomer.getRecommendPerson());
397
+        TaPerson recommendPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
393
         if (null != recommendPerson) {
398
         if (null != recommendPerson) {
394
             customerSignatory.setRealtyConsultantName(recommendPerson.getName());
399
             customerSignatory.setRealtyConsultantName(recommendPerson.getName());
395
         }
400
         }
398
         if (null != channelPerson) {
403
         if (null != channelPerson) {
399
             customerSignatory.setRealtyConsultantName(channelPerson.getName());
404
             customerSignatory.setRealtyConsultantName(channelPerson.getName());
400
         }
405
         }
401
-        customerSignatory.setOrgId(customer.getOrgId());
406
+        customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
402
         customerSignatory.setCreateDate(LocalDateTime.now());
407
         customerSignatory.setCreateDate(LocalDateTime.now());
403
         customerSignatory.setType("commission");
408
         customerSignatory.setType("commission");
404
         customerSignatoryMapper.insert(customerSignatory);
409
         customerSignatoryMapper.insert(customerSignatory);
422
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
427
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
423
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
428
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
424
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
429
         ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
425
-        customer.setSignedDate(LocalDateTime.now());
426
-        customer.setRealtyConsultant(customerSignatory.getRealtyConsultant());
427
-        channelCustomerMapper.updateById(customer);
430
+        if (null != customer) {
431
+            customer.setSignedDate(LocalDateTime.now());
432
+            customer.setRealtyConsultant(customerSignatory.getRealtyConsultant());
433
+            channelCustomerMapper.updateById(customer);
434
+        }
428
 
435
 
429
         customerSignatory.setCreateDate(LocalDateTime.now());
436
         customerSignatory.setCreateDate(LocalDateTime.now());
430
-        customerSignatory.setBuildingId(customer.getBuildingId());
431
-        customerSignatory.setRecommendPerson(customer.getRecommendPerson());
432
-        TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
437
+        customerSignatory.setBuildingId(taRecommendCustomer.getBuildingId());
438
+        customerSignatory.setRecommendPerson(taRecommendCustomer.getRecommendPerson());
439
+        TaPerson recommendPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
433
         if (null != recommendPerson) {
440
         if (null != recommendPerson) {
434
             customerSignatory.setRealtyConsultantName(recommendPerson.getName());
441
             customerSignatory.setRealtyConsultantName(recommendPerson.getName());
435
         }
442
         }
438
         if (null != channelPerson) {
445
         if (null != channelPerson) {
439
             customerSignatory.setRealtyConsultantName(channelPerson.getName());
446
             customerSignatory.setRealtyConsultantName(channelPerson.getName());
440
         }
447
         }
441
-        customerSignatory.setOrgId(customer.getOrgId());
448
+        customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
442
         customerSignatory.setType("signatory");
449
         customerSignatory.setType("signatory");
443
         customerSignatoryMapper.insert(customerSignatory);
450
         customerSignatoryMapper.insert(customerSignatory);
444
         return ResponseBean.success("审核成功");
451
         return ResponseBean.success("审核成功");

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

1020
             null as channel_id,
1020
             null as channel_id,
1021
             p.name as channelName,
1021
             p.name as channelName,
1022
             t.create_date,
1022
             t.create_date,
1023
-            if(v.customer_visit_id is not null || t.`status` = 2 ,true,false) as visitStatus
1023
+            if(v.customer_visit_id is not null || t.`status` = 2 || t.realty_consultant is not null,true,false) as visitStatus
1024
         FROM
1024
         FROM
1025
             ta_recommend_customer t
1025
             ta_recommend_customer t
1026
          left JOIN ta_person p ON t.realty_consultant = p.person_id
1026
          left JOIN ta_person p ON t.realty_consultant = p.person_id

+ 5
- 1
src/main/resources/mapper/xlk/PcStatisticsMapper.xml 查看文件

250
                 #{item}
250
                 #{item}
251
             </foreach>
251
             </foreach>
252
         </if>
252
         </if>
253
-        order by t.create_date desc
253
+        order by
254
+        <if test="params.sortField != null and params.sortField != ''">
255
+            ${params.sortField} ${params.sortType},
256
+        </if>
257
+        t.create_date desc
254
     </select>
258
     </select>
255
 </mapper>
259
 </mapper>