| | |
| | | import com.by4cloud.platformx.business.vo.*; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.excel.vo.ErrorMessage; |
| | | import com.by4cloud.platformx.common.security.util.SecurityUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | return R.failed("客商名称或社会信用代码不能为空"); |
| | | } |
| | | BusinessCustomer bc = baseMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery().eq(BusinessCustomer::getCompanyName,addDTO.getCompanyName()) |
| | | .eq(BusinessCustomer::getCreditCode,addDTO.getCreditCode()).last("limit 1")); |
| | | .eq(BusinessCustomer::getCreditCode,addDTO.getCreditCode()) |
| | | .eq(BusinessCustomer::getCompId, SecurityUtils.getUser().getCompId()) |
| | | .last("limit 1")); |
| | | if (ObjUtil.isNotNull(bc)){ |
| | | return R.failed("客商已存在"); |
| | | } |
| | |
| | | .last("limit 1")); |
| | | if (ObjUtil.isNull(customer)) { |
| | | customer = BeanUtil.copyProperties(excelVO, BusinessCustomer.class); |
| | | CustInfoVo custInfo = bipViewMapper.selectBaseInfoByCustName(excelVO.getCompanyName()); |
| | | CustInfoVo custInfo = bipViewMapper.selectBaseInfoByCertId(excelVO.getCreditCode()); |
| | | if (ObjUtil.isNotNull(custInfo)) { |
| | | customer.setCreditCode(custInfo.getCertificateId()); |
| | | customer.setRegisterName(custInfo.getCustName()); |