出差流程没有外勤打卡不计算考勤

dev
chenwei 1 year ago
parent add2b096db
commit b966a3b429

@ -37,6 +37,8 @@ import java.util.regex.Pattern;
*/
public class KQBalanceOfLeaveBiz {
static BaseBean bb = new BaseBean();
private static KQLog logger = new KQLog();//用于记录日志信息
public static String getBalanceOfLeave(String resourceId, String ruleId, String date) {
@ -87,6 +89,7 @@ public class KQBalanceOfLeaveBiz {
* @return 0.00
*/
public static String getRestAmount(String resourceId, String ruleId, String searchDate, boolean calcByCurrentDate, boolean isAll) {
bb.writeLog("getRestAmount start");
//员工的假期余额
String balanceOfLeave = "0";
Map<String, Object> params = new HashMap<>();
@ -123,11 +126,19 @@ public class KQBalanceOfLeaveBiz {
/**********************************************************************************************************/
//假期规则缓存类
KQLeaveRulesDetailComInfo detailComInfo = new KQLeaveRulesDetailComInfo();
KQLeaveRulesDetail detailComInfo = new KQLeaveRulesDetail();
String seclevel = resourceComInfo.getSeclevel(resourceId);
String rulesDetailId = detailComInfo.getKqLeaveRulesId(resourceId, Util.getIntValue(seclevel, 0), ruleId);
detailComInfo = detailComInfo.initCache(rulesDetailId);
// KQLeaveRulesDetailComInfo detailComInfo = new KQLeaveRulesDetailComInfo();
//余额发放方式1-手动发放、2-按司龄自动发放、3-按工龄自动发放、4-每年自动发放固定天数、5-加班时长自动计入余额、6-按司龄+工龄自动发放
int distributionMode = Util.getIntValue(detailComInfo.getDistributionMode(ruleId, subCompanyId), 1);
int distributionMode = Util.getIntValue(""+detailComInfo.getDistributionMode());
bb.writeLog("distributionMode: " + distributionMode);
bb.writeLog("distributionMode: " + ""+detailComInfo.getDistributionMode());
//
int decimalDigit = Util.getIntValue(detailComInfo.getDecimalDigit(ruleId, subCompanyId), 2);
int decimalDigit = Util.getIntValue(""+detailComInfo.getDecimalDigit());
/**********************************************************************************************************/
@ -152,7 +163,13 @@ public class KQBalanceOfLeaveBiz {
String date = calcByCurrentDate ? currentDate : searchDate;
//如果是调休,获取假期余额的逻辑会不太一样
bb.writeLog("distributionMode: " + distributionMode);
if (distributionMode == 5) {
bb.writeLog("ruleId: " + ruleId);
bb.writeLog("resourceId: " + resourceId);
bb.writeLog("searchDate: " + searchDate);
bb.writeLog("calcByCurrentDate: " + calcByCurrentDate);
bb.writeLog("isAll: " + isAll);
restAmount = getRestAmountByDis5(ruleId, resourceId, searchDate, calcByCurrentDate, isAll);
return restAmount.setScale(decimalDigit, RoundingMode.HALF_UP).toPlainString();
}
@ -263,13 +280,18 @@ public class KQBalanceOfLeaveBiz {
/*********************************************************************************/
//获取此假期类型下,该人员所在分部对应的假期规则
KQLeaveRulesDetailComInfo detailComInfo = new KQLeaveRulesDetailComInfo();
KQLeaveRulesDetail detailComInfo = new KQLeaveRulesDetail();
String seclevel = resourceComInfo.getSeclevel(resourceId);
String rulesDetailId = detailComInfo.getKqLeaveRulesId(resourceId, Util.getIntValue(seclevel, 0), ruleId);
detailComInfo = detailComInfo.initCache(rulesDetailId);
// KQLeaveRulesDetailComInfo detailComInfo = new KQLeaveRulesDetailComInfo();
//余额发放方式
int distributionMode = Util.getIntValue(detailComInfo.getDistributionMode(ruleId, subCompanyId), 1);
int distributionMode = Util.getIntValue(""+detailComInfo.getDistributionMode());
//释放规则0-不限制、1-按天释放、2-按月释放
int releaseRule = Util.getIntValue(detailComInfo.getReleaseRule(ruleId, subCompanyId), 0);
int releaseRule = Util.getIntValue(""+detailComInfo.getReleaseRule());
//小数位数
int decimalDigit = Util.getIntValue(detailComInfo.getDecimalDigit(ruleId, subCompanyId), 2);
int decimalDigit = Util.getIntValue(""+detailComInfo.getDecimalDigit());
/*********************************************************************************/
@ -926,7 +948,7 @@ public class KQBalanceOfLeaveBiz {
logger.info("加班转调休余额为0不产生调休明细记录使用日志。params=" + JSONObject.toJSONString(params));
usageHistoryEntity.setInsertOrUpdate("OnlyRecordLog");
usageHistoryEntity.setNewExtraAmount("0");
/*记录使用记录*/
/*记录使用记录*/
usageHistoryEntityList.add(usageHistoryEntity);
flag = usageHistoryBiz.save(usageHistoryEntityList);
if (!flag) {
@ -1010,7 +1032,7 @@ public class KQBalanceOfLeaveBiz {
resultMap.put("status", "-1");
return resultMap;
}
/*插入调休时长*/
/*插入调休时长*/
String _belongYear = date.substring(0, 4);
String _belongMonth = date.substring(5, 7);
String sql = "insert into kq_balanceOfLeave(leaveRulesId,resourceId,belongYear,belongMonth,baseAmount,tiaoxiuamount,usedAmount,baseAmount2,extraAmount2,usedAmount2,status,expirationDate,effectiveDate,overtimeType,isDelete) " +
@ -1097,7 +1119,7 @@ public class KQBalanceOfLeaveBiz {
if(overtimelength_i < 0){
extraAmount = "0.0";
}
/*插入调休时长*/
/*插入调休时长*/
String _belongYear = date.substring(0, 4);
String _belongMonth = date.substring(5, 7);
String sql = "insert into kq_balanceOfLeave(leaveRulesId,resourceId,belongYear,belongMonth,baseAmount,tiaoxiuamount,usedAmount,baseAmount2,extraAmount2,usedAmount2,status,expirationDate,effectiveDate,overtimeType,isDelete) " +
@ -1152,7 +1174,7 @@ public class KQBalanceOfLeaveBiz {
if (durationOfLeave.doubleValue() <= 0) {
extraAmount = "0.0";
}
/*插入调休时长*/
/*插入调休时长*/
String _belongYear = date.substring(0, 4);
String _belongMonth = date.substring(5, 7);
String sql = "insert into kq_balanceOfLeave(leaveRulesId,resourceId,belongYear,belongMonth,baseAmount,tiaoxiuamount,usedAmount,baseAmount2,extraAmount2,usedAmount2,status,expirationDate,effectiveDate,overtimeType,isDelete) " +
@ -3484,6 +3506,8 @@ public class KQBalanceOfLeaveBiz {
sql += " and belongYear='" + searchYear + "'";
}
}
bb.writeLog("balance of leave restamount sql: " + sql );
recordSet.executeQuery(sql);
while (recordSet.next()) {
BigDecimal _baseAmount = new BigDecimal(Util.null2s(recordSet.getString("allBaseAmount"), "0"));

@ -493,7 +493,7 @@ public class KQReportBiz extends BaseBean {
String empType = Util.null2String(PropBean.getUfPropValue("empType"),"field9");
basebean.writeLog("empType: " + empType);
String acqLaSql = "select id from cus_fielddata where scopeid = -1 and scope = 'HrmCustomFieldByInfoType' and " + empType + " = 0";
String acqLaSql = "select id from cus_fielddata where scopeid = -1 and scope = 'HrmCustomFieldByInfoType' and " + empType + " = 1";
basebean.writeLog("acqLaSql: " + acqLaSql);
rs.executeQuery(acqLaSql);
@ -716,7 +716,7 @@ public class KQReportBiz extends BaseBean {
sqlWhere += " and c.loginid is not null " + (rs.getDBType().equals("oracle") ? "" : " and c.loginid<>'' ");
}
sql = " select * from (select * from uf_casleave a left join hrmresource b on a.resourceid = b.id " +
sql = " select * from (select a.duration, b.* from uf_casleave a left join hrmresource b on a.resourceid = b.id " +
" where a.startdate >='" + fromDate + "' and a.enddate <='" + toDate +"' and (a.isdecu = 0 or a.isdecu is null ) ) c where 1=1 " + sqlWhere;
basebean.writeLog("getToComLeaveData sql: " + sql);

@ -70,7 +70,7 @@ public class GetSearchListCmd extends AbstractCommonCommand<Map<String, Object>>
" WHEN c.changetype = 2 THEN '工作日' " +
" WHEN c.changetype = 3 THEN '休息日' " +
" ELSE '未知' END as changetype ";
String sqlFrom = " from HrmResource a,KQ_BalanceOfLeave b, kq_flow_overtime c ";
String sqlFrom = " from HrmResource a,KQ_BalanceOfLeave b left join kq_flow_overtime c on b.id = c.tiaoxiuid ";
String sqlWhere = " where 1=1 and a.id=b.resourceId and (isDelete is null or isDelete<>1) ";
String orderBy = " b.belongYear asc,b.expirationDate asc,b.id asc ";

@ -545,7 +545,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
int emp = Util.getIntValue(Util.null2String(empTypes.get(id)));
bb.writeLog("id: " + id);
bb.writeLog("emp: " + emp);
if (emp == 0) {
if (emp == 1) {
double attendanceMins = Util.getDoubleValue(Util.null2String(rs.getString("attendanceMins")));
double attendanceHours = Util.getDoubleValue(KQDurationCalculatorUtil.getDurationRound(String.valueOf(attendanceMins / 60.0)));
@ -584,6 +584,11 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
}
data.add( fieldValue);
} else {
data.add( "0");
data.add( "0");
data.add( "0");
data.add( "0");
}
continue;
} else if(fieldName.equals("kqdate")){

@ -256,6 +256,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
empTypes.put(id, empTypeValue);
}
}
bb.writeLog("empTypes: " + empTypes);
/*考勤二开--劳务工时end*/
// #1475814-概述:满足考勤报分部部门显示及导出时显示全路径
@ -391,12 +392,14 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
bb.writeLog("fieldValue: " + fieldValue);
data.put(fieldName, fieldValue);
} else if ("laborHours".equals(kqReportFieldComInfo.getParentid()) ) {
bb.writeLog("laborHours start ");
int emp = Util.getIntValue(Util.null2String(empTypes.get(id)));
bb.writeLog("emp: " + emp);
if (emp == 0) {
if (emp == 1) {
double attendanceMins = Util.getDoubleValue(Util.null2String(rs.getString("attendanceMins")));
double attendanceHours = Util.getDoubleValue(KQDurationCalculatorUtil.getDurationRound(String.valueOf(attendanceMins / 60.0)));
bb.writeLog("attendanceHours: " + attendanceHours);
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id + "|" + kqdate + "|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
@ -415,6 +418,8 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
fieldValue = KQDurationCalculatorUtil.getDurationRound(String.valueOf(attendanceHours + workingDayOvertime_4leave + restDayOvertime_4leave + holidayOvertime_4leave +
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave));
bb.writeLog("fieldValue: " + fieldValue);
int changeType = KQOvertimeRulesBiz.getChangeType(id, kqdate);
if (changeType == 1 && "holiday".equals(fieldName) ) {

@ -450,10 +450,13 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
// data.put("restday", restdayValue);
fieldValue = String.valueOf(total);
data.put(fieldName,fieldValue);
}else {
double temp = Util.getDoubleValue(Util.null2String(flowData.get("LaborHoursData|" + id + "|" + fieldName)), 0.00);
fieldValue = String.valueOf(temp);
data.put(fieldName,fieldValue);
}

Loading…
Cancel
Save