|
@@ -71,97 +71,109 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(CustomerBasicServiceImpl.class);
|
|
private Logger logger = LoggerFactory.getLogger(CustomerBasicServiceImpl.class);
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private CustomerBasicMapper customerBasicInfoSaveMapper;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public CustomerBasicInfo queryCustomerBasicInfoByCustomerId(int queryCustomerId) {
|
|
public CustomerBasicInfo queryCustomerBasicInfoByCustomerId(int queryCustomerId) {
|
|
- return customerBasicInfoSaveMapper.queryCustomerBasicInfoByCustomerId(queryCustomerId);
|
|
|
|
|
|
+ return customerBasicMapper.queryCustomerBasicInfoByCustomerId(queryCustomerId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<DockedContactInfo> queryDockedContactInfoListByCustomerId(int queryCustomerId) {
|
|
public List<DockedContactInfo> queryDockedContactInfoListByCustomerId(int queryCustomerId) {
|
|
- return customerBasicInfoSaveMapper.queryDockedContactInfoListByCustomerId(queryCustomerId);
|
|
|
|
|
|
+ return customerBasicMapper.queryDockedContactInfoListByCustomerId(queryCustomerId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<ChannelSaleInfo> queryChannelSaleInfoListByCustomerId(int queryCustomerId) {
|
|
public List<ChannelSaleInfo> queryChannelSaleInfoListByCustomerId(int queryCustomerId) {
|
|
- return customerBasicInfoSaveMapper.queryChannelSaleInfoListByCustomerId(queryCustomerId);
|
|
|
|
|
|
+ return customerBasicMapper.queryChannelSaleInfoListByCustomerId(queryCustomerId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BillingInfo queryBillingInfoByCustomerId(int queryCustomerId) {
|
|
public BillingInfo queryBillingInfoByCustomerId(int queryCustomerId) {
|
|
- return customerBasicInfoSaveMapper.queryBillingInfoByCustomerId(queryCustomerId);
|
|
|
|
|
|
+ return customerBasicMapper.queryBillingInfoByCustomerId(queryCustomerId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public TicketOpeningInfo queryTicketOpeningInfoByCustomerId(int queryCustomerId) {
|
|
public TicketOpeningInfo queryTicketOpeningInfoByCustomerId(int queryCustomerId) {
|
|
- return customerBasicInfoSaveMapper.queryTicketOpeningInfoByCustomerId(queryCustomerId);
|
|
|
|
|
|
+ return customerBasicMapper.queryTicketOpeningInfoByCustomerId(queryCustomerId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public void saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo,List<DockedContactInfo> dockedContactInfoList, List<ChannelSaleInfo> channelSaleInfoList,
|
|
public void saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo,List<DockedContactInfo> dockedContactInfoList, List<ChannelSaleInfo> channelSaleInfoList,
|
|
BillingInfo billingInfo, TicketOpeningInfo ticketOpeningInfo) throws Exception{
|
|
BillingInfo billingInfo, TicketOpeningInfo ticketOpeningInfo) throws Exception{
|
|
- logger.info("saveCustomerBasicInfo start...");
|
|
|
|
int customerId = -1;
|
|
int customerId = -1;
|
|
int channelDivisionId = -1;
|
|
int channelDivisionId = -1;
|
|
try {
|
|
try {
|
|
- customerBasicInfoSaveMapper.saveCustomerBasicInfo(customerBasicInfo);
|
|
|
|
|
|
+ customerBasicMapper.updateCustomerBasic(customerBasicInfo);
|
|
customerId = customerBasicInfo.getCustomerId();
|
|
customerId = customerBasicInfo.getCustomerId();
|
|
|
|
+
|
|
|
|
+ //删除旧联系人数据和渠道销售信息
|
|
|
|
+ customerBasicMapper.deleteContactInfo(customerId);
|
|
|
|
+ List<ChannelSaleInfo> listChannelSale = customerBasicMapper.queryChannelSaleInfoListByCustomerId(customerId);
|
|
|
|
+ if(listChannelSale.size() > 0){
|
|
|
|
+ for(ChannelSaleInfo channelSaleInfo : listChannelSale){
|
|
|
|
+ customerBasicMapper.deleteDivisionInfo(channelSaleInfo.getChannelDivisionId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if(customerId != -1){
|
|
if(customerId != -1){
|
|
if(dockedContactInfoList != null && dockedContactInfoList.size()>1){
|
|
if(dockedContactInfoList != null && dockedContactInfoList.size()>1){
|
|
dockedContactInfoList.remove(0);
|
|
dockedContactInfoList.remove(0);
|
|
for (DockedContactInfo dockedContactInfo: dockedContactInfoList) {
|
|
for (DockedContactInfo dockedContactInfo: dockedContactInfoList) {
|
|
dockedContactInfo.setCustomerId(customerId);
|
|
dockedContactInfo.setCustomerId(customerId);
|
|
- customerBasicInfoSaveMapper.saveDockedContactInfo(dockedContactInfo);
|
|
|
|
|
|
+ customerBasicMapper.saveDockedContactInfo(dockedContactInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(channelSaleInfoList != null && channelSaleInfoList.size()>1){
|
|
if(channelSaleInfoList != null && channelSaleInfoList.size()>1){
|
|
channelSaleInfoList.remove(0);
|
|
channelSaleInfoList.remove(0);
|
|
for (ChannelSaleInfo channelSaleInfo: channelSaleInfoList) {
|
|
for (ChannelSaleInfo channelSaleInfo: channelSaleInfoList) {
|
|
channelSaleInfo.setCustomerId(customerId);
|
|
channelSaleInfo.setCustomerId(customerId);
|
|
- customerBasicInfoSaveMapper.saveChannelDivisionInfo(channelSaleInfo);
|
|
|
|
- //channelSaleInfo.setChannelDivisionId(channelDivisionId);
|
|
|
|
- customerBasicInfoSaveMapper.saveChannelSaleInfo(channelSaleInfo);
|
|
|
|
|
|
+ customerBasicMapper.saveChannelDivisionInfo(channelSaleInfo);
|
|
|
|
+ customerBasicMapper.saveChannelSaleInfo(channelSaleInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
billingInfo.setCustomerId(customerId);
|
|
billingInfo.setCustomerId(customerId);
|
|
ticketOpeningInfo.setCustomerId(customerId);
|
|
ticketOpeningInfo.setCustomerId(customerId);
|
|
- customerBasicInfoSaveMapper.saveBillingInfo(billingInfo);
|
|
|
|
- customerBasicInfoSaveMapper.saveTicketOpeningInfo(ticketOpeningInfo);
|
|
|
|
|
|
+ if(billingInfo.getBillingId()!=null){
|
|
|
|
+ customerBasicMapper.updateBillingInfo(billingInfo);
|
|
|
|
+ }else{
|
|
|
|
+ customerBasicMapper.saveBillingInfo(billingInfo);
|
|
|
|
+ }
|
|
|
|
+ if(ticketOpeningInfo.getTicketOpeningId()!=null){
|
|
|
|
+ customerBasicMapper.updateOpeningInfo(ticketOpeningInfo);
|
|
|
|
+ }else{
|
|
|
|
+ customerBasicMapper.saveTicketOpeningInfo(ticketOpeningInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
- logger.info("saveCustomerBasicInfo end...");
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- logger.error("添加客户信息失败"+e.getMessage());
|
|
|
|
- throw new RuntimeException("添加客户信息失败");
|
|
|
|
|
|
+ logger.error("修改客户信息失败"+e.getMessage());
|
|
|
|
+ throw new RuntimeException("修改客户信息失败");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public List<Province> queryProvinceList(String provinceId){
|
|
public List<Province> queryProvinceList(String provinceId){
|
|
- return (List<Province>)customerBasicInfoSaveMapper.queryProvinceList(provinceId);
|
|
|
|
|
|
+ return (List<Province>)customerBasicMapper.queryProvinceList(provinceId);
|
|
}
|
|
}
|
|
|
|
|
|
public List<City> queryCityList(String provinceId){
|
|
public List<City> queryCityList(String provinceId){
|
|
- return (List<City>)customerBasicInfoSaveMapper.queryCityList(provinceId);
|
|
|
|
|
|
+ return (List<City>)customerBasicMapper.queryCityList(provinceId);
|
|
}
|
|
}
|
|
|
|
|
|
public List<ChannelDivisionInfo> queryChannelCategoryList(String channelCategoryId){
|
|
public List<ChannelDivisionInfo> queryChannelCategoryList(String channelCategoryId){
|
|
- return (List<ChannelDivisionInfo>)customerBasicInfoSaveMapper.queryChannelCategoryList(channelCategoryId);
|
|
|
|
|
|
+ return (List<ChannelDivisionInfo>)customerBasicMapper.queryChannelCategoryList(channelCategoryId);
|
|
}
|
|
}
|
|
|
|
|
|
public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId){
|
|
public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId){
|
|
- return (List<ChannelDivisionInfo>)customerBasicInfoSaveMapper.queryChannelTypeList(channelCategoryId);
|
|
|
|
|
|
+ return (List<ChannelDivisionInfo>)customerBasicMapper.queryChannelTypeList(channelCategoryId);
|
|
}
|
|
}
|
|
|
|
|
|
public List<Product> queryPromotingProductsList(String promotingProductsInfo){
|
|
public List<Product> queryPromotingProductsList(String promotingProductsInfo){
|
|
- return (List<Product>)customerBasicInfoSaveMapper.queryPromotingProductsList(promotingProductsInfo);
|
|
|
|
|
|
+ return (List<Product>)customerBasicMapper.queryPromotingProductsList(promotingProductsInfo);
|
|
}
|
|
}
|
|
|
|
|
|
public List<ProductColor> querySupplyPriceList(String promotingProductsId){
|
|
public List<ProductColor> querySupplyPriceList(String promotingProductsId){
|
|
- return (List<ProductColor>)customerBasicInfoSaveMapper.querySupplyPriceList(promotingProductsId);
|
|
|
|
|
|
+ return (List<ProductColor>)customerBasicMapper.querySupplyPriceList(promotingProductsId);
|
|
}
|
|
}
|
|
/*@Override
|
|
/*@Override
|
|
public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {
|
|
public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {
|