Commit fc873d2f by 邓实川 Committed by chenzg

客户管理优化

parent 24d4490f
......@@ -256,11 +256,23 @@ public class CrmController {
@GetMapping("getBusinessGroupId")
@ApiOperation(value = "获取业务组列表(id,name)", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroupId(@CurrentUser UserBean userBean) {
return ResultUtil.data(CrmBusinessGroup.builder().build()
.selectList(new LambdaQueryWrapper<CrmBusinessGroup>()
.eq(CrmBusinessGroup::getOrgCode, getOrgCode(userBean))
.select(CrmBusinessGroup::getId, CrmBusinessGroup::getName)),
"获取成功");
Integer empNum = getEmpNum(userBean);
List<CrmBusinessGroupMember> list = CrmBusinessGroupMember.builder().build()
.selectList(new LambdaQueryWrapper<CrmBusinessGroupMember>()
.eq(CrmBusinessGroupMember::getEmpNum, empNum).select(CrmBusinessGroupMember::getGid));
List<Integer> gids = list.stream().map(CrmBusinessGroupMember::getGid).collect(Collectors.toList()).stream()
.distinct().collect(Collectors.toList());
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
for (Integer gid : gids) {
System.err.println(gid);
String name = CrmBusinessGroup.builder().build().selectOne(new LambdaQueryWrapper<CrmBusinessGroup>()
.eq(CrmBusinessGroup::getId, gid).select(CrmBusinessGroup::getName)).getName();
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", gid);
map.put("name", name);
result.add(map);
}
return ResultUtil.data(result, "获取成功");
}
// @GetMapping("getBusinessGroupMembers")
......@@ -304,6 +316,7 @@ public class CrmController {
public Result<Object> addClient(@CurrentUser UserBean userBean, @RequestBody CrmClientData crmClientData) {
Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean);
crmClientData.setClientStatus(1);
crmClientData.setCreateUser(empNum);
SysRegion district = getSysRegion(crmClientData.getDistrictId());
// crmClientData.setZipCode(district.getZipCode());
......@@ -702,7 +715,7 @@ public class CrmController {
crmClientData.updateById();
return ResultUtil.success("封档成功");
} else if (status == 5) {
crmClientData.setClientStatus(0); // 解封后默认无状态
// crmClientData.setClientStatus(0); // 解封后默认无状态
crmClientData.updateById();
return ResultUtil.success("解封成功");
} else
......@@ -1133,7 +1146,7 @@ public class CrmController {
crmClientData.setClientType(clientTypeClass.getId());
}
crmClientData.setClientStatus(0);
crmClientData.setClientStatus(1);
crmClientData.setContactsNum(1);
crmClientData.setBelongUser(empNum);
crmClientData.setBelongUserName(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