|
|
@@ -683,6 +683,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
return R.data(200, "error", "客户名称不能为空");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
PjCorpsDesc pjCorpsDesc = baseMapper.selectCorpsDescCname(corpsDesc.getCname(), AuthUtil.getTenantId());
|
|
|
if (ObjectUtils.isNotNull(pjCorpsDesc)) {
|
|
|
pjCorpsDesc.setSalesCompanyId(deptId);
|
|
|
@@ -744,7 +745,14 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
corpsAddr1.setCreateUser(AuthUtil.getUserId());
|
|
|
corpsAddr1.setSalesCompanyId(deptId);
|
|
|
corpsAddr1.setSalesCompanyName(deptName);
|
|
|
- corpsAddr1.setDefaultAddres("1");
|
|
|
+ long count = corpsAddrService.count(new LambdaQueryWrapper<PjCorpsAddr>().eq(PjCorpsAddr::getIsDeleted, 0)
|
|
|
+ .eq(PjCorpsAddr::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjCorpsAddr::getPid, pjCorpsDesc.getId()));
|
|
|
+ if (count > 1) {
|
|
|
+ corpsAddr1.setDefaultAddres("0");
|
|
|
+ }else{
|
|
|
+ corpsAddr1.setDefaultAddres("1");
|
|
|
+ }
|
|
|
corpsAddrService.save(corpsAddr1);
|
|
|
}
|
|
|
} else {
|
|
|
@@ -763,7 +771,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
//保存客户联系人信息
|
|
|
PjCorpsAttn corpsAttn = new PjCorpsAttn();
|
|
|
R<Dept> resDept = sysClient.getDept(Long.parseLong(AuthUtil.getDeptId()));
|
|
|
- if (!resDept.isSuccess() || ObjectUtils.isNull(resDept.getData())){
|
|
|
+ if (!resDept.isSuccess() || ObjectUtils.isNull(resDept.getData())) {
|
|
|
throw new RuntimeException("未找到小程序id");
|
|
|
}
|
|
|
User user = userClient.loginByAccount("", corpsDesc.getTel(), "4", AuthUtil.getTenantId(), resDept.getData().getAppletsId());
|