Commit 776234a0c37c917b5d5bb3ea85c2792496a493f8

Authored by 张志伟
1 parent b085dca5

:sparkles: feature(*): 公共池报表新增字段

- 公共池报表新增字段
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/db/pool/StammkundePool.java
... ... @@ -77,4 +77,8 @@ public class StammkundePool extends BaseAuditableTimeEntity<StammkundePool, Long
77 77 * 集团id
78 78 */
79 79 private Long groupId;
  80 + /**
  81 + * 公共池来源【针对自然进店的标识】
  82 + */
  83 + private Boolean fromPublic;
80 84 }
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java
... ... @@ -54,6 +54,7 @@ import org.springframework.util.CollectionUtils;
54 54 import java.time.LocalDateTime;
55 55 import java.util.*;
56 56 import java.util.concurrent.TimeUnit;
  57 +import java.util.function.Consumer;
57 58  
58 59 import static cn.fw.common.businessvalidator.Validator.BV;
59 60  
... ... @@ -397,9 +398,8 @@ public class CustomerChangeBizService extends AbstractCustomerService {
397 398  
398 399 if (Objects.isNull(customer.getAdviserId()) && Objects.isNull(customer.getShopId())) {
399 400 publicPoolService.removeByCustomerId(customer.getId(), customer.getGroupId());
400   - create(customer, adviserId, shopId);
  401 + create(customer, adviserId, shopId, r -> r.setFromPublic(Boolean.TRUE));
401 402 }
402   -
403 403 return updated;
404 404 }
405 405  
... ... @@ -421,6 +421,10 @@ public class CustomerChangeBizService extends AbstractCustomerService {
421 421  
422 422  
423 423 private void create(Customer customer, Long adviserId, Long shopId) {
  424 + create(customer, adviserId, shopId, null);
  425 + }
  426 +
  427 + private void create(Customer customer, Long adviserId, Long shopId, Consumer<StammkundePool> cs) {
424 428 StammkundePool stammkundePool = createSimpleInfo(customer, adviserId);
425 429 stammkundePool.setSources(StammkundeSourcesEnum.NATURAL);
426 430 stammkundePool.setShopId(shopId);
... ... @@ -428,6 +432,9 @@ public class CustomerChangeBizService extends AbstractCustomerService {
428 432 stammkundePool.setAktiv(Boolean.TRUE);
429 433 stammkundePool.setActivationTime(new Date());
430 434 stammkundePool.setCreateTime(new Date());
  435 + if (cs != null) {
  436 + cs.accept(stammkundePool);
  437 + }
431 438 stammkundePoolService.save(stammkundePool);
432 439 }
433 440  
... ...