|
@@ -29,6 +29,7 @@ import redis.clients.jedis.JedisCluster;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -70,12 +71,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
@Override
|
|
|
public IPage<CustomerInfoVo> getCustomerInfoPage(Page page, CustomerDto customerDto) {
|
|
|
IPage<CustomerInfoVo> customerInfoVoIPage = baseMapper.queryCustomerInfoPage(page, customerDto);
|
|
|
-
|
|
|
List<CustomerInfoVo> infoVos = customerInfoVoIPage.getRecords();
|
|
|
if (!infoVos.isEmpty()) {
|
|
|
infoVos.forEach(info -> {
|
|
|
// TODO 返回客户的银行卡信息
|
|
|
info.setBankCards(bankCardService.getBankCardList(info.getCustomerId(), 2));
|
|
|
+ if (ObjectUtil.isNotEmpty(info.getCreditAmount())) {
|
|
|
+ info.setCreditAmount(new BigDecimal(info.getCreditAmount()).divide(new BigDecimal(10000)).setScale(4, RoundingMode.HALF_DOWN).toString());
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
return customerInfoVoIPage;
|
|
@@ -95,7 +98,6 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
// TODO 新增客户
|
|
|
CustomerInfo customerInfo = CustomerInfo.builder()
|
|
|
.customerId(jedisCluster.incr(GLOBAL_ID_INCR.key()))
|
|
|
- .partnerId(customerDto.getPartnerId())
|
|
|
.customerName(customerDto.getCustomerName().trim())
|
|
|
.shorterName(customerDto.getShorterName().trim())
|
|
|
.linkmanName(customerDto.getLinkmanName())
|
|
@@ -160,7 +162,6 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
@Override
|
|
|
public void updateCustomerInfo(CustomerDto customerDto) {
|
|
|
CustomerInfo customerInfo = CustomerInfo.builder().customerId(customerDto.getCustomerId())
|
|
|
- .partnerId(customerDto.getPartnerId())
|
|
|
.customerName(customerDto.getCustomerName())
|
|
|
.shorterName(customerDto.getShorterName())
|
|
|
.linkmanName(customerDto.getLinkmanName())
|
|
@@ -207,7 +208,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
|
|
|
@Override
|
|
|
public List<CustomerInfo> queryCustomerInfo(String customerName) {
|
|
|
LambdaQueryWrapper<CustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.select(CustomerInfo::getCustomerId, CustomerInfo::getCustomerName,CustomerInfo::getUserId)
|
|
|
+ queryWrapper.select(CustomerInfo::getCustomerId, CustomerInfo::getCustomerName, CustomerInfo::getUserId)
|
|
|
.like(customerName != null, CustomerInfo::getCustomerName, customerName);
|
|
|
|
|
|
return baseMapper.selectList(queryWrapper);
|