打卡机人员信息下发, 新增部门数据
This commit is contained in:
parent
20e4492b6b
commit
e9bae2626e
@ -1,7 +1,9 @@
|
||||
package com.evo.equipment.domain.vo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class StaffData {
|
||||
|
||||
private String cmd;
|
||||
@ -18,116 +20,7 @@ public class StaffData {
|
||||
private int mode;
|
||||
private List valid_cycle;
|
||||
private int user_type;
|
||||
//部门名称
|
||||
private String department;
|
||||
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public void setCmd(String cmd) {
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
public String getUser_id() {
|
||||
return user_id;
|
||||
}
|
||||
|
||||
public void setUser_id(String user_id) {
|
||||
this.user_id = user_id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getTts_name() {
|
||||
return tts_name;
|
||||
}
|
||||
|
||||
public void setTts_name(String tts_name) {
|
||||
this.tts_name = tts_name;
|
||||
}
|
||||
|
||||
public int getEdit_mode() {
|
||||
return edit_mode;
|
||||
}
|
||||
|
||||
public void setEdit_mode(int edit_mode) {
|
||||
this.edit_mode = edit_mode;
|
||||
}
|
||||
|
||||
public String getFace_template() {
|
||||
return face_template;
|
||||
}
|
||||
|
||||
public void setFace_template(String face_template) {
|
||||
this.face_template = face_template;
|
||||
}
|
||||
|
||||
public String getEffect_time() {
|
||||
return effect_time;
|
||||
}
|
||||
|
||||
public void setEffect_time(String effect_time) {
|
||||
this.effect_time = effect_time;
|
||||
}
|
||||
|
||||
public String getId_valid() {
|
||||
return id_valid;
|
||||
}
|
||||
|
||||
public void setId_valid(String id_valid) {
|
||||
this.id_valid = id_valid;
|
||||
}
|
||||
|
||||
public String getIc() {
|
||||
return Ic;
|
||||
}
|
||||
|
||||
public void setIc(String ic) {
|
||||
Ic = ic;
|
||||
}
|
||||
|
||||
public float getConfidence_level() {
|
||||
return confidence_level;
|
||||
}
|
||||
|
||||
public void setConfidence_level(float confidence_level) {
|
||||
this.confidence_level = confidence_level;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public int getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(int mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public List getValid_cycle() {
|
||||
return valid_cycle;
|
||||
}
|
||||
|
||||
public void setValid_cycle(List valid_cycle) {
|
||||
this.valid_cycle = valid_cycle;
|
||||
}
|
||||
|
||||
public int getUser_type() {
|
||||
return user_type;
|
||||
}
|
||||
|
||||
public void setUser_type(int user_type) {
|
||||
this.user_type = user_type;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,11 +7,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.RzUpload;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.exception.WebSocketException;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.common.utils.*;
|
||||
import com.evo.equipment.domain.EqButton;
|
||||
import com.evo.equipment.domain.EqSnDetail;
|
||||
import com.evo.equipment.domain.vo.*;
|
||||
@ -27,6 +25,8 @@ import com.evo.restaurant.service.IRzRestaurantImagesService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.system.service.RzUploadService;
|
||||
import com.evo.system.service.impl.SysDeptServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -55,6 +55,9 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
private RzRestaurantImagesMapper rzRestaurantImagesMapper;
|
||||
@Resource
|
||||
private EqOverStaffMapper eqOverStaffMapper;
|
||||
@Autowired
|
||||
private SysDeptServiceImpl sysDeptServiceImpl;
|
||||
|
||||
/**
|
||||
* 查询考勤设备信息列表
|
||||
*
|
||||
@ -118,10 +121,11 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
private List<Map<String, String>> getPhoto(List<SysStaff> userList){
|
||||
List<Map<String, String>> userPhotoList = Collections.emptyList();
|
||||
Map<Long, RzUpload> longRzUploadMap = rzUploadService.selectListByBusinessIdAndyType(userList.stream().map(SysStaff::getUserId).collect(Collectors.toList()), "avatar").stream().collect(Collectors.toMap(RzUpload::getBusinessId, d->d, (k1,k2) ->k1));
|
||||
Map<Long, String> deptNameMap = sysDeptServiceImpl.list(new LambdaQueryWrapper<SysDept>()).stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName,(k1,k2)->k1));
|
||||
String url = ParamUtils.getGlobalStaticUrl();
|
||||
for(SysStaff user : userList){
|
||||
try {
|
||||
userPhotoList.add(Collections.asMap("userId", String.valueOf(user.getUserId()), "name", user.getName(), "photoUrl", url+longRzUploadMap.get(user.getUserId()).getFileName()));
|
||||
userPhotoList.add(Collections.asMap("userId", String.valueOf(user.getUserId()), "name", user.getName(), "photoUrl", url+longRzUploadMap.get(user.getUserId()).getFileName(), "deptName", DataUtils.findDefaultValue(deptNameMap.get(user.getDeptId()),"实习生")));
|
||||
// userPhotoList.add(Collections.asMap("userId", String.valueOf(user.getUserId()), "name", user.getName(), "photoUrl", longRzUploadMap.get(user.getUserId()).getUrl()));
|
||||
} catch (Exception e) {
|
||||
log.error("员工:"+String.valueOf(user.getUserId())+" 的照片拼装出现问题:"+e.getMessage());
|
||||
@ -139,18 +143,18 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
List<SysStaff> userList = Collections.emptyList();
|
||||
if (deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) || deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)) {
|
||||
//获取所有未删除的, 没有离职的员工信息
|
||||
userList = sysStaffMapper.selectList(new LambdaQueryWrapper<SysStaff>().eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus, Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getName));
|
||||
userList = sysStaffMapper.selectList(new LambdaQueryWrapper<SysStaff>().eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus, Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName));
|
||||
}
|
||||
//加班打卡机
|
||||
if (deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE)) {
|
||||
List<Long> userIds = eqOverStaffMapper.selectList(new LambdaQueryWrapper<EqOverStaff>().eq(EqOverStaff::getDelFlag, Constants.DELETE_FLAG_0).select(EqOverStaff::getUserId)).stream().map(EqOverStaff::getUserId).collect(Collectors.toList());
|
||||
userList = sysStaffMapper.selectList((new LambdaQueryWrapper<SysStaff>().in(SysStaff::getUserId, userIds).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus, Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getName)));
|
||||
userList = sysStaffMapper.selectList((new LambdaQueryWrapper<SysStaff>().in(SysStaff::getUserId, userIds).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus, Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName)));
|
||||
}
|
||||
//如果是下发的食堂打卡机, 则需要查找餐饮人员的数据
|
||||
if (deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)) {
|
||||
List<RzRestaurantImages> list = rzRestaurantImagesMapper.selectList(new LambdaQueryWrapper<RzRestaurantImages>().eq(RzRestaurantImages::getDelFlag, Constants.DELETE_FLAG_0));
|
||||
for (RzRestaurantImages img : list) {
|
||||
userPhotoList.add(Collections.asMap("userId", String.valueOf(img.getId()), "name", img.getName(), "photoUrl", img.getImageUrl()));
|
||||
userPhotoList.add(Collections.asMap("userId", String.valueOf(img.getId()), "name", img.getName(), "photoUrl", img.getImageUrl(), "deptName", "实习生"));
|
||||
}
|
||||
}
|
||||
//拼接数据
|
||||
@ -205,7 +209,7 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
snList.remove(tsDeviceSn);
|
||||
snList.stream().filter(sn-> !tsSn.contains(sn)).forEach(sn ->{
|
||||
//获取所有未删除的, 没有离职的员工信息
|
||||
List<SysStaff> userList = sysStaffMapper.selectList((new LambdaQueryWrapper<SysStaff>().eq(SysStaff::getTimeClock, sn).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus,Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getName)));
|
||||
List<SysStaff> userList = sysStaffMapper.selectList((new LambdaQueryWrapper<SysStaff>().eq(SysStaff::getTimeClock, sn).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus,Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName)));
|
||||
snUserPhotoList.put(sn, getPhoto(userList));
|
||||
});
|
||||
//装载特殊的打卡机
|
||||
@ -250,6 +254,7 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
caud.setUser_id(userPhoto.get("userId"));
|
||||
caud.setName(userPhoto.get("name"));
|
||||
caud.setFace_template(userPhoto.get("photoUrl"));
|
||||
caud.setDepartment(userPhoto.get("deptName"));
|
||||
//循环替换属性
|
||||
cau.setData(caud);
|
||||
//调用websocket,推送给设备
|
||||
|
||||
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.evo.common.annotation.DataScope;
|
||||
import com.evo.common.constant.UserConstants;
|
||||
@ -27,7 +29,7 @@ import javax.annotation.Resource;
|
||||
* @author evo
|
||||
*/
|
||||
@Service
|
||||
public class SysDeptServiceImpl implements ISysDeptService
|
||||
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService
|
||||
{
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user