Commit dfabf52e by zhoulm

Merge branch 'v5.6.0' of http://192.168.3.233:8090/dj/rpc-staff into v5.6.0

2 parents 37aaebe5 2e256bec
Showing 19 changed files with 441 additions and 79 deletions
package cn.com.glsx.dj.staff.dto.perfSalary;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CheckInRecordDTO {
private String userId;
private String groupName;
private String checkinType;
private String exceptionType;
private long checkinTime;
private String locationTitle;
private String locationDetail;
private String wifiName;
private String notes;
private String wifiMac;
private List<String> mediaIds;
private Integer lat;
private Integer lng;
private String deviceId;
private Long schCheckInTime;
private Integer groupId;
private Integer scheduleId;
private Integer timelineId;
/**
* 打卡日期
*/
private String checkinDate;
}
\ No newline at end of file \ No newline at end of file
...@@ -77,9 +77,9 @@ public class EffectiveReferralReview implements Serializable { ...@@ -77,9 +77,9 @@ public class EffectiveReferralReview implements Serializable {
private String remark; private String remark;
/** /**
* 状态:0-待提交,1-待复核 * 状态:0-未保存过,1-待提交(草稿),2-待复核
*/ */
@ApiModelProperty(notes = "状态:0-待提交,1-待复核") @ApiModelProperty(notes = "状态:0-未保存过,1-待提交(草稿),2-待复核")
@Column(name = "status") @Column(name = "status")
private Integer status; private Integer status;
......
package cn.com.glsx.dj.staff.model.perfSalary;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* 员工企微打卡信息
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Table(name = "dj_car_life_staff_qw_clock_clean")
public class StaffQwClockClean implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 员工手机号
*/
@ApiModelProperty(notes = "员工手机号")
@Column(name = "staff_phone")
private String staffPhone;
/**
* 打卡日期
*/
@ApiModelProperty(notes = "打卡日期")
@Column(name = "clock_in_date")
private String clockInDate;
/**
* 上班打卡地址-经度
*/
@ApiModelProperty(notes = "上班打卡地址-经度")
@Column(name = "clock_in_addr_lng")
private String clockInAddrLng;
/**
* 上班打卡地址-纬度
*/
@ApiModelProperty(notes = "上班打卡地址-纬度")
@Column(name = "clock_in_addr_lat")
private String clockInAddrLat;
/**
* 上班打卡时间-有打卡照片的最早打卡时间 clock_in_time_start
*/
@ApiModelProperty(notes = "上班打卡时间-有打卡照片的最早打卡时间")
@Column(name = "clock_in_time_start")
private Date clockInTimeStart;
/**
* 上班打卡地址 clock_in_addr_info
*/
@ApiModelProperty(notes = "上班打卡地址")
@Column(name = "clock_in_addr_info")
private String clockInAddrInfo;
/**
* 下班打卡地址-经度
*/
@ApiModelProperty(notes = "下班打卡地址-经度")
@Column(name = "clock_out_addr_lng")
private String clockOutAddrLng;
/**
* 下班打卡地址-纬度
*/
@ApiModelProperty(notes = "下班打卡地址-纬度")
@Column(name = "clock_out_addr_lat")
private String clockOutAddrLat;
/**
* 下班打卡地址 clock_out_addr_info
*/
@ApiModelProperty(notes = "下班打卡地址")
@Column(name = "clock_out_addr_info")
private String clockOutAddrInfo;
/**
* 下班打卡时间-有打卡照片的最晚打卡时间 clock_out_time_end
*/
@ApiModelProperty(notes = "下班打卡时间-有打卡照片的最晚打卡时间")
@Column(name = "clock_out_time_end")
private Date clockOutTimeEnd;
/**
* 企微userId
*/
@ApiModelProperty(notes = "企微userId")
@Column(name = "user_id")
private String userId;
/**
* 创建人
*/
@ApiModelProperty(notes = "创建人")
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@ApiModelProperty(notes = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "created_date")
private Date createdDate;
/**
* 修改人
*/
@ApiModelProperty(notes = "修改人")
@Column(name = "updated_by")
private String updatedBy;
/**
*
*/
@ApiModelProperty(notes = "")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@ApiModelProperty(notes = "删除标识(D:已删除;N:未删除)")
@Column(name = "deleted_flag")
private String deletedFlag;
}
...@@ -18,7 +18,8 @@ import java.util.Date; ...@@ -18,7 +18,8 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
@Table(name = "dj_car_life_staff_qw_clock_in_info") // todz dj_car_life_staff_qw_clock_in_info_dev 修改
@Table(name = "dj_car_life_staff_qw_clock_in_info_dev")
public class StaffQwClockInInfo implements Serializable { public class StaffQwClockInInfo implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -78,62 +79,6 @@ public class StaffQwClockInInfo implements Serializable { ...@@ -78,62 +79,6 @@ public class StaffQwClockInInfo implements Serializable {
private String clockOutPhotoUrl; private String clockOutPhotoUrl;
/** /**
* 上班打卡地址-经度
*/
@ApiModelProperty(notes = "上班打卡地址-经度")
@Column(name = "clock_in_addr_lng")
private String clockInAddrLng;
/**
* 上班打卡地址-纬度
*/
@ApiModelProperty(notes = "上班打卡地址-纬度")
@Column(name = "clock_in_addr_lat")
private String clockInAddrLat;
/**
* 上班打卡时间-有打卡照片的最早打卡时间 clock_in_time_start
*/
@ApiModelProperty(notes = "上班打卡时间-有打卡照片的最早打卡时间")
@Column(name = "clock_in_time_start")
private Date clockInTimeStart;
/**
* 上班打卡地址 clock_in_addr_info
*/
@ApiModelProperty(notes = "上班打卡地址")
@Column(name = "clock_in_addr_info")
private String clockInAddrInfo;
/**
* 下班打卡地址-经度
*/
@ApiModelProperty(notes = "下班打卡地址-经度")
@Column(name = "clock_out_addr_lng")
private String clockOutAddrLng;
/**
* 下班打卡地址-纬度
*/
@ApiModelProperty(notes = "下班打卡地址-纬度")
@Column(name = "clock_out_addr_lat")
private String clockOutAddrLat;
/**
* 下班打卡地址 clock_out_addr_info
*/
@ApiModelProperty(notes = "下班打卡地址")
@Column(name = "clock_out_addr_info")
private String clockOutAddrInfo;
/**
* 下班打卡时间-有打卡照片的最晚打卡时间 clock_out_time_end
*/
@ApiModelProperty(notes = "下班打卡时间-有打卡照片的最晚打卡时间")
@Column(name = "clock_out_time_end")
private Date clockOutTimeEnd;
/**
* 企微userId * 企微userId
*/ */
@ApiModelProperty(notes = "企微userId") @ApiModelProperty(notes = "企微userId")
......
...@@ -58,4 +58,9 @@ public interface PerfRuleRemote { ...@@ -58,4 +58,9 @@ public interface PerfRuleRemote {
* 考勤数据清洗 * 考勤数据清洗
*/ */
RpcResponse<Boolean> attendanceDataCleansing(); RpcResponse<Boolean> attendanceDataCleansing();
/**
* 打卡数据
*/
RpcResponse<Boolean> clockInCompleteAnalysisStaff();
} }
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-scrm-wechat-api</artifactId>
<version>4.54.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId> <groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-elasticjob</artifactId> <artifactId>ore-boot-starter-elasticjob</artifactId>
</dependency> </dependency>
......
package cn.com.glsx.dj.staff.job;
import cn.com.glsx.dj.staff.service.perfSalary.PerfRuleRemoteService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import javax.annotation.Resource;
@Slf4j
@ElasticJobConf(name = "PerfRuleSettingJob", cron = "0 0 1 1 * ? ", description = "绩效配置设置", overwrite = false)
public class PerfRuleSettingJob implements SimpleJob {
@Resource
private PerfRuleRemoteService perfRuleRemoteService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------绩效配置设置开始-----------------");
try {
perfRuleRemoteService.perfRuleSettingJob();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------绩效配置设置结束-----------------");
}
}
package cn.com.glsx.dj.staff.job;
import cn.com.glsx.dj.staff.service.perfSalary.ClockInCompleteAnalysisStaffService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@ElasticJobConf(name = "SyncQwClockInDetailDataJob", cron = "0 0 4 1 * ? ", description = "定时打卡详情同步任务-每月1号4点执行-可配参数格式(yyyy-MM)", overwrite = false)
public class SyncQwClockInDetailDataJob implements SimpleJob {
@Autowired
private ClockInCompleteAnalysisStaffService clockInCompleteAnalysisStaffService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------定时打卡详情同步任务开始-----------------");
long l = System.currentTimeMillis();
try {
String shardingParameter = shardingContext.getShardingParameter();
log.info("参数:{}", shardingParameter);
clockInCompleteAnalysisStaffService.syncQwClockInDetailData(shardingParameter);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------定时打卡详情同步任务结束,耗时:{} ms-----------------", System.currentTimeMillis() - l);
}
}
...@@ -18,4 +18,8 @@ public interface AutoPerformRuleMapper extends OreMapper<AutoPerformRule> { ...@@ -18,4 +18,8 @@ public interface AutoPerformRuleMapper extends OreMapper<AutoPerformRule> {
void deleteLatestRuleConfig(); void deleteLatestRuleConfig();
void deleteEffectiveRuleConfig();
void updatePendingRuleConfig(@Param("id") Integer id);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.mapper.perfSalary;
import cn.com.glsx.dj.staff.model.perfSalary.StaffQwClockClean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface StaffQwClockCleanMapper extends OreMapper<StaffQwClockClean> {
void insertByDate(StaffQwClockClean staffQwClockClean);
void insertByDateBatch(@Param("list") List<StaffQwClockClean> list);
}
\ No newline at end of file \ No newline at end of file
...@@ -2,9 +2,14 @@ package cn.com.glsx.dj.staff.mapper.perfSalary; ...@@ -2,9 +2,14 @@ package cn.com.glsx.dj.staff.mapper.perfSalary;
import cn.com.glsx.dj.staff.model.perfSalary.StaffQwClockInInfo; import cn.com.glsx.dj.staff.model.perfSalary.StaffQwClockInInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper @Mapper
public interface StaffQwClockInInfoMapper extends OreMapper<StaffQwClockInInfo> { public interface StaffQwClockInInfoMapper extends OreMapper<StaffQwClockInInfo> {
List<StaffQwClockInInfo> selectByDate(@Param("clockInDate") String clockInDate);
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.staff.remote.perfSalary; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.staff.remote.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.*; import cn.com.glsx.dj.staff.dto.perfSalary.*;
import cn.com.glsx.dj.staff.service.perfSalary.AttendanceDataCleansingService; import cn.com.glsx.dj.staff.service.perfSalary.AttendanceDataCleansingService;
import cn.com.glsx.dj.staff.service.perfSalary.ClockInCompleteAnalysisStaffService;
import cn.com.glsx.dj.staff.service.perfSalary.PerfRuleRemoteService; import cn.com.glsx.dj.staff.service.perfSalary.PerfRuleRemoteService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
...@@ -19,6 +20,8 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote { ...@@ -19,6 +20,8 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote {
private PerfRuleRemoteService perfRuleRemoteService; private PerfRuleRemoteService perfRuleRemoteService;
@Resource @Resource
private AttendanceDataCleansingService attendanceDataCleansingService; private AttendanceDataCleansingService attendanceDataCleansingService;
@Resource
private ClockInCompleteAnalysisStaffService clockInCompleteAnalysisStaffService;
...@@ -118,5 +121,14 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote { ...@@ -118,5 +121,14 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote {
return RpcResponse.success(true); return RpcResponse.success(true);
} }
/**
* 打卡数据
*/
@Override
public RpcResponse<Boolean> clockInCompleteAnalysisStaff() {
clockInCompleteAnalysisStaffService.syncQwClockInDetailData("");
return RpcResponse.success(true);
}
} }
...@@ -11,14 +11,18 @@ import cn.com.glsx.dj.staff.model.perfSalary.PerformanceLevel; ...@@ -11,14 +11,18 @@ import cn.com.glsx.dj.staff.model.perfSalary.PerformanceLevel;
import cn.com.glsx.dj.staff.model.perfSalary.PerformanceMonthly; import cn.com.glsx.dj.staff.model.perfSalary.PerformanceMonthly;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.env.OrePropertyConfigurer; import org.oreframework.boot.env.OrePropertyConfigurer;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
...@@ -73,10 +77,10 @@ public class PerfRuleRemoteService { ...@@ -73,10 +77,10 @@ public class PerfRuleRemoteService {
// log.info("perfRuleConfigUpdate:{}", JSONUtil.toJsonPrettyStr(perfRuleConfigUpdateDTO)); // log.info("perfRuleConfigUpdate:{}", JSONUtil.toJsonPrettyStr(perfRuleConfigUpdateDTO));
AutoPerformRuleUpdateDTO autoPerformRuleUpdateDTO = perfRuleConfigUpdateDTO.getAutoPerformRuleUpdateDTO(); AutoPerformRuleUpdateDTO autoPerformRuleUpdateDTO = perfRuleConfigUpdateDTO.getAutoPerformRuleUpdateDTO();
List<PerformanceLevelUpdateDTO> performanceLevelUpdateDTOS = perfRuleConfigUpdateDTO.getPerformanceLevelUpdateDTOS(); List<PerformanceLevelUpdateDTO> performanceLevelUpdateDTOS = perfRuleConfigUpdateDTO.getPerformanceLevelUpdateDTOS();
// hutool判断生效月份是未来月份 如果不是则抛异常 // hutool判断生效月份是当月或未来月份 如果不是则抛异常
Date effectiveMonth = autoPerformRuleUpdateDTO.getEffectiveMonth(); Date effectiveMonth = autoPerformRuleUpdateDTO.getEffectiveMonth();
if (!isFutureMonth(DateUtil.formatDate(effectiveMonth))) { if (!isCurrentAndFutureMonth(DateUtil.formatDate(effectiveMonth))) {
throw new RpcServiceException("生效时间应大于当前月"); throw new RpcServiceException("生效时间应大于等于当前月");
} }
// 删除最新的配置 // 删除最新的配置
autoPerformRuleMapper.deleteLatestRuleConfig(); autoPerformRuleMapper.deleteLatestRuleConfig();
...@@ -147,12 +151,46 @@ public class PerfRuleRemoteService { ...@@ -147,12 +151,46 @@ public class PerfRuleRemoteService {
} }
/** /**
* 判断指定日期时间字符串是否属于未来月份 * 定时任务-绩效配置设置
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void perfRuleSettingJob() {
// 查询是否存在 待生效且生效时间等于上个月的配置
// 上个月
DateTime lastMonthDate = DateUtil.offsetMonth(new Date(), -1);
String lastMonth = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN);
String queryLastMonthPendingCondition = "(DATE_FORMAT(effective_month, '%Y-%m') = '{}')";
queryLastMonthPendingCondition = StrUtil.format(queryLastMonthPendingCondition, lastMonth);
Example queryLastMonthPendingExample = new Example(AutoPerformRule.class);
queryLastMonthPendingExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.PENDING_EFFECTIVE.getCode())
.andCondition(queryLastMonthPendingCondition)
.andEqualTo("effectiveStartDate", lastMonth);
AutoPerformRule lastMonthPendingAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryLastMonthPendingExample);
if (ObjectUtil.isEmpty(lastMonthPendingAutoPerformRule)) {
// 使用生效中的配置
Example queryEffectiveExample = new Example(AutoPerformRule.class);
queryEffectiveExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.EFFECTIVE.getCode())
.andEqualTo("deletedFlag", 'N');
AutoPerformRule effectiveAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryEffectiveExample);
if (ObjectUtil.isEmpty(effectiveAutoPerformRule)) {
log.error("未找到有效的绩效配置");
return;
}
}
// 存在待生效的
// 将生效中的配置逻辑删除
autoPerformRuleMapper.deleteEffectiveRuleConfig();
// 将lastMonthPendingAutoPerformRule设置为生效中
autoPerformRuleMapper.updatePendingRuleConfig(lastMonthPendingAutoPerformRule.getId());
}
/**
* 判断指定日期时间字符串是否属于当前或未来月份
* *
* @param dateTimeStr 日期时间字符串 (格式: yyyy-MM-dd hh:mm:ss) * @param dateTimeStr 日期时间字符串 (格式: yyyy-MM-dd hh:mm:ss)
* @return true 表示是未来月份,false 表示不是 * @return true 表示是当前或未来月份,false 表示不是
*/ */
public static boolean isFutureMonth(String dateTimeStr) { public static boolean isCurrentAndFutureMonth(String dateTimeStr) {
// 1. 解析传入的日期字符串 // 1. 解析传入的日期字符串
Date targetDate = DateUtil.parse(dateTimeStr); Date targetDate = DateUtil.parse(dateTimeStr);
...@@ -165,15 +203,14 @@ public class PerfRuleRemoteService { ...@@ -165,15 +203,14 @@ public class PerfRuleRemoteService {
int currentYear = DateUtil.year(now); int currentYear = DateUtil.year(now);
int currentMonth = DateUtil.month(now) + 1; int currentMonth = DateUtil.month(now) + 1;
// 4. 比较逻辑 // 4. 比较逻辑(关键修改:当前月份也返回 true)
// 同年同月或更早
if (targetYear > currentYear) { if (targetYear > currentYear) {
return true; // 目标年份更晚 return true; // 目标年份更晚
} else return targetYear == currentYear && targetMonth > currentMonth; // 同年但目标月份更晚 } else {
// 修正:目标月份 >= 当前月份(包含当前月份)
return targetYear == currentYear && targetMonth >= currentMonth;
}
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
) )
VALUES (#{mobilePhone}, VALUES (#{mobilePhone},
#{name}, #{name},
#{merchantAttendanceListId}, #{merchantAttendanceListIds},
#{attendanceMonth}, #{attendanceMonth},
#{expectedAttendanceDays}, #{expectedAttendanceDays},
#{actualAttendanceDays}, #{actualAttendanceDays},
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#{updatedBy}, #{updatedBy},
#{updatedDate}, #{updatedDate},
#{deletedFlag}) ON DUPLICATE KEY UPDATE #{deletedFlag}) ON DUPLICATE KEY UPDATE
merchant_attendance_list_id = VALUES(merchant_attendance_list_id), merchant_attendance_list_ids = VALUES(merchant_attendance_list_ids),
expected_attendance_days = VALUES(expected_attendance_days), expected_attendance_days = VALUES(expected_attendance_days),
actual_attendance_days = VALUES(actual_attendance_days), actual_attendance_days = VALUES(actual_attendance_days),
appeal_attendance_days = VALUES(appeal_attendance_days), appeal_attendance_days = VALUES(appeal_attendance_days),
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<!-- 批量插入(使用MyBatis foreach) --> <!-- 批量插入(使用MyBatis foreach) -->
<insert id="insertOrUpdateBatch" parameterType="java.util.List"> <insert id="insertOrUpdateBatch" parameterType="java.util.List">
INSERT INTO sal_attendance_summary ( INSERT INTO sal_attendance_summary (
mobile_phone, name, merchant_attendance_list_id, attendance_month, mobile_phone, name, merchant_attendance_list_ids, attendance_month,
expected_attendance_days, actual_attendance_days, appeal_attendance_days, expected_attendance_days, actual_attendance_days, appeal_attendance_days,
total_work_hours, late_early_minutes, late_early_hours, total_work_hours, late_early_minutes, late_early_hours,
missing_punch_count, superior_leader_mobile_phone, missing_punch_count, superior_leader_mobile_phone,
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.mobilePhone}, #{item.name}, #{item.merchantAttendanceListId}, #{item.mobilePhone}, #{item.name}, #{item.merchantAttendanceListIds},
#{item.attendanceMonth}, #{item.expectedAttendanceDays}, #{item.attendanceMonth}, #{item.expectedAttendanceDays},
#{item.actualAttendanceDays}, #{item.appealAttendanceDays}, #{item.actualAttendanceDays}, #{item.appealAttendanceDays},
#{item.totalWorkHours}, #{item.lateEarlyMinutes}, #{item.lateEarlyHours}, #{item.totalWorkHours}, #{item.lateEarlyMinutes}, #{item.lateEarlyHours},
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
) )
</foreach> </foreach>
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
merchant_attendance_list_id = VALUES(merchant_attendance_list_id), merchant_attendance_list_ids = VALUES(merchant_attendance_list_ids),
expected_attendance_days = VALUES(expected_attendance_days), expected_attendance_days = VALUES(expected_attendance_days),
actual_attendance_days = VALUES(actual_attendance_days), actual_attendance_days = VALUES(actual_attendance_days),
appeal_attendance_days = VALUES(appeal_attendance_days), appeal_attendance_days = VALUES(appeal_attendance_days),
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
LIMIT 1 LIMIT 1
</select> </select>
<!-- 2. 查询绩效等级配置(关联表) -->
<select id="getPerformanceLevels" resultType="cn.com.glsx.dj.staff.dto.perfSalary.PerformanceLevelDetailDTO"> <select id="getPerformanceLevels" resultType="cn.com.glsx.dj.staff.dto.perfSalary.PerformanceLevelDetailDTO">
SELECT SELECT
level_code AS levelCode, level_code AS levelCode,
...@@ -40,16 +39,27 @@ ...@@ -40,16 +39,27 @@
score_symbol_value AS scoreSymbolValue, score_symbol_value AS scoreSymbolValue,
reward_coefficient AS rewardCoefficient reward_coefficient AS rewardCoefficient
FROM sal_performance_level FROM sal_performance_level
WHERE uuid = #{uuid} <!-- 通过外部参数传入 --> WHERE uuid = #{uuid}
</select> </select>
<update id="deleteLatestRuleConfig"> <update id="deleteLatestRuleConfig">
UPDATE sal_auto_perform_rule UPDATE sal_auto_perform_rule
SET deleted_flag = 'D' SET deleted_flag = 'D'
WHERE effective_month > Date(now())
ORDER BY created_date DESC ORDER BY created_date DESC
LIMIT 1 LIMIT 1
</update> </update>
<update id="deleteEffectiveRuleConfig">
UPDATE sal_auto_perform_rule
SET deleted_flag = 'D'
WHERE effective_status = 1;
</update>
<update id="updatePendingRuleConfig">
UPDATE sal_auto_perform_rule
SET effective_status = 2
WHERE id = #{id};
</update>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.glsx.dj.staff.mapper.perfSalary.StaffQwClockCleanMapper">
<insert id="insertByDate">
insert into dj_car_life_staff_qw_clock_clean (staff_phone,
clock_in_date,
clock_in_addr_lng,
clock_in_addr_lat,
clock_in_addr_info,
clock_in_time_start,
clock_out_addr_lng,
clock_out_addr_lat,
clock_out_addr_info,
clock_out_time_end,
user_id)
VALUES (#{staffPhone},
#{clockInDate},
#{clockInAddrLng},
#{clockInAddrLat},
#{clockInAddrInfo},
#{clockInTimeStart},
#{clockOutAddrLng},
#{clockOutAddrLat},
#{clockOutAddrInfo},
#{clockOutTimeEnd},
#{userId})
</insert>
<insert id="insertByDateBatch" parameterType="java.util.List">
insert into dj_car_life_staff_qw_clock_clean (staff_phone,
clock_in_date,
clock_in_addr_lng,
clock_in_addr_lat,
clock_in_addr_info,
clock_in_time_start,
clock_out_addr_lng,
clock_out_addr_lat,
clock_out_addr_info,
clock_out_time_end,
user_id)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.staffPhone},
#{item.clockInDate},
#{item.clockInAddrLng},
#{item.clockInAddrLat},
#{item.clockInAddrInfo},
#{item.clockInTimeStart},
#{item.clockOutAddrLng},
#{item.clockOutAddrLat},
#{item.clockOutAddrInfo},
#{item.clockOutTimeEnd},
#{item.userId})
</foreach>
ON DUPLICATE KEY UPDATE
clock_in_addr_lng = VALUES(clock_in_addr_lng),
clock_in_addr_lat = VALUES(clock_in_addr_lat),
clock_in_addr_info = VALUES(clock_in_addr_info),
clock_in_time_start = VALUES(clock_in_time_start),
clock_out_addr_lng = VALUES(clock_out_addr_lng),
clock_out_addr_lat = VALUES(clock_out_addr_lat),
clock_out_addr_info = VALUES(clock_out_addr_info),
clock_out_time_end = VALUES(clock_out_time_end),
user_id = VALUES(user_id)
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -4,5 +4,16 @@ ...@@ -4,5 +4,16 @@
<mapper namespace="cn.com.glsx.dj.staff.mapper.perfSalary.StaffQwClockInInfoMapper"> <mapper namespace="cn.com.glsx.dj.staff.mapper.perfSalary.StaffQwClockInInfoMapper">
<!-- todz dj_car_life_staff_qw_clock_in_info_dev 修改-->
<select id="selectByDate" resultType="cn.com.glsx.dj.staff.model.perfSalary.StaffQwClockInInfo">
select user_id as userId,
staff_phone as staffPhone,
clock_in_date as clockInDate
from dj_car_life_staff_qw_clock_in_info_dev
where deleted_flag = 'N'
and (DATE_FORMAT(clock_in_date, '%Y-%m') = #{clockInDate})
order by user_id;
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!