diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java index 1628fddb..ef817b43 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java @@ -1,5 +1,6 @@ package com.yanzhu.jh.project.domain; +import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson2.JSONObject; @@ -16,6 +17,9 @@ import com.ruoyi.common.core.domain.BaseEntity; */ public class SurProjectAttendanceData extends BaseEntity { + public SurProjectAttendanceData(){ + this.year= DateTime.now().year(); + } private static final long serialVersionUID = 1L; private int year; diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/task/AttendanceJgwTask.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/task/AttendanceJgwTask.java index 83bd21ad..fef0b3e3 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/task/AttendanceJgwTask.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/task/AttendanceJgwTask.java @@ -78,6 +78,7 @@ public class AttendanceJgwTask { public static void main(String[] args){ String d="sxyzxx2024suc"; System.out.println(Base64.encode(d)); + System.out.println(DateTime.now().year()); String appid="6a6f24fe35b04ee0bcf31cfb46ed1051"; String secret="c3h5enh4MjAyNHN1Yw=="; diff --git a/yanzhu-jh/src/main/resources/mapper/project/SurProjectAttendanceDataMapper.xml b/yanzhu-jh/src/main/resources/mapper/project/SurProjectAttendanceDataMapper.xml index 1d94ce7d..5857000c 100644 --- a/yanzhu-jh/src/main/resources/mapper/project/SurProjectAttendanceDataMapper.xml +++ b/yanzhu-jh/src/main/resources/mapper/project/SurProjectAttendanceDataMapper.xml @@ -8,45 +8,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + - - + + + + + + + + + + + + + + + - - - - - - - - - + select * FROM ( - select a.*,b.project_id,b.sub_dept_id,c.companyTypeId - from sur_project_attendance_data a,sur_project_attendance_cfg b,view_sur_project_attendance_group c - where a.cfgid=b.id and a.companyId=c.companyId + select a.* + from sur_project_attendance_data_${year} a ) sur_project_attendance_data - - insert into sur_project_attendance_data + + insert into sur_project_attendance_data_${year} cfgid, app_id, + projectId, + projectName, + deptId, + deptName, vendors_code, serverid, workerId, - attendance_type, - attendance_time, + workerName, identification, + workerPhoto, + workerGender, + birthDate, + ethnic, + nativePlace, + phone, + workTypeName, + specWorkType, + groupName, + companyTypeId, + companyName, + attendance_time, + attendance_out_time, + scanPhoto, teamId, workTypeCode, companyId, vendorId, - projectType, device_code, - work_point_id, - scanPhoto, - other, - state, - remark, is_del, create_by, create_time, update_by, update_time, + remark, #{cfgid}, #{appId}, + #{projectId}, + #{projectName}, + #{deptId}, + #{deptName}, #{vendorsCode}, #{serverid}, #{workerId}, - #{attendanceType}, - #{attendanceTime}, + #{workerName}, #{identification}, + #{workerPhoto}, + #{workerGender}, + #{birthDate}, + #{ethnic}, + #{nativePlace}, + #{phone}, + #{workTypeName}, + #{specWorkType}, + #{groupName}, + #{companyTypeId}, + #{companyName}, + #{attendanceTime}, + #{attendanceOutTime}, + #{scanPhoto}, #{teamId}, #{workTypeCode}, #{companyId}, #{vendorId}, - #{projectType}, #{deviceCode}, - #{workPointId}, - #{scanPhoto}, - #{other}, - #{state}, - #{remark}, #{isDel}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, + #{remark}, - - update sur_project_attendance_data + + update sur_project_attendance_data_${year} cfgid = #{cfgid}, app_id = #{appId}, + projectId = #{projectId}, + projectName = #{projectName}, + deptId = #{deptId}, + deptName = #{deptName}, vendors_code = #{vendorsCode}, serverid = #{serverid}, workerId = #{workerId}, - attendance_type = #{attendanceType}, - attendance_time = #{attendanceTime}, + workerName = #{workerName}, identification = #{identification}, + workerPhoto = #{workerPhoto}, + workerGender = #{workerGender}, + birthDate = #{birthDate}, + ethnic = #{ethnic}, + nativePlace = #{nativePlace}, + phone = #{phone}, + workTypeName = #{workTypeName}, + specWorkType = #{specWorkType}, + groupName = #{groupName}, + companyTypeId = #{companyTypeId}, + companyName = #{companyName}, + attendance_time = #{attendanceTime}, + attendance_out_time = #{attendanceOutTime}, + scanPhoto = #{scanPhoto}, teamId = #{teamId}, workTypeCode = #{workTypeCode}, companyId = #{companyId}, vendorId = #{vendorId}, - projectType = #{projectType}, device_code = #{deviceCode}, - work_point_id = #{workPointId}, - scanPhoto = #{scanPhoto}, - other = #{other}, - state = #{state}, - remark = #{remark}, is_del = #{isDel}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, + remark = #{remark}, where id = #{id} - delete from sur_project_attendance_data where id = #{id} + delete from sur_project_attendance_data_${year} where id = #{id} - delete from sur_project_attendance_data where id in + delete from sur_project_attendance_data_${year} where id in #{id} - delete from sur_project_attendance_data where CONCAT(app_id,'-',serverid,'-',workerId) in + delete from sur_project_attendance_data_${year} where CONCAT(app_id,'-',serverid,'-',workerId) in #{item} - insert into sur_project_attendance_data( id, cfgid, app_id, vendors_code, serverid, workerId, attendance_type, attendance_time, identification, teamId, workTypeCode, companyId, vendorId, projectType, device_code, work_point_id, scanPhoto, other, state, remark, is_del, create_by, create_time, update_by, update_time) values + insert into sur_project_attendance_data_${year}( id, cfgid, app_id, vendors_code, serverid, workerId, attendance_type, attendance_time, identification, teamId, workTypeCode, companyId, vendorId, projectType, device_code, work_point_id, scanPhoto, other, state, remark, is_del, create_by, create_time, update_by, update_time) values ( #{item.id}, #{item.cfgid},#{item.appId}, #{item.vendorsCode}, #{item.serverid}, #{item.workerId}, #{item.attendanceType}, #{item.attendanceTime}, #{item.identification}, #{item.teamId}, #{item.workTypeCode}, #{item.companyId}, #{item.vendorId}, #{item.projectType}, #{item.deviceCode}, #{item.workPointId}, #{item.scanPhoto}, #{item.other}, #{item.state}, #{item.remark}, #{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) \ No newline at end of file