|
|
@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
@ -59,6 +60,16 @@ public class CustomerService {
|
|
|
|
this.poiStoreStaffDOMapper = poiStoreStaffDOMapper;
|
|
|
|
this.poiStoreStaffDOMapper = poiStoreStaffDOMapper;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostConstruct
|
|
|
|
|
|
|
|
public void test(){
|
|
|
|
|
|
|
|
CustomerDTO customerDTO = new CustomerDTO();
|
|
|
|
|
|
|
|
customerDTO.setUniId("insduneubg-1234");
|
|
|
|
|
|
|
|
customerDTO.setName("何永东");
|
|
|
|
|
|
|
|
customerDTO.setStaffCode("001");
|
|
|
|
|
|
|
|
customerDTO.setShopCode("002");
|
|
|
|
|
|
|
|
customerRelation(customerDTO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 绑定客户的关系
|
|
|
|
* 绑定客户的关系
|
|
|
|
* @param customerDTO 传输实体
|
|
|
|
* @param customerDTO 传输实体
|
|
|
@ -74,10 +85,14 @@ public class CustomerService {
|
|
|
|
QueryWrapper<PoiStore> poiWrapper = new QueryWrapper<>();
|
|
|
|
QueryWrapper<PoiStore> poiWrapper = new QueryWrapper<>();
|
|
|
|
poiWrapper.eq("code",customerDTO.getShopCode()).last("limit 1");
|
|
|
|
poiWrapper.eq("code",customerDTO.getShopCode()).last("limit 1");
|
|
|
|
PoiStore poiStore = poiStoreDOMapper.selectOne(poiWrapper);
|
|
|
|
PoiStore poiStore = poiStoreDOMapper.selectOne(poiWrapper);
|
|
|
|
|
|
|
|
|
|
|
|
//导购信息
|
|
|
|
//导购信息
|
|
|
|
QueryWrapper<PoiStoreStaff> wrapper = new QueryWrapper<>();
|
|
|
|
QueryWrapper<PoiStoreStaff> wrapper = new QueryWrapper<>();
|
|
|
|
wrapper.eq("staff_code",customerDTO.getStaffCode()).eq("store_code",customerDTO.getShopCode()).last("limit 1");
|
|
|
|
wrapper.eq("staff_code",customerDTO.getStaffCode()).eq("store_code",customerDTO.getShopCode()).last("limit 1");
|
|
|
|
PoiStoreStaff poiStoreStaff = poiStoreStaffDOMapper.selectOne(wrapper);
|
|
|
|
PoiStoreStaff poiStoreStaff = poiStoreStaffDOMapper.selectOne(wrapper);
|
|
|
|
|
|
|
|
if(poiStoreStaff == null || poiStore == null){
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//做插入使用
|
|
|
|
//做插入使用
|
|
|
|
OpCustomer insertCustomer = new OpCustomer();
|
|
|
|
OpCustomer insertCustomer = new OpCustomer();
|
|
|
|