Commit 38b8a1e3 authored by lcl's avatar lcl

update

parent adb0d27a
...@@ -69,15 +69,16 @@ public class CustomerController extends BaseController { ...@@ -69,15 +69,16 @@ public class CustomerController extends BaseController {
@RepeatSubmit @RepeatSubmit
public AjaxResult add(@RequestBody Customer customer) { public AjaxResult add(@RequestBody Customer customer) {
if (ObjectUtils.isEmpty(customer.getCompanyName())) throw new BeanException("企业名称不能为空"); if (ObjectUtils.isEmpty(customer.getCompanyName())) throw new BeanException("企业名称不能为空");
if (ObjectUtils.isEmpty(customer.getCompanyId())) {
try { try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(customer.getCompanyName()); Map<String, Object> map = opportunityRadarService.enterpriseByName(customer.getCompanyName());
if(!ObjectUtils.isEmpty(map.get("data"))) { if (!ObjectUtils.isEmpty(map.get("data"))) {
customer.setCompanyId(MapUtil.getInt(BeanUtil.beanToMap(map.get("data")), "jskEid")); customer.setCompanyId(MapUtil.getInt(BeanUtil.beanToMap(map.get("data")), "jskEid"));
} }
} catch (Exception e) { } catch (Exception e) {
logger.debug("获取企业id错误!error:{}", e.getMessage()); logger.debug("获取企业id错误!error:{}", e.getMessage());
} }
baseService.add(customer); }
return AjaxResult.success(baseService.add(customer)); return AjaxResult.success(baseService.add(customer));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment