Commit a04b4482 authored by 姬鋆屾's avatar 姬鋆屾
parents 742e2e18 97ae2ca4
......@@ -42,6 +42,7 @@ public class AttendanceSummaryTaskImpl implements ITaskExcuteService {
query.setSummaryTimeEnd(DateUtils.getStrDate(now.getTime()));
now.add(Calendar.DAY_OF_MONTH, -19);
query.setSummaryTimeStart(DateUtils.getStrDate(now.getTime()));
log.info("考勤汇总时间:"+DateUtils.getDateTime(now.getTime(),"yyyy-MM-dd HH:mm:ss"));
//重新汇总最近20天的考勤数据
cacheService.lpush(KEY_ATTENDANCE_STAT_CACHE,query);
}
......
......@@ -2,6 +2,8 @@ package com.mortals.xhx.module.attendance.model.vo;
import lombok.Data;
import java.util.Date;
/**
* 考勤异常汇总
*/
......@@ -40,4 +42,12 @@ public class ErrorSummaryVo {
* 考勤汇总-早退(次)
*/
private Integer overtimeTimes;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
private Integer status;
/**
* 离职时间
*/
private Date leaveDate;
}
......@@ -46,4 +46,12 @@ public class LeaveSummaryVo {
* 结束时间
*/
private Date endTime;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
private Integer status;
/**
* 离职时间
*/
private Date leaveDate;
}
......@@ -3,6 +3,7 @@ package com.mortals.xhx.module.attendance.model.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 假期余额汇总
......@@ -129,4 +130,12 @@ public class VacationBalanceSummaryVo {
* 探亲假(天)
*/
private BigDecimal homeLeave;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
private Integer status;
/**
* 离职时间
*/
private Date leaveDate;
}
......@@ -8,10 +8,7 @@ import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.LeaveTypeEnum;
import com.mortals.xhx.common.code.OffWorkResultEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.common.utils.BeanUtil;
......@@ -43,10 +40,7 @@ import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* AttendanceStatService
......@@ -224,7 +218,22 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
//汇总当前日期假期余额
List<VacationBalanceSummaryVo> vacationBalanceSummaryVoList = attendanceSummaryDao.getVacationBalanceSummary(query);
if (CollectionUtils.isNotEmpty(vacationBalanceSummaryVoList)) {
List<AttendanceStatEntity> insertList = new ArrayList<>();
List<AttendanceStatEntity> updateList = new ArrayList<>();
for (VacationBalanceSummaryVo item : vacationBalanceSummaryVoList) {
if(item.getStatus() == StaffSatusEnum.离职.getValue()){
//离职状态时判断当前汇总日期是否在离职后
if(item.getLeaveDate()!=null){
String leaveDateStr = DateUtils.getStrDate(item.getLeaveDate());
if(DateUtils.StrToDate(leaveDateStr).compareTo(DateUtils.StrToDate(query.getSummaryTime())) < 0){
//离职日期在统计日期之前不统计
continue;
}
}else {
//没有离职日期也不统计
continue;
}
}
AttendanceStatEntity temp = this.selectOne(new AttendanceStatQuery().staffId(item.getStaffId()).year(item.getYear()).month(item.getMonth()).day(item.getDay()));
if (temp == null) {
AttendanceStatEntity attendanceStatEntity = new AttendanceStatEntity();
......@@ -241,12 +250,17 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
attendanceStatEntity.setCreateTime(new Date());
attendanceStatEntity.setCreateUserId(1l);
attendanceStatEntity.setGoTimes(1); //默认当天全勤
this.dao.insert(attendanceStatEntity);
//this.dao.insert(attendanceStatEntity);
insertList.add(attendanceStatEntity);
} else {
//BeanUtils.copyProperties(item, temp, BeanUtil.getNullPropertyNames(item));
temp.setUpdateTime(new Date());
this.dao.update(temp);
//temp.setUpdateTime(new Date());
//this.dao.update(temp);
//updateList.add(temp);
}
}
if(insertList.size()>0){
this.dao.insertBatch(insertList);
}
}
log.info("完成汇总当前日期假期余额.....");
......@@ -254,7 +268,23 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
//汇总当前日期异常考勤
List<ErrorSummaryVo> errorSummaryVoList = attendanceSummaryDao.getErrorSummary(query);
if (CollectionUtils.isNotEmpty(errorSummaryVoList)) {
List<AttendanceStatEntity> updateList = new ArrayList<>();
List<AttendanceStaffStatEntity> addStaffStat = new ArrayList<>();
List<AttendanceStaffStatEntity> updateStaffStat = new ArrayList<>();
for (ErrorSummaryVo item : errorSummaryVoList) {
if(item.getStatus() == StaffSatusEnum.离职.getValue()){
//离职状态时判断当前汇总日期是否在离职后
if(item.getLeaveDate()!=null){
String leaveDateStr = DateUtils.getStrDate(item.getLeaveDate());
if(DateUtils.StrToDate(leaveDateStr).compareTo(DateUtils.StrToDate(query.getSummaryTime())) < 0){
//离职日期在统计日期之前不统计
continue;
}
}else {
//没有离职日期也不统计
continue;
}
}
AttendanceStatEntity temp = this.selectOne(new AttendanceStatQuery().staffId(item.getStaffId()).year(item.getYear()).month(item.getMonth()).day(item.getDay()));
if (temp != null) {
BeanUtils.copyProperties(item, temp, BeanUtil.getNullPropertyNames(item));
......@@ -262,7 +292,8 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
if (item.getMorningTimes() > 0) {
temp.setNonCompliancePunch(new BigDecimal(item.getMorningTimes()));
}
this.dao.update(temp);
//this.dao.update(temp);
updateList.add(temp);
}
String attendanceSummary = "";
if (item.getMorningTimes() > 0) {
......@@ -299,21 +330,48 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
if (staffStatTemp != null) {
staffStat.setId(staffStatTemp.getId());
staffStat.setUpdateTime(new Date());
attendanceStaffStatService.update(staffStat);
//attendanceStaffStatService.update(staffStat);
updateStaffStat.add(staffStat);
} else {
staffStat.setCreateTime(DateUtils.StrToDate(query.getSummaryTime()));
staffStat.setCreateUserId(1l);
attendanceStaffStatService.save(staffStat);
//attendanceStaffStatService.save(staffStat);
addStaffStat.add(staffStat);
}
}
if(updateList.size()>0){
this.dao.updateBatch(updateList);
}
if(addStaffStat.size()>0){
attendanceStaffStatService.save(addStaffStat);
}
if(updateStaffStat.size()>0){
attendanceStaffStatService.update(updateStaffStat);
}
}
log.info("完成汇总当前日期异常考勤.....");
//汇总当前日期请假情况
List<LeaveSummaryVo> leaveSummaryVoList = attendanceSummaryDao.getLeaveSummary(query);
if (CollectionUtils.isNotEmpty(leaveSummaryVoList)) {
List<AttendanceStatEntity> updateList = new ArrayList<>();
List<AttendanceStaffStatEntity> addStaffStat = new ArrayList<>();
List<AttendanceStaffStatEntity> updateStaffStat = new ArrayList<>();
BigDecimal day = new BigDecimal(3600 * 8); //一天按8小时折算
BigDecimal oneDay = new BigDecimal(1);
for (LeaveSummaryVo item : leaveSummaryVoList) {
if(item.getStatus() == StaffSatusEnum.离职.getValue()){
//离职状态时判断当前汇总日期是否在离职后
if(item.getLeaveDate()!=null){
String leaveDateStr = DateUtils.getStrDate(item.getLeaveDate());
if(DateUtils.StrToDate(leaveDateStr).compareTo(DateUtils.StrToDate(query.getSummaryTime())) < 0){
//离职日期在统计日期之前不统计
continue;
}
}else {
//没有离职日期也不统计
continue;
}
}
String attendanceSummary = "";
AttendanceStatEntity temp = this.selectOne(new AttendanceStatQuery().staffId(item.getStaffId()).year(item.getYear()).month(item.getMonth()).day(item.getDay()));
if (temp != null) {
......@@ -417,7 +475,8 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
temp.setOtherDays(leaveTime);
break;
}
this.dao.update(temp);
//this.dao.update(temp);
updateList.add(temp);
}
AttendanceStaffStatEntity staffStat = new AttendanceStaffStatEntity();
......@@ -428,12 +487,23 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
if (staffStatTemp != null) {
staffStat.setId(staffStatTemp.getId());
staffStat.setUpdateTime(new Date());
attendanceStaffStatService.update(staffStat);
//attendanceStaffStatService.update(staffStat);
updateStaffStat.add(staffStat);
} else {
staffStat.setCreateTime(DateUtils.StrToDate(query.getSummaryTime()));
staffStat.setCreateUserId(1l);
attendanceStaffStatService.save(staffStat);
//attendanceStaffStatService.save(staffStat);
addStaffStat.add(staffStat);
}
}
if(updateList.size()>0){
this.dao.updateBatch(updateList);
}
if(addStaffStat.size()>0){
attendanceStaffStatService.save(addStaffStat);
}
if(updateStaffStat.size()>0){
attendanceStaffStatService.update(updateStaffStat);
}
}
log.info("完成汇总当前日期请假情况.....");
......
......@@ -140,6 +140,32 @@ public class StaffEntity extends StaffVo {
* 最后登录时间
*/
private Date lastLoginTime;
/**
* 考勤授权(0.不启用,1.启用)
*/
private Integer attendCheck;
/**
* 评价授权(0.不启用,1.启用)
*/
private Integer complainCheck;
/**
* 投诉授权(0.不启用,1.启用)
*/
private Integer reviewCheck;
/**
* 办件授权(0.不启用,1.启用)
*/
private Integer goworkCheck;
/**
* 效能授权(0.不启用,1.启用)
*/
private Integer effectCheck;
/**
* 其他授权(0.不启用,1.启用)
*/
private Integer otherCheck;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -211,5 +237,17 @@ public class StaffEntity extends StaffVo {
this.loginPwd = "";
this.lastLoginTime = null;
this.attendCheck = 0;
this.complainCheck = 0;
this.reviewCheck = 0;
this.goworkCheck = 0;
this.effectCheck = 0;
this.otherCheck = 0;
}
}
\ No newline at end of file
......@@ -288,6 +288,96 @@ public class StaffQuery extends StaffEntity {
/** 结束 最后登录时间 */
private String lastLoginTimeEnd;
/** 开始 考勤授权(0.不启用,1.启用) */
private Integer attendCheckStart;
/** 结束 考勤授权(0.不启用,1.启用) */
private Integer attendCheckEnd;
/** 增加 考勤授权(0.不启用,1.启用) */
private Integer attendCheckIncrement;
/** 考勤授权(0.不启用,1.启用)列表 */
private List <Integer> attendCheckList;
/** 考勤授权(0.不启用,1.启用)排除列表 */
private List <Integer> attendCheckNotList;
/** 开始 评价授权(0.不启用,1.启用) */
private Integer complainCheckStart;
/** 结束 评价授权(0.不启用,1.启用) */
private Integer complainCheckEnd;
/** 增加 评价授权(0.不启用,1.启用) */
private Integer complainCheckIncrement;
/** 评价授权(0.不启用,1.启用)列表 */
private List <Integer> complainCheckList;
/** 评价授权(0.不启用,1.启用)排除列表 */
private List <Integer> complainCheckNotList;
/** 开始 投诉授权(0.不启用,1.启用) */
private Integer reviewCheckStart;
/** 结束 投诉授权(0.不启用,1.启用) */
private Integer reviewCheckEnd;
/** 增加 投诉授权(0.不启用,1.启用) */
private Integer reviewCheckIncrement;
/** 投诉授权(0.不启用,1.启用)列表 */
private List <Integer> reviewCheckList;
/** 投诉授权(0.不启用,1.启用)排除列表 */
private List <Integer> reviewCheckNotList;
/** 开始 办件授权(0.不启用,1.启用) */
private Integer goworkCheckStart;
/** 结束 办件授权(0.不启用,1.启用) */
private Integer goworkCheckEnd;
/** 增加 办件授权(0.不启用,1.启用) */
private Integer goworkCheckIncrement;
/** 办件授权(0.不启用,1.启用)列表 */
private List <Integer> goworkCheckList;
/** 办件授权(0.不启用,1.启用)排除列表 */
private List <Integer> goworkCheckNotList;
/** 开始 效能授权(0.不启用,1.启用) */
private Integer effectCheckStart;
/** 结束 效能授权(0.不启用,1.启用) */
private Integer effectCheckEnd;
/** 增加 效能授权(0.不启用,1.启用) */
private Integer effectCheckIncrement;
/** 效能授权(0.不启用,1.启用)列表 */
private List <Integer> effectCheckList;
/** 效能授权(0.不启用,1.启用)排除列表 */
private List <Integer> effectCheckNotList;
/** 开始 其他授权(0.不启用,1.启用) */
private Integer otherCheckStart;
/** 结束 其他授权(0.不启用,1.启用) */
private Integer otherCheckEnd;
/** 增加 其他授权(0.不启用,1.启用) */
private Integer otherCheckIncrement;
/** 其他授权(0.不启用,1.启用)列表 */
private List <Integer> otherCheckList;
/** 其他授权(0.不启用,1.启用)排除列表 */
private List <Integer> otherCheckNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<StaffQuery> orConditionList;
......@@ -1859,6 +1949,491 @@ public class StaffQuery extends StaffEntity {
this.lastLoginTimeEnd = lastLoginTimeEnd;
}
/**
* 获取 开始 考勤授权(0.不启用,1.启用)
* @return attendCheckStart
*/
public Integer getAttendCheckStart(){
return this.attendCheckStart;
}
/**
* 设置 开始 考勤授权(0.不启用,1.启用)
* @param attendCheckStart
*/
public void setAttendCheckStart(Integer attendCheckStart){
this.attendCheckStart = attendCheckStart;
}
/**
* 获取 结束 考勤授权(0.不启用,1.启用)
* @return $attendCheckEnd
*/
public Integer getAttendCheckEnd(){
return this.attendCheckEnd;
}
/**
* 设置 结束 考勤授权(0.不启用,1.启用)
* @param attendCheckEnd
*/
public void setAttendCheckEnd(Integer attendCheckEnd){
this.attendCheckEnd = attendCheckEnd;
}
/**
* 获取 增加 考勤授权(0.不启用,1.启用)
* @return attendCheckIncrement
*/
public Integer getAttendCheckIncrement(){
return this.attendCheckIncrement;
}
/**
* 设置 增加 考勤授权(0.不启用,1.启用)
* @param attendCheckIncrement
*/
public void setAttendCheckIncrement(Integer attendCheckIncrement){
this.attendCheckIncrement = attendCheckIncrement;
}
/**
* 获取 考勤授权(0.不启用,1.启用)
* @return attendCheckList
*/
public List<Integer> getAttendCheckList(){
return this.attendCheckList;
}
/**
* 设置 考勤授权(0.不启用,1.启用)
* @param attendCheckList
*/
public void setAttendCheckList(List<Integer> attendCheckList){
this.attendCheckList = attendCheckList;
}
/**
* 获取 考勤授权(0.不启用,1.启用)
* @return attendCheckNotList
*/
public List<Integer> getAttendCheckNotList(){
return this.attendCheckNotList;
}
/**
* 设置 考勤授权(0.不启用,1.启用)
* @param attendCheckNotList
*/
public void setAttendCheckNotList(List<Integer> attendCheckNotList){
this.attendCheckNotList = attendCheckNotList;
}
/**
* 获取 开始 评价授权(0.不启用,1.启用)
* @return complainCheckStart
*/
public Integer getComplainCheckStart(){
return this.complainCheckStart;
}
/**
* 设置 开始 评价授权(0.不启用,1.启用)
* @param complainCheckStart
*/
public void setComplainCheckStart(Integer complainCheckStart){
this.complainCheckStart = complainCheckStart;
}
/**
* 获取 结束 评价授权(0.不启用,1.启用)
* @return $complainCheckEnd
*/
public Integer getComplainCheckEnd(){
return this.complainCheckEnd;
}
/**
* 设置 结束 评价授权(0.不启用,1.启用)
* @param complainCheckEnd
*/
public void setComplainCheckEnd(Integer complainCheckEnd){
this.complainCheckEnd = complainCheckEnd;
}
/**
* 获取 增加 评价授权(0.不启用,1.启用)
* @return complainCheckIncrement
*/
public Integer getComplainCheckIncrement(){
return this.complainCheckIncrement;
}
/**
* 设置 增加 评价授权(0.不启用,1.启用)
* @param complainCheckIncrement
*/
public void setComplainCheckIncrement(Integer complainCheckIncrement){
this.complainCheckIncrement = complainCheckIncrement;
}
/**
* 获取 评价授权(0.不启用,1.启用)
* @return complainCheckList
*/
public List<Integer> getComplainCheckList(){
return this.complainCheckList;
}
/**
* 设置 评价授权(0.不启用,1.启用)
* @param complainCheckList
*/
public void setComplainCheckList(List<Integer> complainCheckList){
this.complainCheckList = complainCheckList;
}
/**
* 获取 评价授权(0.不启用,1.启用)
* @return complainCheckNotList
*/
public List<Integer> getComplainCheckNotList(){
return this.complainCheckNotList;
}
/**
* 设置 评价授权(0.不启用,1.启用)
* @param complainCheckNotList
*/
public void setComplainCheckNotList(List<Integer> complainCheckNotList){
this.complainCheckNotList = complainCheckNotList;
}
/**
* 获取 开始 投诉授权(0.不启用,1.启用)
* @return reviewCheckStart
*/
public Integer getReviewCheckStart(){
return this.reviewCheckStart;
}
/**
* 设置 开始 投诉授权(0.不启用,1.启用)
* @param reviewCheckStart
*/
public void setReviewCheckStart(Integer reviewCheckStart){
this.reviewCheckStart = reviewCheckStart;
}
/**
* 获取 结束 投诉授权(0.不启用,1.启用)
* @return $reviewCheckEnd
*/
public Integer getReviewCheckEnd(){
return this.reviewCheckEnd;
}
/**
* 设置 结束 投诉授权(0.不启用,1.启用)
* @param reviewCheckEnd
*/
public void setReviewCheckEnd(Integer reviewCheckEnd){
this.reviewCheckEnd = reviewCheckEnd;
}
/**
* 获取 增加 投诉授权(0.不启用,1.启用)
* @return reviewCheckIncrement
*/
public Integer getReviewCheckIncrement(){
return this.reviewCheckIncrement;
}
/**
* 设置 增加 投诉授权(0.不启用,1.启用)
* @param reviewCheckIncrement
*/
public void setReviewCheckIncrement(Integer reviewCheckIncrement){
this.reviewCheckIncrement = reviewCheckIncrement;
}
/**
* 获取 投诉授权(0.不启用,1.启用)
* @return reviewCheckList
*/
public List<Integer> getReviewCheckList(){
return this.reviewCheckList;
}
/**
* 设置 投诉授权(0.不启用,1.启用)
* @param reviewCheckList
*/
public void setReviewCheckList(List<Integer> reviewCheckList){
this.reviewCheckList = reviewCheckList;
}
/**
* 获取 投诉授权(0.不启用,1.启用)
* @return reviewCheckNotList
*/
public List<Integer> getReviewCheckNotList(){
return this.reviewCheckNotList;
}
/**
* 设置 投诉授权(0.不启用,1.启用)
* @param reviewCheckNotList
*/
public void setReviewCheckNotList(List<Integer> reviewCheckNotList){
this.reviewCheckNotList = reviewCheckNotList;
}
/**
* 获取 开始 办件授权(0.不启用,1.启用)
* @return goworkCheckStart
*/
public Integer getGoworkCheckStart(){
return this.goworkCheckStart;
}
/**
* 设置 开始 办件授权(0.不启用,1.启用)
* @param goworkCheckStart
*/
public void setGoworkCheckStart(Integer goworkCheckStart){
this.goworkCheckStart = goworkCheckStart;
}
/**
* 获取 结束 办件授权(0.不启用,1.启用)
* @return $goworkCheckEnd
*/
public Integer getGoworkCheckEnd(){
return this.goworkCheckEnd;
}
/**
* 设置 结束 办件授权(0.不启用,1.启用)
* @param goworkCheckEnd
*/
public void setGoworkCheckEnd(Integer goworkCheckEnd){
this.goworkCheckEnd = goworkCheckEnd;
}
/**
* 获取 增加 办件授权(0.不启用,1.启用)
* @return goworkCheckIncrement
*/
public Integer getGoworkCheckIncrement(){
return this.goworkCheckIncrement;
}
/**
* 设置 增加 办件授权(0.不启用,1.启用)
* @param goworkCheckIncrement
*/
public void setGoworkCheckIncrement(Integer goworkCheckIncrement){
this.goworkCheckIncrement = goworkCheckIncrement;
}
/**
* 获取 办件授权(0.不启用,1.启用)
* @return goworkCheckList
*/
public List<Integer> getGoworkCheckList(){
return this.goworkCheckList;
}
/**
* 设置 办件授权(0.不启用,1.启用)
* @param goworkCheckList
*/
public void setGoworkCheckList(List<Integer> goworkCheckList){
this.goworkCheckList = goworkCheckList;
}
/**
* 获取 办件授权(0.不启用,1.启用)
* @return goworkCheckNotList
*/
public List<Integer> getGoworkCheckNotList(){
return this.goworkCheckNotList;
}
/**
* 设置 办件授权(0.不启用,1.启用)
* @param goworkCheckNotList
*/
public void setGoworkCheckNotList(List<Integer> goworkCheckNotList){
this.goworkCheckNotList = goworkCheckNotList;
}
/**
* 获取 开始 效能授权(0.不启用,1.启用)
* @return effectCheckStart
*/
public Integer getEffectCheckStart(){
return this.effectCheckStart;
}
/**
* 设置 开始 效能授权(0.不启用,1.启用)
* @param effectCheckStart
*/
public void setEffectCheckStart(Integer effectCheckStart){
this.effectCheckStart = effectCheckStart;
}
/**
* 获取 结束 效能授权(0.不启用,1.启用)
* @return $effectCheckEnd
*/
public Integer getEffectCheckEnd(){
return this.effectCheckEnd;
}
/**
* 设置 结束 效能授权(0.不启用,1.启用)
* @param effectCheckEnd
*/
public void setEffectCheckEnd(Integer effectCheckEnd){
this.effectCheckEnd = effectCheckEnd;
}
/**
* 获取 增加 效能授权(0.不启用,1.启用)
* @return effectCheckIncrement
*/
public Integer getEffectCheckIncrement(){
return this.effectCheckIncrement;
}
/**
* 设置 增加 效能授权(0.不启用,1.启用)
* @param effectCheckIncrement
*/
public void setEffectCheckIncrement(Integer effectCheckIncrement){
this.effectCheckIncrement = effectCheckIncrement;
}
/**
* 获取 效能授权(0.不启用,1.启用)
* @return effectCheckList
*/
public List<Integer> getEffectCheckList(){
return this.effectCheckList;
}
/**
* 设置 效能授权(0.不启用,1.启用)
* @param effectCheckList
*/
public void setEffectCheckList(List<Integer> effectCheckList){
this.effectCheckList = effectCheckList;
}
/**
* 获取 效能授权(0.不启用,1.启用)
* @return effectCheckNotList
*/
public List<Integer> getEffectCheckNotList(){
return this.effectCheckNotList;
}
/**
* 设置 效能授权(0.不启用,1.启用)
* @param effectCheckNotList
*/
public void setEffectCheckNotList(List<Integer> effectCheckNotList){
this.effectCheckNotList = effectCheckNotList;
}
/**
* 获取 开始 其他授权(0.不启用,1.启用)
* @return otherCheckStart
*/
public Integer getOtherCheckStart(){
return this.otherCheckStart;
}
/**
* 设置 开始 其他授权(0.不启用,1.启用)
* @param otherCheckStart
*/
public void setOtherCheckStart(Integer otherCheckStart){
this.otherCheckStart = otherCheckStart;
}
/**
* 获取 结束 其他授权(0.不启用,1.启用)
* @return $otherCheckEnd
*/
public Integer getOtherCheckEnd(){
return this.otherCheckEnd;
}
/**
* 设置 结束 其他授权(0.不启用,1.启用)
* @param otherCheckEnd
*/
public void setOtherCheckEnd(Integer otherCheckEnd){
this.otherCheckEnd = otherCheckEnd;
}
/**
* 获取 增加 其他授权(0.不启用,1.启用)
* @return otherCheckIncrement
*/
public Integer getOtherCheckIncrement(){
return this.otherCheckIncrement;
}
/**
* 设置 增加 其他授权(0.不启用,1.启用)
* @param otherCheckIncrement
*/
public void setOtherCheckIncrement(Integer otherCheckIncrement){
this.otherCheckIncrement = otherCheckIncrement;
}
/**
* 获取 其他授权(0.不启用,1.启用)
* @return otherCheckList
*/
public List<Integer> getOtherCheckList(){
return this.otherCheckList;
}
/**
* 设置 其他授权(0.不启用,1.启用)
* @param otherCheckList
*/
public void setOtherCheckList(List<Integer> otherCheckList){
this.otherCheckList = otherCheckList;
}
/**
* 获取 其他授权(0.不启用,1.启用)
* @return otherCheckNotList
*/
public List<Integer> getOtherCheckNotList(){
return this.otherCheckNotList;
}
/**
* 设置 其他授权(0.不启用,1.启用)
* @param otherCheckNotList
*/
public void setOtherCheckNotList(List<Integer> otherCheckNotList){
this.otherCheckNotList = otherCheckNotList;
}
/**
* 设置 序号,主键,自增长
* @param id
......@@ -2725,6 +3300,329 @@ public class StaffQuery extends StaffEntity {
return this;
}
/**
* 设置 考勤授权(0.不启用,1.启用)
* @param attendCheck
*/
public StaffQuery attendCheck(Integer attendCheck){
setAttendCheck(attendCheck);
return this;
}
/**
* 设置 开始 考勤授权(0.不启用,1.启用)
* @param attendCheckStart
*/
public StaffQuery attendCheckStart(Integer attendCheckStart){
this.attendCheckStart = attendCheckStart;
return this;
}
/**
* 设置 结束 考勤授权(0.不启用,1.启用)
* @param attendCheckEnd
*/
public StaffQuery attendCheckEnd(Integer attendCheckEnd){
this.attendCheckEnd = attendCheckEnd;
return this;
}
/**
* 设置 增加 考勤授权(0.不启用,1.启用)
* @param attendCheckIncrement
*/
public StaffQuery attendCheckIncrement(Integer attendCheckIncrement){
this.attendCheckIncrement = attendCheckIncrement;
return this;
}
/**
* 设置 考勤授权(0.不启用,1.启用)
* @param attendCheckList
*/
public StaffQuery attendCheckList(List<Integer> attendCheckList){
this.attendCheckList = attendCheckList;
return this;
}
/**
* 设置 考勤授权(0.不启用,1.启用)
* @param attendCheckNotList
*/
public StaffQuery attendCheckNotList(List<Integer> attendCheckNotList){
this.attendCheckNotList = attendCheckNotList;
return this;
}
/**
* 设置 评价授权(0.不启用,1.启用)
* @param complainCheck
*/
public StaffQuery complainCheck(Integer complainCheck){
setComplainCheck(complainCheck);
return this;
}
/**
* 设置 开始 评价授权(0.不启用,1.启用)
* @param complainCheckStart
*/
public StaffQuery complainCheckStart(Integer complainCheckStart){
this.complainCheckStart = complainCheckStart;
return this;
}
/**
* 设置 结束 评价授权(0.不启用,1.启用)
* @param complainCheckEnd
*/
public StaffQuery complainCheckEnd(Integer complainCheckEnd){
this.complainCheckEnd = complainCheckEnd;
return this;
}
/**
* 设置 增加 评价授权(0.不启用,1.启用)
* @param complainCheckIncrement
*/
public StaffQuery complainCheckIncrement(Integer complainCheckIncrement){
this.complainCheckIncrement = complainCheckIncrement;
return this;
}
/**
* 设置 评价授权(0.不启用,1.启用)
* @param complainCheckList
*/
public StaffQuery complainCheckList(List<Integer> complainCheckList){
this.complainCheckList = complainCheckList;
return this;
}
/**
* 设置 评价授权(0.不启用,1.启用)
* @param complainCheckNotList
*/
public StaffQuery complainCheckNotList(List<Integer> complainCheckNotList){
this.complainCheckNotList = complainCheckNotList;
return this;
}
/**
* 设置 投诉授权(0.不启用,1.启用)
* @param reviewCheck
*/
public StaffQuery reviewCheck(Integer reviewCheck){
setReviewCheck(reviewCheck);
return this;
}
/**
* 设置 开始 投诉授权(0.不启用,1.启用)
* @param reviewCheckStart
*/
public StaffQuery reviewCheckStart(Integer reviewCheckStart){
this.reviewCheckStart = reviewCheckStart;
return this;
}
/**
* 设置 结束 投诉授权(0.不启用,1.启用)
* @param reviewCheckEnd
*/
public StaffQuery reviewCheckEnd(Integer reviewCheckEnd){
this.reviewCheckEnd = reviewCheckEnd;
return this;
}
/**
* 设置 增加 投诉授权(0.不启用,1.启用)
* @param reviewCheckIncrement
*/
public StaffQuery reviewCheckIncrement(Integer reviewCheckIncrement){
this.reviewCheckIncrement = reviewCheckIncrement;
return this;
}
/**
* 设置 投诉授权(0.不启用,1.启用)
* @param reviewCheckList
*/
public StaffQuery reviewCheckList(List<Integer> reviewCheckList){
this.reviewCheckList = reviewCheckList;
return this;
}
/**
* 设置 投诉授权(0.不启用,1.启用)
* @param reviewCheckNotList
*/
public StaffQuery reviewCheckNotList(List<Integer> reviewCheckNotList){
this.reviewCheckNotList = reviewCheckNotList;
return this;
}
/**
* 设置 办件授权(0.不启用,1.启用)
* @param goworkCheck
*/
public StaffQuery goworkCheck(Integer goworkCheck){
setGoworkCheck(goworkCheck);
return this;
}
/**
* 设置 开始 办件授权(0.不启用,1.启用)
* @param goworkCheckStart
*/
public StaffQuery goworkCheckStart(Integer goworkCheckStart){
this.goworkCheckStart = goworkCheckStart;
return this;
}
/**
* 设置 结束 办件授权(0.不启用,1.启用)
* @param goworkCheckEnd
*/
public StaffQuery goworkCheckEnd(Integer goworkCheckEnd){
this.goworkCheckEnd = goworkCheckEnd;
return this;
}
/**
* 设置 增加 办件授权(0.不启用,1.启用)
* @param goworkCheckIncrement
*/
public StaffQuery goworkCheckIncrement(Integer goworkCheckIncrement){
this.goworkCheckIncrement = goworkCheckIncrement;
return this;
}
/**
* 设置 办件授权(0.不启用,1.启用)
* @param goworkCheckList
*/
public StaffQuery goworkCheckList(List<Integer> goworkCheckList){
this.goworkCheckList = goworkCheckList;
return this;
}
/**
* 设置 办件授权(0.不启用,1.启用)
* @param goworkCheckNotList
*/
public StaffQuery goworkCheckNotList(List<Integer> goworkCheckNotList){
this.goworkCheckNotList = goworkCheckNotList;
return this;
}
/**
* 设置 效能授权(0.不启用,1.启用)
* @param effectCheck
*/
public StaffQuery effectCheck(Integer effectCheck){
setEffectCheck(effectCheck);
return this;
}
/**
* 设置 开始 效能授权(0.不启用,1.启用)
* @param effectCheckStart
*/
public StaffQuery effectCheckStart(Integer effectCheckStart){
this.effectCheckStart = effectCheckStart;
return this;
}
/**
* 设置 结束 效能授权(0.不启用,1.启用)
* @param effectCheckEnd
*/
public StaffQuery effectCheckEnd(Integer effectCheckEnd){
this.effectCheckEnd = effectCheckEnd;
return this;
}
/**
* 设置 增加 效能授权(0.不启用,1.启用)
* @param effectCheckIncrement
*/
public StaffQuery effectCheckIncrement(Integer effectCheckIncrement){
this.effectCheckIncrement = effectCheckIncrement;
return this;
}
/**
* 设置 效能授权(0.不启用,1.启用)
* @param effectCheckList
*/
public StaffQuery effectCheckList(List<Integer> effectCheckList){
this.effectCheckList = effectCheckList;
return this;
}
/**
* 设置 效能授权(0.不启用,1.启用)
* @param effectCheckNotList
*/
public StaffQuery effectCheckNotList(List<Integer> effectCheckNotList){
this.effectCheckNotList = effectCheckNotList;
return this;
}
/**
* 设置 其他授权(0.不启用,1.启用)
* @param otherCheck
*/
public StaffQuery otherCheck(Integer otherCheck){
setOtherCheck(otherCheck);
return this;
}
/**
* 设置 开始 其他授权(0.不启用,1.启用)
* @param otherCheckStart
*/
public StaffQuery otherCheckStart(Integer otherCheckStart){
this.otherCheckStart = otherCheckStart;
return this;
}
/**
* 设置 结束 其他授权(0.不启用,1.启用)
* @param otherCheckEnd
*/
public StaffQuery otherCheckEnd(Integer otherCheckEnd){
this.otherCheckEnd = otherCheckEnd;
return this;
}
/**
* 设置 增加 其他授权(0.不启用,1.启用)
* @param otherCheckIncrement
*/
public StaffQuery otherCheckIncrement(Integer otherCheckIncrement){
this.otherCheckIncrement = otherCheckIncrement;
return this;
}
/**
* 设置 其他授权(0.不启用,1.启用)
* @param otherCheckList
*/
public StaffQuery otherCheckList(List<Integer> otherCheckList){
this.otherCheckList = otherCheckList;
return this;
}
/**
* 设置 其他授权(0.不启用,1.启用)
* @param otherCheckNotList
*/
public StaffQuery otherCheckNotList(List<Integer> otherCheckNotList){
this.otherCheckNotList = otherCheckNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
......
package com.mortals.xhx.module.staff.model.vo;
import lombok.Data;
@Data
public class StaffCheckAuthorizePdu {
private Long staffId;
/** 核查类型枚举CheckTypeEnum(1.考勤绩效,2.评价绩效,3.办件绩效,4.效能绩效,5.其它绩效,6.投诉绩效) */
private Integer type;
}
package com.mortals.xhx.module.staff.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu;
import com.mortals.xhx.module.staff.model.vo.StaffInfoVo;
import java.util.List;
......@@ -30,4 +32,11 @@ public interface StaffService extends ICRUDCacheService<StaffEntity,Long> {
*/
Rest<Void> syncPersons(Context context);
/**
* 绩效考核授权
* @param pdu
* @return
*/
int checkAuthorize(StaffCheckAuthorizePdu pdu,Context context) throws AppException;
}
\ No newline at end of file
......@@ -34,6 +34,7 @@ import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import com.mortals.xhx.module.staff.model.StaffLeaveQuery;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu;
import com.mortals.xhx.module.staff.model.vo.StaffInfoVo;
import com.mortals.xhx.module.staff.service.StaffLeaveService;
import com.mortals.xhx.module.staff.service.StaffService;
......@@ -207,6 +208,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
if (!ObjectUtils.isEmpty(key)) {
StaffEntity staff = item.getValue();
staff.setStatus(StaffSatusEnum.离职.getValue());
staff.setLeaveDate(new Date());
staff.setUpdateTime(new Date());
staff.setUpdateUserId(1L);
this.update(staff);
......@@ -365,6 +367,76 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
return params;
}
@Override
public int checkAuthorize(StaffCheckAuthorizePdu pdu,Context context) throws AppException {
StaffEntity temp = this.get(pdu.getStaffId());
if(temp == null){
throw new AppException("人员信息ID不正确");
}
CheckTypeEnum checkTypeEnum = CheckTypeEnum.getByValue(pdu.getType());
if(checkTypeEnum==null){
throw new AppException("考核类型不正确");
}
StaffEntity update = new StaffEntity();
update.setId(pdu.getStaffId());
//1.考勤绩效,2.评价绩效,3.办件绩效,4.效能绩效,5.其它绩效,6.投诉绩效
switch(checkTypeEnum){
case 考勤绩效:
if(temp.getAttendCheck()==1){
update.setAttendCheck(0);
}else {
update.setAttendCheck(1);
}
break;
case 评价绩效:
if(temp.getComplainCheck()==1){
update.setComplainCheck(0);
}else {
update.setComplainCheck(1);
}
break;
case 办件绩效:
if(temp.getGoworkCheck()==1){
update.setGoworkCheck(0);
}else {
update.setGoworkCheck(1);
}
break;
case 效能绩效:
if(temp.getEffectCheck()==1){
update.setEffectCheck(0);
}else {
update.setEffectCheck(1);
}
break;
case 其它绩效:
if(temp.getOtherCheck()==1){
update.setOtherCheck(0);
}else {
update.setOtherCheck(1);
}
break;
case 投诉绩效:
if(temp.getReviewCheck()==1){
update.setReviewCheck(0);
}else {
update.setReviewCheck(1);
}
break;
default:
if(temp.getOtherCheck()==1){
update.setOtherCheck(0);
}else {
update.setOtherCheck(1);
}
}
update.setUpdateTime(new Date());
if(context.getUser()!=null) {
update.setUpdateUserId(context.getUser().getId());
}
return dao.update(update);
}
public static void main(String[] args) {
System.out.println("1" + StrUtil.padPre("125", 7, "0"));
......
......@@ -28,12 +28,14 @@ import com.mortals.xhx.module.job.model.JobQuery;
import com.mortals.xhx.module.job.service.JobService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.vo.HolidayListVo;
import com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu;
import com.mortals.xhx.module.staff.model.vo.StaffInfoVo;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
......@@ -221,5 +223,34 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
public String delete(Long[] id) {
return super.delete(id);
}
@PostMapping(value = "check/authorize")
public String checkAuthorize(StaffCheckAuthorizePdu pdu) {
Map<String, Object> model = new HashMap();
if (pdu.getStaffId() == null) {
return this.createFailJsonResp("请选择待授权" + this.getModuleDesc() + "信息");
} else {
JSONObject ret = new JSONObject();
String busiDesc = "授权" + this.getModuleDesc();
Context context = this.getContext();
try {
this.service.checkAuthorize(pdu,context);
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var8) {
this.doException(this.request, busiDesc, model, var8);
Object msg = model.get("message_info");
return this.createFailJsonResp(msg == null ? "系统异常" : msg.toString());
}
this.init(model, context);
ret.put("data", model);
ret.put("code", 1);
ret.put("msg", model.remove("message_info"));
return ret.toJSONString();
}
}
}
......@@ -12,6 +12,8 @@
s.workNum,
s.deptId,
s.deptName,
s.`status`,
s.leaveDate,
DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%Y') as `year`,
DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%m') as `month`,
DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%d') as `day`,
......@@ -46,24 +48,26 @@
<!-- 汇总当前日期请假情况 -->
<select id="getLeaveSummary" parameterType="com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery" resultType="com.mortals.xhx.module.attendance.model.vo.LeaveSummaryVo">
SELECT
leavePersonId AS staffId,
leavePerson AS staffName,
leaveType,
IFNULL(sum(duration),0) as duration,
r.leavePersonId AS staffId,
r.leavePerson AS staffName,
ANY_VALUE(s.`status`) as `status`,
ANY_VALUE(s.leaveDate) as leaveDate,
r.leaveType,
IFNULL(sum(r.duration),0) as duration,
ANY_VALUE(DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%Y')) as `year`,
ANY_VALUE(DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%m')) as `month`,
ANY_VALUE(DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%d')) as `day`,
ANY_VALUE(startTime) as startTime,
ANY_VALUE(endTime) as endTime
ANY_VALUE(r.startTime) as startTime,
ANY_VALUE(r.endTime) as endTime
FROM
mortals_xhx_attendance_leave_record
mortals_xhx_attendance_leave_record r INNER JOIN mortals_xhx_staff s ON r.leavePersonId = s.id
WHERE
auditResult = 1
AND processStatus = 2
AND STR_TO_DATE(date_format(startTime,'%Y-%m-%d'),'%Y-%m-%d') <![CDATA[ <= ]]> STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
AND STR_TO_DATE(date_format(endTime,'%Y-%m-%d'),'%Y-%m-%d') <![CDATA[ >= ]]> STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
r.auditResult = 1
AND r.processStatus = 2
AND STR_TO_DATE(date_format(r.startTime,'%Y-%m-%d'),'%Y-%m-%d') <![CDATA[ <= ]]> STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
AND STR_TO_DATE(date_format(r.endTime,'%Y-%m-%d'),'%Y-%m-%d') <![CDATA[ >= ]]> STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
<if test="staffId != null and staffId!=''"> AND leavePersonId = #{staffId}</if>
GROUP BY leavePersonId,leavePerson,leaveType
GROUP BY r.leavePersonId,r.leavePerson,r.leaveType
</select>
......@@ -72,6 +76,8 @@
select
e.staffId,
e.staffName,
ANY_VALUE(s.`status`) as `status`,
ANY_VALUE(s.leaveDate) as leaveDate,
ANY_VALUE(DATE_FORMAT(errorDateTime,'%Y')) as `year`,
ANY_VALUE(DATE_FORMAT(errorDateTime,'%m')) as `month`,
ANY_VALUE(DATE_FORMAT(errorDateTime,'%d')) as `day`,
......@@ -80,7 +86,7 @@
sum(case processResult when 1 then 1 ELSE 0 end) as overtimeTimes,
sum(case processResult when 2 then 1 ELSE 0 end) as lateTimes
from
mortals_xhx_attendance_record_error e
mortals_xhx_attendance_record_error e INNER JOIN mortals_xhx_staff s ON e.staffId = s.id
where
processResult != 4
and e.errorDateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{summaryTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
......
......@@ -37,7 +37,12 @@
<result property="loginName" column="loginName" />
<result property="loginPwd" column="loginPwd" />
<result property="lastLoginTime" column="lastLoginTime" />
<result property="attendCheck" column="attendCheck" />
<result property="complainCheck" column="complainCheck" />
<result property="reviewCheck" column="reviewCheck" />
<result property="goworkCheck" column="goworkCheck" />
<result property="effectCheck" column="effectCheck" />
<result property="otherCheck" column="otherCheck" />
</resultMap>
......@@ -140,23 +145,41 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginTime') or colPickMode == 1 and data.containsKey('lastLoginTime')))">
a.lastLoginTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('attendCheck') or colPickMode == 1 and data.containsKey('attendCheck')))">
a.attendCheck,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('complainCheck') or colPickMode == 1 and data.containsKey('complainCheck')))">
a.complainCheck,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('reviewCheck') or colPickMode == 1 and data.containsKey('reviewCheck')))">
a.reviewCheck,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('goworkCheck') or colPickMode == 1 and data.containsKey('goworkCheck')))">
a.goworkCheck,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('effectCheck') or colPickMode == 1 and data.containsKey('effectCheck')))">
a.effectCheck,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('otherCheck') or colPickMode == 1 and data.containsKey('otherCheck')))">
a.otherCheck,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="StaffEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_staff
(name,gender,birthday,photoPath,phoneNumber,idCard,workNum,politicalstatus,deptId,deptName,positionId,positionName,staffType,status,source,registerPath,entryDate,regularDate,leaveDate,remark,createUserId,createTime,updateUserId,updateTime,remarkId,picUri,serverIndexCode,score,loginName,loginPwd,lastLoginTime)
(name,gender,birthday,photoPath,phoneNumber,idCard,workNum,politicalstatus,deptId,deptName,positionId,positionName,staffType,status,source,registerPath,entryDate,regularDate,leaveDate,remark,createUserId,createTime,updateUserId,updateTime,remarkId,picUri,serverIndexCode,score,loginName,loginPwd,lastLoginTime,attendCheck,complainCheck,reviewCheck,goworkCheck,effectCheck,otherCheck)
VALUES
(#{name},#{gender},#{birthday},#{photoPath},#{phoneNumber},#{idCard},#{workNum},#{politicalstatus},#{deptId},#{deptName},#{positionId},#{positionName},#{staffType},#{status},#{source},#{registerPath},#{entryDate},#{regularDate},#{leaveDate},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{remarkId},#{picUri},#{serverIndexCode},#{score},#{loginName},#{loginPwd},#{lastLoginTime})
(#{name},#{gender},#{birthday},#{photoPath},#{phoneNumber},#{idCard},#{workNum},#{politicalstatus},#{deptId},#{deptName},#{positionId},#{positionName},#{staffType},#{status},#{source},#{registerPath},#{entryDate},#{regularDate},#{leaveDate},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{remarkId},#{picUri},#{serverIndexCode},#{score},#{loginName},#{loginPwd},#{lastLoginTime},#{attendCheck},#{complainCheck},#{reviewCheck},#{goworkCheck},#{effectCheck},#{otherCheck})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_staff
(name,gender,birthday,photoPath,phoneNumber,idCard,workNum,politicalstatus,deptId,deptName,positionId,positionName,staffType,status,source,registerPath,entryDate,regularDate,leaveDate,remark,createUserId,createTime,updateUserId,updateTime,remarkId,picUri,serverIndexCode,score,loginName,loginPwd,lastLoginTime)
(name,gender,birthday,photoPath,phoneNumber,idCard,workNum,politicalstatus,deptId,deptName,positionId,positionName,staffType,status,source,registerPath,entryDate,regularDate,leaveDate,remark,createUserId,createTime,updateUserId,updateTime,remarkId,picUri,serverIndexCode,score,loginName,loginPwd,lastLoginTime,attendCheck,complainCheck,reviewCheck,goworkCheck,effectCheck,otherCheck)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.name},#{item.gender},#{item.birthday},#{item.photoPath},#{item.phoneNumber},#{item.idCard},#{item.workNum},#{item.politicalstatus},#{item.deptId},#{item.deptName},#{item.positionId},#{item.positionName},#{item.staffType},#{item.status},#{item.source},#{item.registerPath},#{item.entryDate},#{item.regularDate},#{item.leaveDate},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.remarkId},#{item.picUri},#{item.serverIndexCode},#{item.score},#{item.loginName},#{item.loginPwd},#{item.lastLoginTime})
(#{item.name},#{item.gender},#{item.birthday},#{item.photoPath},#{item.phoneNumber},#{item.idCard},#{item.workNum},#{item.politicalstatus},#{item.deptId},#{item.deptName},#{item.positionId},#{item.positionName},#{item.staffType},#{item.status},#{item.source},#{item.registerPath},#{item.entryDate},#{item.regularDate},#{item.leaveDate},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.remarkId},#{item.picUri},#{item.serverIndexCode},#{item.score},#{item.loginName},#{item.loginPwd},#{item.lastLoginTime},#{item.attendCheck},#{item.complainCheck},#{item.reviewCheck},#{item.goworkCheck},#{item.effectCheck},#{item.otherCheck})
</foreach>
</insert>
......@@ -289,6 +312,42 @@
<if test="(colPickMode==0 and data.containsKey('lastLoginTime')) or (colPickMode==1 and !data.containsKey('lastLoginTime'))">
a.lastLoginTime=#{data.lastLoginTime},
</if>
<if test="(colPickMode==0 and data.containsKey('attendCheck')) or (colPickMode==1 and !data.containsKey('attendCheck'))">
a.attendCheck=#{data.attendCheck},
</if>
<if test="(colPickMode==0 and data.containsKey('attendCheckIncrement')) or (colPickMode==1 and !data.containsKey('attendCheckIncrement'))">
a.attendCheck=ifnull(a.attendCheck,0) + #{data.attendCheckIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('complainCheck')) or (colPickMode==1 and !data.containsKey('complainCheck'))">
a.complainCheck=#{data.complainCheck},
</if>
<if test="(colPickMode==0 and data.containsKey('complainCheckIncrement')) or (colPickMode==1 and !data.containsKey('complainCheckIncrement'))">
a.complainCheck=ifnull(a.complainCheck,0) + #{data.complainCheckIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('reviewCheck')) or (colPickMode==1 and !data.containsKey('reviewCheck'))">
a.reviewCheck=#{data.reviewCheck},
</if>
<if test="(colPickMode==0 and data.containsKey('reviewCheckIncrement')) or (colPickMode==1 and !data.containsKey('reviewCheckIncrement'))">
a.reviewCheck=ifnull(a.reviewCheck,0) + #{data.reviewCheckIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('goworkCheck')) or (colPickMode==1 and !data.containsKey('goworkCheck'))">
a.goworkCheck=#{data.goworkCheck},
</if>
<if test="(colPickMode==0 and data.containsKey('goworkCheckIncrement')) or (colPickMode==1 and !data.containsKey('goworkCheckIncrement'))">
a.goworkCheck=ifnull(a.goworkCheck,0) + #{data.goworkCheckIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('effectCheck')) or (colPickMode==1 and !data.containsKey('effectCheck'))">
a.effectCheck=#{data.effectCheck},
</if>
<if test="(colPickMode==0 and data.containsKey('effectCheckIncrement')) or (colPickMode==1 and !data.containsKey('effectCheckIncrement'))">
a.effectCheck=ifnull(a.effectCheck,0) + #{data.effectCheckIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('otherCheck')) or (colPickMode==1 and !data.containsKey('otherCheck'))">
a.otherCheck=#{data.otherCheck},
</if>
<if test="(colPickMode==0 and data.containsKey('otherCheckIncrement')) or (colPickMode==1 and !data.containsKey('otherCheckIncrement'))">
a.otherCheck=ifnull(a.otherCheck,0) + #{data.otherCheckIncrement},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -568,6 +627,78 @@
</if>
</foreach>
</trim>
<trim prefix="attendCheck=(case" suffix="ELSE attendCheck end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('attendCheck')) or (colPickMode==1 and !item.containsKey('attendCheck'))">
when a.id=#{item.id} then #{item.attendCheck}
</when>
<when test="(colPickMode==0 and item.containsKey('attendCheckIncrement')) or (colPickMode==1 and !item.containsKey('attendCheckIncrement'))">
when a.id=#{item.id} then ifnull(a.attendCheck,0) + #{item.attendCheckIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="complainCheck=(case" suffix="ELSE complainCheck end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('complainCheck')) or (colPickMode==1 and !item.containsKey('complainCheck'))">
when a.id=#{item.id} then #{item.complainCheck}
</when>
<when test="(colPickMode==0 and item.containsKey('complainCheckIncrement')) or (colPickMode==1 and !item.containsKey('complainCheckIncrement'))">
when a.id=#{item.id} then ifnull(a.complainCheck,0) + #{item.complainCheckIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="reviewCheck=(case" suffix="ELSE reviewCheck end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('reviewCheck')) or (colPickMode==1 and !item.containsKey('reviewCheck'))">
when a.id=#{item.id} then #{item.reviewCheck}
</when>
<when test="(colPickMode==0 and item.containsKey('reviewCheckIncrement')) or (colPickMode==1 and !item.containsKey('reviewCheckIncrement'))">
when a.id=#{item.id} then ifnull(a.reviewCheck,0) + #{item.reviewCheckIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="goworkCheck=(case" suffix="ELSE goworkCheck end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('goworkCheck')) or (colPickMode==1 and !item.containsKey('goworkCheck'))">
when a.id=#{item.id} then #{item.goworkCheck}
</when>
<when test="(colPickMode==0 and item.containsKey('goworkCheckIncrement')) or (colPickMode==1 and !item.containsKey('goworkCheckIncrement'))">
when a.id=#{item.id} then ifnull(a.goworkCheck,0) + #{item.goworkCheckIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="effectCheck=(case" suffix="ELSE effectCheck end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('effectCheck')) or (colPickMode==1 and !item.containsKey('effectCheck'))">
when a.id=#{item.id} then #{item.effectCheck}
</when>
<when test="(colPickMode==0 and item.containsKey('effectCheckIncrement')) or (colPickMode==1 and !item.containsKey('effectCheckIncrement'))">
when a.id=#{item.id} then ifnull(a.effectCheck,0) + #{item.effectCheckIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="otherCheck=(case" suffix="ELSE otherCheck end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('otherCheck')) or (colPickMode==1 and !item.containsKey('otherCheck'))">
when a.id=#{item.id} then #{item.otherCheck}
</when>
<when test="(colPickMode==0 and item.containsKey('otherCheckIncrement')) or (colPickMode==1 and !item.containsKey('otherCheckIncrement'))">
when a.id=#{item.id} then ifnull(a.otherCheck,0) + #{item.otherCheckIncrement}
</when>
</choose>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -1380,6 +1511,167 @@
<if test="conditionParamRef.containsKey('lastLoginTimeEnd') and conditionParamRef.lastLoginTimeEnd != null and conditionParamRef.lastLoginTimeEnd!=''">
${_conditionType_} a.lastLoginTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lastLoginTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('attendCheck')">
<if test="conditionParamRef.attendCheck != null ">
${_conditionType_} a.attendCheck = #{${_conditionParam_}.attendCheck}
</if>
<if test="conditionParamRef.attendCheck == null">
${_conditionType_} a.attendCheck is null
</if>
</if>
<if test="conditionParamRef.containsKey('attendCheckList') and conditionParamRef.attendCheckList.size() > 0">
${_conditionType_} a.attendCheck in
<foreach collection="conditionParamRef.attendCheckList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('attendCheckNotList') and conditionParamRef.attendCheckNotList.size() > 0">
${_conditionType_} a.attendCheck not in
<foreach collection="conditionParamRef.attendCheckNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('attendCheckStart') and conditionParamRef.attendCheckStart != null">
${_conditionType_} a.attendCheck <![CDATA[ >= ]]> #{${_conditionParam_}.attendCheckStart}
</if>
<if test="conditionParamRef.containsKey('attendCheckEnd') and conditionParamRef.attendCheckEnd != null">
${_conditionType_} a.attendCheck <![CDATA[ <= ]]> #{${_conditionParam_}.attendCheckEnd}
</if>
<if test="conditionParamRef.containsKey('complainCheck')">
<if test="conditionParamRef.complainCheck != null ">
${_conditionType_} a.complainCheck = #{${_conditionParam_}.complainCheck}
</if>
<if test="conditionParamRef.complainCheck == null">
${_conditionType_} a.complainCheck is null
</if>
</if>
<if test="conditionParamRef.containsKey('complainCheckList') and conditionParamRef.complainCheckList.size() > 0">
${_conditionType_} a.complainCheck in
<foreach collection="conditionParamRef.complainCheckList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('complainCheckNotList') and conditionParamRef.complainCheckNotList.size() > 0">
${_conditionType_} a.complainCheck not in
<foreach collection="conditionParamRef.complainCheckNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('complainCheckStart') and conditionParamRef.complainCheckStart != null">
${_conditionType_} a.complainCheck <![CDATA[ >= ]]> #{${_conditionParam_}.complainCheckStart}
</if>
<if test="conditionParamRef.containsKey('complainCheckEnd') and conditionParamRef.complainCheckEnd != null">
${_conditionType_} a.complainCheck <![CDATA[ <= ]]> #{${_conditionParam_}.complainCheckEnd}
</if>
<if test="conditionParamRef.containsKey('reviewCheck')">
<if test="conditionParamRef.reviewCheck != null ">
${_conditionType_} a.reviewCheck = #{${_conditionParam_}.reviewCheck}
</if>
<if test="conditionParamRef.reviewCheck == null">
${_conditionType_} a.reviewCheck is null
</if>
</if>
<if test="conditionParamRef.containsKey('reviewCheckList') and conditionParamRef.reviewCheckList.size() > 0">
${_conditionType_} a.reviewCheck in
<foreach collection="conditionParamRef.reviewCheckList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('reviewCheckNotList') and conditionParamRef.reviewCheckNotList.size() > 0">
${_conditionType_} a.reviewCheck not in
<foreach collection="conditionParamRef.reviewCheckNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('reviewCheckStart') and conditionParamRef.reviewCheckStart != null">
${_conditionType_} a.reviewCheck <![CDATA[ >= ]]> #{${_conditionParam_}.reviewCheckStart}
</if>
<if test="conditionParamRef.containsKey('reviewCheckEnd') and conditionParamRef.reviewCheckEnd != null">
${_conditionType_} a.reviewCheck <![CDATA[ <= ]]> #{${_conditionParam_}.reviewCheckEnd}
</if>
<if test="conditionParamRef.containsKey('goworkCheck')">
<if test="conditionParamRef.goworkCheck != null ">
${_conditionType_} a.goworkCheck = #{${_conditionParam_}.goworkCheck}
</if>
<if test="conditionParamRef.goworkCheck == null">
${_conditionType_} a.goworkCheck is null
</if>
</if>
<if test="conditionParamRef.containsKey('goworkCheckList') and conditionParamRef.goworkCheckList.size() > 0">
${_conditionType_} a.goworkCheck in
<foreach collection="conditionParamRef.goworkCheckList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('goworkCheckNotList') and conditionParamRef.goworkCheckNotList.size() > 0">
${_conditionType_} a.goworkCheck not in
<foreach collection="conditionParamRef.goworkCheckNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('goworkCheckStart') and conditionParamRef.goworkCheckStart != null">
${_conditionType_} a.goworkCheck <![CDATA[ >= ]]> #{${_conditionParam_}.goworkCheckStart}
</if>
<if test="conditionParamRef.containsKey('goworkCheckEnd') and conditionParamRef.goworkCheckEnd != null">
${_conditionType_} a.goworkCheck <![CDATA[ <= ]]> #{${_conditionParam_}.goworkCheckEnd}
</if>
<if test="conditionParamRef.containsKey('effectCheck')">
<if test="conditionParamRef.effectCheck != null ">
${_conditionType_} a.effectCheck = #{${_conditionParam_}.effectCheck}
</if>
<if test="conditionParamRef.effectCheck == null">
${_conditionType_} a.effectCheck is null
</if>
</if>
<if test="conditionParamRef.containsKey('effectCheckList') and conditionParamRef.effectCheckList.size() > 0">
${_conditionType_} a.effectCheck in
<foreach collection="conditionParamRef.effectCheckList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('effectCheckNotList') and conditionParamRef.effectCheckNotList.size() > 0">
${_conditionType_} a.effectCheck not in
<foreach collection="conditionParamRef.effectCheckNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('effectCheckStart') and conditionParamRef.effectCheckStart != null">
${_conditionType_} a.effectCheck <![CDATA[ >= ]]> #{${_conditionParam_}.effectCheckStart}
</if>
<if test="conditionParamRef.containsKey('effectCheckEnd') and conditionParamRef.effectCheckEnd != null">
${_conditionType_} a.effectCheck <![CDATA[ <= ]]> #{${_conditionParam_}.effectCheckEnd}
</if>
<if test="conditionParamRef.containsKey('otherCheck')">
<if test="conditionParamRef.otherCheck != null ">
${_conditionType_} a.otherCheck = #{${_conditionParam_}.otherCheck}
</if>
<if test="conditionParamRef.otherCheck == null">
${_conditionType_} a.otherCheck is null
</if>
</if>
<if test="conditionParamRef.containsKey('otherCheckList') and conditionParamRef.otherCheckList.size() > 0">
${_conditionType_} a.otherCheck in
<foreach collection="conditionParamRef.otherCheckList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('otherCheckNotList') and conditionParamRef.otherCheckNotList.size() > 0">
${_conditionType_} a.otherCheck not in
<foreach collection="conditionParamRef.otherCheckNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('otherCheckStart') and conditionParamRef.otherCheckStart != null">
${_conditionType_} a.otherCheck <![CDATA[ >= ]]> #{${_conditionParam_}.otherCheckStart}
</if>
<if test="conditionParamRef.containsKey('otherCheckEnd') and conditionParamRef.otherCheckEnd != null">
${_conditionType_} a.otherCheck <![CDATA[ <= ]]> #{${_conditionParam_}.otherCheckEnd}
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -1553,6 +1845,36 @@
<if test='orderCol.lastLoginTime != null and "DESC".equalsIgnoreCase(orderCol.lastLoginTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('attendCheck')">
a.attendCheck
<if test='orderCol.attendCheck != null and "DESC".equalsIgnoreCase(orderCol.attendCheck)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('complainCheck')">
a.complainCheck
<if test='orderCol.complainCheck != null and "DESC".equalsIgnoreCase(orderCol.complainCheck)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('reviewCheck')">
a.reviewCheck
<if test='orderCol.reviewCheck != null and "DESC".equalsIgnoreCase(orderCol.reviewCheck)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('goworkCheck')">
a.goworkCheck
<if test='orderCol.goworkCheck != null and "DESC".equalsIgnoreCase(orderCol.goworkCheck)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('effectCheck')">
a.effectCheck
<if test='orderCol.effectCheck != null and "DESC".equalsIgnoreCase(orderCol.effectCheck)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('otherCheck')">
a.otherCheck
<if test='orderCol.otherCheck != null and "DESC".equalsIgnoreCase(orderCol.otherCheck)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
......@@ -884,3 +884,16 @@ CREATE TABLE `mortals_sys_holiday`
-- 2023-12-05 员工绩效分数初始化任务
-- --------------
INSERT INTO `mortals_xhx_task` (`name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('员工绩效分数初始化任务', 'StaffPerformInitDataTask', '0', 'StaffPerformInitDataTask', NULL, NULL, '1', '0', '00:10', NULL, NULL, NULL, '0', NOW(), '1', '系统管理员');
-- ----------
-- 2024-01-08 更新人员信息离职时间,人员信息表增加考核授权
-- ----------
update mortals_xhx_staff s INNER JOIN mortals_xhx_staff_leave l ON s.id = l.staffId SET s.leaveDate = l.leaveDate;
ALTER TABLE `mortals_xhx_staff` ADD COLUMN `attendCheck` TINYINT (2) DEFAULT '0' COMMENT '考勤授权(0.不启用,1.启用)',
ADD COLUMN `complainCheck` TINYINT (2) DEFAULT '0' COMMENT '评价授权(0.不启用,1.启用)',
ADD COLUMN `reviewCheck` TINYINT (2) DEFAULT '0' COMMENT '投诉授权(0.不启用,1.启用)',
ADD COLUMN `goworkCheck` TINYINT (2) DEFAULT '0' COMMENT '办件授权(0.不启用,1.启用)',
ADD COLUMN `effectCheck` TINYINT (2) DEFAULT '0' COMMENT '效能授权(0.不启用,1.启用)',
ADD COLUMN `otherCheck` TINYINT (2) DEFAULT '0' COMMENT '其他授权(0.不启用,1.启用)';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment