|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|