|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.kiisoo.ic.customer;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.kiisoo.ic.constants.Constants;
|
|
|
|
|
import com.kiisoo.ic.customer.bean.CustomerDTO;
|
|
|
|
|
import com.kiisoo.ic.customer.bean.CustomerModifyDTO;
|
|
|
|
|
import com.kiisoo.ic.customer.entity.OpCustomer;
|
|
|
|
@ -76,6 +77,7 @@ public class CustomerService {
|
|
|
|
|
sellerCustomerRelation(opCustomer,customerDTO.getStaffCode(),poiStore.getId(),poiStoreStaff.getUserId());
|
|
|
|
|
return opCustomer.getId();
|
|
|
|
|
}else {
|
|
|
|
|
insertCustomer.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
|
//不存在
|
|
|
|
|
opCustomerDOMapper.insert(insertCustomer);
|
|
|
|
|
//添加关系
|
|
|
|
@ -91,6 +93,7 @@ public class CustomerService {
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void customerVipRelation(CustomerModifyDTO customerModifyDTO){
|
|
|
|
|
OpCustomer opCustomer = new OpCustomer(customerModifyDTO.getName(),customerModifyDTO.getPhone());
|
|
|
|
|
opCustomer.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
|
QueryWrapper<OpVip> wrapper = new QueryWrapper<>();
|
|
|
|
|
wrapper.eq("phone",customerModifyDTO.getPhone()).last("limit 1");
|
|
|
|
|
OpVip opVip = opVipDOMapper.selectOne(wrapper);
|
|
|
|
@ -120,6 +123,8 @@ public class CustomerService {
|
|
|
|
|
insertRelation.setCustomerId(opCustomer.getId());
|
|
|
|
|
insertRelation.setStoreId(shopId);
|
|
|
|
|
insertRelation.setUserId(sellerId);
|
|
|
|
|
insertRelation.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
|
insertRelation.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
|
opSellerCustomerRelationDOMapper.insert(insertRelation);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|