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; + /** * 是否有效 */