傅行帆 3 jaren geleden
bovenliggende
commit
1f830edf36

+ 4
- 4
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Bestand weergeven

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

+ 4
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/PcIndexStatisticsController.java Bestand weergeven

@@ -111,6 +111,8 @@ public class PcIndexStatisticsController extends BaseController {
111 111
     public ResponseBean selectActivityList(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
112 112
                                           @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)  LocalDateTime endDate,
113 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 116
                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
115 117
                                            @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
116 118
                                           HttpServletRequest request) {
@@ -123,6 +125,8 @@ public class PcIndexStatisticsController extends BaseController {
123 125
         pcStatisticsDTO.setBuildingId(buildingId);
124 126
         pcStatisticsDTO.setPageNum(pageNum);
125 127
         pcStatisticsDTO.setPageSize(pageSize);
128
+        pcStatisticsDTO.setSortField(sortField);
129
+        pcStatisticsDTO.setSortType(sortType);
126 130
         return pcStatisticsService.selectActivityList(taUser, pcStatisticsDTO);
127 131
     }
128 132
 }

+ 4
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/PcStatisticsDTO.java Bestand weergeven

@@ -44,4 +44,8 @@ public class PcStatisticsDTO {
44 44
     private Integer pageSize;
45 45
 
46 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 Bestand weergeven

@@ -347,14 +347,16 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
347 347
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
348 348
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
349 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 355
         CustomerPreparatory customerPreparatory = params.getCustomerPreparatory();
354 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 360
         if (null != recommendPerson) {
359 361
             customerPreparatory.setRealtyConsultantName(recommendPerson.getName());
360 362
         }
@@ -363,7 +365,8 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
363 365
         if (null != channelPerson) {
364 366
             customerPreparatory.setRealtyConsultantName(channelPerson.getName());
365 367
         }
366
-        customerPreparatory.setOrgId(customer.getOrgId());
368
+        customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
369
+        customerPreparatory.setCustomerId(taRecommendCustomer.getCustomerId());
367 370
         customerPreparatoryMapper.insert(customerPreparatory);
368 371
         return ResponseBean.success("审核成功");
369 372
     }
@@ -384,12 +387,14 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
384 387
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
385 388
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
386 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 398
         if (null != recommendPerson) {
394 399
             customerSignatory.setRealtyConsultantName(recommendPerson.getName());
395 400
         }
@@ -398,7 +403,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
398 403
         if (null != channelPerson) {
399 404
             customerSignatory.setRealtyConsultantName(channelPerson.getName());
400 405
         }
401
-        customerSignatory.setOrgId(customer.getOrgId());
406
+        customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
402 407
         customerSignatory.setCreateDate(LocalDateTime.now());
403 408
         customerSignatory.setType("commission");
404 409
         customerSignatoryMapper.insert(customerSignatory);
@@ -422,14 +427,16 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
422 427
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
423 428
         channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,params.getCustomerId());
424 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 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 440
         if (null != recommendPerson) {
434 441
             customerSignatory.setRealtyConsultantName(recommendPerson.getName());
435 442
         }
@@ -438,7 +445,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
438 445
         if (null != channelPerson) {
439 446
             customerSignatory.setRealtyConsultantName(channelPerson.getName());
440 447
         }
441
-        customerSignatory.setOrgId(customer.getOrgId());
448
+        customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
442 449
         customerSignatory.setType("signatory");
443 450
         customerSignatoryMapper.insert(customerSignatory);
444 451
         return ResponseBean.success("审核成功");

+ 1
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Bestand weergeven

@@ -1020,7 +1020,7 @@ FROM
1020 1020
             null as channel_id,
1021 1021
             p.name as channelName,
1022 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 1024
         FROM
1025 1025
             ta_recommend_customer t
1026 1026
          left JOIN ta_person p ON t.realty_consultant = p.person_id

+ 5
- 1
src/main/resources/mapper/xlk/PcStatisticsMapper.xml Bestand weergeven

@@ -250,6 +250,10 @@
250 250
                 #{item}
251 251
             </foreach>
252 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 258
     </select>
255 259
 </mapper>