|
@@ -19,7 +19,6 @@ import com.fire.dto.CustomerInfo;
|
|
|
import com.fire.dto.FlowAppInfo;
|
|
|
import com.fire.dto.enums.Status;
|
|
|
import com.fire.utils.date.DateUtils;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -29,7 +28,6 @@ import redis.clients.jedis.JedisCluster;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.fire.dto.enums.RedisKey.CUSTOMER_AMOUNT;
|
|
|
import static com.fire.dto.enums.RedisKey.GLOBAL_ID_INCR;
|
|
@@ -68,7 +66,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
if (!infoVos.isEmpty()) {
|
|
|
infoVos.forEach(info -> {
|
|
|
// TODO 返回客户的银行卡信息
|
|
|
- info.setBankCards(bankCardService.getBankCardList(Integer.parseInt(String.valueOf(info.getCustomerId())), 2));
|
|
|
+ info.setBankCards(bankCardService.getBankCardList(Long.parseLong(String.valueOf(info.getCustomerId())), 2));
|
|
|
});
|
|
|
}
|
|
|
return customerInfoVoIPage;
|
|
@@ -87,7 +85,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
public void insertCustomer(CustomerDto customerDto) {
|
|
|
// TODO 新增客户
|
|
|
CustomerInfo customerInfo = CustomerInfo.builder()
|
|
|
- .customerId( jedisCluster.incr(GLOBAL_ID_INCR.key()))
|
|
|
+ .customerId(jedisCluster.incr(GLOBAL_ID_INCR.key()))
|
|
|
.partnerId(customerDto.getPartnerId())
|
|
|
.customerName(customerDto.getCustomerName().trim())
|
|
|
.shorterName(customerDto.getShorterName().trim())
|
|
@@ -106,7 +104,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
int count1 = baseMapper.insert(customerInfo);
|
|
|
// TODO 新增客户接入
|
|
|
FlowAppInfo appInfo = FlowAppInfo.builder()
|
|
|
- .flowAppId( jedisCluster.incr(GLOBAL_ID_INCR.key()))
|
|
|
+ .flowAppId(jedisCluster.incr(GLOBAL_ID_INCR.key()))
|
|
|
.customerId(customerInfo.getCustomerId())
|
|
|
.appId(RandomUtil.randomString(8))
|
|
|
.appKey(RandomUtil.randomString(32))
|
|
@@ -173,7 +171,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
List<BankCard> bankCards = customerDto.getBankCards();
|
|
|
if (!bankCards.isEmpty()) {
|
|
|
bankCards.forEach(cars -> {
|
|
|
- cars.setRelationId(Integer.parseInt(String.valueOf(customerDto.getCustomerId())));
|
|
|
+ cars.setRelationId(Long.parseLong(String.valueOf(customerDto.getCustomerId())));
|
|
|
});
|
|
|
|
|
|
bankCardService.saveBankCards(customerDto.getBankCards());
|
|
@@ -197,14 +195,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
public List<CustomerInfo> queryCustomerInfo(String customerName) {
|
|
|
LambdaQueryWrapper<CustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.select(CustomerInfo::getCustomerId, CustomerInfo::getCustomerName)
|
|
|
- .like(customerName!=null,CustomerInfo::getCustomerName, customerName);
|
|
|
+ .like(customerName != null, CustomerInfo::getCustomerName, customerName);
|
|
|
|
|
|
return baseMapper.selectList(queryWrapper);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @Description: TODO 根据客户的id获取客户信息,用于客户账户撤销获取客户的授信
|
|
|
+ * @Description: TODO 根据客户的id获取客户信息,用于客户账户撤销获取客户的授信
|
|
|
* @Param: [customerId]
|
|
|
* @return: com.fire.dto.CustomerInfo
|
|
|
* @Author: liuliu
|
|
@@ -213,13 +211,13 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
@Override
|
|
|
public CustomerInfo getcustomerOne(Long customerId) {
|
|
|
if (ObjectUtil.isNotEmpty(customerId)) {
|
|
|
- LambdaQueryWrapper<CustomerInfo> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.select(CustomerInfo::getCustomerId,CustomerInfo::getCreditAmount)
|
|
|
- .eq(CustomerInfo::getCustomerId,customerId);
|
|
|
- return baseMapper.selectOne(wrapper);
|
|
|
- }else {
|
|
|
- log.info("查询客户授信请传入正确的客户编号,当前传入编号为:【{}】",customerId);
|
|
|
- throw new BaseException(Status.PARAM_LOSS.status(),Status.PARAM_LOSS.message());
|
|
|
+ LambdaQueryWrapper<CustomerInfo> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.select(CustomerInfo::getCustomerId, CustomerInfo::getCreditAmount)
|
|
|
+ .eq(CustomerInfo::getCustomerId, customerId);
|
|
|
+ return baseMapper.selectOne(wrapper);
|
|
|
+ } else {
|
|
|
+ log.info("查询客户授信请传入正确的客户编号,当前传入编号为:【{}】", customerId);
|
|
|
+ throw new BaseException(Status.PARAM_LOSS.status(), Status.PARAM_LOSS.message());
|
|
|
}
|
|
|
}
|
|
|
|