Commit 9433de9d by dengshichuan

Merge branch 'dsc' into 'develop'

bug修改

See merge request 8timerv2/8timerapiv200!190
parents 351502be 4a74a4ee
......@@ -280,23 +280,37 @@ public class CrmController {
@GetMapping("getBusinessGroupId")
@ApiOperation(value = "获取业务组列表(id,name)", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getBusinessGroupId(@CurrentUser UserBean userBean) {
List<CrmBusinessGroupMember> list = CrmBusinessGroupMember.builder().build()
.selectList(new LambdaQueryWrapper<CrmBusinessGroupMember>()
.eq(CrmBusinessGroupMember::getEmpNum, getEmpNum(userBean))
.eq(CrmBusinessGroupMember::getOrgCode, getOrgCode(userBean))
.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) {
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);
Integer nowEmpNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean);
YgglMainEmp yg = YgglMainEmp.builder().build()
.selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, nowEmpNum).select(YgglMainEmp::getIsManager));
if (yg != null && yg.getIsManager() != null && (yg.getIsManager() == 1 || yg.getIsManager() == 2)) {
List<CrmBusinessGroup> list = CrmBusinessGroup.builder().build()
.selectList(new LambdaQueryWrapper<CrmBusinessGroup>().eq(CrmBusinessGroup::getOrgCode, orgCode)
.select(CrmBusinessGroup::getName, CrmBusinessGroup::getId));
return ResultUtil.data(list, "获取成功");
} else {
List<CrmBusinessGroupMember> list = CrmBusinessGroupMember.builder().build()
.selectList(new LambdaQueryWrapper<CrmBusinessGroupMember>()
.eq(CrmBusinessGroupMember::getEmpNum, getEmpNum(userBean))
.eq(CrmBusinessGroupMember::getOrgCode, getOrgCode(userBean))
.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) {
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, "获取成功");
}
return ResultUtil.data(result, "获取成功");
}
// @GetMapping("getBusinessGroupMembers")
......@@ -559,25 +573,45 @@ public class CrmController {
@RequestParam(required = false) Integer status, @RequestParam(required = false) String like) {
Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean);
// 当前用户加入的组
List<Integer> gids1 = MyJoinGroup(empNum, orgCode);
// 当前用户管理的组
List<Integer> gids2 = MyManageGroup(empNum, orgCode);
List<Integer> myGids = CheckUtil.distinct(gids1, gids2, true); // 当前用户所有业务组id
List<CrmClientData> crmClientDatas = new ArrayList<CrmClientData>();
for (Integer gid : myGids) {
List<CrmClientData> datas = CrmClientData.builder().build()
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getBelongGroup, gid)
YgglMainEmp yg = YgglMainEmp.builder().build()
.selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, empNum).select(YgglMainEmp::getIsManager));
if (yg != null && yg.getIsManager() != null && (yg.getIsManager() == 1 || yg.getIsManager() == 2)) {
List<CrmClientData> list = CrmClientData.builder().build()
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getOrgCode, orgCode)
.eq(CrmClientData::getBelongUser, 0)
.eq(type != null && type >= 0, CrmClientData::getClientType, type)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like));
for (CrmClientData data : datas)
crmClientDatas.add(data);
return ResultUtil.data(list, "查询成功");
} else {
// 当前用户加入的组
List<Integer> gids1 = MyJoinGroup(empNum, orgCode);
// 当前用户管理的组
List<Integer> gids2 = MyManageGroup(empNum, orgCode);
List<Integer> myGids = CheckUtil.distinct(gids1, gids2, true); // 当前用户所有业务组id
List<CrmClientData> crmClientDatas = new ArrayList<CrmClientData>();
for (Integer gid : myGids) {
List<CrmClientData> datas = CrmClientData.builder().build()
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getBelongGroup, gid)
.eq(CrmClientData::getBelongUser, 0)
.eq(type != null && type >= 0, CrmClientData::getClientType, type)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like));
for (CrmClientData data : datas)
crmClientDatas.add(data);
}
return ResultUtil.data(crmClientDatas, "查询成功");
}
return ResultUtil.data(crmClientDatas, "查询成功");
}
@GetMapping("getAllCilentTotal")
......@@ -589,14 +623,16 @@ public class CrmController {
@RequestParam(required = false) String endCreateTime,
@RequestParam(required = false) String startFollowTime,
@RequestParam(required = false) String endFollowTime) {
Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean);
// 当前用户管理的组
List<Integer> gids = MyManageGroup(empNum, orgCode);
List<Object> crmClientDatas = new ArrayList<Object>();
for (Integer gid : gids) {
YgglMainEmp yg = YgglMainEmp.builder().build()
.selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, empNum).select(YgglMainEmp::getIsManager));
if (yg != null && yg.getIsManager() != null && (yg.getIsManager() == 1 || yg.getIsManager() == 2)) {
List<CrmClientData> datas = CrmClientData.builder().build()
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getBelongGroup, gid)
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getOrgCode, orgCode)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId)
.eq(type != null && type >= 0, CrmClientData::getClientType, type)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
......@@ -606,10 +642,29 @@ public class CrmController {
.le(StringUtils.isNotBlank(endFollowTime), CrmClientData::getCreateTime, endFollowTime)
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like));
for (CrmClientData data : datas)
crmClientDatas.add(data);
return ResultUtil.data(datas, "查询成功");
} else {
// 当前用户管理的组
List<Integer> gids = MyManageGroup(empNum, orgCode);
List<Object> crmClientDatas = new ArrayList<Object>();
for (Integer gid : gids) {
List<CrmClientData> datas = CrmClientData.builder().build().selectList(new QueryWrapper<CrmClientData>()
.lambda().eq(CrmClientData::getBelongGroup, gid)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId)
.eq(type != null && type >= 0, CrmClientData::getClientType, type)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
.ge(StringUtils.isNotBlank(startCreateTime), CrmClientData::getCreateTime, startCreateTime)
.le(StringUtils.isNotBlank(endCreateTime), CrmClientData::getCreateTime, endCreateTime)
.ge(StringUtils.isNotBlank(startFollowTime), CrmClientData::getCreateTime, startFollowTime)
.le(StringUtils.isNotBlank(endFollowTime), CrmClientData::getCreateTime, endFollowTime)
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like));
for (CrmClientData data : datas)
crmClientDatas.add(data);
}
return ResultUtil.data(crmClientDatas, "查询成功");
}
return ResultUtil.data(crmClientDatas, "查询成功");
}
@PostMapping("addCilentLinkMan")
......
......@@ -358,7 +358,7 @@ public class CmsController {
// 查询条件
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("organization_id", userBean.getOrgCode())
.select("id", "auditopinion", "modularid", "status", "title", "releasetime", "addeddate", "author",
.select("id","publisher_name", "auditopinion", "modularid", "status", "title", "releasetime", "addeddate", "author",
"summary", "releasetype", "fmtpath")
.ne("status", 1).eq(t != null && t > -1, "modularid", t)
.between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime",
......
......@@ -9,6 +9,7 @@ package cn.timer.api.controller.qyzx;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.timer.api.bean.qyzx.auth.QyzxAuthAccount;
......@@ -170,4 +172,20 @@ public class QyzxAuthController {
}
@GetMapping(value = "/getYgAuth")
@ApiOperation(value = "获取全部权限信息", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglMainEmp>> getYgAuth(@CurrentUser UserBean userBean) {
YgglMainEmp main = YgglMainEmp.builder().build()
.selectOne(new LambdaQueryWrapper<YgglMainEmp>().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getIsManager, 1).select(YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getEmpNum, YgglMainEmp::getIsManager));
List<YgglMainEmp> child = YgglMainEmp.builder().build()
.selectList(new LambdaQueryWrapper<YgglMainEmp>().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getIsManager, 2).select(YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getEmpNum, YgglMainEmp::getIsManager));
child.add(main);
return ResultUtil.data(child, "查询成功");
}
}
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