diff --git a/.idea/artifacts/weaver_develop_jar.xml b/.idea/artifacts/weaver_develop_jar.xml index 6258dfe..2aff103 100644 --- a/.idea/artifacts/weaver_develop_jar.xml +++ b/.idea/artifacts/weaver_develop_jar.xml @@ -1,6 +1,6 @@ - $PROJECT_DIR$/out/artifacts/weaver_develop_jar + $PROJECT_DIR$/../../../../weaver/ecology/WEB-INF/lib diff --git a/src/com/engine/kq/biz/KQBalanceOfLeaveBiz.java b/src/com/engine/kq/biz/KQBalanceOfLeaveBiz.java index 017bee8..d790cac 100644 --- a/src/com/engine/kq/biz/KQBalanceOfLeaveBiz.java +++ b/src/com/engine/kq/biz/KQBalanceOfLeaveBiz.java @@ -2332,10 +2332,15 @@ public class KQBalanceOfLeaveBiz { String subCompanyId = Util.null2String(recordSet.getString("subCompanyId1")); String departmentId = Util.null2String(recordSet.getString("departmentId")); String locationid = Util.null2String(recordSet.getString("locationid")); + String secLevel = Util.null2String(recordSet.getString("seclevel")); /*获取人员的相关信息 end*/ /*获取人员所属分部对应的假期规则 start*/ - rulesDetailId = detailComInfo.getId(ruleId, subCompanyId, departmentId, resourceId); + //rulesDetailId = detailComInfo.getId(ruleId, subCompanyId, departmentId, resourceId); + /*#QC3429745# 批处理操作*/ + rulesDetailId = getRulesDetailId(ruleId,subCompanyId, departmentId, resourceId,secLevel); + + distributionMode = Util.getIntValue(detailComInfo.getDistributionMode(ruleId, subCompanyId, departmentId, resourceId), 1); legalKey = Util.getIntValue(detailComInfo.getLegalKey(ruleId, subCompanyId, departmentId, resourceId), 0); welfareKey = Util.getIntValue(detailComInfo.getWelfareKey(ruleId, subCompanyId, departmentId, resourceId), 1); @@ -2525,6 +2530,45 @@ public class KQBalanceOfLeaveBiz { return isSuccess; } + /** + * 根据人员安全级别获取对应假期规则 + * @param ruleId + * @param subCompanyId + * @param departmentId + * @param resourceId + * @param secLevel + * @return + */ + private static String getRulesDetailId(String ruleId, String subCompanyId, String departmentId, String resourceId, String secLevel) { + String value = ""; + RecordSet rs = new RecordSet(); + //人员 > 部门 > 分部 + String[] SCOPE_TYPES = {"3", "2", "1"}; + String[] scopeValue = {resourceId, departmentId, subCompanyId}; + for (int i = 0; i = ?",ruleId,scopeType,scopevalue,secLevel,secLevel); + if (rs.next()) { + value = Util.null2String(rs.getString("id")); + if (StringUtil.isNotNull(value)){ + break; + } + + } + } + + if (StringUtil.isNull(value)) { + rs.executeQuery("select id from KQ_leaveRulesDetail where ruleId = ? and scopeType = 0 " + + " and minLevel <= ? and maxLevel >= ?",ruleId,secLevel,secLevel); + if (rs.next()) { + value = Util.null2String(rs.getString("id")); + } + } + return value; + } + /** * 获取指定机构下的人员的假期余额 * diff --git a/src/com/engine/kq/cmd/leaverules/AddLeaveRulesCmd.java b/src/com/engine/kq/cmd/leaverules/AddLeaveRulesCmd.java index d738ff8..6c94afe 100644 --- a/src/com/engine/kq/cmd/leaverules/AddLeaveRulesCmd.java +++ b/src/com/engine/kq/cmd/leaverules/AddLeaveRulesCmd.java @@ -111,6 +111,11 @@ public class AddLeaveRulesCmd extends AbstractCommonCommand> /*应用范围为人员时,选择的人员ID*/ String scopeValueMember = Util.null2String(params.get("scopeValueMember")); + /*#QC3429745# 安全级别*/ + String minLevel = Util.null2String(params.get("secLevel")); + String maxLevel = Util.null2String(params.get("secLevelto")); + + if(scopeType == 2) { scopeValue = scopeValueDepartment; } else if(scopeType == 3) { @@ -271,63 +276,63 @@ public class AddLeaveRulesCmd extends AbstractCommonCommand> } } - String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=?"; - RecordSet recordSet = new RecordSet(); - recordSet.executeQuery(searchSql, ruleId); - while (recordSet.next()) { - int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0); - String scopeValueTemp = recordSet.getString("scopeValue"); - - if (scopeType == 0 && scopeTypeTemp == 0) { - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建 - return resultMap; - } - if (scopeType == 1 && scopeTypeTemp == 1) { - List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); - List scopeValueList = Util.TokenizerString(scopeValue, ","); - for (String temp : scopeValueList) - if (scopeValueTempList.contains(temp)) { - SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); - String subcomName = subCompanyComInfo.getSubCompanyname(temp); - - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建 - return resultMap; - } - } - if (scopeType == 2 && scopeTypeTemp == 2) { - List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); - List scopeValueList = Util.TokenizerString(scopeValue, ","); - for (String temp : scopeValueList) - if (scopeValueTempList.contains(temp)) { - DepartmentComInfo comInfo = new DepartmentComInfo(); - String name = comInfo.getDepartmentname(temp); - - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建 - return resultMap; - } - } - if (scopeType == 3 && scopeTypeTemp == 3) { - List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); - List scopeValueList = Util.TokenizerString(scopeValue, ","); - for (String temp : scopeValueList) - if (scopeValueTempList.contains(temp)) { - ResourceComInfo comInfo = new ResourceComInfo(); - String name = comInfo.getLastname(temp); - - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建 - return resultMap; - } - } - } +// String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=?"; + RecordSet recordSet = new RecordSet(); +// recordSet.executeQuery(searchSql, ruleId); +// while (recordSet.next()) { +// int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0); +// String scopeValueTemp = recordSet.getString("scopeValue"); +// +// if (scopeType == 0 && scopeTypeTemp == 0) { +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建 +// return resultMap; +// } +// if (scopeType == 1 && scopeTypeTemp == 1) { +// List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); +// List scopeValueList = Util.TokenizerString(scopeValue, ","); +// for (String temp : scopeValueList) +// if (scopeValueTempList.contains(temp)) { +// SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); +// String subcomName = subCompanyComInfo.getSubCompanyname(temp); +// +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建 +// return resultMap; +// } +// } +// if (scopeType == 2 && scopeTypeTemp == 2) { +// List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); +// List scopeValueList = Util.TokenizerString(scopeValue, ","); +// for (String temp : scopeValueList) +// if (scopeValueTempList.contains(temp)) { +// DepartmentComInfo comInfo = new DepartmentComInfo(); +// String name = comInfo.getDepartmentname(temp); +// +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建 +// return resultMap; +// } +// } +// if (scopeType == 3 && scopeTypeTemp == 3) { +// List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); +// List scopeValueList = Util.TokenizerString(scopeValue, ","); +// for (String temp : scopeValueList) +// if (scopeValueTempList.contains(temp)) { +// ResourceComInfo comInfo = new ResourceComInfo(); +// String name = comInfo.getLastname(temp); +// +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建 +// return resultMap; +// } +// } +// } boolean flag = false;//数据是否插入成功 String sql = "insert into kq_LeaveRulesDetail(ruleId,ruleName,scopeType,scopeValue," + - "distributionMode,annualAmount,legalKey,welfareKey,priority,validityRule,effectiveDays,effectiveMonths,expirationMonth,expirationDay,extensionEnable,extendedDays,releaseRule,calcMethod,convertMode,excludeSubAccount,beforeFormal,severalChildren,yearsOld,isprovince,carryOver,carryOverDays,deductorder,isDelete) values(?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?,?,?,?,0)"; + "distributionMode,annualAmount,legalKey,welfareKey,priority,validityRule,effectiveDays,effectiveMonths,expirationMonth,expirationDay,extensionEnable,extendedDays,releaseRule,calcMethod,convertMode,excludeSubAccount,beforeFormal,severalChildren,yearsOld,isprovince,carryOver,carryOverDays,deductorder,isDelete,minLevel,maxLevel) values(?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?,?,?,?,0,?,?)"; flag = recordSet.executeUpdate(sql, ruleId, ruleName, scopeType, scopeValue, - distributionMode, annualAmount, legalKey, welfareKey, priority, validityRule, effectiveDays, effectiveMonths, expirationMonth, expirationDay, extensionEnable, extendedDays, releaseRule, calcMethod, convertMode, excludeSubAccount, beforeFormal,severalChildren,yearsOld,isprovince,carryOver,carryOverDays,deductorder); + distributionMode, annualAmount, legalKey, welfareKey, priority, validityRule, effectiveDays, effectiveMonths, expirationMonth, expirationDay, extensionEnable, extendedDays, releaseRule, calcMethod, convertMode, excludeSubAccount, beforeFormal,severalChildren,yearsOld,isprovince,carryOver,carryOverDays,deductorder,minLevel,maxLevel); if (!flag) { resultMap.put("sign", "-1"); resultMap.put("message", SystemEnv.getHtmlLabelName(84544, user.getLanguage()));//保存失败 diff --git a/src/com/engine/kq/cmd/leaverules/EditLeaveRulesCmd.java b/src/com/engine/kq/cmd/leaverules/EditLeaveRulesCmd.java index 0de627d..559c117 100644 --- a/src/com/engine/kq/cmd/leaverules/EditLeaveRulesCmd.java +++ b/src/com/engine/kq/cmd/leaverules/EditLeaveRulesCmd.java @@ -112,6 +112,11 @@ public class EditLeaveRulesCmd extends AbstractCommonCommand /*应用范围为人员时,选择的人员ID*/ String scopeValueMember = Util.null2String(params.get("scopeValueMember")); + /*#QC3429745# 安全级别*/ + String minLevel = Util.null2String(params.get("secLevel")); + String maxLevel = Util.null2String(params.get("secLevelto")); + + if(scopeType == 2) { scopeValue = scopeValueDepartment; } else if(scopeType == 3) { @@ -271,63 +276,63 @@ public class EditLeaveRulesCmd extends AbstractCommonCommand } } - String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=? and id<>?"; - RecordSet recordSet = new RecordSet(); - recordSet.executeQuery(searchSql, ruleId, ruleDetailId); - while (recordSet.next()) { - int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0); - String scopeValueTemp = recordSet.getString("scopeValue"); - - if (scopeType == 0 && scopeTypeTemp == 0) { - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建 - return resultMap; - } - if (scopeType == 1 && scopeTypeTemp == 1) { - List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); - List scopeValueList = Util.TokenizerString(scopeValue, ","); - for (String temp : scopeValueList) - if (scopeValueTempList.contains(temp)) { - SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); - String subcomName = subCompanyComInfo.getSubCompanyname(temp); - - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建 - return resultMap; - } - } - if (scopeType == 2 && scopeTypeTemp == 2) { - List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); - List scopeValueList = Util.TokenizerString(scopeValue, ","); - for (String temp : scopeValueList) - if (scopeValueTempList.contains(temp)) { - DepartmentComInfo comInfo = new DepartmentComInfo(); - String name = comInfo.getDepartmentname(temp); - - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建 - return resultMap; - } - } - if (scopeType == 3 && scopeTypeTemp == 3) { - List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); - List scopeValueList = Util.TokenizerString(scopeValue, ","); - for (String temp : scopeValueList) - if (scopeValueTempList.contains(temp)) { - ResourceComInfo comInfo = new ResourceComInfo(); - String name = comInfo.getLastname(temp); - - resultMap.put("status", "-1"); - resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建 - return resultMap; - } - } - } +// String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=? and id<>?"; + RecordSet recordSet = new RecordSet(); +// recordSet.executeQuery(searchSql, ruleId, ruleDetailId); +// while (recordSet.next()) { +// int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0); +// String scopeValueTemp = recordSet.getString("scopeValue"); +// +// if (scopeType == 0 && scopeTypeTemp == 0) { +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建 +// return resultMap; +// } +// if (scopeType == 1 && scopeTypeTemp == 1) { +// List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); +// List scopeValueList = Util.TokenizerString(scopeValue, ","); +// for (String temp : scopeValueList) +// if (scopeValueTempList.contains(temp)) { +// SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); +// String subcomName = subCompanyComInfo.getSubCompanyname(temp); +// +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建 +// return resultMap; +// } +// } +// if (scopeType == 2 && scopeTypeTemp == 2) { +// List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); +// List scopeValueList = Util.TokenizerString(scopeValue, ","); +// for (String temp : scopeValueList) +// if (scopeValueTempList.contains(temp)) { +// DepartmentComInfo comInfo = new DepartmentComInfo(); +// String name = comInfo.getDepartmentname(temp); +// +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建 +// return resultMap; +// } +// } +// if (scopeType == 3 && scopeTypeTemp == 3) { +// List scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); +// List scopeValueList = Util.TokenizerString(scopeValue, ","); +// for (String temp : scopeValueList) +// if (scopeValueTempList.contains(temp)) { +// ResourceComInfo comInfo = new ResourceComInfo(); +// String name = comInfo.getLastname(temp); +// +// resultMap.put("status", "-1"); +// resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建 +// return resultMap; +// } +// } +// } boolean flag = false;//数据是否更新成功 String sql = "update kq_LeaveRulesDetail set ruleId=?,ruleName=?,scopeType=?,scopeValue=?," + - "distributionMode=?,annualAmount=?,legalKey=?,welfareKey=?,priority=?,validityRule=?,effectiveDays=?,effectiveMonths=?,expirationMonth=?,expirationDay=?,extensionEnable=?,extendedDays=?,releaseRule=?,calcMethod=?,convertMode=?,excludeSubAccount=?,beforeFormal=?,severalChildren=?,yearsOld=?,isprovince=? ,carryOver=?,carryOverDays=?,deductorder=? where id=?"; + "distributionMode=?,annualAmount=?,legalKey=?,welfareKey=?,priority=?,validityRule=?,effectiveDays=?,effectiveMonths=?,expirationMonth=?,expirationDay=?,extensionEnable=?,extendedDays=?,releaseRule=?,calcMethod=?,convertMode=?,excludeSubAccount=?,beforeFormal=?,severalChildren=?,yearsOld=?,isprovince=? ,carryOver=?,carryOverDays=?,deductorder=?,minLevel=?,maxLevel=? where id=?"; flag = recordSet.executeUpdate(sql, ruleId, ruleName, scopeType, scopeValue, - distributionMode, annualAmount, legalKey, welfareKey, priority, validityRule, effectiveDays, effectiveMonths, expirationMonth, expirationDay, extensionEnable, extendedDays, releaseRule, calcMethod, convertMode, excludeSubAccount, beforeFormal,severalChildren,yearsOld,isprovince,carryOver,carryOverDays,deductorder,ruleDetailId); + distributionMode, annualAmount, legalKey, welfareKey, priority, validityRule, effectiveDays, effectiveMonths, expirationMonth, expirationDay, extensionEnable, extendedDays, releaseRule, calcMethod, convertMode, excludeSubAccount, beforeFormal,severalChildren,yearsOld,isprovince,carryOver,carryOverDays,deductorder,minLevel,maxLevel,ruleDetailId); if (!flag) { resultMap.put("sign", "-1"); resultMap.put("message", SystemEnv.getHtmlLabelName(84544, user.getLanguage()));//保存失败 diff --git a/src/com/engine/kq/cmd/leaverules/GetLeaveRulesFormCmd.java b/src/com/engine/kq/cmd/leaverules/GetLeaveRulesFormCmd.java index 95706d6..1e728bd 100644 --- a/src/com/engine/kq/cmd/leaverules/GetLeaveRulesFormCmd.java +++ b/src/com/engine/kq/cmd/leaverules/GetLeaveRulesFormCmd.java @@ -75,6 +75,12 @@ public class GetLeaveRulesFormCmd extends AbstractCommonCommand();