人员入场考勤

This commit is contained in:
haozq 2025-12-29 16:37:06 +08:00
parent 6b99b0c66a
commit b86e7be4ae
8 changed files with 225 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package com.bonus.bmw.controller;
import com.bonus.bmw.domain.vo.DeviceConfigVo;
import com.bonus.bmw.domain.vo.KqCmdBean;
import com.bonus.bmw.service.KqCmdService;
import com.bonus.common.core.web.controller.BaseController;
@ -197,7 +198,7 @@ public class KqCmdController extends BaseController {
* @param o 考勤机编号
* @return 人员
*/
@GetMapping("getDeviceTask")
@PostMapping("getDeviceTask")
@SysLog(title = "查询正在执行的任务", businessType = OperaType.QUERY, logType = 0, module = "查询正在执行的任务", details = "查询正在执行的任务")
public AjaxResult getDeviceTask(KqCmdBean o) {
try {
@ -208,8 +209,64 @@ public class KqCmdController extends BaseController {
return error("系统异常,请联系管理员");
}
@PostMapping("getDeviceConfigInfo")
@SysLog(title = "查询当前配置信息", businessType = OperaType.QUERY, logType = 0, module = "查询当前配置信息", details = "查询当前配置信息")
public AjaxResult getDeviceConfigInfo(@RequestBody KqCmdBean o) {
try {
return service.getDeviceConfigInfo(o);
} catch (Exception e) {
logger.error(e.toString(), e);
}
return error("系统异常,请联系管理员");
}
@PostMapping("getDeviceConfig")
@SysLog(title = "下发获取配置信息任务", businessType = OperaType.QUERY, logType = 0, module = "下发获取配置信息任务", details = "下发获取配置信息任务")
public AjaxResult getDeviceConfig(@RequestBody KqCmdBean o) {
try {
return service.getDeviceConfig(o);
} catch (Exception e) {
logger.error(e.toString(), e);
}
return error("系统异常,请联系管理员");
}
@PostMapping("setDeviceConfig")
@SysLog(title = "获取配置信息", businessType = OperaType.QUERY, logType = 0, module = "设置配置信息", details = "设置配置信息")
public AjaxResult setDeviceConfig(@RequestBody DeviceConfigVo o) {
try {
return service.setDeviceConfig(o);
} catch (Exception e) {
logger.error(e.toString(), e);
}
return error("系统异常,请联系管理员");
}
@GetMapping("/getKqList")
@SysLog(title = "考勤列表", businessType = OperaType.QUERY, logType = 0, module = "获取考勤机考勤打卡记录", details = "获取考勤机考勤打卡记录")
public TableDataInfo getKqList(KqCmdBean o) {
try {
startPage();
List<KqCmdBean> list = service.getKqList(o);
return getDataTable(list);
} catch (Exception e) {
logger.error(e.toString(), e);
}
return getDataTableError(new ArrayList<>());
}
@GetMapping("/getWrcKqList")
@SysLog(title = "考勤列表", businessType = OperaType.QUERY, logType = 0, module = "获取考勤机考勤未入场打卡记录", details = "获取考勤机考勤未入场打卡记录")
public TableDataInfo getWrcKqList(KqCmdBean o) {
try {
startPage();
List<KqCmdBean> list = service.getWrcKqList(o);
return getDataTable(list);
} catch (Exception e) {
logger.error(e.toString(), e);
}
return getDataTableError(new ArrayList<>());
}
}

View File

@ -31,6 +31,11 @@ public class KqCmdBean {
private String cmdName;
private String statusName;
private String startTime;
private String endTime;
/**
* 执行消息
*/
@ -116,6 +121,14 @@ public class KqCmdBean {
private Integer proId;
private Integer subId;
private Integer teamId;
/**
* 打卡日期
*/
private String attDay;
/**
* 打卡时间
*/
private String attTime;
private String proName;
private String subName;

View File

@ -1,5 +1,6 @@
package com.bonus.bmw.mapper;
import com.bonus.bmw.domain.vo.DeviceConfigVo;
import com.bonus.bmw.domain.vo.KqCmdBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -43,4 +44,25 @@ public interface KqCmdMapper {
int delTaskById(@Param("list") List<String> list);
int delHisTaskById(@Param("list") List<String> list);
/**
* 获取设备配置信息
* @param deviceCode
* @return
*/
DeviceConfigVo getDeviceConfigInfo(@Param("deviceCode")String deviceCode);
/**
* 获取考勤打卡记录
* @param o
* @return
*/
List<KqCmdBean> getKqList(KqCmdBean o);
/**
* 未入场考勤记录
* @param o
* @return
*/
List<KqCmdBean> getWrcKqList(KqCmdBean o);
}

View File

@ -1,5 +1,6 @@
package com.bonus.bmw.service;
import com.bonus.bmw.domain.vo.DeviceConfigVo;
import com.bonus.bmw.domain.vo.KqCmdBean;
import com.bonus.common.core.web.domain.AjaxResult;
@ -49,4 +50,39 @@ public interface KqCmdService{
* @return
*/
AjaxResult delHisTaskById(KqCmdBean o);
/**
* 获取配置信息
* @param o
* @return
*/
AjaxResult getDeviceConfig(KqCmdBean o);
/**
* 设置配置信息
* @param o
* @return
*/
AjaxResult setDeviceConfig(DeviceConfigVo o);
/**
* 获取当前设备配置信息
* @param o
* @return
*/
AjaxResult getDeviceConfigInfo(KqCmdBean o);
/**
* 获取考勤机考勤打卡信息
* @param o
* @return
*/
List<KqCmdBean> getKqList(KqCmdBean o);
/**
* 获取未入场考勤记录
* @param o
* @return
*/
List<KqCmdBean> getWrcKqList(KqCmdBean o);
}

View File

@ -79,7 +79,7 @@ public interface UrkSendService {
/**
* 下发指定人员
* 获取设备哦配置
* @param deviceCode
* @throws Exception
*/

View File

@ -1,5 +1,6 @@
package com.bonus.bmw.service.impl;
import com.bonus.bmw.domain.vo.DeviceConfigVo;
import com.bonus.bmw.domain.vo.KqCmdBean;
import com.bonus.bmw.domain.vo.TreeNode;
import com.bonus.bmw.mapper.KqCmdMapper;
@ -154,6 +155,68 @@ public class KqCmdServiceImpl implements KqCmdService {
}
return AjaxResult.error("删除失败");
}
@Override
public AjaxResult getDeviceConfig(KqCmdBean o) {
try{
urkSendServiceImpl.getDeviceConfig(o.getDeviceCode());
}catch (Exception e){
log.error(e.toString(), e);
return AjaxResult.error("获取配置失败");
}
return AjaxResult.success("获取配置成功");
}
/**
* 设置配置信息
* @param o
* @return
*/
@Override
public AjaxResult setDeviceConfig(DeviceConfigVo o) {
try{
urkSendServiceImpl.setDeviceConfig(o);
}catch (Exception e){
log.error(e.toString(), e);
return AjaxResult.error(e.toString());
}
return AjaxResult.success("下发配置成功");
}
@Override
public AjaxResult getDeviceConfigInfo(KqCmdBean o) {
try{
DeviceConfigVo vo= mapper.getDeviceConfigInfo(o.getDeviceCode());
if(vo!=null){
return AjaxResult.success(vo);
}
return AjaxResult.error("请先下发获取配置");
}catch (Exception e){
log.error(e.toString(), e);
}
return AjaxResult.error("请先下发获取配置");
}
@Override
public List<KqCmdBean> getKqList(KqCmdBean o) {
try{
return mapper.getKqList(o);
}catch (Exception e){
log.error(e.toString(), e);
}
return Collections.emptyList();
}
@Override
public List<KqCmdBean> getWrcKqList(KqCmdBean o) {
try{
return mapper.getWrcKqList(o);
}catch (Exception e){
log.error(e.toString(), e);
}
return Collections.emptyList();
}
/**
* 构建设备树
* @param data 包含pro_id和device_code的数据列表

View File

@ -172,4 +172,36 @@
</if>
order by trans_status_update_time desc
</select>
<select id="getDeviceConfigInfo" resultType="com.bonus.bmw.domain.vo.DeviceConfigVo">
select dev_code devCode,
service_ip serverHost,
service_port serverPort,
push_service pushServerHost,
push_port pushServerPort,
servrt_interval 'interval',
json json,
push_enable pushEnable
from kq_device_config
where dev_code=#{deviceCode}
</select>
<select id="getKqList" resultType="com.bonus.bmw.domain.vo.KqCmdBean">
select worker_id userId,device_code deviceCode,
pro_id proId,pro_name proName,id_number,`name` userName,sub_id,sub_name subName,team_id,team_name teamName,att_day attDay,att_time attTime
from bm_att_person
where device_code=#{deviceCode}
<if test="userName!=null and userName!=''">
and name like concat('%'#{userName},'%')
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and att_day between #{startTime} and #{endTime}
</if>
</select>
<select id="getWrcKqList" resultType="com.bonus.bmw.domain.vo.KqCmdBean">
select worker_id userId,device_code deviceCode,att_day attDay,att_time attTime
from bm_att_record_no_ru
where device_code=#{deviceCode}
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and att_day between #{startTime} and #{endTime}
</if>
</select>
</mapper>

View File

@ -31,7 +31,6 @@ public class CmdLogService {
body=body.substring(0,4000);
}
mapper.insertCmdLogs(taskVo,body);
}catch (Exception e){
log.error(e.toString(),e);
}