|
@@ -1,6 +1,8 @@
|
|
package com.fire.admin.service.impl;
|
|
package com.fire.admin.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.RandomUtil;
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -11,9 +13,11 @@ import com.fire.admin.service.BankCardService;
|
|
import com.fire.admin.service.CustomerService;
|
|
import com.fire.admin.service.CustomerService;
|
|
import com.fire.admin.util.SecurityUtil;
|
|
import com.fire.admin.util.SecurityUtil;
|
|
import com.fire.admin.vo.CustomerInfoVo;
|
|
import com.fire.admin.vo.CustomerInfoVo;
|
|
|
|
+import com.fire.dto.BankCard;
|
|
import com.fire.dto.CustomerInfo;
|
|
import com.fire.dto.CustomerInfo;
|
|
import com.fire.dto.FlowAppInfo;
|
|
import com.fire.dto.FlowAppInfo;
|
|
import com.fire.utils.date.DateUtils;
|
|
import com.fire.utils.date.DateUtils;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -56,9 +60,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
@Override
|
|
@Override
|
|
public IPage<CustomerInfoVo> getCustomerInfoPage(Page page, CustomerDto customerDto) {
|
|
public IPage<CustomerInfoVo> getCustomerInfoPage(Page page, CustomerDto customerDto) {
|
|
IPage<CustomerInfoVo> customerInfoVoIPage = baseMapper.queryCustomerInfoPage(page, customerDto);
|
|
IPage<CustomerInfoVo> customerInfoVoIPage = baseMapper.queryCustomerInfoPage(page, customerDto);
|
|
- List<Long> customerIds = customerInfoVoIPage.getRecords().stream().map(CustomerInfoVo::getCustomerId).collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
+ List<CustomerInfoVo> infoVos = customerInfoVoIPage.getRecords();
|
|
|
|
+ if (!infoVos.isEmpty()) {
|
|
|
|
+ infoVos.forEach(info -> {
|
|
|
|
+ // TODO 返回客户的银行卡信息
|
|
|
|
+ info.setBankCards(bankCardService.getBankCardList(Integer.parseInt(String.valueOf(info.getCustomerId())), 2));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
return customerInfoVoIPage;
|
|
return customerInfoVoIPage;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -105,12 +114,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
|
|
|
log.info("新增客户对象为:【{}】", customerInfo.toString());
|
|
log.info("新增客户对象为:【{}】", customerInfo.toString());
|
|
log.info("新增客户接入信息为:【{}】", appInfo.toString());
|
|
log.info("新增客户接入信息为:【{}】", appInfo.toString());
|
|
|
|
+
|
|
|
|
+ jedisCluster.hset(CUSTOMER_AMOUNT.key(), CUSTOMER_AMOUNT.key().concat(customerInfo.getCustomerId().toString()), "0");
|
|
}
|
|
}
|
|
- jedisCluster.hset(CUSTOMER_AMOUNT.key(), CUSTOMER_AMOUNT.key().concat(customerInfo.getCustomerId().toString()), "0");
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @Description: TODO 逻辑删除客户信息
|
|
|
|
|
|
+ * @Description: TODO 逻辑删除客户信息 (暂时弃用)
|
|
* @Param: [customerId]
|
|
* @Param: [customerId]
|
|
* @return: void
|
|
* @return: void
|
|
* @Author: liuliu
|
|
* @Author: liuliu
|
|
@@ -123,6 +134,13 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
baseMapper.updateById(info);
|
|
baseMapper.updateById(info);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description: TODO 修改客户信息
|
|
|
|
+ * @Param: [customerDto]
|
|
|
|
+ * @return: void
|
|
|
|
+ * @Author: liuliu
|
|
|
|
+ * @Date: 2021/6/4 15:46
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public void updateCustomerInfo(CustomerDto customerDto) {
|
|
public void updateCustomerInfo(CustomerDto customerDto) {
|
|
CustomerInfo customerInfo = CustomerInfo.builder().customerId(customerDto.getCustomerId())
|
|
CustomerInfo customerInfo = CustomerInfo.builder().customerId(customerDto.getCustomerId())
|
|
@@ -145,16 +163,38 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
.priceCheck(customerDto.getPriceCheck()).build();
|
|
.priceCheck(customerDto.getPriceCheck()).build();
|
|
|
|
|
|
int count = baseMapper.updateById(customerInfo);
|
|
int count = baseMapper.updateById(customerInfo);
|
|
|
|
+ List<BankCard> bankCards = customerDto.getBankCards();
|
|
|
|
+ if (!bankCards.isEmpty()) {
|
|
|
|
+ bankCards.forEach(cars -> {
|
|
|
|
+ cars.setRelationId(Integer.parseInt(String.valueOf(customerDto.getCustomerId())));
|
|
|
|
+ });
|
|
|
|
|
|
- if (!customerDto.getBankCards().isEmpty()){
|
|
|
|
bankCardService.saveBankCards(customerDto.getBankCards());
|
|
bankCardService.saveBankCards(customerDto.getBankCards());
|
|
}
|
|
}
|
|
|
|
|
|
- if(count>0){
|
|
|
|
|
|
+ if (count > 0) {
|
|
log.info("------------------------- 客户修改成功,发送消息到相应的topic --------------------------------");
|
|
log.info("------------------------- 客户修改成功,发送消息到相应的topic --------------------------------");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Description: TODO 获取所有的客户信息{用于各种对客户条件的查询}
|
|
|
|
+ * @Param: 客户名称
|
|
|
|
+ * @return: 客户展示vo对象
|
|
|
|
+ * @Author: liuliu
|
|
|
|
+ * @Date: 2021/6/4 15:49
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<CustomerInfo> queryCustomerInfo(String customerName) {
|
|
|
|
+ LambdaQueryWrapper<CustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.select(CustomerInfo::getCustomerId, CustomerInfo::getCustomerName)
|
|
|
|
+ .like(CustomerInfo::getCustomerName, customerName);
|
|
|
|
+
|
|
|
|
+ return baseMapper.selectList(queryWrapper);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|