diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 02bb468..92d0e4c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -10,13 +10,13 @@ - - + + + + + + - - - - @@ -476,7 +476,7 @@ - + diff --git a/src/com/engine/attendance/workflow/action/AskForLeaveCheckAction.java b/src/com/engine/attendance/workflow/action/AskForLeaveCheckAction.java new file mode 100644 index 0000000..3495b35 --- /dev/null +++ b/src/com/engine/attendance/workflow/action/AskForLeaveCheckAction.java @@ -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 mainTableData = CommonUtil.getMainTableInfo(requestInfo); + // 流程表单明细表数据 + List> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0); + //补打卡人员 + String qjry = mainTableData.get("qjry"); + + Map params = Maps.newHashMap(); + params.put("userId",qjry); + params.put("submitDate", DateUtil.getCurrentDate()); + + Map dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params); + + List> dateList = (List>)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 detailTable:detailTableData){ + String bdkrq = detailTable.get("ksrq"); + boolean mark = true; + for (Map 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; + } +} diff --git a/src/com/engine/attendance/workflow/action/EliminationsAskForLeaveAction.java b/src/com/engine/attendance/workflow/action/EliminationsAskForLeaveAction.java new file mode 100644 index 0000000..318a6fb --- /dev/null +++ b/src/com/engine/attendance/workflow/action/EliminationsAskForLeaveAction.java @@ -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 mainTableData = CommonUtil.getMainTableInfo(requestInfo); + // 流程表单明细表数据 + List> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0); + //销差人 + String xjr = mainTableData.get("xjr"); + + Map params = Maps.newHashMap(); + params.put("userId",xjr); + params.put("submitDate", DateUtil.getCurrentDate()); + + Map dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params); + + List> dateList = (List>)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 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> detailList = DbTools.getSqlToList(sql); + + for (Map detailTable:detailList){ + String bdkrq = Util.null2String(detailTable.get("ksrq")); + boolean mark = true; + for (Map 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; + } +} diff --git a/src/com/engine/attendance/workflow/action/EliminationsEvctionCheckAction.java b/src/com/engine/attendance/workflow/action/EliminationsEvctionCheckAction.java new file mode 100644 index 0000000..f2ab1e4 --- /dev/null +++ b/src/com/engine/attendance/workflow/action/EliminationsEvctionCheckAction.java @@ -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 mainTableData = CommonUtil.getMainTableInfo(requestInfo); + // 流程表单明细表数据 + List> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0); + //销差人 + String xjr = mainTableData.get("xjr"); + + Map params = Maps.newHashMap(); + params.put("userId",xjr); + params.put("submitDate", DateUtil.getCurrentDate()); + + Map dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params); + + List> dateList = (List>)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 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> detailList = DbTools.getSqlToList(sql); + + for (Map detailTable:detailList){ + String bdkrq = Util.null2String(detailTable.get("ksrq")); + boolean mark = true; + for (Map 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; + } +} diff --git a/src/com/engine/attendance/workflow/action/EvctionCheckAction.java b/src/com/engine/attendance/workflow/action/EvctionCheckAction.java new file mode 100644 index 0000000..6f0d7c5 --- /dev/null +++ b/src/com/engine/attendance/workflow/action/EvctionCheckAction.java @@ -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 mainTableData = CommonUtil.getMainTableInfo(requestInfo); + // 流程表单明细表数据 + List> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0); + //出差人员 + String ccr = mainTableData.get("ccr"); + + Map params = Maps.newHashMap(); + params.put("userId",ccr); + params.put("submitDate", DateUtil.getCurrentDate()); + + Map dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params); + + List> dateList = (List>)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 detailTable:detailTableData){ + String bdkrq = detailTable.get("ksrq"); + boolean mark = true; + for (Map 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; + } +} diff --git a/src/com/engine/attendance/workflow/action/OvertimePlanCheckAction.java b/src/com/engine/attendance/workflow/action/OvertimePlanCheckAction.java new file mode 100644 index 0000000..718ee63 --- /dev/null +++ b/src/com/engine/attendance/workflow/action/OvertimePlanCheckAction.java @@ -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 mainTableData = CommonUtil.getMainTableInfo(requestInfo); + // 流程表单明细表数据 + List> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0); + //加班人员 + String jbry = mainTableData.get("jbry"); + + Map params = Maps.newHashMap(); + params.put("userId",jbry); + params.put("submitDate", DateUtil.getCurrentDate()); + + Map dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params); + + List> dateList = (List>)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 detailTable:detailTableData){ + String bdkrq = detailTable.get("ksrq"); + boolean mark = true; + for (Map 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; + } +} diff --git a/src/com/engine/attendance/workflow/action/OvertimeResultCheckAction.java b/src/com/engine/attendance/workflow/action/OvertimeResultCheckAction.java new file mode 100644 index 0000000..f5857e6 --- /dev/null +++ b/src/com/engine/attendance/workflow/action/OvertimeResultCheckAction.java @@ -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 mainTableData = CommonUtil.getMainTableInfo(requestInfo); + //加班人员 + String jbry = mainTableData.get("jbry"); + + Map params = Maps.newHashMap(); + params.put("userId",jbry); + params.put("submitDate", DateUtil.getCurrentDate()); + + Map dataMap = makeUpClockInService.getKqCycleTimeIntervalCmd(params); + + List> dateList = (List>)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 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; + } +}