客户回调接口

master
Caps 6 years ago
parent b4372a4b33
commit 107193ee4a

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

Loading…
Cancel
Save