Commit 635ef68f by 邓实川 Committed by chenzg

修复客户跟进 字段类型

parent 2e277b5f
...@@ -60,7 +60,7 @@ public class CrmClientFollow extends Model<CrmClientFollow> { ...@@ -60,7 +60,7 @@ public class CrmClientFollow extends Model<CrmClientFollow> {
private Integer content; private Integer content;
@ApiModelProperty(value = "客户数据状态 0-无 1-潜在 2-意向 3-签约 4-合作中 5-已封档") @ApiModelProperty(value = "客户数据状态 0-无 1-潜在 2-意向 3-签约 4-合作中 5-已封档")
private String clientStatus; private Integer clientStatus;
@ApiModelProperty(value = "联系人姓名") @ApiModelProperty(value = "联系人姓名")
private String name; private String name;
......
...@@ -73,7 +73,7 @@ public class CrmController { ...@@ -73,7 +73,7 @@ public class CrmController {
@Autowired @Autowired
private CrmClientDataMapper crmClientDataMapper; private CrmClientDataMapper crmClientDataMapper;
@Autowired @Autowired
private CrmClientContactsMapper crmClientContactsMapper; private CrmClientContactsMapper crmClientContactsMapper;
...@@ -591,7 +591,10 @@ public class CrmController { ...@@ -591,7 +591,10 @@ public class CrmController {
if (cid == null) if (cid == null)
return ResultUtil.error("删除失败,请传入客户id"); return ResultUtil.error("删除失败,请传入客户id");
Integer num = CrmClientData.builder().id(cid).build().selectById().getContactsNum(); Integer num = CrmClientData.builder().id(cid).build().selectById().getContactsNum();
CrmClientData.builder().id(cid).contactsNum(--num).build().updateById(); if (--num < 0) {
return ResultUtil.error("删除失败,已经没有可以删的联系人了");
}
CrmClientData.builder().id(cid).contactsNum(num).build().updateById();
if (crmClientContactsMapper.deleteById(id) > 0) if (crmClientContactsMapper.deleteById(id) > 0)
return ResultUtil.success("删除成功"); return ResultUtil.success("删除成功");
return ResultUtil.error("删除失败"); return ResultUtil.error("删除失败");
...@@ -645,7 +648,8 @@ public class CrmController { ...@@ -645,7 +648,8 @@ public class CrmController {
Integer orgCode = getOrgCode(userBean); Integer orgCode = getOrgCode(userBean);
Integer empNum = getEmpNum(userBean); Integer empNum = getEmpNum(userBean);
CrmClientData.builder().id(crmClientFollow.getCid()).lastFollowTime(new Date()).build().updateById(); // 更新客户最近跟进时间 CrmClientData.builder().id(crmClientFollow.getCid()).clientStatus(crmClientFollow.getClientStatus())
.lastFollowTime(new Date()).build().updateById(); // 更新客户最近跟进时间
crmClientFollow.setOrgCode(orgCode); crmClientFollow.setOrgCode(orgCode);
crmClientFollow.setCreateUserName(getEmpName(orgCode, empNum)); crmClientFollow.setCreateUserName(getEmpName(orgCode, empNum));
......
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