Commit a8a049f5 by 邓实川

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

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