|
@@ -2,6 +2,7 @@ package com.management.platform.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.management.platform.entity.*;
|
|
import com.management.platform.entity.*;
|
|
@@ -31,6 +32,7 @@ import java.text.DecimalFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -69,6 +71,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
private ExcelExportService excelExportService;
|
|
private ExcelExportService excelExportService;
|
|
@Resource
|
|
@Resource
|
|
private WxCorpInfoService wxCorpInfoService;
|
|
private WxCorpInfoService wxCorpInfoService;
|
|
|
|
+ @Resource
|
|
|
|
+ private UserWorkTypeMapper userWorkTypeMapper;
|
|
|
|
|
|
@Value("${corpId}")
|
|
@Value("${corpId}")
|
|
private String corpId;
|
|
private String corpId;
|
|
@@ -1516,6 +1520,38 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取当前班组人员
|
|
|
|
+ * @param request
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg getMyGroups(HttpServletRequest request) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
|
|
+ ArrayList<User> departmentUserList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<User> groupList = userMapper.selectList(new LambdaQueryWrapper<User>()
|
|
|
|
+ .eq(user.getCompanyId() != null, User::getCompanyId, user.getCompanyId())
|
|
|
|
+ .eq(user.getDepartmentId() != null, User::getDepartmentId, user.getDepartmentId())
|
|
|
|
+ .select(User::getId, User::getName,User::getJobNumber,User::getWorkTypeId)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ List<UserWorkType> userWorkTypeList = userWorkTypeMapper.selectList(null);
|
|
|
|
+
|
|
|
|
+ groupList.stream().forEach(member->{
|
|
|
|
+ List<UserWorkType> workTypeList = userWorkTypeList.stream().filter(userWorkType -> userWorkType.getId() == member.getWorkTypeId()).collect(Collectors.toList());
|
|
|
|
+ if(workTypeList!=null&&workTypeList.size()>0){
|
|
|
|
+ member.setWorkType(workTypeList.get(0).getName());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ msg.setData(groupList);
|
|
|
|
+
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 递归对返回的部门数据进行排序
|
|
* 递归对返回的部门数据进行排序
|
|
* @param list
|
|
* @param list
|