Commit 2edf8332 by 翁国栋

crm需求

省市区导入为必填项
parent 80554387
...@@ -1536,11 +1536,11 @@ public class CrmController { ...@@ -1536,11 +1536,11 @@ public class CrmController {
reader.addHeaderAlias("官网", "clientUrl"); reader.addHeaderAlias("官网", "clientUrl");
reader.addHeaderAlias("邮箱", "clientEmail"); reader.addHeaderAlias("邮箱", "clientEmail");
reader.addHeaderAlias("地址", "address"); reader.addHeaderAlias("地址", "address");
reader.addHeaderAlias("", "province"); reader.addHeaderAlias("*省(必填)", "province");
reader.addHeaderAlias("", "city"); reader.addHeaderAlias("*市(必填)", "city");
reader.addHeaderAlias("", "district"); reader.addHeaderAlias("*区(必填)", "district");
reader.addHeaderAlias("联系人姓名", "linkName"); reader.addHeaderAlias("联系人姓名", "linkName");
reader.addHeaderAlias("*手机号码(必填)", "cellphone"); reader.addHeaderAlias("手机号码", "cellphone");
reader.addHeaderAlias("所属公司", "company"); reader.addHeaderAlias("所属公司", "company");
reader.addHeaderAlias("性别", "gender"); reader.addHeaderAlias("性别", "gender");
reader.addHeaderAlias("职位", "position"); reader.addHeaderAlias("职位", "position");
...@@ -1584,40 +1584,41 @@ public class CrmController { ...@@ -1584,40 +1584,41 @@ public class CrmController {
String followuprecord = crmClientDataImportVo.getFollowuprecord(); // 跟进记录 String followuprecord = crmClientDataImportVo.getFollowuprecord(); // 跟进记录
CrmClientData crmClientData = new CrmClientData(); CrmClientData crmClientData = new CrmClientData();
if (province != null) { if (StringUtils.isNotBlank(province)) {
SysRegion provinceSysRegion = SysRegion.builder().build().selectOne(new QueryWrapper<SysRegion>().lambda() SysRegion provinceSysRegion = SysRegion.builder().build().selectOne(new QueryWrapper<SysRegion>().lambda()
.eq(SysRegion::getLevel, 1).eq(SysRegion::getRegionName, province)); .eq(SysRegion::getLevel, 1).eq(SysRegion::getRegionName, province));
if(provinceSysRegion==null){ if (provinceSysRegion == null) {
return ResultUtil.error("省名错误"); return ResultUtil.error("省名错误");
}else{ } else {
crmClientData.setProvinceId(provinceSysRegion.getKeyId()); crmClientData.setProvinceId(provinceSysRegion.getKeyId());
crmClientData.setProvince(provinceSysRegion.getRegionName()); crmClientData.setProvince(provinceSysRegion.getRegionName());
} }
}else{
return ResultUtil.error("省为必填项");
} }
if (city != null) { if (StringUtils.isNotBlank(city)) {
if (city != null) {
SysRegion citySysRegion = SysRegion.builder().build().selectOne(new QueryWrapper<SysRegion>().lambda() SysRegion citySysRegion = SysRegion.builder().build().selectOne(new QueryWrapper<SysRegion>().lambda()
.eq(SysRegion::getLevel, 2).eq(SysRegion::getRegionName, city)); .eq(SysRegion::getLevel, 2).eq(SysRegion::getRegionName, city));
if(citySysRegion==null){ if (citySysRegion == null) {
return ResultUtil.error("市名错误"); return ResultUtil.error("市名错误");
}else{ } else {
crmClientData.setCityId(citySysRegion.getKeyId()); crmClientData.setCityId(citySysRegion.getKeyId());
crmClientData.setCity(citySysRegion.getRegionName()); crmClientData.setCity(citySysRegion.getRegionName());
} }
}else{
return ResultUtil.error("市为必填项");
} }
} if (StringUtils.isNotBlank(district)) {
if (district != null) {
if (district != null) {
SysRegion districtSysRegion = SysRegion.builder().build().selectOne(new QueryWrapper<SysRegion>().lambda() SysRegion districtSysRegion = SysRegion.builder().build().selectOne(new QueryWrapper<SysRegion>().lambda()
.eq(SysRegion::getLevel, 3).eq(SysRegion::getRegionName, district)); .eq(SysRegion::getLevel, 3).eq(SysRegion::getRegionName, district));
if(districtSysRegion==null){ if (districtSysRegion == null) {
return ResultUtil.error("区名错误"); return ResultUtil.error("区名错误");
}else{ } else {
crmClientData.setDistrictId(districtSysRegion.getKeyId()); crmClientData.setDistrictId(districtSysRegion.getKeyId());
crmClientData.setDistrict(districtSysRegion.getRegionName()); crmClientData.setDistrict(districtSysRegion.getRegionName());
} }
} }else{
return ResultUtil.error("区为必填项");
} }
// 业务组 // 业务组
...@@ -1685,7 +1686,11 @@ public class CrmController { ...@@ -1685,7 +1686,11 @@ public class CrmController {
crmClientData.setClientTypeName(clientTypeName); crmClientData.setClientTypeName(clientTypeName);
if(StringUtils.isNotBlank(clientCellphone)) {
crmClientData.setClientCellphone(clientCellphone); crmClientData.setClientCellphone(clientCellphone);
}else{
return ResultUtil.error("手机号码为必填项 ");
}
crmClientData.setClientTelephone(clientTelephone); crmClientData.setClientTelephone(clientTelephone);
crmClientData.setClientUrl(clientUrl); crmClientData.setClientUrl(clientUrl);
crmClientData.setClientEmail(clientEmail); crmClientData.setClientEmail(clientEmail);
......
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