Commit b1482c9b by 邓实川

新增联系人优化

parent 6ec23793
...@@ -428,8 +428,8 @@ public class CrmController { ...@@ -428,8 +428,8 @@ public class CrmController {
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status) .eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or() .like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like)); .like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like));
if (crmClientData != null) if (crmClientData != null)
myCrmClientAssociates.add(crmClientData); myCrmClientAssociates.add(crmClientData);
} }
return myCrmClientAssociates; return myCrmClientAssociates;
} }
...@@ -468,7 +468,7 @@ public class CrmController { ...@@ -468,7 +468,7 @@ public class CrmController {
if (type == null || type == 0) { // 全部客户(去重) if (type == null || type == 0) { // 全部客户(去重)
List<CrmClientData> myClient = getMyCilent(empNum, orgCode, groupId, status, like); List<CrmClientData> myClient = getMyCilent(empNum, orgCode, groupId, status, like);
List<CrmClientData> myAsso = getMyAssociateCilent(empNum, orgCode, groupId, status, like); List<CrmClientData> myAsso = getMyAssociateCilent(empNum, orgCode, groupId, status, like);
crmClientDatas = CheckUtil.distinct(myClient, myAsso, true); crmClientDatas = CheckUtil.distinct(myClient, myAsso, true);
} else if (type == 1) // 我负责的客户 } else if (type == 1) // 我负责的客户
crmClientDatas = getMyCilent(empNum, orgCode, groupId, status, like); crmClientDatas = getMyCilent(empNum, orgCode, groupId, status, like);
else if (type == 2) // 我协作的客户 else if (type == 2) // 我协作的客户
...@@ -479,11 +479,10 @@ public class CrmController { ...@@ -479,11 +479,10 @@ public class CrmController {
crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status); crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status);
else else
return ResultUtil.error("查询失败"); return ResultUtil.error("查询失败");
// TODO 排序
Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序 Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序
return ResultUtil.data(crmClientDatas, "查询成功"); return ResultUtil.data(crmClientDatas, "查询成功");
} }
private List<Integer> MyJoinGroup(Integer empNum, Integer orgCode) { private List<Integer> MyJoinGroup(Integer empNum, Integer orgCode) {
List<CrmBusinessGroupMember> members = CrmBusinessGroupMember.builder().build() List<CrmBusinessGroupMember> members = CrmBusinessGroupMember.builder().build()
.selectList(new QueryWrapper<CrmBusinessGroupMember>().lambda() .selectList(new QueryWrapper<CrmBusinessGroupMember>().lambda()
...@@ -562,9 +561,10 @@ public class CrmController { ...@@ -562,9 +561,10 @@ public class CrmController {
@PostMapping("addCilentLinkMan") @PostMapping("addCilentLinkMan")
@Transactional @Transactional
@ApiOperation(value = "新增/编辑客户联系人", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "新增/编辑客户联系人", httpMethod = "POST", notes = "接口发布说明")
public Result<Void> addCilentLinkMan(@CurrentUser UserBean userBean, CrmClientContacts crmClientContacts) { public Result<Void> addCilentLinkMan(@CurrentUser UserBean userBean,
@RequestBody CrmClientContacts crmClientContacts) {
if (crmClientContacts.getId() == null) { if (crmClientContacts.getId() == null) {
Integer num = CrmClientData.builder().build().selectById().getContactsNum(); Integer num = CrmClientData.builder().id(crmClientContacts.getCid()).build().selectById().getContactsNum();
CrmClientData.builder().id(crmClientContacts.getCid()).contactsNum(++num).build().updateById(); CrmClientData.builder().id(crmClientContacts.getCid()).contactsNum(++num).build().updateById();
} }
if (crmClientContacts.insertOrUpdate()) if (crmClientContacts.insertOrUpdate())
......
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