liuliang
parent
7127aae951
commit
3640bf24e4
@ -0,0 +1,81 @@
|
|||||||
|
package com.engine.attendance.workflow.action;
|
||||||
|
|
||||||
|
import com.engine.attendance.workflow.service.MakeUpClockInService;
|
||||||
|
import com.engine.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
|
||||||
|
import com.engine.common.util.CommonUtil;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请假流程提交检查
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class AskForLeaveCheckAction implements Action {
|
||||||
|
private MakeUpClockInService makeUpClockInService = ServiceUtil.getService(MakeUpClockInServiceImpl.class);
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
// 流程表单主表数据
|
||||||
|
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
|
||||||
|
// 流程表单明细表数据
|
||||||
|
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
|
||||||
|
//补打卡人员
|
||||||
|
String qjry = mainTableData.get("qjry");
|
||||||
|
|
||||||
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
|
params.put("userId",qjry);
|
||||||
|
params.put("submitDate", DateUtil.getCurrentDate());
|
||||||
|
|
||||||
|
Map<String,Object> dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params);
|
||||||
|
|
||||||
|
List<Map<String,Object>> dateList = (List<Map<String,Object>>)dataMap.get("data");
|
||||||
|
|
||||||
|
boolean status = (boolean)dataMap.get("status");
|
||||||
|
if (!status){
|
||||||
|
log.error("该人员没有考勤周期");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("该人员没有考勤周期!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
if (dateList.size()==0){
|
||||||
|
log.error("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map<String, String> detailTable:detailTableData){
|
||||||
|
String bdkrq = detailTable.get("ksrq");
|
||||||
|
boolean mark = true;
|
||||||
|
for (Map<String,Object> date:dateList){
|
||||||
|
//存在考勤周期内
|
||||||
|
String startDate = Util.null2String(date.get("startDate"));
|
||||||
|
String endDate = Util.null2String(date.get("endDate"));
|
||||||
|
if (DateUtil.getTime(startDate).compareTo(DateUtil.getTime(bdkrq)) <=0 &&
|
||||||
|
DateUtil.getTime(endDate).compareTo(DateUtil.getTime(bdkrq)) >=0){
|
||||||
|
mark = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mark){
|
||||||
|
//已关账
|
||||||
|
log.error("补打卡日期:{},已关账无法补打卡",bdkrq);
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("补打卡日期:"+bdkrq+"所在考勤周期已经关账无法再补打卡!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.engine.attendance.workflow.action;
|
||||||
|
|
||||||
|
import com.engine.attendance.workflow.service.MakeUpClockInService;
|
||||||
|
import com.engine.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
|
||||||
|
import com.engine.common.util.CommonUtil;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.common.util.DbTools;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销假流程提交检查
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class EliminationsAskForLeaveAction implements Action {
|
||||||
|
|
||||||
|
private MakeUpClockInService makeUpClockInService = ServiceUtil.getService(MakeUpClockInServiceImpl.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
// 流程表单主表数据
|
||||||
|
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
|
||||||
|
// 流程表单明细表数据
|
||||||
|
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
|
||||||
|
//销差人
|
||||||
|
String xjr = mainTableData.get("xjr");
|
||||||
|
|
||||||
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
|
params.put("userId",xjr);
|
||||||
|
params.put("submitDate", DateUtil.getCurrentDate());
|
||||||
|
|
||||||
|
Map<String,Object> dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params);
|
||||||
|
|
||||||
|
List<Map<String,Object>> dateList = (List<Map<String,Object>>)dataMap.get("data");
|
||||||
|
|
||||||
|
boolean status = (boolean)dataMap.get("status");
|
||||||
|
if (!status){
|
||||||
|
log.error("该人员没有考勤周期");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("该人员没有考勤周期!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
if (dateList.size()==0){
|
||||||
|
log.error("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
detailTableData = detailTableData.stream().filter(e->"1".equals(e.get("cx"))).collect(Collectors.toList());
|
||||||
|
List<String> detailIds = detailTableData.stream().map(e->e.get("cxlyid")).collect(Collectors.toList());
|
||||||
|
String sql = "select id,ksrq from uf_jcl_kq_qjjl_dt1 where (cxqj is null or cxqj <> '1') and id in ("+String.join(",",detailIds)+")";
|
||||||
|
List<Map<String, Object>> detailList = DbTools.getSqlToList(sql);
|
||||||
|
|
||||||
|
for (Map<String, Object> detailTable:detailList){
|
||||||
|
String bdkrq = Util.null2String(detailTable.get("ksrq"));
|
||||||
|
boolean mark = true;
|
||||||
|
for (Map<String,Object> date:dateList){
|
||||||
|
//存在考勤周期内
|
||||||
|
String startDate = Util.null2String(date.get("startDate"));
|
||||||
|
String endDate = Util.null2String(date.get("endDate"));
|
||||||
|
if (DateUtil.getTime(startDate).compareTo(DateUtil.getTime(bdkrq)) <=0 &&
|
||||||
|
DateUtil.getTime(endDate).compareTo(DateUtil.getTime(bdkrq)) >=0){
|
||||||
|
mark = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mark){
|
||||||
|
//已关账
|
||||||
|
log.error("补打卡日期:{},已关账无法补打卡",bdkrq);
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("补打卡日期:"+bdkrq+"所在考勤周期已经关账无法再补打卡!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.engine.attendance.workflow.action;
|
||||||
|
|
||||||
|
import com.engine.attendance.workflow.service.MakeUpClockInService;
|
||||||
|
import com.engine.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
|
||||||
|
import com.engine.common.util.CommonUtil;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.common.util.DbTools;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销差流程提交检查
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class EliminationsEvctionCheckAction implements Action {
|
||||||
|
|
||||||
|
private MakeUpClockInService makeUpClockInService = ServiceUtil.getService(MakeUpClockInServiceImpl.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
// 流程表单主表数据
|
||||||
|
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
|
||||||
|
// 流程表单明细表数据
|
||||||
|
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
|
||||||
|
//销差人
|
||||||
|
String xjr = mainTableData.get("xjr");
|
||||||
|
|
||||||
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
|
params.put("userId",xjr);
|
||||||
|
params.put("submitDate", DateUtil.getCurrentDate());
|
||||||
|
|
||||||
|
Map<String,Object> dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params);
|
||||||
|
|
||||||
|
List<Map<String,Object>> dateList = (List<Map<String,Object>>)dataMap.get("data");
|
||||||
|
|
||||||
|
boolean status = (boolean)dataMap.get("status");
|
||||||
|
if (!status){
|
||||||
|
log.error("该人员没有考勤周期");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("该人员没有考勤周期!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
if (dateList.size()==0){
|
||||||
|
log.error("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
detailTableData = detailTableData.stream().filter(e->"1".equals(e.get("cx"))).collect(Collectors.toList());
|
||||||
|
List<String> detailIds = detailTableData.stream().map(e->e.get("cxlyid")).collect(Collectors.toList());
|
||||||
|
String sql = "select id,ksrq from uf_jcl_kq_ccjl_dt1 where (cxcc is null or cxcc <> '1') and id in ("+String.join(",",detailIds)+")";
|
||||||
|
List<Map<String, Object>> detailList = DbTools.getSqlToList(sql);
|
||||||
|
|
||||||
|
for (Map<String, Object> detailTable:detailList){
|
||||||
|
String bdkrq = Util.null2String(detailTable.get("ksrq"));
|
||||||
|
boolean mark = true;
|
||||||
|
for (Map<String,Object> date:dateList){
|
||||||
|
//存在考勤周期内
|
||||||
|
String startDate = Util.null2String(date.get("startDate"));
|
||||||
|
String endDate = Util.null2String(date.get("endDate"));
|
||||||
|
if (DateUtil.getTime(startDate).compareTo(DateUtil.getTime(bdkrq)) <=0 &&
|
||||||
|
DateUtil.getTime(endDate).compareTo(DateUtil.getTime(bdkrq)) >=0){
|
||||||
|
mark = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mark){
|
||||||
|
//已关账
|
||||||
|
log.error("补打卡日期:{},已关账无法补打卡",bdkrq);
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("补打卡日期:"+bdkrq+"所在考勤周期已经关账无法再补打卡!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package com.engine.attendance.workflow.action;
|
||||||
|
|
||||||
|
import com.engine.attendance.workflow.service.MakeUpClockInService;
|
||||||
|
import com.engine.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
|
||||||
|
import com.engine.common.util.CommonUtil;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差流程提交检查
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class EvctionCheckAction implements Action {
|
||||||
|
private MakeUpClockInService makeUpClockInService = ServiceUtil.getService(MakeUpClockInServiceImpl.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
// 流程表单主表数据
|
||||||
|
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
|
||||||
|
// 流程表单明细表数据
|
||||||
|
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
|
||||||
|
//出差人员
|
||||||
|
String ccr = mainTableData.get("ccr");
|
||||||
|
|
||||||
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
|
params.put("userId",ccr);
|
||||||
|
params.put("submitDate", DateUtil.getCurrentDate());
|
||||||
|
|
||||||
|
Map<String,Object> dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params);
|
||||||
|
|
||||||
|
List<Map<String,Object>> dateList = (List<Map<String,Object>>)dataMap.get("data");
|
||||||
|
|
||||||
|
boolean status = (boolean)dataMap.get("status");
|
||||||
|
if (!status){
|
||||||
|
log.error("该人员没有考勤周期");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("该人员没有考勤周期!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
if (dateList.size()==0){
|
||||||
|
log.error("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map<String, String> detailTable:detailTableData){
|
||||||
|
String bdkrq = detailTable.get("ksrq");
|
||||||
|
boolean mark = true;
|
||||||
|
for (Map<String,Object> date:dateList){
|
||||||
|
//存在考勤周期内
|
||||||
|
String startDate = Util.null2String(date.get("startDate"));
|
||||||
|
String endDate = Util.null2String(date.get("endDate"));
|
||||||
|
if (DateUtil.getTime(startDate).compareTo(DateUtil.getTime(bdkrq)) <=0 &&
|
||||||
|
DateUtil.getTime(endDate).compareTo(DateUtil.getTime(bdkrq)) >=0){
|
||||||
|
mark = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mark){
|
||||||
|
//已关账
|
||||||
|
log.error("补打卡日期:{},已关账无法补打卡",bdkrq);
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("补打卡日期:"+bdkrq+"所在考勤周期已经关账无法再补打卡!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.engine.attendance.workflow.action;
|
||||||
|
|
||||||
|
import com.engine.attendance.workflow.service.MakeUpClockInService;
|
||||||
|
import com.engine.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
|
||||||
|
import com.engine.common.util.CommonUtil;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班计划流程提交检查
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class OvertimePlanCheckAction implements Action {
|
||||||
|
|
||||||
|
private MakeUpClockInService makeUpClockInService = ServiceUtil.getService(MakeUpClockInServiceImpl.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
// 流程表单主表数据
|
||||||
|
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
|
||||||
|
// 流程表单明细表数据
|
||||||
|
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
|
||||||
|
//加班人员
|
||||||
|
String jbry = mainTableData.get("jbry");
|
||||||
|
|
||||||
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
|
params.put("userId",jbry);
|
||||||
|
params.put("submitDate", DateUtil.getCurrentDate());
|
||||||
|
|
||||||
|
Map<String,Object> dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params);
|
||||||
|
|
||||||
|
List<Map<String,Object>> dateList = (List<Map<String,Object>>)dataMap.get("data");
|
||||||
|
|
||||||
|
boolean status = (boolean)dataMap.get("status");
|
||||||
|
if (!status){
|
||||||
|
log.error("该人员没有考勤周期");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("该人员没有考勤周期!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
if (dateList.size()==0){
|
||||||
|
log.error("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map<String, String> detailTable:detailTableData){
|
||||||
|
String bdkrq = detailTable.get("ksrq");
|
||||||
|
boolean mark = true;
|
||||||
|
for (Map<String,Object> date:dateList){
|
||||||
|
//存在考勤周期内
|
||||||
|
String startDate = Util.null2String(date.get("startDate"));
|
||||||
|
String endDate = Util.null2String(date.get("endDate"));
|
||||||
|
if (DateUtil.getTime(startDate).compareTo(DateUtil.getTime(bdkrq)) <=0 &&
|
||||||
|
DateUtil.getTime(endDate).compareTo(DateUtil.getTime(bdkrq)) >=0){
|
||||||
|
mark = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mark){
|
||||||
|
//已关账
|
||||||
|
log.error("补打卡日期:{},已关账无法补打卡",bdkrq);
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("补打卡日期:"+bdkrq+"所在考勤周期已经关账无法再补打卡!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.engine.attendance.workflow.action;
|
||||||
|
|
||||||
|
import com.engine.attendance.workflow.service.MakeUpClockInService;
|
||||||
|
import com.engine.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
|
||||||
|
import com.engine.common.util.CommonUtil;
|
||||||
|
import com.engine.common.util.DateUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班结果流程提交检查
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class OvertimeResultCheckAction implements Action {
|
||||||
|
private MakeUpClockInService makeUpClockInService = ServiceUtil.getService(MakeUpClockInServiceImpl.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
// 流程表单主表数据
|
||||||
|
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
|
||||||
|
//加班人员
|
||||||
|
String jbry = mainTableData.get("jbry");
|
||||||
|
|
||||||
|
Map<String, Object> params = Maps.newHashMap();
|
||||||
|
params.put("userId",jbry);
|
||||||
|
params.put("submitDate", DateUtil.getCurrentDate());
|
||||||
|
|
||||||
|
Map<String,Object> dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params);
|
||||||
|
|
||||||
|
List<Map<String,Object>> dateList = (List<Map<String,Object>>)dataMap.get("data");
|
||||||
|
|
||||||
|
boolean status = (boolean)dataMap.get("status");
|
||||||
|
if (!status){
|
||||||
|
log.error("该人员没有考勤周期");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("该人员没有考勤周期!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
if (dateList.size()==0){
|
||||||
|
log.error("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("申请人员当前时间没有考勤周期,请联系管理员!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String bdkrq = mainTableData.get("ksrq");
|
||||||
|
boolean mark = true;
|
||||||
|
for (Map<String,Object> date:dateList){
|
||||||
|
//存在考勤周期内
|
||||||
|
String startDate = Util.null2String(date.get("startDate"));
|
||||||
|
String endDate = Util.null2String(date.get("endDate"));
|
||||||
|
if (DateUtil.getTime(startDate).compareTo(DateUtil.getTime(bdkrq)) <=0 &&
|
||||||
|
DateUtil.getTime(endDate).compareTo(DateUtil.getTime(bdkrq)) >=0){
|
||||||
|
mark = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mark){
|
||||||
|
//已关账
|
||||||
|
log.error("补打卡日期:{},已关账无法补打卡",bdkrq);
|
||||||
|
requestInfo.getRequestManager().setMessageid("11111" + requestid + "22222");
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("补打卡日期:"+bdkrq+"所在考勤周期已经关账无法再补打卡!");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue