From bc502c673cd9abb424a3b30b0b048b75f091cb24 Mon Sep 17 00:00:00 2001 From: yechenhao Date: Mon, 1 Jun 2020 02:29:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=86=97=E4=BD=99=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kiisoo/ic/customer/CustomerService.java | 27 +++++++++++++------ .../entity/OpSellerCustomerRelation.java | 12 ++++++++- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/kiisoo/ic/customer/CustomerService.java b/src/main/java/com/kiisoo/ic/customer/CustomerService.java index 6034b82..640fe90 100644 --- a/src/main/java/com/kiisoo/ic/customer/CustomerService.java +++ b/src/main/java/com/kiisoo/ic/customer/CustomerService.java @@ -295,6 +295,10 @@ public class CustomerService { insertCustomer.setExternalUserid(turnBackDTOS.getWxData().getUserId()); insertCustomer.setCpUserId(turnBackDTOS.getUserId()); insertCustomer.setPhone(turnBackDTOS.getPhone()); + if (turnBackDTOS.getVipData() != null && !turnBackDTOS.getVipData().getPhone().equals("")) { + //有vip数据就不需要重新请求bsd的vip接口 + insertCustomer.setPhone(turnBackDTOS.getVipData().getPhone()); + } if (shop != null && StringUtils.isNotBlank(shop.getName())) { insertCustomer.setShopName(shop.getName()); } @@ -427,8 +431,12 @@ public class CustomerService { insertRelation.setCreateTime(joinTime); insertRelation.setUpdateTime(new Date()); insertRelation.setCustomerId(opCustomer.getId()); + PoiStore poiStore = poiStoreDOMapper.selectById(shopId); insertRelation.setStoreId(shopId); + insertRelation.setStoreCode(poiStore.getCode()); + PoiStoreStaff staff = poiStoreStaffDOMapper.selectById(sellerId); insertRelation.setUserId(sellerId); + insertRelation.setStaffCode(staff.getStaffCode()); insertRelation.setCreateBy(Constants.SYS_OPERATION); insertRelation.setUpdateBy(Constants.SYS_OPERATION); @@ -446,14 +454,14 @@ public class CustomerService { opSellerCustomerRelationDOMapper.insert(insertRelation); } else { //可能是同步过来的数据,此时已经存在的话,用有导购的代替 - opSellerCustomerRelation.setCreateTime(joinTime); - opSellerCustomerRelation.setUpdateTime(new Date()); - opSellerCustomerRelation.setCustomerId(opCustomer.getId()); - opSellerCustomerRelation.setStoreId(shopId); - opSellerCustomerRelation.setUserId(sellerId); - opSellerCustomerRelation.setCreateBy(Constants.SYS_OPERATION); - opSellerCustomerRelation.setUpdateBy(Constants.SYS_OPERATION); - opSellerCustomerRelationDOMapper.updateById(opSellerCustomerRelation); +// opSellerCustomerRelation.setCreateTime(joinTime); +// opSellerCustomerRelation.setUpdateTime(new Date()); +// opSellerCustomerRelation.setCustomerId(opCustomer.getId()); +// opSellerCustomerRelation.setStoreId(shopId); +// opSellerCustomerRelation.setUserId(sellerId); +// opSellerCustomerRelation.setCreateBy(Constants.SYS_OPERATION); +// opSellerCustomerRelation.setUpdateBy(Constants.SYS_OPERATION); +// opSellerCustomerRelationDOMapper.updateById(opSellerCustomerRelation); } } @@ -499,6 +507,9 @@ public class CustomerService { } insertRelation.setType(3); + }else{ + PoiStore poiStore = poiStoreDOMapper.selectById(shopId); + insertRelation.setStoreCode(poiStore.getCode()); } opSellerCustomerRelationDOMapper.insert(insertRelation); } diff --git a/src/main/java/com/kiisoo/ic/customer/entity/OpSellerCustomerRelation.java b/src/main/java/com/kiisoo/ic/customer/entity/OpSellerCustomerRelation.java index 9867cfb..0044bdc 100644 --- a/src/main/java/com/kiisoo/ic/customer/entity/OpSellerCustomerRelation.java +++ b/src/main/java/com/kiisoo/ic/customer/entity/OpSellerCustomerRelation.java @@ -26,16 +26,26 @@ public class OpSellerCustomerRelation { */ private Long userId; + /** + * 导购code + */ + private String staffCode; + /** * 客户ID */ private Long customerId; /** - * 店铺ID + * 店铺code */ private Long storeId; + /** + * 店铺ID + */ + private String storeCode; + /** * 是否有效 */