//#QC3429745# 年假规则开发 安全级别 上海科蓝柏新材料科技有限公司

上海科蓝柏新材料科技有限公司
Chengliang 6 months ago
parent 92686da8dd
commit 17202da79d

@ -1,6 +1,6 @@
<component name="ArtifactManager"> <component name="ArtifactManager">
<artifact type="jar" name="weaver-develop:jar"> <artifact type="jar" name="weaver-develop:jar">
<output-path>$PROJECT_DIR$/out/artifacts/weaver_develop_jar</output-path> <output-path>$PROJECT_DIR$/../../../../weaver/ecology/WEB-INF/lib</output-path>
<root id="archive" name="weaver-develop.jar"> <root id="archive" name="weaver-develop.jar">
<element id="module-output" name="weaver-develop" /> <element id="module-output" name="weaver-develop" />
</root> </root>

@ -2332,10 +2332,15 @@ public class KQBalanceOfLeaveBiz {
String subCompanyId = Util.null2String(recordSet.getString("subCompanyId1")); String subCompanyId = Util.null2String(recordSet.getString("subCompanyId1"));
String departmentId = Util.null2String(recordSet.getString("departmentId")); String departmentId = Util.null2String(recordSet.getString("departmentId"));
String locationid = Util.null2String(recordSet.getString("locationid")); String locationid = Util.null2String(recordSet.getString("locationid"));
String secLevel = Util.null2String(recordSet.getString("seclevel"));
/*获取人员的相关信息 end*/ /*获取人员的相关信息 end*/
/*获取人员所属分部对应的假期规则 start*/ /*获取人员所属分部对应的假期规则 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); distributionMode = Util.getIntValue(detailComInfo.getDistributionMode(ruleId, subCompanyId, departmentId, resourceId), 1);
legalKey = Util.getIntValue(detailComInfo.getLegalKey(ruleId, subCompanyId, departmentId, resourceId), 0); legalKey = Util.getIntValue(detailComInfo.getLegalKey(ruleId, subCompanyId, departmentId, resourceId), 0);
welfareKey = Util.getIntValue(detailComInfo.getWelfareKey(ruleId, subCompanyId, departmentId, resourceId), 1); welfareKey = Util.getIntValue(detailComInfo.getWelfareKey(ruleId, subCompanyId, departmentId, resourceId), 1);
@ -2525,6 +2530,45 @@ public class KQBalanceOfLeaveBiz {
return isSuccess; 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 <SCOPE_TYPES.length ; i++) {
String scopevalue = scopeValue[i];
String scopeType = SCOPE_TYPES[i];
rs.executeQuery("select id from KQ_leaveRulesDetail where ruleId = ? and scopeType = ? " +
" and scopeValue = ? and minLevel <= ? and maxLevel >= ?",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;
}
/** /**
* *
* *

@ -111,6 +111,11 @@ public class AddLeaveRulesCmd extends AbstractCommonCommand<Map<String, Object>>
/*应用范围为人员时选择的人员ID*/ /*应用范围为人员时选择的人员ID*/
String scopeValueMember = Util.null2String(params.get("scopeValueMember")); 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) { if(scopeType == 2) {
scopeValue = scopeValueDepartment; scopeValue = scopeValueDepartment;
} else if(scopeType == 3) { } else if(scopeType == 3) {
@ -271,63 +276,63 @@ public class AddLeaveRulesCmd extends AbstractCommonCommand<Map<String, Object>>
} }
} }
String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=?"; // String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=?";
RecordSet recordSet = new RecordSet(); RecordSet recordSet = new RecordSet();
recordSet.executeQuery(searchSql, ruleId); // recordSet.executeQuery(searchSql, ruleId);
while (recordSet.next()) { // while (recordSet.next()) {
int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0); // int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0);
String scopeValueTemp = recordSet.getString("scopeValue"); // String scopeValueTemp = recordSet.getString("scopeValue");
//
if (scopeType == 0 && scopeTypeTemp == 0) { // if (scopeType == 0 && scopeTypeTemp == 0) {
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
if (scopeType == 1 && scopeTypeTemp == 1) { // if (scopeType == 1 && scopeTypeTemp == 1) {
List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); // List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ",");
List<String> scopeValueList = Util.TokenizerString(scopeValue, ","); // List<String> scopeValueList = Util.TokenizerString(scopeValue, ",");
for (String temp : scopeValueList) // for (String temp : scopeValueList)
if (scopeValueTempList.contains(temp)) { // if (scopeValueTempList.contains(temp)) {
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); // SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
String subcomName = subCompanyComInfo.getSubCompanyname(temp); // String subcomName = subCompanyComInfo.getSubCompanyname(temp);
//
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
} // }
if (scopeType == 2 && scopeTypeTemp == 2) { // if (scopeType == 2 && scopeTypeTemp == 2) {
List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); // List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ",");
List<String> scopeValueList = Util.TokenizerString(scopeValue, ","); // List<String> scopeValueList = Util.TokenizerString(scopeValue, ",");
for (String temp : scopeValueList) // for (String temp : scopeValueList)
if (scopeValueTempList.contains(temp)) { // if (scopeValueTempList.contains(temp)) {
DepartmentComInfo comInfo = new DepartmentComInfo(); // DepartmentComInfo comInfo = new DepartmentComInfo();
String name = comInfo.getDepartmentname(temp); // String name = comInfo.getDepartmentname(temp);
//
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
} // }
if (scopeType == 3 && scopeTypeTemp == 3) { // if (scopeType == 3 && scopeTypeTemp == 3) {
List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); // List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ",");
List<String> scopeValueList = Util.TokenizerString(scopeValue, ","); // List<String> scopeValueList = Util.TokenizerString(scopeValue, ",");
for (String temp : scopeValueList) // for (String temp : scopeValueList)
if (scopeValueTempList.contains(temp)) { // if (scopeValueTempList.contains(temp)) {
ResourceComInfo comInfo = new ResourceComInfo(); // ResourceComInfo comInfo = new ResourceComInfo();
String name = comInfo.getLastname(temp); // String name = comInfo.getLastname(temp);
//
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
} // }
} // }
boolean flag = false;//数据是否插入成功 boolean flag = false;//数据是否插入成功
String sql = "insert into kq_LeaveRulesDetail(ruleId,ruleName,scopeType,scopeValue," + 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, 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) { if (!flag) {
resultMap.put("sign", "-1"); resultMap.put("sign", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(84544, user.getLanguage()));//保存失败 resultMap.put("message", SystemEnv.getHtmlLabelName(84544, user.getLanguage()));//保存失败

@ -112,6 +112,11 @@ public class EditLeaveRulesCmd extends AbstractCommonCommand<Map<String, Object>
/*应用范围为人员时选择的人员ID*/ /*应用范围为人员时选择的人员ID*/
String scopeValueMember = Util.null2String(params.get("scopeValueMember")); 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) { if(scopeType == 2) {
scopeValue = scopeValueDepartment; scopeValue = scopeValueDepartment;
} else if(scopeType == 3) { } else if(scopeType == 3) {
@ -271,63 +276,63 @@ public class EditLeaveRulesCmd extends AbstractCommonCommand<Map<String, Object>
} }
} }
String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=? and id<>?"; // String searchSql = "select * from kq_LeaveRulesDetail where (isDelete is null or isDelete<>1) and ruleId=? and id<>?";
RecordSet recordSet = new RecordSet(); RecordSet recordSet = new RecordSet();
recordSet.executeQuery(searchSql, ruleId, ruleDetailId); // recordSet.executeQuery(searchSql, ruleId, ruleDetailId);
while (recordSet.next()) { // while (recordSet.next()) {
int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0); // int scopeTypeTemp = Util.getIntValue(recordSet.getString("scopeType"), 0);
String scopeValueTemp = recordSet.getString("scopeValue"); // String scopeValueTemp = recordSet.getString("scopeValue");
//
if (scopeType == 0 && scopeTypeTemp == 0) { // if (scopeType == 0 && scopeTypeTemp == 0) {
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(505667, user.getLanguage()));//该假期类型下已经新建过总部的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
if (scopeType == 1 && scopeTypeTemp == 1) { // if (scopeType == 1 && scopeTypeTemp == 1) {
List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); // List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ",");
List<String> scopeValueList = Util.TokenizerString(scopeValue, ","); // List<String> scopeValueList = Util.TokenizerString(scopeValue, ",");
for (String temp : scopeValueList) // for (String temp : scopeValueList)
if (scopeValueTempList.contains(temp)) { // if (scopeValueTempList.contains(temp)) {
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); // SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
String subcomName = subCompanyComInfo.getSubCompanyname(temp); // String subcomName = subCompanyComInfo.getSubCompanyname(temp);
//
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(505668, user.getLanguage()).replace("$", subcomName));//该假期类型下已经新建过分部的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
} // }
if (scopeType == 2 && scopeTypeTemp == 2) { // if (scopeType == 2 && scopeTypeTemp == 2) {
List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); // List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ",");
List<String> scopeValueList = Util.TokenizerString(scopeValue, ","); // List<String> scopeValueList = Util.TokenizerString(scopeValue, ",");
for (String temp : scopeValueList) // for (String temp : scopeValueList)
if (scopeValueTempList.contains(temp)) { // if (scopeValueTempList.contains(temp)) {
DepartmentComInfo comInfo = new DepartmentComInfo(); // DepartmentComInfo comInfo = new DepartmentComInfo();
String name = comInfo.getDepartmentname(temp); // String name = comInfo.getDepartmentname(temp);
//
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(534890, user.getLanguage()).replace("$", name));//该假期类型下已经新建过部门的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
} // }
if (scopeType == 3 && scopeTypeTemp == 3) { // if (scopeType == 3 && scopeTypeTemp == 3) {
List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ","); // List<String> scopeValueTempList = Util.TokenizerString(scopeValueTemp, ",");
List<String> scopeValueList = Util.TokenizerString(scopeValue, ","); // List<String> scopeValueList = Util.TokenizerString(scopeValue, ",");
for (String temp : scopeValueList) // for (String temp : scopeValueList)
if (scopeValueTempList.contains(temp)) { // if (scopeValueTempList.contains(temp)) {
ResourceComInfo comInfo = new ResourceComInfo(); // ResourceComInfo comInfo = new ResourceComInfo();
String name = comInfo.getLastname(temp); // String name = comInfo.getLastname(temp);
//
resultMap.put("status", "-1"); // resultMap.put("status", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建 // resultMap.put("message", SystemEnv.getHtmlLabelName(534891, user.getLanguage()).replace("$", name));//该假期类型下已经新建过人员的假期规则,请勿重复新建
return resultMap; // return resultMap;
} // }
} // }
} // }
boolean flag = false;//数据是否更新成功 boolean flag = false;//数据是否更新成功
String sql = "update kq_LeaveRulesDetail set ruleId=?,ruleName=?,scopeType=?,scopeValue=?," + 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, 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) { if (!flag) {
resultMap.put("sign", "-1"); resultMap.put("sign", "-1");
resultMap.put("message", SystemEnv.getHtmlLabelName(84544, user.getLanguage()));//保存失败 resultMap.put("message", SystemEnv.getHtmlLabelName(84544, user.getLanguage()));//保存失败

@ -75,6 +75,12 @@ public class GetLeaveRulesFormCmd extends AbstractCommonCommand<Map<String, Obje
/*应用范围为分部时选择的分部ID*/ /*应用范围为分部时选择的分部ID*/
String scopeValue = ""; String scopeValue = "";
/*最小安全级别*/
String minLevel = "";
/*最大安全级别*/
String maxLevel = "";
/*余额发放方式1-手动发放、2-按司龄自动发放、3-按工龄自动发放、4-每年自动发放固定天数、5-加班时长自动计入余额、6-按工龄+司龄自动发放*/ /*余额发放方式1-手动发放、2-按司龄自动发放、3-按工龄自动发放、4-每年自动发放固定天数、5-加班时长自动计入余额、6-按工龄+司龄自动发放*/
int distributionMode = 1; int distributionMode = 1;
@ -169,6 +175,8 @@ public class GetLeaveRulesFormCmd extends AbstractCommonCommand<Map<String, Obje
isEdit = true; isEdit = true;
ruleName = recordSet.getString("ruleName"); ruleName = recordSet.getString("ruleName");
minLevel = recordSet.getString("minLevel");
maxLevel = recordSet.getString("maxLevel");
ruleId = recordSet.getString("ruleId"); ruleId = recordSet.getString("ruleId");
scopeType = recordSet.getInt("scopeType"); scopeType = recordSet.getInt("scopeType");
scopeValue = recordSet.getString("scopeValue"); scopeValue = recordSet.getString("scopeValue");
@ -502,6 +510,28 @@ public class GetLeaveRulesFormCmd extends AbstractCommonCommand<Map<String, Obje
groupItem.put("items", itemList); groupItem.put("items", itemList);
groupList.add(groupItem); groupList.add(groupItem);
//#QC3429745# 年假规则开发 安全级别
hrmFieldBean = new HrmFieldBean();
hrmFieldBean.setFieldname("secLevel");
hrmFieldBean.setFieldlabel("683");
hrmFieldBean.setFieldhtmltype("1");
hrmFieldBean.setType("2");
hrmFieldBean.setIsScope(true);
hrmFieldBean.setIsFormField(true);
hrmFieldBean.setViewAttr(3);
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
searchConditionItem.setViewAttr(3);
searchConditionItem.setRules("required");
if (isEdit) {
searchConditionItem.setStartValue(minLevel);
searchConditionItem.setEndValue(maxLevel);
}
searchConditionItem.setValue(new Integer[]{0,100});
itemList.add(searchConditionItem);
/****************************************************发放规则****************************************************/ /****************************************************发放规则****************************************************/
groupItem = new HashMap<String, Object>(); groupItem = new HashMap<String, Object>();

Loading…
Cancel
Save