|
|
|
@ -97,23 +97,52 @@ public class KQOverTimeRuleCalBiz {
|
|
|
|
|
//获取加班打卡数据
|
|
|
|
|
getOverTimeCardDataMap(resourceid, splitDate, splitDate, dateFormatter,kqTimesArrayComInfo,overRulesDetailMap,changeTypeMap,lsCheckInfoMaps,eventMap);
|
|
|
|
|
|
|
|
|
|
//0.无加班打卡数据时候,只有加班流程数据直接走新方法 todo
|
|
|
|
|
if (lsCheckInfoMaps.isEmpty()) {
|
|
|
|
|
Map<String,List<SplitBean>> splitBeanMaps = Maps.newHashMap();
|
|
|
|
|
String change_key = fromDate+"_"+resourceid;
|
|
|
|
|
int changeType = Util.getIntValue(""+changeTypeMap.get(change_key),-1);
|
|
|
|
|
String changeType_key = fromDate+"_"+changeType;
|
|
|
|
|
int computingMode = Util.getIntValue(""+computingModeMap.get(changeType_key),-1);
|
|
|
|
|
kqLog.info("AISIN: " + changeType_key+"--"+computingMode);
|
|
|
|
|
//获取加班流程数据
|
|
|
|
|
getOverTimeFlowData(resourceid,fromDate,toDate,splitBeanMaps,dateFormatter);
|
|
|
|
|
for (Map.Entry<String, List<SplitBean>> entry : splitBeanMaps.entrySet()) {
|
|
|
|
|
String mapKey = entry.getKey();
|
|
|
|
|
kqLog.info("加班流程是否存在 =>"+entry.getKey()+"=>"+splitBeanMaps.containsKey(mapKey));
|
|
|
|
|
if(splitBeanMaps.containsKey(mapKey)) {
|
|
|
|
|
List<SplitBean> splitBeans = splitBeanMaps.get(mapKey);
|
|
|
|
|
if (splitBeans == null || splitBeans.isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (int j = 0; j < splitBeans.size(); j++) {
|
|
|
|
|
SplitBean splitBean = splitBeans.get(j);
|
|
|
|
|
kqLog.info("直接通过加班流程生成加班数据:" + splitBean.getRequestId());
|
|
|
|
|
SplitActionUtil.doComputingMode1_splitBean(computingMode,splitBean);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Iterator<Entry<String, KQOvertimeCardBean>> iterator = lsCheckInfoMaps.entrySet().iterator();
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
|
Entry<String, KQOvertimeCardBean> next = iterator.next();
|
|
|
|
|
kqLog.info("lsCheckInfoMaps next==>"+next.toString());
|
|
|
|
|
String mapKey = next.getKey();
|
|
|
|
|
kqLog.info("lsCheckInfoMaps mapKey==>"+mapKey);
|
|
|
|
|
KQOvertimeCardBean kqOvertimeCardBean = next.getValue();
|
|
|
|
|
String[] mapKeys = mapKey.split("_");
|
|
|
|
|
if (mapKeys.length != 2) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String realSplitDate = mapKeys[1];
|
|
|
|
|
kqLog.info("realSplitDate ==>"+realSplitDate);
|
|
|
|
|
String change_key = realSplitDate+"_"+resourceid;
|
|
|
|
|
int changeType = Util.getIntValue(""+changeTypeMap.get(change_key),-1);
|
|
|
|
|
String changeType_key = realSplitDate+"_"+changeType;
|
|
|
|
|
int computingMode = Util.getIntValue(""+computingModeMap.get(changeType_key),-1);
|
|
|
|
|
|
|
|
|
|
boolean isOk = true;
|
|
|
|
|
new BaseBean().writeLog("新加班规则5 ==>"+computingMode);
|
|
|
|
|
//把原来下面一个方法里的内容要抽出来,是因为存在如下的问题,如果我是跨天打卡,次日3点,加班归属点设置的是次日2点,2-3这部分的是属于第二天的,需要判断下第二天的加班方式是不是doComputingMode2,如果不是就需要去走对应的doComputingMode方法
|
|
|
|
|
if(2 == computingMode){
|
|
|
|
|
isOk = doComputingMode2WithCard(kqOvertimeCardBean,mapKey,resourceid,changeTypeMap,
|
|
|
|
@ -128,6 +157,7 @@ public class KQOverTimeRuleCalBiz {
|
|
|
|
|
dateFormatter,overtimeLogMap,splitDate,overRulesDetailMap,eventMap,kqTimesArrayComInfo,
|
|
|
|
|
restTimeMap,kqEventLogBiz,uuid,realSplitDate);
|
|
|
|
|
}else if(5 == computingMode){
|
|
|
|
|
//进入该方法时有两种情况1.只有打卡数据没有加班流程;2.既有加班流程又有打卡数据
|
|
|
|
|
isOk = doComputingMode5WithCard(computingMode,kqOvertimeCardBean,mapKey,resourceid,changeTypeMap,
|
|
|
|
|
dateFormatter,overtimeLogMap,splitDate,overRulesDetailMap,eventMap,kqTimesArrayComInfo,
|
|
|
|
|
restTimeMap,kqEventLogBiz,uuid,realSplitDate);
|
|
|
|
@ -136,6 +166,8 @@ public class KQOverTimeRuleCalBiz {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
kqLog.info("加班生成数据报错:KQOverTimeRuleCalBiz:");
|
|
|
|
|
StringWriter errorsWriter = new StringWriter();
|
|
|
|
@ -339,26 +371,24 @@ public class KQOverTimeRuleCalBiz {
|
|
|
|
|
private boolean doComputingMode5WithCard(int computingMode,KQOvertimeCardBean kqOvertimeCardBean, String mapKey, String resourceid, Map<String, Integer> changeTypeMap, DateTimeFormatter dateFormatter, Map<String, Object> overtimeLogMap,
|
|
|
|
|
String splitDate, Map<String, KQOvertimeRulesDetailEntity> overRulesDetailMap, Map<String, Object> eventMap, KQTimesArrayComInfo kqTimesArrayComInfo, Map<String, List<String[]>> restTimeMap, KQOvertimeLogBiz kqEventLogBiz, String uuid,
|
|
|
|
|
String realSplitDate) throws Exception{
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
Map<String,List<SplitBean>> splitBeanMaps = Maps.newHashMap();
|
|
|
|
|
//获取加班流程数据
|
|
|
|
|
getOverTimeFlowData(resourceid,realSplitDate,realSplitDate,splitBeanMaps,dateFormatter);
|
|
|
|
|
|
|
|
|
|
//有加班流程 以加班流程数据为准
|
|
|
|
|
bb.writeLog("加班流程是否存在 =>"+splitBeanMaps.containsKey(mapKey));
|
|
|
|
|
//1.有加班流程 以加班流程数据为准
|
|
|
|
|
kqLog.info("加班流程是否存在 =>"+splitBeanMaps.containsKey(mapKey));
|
|
|
|
|
if(splitBeanMaps.containsKey(mapKey)) {
|
|
|
|
|
List<SplitBean> splitBeans = splitBeanMaps.get(mapKey);
|
|
|
|
|
bb.writeLog("splitBeans是否为空 =>"+splitBeans.toString());
|
|
|
|
|
kqLog.info("splitBeans是否为空 =>"+splitBeans.toString());
|
|
|
|
|
if(splitBeans == null || splitBeans.isEmpty()){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < splitBeans.size(); i++) {
|
|
|
|
|
SplitBean splitBean = splitBeans.get(i);
|
|
|
|
|
bb.writeLog("生成加班数据 =>"+computingMode);
|
|
|
|
|
SplitActionUtil.doComputingMode1_splitBean(computingMode,splitBean);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
//没有加班流程 以打卡数据为准 直接走3
|
|
|
|
|
//2.没有加班流程 以打卡数据为准 直接走3
|
|
|
|
|
doComputingMode3WithCard(computingMode,kqOvertimeCardBean,mapKey,resourceid,changeTypeMap,
|
|
|
|
|
dateFormatter,overtimeLogMap,splitDate,overRulesDetailMap,eventMap,kqTimesArrayComInfo,
|
|
|
|
|
restTimeMap,kqEventLogBiz,uuid,realSplitDate);
|
|
|
|
|