123
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package com.bashi.dk.service.impl;
|
||||
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bashi.common.core.domain.entity.Customer;
|
||||
import com.bashi.common.exception.CustomException;
|
||||
import com.bashi.dk.domain.Borrow;
|
||||
import com.bashi.dk.domain.CustomerInfo;
|
||||
import com.bashi.dk.mapper.CustomerInfoMapper;
|
||||
import com.bashi.dk.service.BorrowService;
|
||||
import com.bashi.dk.service.CustomerInfoService;
|
||||
import com.bashi.dk.service.CustomerService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -15,9 +19,15 @@ import org.springframework.stereotype.Service;
|
||||
public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, CustomerInfo> implements CustomerInfoService {
|
||||
@Autowired
|
||||
private CustomerService customerService;
|
||||
@Autowired
|
||||
private BorrowService borrowService;
|
||||
@Override
|
||||
public void updateCustomerInfo(CustomerInfo customerInfo) {
|
||||
Long customerId = customerInfo.getCustomerId();
|
||||
long count = borrowService.count(Wrappers.lambdaQuery(Borrow.class).eq(Borrow::getCustomerId, customerId));
|
||||
if(count > 0){
|
||||
throw new CustomException("贷款已提交无法修改信息,请联系客服");
|
||||
}
|
||||
this.update(customerInfo,Wrappers.lambdaQuery(CustomerInfo.class)
|
||||
.eq(CustomerInfo::getCustomerId, customerId));
|
||||
CustomerInfo one = this.getOne(Wrappers.lambdaQuery(CustomerInfo.class)
|
||||
|
||||
Reference in New Issue
Block a user