设备新增照片下发
This commit is contained in:
parent
650be527e1
commit
289d595239
@ -1,15 +1,17 @@
|
|||||||
package com.evo.attendance.mapper;
|
package com.evo.attendance.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evo.attendance.domain.RzSysParam;
|
import com.evo.attendance.domain.RzSysParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置Mapper接口
|
* 参数配置Mapper接口
|
||||||
*
|
*
|
||||||
* @author 田志阳
|
* @author 田志阳
|
||||||
* @date 2025-05-23
|
* @date 2025-05-23
|
||||||
*/
|
*/
|
||||||
public interface RzSysParamMapper
|
public interface RzSysParamMapper extends BaseMapper<RzSysParam>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询参数配置
|
* 查询参数配置
|
||||||
|
|||||||
@ -58,4 +58,14 @@ public interface IRzSysParamService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteRzSysParamById(Long id);
|
public int deleteRzSysParamById(Long id);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 获取数据信息
|
||||||
|
* @param name
|
||||||
|
* @param code
|
||||||
|
* @param defVal
|
||||||
|
* @param des
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RzSysParam getRzSysParam(String name, String code, String defVal, String des);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
package com.evo.attendance.service.impl;
|
package com.evo.attendance.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.evo.common.utils.DateUtils;
|
import com.evo.common.utils.DateUtils;
|
||||||
import com.evo.common.utils.SecurityUtils;
|
import com.evo.common.utils.SecurityUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.evo.attendance.mapper.RzSysParamMapper;
|
import com.evo.attendance.mapper.RzSysParamMapper;
|
||||||
@ -16,10 +20,8 @@ import com.evo.attendance.service.IRzSysParamService;
|
|||||||
* @date 2025-05-23
|
* @date 2025-05-23
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class RzSysParamServiceImpl implements IRzSysParamService
|
public class RzSysParamServiceImpl extends ServiceImpl<RzSysParamMapper, RzSysParam> implements IRzSysParamService
|
||||||
{
|
{
|
||||||
@Autowired
|
|
||||||
private RzSysParamMapper rzSysParamMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置
|
* 查询参数配置
|
||||||
@ -30,7 +32,7 @@ public class RzSysParamServiceImpl implements IRzSysParamService
|
|||||||
@Override
|
@Override
|
||||||
public RzSysParam selectRzSysParamById(Long id)
|
public RzSysParam selectRzSysParamById(Long id)
|
||||||
{
|
{
|
||||||
return rzSysParamMapper.selectRzSysParamById(id);
|
return getBaseMapper().selectRzSysParamById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,7 +44,7 @@ public class RzSysParamServiceImpl implements IRzSysParamService
|
|||||||
@Override
|
@Override
|
||||||
public List<RzSysParam> selectRzSysParamList(RzSysParam rzSysParam)
|
public List<RzSysParam> selectRzSysParamList(RzSysParam rzSysParam)
|
||||||
{
|
{
|
||||||
return rzSysParamMapper.selectRzSysParamList(rzSysParam);
|
return getBaseMapper().selectRzSysParamList(rzSysParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,7 +59,7 @@ public class RzSysParamServiceImpl implements IRzSysParamService
|
|||||||
rzSysParam.setUpdateTime(DateUtils.getNowDate());
|
rzSysParam.setUpdateTime(DateUtils.getNowDate());
|
||||||
rzSysParam.setCreateBy(SecurityUtils.getUsername());
|
rzSysParam.setCreateBy(SecurityUtils.getUsername());
|
||||||
rzSysParam.setCreateTime(DateUtils.getNowDate());
|
rzSysParam.setCreateTime(DateUtils.getNowDate());
|
||||||
return rzSysParamMapper.insertRzSysParam(rzSysParam);
|
return getBaseMapper().insertRzSysParam(rzSysParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,7 +71,7 @@ public class RzSysParamServiceImpl implements IRzSysParamService
|
|||||||
@Override
|
@Override
|
||||||
public int updateRzSysParam(RzSysParam rzSysParam)
|
public int updateRzSysParam(RzSysParam rzSysParam)
|
||||||
{
|
{
|
||||||
return rzSysParamMapper.updateRzSysParam(rzSysParam);
|
return getBaseMapper().updateRzSysParam(rzSysParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,7 +83,7 @@ public class RzSysParamServiceImpl implements IRzSysParamService
|
|||||||
@Override
|
@Override
|
||||||
public int deleteRzSysParamByIds(Long[] ids)
|
public int deleteRzSysParamByIds(Long[] ids)
|
||||||
{
|
{
|
||||||
return rzSysParamMapper.deleteRzSysParamByIds(ids);
|
return getBaseMapper().deleteRzSysParamByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,6 +95,22 @@ public class RzSysParamServiceImpl implements IRzSysParamService
|
|||||||
@Override
|
@Override
|
||||||
public int deleteRzSysParamById(Long id)
|
public int deleteRzSysParamById(Long id)
|
||||||
{
|
{
|
||||||
return rzSysParamMapper.deleteRzSysParamById(id);
|
return getBaseMapper().deleteRzSysParamById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public RzSysParam getRzSysParam(String name, String code, String defVal, String des){
|
||||||
|
RzSysParam param = getOne(new LambdaQueryWrapper<RzSysParam>().eq(RzSysParam::getParamCode, code));
|
||||||
|
if(ObjectUtils.isEmpty(param)){
|
||||||
|
param = new RzSysParam();
|
||||||
|
param.setParamName(name);
|
||||||
|
param.setParamCode(code);
|
||||||
|
param.setParamValue(defVal);
|
||||||
|
param.setDescription(des);
|
||||||
|
save(param);
|
||||||
|
}
|
||||||
|
return param;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,6 +101,7 @@ public class Constants
|
|||||||
*/
|
*/
|
||||||
public static final String DELETE_FLAG_0 = "0"; //添加信息
|
public static final String DELETE_FLAG_0 = "0"; //添加信息
|
||||||
public static final String DELETE_FLAG_1 = "1"; //删除信息
|
public static final String DELETE_FLAG_1 = "1"; //删除信息
|
||||||
|
public static final String JOB_STATIS_11 = "-1"; //员工 离职
|
||||||
public static final String JOB_STATIS_0 = "0"; //员工 试用
|
public static final String JOB_STATIS_0 = "0"; //员工 试用
|
||||||
public static final String JOB_STATIS_1 = "1"; //员工 正式
|
public static final String JOB_STATIS_1 = "1"; //员工 正式
|
||||||
public static final String SYS_COMPANY = "sys_company"; //公司简称
|
public static final String SYS_COMPANY = "sys_company"; //公司简称
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.evo.common.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* webSocket异常
|
||||||
|
*
|
||||||
|
* @author evo
|
||||||
|
*/
|
||||||
|
public class WebSocketException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public WebSocketException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebSocketException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebSocketException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
evo-admin/src/main/java/com/evo/common/utils/ParamUtils.java
Normal file
35
evo-admin/src/main/java/com/evo/common/utils/ParamUtils.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.evo.common.utils;
|
||||||
|
|
||||||
|
import com.evo.attendance.domain.RzSysParam;
|
||||||
|
import com.evo.attendance.service.IRzSysParamService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局参数获取配置类
|
||||||
|
*
|
||||||
|
* @ClassName:ParamUtils
|
||||||
|
* @date: 2025年05月23日 16:50
|
||||||
|
* @author: andy.shi
|
||||||
|
* @contact: 17330188597
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ParamUtils {
|
||||||
|
|
||||||
|
private static IRzSysParamService paramService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ParamUtils(IRzSysParamService paramService) {
|
||||||
|
this.paramService = paramService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getGlobalStaticUrl(){
|
||||||
|
RzSysParam param= paramService.getRzSysParam("静态地址URL", "static_url","http://192.168.16.1:8081","静态文件的url地址");
|
||||||
|
return param.getParamValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -13,9 +13,18 @@ public class Constants
|
|||||||
public static final String STAFF_BUTTON_URL = "http://192.168.5.12:8088/button/"; //打卡按钮图片存服务器获取地址
|
public static final String STAFF_BUTTON_URL = "http://192.168.5.12:8088/button/"; //打卡按钮图片存服务器获取地址
|
||||||
public static final String STAFF_IMAGE_URL = "http://192.168.5.12:8088/image/"; //打卡人员图片存服务器获取地址
|
public static final String STAFF_IMAGE_URL = "http://192.168.5.12:8088/image/"; //打卡人员图片存服务器获取地址
|
||||||
public static final String STAFF_FUND_ADDRESS = "D:/lableExcel/"; //公积金存储地址
|
public static final String STAFF_FUND_ADDRESS = "D:/lableExcel/"; //公积金存储地址
|
||||||
|
/***
|
||||||
|
* 餐饮打卡机设备号
|
||||||
|
*/
|
||||||
public static final String EQ_DEVICE_CODE = "T71474"; //餐饮打卡机设备号
|
public static final String EQ_DEVICE_CODE = "T71474"; //餐饮打卡机设备号
|
||||||
|
/***
|
||||||
|
* 公共打卡机
|
||||||
|
*/
|
||||||
public static final String EQ_DEVICE_PUBLIC_CODE = "ET74333"; //公共打卡机
|
public static final String EQ_DEVICE_PUBLIC_CODE = "ET74333"; //公共打卡机
|
||||||
public static final String STAFF_IMAGE_URL_OVER_TIME = "http://192.168.5.12:8088/image/"; //打卡人员图片存服务器获取地址
|
public static final String STAFF_IMAGE_URL_OVER_TIME = "http://192.168.5.12:8088/image/";//打卡人员图片存服务器获取地址
|
||||||
|
/***
|
||||||
|
* 加班打卡机
|
||||||
|
*/
|
||||||
public static final String EQ_DEVICE_OVER_TIME_CODE = "ET74336"; //加班打卡机
|
public static final String EQ_DEVICE_OVER_TIME_CODE = "ET74336"; //加班打卡机
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.io.BufferedOutputStream;
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -29,7 +30,7 @@ import java.util.List;
|
|||||||
@RequestMapping("/equipment/button")
|
@RequestMapping("/equipment/button")
|
||||||
public class EqButtonController extends BaseController
|
public class EqButtonController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Resource
|
||||||
private IEqButtonService eqButtonService;
|
private IEqButtonService eqButtonService;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,19 @@
|
|||||||
package com.evo.equipment.controller;
|
package com.evo.equipment.controller;
|
||||||
|
|
||||||
import com.evo.common.core.controller.BaseController;
|
import com.evo.common.core.controller.BaseController;
|
||||||
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
import com.evo.common.core.page.TableDataInfo;
|
import com.evo.common.core.page.TableDataInfo;
|
||||||
|
import com.evo.common.utils.Collections;
|
||||||
import com.evo.equipment.domain.EqSnDetail;
|
import com.evo.equipment.domain.EqSnDetail;
|
||||||
import com.evo.equipment.service.IEqSnDetailService;
|
import com.evo.equipment.service.IEqSnDetailService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,8 +26,8 @@ import java.util.List;
|
|||||||
@RequestMapping("/equipment/snDetail")
|
@RequestMapping("/equipment/snDetail")
|
||||||
public class EqSnDetailController extends BaseController
|
public class EqSnDetailController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Resource
|
||||||
private IEqSnDetailService EqSnDetailService;
|
private IEqSnDetailService eqSnDetailService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询考勤设备信息列表
|
* 查询考勤设备信息列表
|
||||||
@ -33,8 +37,14 @@ public class EqSnDetailController extends BaseController
|
|||||||
public TableDataInfo list(EqSnDetail EqSnDetail)
|
public TableDataInfo list(EqSnDetail EqSnDetail)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<EqSnDetail> list = EqSnDetailService.selectEqSnDetailList(EqSnDetail);
|
List<EqSnDetail> list = eqSnDetailService.selectEqSnDetailList(EqSnDetail);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/sendPhoto/{sn}")
|
||||||
|
public AjaxResult sendPhoto(@PathVariable String sn)
|
||||||
|
{
|
||||||
|
return eqSnDetailService.sendPhoto(Collections.asList(sn), null) ? AjaxResult.success(true) : AjaxResult.error();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,8 @@ package com.evo.equipment.domain;
|
|||||||
import com.evo.common.annotation.Excel;
|
import com.evo.common.annotation.Excel;
|
||||||
import com.evo.common.core.domain.BaseEntity;
|
import com.evo.common.core.domain.BaseEntity;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
@ -14,6 +16,8 @@ import java.util.Date;
|
|||||||
* @author chenyj
|
* @author chenyj
|
||||||
* @date 2024-08-07
|
* @date 2024-08-07
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
public class EqSnDetail extends BaseEntity
|
public class EqSnDetail extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -37,6 +41,12 @@ public class EqSnDetail extends BaseEntity
|
|||||||
@Excel(name = "设备ip")
|
@Excel(name = "设备ip")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sessionId
|
||||||
|
* 记录链接的sessionId, 用于链接关闭的数据处理, 和异常关闭的数据处理
|
||||||
|
*/
|
||||||
|
private String sessionId;
|
||||||
|
|
||||||
/** 设备连接时间 */
|
/** 设备连接时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "设备连接时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "设备连接时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ -49,94 +59,5 @@ public class EqSnDetail extends BaseEntity
|
|||||||
/** 删除标识 */
|
/** 删除标识 */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
public void setId(Long id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setSn(String sn)
|
|
||||||
{
|
|
||||||
this.sn = sn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSn()
|
|
||||||
{
|
|
||||||
return sn;
|
|
||||||
}
|
|
||||||
public void setVersionCode(String versionCode)
|
|
||||||
{
|
|
||||||
this.versionCode = versionCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVersionCode()
|
|
||||||
{
|
|
||||||
return versionCode;
|
|
||||||
}
|
|
||||||
public void setVersionName(String versionName)
|
|
||||||
{
|
|
||||||
this.versionName = versionName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVersionName()
|
|
||||||
{
|
|
||||||
return versionName;
|
|
||||||
}
|
|
||||||
public void setIp(String ip)
|
|
||||||
{
|
|
||||||
this.ip = ip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIp()
|
|
||||||
{
|
|
||||||
return ip;
|
|
||||||
}
|
|
||||||
public void setSnTime(Date snTime)
|
|
||||||
{
|
|
||||||
this.snTime = snTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getSnTime()
|
|
||||||
{
|
|
||||||
return snTime;
|
|
||||||
}
|
|
||||||
public void setType(String type)
|
|
||||||
{
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType()
|
|
||||||
{
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
public void setDelFlag(String delFlag)
|
|
||||||
{
|
|
||||||
this.delFlag = delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDelFlag()
|
|
||||||
{
|
|
||||||
return delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("id", getId())
|
|
||||||
.append("sn", getSn())
|
|
||||||
.append("versionCode", getVersionCode())
|
|
||||||
.append("versionName", getVersionName())
|
|
||||||
.append("ip", getIp())
|
|
||||||
.append("snTime", getSnTime())
|
|
||||||
.append("type", getType())
|
|
||||||
.append("delFlag", getDelFlag())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("updateTime", getUpdateTime())
|
|
||||||
.append("updateBy", getUpdateBy())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evo.equipment.mapper;
|
package com.evo.equipment.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evo.equipment.domain.EqSnDetail;
|
import com.evo.equipment.domain.EqSnDetail;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -10,7 +11,7 @@ import java.util.List;
|
|||||||
* @author chenyj
|
* @author chenyj
|
||||||
* @date 2024-08-07
|
* @date 2024-08-07
|
||||||
*/
|
*/
|
||||||
public interface EqSnDetailMapper
|
public interface EqSnDetailMapper extends BaseMapper<EqSnDetail>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询考勤设备信息列表
|
* 查询考勤设备信息列表
|
||||||
|
|||||||
@ -62,9 +62,4 @@ public interface IEqButtonService
|
|||||||
*/
|
*/
|
||||||
public EqButton selectEqButtonByName(String name);
|
public EqButton selectEqButtonByName(String name);
|
||||||
|
|
||||||
/***
|
|
||||||
* 照片下发
|
|
||||||
* @param paramEqSnDetail
|
|
||||||
*/
|
|
||||||
void sendButton(EqSnDetail paramEqSnDetail);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,10 @@ package com.evo.equipment.service;
|
|||||||
|
|
||||||
import com.evo.common.core.domain.AjaxResult;
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
import com.evo.equipment.domain.EqSnDetail;
|
import com.evo.equipment.domain.EqSnDetail;
|
||||||
|
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 考勤设备信息Service接口
|
* 考勤设备信息Service接口
|
||||||
@ -43,4 +45,24 @@ public interface IEqSnDetailService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public EqSnDetail selectEqSnDetailBySn(String sn);
|
public EqSnDetail selectEqSnDetailBySn(String sn);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 下发照片
|
||||||
|
* @param snList
|
||||||
|
* @param userPhotoList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Boolean sendPhoto(List<String> snList, List<Map<String, String>> userPhotoList);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 下发按钮
|
||||||
|
* @param snList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Boolean sendButtons(List<String> snList);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 检查设备在线情况
|
||||||
|
*/
|
||||||
|
public void checkDevice();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,19 @@
|
|||||||
package com.evo.equipment.service.impl;
|
package com.evo.equipment.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.evo.common.constant.Constants;
|
import com.evo.common.constant.Constants;
|
||||||
import com.evo.common.core.domain.AjaxResult;
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
import com.evo.common.utils.DateUtils;
|
import com.evo.common.utils.DateUtils;
|
||||||
import com.evo.common.utils.SecurityUtils;
|
import com.evo.common.utils.SecurityUtils;
|
||||||
import com.evo.equipment.domain.EqButton;
|
import com.evo.equipment.domain.EqButton;
|
||||||
import com.evo.equipment.domain.EqSnDetail;
|
import com.evo.equipment.domain.EqSnDetail;
|
||||||
import com.evo.equipment.domain.vo.CwBottonDto;
|
|
||||||
import com.evo.equipment.domain.vo.CwButtonData;
|
|
||||||
import com.evo.equipment.domain.vo.CwButtonVo;
|
|
||||||
import com.evo.equipment.mapper.EqButtonMapper;
|
import com.evo.equipment.mapper.EqButtonMapper;
|
||||||
import com.evo.equipment.mapper.EqSnDetailMapper;
|
|
||||||
import com.evo.equipment.service.IEqButtonService;
|
import com.evo.equipment.service.IEqButtonService;
|
||||||
import com.evo.framework.websocket.WebSocketUsers;
|
import com.evo.equipment.service.IEqSnDetailService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按钮信息Service业务层处理
|
* 按钮信息Service业务层处理
|
||||||
@ -31,7 +27,8 @@ public class EqButtonServiceImpl implements IEqButtonService
|
|||||||
@Resource
|
@Resource
|
||||||
private EqButtonMapper eqButtonMapper;
|
private EqButtonMapper eqButtonMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private EqSnDetailMapper EqSnDetailMapper; //考勤设备
|
private IEqSnDetailService eqSnDetailService; //考勤设备
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询按钮信息
|
* 查询按钮信息
|
||||||
@ -88,41 +85,9 @@ public class EqButtonServiceImpl implements IEqButtonService
|
|||||||
if(i < 1){
|
if(i < 1){
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
//下发按钮到打卡机器 ,获取所有打卡机
|
|
||||||
List<EqSnDetail> sn_list = EqSnDetailMapper.selectEqSnDetailList(null);
|
|
||||||
//获取所有打卡按钮
|
|
||||||
List<EqButton> bt_list = eqButtonMapper.selectEqButtonList(null);
|
|
||||||
//需要返回的对象
|
|
||||||
CwButtonVo cbv = null;
|
|
||||||
//发送的数据
|
|
||||||
CwButtonData cbd = null;
|
|
||||||
//按钮对象
|
|
||||||
CwBottonDto cwBottonDto = null;
|
|
||||||
//按钮集合
|
|
||||||
List<CwBottonDto> list2 = null;
|
|
||||||
for (EqSnDetail snDetail : sn_list) {
|
|
||||||
cbv = new CwButtonVo();
|
|
||||||
cbd = new CwButtonData();
|
|
||||||
list2 = new ArrayList<CwBottonDto>();
|
|
||||||
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
|
||||||
cbv.setCmd("to_device");
|
|
||||||
//无用值,空串
|
|
||||||
cbv.setForm("");
|
|
||||||
//设备号
|
|
||||||
cbv.setTo(snDetail.getSn());
|
|
||||||
//发送的数据
|
|
||||||
cbd.setCmd("setButtons");
|
|
||||||
for (EqButton button : bt_list) {
|
|
||||||
cwBottonDto = new CwBottonDto();
|
|
||||||
cwBottonDto.setIcon(button.getImage());
|
|
||||||
list2.add(cwBottonDto);
|
|
||||||
}
|
|
||||||
cbd.setValue(list2);
|
|
||||||
cbv.setData(cbd);
|
|
||||||
//调用websocket,推送给设备
|
|
||||||
WebSocketUsers.sendMessageToUsersByText(JSONObject.toJSONString(cbv));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//下发按钮到打卡机器 ,获取所有打卡机
|
||||||
|
eqSnDetailService.sendButtons(eqSnDetailService.selectEqSnDetailList(null).stream().map(EqSnDetail::getSn).collect(Collectors.toList()));
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,40 +122,8 @@ public class EqButtonServiceImpl implements IEqButtonService
|
|||||||
if(i < 1){
|
if(i < 1){
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
//下发机器 ,获取所有打卡机
|
//下发按钮到打卡机器 ,获取所有打卡机
|
||||||
List<EqSnDetail> sn_list = EqSnDetailMapper.selectEqSnDetailList(null);
|
eqSnDetailService.sendButtons(eqSnDetailService.selectEqSnDetailList(null).stream().map(EqSnDetail::getSn).collect(Collectors.toList()));
|
||||||
//获取所有打卡按钮
|
|
||||||
List<EqButton> bt_list = eqButtonMapper.selectEqButtonList(null);
|
|
||||||
//需要返回的对象
|
|
||||||
CwButtonVo cbv = null;
|
|
||||||
//发送的数据
|
|
||||||
CwButtonData cbd = null;
|
|
||||||
//按钮对象
|
|
||||||
CwBottonDto cwBottonDto = null;
|
|
||||||
//按钮集合
|
|
||||||
List<CwBottonDto> list2 = null;
|
|
||||||
for (EqSnDetail snDetail : sn_list) {
|
|
||||||
cbv = new CwButtonVo();
|
|
||||||
cbd = new CwButtonData();
|
|
||||||
list2 = new ArrayList<CwBottonDto>();
|
|
||||||
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
|
||||||
cbv.setCmd("to_device");
|
|
||||||
//无用值,空串
|
|
||||||
cbv.setForm("");
|
|
||||||
//设备号
|
|
||||||
cbv.setTo(snDetail.getSn());
|
|
||||||
//发送的数据
|
|
||||||
cbd.setCmd("setButtons");
|
|
||||||
for (EqButton button : bt_list) {
|
|
||||||
cwBottonDto = new CwBottonDto();
|
|
||||||
cwBottonDto.setIcon(button.getImage());
|
|
||||||
list2.add(cwBottonDto);
|
|
||||||
}
|
|
||||||
cbd.setValue(list2);
|
|
||||||
cbv.setData(cbd);
|
|
||||||
//调用websocket,推送给设备
|
|
||||||
WebSocketUsers.sendMessageToUsersByText(JSONObject.toJSONString(cbv));
|
|
||||||
}
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,24 +138,4 @@ public class EqButtonServiceImpl implements IEqButtonService
|
|||||||
return eqButtonMapper.selectEqButtonByName(name);
|
return eqButtonMapper.selectEqButtonByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendButton(EqSnDetail snDetail) {
|
|
||||||
List<EqButton> bt_list = this.eqButtonMapper.selectEqButtonList(null);
|
|
||||||
CwButtonVo cbv = new CwButtonVo();
|
|
||||||
CwButtonData cbd = new CwButtonData();
|
|
||||||
cbv.setCmd("to_device");
|
|
||||||
cbv.setForm("");
|
|
||||||
cbv.setTo(snDetail.getSn());
|
|
||||||
cbd.setCmd("setButtons");
|
|
||||||
CwBottonDto cwBottonDto = null;
|
|
||||||
List<CwBottonDto> list2 = new ArrayList<>();
|
|
||||||
for (EqButton button : bt_list) {
|
|
||||||
cwBottonDto = new CwBottonDto();
|
|
||||||
cwBottonDto.setIcon(button.getImage());
|
|
||||||
list2.add(cwBottonDto);
|
|
||||||
}
|
|
||||||
cbd.setValue(list2);
|
|
||||||
cbv.setData(cbd);
|
|
||||||
WebSocketUsers.sendMessageToUsersByText(JSONObject.toJSONString(cbv, new com.alibaba.fastjson2.JSONWriter.Feature[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,7 +127,7 @@ public class EqImagesServiceImpl implements IEqImagesService
|
|||||||
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
||||||
cau.setExtra("");
|
cau.setExtra("");
|
||||||
//发送的数据
|
//发送的数据
|
||||||
caud.setCmd("addUser");
|
// caud.setCmd("addUser");
|
||||||
caud.setUser_id(eqImages.getUserId()+"");
|
caud.setUser_id(eqImages.getUserId()+"");
|
||||||
caud.setName(eqImages.getStaffName());
|
caud.setName(eqImages.getStaffName());
|
||||||
caud.setTts_name("");
|
caud.setTts_name("");
|
||||||
@ -280,7 +280,7 @@ public class EqImagesServiceImpl implements IEqImagesService
|
|||||||
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
||||||
cau.setExtra("");
|
cau.setExtra("");
|
||||||
//发送的数据
|
//发送的数据
|
||||||
caud.setCmd("addUser");
|
// caud.setCmd("addUser");
|
||||||
caud.setUser_id(row.getCell(0).getNumericCellValue()+"");
|
caud.setUser_id(row.getCell(0).getNumericCellValue()+"");
|
||||||
caud.setName(row.getCell(1).getStringCellValue());
|
caud.setName(row.getCell(1).getStringCellValue());
|
||||||
caud.setTts_name("");
|
caud.setTts_name("");
|
||||||
|
|||||||
@ -1,16 +1,40 @@
|
|||||||
package com.evo.equipment.service.impl;
|
package com.evo.equipment.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.evo.common.constant.Constants;
|
import com.evo.common.constant.Constants;
|
||||||
import com.evo.common.core.domain.AjaxResult;
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
|
import com.evo.common.core.domain.entity.RzUpload;
|
||||||
|
import com.evo.common.exception.WebSocketException;
|
||||||
|
import com.evo.common.utils.Collections;
|
||||||
import com.evo.common.utils.DateUtils;
|
import com.evo.common.utils.DateUtils;
|
||||||
|
import com.evo.common.utils.ParamUtils;
|
||||||
import com.evo.common.utils.StringUtils;
|
import com.evo.common.utils.StringUtils;
|
||||||
|
import com.evo.equipment.domain.EqButton;
|
||||||
import com.evo.equipment.domain.EqSnDetail;
|
import com.evo.equipment.domain.EqSnDetail;
|
||||||
|
import com.evo.equipment.domain.vo.*;
|
||||||
|
import com.evo.equipment.mapper.EqButtonMapper;
|
||||||
import com.evo.equipment.mapper.EqSnDetailMapper;
|
import com.evo.equipment.mapper.EqSnDetailMapper;
|
||||||
import com.evo.equipment.service.IEqSnDetailService;
|
import com.evo.equipment.service.IEqSnDetailService;
|
||||||
|
import com.evo.framework.websocket.WebSocketUsers;
|
||||||
|
import com.evo.personnelMatters.domain.EqOverStaff;
|
||||||
|
import com.evo.personnelMatters.mapper.EqOverStaffMapper;
|
||||||
|
import com.evo.restaurant.domain.RzRestaurantImages;
|
||||||
|
import com.evo.restaurant.mapper.RzRestaurantImagesMapper;
|
||||||
|
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 org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.websocket.Session;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 考勤设备信息Service业务层处理
|
* 考勤设备信息Service业务层处理
|
||||||
@ -19,11 +43,18 @@ import java.util.List;
|
|||||||
* @date 2024-08-07
|
* @date 2024-08-07
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class EqSnDetailServiceImpl implements IEqSnDetailService
|
public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDetail> implements IEqSnDetailService
|
||||||
{
|
{
|
||||||
@Resource
|
@Resource
|
||||||
private EqSnDetailMapper EqSnDetailMapper;
|
private SysStaffMapper sysStaffMapper;
|
||||||
|
@Resource
|
||||||
|
private EqButtonMapper eqButtonMapper;
|
||||||
|
@Resource
|
||||||
|
private RzUploadService rzUploadService;
|
||||||
|
@Resource
|
||||||
|
private RzRestaurantImagesMapper rzRestaurantImagesMapper;
|
||||||
|
@Resource
|
||||||
|
private EqOverStaffMapper eqOverStaffMapper;
|
||||||
/**
|
/**
|
||||||
* 查询考勤设备信息列表
|
* 查询考勤设备信息列表
|
||||||
*
|
*
|
||||||
@ -33,7 +64,7 @@ public class EqSnDetailServiceImpl implements IEqSnDetailService
|
|||||||
@Override
|
@Override
|
||||||
public List<EqSnDetail> selectEqSnDetailList(EqSnDetail EqSnDetail)
|
public List<EqSnDetail> selectEqSnDetailList(EqSnDetail EqSnDetail)
|
||||||
{
|
{
|
||||||
return EqSnDetailMapper.selectEqSnDetailList(EqSnDetail);
|
return getBaseMapper().selectEqSnDetailList(EqSnDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,13 +77,13 @@ public class EqSnDetailServiceImpl implements IEqSnDetailService
|
|||||||
public AjaxResult insertEqSnDetail(EqSnDetail EqSnDetail)
|
public AjaxResult insertEqSnDetail(EqSnDetail EqSnDetail)
|
||||||
{
|
{
|
||||||
//判断设备是否添加
|
//判断设备是否添加
|
||||||
EqSnDetail sbSn = EqSnDetailMapper.selectEqSnDetailBySn(EqSnDetail.getSn());
|
EqSnDetail sbSn = getBaseMapper().selectEqSnDetailBySn(EqSnDetail.getSn());
|
||||||
if(StringUtils.isNotNull(sbSn)){
|
if(StringUtils.isNotNull(sbSn)){
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
EqSnDetail.setCreateTime(DateUtils.getNowDate());
|
EqSnDetail.setCreateTime(DateUtils.getNowDate());
|
||||||
EqSnDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
EqSnDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||||
int i = EqSnDetailMapper.insertEqSnDetail(EqSnDetail);
|
int i = getBaseMapper().insertEqSnDetail(EqSnDetail);
|
||||||
if(i < 1){
|
if(i < 1){
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
@ -69,7 +100,7 @@ public class EqSnDetailServiceImpl implements IEqSnDetailService
|
|||||||
public int updateEqSnDetail(EqSnDetail EqSnDetail)
|
public int updateEqSnDetail(EqSnDetail EqSnDetail)
|
||||||
{
|
{
|
||||||
EqSnDetail.setUpdateTime(DateUtils.getNowDate());
|
EqSnDetail.setUpdateTime(DateUtils.getNowDate());
|
||||||
return EqSnDetailMapper.updateEqSnDetail(EqSnDetail);
|
return getBaseMapper().updateEqSnDetail(EqSnDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,6 +110,176 @@ public class EqSnDetailServiceImpl implements IEqSnDetailService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public EqSnDetail selectEqSnDetailBySn(String sn){
|
public EqSnDetail selectEqSnDetailBySn(String sn){
|
||||||
return EqSnDetailMapper.selectEqSnDetailBySn(sn);
|
return getBaseMapper().selectEqSnDetailBySn(sn);
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<String> tsSn = Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE,com.evo.equipment.constant.Constants.EQ_DEVICE_CODE,com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE);
|
||||||
|
|
||||||
|
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));
|
||||||
|
String url = ParamUtils.getGlobalStaticUrl();
|
||||||
|
for(SysStaff user : userList){
|
||||||
|
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", longRzUploadMap.get(user.getUserId()).getUrl()));
|
||||||
|
}
|
||||||
|
return userPhotoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, List<Map<String, String>>> initTsDkDevice(String deviceSn){
|
||||||
|
Map<String, List<Map<String, String>>> snUserPhotoList = Collections.emptyMap();
|
||||||
|
//如果有且只有一个设备信息, 并且设备信息为公共打卡机, 或者是 食堂打卡机
|
||||||
|
if(tsSn.contains(deviceSn)) {
|
||||||
|
List<Map<String, String>> userPhotoList = Collections.emptyList();
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
//加班打卡机
|
||||||
|
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)));
|
||||||
|
}
|
||||||
|
//如果是下发的食堂打卡机, 则需要查找餐饮人员的数据
|
||||||
|
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.addAll(getPhoto(userList));
|
||||||
|
//装载数据
|
||||||
|
snUserPhotoList.put(deviceSn, userPhotoList);
|
||||||
|
}
|
||||||
|
return snUserPhotoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Session> checkSession(List<String> snList){
|
||||||
|
Map<String, Session> sessionMap = Collections.emptyMap();
|
||||||
|
List<EqSnDetail> deviceList = getBaseMapper().selectList(new LambdaQueryWrapper<EqSnDetail>().in(EqSnDetail::getSn, snList));
|
||||||
|
StringBuilder errorMsg = new StringBuilder("");
|
||||||
|
List<EqSnDetail> loseDeviceList = Collections.emptyList();
|
||||||
|
for (EqSnDetail device : deviceList){
|
||||||
|
if(!WebSocketUsers.getUsers().containsKey(device.getSessionId())){
|
||||||
|
errorMsg.append("设备"+device.getSn()+"已经失去连接;");
|
||||||
|
device.setType("连接已断开");
|
||||||
|
loseDeviceList.add(device);
|
||||||
|
}
|
||||||
|
sessionMap.put(device.getSn(), WebSocketUsers.getUsers().get(device.getSessionId()));
|
||||||
|
}
|
||||||
|
if(Collections.isNotEmpty(loseDeviceList)){
|
||||||
|
updateBatchById(loseDeviceList);
|
||||||
|
throw new WebSocketException(errorMsg.toString());
|
||||||
|
}
|
||||||
|
return sessionMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean sendPhoto(List<String> snList, List<Map<String, String>> userPhotoList) {
|
||||||
|
//检查设备是否在链接状态
|
||||||
|
Map<String, Session> sessionMap = checkSession(snList);
|
||||||
|
|
||||||
|
Map<String, List<Map<String, String>>> snUserPhotoList = Collections.emptyMap();
|
||||||
|
if(Collections.isEmpty(userPhotoList)){
|
||||||
|
//如果有且只有一个设备信息, 并且设备信息为公共打卡机, 或者是 食堂打卡机
|
||||||
|
if(snList.size() ==1 && tsSn.contains(snList.get(0))){
|
||||||
|
snUserPhotoList.putAll(initTsDkDevice(snList.get(0)));
|
||||||
|
}else{
|
||||||
|
|
||||||
|
List<String> tsDeviceSn = Collections.findDuplicatesList(snList, tsSn);
|
||||||
|
//所有所有不是特殊打卡机人员信息
|
||||||
|
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)));
|
||||||
|
snUserPhotoList.put(sn, getPhoto(userList));
|
||||||
|
});
|
||||||
|
//装载特殊的打卡机
|
||||||
|
if(Collections.isNotEmpty(tsDeviceSn)){
|
||||||
|
for (String ts : tsDeviceSn){
|
||||||
|
snUserPhotoList.putAll(initTsDkDevice(ts));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//如果userPhotoList参数存在, 则每个sn设备都需要下发
|
||||||
|
snList.forEach(sn ->{
|
||||||
|
snUserPhotoList.put(sn, userPhotoList);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送数据的类型
|
||||||
|
StaffDto cau = new StaffDto();
|
||||||
|
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
||||||
|
cau.setCmd("to_device");
|
||||||
|
//无用值,空串
|
||||||
|
cau.setForm("");
|
||||||
|
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
||||||
|
cau.setExtra("");
|
||||||
|
|
||||||
|
//发送的具体Data
|
||||||
|
StaffData caud = new StaffData();
|
||||||
|
caud.setCmd("addUser");
|
||||||
|
caud.setTts_name("");
|
||||||
|
caud.setEffect_time("");
|
||||||
|
caud.setId_valid("");
|
||||||
|
caud.setIc("");
|
||||||
|
caud.setPhone("");
|
||||||
|
caud.setMode(0);
|
||||||
|
|
||||||
|
//循环发送信息照片信息
|
||||||
|
for (String sn : snList) {
|
||||||
|
//设备号
|
||||||
|
cau.setTo(sn);
|
||||||
|
//组装主要的下发信息
|
||||||
|
for(Map<String, String> userPhoto : snUserPhotoList.get(sn)){
|
||||||
|
caud.setUser_id(userPhoto.get("userId"));
|
||||||
|
caud.setName(userPhoto.get("name"));
|
||||||
|
caud.setFace_template(userPhoto.get("photoUrl"));
|
||||||
|
//循环替换属性
|
||||||
|
cau.setData(caud);
|
||||||
|
//调用websocket,推送给设备
|
||||||
|
WebSocketUsers.sendMessageToUserByText(sessionMap.get(sn), JSONObject.toJSONString(cau));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean sendButtons(List<String> snList) {
|
||||||
|
Map<String, Session> sessionMap = checkSession(snList);
|
||||||
|
|
||||||
|
List<EqButton> bt_list = this.eqButtonMapper.selectEqButtonList(null);
|
||||||
|
CwButtonVo cbv = new CwButtonVo();
|
||||||
|
CwButtonData cbd = new CwButtonData();
|
||||||
|
cbv.setCmd("to_device");
|
||||||
|
cbv.setForm("");
|
||||||
|
cbd.setCmd("setButtons");
|
||||||
|
CwBottonDto cwBottonDto = null;
|
||||||
|
List<CwBottonDto> list2 = new ArrayList<>();
|
||||||
|
for (EqButton button : bt_list) {
|
||||||
|
cwBottonDto = new CwBottonDto();
|
||||||
|
cwBottonDto.setIcon(button.getImage());
|
||||||
|
list2.add(cwBottonDto);
|
||||||
|
}
|
||||||
|
cbd.setValue(list2);
|
||||||
|
cbv.setData(cbd);
|
||||||
|
for(String sn : snList){
|
||||||
|
cbv.setTo(sn);
|
||||||
|
WebSocketUsers.sendMessageToUserByText(sessionMap.get(sn), JSONObject.toJSONString(cbv, new com.alibaba.fastjson2.JSONWriter.Feature[0]));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkDevice() {
|
||||||
|
List<String> sessionIds = WebSocketUsers.getUsers().keySet().stream().collect(Collectors.toList());
|
||||||
|
update(new UpdateWrapper<EqSnDetail>().set("type","连接已断开").notIn(Collections.isNotEmpty(sessionIds), "session_id", sessionIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.evo.framework.web.exception;
|
package com.evo.framework.web.exception;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import com.evo.common.exception.WebSocketException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
@ -18,6 +20,7 @@ import com.evo.common.exception.DemoModeException;
|
|||||||
import com.evo.common.exception.ServiceException;
|
import com.evo.common.exception.ServiceException;
|
||||||
import com.evo.common.utils.StringUtils;
|
import com.evo.common.utils.StringUtils;
|
||||||
import com.evo.common.utils.html.EscapeUtil;
|
import com.evo.common.utils.html.EscapeUtil;
|
||||||
|
import org.springframework.web.socket.WebSocketExtension;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局异常处理器
|
* 全局异常处理器
|
||||||
@ -142,4 +145,13 @@ public class GlobalExceptionHandler
|
|||||||
{
|
{
|
||||||
return AjaxResult.error("演示模式,不允许操作");
|
return AjaxResult.error("演示模式,不允许操作");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ExceptionHandler(WebSocketException.class)
|
||||||
|
public AjaxResult handleWebSocketExtension(WebSocketException e)
|
||||||
|
{
|
||||||
|
return AjaxResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package com.evo.framework.websocket;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.evo.common.constant.Constants;
|
import com.evo.common.constant.Constants;
|
||||||
|
import com.evo.common.utils.Collections;
|
||||||
|
import com.evo.common.utils.StringUtils;
|
||||||
import com.evo.equipment.domain.EqSnDetail;
|
import com.evo.equipment.domain.EqSnDetail;
|
||||||
import com.evo.equipment.service.IEqButtonService;
|
import com.evo.equipment.service.IEqButtonService;
|
||||||
import com.evo.equipment.service.IEqSnDetailService;
|
import com.evo.equipment.service.IEqSnDetailService;
|
||||||
@ -10,6 +12,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.websocket.*;
|
import javax.websocket.*;
|
||||||
import javax.websocket.server.ServerEndpoint;
|
import javax.websocket.server.ServerEndpoint;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -27,9 +31,7 @@ public class WebSocketServer{
|
|||||||
|
|
||||||
private static IEqSnDetailService snDetailService;
|
private static IEqSnDetailService snDetailService;
|
||||||
|
|
||||||
private static IEqButtonService qButtonService;
|
@Resource
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public void setBrandService(IEqSnDetailService snDetailService) {
|
public void setBrandService(IEqSnDetailService snDetailService) {
|
||||||
WebSocketServer.snDetailService = snDetailService;
|
WebSocketServer.snDetailService = snDetailService;
|
||||||
}
|
}
|
||||||
@ -133,36 +135,36 @@ public class WebSocketServer{
|
|||||||
String timestamp = jsonObject.getString("timestamp");
|
String timestamp = jsonObject.getString("timestamp");
|
||||||
//根据设备号查询
|
//根据设备号查询
|
||||||
EqSnDetail snDetail = snDetailService.selectEqSnDetailBySn(sn);
|
EqSnDetail snDetail = snDetailService.selectEqSnDetailBySn(sn);
|
||||||
|
//不存在设备信息
|
||||||
|
if(snDetail == null){
|
||||||
|
//说明没有添加过此设备,添加
|
||||||
|
snDetail = new EqSnDetail();
|
||||||
|
//设备号
|
||||||
|
snDetail.setSn(sn);
|
||||||
|
snDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||||
|
}
|
||||||
//格式化时间
|
//格式化时间
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if(null != timestamp){
|
if(StringUtils.isNotEmpty(timestamp)){
|
||||||
date.setTime(Long.valueOf(timestamp)*1000);
|
date.setTime(Long.valueOf(timestamp)*1000);
|
||||||
}
|
}
|
||||||
if(null != snDetail){
|
//说明添加过此设备,修改
|
||||||
//说明添加过此设备,修改
|
snDetail.setVersionCode(version_code);
|
||||||
snDetail.setVersionCode(version_code);
|
snDetail.setVersionName(version_name);
|
||||||
snDetail.setVersionName(version_name);
|
snDetail.setIp(ip);
|
||||||
snDetail.setIp(ip);
|
snDetail.setSessionId(session.getId());
|
||||||
snDetail.setSnTime(date);
|
snDetail.setSnTime(date);
|
||||||
snDetail.setType("已连接");
|
snDetail.setType("已连接");
|
||||||
|
|
||||||
|
if(null != snDetail.getId()){
|
||||||
//修改
|
//修改
|
||||||
snDetailService.updateEqSnDetail(snDetail);
|
snDetailService.updateEqSnDetail(snDetail);
|
||||||
}else{
|
}else{
|
||||||
//说明没有添加过此设备,添加
|
|
||||||
snDetail = new EqSnDetail();
|
|
||||||
//设备号
|
|
||||||
snDetail.setSn(sn);
|
|
||||||
snDetail.setVersionCode(version_code);
|
|
||||||
snDetail.setVersionName(version_name);
|
|
||||||
snDetail.setIp(ip);
|
|
||||||
snDetail.setSnTime(date);
|
|
||||||
snDetail.setType("已连接");
|
|
||||||
snDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
|
||||||
//添加
|
//添加
|
||||||
snDetailService.insertEqSnDetail(snDetail);
|
snDetailService.insertEqSnDetail(snDetail);
|
||||||
}
|
}
|
||||||
qButtonService.sendButton(snDetail);
|
//发送设备按钮信息
|
||||||
|
snDetailService.sendButtons(Collections.asList(snDetail.getSn()));
|
||||||
}else{
|
}else{
|
||||||
//接受设备端返回的数据,先不做处理
|
//接受设备端返回的数据,先不做处理
|
||||||
System.out.println("设备返回信息:"+message);
|
System.out.println("设备返回信息:"+message);
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.evo.framework.websocket;
|
package com.evo.framework.websocket;
|
||||||
|
|
||||||
|
import com.evo.common.exception.WebSocketException;
|
||||||
|
import com.evo.common.utils.Collections;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -102,6 +104,9 @@ public class WebSocketUsers
|
|||||||
*/
|
*/
|
||||||
public static void sendMessageToUsersByText(String message){
|
public static void sendMessageToUsersByText(String message){
|
||||||
Collection<Session> values = USERS.values();
|
Collection<Session> values = USERS.values();
|
||||||
|
if(Collections.isEmpty(values)){
|
||||||
|
throw new WebSocketException("当前没有任何设备在线");
|
||||||
|
}
|
||||||
for (Session value : values){
|
for (Session value : values){
|
||||||
sendMessageToUserByText(value, message);
|
sendMessageToUserByText(value, message);
|
||||||
}
|
}
|
||||||
@ -130,6 +135,7 @@ public class WebSocketUsers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOGGER.info("\n[你已离线]");
|
LOGGER.info("\n[你已离线]");
|
||||||
|
throw new WebSocketException("当前设备已离线");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,7 +138,7 @@ public class SpecialOverTimeController extends BaseController {
|
|||||||
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
||||||
cau.setExtra("");
|
cau.setExtra("");
|
||||||
//发送的数据
|
//发送的数据
|
||||||
caud.setCmd("addUser");
|
// caud.setCmd("addUser");
|
||||||
caud.setUser_id(eqOverStaff.getUserId().toString());
|
caud.setUser_id(eqOverStaff.getUserId().toString());
|
||||||
caud.setName(eqOverStaff.getStaffName());
|
caud.setName(eqOverStaff.getStaffName());
|
||||||
caud.setTts_name("");
|
caud.setTts_name("");
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
package com.evo.personnelMatters.mapper;
|
package com.evo.personnelMatters.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evo.personnelMatters.domain.SpecialOverTime;
|
import com.evo.personnelMatters.domain.SpecialOverTime;
|
||||||
|
|
||||||
public interface BsOverTimeMapper {
|
public interface BsOverTimeMapper extends BaseMapper<SpecialOverTime> {
|
||||||
|
|
||||||
public int updateSpecialOverTime(SpecialOverTime specialOverTime);
|
public int updateSpecialOverTime(SpecialOverTime specialOverTime);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evo.personnelMatters.mapper;
|
package com.evo.personnelMatters.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evo.personnelMatters.domain.EqOverStaff;
|
import com.evo.personnelMatters.domain.EqOverStaff;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ import java.util.List;
|
|||||||
* @author evo
|
* @author evo
|
||||||
* @date 2025-04-17
|
* @date 2025-04-17
|
||||||
*/
|
*/
|
||||||
public interface EqOverStaffMapper
|
public interface EqOverStaffMapper extends BaseMapper<EqOverStaff>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询照片管理
|
* 查询照片管理
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
package com.evo.personnelMatters.service;
|
package com.evo.personnelMatters.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.evo.common.core.domain.AjaxResult;
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
import com.evo.personnelMatters.domain.EqOverStaff;
|
import com.evo.personnelMatters.domain.EqOverStaff;
|
||||||
import com.evo.personnelMatters.domain.SpecialOverTime;
|
import com.evo.personnelMatters.domain.SpecialOverTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface SpecialOverTimeService {
|
public interface SpecialOverTimeService extends IService<SpecialOverTime> {
|
||||||
|
|
||||||
public SpecialOverTime selectSpecialOverTimeById();
|
public SpecialOverTime selectSpecialOverTimeById();
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evo.personnelMatters.service.impl;
|
package com.evo.personnelMatters.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.evo.common.core.domain.AjaxResult;
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
import com.evo.common.utils.SecurityUtils;
|
import com.evo.common.utils.SecurityUtils;
|
||||||
import com.evo.personnelMatters.domain.EqOverStaff;
|
import com.evo.personnelMatters.domain.EqOverStaff;
|
||||||
@ -13,21 +14,19 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SpecialOverTimeServiceImpl implements SpecialOverTimeService {
|
public class SpecialOverTimeServiceImpl extends ServiceImpl<BsOverTimeMapper, SpecialOverTime> implements SpecialOverTimeService {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BsOverTimeMapper bsOverTimeMapper;
|
|
||||||
@Resource
|
@Resource
|
||||||
private EqOverStaffMapper eqOverStaffMapper;
|
private EqOverStaffMapper eqOverStaffMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SpecialOverTime selectSpecialOverTimeById(){
|
public SpecialOverTime selectSpecialOverTimeById(){
|
||||||
return bsOverTimeMapper.selectSpecialOverTimeById();
|
return getBaseMapper().selectSpecialOverTimeById();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult addSpecialOverTime(SpecialOverTime specialOverTime){
|
public AjaxResult addSpecialOverTime(SpecialOverTime specialOverTime){
|
||||||
int i = bsOverTimeMapper.updateSpecialOverTime(specialOverTime);
|
int i = getBaseMapper().updateSpecialOverTime(specialOverTime);
|
||||||
if(i < 1){
|
if(i < 1){
|
||||||
return AjaxResult.error("保存失败");
|
return AjaxResult.error("保存失败");
|
||||||
}
|
}
|
||||||
@ -60,6 +59,7 @@ public class SpecialOverTimeServiceImpl implements SpecialOverTimeService {
|
|||||||
@Override
|
@Override
|
||||||
public int insertEqOverStaff(EqOverStaff eqOverStaff)
|
public int insertEqOverStaff(EqOverStaff eqOverStaff)
|
||||||
{
|
{
|
||||||
|
|
||||||
eqOverStaff.setCreateBy(SecurityUtils.getUsername());
|
eqOverStaff.setCreateBy(SecurityUtils.getUsername());
|
||||||
eqOverStaff.setCreateTime(new Date());
|
eqOverStaff.setCreateTime(new Date());
|
||||||
eqOverStaff.setDelFlag("0");
|
eqOverStaff.setDelFlag("0");
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evo.restaurant.mapper;
|
package com.evo.restaurant.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evo.restaurant.domain.RzRestaurantImages;
|
import com.evo.restaurant.domain.RzRestaurantImages;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -10,7 +11,7 @@ import java.util.List;
|
|||||||
* @author chenyj
|
* @author chenyj
|
||||||
* @date 2024-10-25
|
* @date 2024-10-25
|
||||||
*/
|
*/
|
||||||
public interface RzRestaurantImagesMapper
|
public interface RzRestaurantImagesMapper extends BaseMapper<RzRestaurantImages>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询餐饮照片管理
|
* 查询餐饮照片管理
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evo.restaurant.service;
|
package com.evo.restaurant.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.evo.common.core.domain.AjaxResult;
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
import com.evo.restaurant.domain.RzRestaurantImages;
|
import com.evo.restaurant.domain.RzRestaurantImages;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@ -12,7 +13,7 @@ import java.util.List;
|
|||||||
* @author chenyj
|
* @author chenyj
|
||||||
* @date 2024-10-25
|
* @date 2024-10-25
|
||||||
*/
|
*/
|
||||||
public interface IRzRestaurantImagesService
|
public interface IRzRestaurantImagesService extends IService<RzRestaurantImages>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询餐饮照片管理列表
|
* 查询餐饮照片管理列表
|
||||||
|
|||||||
@ -1,13 +1,16 @@
|
|||||||
package com.evo.restaurant.service.impl;
|
package com.evo.restaurant.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.evo.common.constant.Constants;
|
import com.evo.common.constant.Constants;
|
||||||
import com.evo.common.core.domain.AjaxResult;
|
import com.evo.common.core.domain.AjaxResult;
|
||||||
|
import com.evo.common.utils.Collections;
|
||||||
import com.evo.common.utils.DateUtils;
|
import com.evo.common.utils.DateUtils;
|
||||||
import com.evo.common.utils.SecurityUtils;
|
import com.evo.common.utils.SecurityUtils;
|
||||||
import com.evo.common.utils.StringUtils;
|
import com.evo.common.utils.StringUtils;
|
||||||
import com.evo.equipment.domain.vo.StaffData;
|
import com.evo.equipment.domain.vo.StaffData;
|
||||||
import com.evo.equipment.domain.vo.StaffDto;
|
import com.evo.equipment.domain.vo.StaffDto;
|
||||||
|
import com.evo.equipment.service.IEqSnDetailService;
|
||||||
import com.evo.framework.websocket.WebSocketUsers;
|
import com.evo.framework.websocket.WebSocketUsers;
|
||||||
import com.evo.restaurant.domain.RzRestaurantImages;
|
import com.evo.restaurant.domain.RzRestaurantImages;
|
||||||
import com.evo.restaurant.domain.RzRestaurantStatistics;
|
import com.evo.restaurant.domain.RzRestaurantStatistics;
|
||||||
@ -31,13 +34,12 @@ import java.util.List;
|
|||||||
* @date 2024-10-25
|
* @date 2024-10-25
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class RzRestaurantImagesServiceImpl implements IRzRestaurantImagesService
|
public class RzRestaurantImagesServiceImpl extends ServiceImpl<RzRestaurantImagesMapper, RzRestaurantImages> implements IRzRestaurantImagesService
|
||||||
{
|
{
|
||||||
@Resource
|
|
||||||
private RzRestaurantImagesMapper rzRestaurantImagesMapper;
|
|
||||||
@Resource
|
@Resource
|
||||||
private RzRestaurantStatisticsMapper rzRestaurantStatisticsMapper; //餐饮统计
|
private RzRestaurantStatisticsMapper rzRestaurantStatisticsMapper; //餐饮统计
|
||||||
|
@Resource
|
||||||
|
private IEqSnDetailService eqSnDetailService;//餐饮统计
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询餐饮照片管理列表
|
* 查询餐饮照片管理列表
|
||||||
@ -48,7 +50,7 @@ public class RzRestaurantImagesServiceImpl implements IRzRestaurantImagesService
|
|||||||
@Override
|
@Override
|
||||||
public List<RzRestaurantImages> selectRzRestaurantImagesList(RzRestaurantImages rzRestaurantImages)
|
public List<RzRestaurantImages> selectRzRestaurantImagesList(RzRestaurantImages rzRestaurantImages)
|
||||||
{
|
{
|
||||||
return rzRestaurantImagesMapper.selectRzRestaurantImagesList(rzRestaurantImages);
|
return getBaseMapper().selectRzRestaurantImagesList(rzRestaurantImages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,7 +63,7 @@ public class RzRestaurantImagesServiceImpl implements IRzRestaurantImagesService
|
|||||||
public int deleteRzRestaurantImagesById(Long id)
|
public int deleteRzRestaurantImagesById(Long id)
|
||||||
{
|
{
|
||||||
//根据id查询信息
|
//根据id查询信息
|
||||||
RzRestaurantImages rzRestaurantImages = rzRestaurantImagesMapper.selectRzRestaurantImagesById(id);
|
RzRestaurantImages rzRestaurantImages = getBaseMapper().selectRzRestaurantImagesById(id);
|
||||||
//删除打卡机照片
|
//删除打卡机照片
|
||||||
String message = "";
|
String message = "";
|
||||||
//需要返回的对象
|
//需要返回的对象
|
||||||
@ -92,7 +94,7 @@ public class RzRestaurantImagesServiceImpl implements IRzRestaurantImagesService
|
|||||||
rzRestaurantImages.setDelFlag(Constants.DELETE_FLAG_1);
|
rzRestaurantImages.setDelFlag(Constants.DELETE_FLAG_1);
|
||||||
rzRestaurantImages.setUpdateTime(new Date());
|
rzRestaurantImages.setUpdateTime(new Date());
|
||||||
rzRestaurantImages.setUpdateBy(SecurityUtils.getUsername());
|
rzRestaurantImages.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return rzRestaurantImagesMapper.updateRzRestaurantImages(rzRestaurantImages);
|
return getBaseMapper().updateRzRestaurantImages(rzRestaurantImages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -150,7 +152,7 @@ public class RzRestaurantImagesServiceImpl implements IRzRestaurantImagesService
|
|||||||
rzRestaurantImages.setCreateBy(SecurityUtils.getUsername());
|
rzRestaurantImages.setCreateBy(SecurityUtils.getUsername());
|
||||||
rzRestaurantImages.setCreateTime(DateUtils.getNowDate());
|
rzRestaurantImages.setCreateTime(DateUtils.getNowDate());
|
||||||
rzRestaurantImages.setDelFlag(Constants.DELETE_FLAG_0);
|
rzRestaurantImages.setDelFlag(Constants.DELETE_FLAG_0);
|
||||||
int i = rzRestaurantImagesMapper.insertRzRestaurantImages(rzRestaurantImages);
|
int i = getBaseMapper().insertRzRestaurantImages(rzRestaurantImages);
|
||||||
if(i < 1){
|
if(i < 1){
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
@ -166,34 +168,8 @@ public class RzRestaurantImagesServiceImpl implements IRzRestaurantImagesService
|
|||||||
if(i < 1){
|
if(i < 1){
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
/** 上传打卡机 */
|
//下发照片
|
||||||
//需要返回的对象
|
eqSnDetailService.sendPhoto(Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE), Collections.asList(Collections.asMap("userId", String.valueOf(rzRestaurantImages.getId()), "name", name, "photoUrl", com.evo.equipment.constant.Constants.STAFF_IMAGE_URL+originalFilename)));
|
||||||
StaffDto cau = new StaffDto();
|
|
||||||
//发送的数据
|
|
||||||
StaffData caud = new StaffData();
|
|
||||||
//指定打卡机传输照片
|
|
||||||
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
|
||||||
cau.setCmd("to_device");
|
|
||||||
//无用值,空串
|
|
||||||
cau.setForm("");
|
|
||||||
//设备号
|
|
||||||
cau.setTo(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE);
|
|
||||||
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
|
||||||
cau.setExtra("");
|
|
||||||
//发送的数据
|
|
||||||
caud.setCmd("addUser");
|
|
||||||
caud.setUser_id(rzRestaurantImages.getId().toString());
|
|
||||||
caud.setName(name);
|
|
||||||
caud.setTts_name("");
|
|
||||||
caud.setFace_template(com.evo.equipment.constant.Constants.STAFF_IMAGE_URL+originalFilename);
|
|
||||||
caud.setEffect_time("");
|
|
||||||
caud.setId_valid("");
|
|
||||||
caud.setIc("");
|
|
||||||
caud.setPhone("");
|
|
||||||
caud.setMode(0);
|
|
||||||
cau.setData(caud);
|
|
||||||
//调用websocket,推送给设备
|
|
||||||
WebSocketUsers.sendMessageToUsersByText(JSONObject.toJSONString(cau));
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,11 +6,15 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.evo.attendance.domain.RzSysParam;
|
||||||
|
import com.evo.attendance.service.IRzSysParamService;
|
||||||
import com.evo.common.annotation.Anonymous;
|
import com.evo.common.annotation.Anonymous;
|
||||||
import com.evo.common.core.domain.entity.RzUpload;
|
import com.evo.common.core.domain.entity.RzUpload;
|
||||||
|
import com.evo.common.utils.ParamUtils;
|
||||||
import com.evo.common.utils.ip.IpUtils;
|
import com.evo.common.utils.ip.IpUtils;
|
||||||
import com.evo.system.service.RzUploadService;
|
import com.evo.system.service.RzUploadService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -42,6 +46,8 @@ public class CommonController
|
|||||||
private ServerConfig serverConfig;
|
private ServerConfig serverConfig;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RzUploadService rzUploadService;
|
private RzUploadService rzUploadService;
|
||||||
|
@Resource
|
||||||
|
private IRzSysParamService paramService;
|
||||||
|
|
||||||
private static final String FILE_DELIMETER = ",";
|
private static final String FILE_DELIMETER = ",";
|
||||||
|
|
||||||
@ -87,7 +93,7 @@ public class CommonController
|
|||||||
String filePath = EvoConfig.getUploadPath();
|
String filePath = EvoConfig.getUploadPath();
|
||||||
// 上传并返回新文件名称
|
// 上传并返回新文件名称
|
||||||
String fileName = FileUploadUtils.upload(filePath, file);
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
String url = serverConfig.getUrl() + fileName;
|
String url = ParamUtils.getGlobalStaticUrl() + fileName;
|
||||||
RzUpload upload = new RzUpload();
|
RzUpload upload = new RzUpload();
|
||||||
upload.setType(type);
|
upload.setType(type);
|
||||||
upload.setUrl(url);
|
upload.setUrl(url);
|
||||||
|
|||||||
@ -35,4 +35,12 @@ public interface RzUploadService
|
|||||||
*/
|
*/
|
||||||
public int updateUploadBusinessId(RzUpload upload);
|
public int updateUploadBusinessId(RzUpload upload);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 根据业务ID和类型, 获取数据信息
|
||||||
|
* @param businessIds 业务ID
|
||||||
|
* @param type 类型: 头像: avatar
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<RzUpload> selectListByBusinessIdAndyType(List<Long> businessIds, String type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evo.system.service.impl;
|
package com.evo.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.evo.common.annotation.DataScope;
|
import com.evo.common.annotation.DataScope;
|
||||||
import com.evo.common.constant.UserConstants;
|
import com.evo.common.constant.UserConstants;
|
||||||
@ -60,9 +61,14 @@ public class RzUploadServiceImpl extends ServiceImpl<RzUploadMapper, RzUpload> i
|
|||||||
public int updateUploadBusinessId(RzUpload upload)
|
public int updateUploadBusinessId(RzUpload upload)
|
||||||
{
|
{
|
||||||
getBaseMapper().updateUploadBusinessId(upload);
|
getBaseMapper().updateUploadBusinessId(upload);
|
||||||
upload.setValid("valid");
|
upload.setValid("invalid");
|
||||||
getBaseMapper().updateUploadValidByBusinessId(upload);
|
getBaseMapper().updateUploadValidByBusinessId(upload);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RzUpload> selectListByBusinessIdAndyType(List<Long> businessIds, String type) {
|
||||||
|
return getBaseMapper().selectList(new LambdaQueryWrapper<RzUpload>().in(RzUpload::getBusinessId, businessIds).eq(RzUpload::getType,type).eq(RzUpload::getValid,"valid").orderByDesc(RzUpload::getUploadTime));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +1,5 @@
|
|||||||
package com.evo.system.service.impl;
|
package com.evo.system.service.impl;
|
||||||
|
|
||||||
import java.io.BufferedOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.Period;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.evo.attendance.domain.RzAttendance;
|
import com.evo.attendance.domain.RzAttendance;
|
||||||
@ -31,14 +17,9 @@ import com.evo.common.utils.DateUtils;
|
|||||||
import com.evo.common.utils.SecurityUtils;
|
import com.evo.common.utils.SecurityUtils;
|
||||||
import com.evo.common.utils.StringUtils;
|
import com.evo.common.utils.StringUtils;
|
||||||
import com.evo.common.utils.bean.BeanUtils;
|
import com.evo.common.utils.bean.BeanUtils;
|
||||||
import com.evo.common.utils.ip.IpUtils;
|
import com.evo.equipment.service.IEqSnDetailService;
|
||||||
import com.evo.equipment.domain.vo.StaffData;
|
|
||||||
import com.evo.equipment.domain.vo.StaffDto;
|
|
||||||
import com.evo.framework.websocket.WebSocketUsers;
|
|
||||||
import com.evo.personnelMatters.domain.RzHoliday;
|
import com.evo.personnelMatters.domain.RzHoliday;
|
||||||
import com.evo.personnelMatters.domain.RzSubsidy;
|
|
||||||
import com.evo.personnelMatters.mapper.RzHolidayMapper;
|
import com.evo.personnelMatters.mapper.RzHolidayMapper;
|
||||||
import com.evo.personnelMatters.mapper.RzSubsidyMapper;
|
|
||||||
import com.evo.restaurant.domain.RzRestaurantStatistics;
|
import com.evo.restaurant.domain.RzRestaurantStatistics;
|
||||||
import com.evo.restaurant.mapper.RzRestaurantStatisticsMapper;
|
import com.evo.restaurant.mapper.RzRestaurantStatisticsMapper;
|
||||||
import com.evo.system.domain.SysStaff;
|
import com.evo.system.domain.SysStaff;
|
||||||
@ -61,7 +42,19 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工管理Service业务层处理
|
* 员工管理Service业务层处理
|
||||||
@ -80,8 +73,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
@Resource
|
@Resource
|
||||||
private SysDeptMapper deptMapper; //部门信息
|
private SysDeptMapper deptMapper; //部门信息
|
||||||
@Resource
|
@Resource
|
||||||
private RzSubsidyMapper rzSubsidyMapper; //补助信息
|
|
||||||
@Resource
|
|
||||||
private RzAttendanceStatisticalMapper rzAttendanceStatisticalMapper; //考勤统计
|
private RzAttendanceStatisticalMapper rzAttendanceStatisticalMapper; //考勤统计
|
||||||
@Resource
|
@Resource
|
||||||
private RzAttendanceMapper rzAttendanceMapper; //打卡记录
|
private RzAttendanceMapper rzAttendanceMapper; //打卡记录
|
||||||
@ -91,8 +82,8 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
private RzRestaurantStatisticsMapper rzRestaurantStatisticsMapper; //餐饮统计
|
private RzRestaurantStatisticsMapper rzRestaurantStatisticsMapper; //餐饮统计
|
||||||
@Resource
|
@Resource
|
||||||
private RzUploadService rzUploadService;//餐饮统计
|
private RzUploadService rzUploadService;//餐饮统计
|
||||||
@Resource
|
@Resource
|
||||||
private SysStaffMapper sysStaffMapper;
|
private IEqSnDetailService eqSnDetailService;//餐饮统计
|
||||||
/**
|
/**
|
||||||
* 查询员工管理
|
* 查询员工管理
|
||||||
*
|
*
|
||||||
@ -119,9 +110,9 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
public List<SysStaff> selectSysStaffList(SysStaff sysStaff)
|
public List<SysStaff> selectSysStaffList(SysStaff sysStaff)
|
||||||
{
|
{
|
||||||
List<SysStaff> res_list = getBaseMapper().selectSysStaffList(sysStaff);
|
List<SysStaff> res_list = getBaseMapper().selectSysStaffList(sysStaff);
|
||||||
for (SysStaff staff : res_list) {
|
// for (SysStaff staff : res_list) {
|
||||||
staff.setDeptName(deptMapper.selectDeptById(staff.getDeptId()).getDeptName());
|
// staff.setDeptName(deptMapper.selectDeptById(staff.getDeptId()).getDeptName());
|
||||||
}
|
// }
|
||||||
return res_list;
|
return res_list;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -194,45 +185,15 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("处理上传照片信息出现错误", e);
|
log.error("处理上传照片信息出现错误", e);
|
||||||
}
|
}
|
||||||
/** 上传打卡机 */
|
List<String> dkj_list = new ArrayList<String>();
|
||||||
//需要返回的对象
|
// dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE); //食堂
|
||||||
StaffDto cau = new StaffDto();
|
// dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE); //公共
|
||||||
//发送的数据
|
|
||||||
StaffData caud = new StaffData();
|
|
||||||
//定义公共打卡机
|
|
||||||
List<String> dkj_list = new ArrayList<String>();
|
|
||||||
dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE); //食堂
|
|
||||||
dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE); //公共
|
|
||||||
dkj_list.add(sysStaff.getTimeClock());
|
dkj_list.add(sysStaff.getTimeClock());
|
||||||
|
//下发照片
|
||||||
for (String s : dkj_list) {
|
eqSnDetailService.sendPhoto(dkj_list, Collections.asList(Collections.asMap("userId", String.valueOf(sysStaff.getUserId()), "name", sysStaff.getName(), "photoUrl", com.evo.equipment.constant.Constants.STAFF_IMAGE_URL_OVER_TIME+upload.getFileName())));
|
||||||
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
|
||||||
cau.setCmd("to_device");
|
|
||||||
//无用值,空串
|
|
||||||
cau.setForm("");
|
|
||||||
//设备号
|
|
||||||
cau.setTo(s);
|
|
||||||
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
|
||||||
cau.setExtra("");
|
|
||||||
//发送的数据
|
|
||||||
caud.setCmd("addUser");
|
|
||||||
caud.setUser_id(sysStaff.getUserId()+"");
|
|
||||||
caud.setName(sysStaff.getName());
|
|
||||||
caud.setTts_name("");
|
|
||||||
caud.setFace_template(IpUtils.getServerUrl()+ upload.getFileName());
|
|
||||||
caud.setEffect_time("");
|
|
||||||
caud.setId_valid("");
|
|
||||||
caud.setIc("");
|
|
||||||
caud.setPhone("");
|
|
||||||
caud.setMode(0);
|
|
||||||
cau.setData(caud);
|
|
||||||
//调用websocket,推送给设备
|
|
||||||
WebSocketUsers.sendMessageToUsersByText(JSONObject.toJSONString(cau));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建员工详情信息
|
* 创建员工详情信息
|
||||||
* @param sysStaff
|
* @param sysStaff
|
||||||
@ -486,6 +447,8 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
createRzAttendance(sysStaff, getMonthAndDays());
|
createRzAttendance(sysStaff, getMonthAndDays());
|
||||||
//餐饮统计
|
//餐饮统计
|
||||||
createRestaurantStatistics(sysStaff);
|
createRestaurantStatistics(sysStaff);
|
||||||
|
//处理考勤机相关信息
|
||||||
|
initCheckDevice(sysStaff);
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@ -1021,6 +984,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
LambdaQueryWrapper<SysStaff> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysStaff> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(SysStaff::getName,employeeName);
|
wrapper.eq(SysStaff::getName,employeeName);
|
||||||
|
|
||||||
return sysStaffMapper.selectOne(wrapper);
|
return getBaseMapper().selectOne(wrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.evo.task;
|
package com.evo.task;
|
||||||
|
|
||||||
import com.evo.attendance.service.IRzAbnormalDetailService;
|
import com.evo.attendance.service.IRzAbnormalDetailService;
|
||||||
|
import com.evo.equipment.service.IEqSnDetailService;
|
||||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||||
import com.evo.system.service.ISysStaffService;
|
import com.evo.system.service.ISysStaffService;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
@ -16,7 +17,9 @@ public class TaskController {
|
|||||||
@Resource
|
@Resource
|
||||||
private IRzRestaurantStatisticsService rzRestaurantStatisticsService; //餐饮统计
|
private IRzRestaurantStatisticsService rzRestaurantStatisticsService; //餐饮统计
|
||||||
@Resource
|
@Resource
|
||||||
private IRzAbnormalDetailService abnormalDetailService; //异常卡
|
private IRzAbnormalDetailService abnormalDetailService;
|
||||||
|
@Resource
|
||||||
|
private IEqSnDetailService eqSnDetailService; //异常卡
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每月1号 0:20 自动生成考勤数据
|
* 每月1号 0:20 自动生成考勤数据
|
||||||
@ -56,4 +59,12 @@ public class TaskController {
|
|||||||
public void calculationOfSeniority(){
|
public void calculationOfSeniority(){
|
||||||
sysStaffService.calculationOfSeniority();
|
sysStaffService.calculationOfSeniority();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每月1号 0:20 自动生成考勤数据
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedRate = 5000)
|
||||||
|
public void checkDevice(){
|
||||||
|
eqSnDetailService.checkDevice();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@
|
|||||||
<if test="ip != null">ip,</if>
|
<if test="ip != null">ip,</if>
|
||||||
<if test="snTime != null">sn_time,</if>
|
<if test="snTime != null">sn_time,</if>
|
||||||
<if test="type != null">type,</if>
|
<if test="type != null">type,</if>
|
||||||
|
<if test="sessionId != null and sessionId != ''">session_id,</if>
|
||||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
@ -48,6 +49,7 @@
|
|||||||
<if test="ip != null">#{ip},</if>
|
<if test="ip != null">#{ip},</if>
|
||||||
<if test="snTime != null">#{snTime},</if>
|
<if test="snTime != null">#{snTime},</if>
|
||||||
<if test="type != null">#{type},</if>
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="sessionId != null and sessionId != ''">#{sessionId},</if>
|
||||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
@ -63,6 +65,7 @@
|
|||||||
<if test="ip != null">ip = #{ip},</if>
|
<if test="ip != null">ip = #{ip},</if>
|
||||||
<if test="snTime != null">sn_time = #{snTime},</if>
|
<if test="snTime != null">sn_time = #{snTime},</if>
|
||||||
<if test="type != null">type = #{type},</if>
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="sessionId != null and sessionId != ''">session_id = #{sessionId},</if>
|
||||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
|||||||
@ -21,12 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEqOverStaffList" parameterType="EqOverStaff" resultMap="EqOverStaffResult">
|
<select id="selectEqOverStaffList" parameterType="EqOverStaff" resultMap="EqOverStaffResult">
|
||||||
<include refid="selectEqOverStaffVo"/>
|
select os.id, os.user_id, ss.name as staff_name, ss.image_url from eq_over_staff os left join sys_staff ss on ss.user_id = os.user_id
|
||||||
<where>
|
<where>
|
||||||
del_flag = '0'
|
os.del_flag = '0'
|
||||||
<if test="userId != null "> and user_id = #{userId}</if>
|
|
||||||
<if test="staffName != null and staffName != ''"> and staff_name like concat('%', #{staffName}, '%')</if>
|
|
||||||
<if test="imageUrl != null and imageUrl != ''"> and image_url = #{imageUrl}</if>
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -52,28 +52,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSysStaffVo">
|
<sql id="selectSysStaffVo">
|
||||||
select user_id,company_name, dept_id, code, name, id_card,is_leader, sex, age, phone, address, level, major, school, bank_number,social_subsidy, bank, employment_date, experience, worker_term, regular_date, quit_date, contract_start, contract_end, contract_type, social_type, seniority, is_overtime_pay, zs_flag, secrecy, injury, insurance, introducer, clock_in, status, wages_ratio_date, remarks, del_flag, create_by, create_time, update_by, update_time from sys_staff
|
select user_id,company_name, dept_id, code, name, id_card,is_leader, sex, age, phone, address, level, major, school, bank_number,social_subsidy, bank, employment_date, experience, worker_term, regular_date, quit_date, contract_start, contract_end, contract_type, social_type, seniority, is_overtime_pay, zs_flag, secrecy, injury, insurance, introducer, clock_in, status, wages_ratio_date, remarks, del_flag, create_by, create_time, update_by, update_time, image_url from sys_staff
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysStaffList" parameterType="com.evo.system.domain.SysStaff" resultMap="SysStaffResult">
|
<select id="selectSysStaffList" parameterType="com.evo.system.domain.SysStaff" resultMap="SysStaffResult">
|
||||||
<include refid="selectSysStaffVo"/>
|
select ss.*, sd.dept_name as deptName
|
||||||
|
from sys_staff ss
|
||||||
|
left join sys_dept sd on sd.dept_id = ss.dept_id
|
||||||
<where>
|
<where>
|
||||||
del_flag = '0'
|
ss.del_flag = '0'
|
||||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
<if test="deptId != null "> and ss.dept_id = #{deptId}</if>
|
||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and ss.name like concat('%', #{name}, '%')</if>
|
||||||
<if test="employmentDate != null"> and DATE_FORMAT(employment_date, '%Y%m') = DATE_FORMAT(#{employmentDate} , '%Y%m')</if>
|
<if test="employmentDate != null"> and DATE_FORMAT(ss.employment_date, '%Y%m') = DATE_FORMAT(#{employmentDate} , '%Y%m')</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="status != null and status != ''">
|
<when test="status != null and status != ''">
|
||||||
and status = #{status}
|
and ss.status = #{status}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
and status != '-1'
|
and ss.status != '-1'
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="experience != null and experience != ''"> and experience like concat('%', #{experience}, '%')</if>
|
<if test="experience != null and experience != ''"> and ss.experience like concat('%', #{experience}, '%')</if>
|
||||||
<if test="isOvertimePay != null and isOvertimePay != ''"> and is_overtime_pay = #{isOvertimePay}</if>
|
<if test="isOvertimePay != null and isOvertimePay != ''"> and ss.is_overtime_pay = #{isOvertimePay}</if>
|
||||||
<if test="zsFlag != null and zsFlag != ''"> and zs_flag = #{zsFlag}</if>
|
<if test="zsFlag != null and zsFlag != ''"> and ss.zs_flag = #{zsFlag}</if>
|
||||||
<if test="companyName != null and companyName != ''"> and company_name = #{companyName}</if>
|
<if test="companyName != null and companyName != ''"> and ss.company_name = #{companyName}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user