From 3e57df53c4985b6b7447e4d10eeba689550fab09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=89=AF=28004796=29?= Date: Mon, 19 Feb 2024 10:05:59 +0800 Subject: [PATCH] 123 --- .../bashi/dk/service/impl/CustomerInfoServiceImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bashi-dk/src/main/java/com/bashi/dk/service/impl/CustomerInfoServiceImpl.java b/bashi-dk/src/main/java/com/bashi/dk/service/impl/CustomerInfoServiceImpl.java index 337c0ea..4d6fdf6 100644 --- a/bashi-dk/src/main/java/com/bashi/dk/service/impl/CustomerInfoServiceImpl.java +++ b/bashi-dk/src/main/java/com/bashi/dk/service/impl/CustomerInfoServiceImpl.java @@ -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 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)