|
@@ -114,6 +114,29 @@ public class BizCustomerServiceImpl extends ServiceImpl<BizCustomerMapper, BizCu
|
|
|
this.save(bizCustomer);
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void addYong(BizCustomerYongAddParam bizCustomerYongAddParam) {
|
|
|
+ //校验手机号格式
|
|
|
+ if(ObjectUtil.isNotEmpty(bizCustomerYongAddParam.getPhone())){
|
|
|
+ if(!PhoneUtil.isMobile(bizCustomerYongAddParam.getPhone())) {
|
|
|
+ throw new CommonException("手机号码:{}格式错误", bizCustomerYongAddParam.getPhone());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //查询用友平台ID是否添加过
|
|
|
+ long countYong = this.count(new QueryWrapper<BizCustomer>().lambda().eq(BizCustomer::getYongId, bizCustomerYongAddParam.getYongId()));
|
|
|
+ if(countYong>0){
|
|
|
+ throw new CommonException("客户档案编码已存在!");
|
|
|
+ }
|
|
|
+ //查询客户名称是否添加过
|
|
|
+ long countName = this.count(new QueryWrapper<BizCustomer>().lambda().eq(BizCustomer::getName, bizCustomerYongAddParam.getName()));
|
|
|
+ if(countName>0){
|
|
|
+ throw new CommonException("客户名称已存在!");
|
|
|
+ }
|
|
|
+ BizCustomer bizCustomer = BeanUtil.toBean(bizCustomerYongAddParam, BizCustomer.class);
|
|
|
+ this.save(bizCustomer);
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public void edit(BizCustomerEditParam bizCustomerEditParam) {
|