Commit f9a477e5 by 邓实川 Committed by chenzg

业务组列表接口-根据前端要求修改

parent 09762ee2
......@@ -91,6 +91,11 @@ public class CrmBusinessGroup extends Model<CrmBusinessGroup> {
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "组管理员信息")
private List<Map<String, Object>> members;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "组成员id")
private Integer[] memberIds;
......
......@@ -160,6 +160,9 @@ public class CrmController {
List<CrmBusinessGroupMember> crmBusinessGroupManagers = CrmBusinessGroupMember.builder().build().selectList(
new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid)
.eq(CrmBusinessGroupMember::getType, 1).select(CrmBusinessGroupMember::getEmpNum));
List<CrmBusinessGroupMember> crmBusinessGroupMembers = CrmBusinessGroupMember.builder().build().selectList(
new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid)
.eq(CrmBusinessGroupMember::getType, 0).select(CrmBusinessGroupMember::getEmpNum));
List<Map<String, Object>> managers = new ArrayList<Map<String, Object>>();
for (CrmBusinessGroupMember crmBusinessGroupManager : crmBusinessGroupManagers) {
Integer empNum = crmBusinessGroupManager.getEmpNum();
......@@ -169,29 +172,51 @@ public class CrmController {
managers.add(map);
}
crmBusinessGroup.setManagers(managers);
}
return ResultUtil.data(list, "获取成功");
}
@GetMapping("getBusinessGroupMembers")
@ApiOperation(value = "获取业务组列表成员", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroupMembers(@CurrentUser UserBean userBean, @RequestParam Integer gid) {
List<CrmBusinessGroupMember> crmBusinessGroupMembers = CrmBusinessGroupMember.builder().build().selectList(
new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid));
List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>();
for (CrmBusinessGroupMember crmBusinessGroupMember : crmBusinessGroupMembers) {
ygglMainEmps.add(getYg(getOrgCode(userBean), crmBusinessGroupMember.getEmpNum()));
List<Map<String, Object>> members = new ArrayList<Map<String, Object>>();
for (CrmBusinessGroupMember crmBusinessGroupManager : crmBusinessGroupMembers) {
Integer empNum = crmBusinessGroupManager.getEmpNum();
String name = getEmpName(getOrgCode(userBean), empNum);
Map<String, Object> map = new HashMap<String, Object>();
map.put("name", name);
members.add(map);
}
crmBusinessGroup.setMembers(members);
CrmSeaRule crmSeaRules = CrmSeaRule.builder().build()
.selectOne(new QueryWrapper<CrmSeaRule>().lambda().eq(CrmSeaRule::getGid, gid));
crmBusinessGroup.setCrmSeaRules(crmSeaRules);
}
return ResultUtil.data(ygglMainEmps, "获取成功");
return ResultUtil.data(list, "获取成功");
}
@GetMapping("getBusinessGroupRules") // TODO 扫描规则进行回收操作
@ApiOperation(value = "获取业务组公海规则", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroupRules(@RequestParam Integer gid) {
List<CrmSeaRule> crmSeaRules = CrmSeaRule.builder().build()
.selectList(new QueryWrapper<CrmSeaRule>().lambda().eq(CrmSeaRule::getGid, gid));
return ResultUtil.data(crmSeaRules, "获取成功");
}
// @GetMapping("getBusinessGroupMembers")
// @ApiOperation(value = "获取业务组列表成员", httpMethod = "GET", notes = "接口发布说明")
// public Result<Object> getBusinessGroupMembers(@CurrentUser UserBean userBean, @RequestParam Integer gid) {
// List<CrmBusinessGroupMember> crmBusinessGroupMembers = CrmBusinessGroupMember.builder().build()
// .selectList(new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid)
// .eq(CrmBusinessGroupMember::getType, 0));
// List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>();
// for (CrmBusinessGroupMember crmBusinessGroupMember : crmBusinessGroupMembers) {
// ygglMainEmps.add(getYg(getOrgCode(userBean), crmBusinessGroupMember.getEmpNum()));
// }
// List<CrmBusinessGroupMember> crmBusinessGroupManagers = CrmBusinessGroupMember.builder().build()
// .selectList(new QueryWrapper<CrmBusinessGroupMember>().lambda().eq(CrmBusinessGroupMember::getGid, gid)
// .eq(CrmBusinessGroupMember::getType, 1));
// List<YgglMainEmp> ygglMainEmps2 = new ArrayList<YgglMainEmp>();
// for (CrmBusinessGroupMember crmBusinessGroupManager : crmBusinessGroupManagers) {
// ygglMainEmps2.add(getYg(getOrgCode(userBean), crmBusinessGroupManager.getEmpNum()));
// }
// return ResultUtil.datas(ygglMainEmps2,ygglMainEmps, "获取成功");
// }
// @GetMapping("getBusinessGroupRules") // TODO 扫描规则进行回收操作
// @ApiOperation(value = "获取业务组公海规则", httpMethod = "GET", notes = "接口发布说明")
// public Result<Object> getBusinessGroupRules(@RequestParam Integer gid) {
// List<CrmSeaRule> crmSeaRules = CrmSeaRule.builder().build()
// .selectList(new QueryWrapper<CrmSeaRule>().lambda().eq(CrmSeaRule::getGid, gid));
// return ResultUtil.data(crmSeaRules, "获取成功");
// }
private SysRegion getSysRegion(Integer keyId) {
return SysRegion.builder().build()
......
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