获取通行记录接口编写
This commit is contained in:
parent
af6c08bad1
commit
9810dbc02e
@ -10,6 +10,7 @@ import com.zhgd.xmgl.base.WorkerVo;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
||||||
import com.zhgd.xmgl.modules.project.service.IProjectEnterpriseService;
|
import com.zhgd.xmgl.modules.project.service.IProjectEnterpriseService;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.*;
|
import com.zhgd.xmgl.modules.worker.entity.*;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.dto.GetPassRecordDto;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.dto.ModGroupDto;
|
import com.zhgd.xmgl.modules.worker.entity.dto.ModGroupDto;
|
||||||
import com.zhgd.xmgl.modules.worker.service.*;
|
import com.zhgd.xmgl.modules.worker.service.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -342,18 +343,8 @@ public class ProjectWorkerApiController {
|
|||||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/getPassRecord")
|
@PostMapping(value = "/getPassRecord")
|
||||||
public Map<String, Object> getPassRecord(@RequestBody Map<String, Object> map) {
|
public Map<String, Object> getPassRecord(@RequestBody GetPassRecordDto dto) {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
return workerAttendanceService.getPassRecord(dto);
|
||||||
try {
|
|
||||||
resultMap.put("data", "");
|
|
||||||
resultMap.put("msg", "操作成功");
|
|
||||||
resultMap.put("status", "1");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
resultMap.put("msg", "操作失败");
|
|
||||||
resultMap.put("status", "0");
|
|
||||||
}
|
|
||||||
return resultMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = " 变更人员证书", notes = "变更人员证书", httpMethod = "POST")
|
@ApiOperation(value = " 变更人员证书", notes = "变更人员证书", httpMethod = "POST")
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.modules.worker.entity.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WorkerAttendanceBo {
|
||||||
|
/*passTime 通行时间 string
|
||||||
|
direction 通行方向 int 1:进 2出
|
||||||
|
passType 通行方式 int 1:IC卡;2:人脸识别;3:指纹识别;5:二维码;6:蓝牙
|
||||||
|
devCode 通行设备编码 string
|
||||||
|
faceUrl 人脸通行抓拍照片http地址 string
|
||||||
|
idCard 通行人员身份证号码 string;*/
|
||||||
|
private String passTime;
|
||||||
|
private int direction;
|
||||||
|
private int passType;
|
||||||
|
private String devCode;
|
||||||
|
private String faceUrl;
|
||||||
|
private String idCard;
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.zhgd.xmgl.modules.worker.entity.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GetPassRecordDto {
|
||||||
|
/*
|
||||||
|
projectCode 项目编码 String 是
|
||||||
|
idCard 人员身份证号 String 否
|
||||||
|
startTime 通行开始时间 String 是 格式:2020-03-10 00:00:00
|
||||||
|
endTime 通行结束时间 String 是 格式:2020-03-10 23:59:59 (按项目获取通行记录,通行时间只能在一天之内)
|
||||||
|
pageIndex 当前页 int 是 默认1
|
||||||
|
pageSize 每页大小 int 是 默认500
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "projectCode不能为空")
|
||||||
|
private String projectCode;
|
||||||
|
private String idCard;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
private Integer pageIndex;
|
||||||
|
private Integer pageSize;
|
||||||
|
}
|
||||||
@ -5,6 +5,8 @@ import java.util.Map;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.bo.WorkerAttendanceBo;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.dto.GetPassRecordDto;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
|
||||||
@ -76,4 +78,6 @@ public interface WorkerAttendanceMapper extends BaseMapper<WorkerAttendance> {
|
|||||||
List<EntityMap> selectDayAttendanceWorkerInfoList(Map<String, Object> map);
|
List<EntityMap> selectDayAttendanceWorkerInfoList(Map<String, Object> map);
|
||||||
|
|
||||||
EntityMap selectTodayAttendanceWorkerCount(@Param("projectSn")String projectSn );
|
EntityMap selectTodayAttendanceWorkerCount(@Param("projectSn")String projectSn );
|
||||||
|
|
||||||
|
Page<WorkerAttendanceBo> getPassRecord(@Param("q") GetPassRecordDto dto, Page<WorkerAttendanceBo> page);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -605,15 +605,43 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="selectTodayAttendanceWorkerCount" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
<select id="selectTodayAttendanceWorkerCount" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT w1.id) total_attendance_person,
|
COUNT(DISTINCT w1.id) total_attendance_person,
|
||||||
IFNULL(sum((CASE WHEN person_type=1 then 1 ELSE 0 END)),0) lw_person_total,
|
IFNULL(sum((CASE WHEN person_type = 1 then 1 ELSE 0 END)), 0) lw_person_total,
|
||||||
IFNULL(sum((CASE WHEN person_type=2 then 1 ELSE 0 END)),0) gl_person_total
|
IFNULL(sum((CASE WHEN person_type = 2 then 1 ELSE 0 END)), 0) gl_person_total
|
||||||
from worker_info w1 INNER JOIN
|
from worker_info w1
|
||||||
(SELECT DISTINCT person_sn FROM worker_attendance
|
INNER JOIN
|
||||||
WHERE create_time>=CONCAT(DATE_FORMAT(now(),"%Y-%m-%d"),' 00:00:00') AND is_statistics=0
|
(SELECT DISTINCT person_sn
|
||||||
and project_sn=#{projectSn}
|
FROM worker_attendance
|
||||||
) p ON w1.person_sn=p.person_sn
|
WHERE create_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
|
||||||
WHERE w1.inService_type=1 and w1.person_type in (1,2)
|
AND is_statistics = 0
|
||||||
and w1.project_sn=#{projectSn}
|
and project_sn = #{projectSn}
|
||||||
|
) p ON w1.person_sn = p.person_sn
|
||||||
|
WHERE w1.inService_type = 1
|
||||||
|
and w1.person_type in (1, 2)
|
||||||
|
and w1.project_sn = #{projectSn}
|
||||||
|
</select>
|
||||||
|
<select id="getPassRecord" resultType="com.zhgd.xmgl.modules.worker.entity.bo.WorkerAttendanceBo">
|
||||||
|
SELECT
|
||||||
|
wa.create_time AS pass_time,
|
||||||
|
wa.pass_type AS direction,
|
||||||
|
wa.card_type as pass_type,
|
||||||
|
wa.dev_sn AS dev_code,
|
||||||
|
wa.image_url AS face_url,
|
||||||
|
wi.id_card as id_card
|
||||||
|
FROM
|
||||||
|
`worker_attendance` wa
|
||||||
|
INNER JOIN worker_info wi ON wi.person_sn = wa.person_sn
|
||||||
|
<if test="q.startTime!=null and q.startTime!=''">
|
||||||
|
and wa.create_time <![CDATA[>=]]> #{q.startTime}
|
||||||
|
</if>
|
||||||
|
<if test="q.endTime!=null and q.endTime!=''">
|
||||||
|
and wa.create_time <![CDATA[<=]]> #{q.endTime}
|
||||||
|
</if>
|
||||||
|
<if test="q.idCard!=null and q.idCard!=''">
|
||||||
|
and wi.id_card = #{q.idCard}
|
||||||
|
</if>
|
||||||
|
<if test="q.projectCode!=null and q.projectCode!=''">
|
||||||
|
and wa.project_sn = #{q.projectCode}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendance;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.dto.GetPassRecordDto;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -63,4 +64,6 @@ public interface IWorkerAttendanceService extends IService<WorkerAttendance> {
|
|||||||
List<Map<String,Object>> selectTenDaysWorkerAttendanceCountList(Map<String, Object> map);
|
List<Map<String,Object>> selectTenDaysWorkerAttendanceCountList(Map<String, Object> map);
|
||||||
|
|
||||||
void ufaceHikCallbackUrl(Map<String, Object> map);
|
void ufaceHikCallbackUrl(Map<String, Object> map);
|
||||||
|
|
||||||
|
Map<String, Object> getPassRecord(GetPassRecordDto dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,8 @@ import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
|||||||
import com.zhgd.xmgl.modules.project.entity.ProjectUfaceConfig;
|
import com.zhgd.xmgl.modules.project.entity.ProjectUfaceConfig;
|
||||||
import com.zhgd.xmgl.modules.project.mapper.ProjectUfaceConfigMapper;
|
import com.zhgd.xmgl.modules.project.mapper.ProjectUfaceConfigMapper;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.*;
|
import com.zhgd.xmgl.modules.worker.entity.*;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.bo.WorkerAttendanceBo;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.dto.GetPassRecordDto;
|
||||||
import com.zhgd.xmgl.modules.worker.mapper.*;
|
import com.zhgd.xmgl.modules.worker.mapper.*;
|
||||||
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService;
|
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService;
|
||||||
import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService;
|
import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService;
|
||||||
@ -900,6 +902,41 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getPassRecord(GetPassRecordDto dto) {
|
||||||
|
/*
|
||||||
|
projectCode 项目编码 String 是
|
||||||
|
idCard 人员身份证号 String 否
|
||||||
|
startTime 通行开始时间 String 是 格式:2020-03-10 00:00:00
|
||||||
|
endTime 通行结束时间 String 是 格式:2020-03-10 23:59:59 (按项目获取通行记录,通行时间只能在一天之内)
|
||||||
|
pageIndex 当前页 int 是 默认1
|
||||||
|
pageSize 每页大小 int 是 默认500
|
||||||
|
|
||||||
|
passTime 通行时间 string
|
||||||
|
direction 通行方向 int 1:进 2出
|
||||||
|
passType 通行方式 int 1:IC卡;2:人脸识别;3:指纹识别;5:二维码;6:蓝牙
|
||||||
|
devCode 通行设备编码 string
|
||||||
|
faceUrl 人脸通行抓拍照片http地址 string
|
||||||
|
idCard 通行人员身份证号码 string
|
||||||
|
msg 错误信息 String
|
||||||
|
status 状态码 String 1表示成功;其余表示失败
|
||||||
|
*/
|
||||||
|
Page<WorkerAttendanceBo> page = new Page<WorkerAttendanceBo>(dto.getPageIndex(), dto.getPageSize());
|
||||||
|
IPage<WorkerAttendanceBo> list = workerAttendanceMapper.getPassRecord(dto, page);
|
||||||
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
try {
|
||||||
|
resultMap.put("data", list.getRecords());
|
||||||
|
resultMap.put("total", list.getTotal());
|
||||||
|
resultMap.put("msg", "操作成功");
|
||||||
|
resultMap.put("status", "1");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("err:", e);
|
||||||
|
resultMap.put("msg", "操作失败");
|
||||||
|
resultMap.put("status", "0");
|
||||||
|
}
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public WorkerInfo getWorkerInfoByImage(String personImage, String projectSn) {
|
public WorkerInfo getWorkerInfoByImage(String personImage, String projectSn) {
|
||||||
WorkerInfo info = null;
|
WorkerInfo info = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user