Commit 20a24431 by ilal Committed by chenzg

提交

parent 84e258fe
...@@ -162,6 +162,9 @@ public class CrmClientData extends Model<CrmClientData> { ...@@ -162,6 +162,9 @@ public class CrmClientData extends Model<CrmClientData> {
@ApiModelProperty(value = "产品") @ApiModelProperty(value = "产品")
private String product; private String product;
@ApiModelProperty(value = "跟进记录")
private String followuprecord;
@Transient @Transient
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "协作(0:否 1:是)") @ApiModelProperty(value = "协作(0:否 1:是)")
......
...@@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
...@@ -57,6 +59,7 @@ import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; ...@@ -57,6 +59,7 @@ import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dto.crm.CrmCartogramDto; import cn.timer.api.dto.crm.CrmCartogramDto;
import cn.timer.api.dto.crm.CrmClientDataImportVo; import cn.timer.api.dto.crm.CrmClientDataImportVo;
import cn.timer.api.dto.kqmk.DailyDetailsDto; import cn.timer.api.dto.kqmk.DailyDetailsDto;
import cn.timer.api.dto.xcgl.ImportDescriptionDto;
import cn.timer.api.utils.CheckUtil; import cn.timer.api.utils.CheckUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
...@@ -1423,6 +1426,13 @@ public class CrmController { ...@@ -1423,6 +1426,13 @@ public class CrmController {
@Transactional @Transactional
@ApiOperation(value = "导入客户", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "导入客户", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> importClient(@CurrentUser UserBean userBean, @RequestParam String url) { public Result<Object> importClient(@CurrentUser UserBean userBean, @RequestParam String url) {
int toinsert = 0;//新增
int toupdate = 0;//更新
int failure = 0;//失败
List<Map<String, String>> reasons = Lists.newArrayList();
Integer empNum = getEmpNum(userBean); Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean); Integer orgCode = getOrgCode(userBean);
...@@ -1459,9 +1469,18 @@ public class CrmController { ...@@ -1459,9 +1469,18 @@ public class CrmController {
reader.addHeaderAlias("办公电话", "telephone"); reader.addHeaderAlias("办公电话", "telephone");
reader.addHeaderAlias("个人邮箱", "email"); reader.addHeaderAlias("个人邮箱", "email");
reader.addHeaderAlias("个人地址", "linkAddress"); reader.addHeaderAlias("个人地址", "linkAddress");
reader.addHeaderAlias("跟进记录", "followuprecord");
List<CrmClientDataImportVo> list = reader.read(0, 1, CrmClientDataImportVo.class); List<CrmClientDataImportVo> list = reader.read(0, 1, CrmClientDataImportVo.class);
for (CrmClientDataImportVo crmClientDataImportVo : list) { for (CrmClientDataImportVo crmClientDataImportVo : list) {
String name = crmClientDataImportVo.getClientName();
Map<String, String> map = Maps.newHashMap();
try {
CrmClientData crmd = CrmClientData.builder().build().selectOne(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getBelongUser, empNum).eq(CrmClientData::getClientName, crmClientDataImportVo.getClientName())
.eq(CrmClientData::getClientCellphone, crmClientDataImportVo.getClientCellphone()));
if(crmd == null) {
String clientName = crmClientDataImportVo.getClientName(); // 客户名称(必填) String clientName = crmClientDataImportVo.getClientName(); // 客户名称(必填)
String belongGroupName = crmClientDataImportVo.getBelongGroupName(); // 分组名(必填) String belongGroupName = crmClientDataImportVo.getBelongGroupName(); // 分组名(必填)
String industryName = crmClientDataImportVo.getIndustryName(); // 行业名 String industryName = crmClientDataImportVo.getIndustryName(); // 行业名
...@@ -1482,6 +1501,8 @@ public class CrmController { ...@@ -1482,6 +1501,8 @@ public class CrmController {
String linkemail = crmClientDataImportVo.getEmail(); // 个人邮箱 String linkemail = crmClientDataImportVo.getEmail(); // 个人邮箱
String linkaddress = crmClientDataImportVo.getLinkAddress(); // 个人地址 String linkaddress = crmClientDataImportVo.getLinkAddress(); // 个人地址
String followuprecord = crmClientDataImportVo.getFollowuprecord(); // 跟进记录
CrmClientData crmClientData = new CrmClientData(); CrmClientData crmClientData = new CrmClientData();
// 业务组 // 业务组
...@@ -1533,6 +1554,7 @@ public class CrmController { ...@@ -1533,6 +1554,7 @@ public class CrmController {
crmClientData.setClientEmail(clientEmail); crmClientData.setClientEmail(clientEmail);
crmClientData.setAddress(clientAddress); crmClientData.setAddress(clientAddress);
crmClientData.setOrgCode(orgCode); crmClientData.setOrgCode(orgCode);
crmClientData.setFollowuprecord(followuprecord);//跟进记录
crmClientData.insert(); crmClientData.insert();
Integer cid = crmClientData.getId(); Integer cid = crmClientData.getId();
...@@ -1558,11 +1580,31 @@ public class CrmController { ...@@ -1558,11 +1580,31 @@ public class CrmController {
contacts.insert(); contacts.insert();
} }
} }
toinsert++;
}else {
failure++;
map.put("name", name);
map.put("msg", "该客户已存在");
reasons.add(map);
}
} catch (Exception e) {
failure++;
map.put("name", name);
map.put("msg", StringUtils.isBlank(e.getMessage()) ? "必填数据出现空值" : e.getMessage());
reasons.add(map);
}
}
ImportDescriptionDto imds = new ImportDescriptionDto();
imds.setSuccess(toinsert + toupdate);//成功
imds.setToinsert(toinsert);
imds.setToupdate(toupdate);//更新
imds.setFailure(failure);//失败
imds.setReasons(reasons);
} return ResultUtil.data(imds,"成功");
return ResultUtil.success("导入成功"); // return ResultUtil.success("导入成功");
} }
private ExcelReader getReaderByUrl(String url) { private ExcelReader getReaderByUrl(String url) {
......
...@@ -123,6 +123,7 @@ import cn.timer.api.dto.yggl.LoginerChargeDto; ...@@ -123,6 +123,7 @@ import cn.timer.api.dto.yggl.LoginerChargeDto;
import cn.timer.api.dto.yggl.LzbQueryDto; import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto; import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.ModifyAvatarDto; import cn.timer.api.dto.yggl.ModifyAvatarDto;
import cn.timer.api.dto.yggl.UserInfo;
import cn.timer.api.dto.yggl.YgCartogramDto; import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgKVDto; import cn.timer.api.dto.yggl.YgKVDto;
import cn.timer.api.dto.yggl.YgQueryDto; import cn.timer.api.dto.yggl.YgQueryDto;
...@@ -1997,7 +1998,16 @@ public class YgglController { ...@@ -1997,7 +1998,16 @@ public class YgglController {
return ResultUtil.success("上传成功"); return ResultUtil.success("上传成功");
} }
@PostMapping(value = "/new_account")
@ApiOperation(value = "修改账号", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> New_account(@CurrentUser UserBean userBean, @RequestBody UserInfo userinfo) {
YgglMainEmp.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, userinfo.getName()));
QyzxEmpLogin.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId,userinfo.getName()));
return ResultUtil.success("修改成功");
}
} }
...@@ -65,4 +65,6 @@ public class CrmClientDataImportVo implements Serializable { ...@@ -65,4 +65,6 @@ public class CrmClientDataImportVo implements Serializable {
private String email; private String email;
private String linkAddress; private String linkAddress;
private String followuprecord;
} }
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