@ -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 ( ) ) ) ; //保存失败