@ -571,7 +571,9 @@ public class ExtendInfoBO {
Map < String , Object > groupitem = null ;
Map < String , Object > groupitem = null ;
List < Object > itemlist = null ;
List < Object > itemlist = null ;
try {
try {
if ( isAdd ) viewAttr = 2 ;
if ( isAdd ) {
viewAttr = 2 ;
}
if ( id . length ( ) = = 0 ) {
if ( id . length ( ) = = 0 ) {
id = "" + user . getUID ( ) ;
id = "" + user . getUID ( ) ;
}
}
@ -587,9 +589,10 @@ public class ExtendInfoBO {
if ( recordSet . next ( ) ) {
if ( recordSet . next ( ) ) {
subcompanyid = Util . toScreen ( recordSet . getString ( "subcompanyid1" ) , user . getLanguage ( ) ) ;
subcompanyid = Util . toScreen ( recordSet . getString ( "subcompanyid1" ) , user . getLanguage ( ) ) ;
departmentId = StringUtil . vString ( recordSet . getString ( "departmentId" ) ) ;
departmentId = StringUtil . vString ( recordSet . getString ( "departmentId" ) ) ;
if ( subcompanyid = = null | | subcompanyid . equals ( "" ) | | subcompanyid . equalsIgnoreCase ( "null" ) )
if ( subcompanyid = = null | | "" . equals ( subcompanyid ) | | "null" . equalsIgnoreCase ( subcompanyid ) ) {
subcompanyid = "-1" ;
subcompanyid = "-1" ;
}
}
}
int operatelevel = - 1 ;
int operatelevel = - 1 ;
//人力资源模块是否开启了管理分权,如不是,则不显示框架,直接转向到列表页面(新的分权管理)
//人力资源模块是否开启了管理分权,如不是,则不显示框架,直接转向到列表页面(新的分权管理)
int hrmdetachable = 0 ;
int hrmdetachable = 0 ;
@ -616,14 +619,18 @@ public class ExtendInfoBO {
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo ( ) ;
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo ( ) ;
com . engine . hrm . biz . HrmFieldManager hfm = new com . engine . hrm . biz . HrmFieldManager ( "HrmCustomFieldByInfoType" , scopeId ) ;
com . engine . hrm . biz . HrmFieldManager hfm = new com . engine . hrm . biz . HrmFieldManager ( "HrmCustomFieldByInfoType" , scopeId ) ;
CustomFieldManager cfm = new CustomFieldManager ( "HrmCustomFieldByInfoType" , scopeId ) ;
CustomFieldManager cfm = new CustomFieldManager ( "HrmCustomFieldByInfoType" , scopeId ) ;
if ( viewAttr ! = 1 ) hfm . isReturnDecryptData ( true ) ;
if ( viewAttr ! = 1 ) {
hfm . isReturnDecryptData ( true ) ;
}
hfm . getHrmData ( Util . getIntValue ( id ) ) ;
hfm . getHrmData ( Util . getIntValue ( id ) ) ;
cfm . getCustomData ( Util . getIntValue ( id ) ) ;
cfm . getCustomData ( Util . getIntValue ( id ) ) ;
HrmListValidate hrmListValidate = new HrmListValidate ( ) ;
HrmListValidate hrmListValidate = new HrmListValidate ( ) ;
while ( HrmFieldGroupComInfo . next ( ) ) {
while ( HrmFieldGroupComInfo . next ( ) ) {
int grouptype = Util . getIntValue ( HrmFieldGroupComInfo . getType ( ) ) ;
int grouptype = Util . getIntValue ( HrmFieldGroupComInfo . getType ( ) ) ;
if ( grouptype ! = scopeId ) continue ;
if ( grouptype ! = scopeId ) {
continue ;
}
int grouplabel = Util . getIntValue ( HrmFieldGroupComInfo . getLabel ( ) ) ;
int grouplabel = Util . getIntValue ( HrmFieldGroupComInfo . getLabel ( ) ) ;
int groupid = Util . getIntValue ( HrmFieldGroupComInfo . getid ( ) ) ;
int groupid = Util . getIntValue ( HrmFieldGroupComInfo . getid ( ) ) ;
hfm . getCustomFields ( groupid ) ;
hfm . getCustomFields ( groupid ) ;
@ -635,7 +642,7 @@ public class ExtendInfoBO {
if ( groupid = = 4 ) {
if ( groupid = = 4 ) {
groupitem . put ( "hide" , ( ! isAdd & & ! canEdit & & isSelf & & viewAttr = = 2 & & hfm . getContactEditCount ( ) = = 0 ) | | ! hrmListValidate . isValidate ( 42 ) ) ;
groupitem . put ( "hide" , ( ! isAdd & & ! canEdit & & isSelf & & viewAttr = = 2 & & hfm . getContactEditCount ( ) = = 0 ) | | ! hrmListValidate . isValidate ( 42 ) ) ;
} else {
} else {
groupitem . put ( "hide" , ( ! isAdd & & ! canEdit & & isSelf & & viewAttr = = 2 & & hfm . getContactEditCount ( ) = = 0 ) | | ! Util . null2String ( HrmFieldGroupComInfo . getIsShow ( ) ) . equals ( "1" ) ) ;
groupitem . put ( "hide" , ( ! isAdd & & ! canEdit & & isSelf & & viewAttr = = 2 & & hfm . getContactEditCount ( ) = = 0 ) | | ! "1" . equals ( Util . null2String ( HrmFieldGroupComInfo . getIsShow ( ) ) ) ) ;
}
}
groupitem . put ( "items" , itemlist ) ;
groupitem . put ( "items" , itemlist ) ;
lsGroup . add ( groupitem ) ;
lsGroup . add ( groupitem ) ;
@ -649,7 +656,9 @@ public class ExtendInfoBO {
} else {
} else {
fieldValue = Util . null2String ( new EncryptUtil ( ) . decrypt ( "cus_fielddata" , "field" + hfm . getFieldid ( ) , "HrmCustomFieldByInfoType" , "" + scopeId , cfm . getData ( "field" + hfm . getFieldid ( ) ) , viewAttr = = 2 , true ) ) ;
fieldValue = Util . null2String ( new EncryptUtil ( ) . decrypt ( "cus_fielddata" , "field" + hfm . getFieldid ( ) , "HrmCustomFieldByInfoType" , "" + scopeId , cfm . getData ( "field" + hfm . getFieldid ( ) ) , viewAttr = = 2 , true ) ) ;
cusFieldname = "customfield" + hfm . getFieldid ( ) ;
cusFieldname = "customfield" + hfm . getFieldid ( ) ;
if ( isAdd ) cusFieldname = "customfield_1_" + hfm . getFieldid ( ) ;
if ( isAdd ) {
cusFieldname = "customfield_1_" + hfm . getFieldid ( ) ;
}
}
}
if ( ! hfm . isUse ( ) | | ( ! isAdd & & viewAttr = = 2 & & ! canEdit & & isSelf & & ! hfm . isModify ( ) ) ) {
if ( ! hfm . isUse ( ) | | ( ! isAdd & & viewAttr = = 2 & & ! canEdit & & isSelf & & ! hfm . isModify ( ) ) ) {
@ -681,19 +690,19 @@ public class ExtendInfoBO {
hrmFieldBean . setFieldvalue ( fieldValue ) ;
hrmFieldBean . setFieldvalue ( fieldValue ) ;
}
}
hrmFieldBean . setIsFormField ( true ) ;
hrmFieldBean . setIsFormField ( true ) ;
if ( viewAttr = = 2 & & ( ( String ) hrmFieldConf . get ( "ismand" ) ) . equals ( "1" ) ) {
if ( viewAttr = = 2 & & "1" . equals ( ( String ) hrmFieldConf . get ( "ismand" ) ) ) {
tmpviewattr = 3 ;
tmpviewattr = 3 ;
if ( hrmFieldBean . getFieldhtmltype ( ) . equals ( "3" ) ) {
if ( "3" . equals ( hrmFieldBean . getFieldhtmltype ( ) ) ) {
hrmFieldBean . setRules ( "required|string" ) ;
hrmFieldBean . setRules ( "required|string" ) ;
// if (hrmFieldBean.getType().equals("2")||hrmFieldBean.getType().equals("161")||hrmFieldBean.getType().equals("162")) {
// if (hrmFieldBean.getType().equals("2")||hrmFieldBean.getType().equals("161")||hrmFieldBean.getType().equals("162")) {
// hrmFieldBean.setRules("required|string");
// hrmFieldBean.setRules("required|string");
// }else{
// }else{
// hrmFieldBean.setRules("required|integer");
// hrmFieldBean.setRules("required|integer");
// }
// }
} else if ( hrmFieldBean . getFieldhtmltype ( ) . equals ( "4" ) | |
} else if ( "4" . equals ( hrmFieldBean . getFieldhtmltype ( ) ) | |
hrmFieldBean . getFieldhtmltype ( ) . equals ( "5" ) ) {
"5" . equals ( hrmFieldBean . getFieldhtmltype ( ) ) ) {
hrmFieldBean . setRules ( "required|integer" ) ;
hrmFieldBean . setRules ( "required|integer" ) ;
} else if ( hrmFieldBean . getFieldhtmltype ( ) .equals ( "1" ) & & hrmFieldBean . getType ( ) . equals ( "2" ) ) {
} else if ( "1" . equals ( hrmFieldBean . getFieldhtmltype ( ) ) & & "2" . equals ( hrmFieldBean . getType ( ) ) ) {
hrmFieldBean . setRules ( "required|integer" ) ;
hrmFieldBean . setRules ( "required|integer" ) ;
} else {
} else {
hrmFieldBean . setRules ( "required|string" ) ;
hrmFieldBean . setRules ( "required|string" ) ;
@ -701,14 +710,18 @@ public class ExtendInfoBO {
}
}
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo . getSearchConditionItem ( hrmFieldBean , user ) ;
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo . getSearchConditionItem ( hrmFieldBean , user ) ;
if ( searchConditionItem = = null ) continue ;
if ( searchConditionItem = = null ) {
continue ;
}
if ( searchConditionItem . getBrowserConditionParam ( ) ! = null ) {
if ( searchConditionItem . getBrowserConditionParam ( ) ! = null ) {
searchConditionItem . getBrowserConditionParam ( ) . setViewAttr ( tmpviewattr ) ;
searchConditionItem . getBrowserConditionParam ( ) . setViewAttr ( tmpviewattr ) ;
}
}
searchConditionItem . setViewAttr ( tmpviewattr ) ;
searchConditionItem . setViewAttr ( tmpviewattr ) ;
itemlist . add ( searchConditionItem ) ;
itemlist . add ( searchConditionItem ) ;
}
}
if ( itemlist . size ( ) = = 0 ) lsGroup . remove ( groupitem ) ;
if ( itemlist . size ( ) = = 0 ) {
lsGroup . remove ( groupitem ) ;
}
}
}
result . put ( "conditions" , lsGroup ) ;
result . put ( "conditions" , lsGroup ) ;
@ -764,7 +777,9 @@ public class ExtendInfoBO {
LinkedHashMap < String , String > ht = new LinkedHashMap < String , String > ( ) ;
LinkedHashMap < String , String > ht = new LinkedHashMap < String , String > ( ) ;
RecordSet . executeSql ( "select id, formlabel,viewtype from cus_treeform where parentid=" + scopeId + " order by scopeorder" ) ;
RecordSet . executeSql ( "select id, formlabel,viewtype from cus_treeform where parentid=" + scopeId + " order by scopeorder" ) ;
while ( RecordSet . next ( ) ) {
while ( RecordSet . next ( ) ) {
if ( RecordSet . getInt ( "viewtype" ) ! = 1 ) continue ;
if ( RecordSet . getInt ( "viewtype" ) ! = 1 ) {
continue ;
}
titles = new ArrayList < HrmFieldBean > ( ) ;
titles = new ArrayList < HrmFieldBean > ( ) ;
int subId = RecordSet . getInt ( "id" ) ;
int subId = RecordSet . getInt ( "id" ) ;
CustomFieldManager cfm2 = new CustomFieldManager ( "HrmCustomFieldByInfoType" , subId ) ;
CustomFieldManager cfm2 = new CustomFieldManager ( "HrmCustomFieldByInfoType" , subId ) ;
@ -775,19 +790,27 @@ public class ExtendInfoBO {
int col = 0 ;
int col = 0 ;
while ( cfm2 . next ( ) ) {
while ( cfm2 . next ( ) ) {
rowcount + + ;
rowcount + + ;
if ( ! cfm2 . isUse ( ) | | ( ! isAdd & & viewAttr = = 2 & & ! canEdit & & isSelf & & ! cfm2 . isModify ( ) ) ) continue ;
if ( ! cfm2 . isUse ( ) | | ( ! isAdd & & viewAttr = = 2 & & ! canEdit & & isSelf & & ! cfm2 . isModify ( ) ) ) {
continue ;
}
col + + ;
col + + ;
}
}
if ( rowcount = = 0 ) continue ;
if ( rowcount = = 0 ) {
continue ;
}
cfm2 . beforeFirst ( ) ;
cfm2 . beforeFirst ( ) ;
ht . put ( "cus_list_" + subId , RecordSet . getString ( "formlabel" ) ) ;
ht . put ( "cus_list_" + subId , RecordSet . getString ( "formlabel" ) ) ;
cfm2 . beforeFirst ( ) ;
cfm2 . beforeFirst ( ) ;
while ( cfm2 . next ( ) ) {
while ( cfm2 . next ( ) ) {
if ( ! cfm2 . isUse ( ) | | ( ! isAdd & & viewAttr = = 2 & & ! canEdit & & isSelf & & ! cfm2 . isModify ( ) ) ) continue ;
if ( ! cfm2 . isUse ( ) | | ( ! isAdd & & viewAttr = = 2 & & ! canEdit & & isSelf & & ! cfm2 . isModify ( ) ) ) {
continue ;
}
int tmpviewattr = viewAttr ;
int tmpviewattr = viewAttr ;
//创建表头
//创建表头
String fieldname = "customfield" + cfm2 . getId ( ) + "_" + subId ;
String fieldname = "customfield" + cfm2 . getId ( ) + "_" + subId ;
if ( isAdd ) fieldname = "customfield_1_" + cfm2 . getId ( ) + "_" + subId ;
if ( isAdd ) {
fieldname = "customfield_1_" + cfm2 . getId ( ) + "_" + subId ;
}
hrmFieldBean = new HrmFieldBean ( ) ;
hrmFieldBean = new HrmFieldBean ( ) ;
hrmFieldBean . setFieldid ( "" + cfm2 . getId ( ) ) ;
hrmFieldBean . setFieldid ( "" + cfm2 . getId ( ) ) ;
hrmFieldBean . setFieldname ( fieldname ) ;
hrmFieldBean . setFieldname ( fieldname ) ;
@ -820,20 +843,22 @@ public class ExtendInfoBO {
int fieldhtmltype = Util . getIntValue ( cfm2 . getHtmlType ( ) ) ;
int fieldhtmltype = Util . getIntValue ( cfm2 . getHtmlType ( ) ) ;
String fieldname = "customfield" + cfm2 . getId ( ) + "_" + subId ;
String fieldname = "customfield" + cfm2 . getId ( ) + "_" + subId ;
if ( isAdd ) fieldname = "customfield_1_" + cfm2 . getId ( ) + "_" + subId ;
if ( isAdd ) {
fieldname = "customfield_1_" + cfm2 . getId ( ) + "_" + subId ;
}
String fieldvalue = "" ;
String fieldvalue = "" ;
if ( ! isAdd ) {
if ( ! isAdd ) {
fieldvalue = Util . null2String ( CustomFieldTreeManager . getMutiData ( "field" + fieldid ) ) ;
fieldvalue = Util . null2String ( CustomFieldTreeManager . getMutiData ( "field" + fieldid ) ) ;
}
}
data . put ( fieldname , fieldvalue ) ;
data . put ( fieldname , fieldvalue ) ;
if ( cfm2 . getHtmlType ( ) . equals ( "1" ) & & cfm2 . getType ( ) = = 1 ) {
if ( "1" . equals ( cfm2 . getHtmlType ( ) ) & & cfm2 . getType ( ) = = 1 ) {
data . put ( fieldname , TextUtil . toBase64ForMultilang ( Util . null2String ( fieldvalue ) ) ) ;
data . put ( fieldname , TextUtil . toBase64ForMultilang ( Util . null2String ( fieldvalue ) ) ) ;
} else if ( cfm2 . getHtmlType ( ) . equals ( "3" ) ) {
} else if ( "3" . equals ( cfm2 . getHtmlType ( ) ) ) {
String fieldshowname = hfm . getFieldvalue ( user , dmlurl , fieldid , fieldhtmltype , type , fieldvalue , 0 ) ;
String fieldshowname = hfm . getFieldvalue ( user , dmlurl , fieldid , fieldhtmltype , type , fieldvalue , 0 ) ;
data . put ( fieldname , fieldvalue ) ;
data . put ( fieldname , fieldvalue ) ;
data . put ( fieldname + "span" , fieldshowname ) ;
data . put ( fieldname + "span" , fieldshowname ) ;
} else if ( cfm2 . getHtmlType ( ) . equals ( "4" ) ) {
} else if ( "4" . equals ( cfm2 . getHtmlType ( ) ) ) {
data . put ( fieldname , fieldvalue . equals ( "1" ) ) ;
data . put ( fieldname , "1" . equals ( fieldvalue ) ) ;
}
}
//只允许有权限的人删除明细行,没有权限的人只能修改不能删除
//只允许有权限的人删除明细行,没有权限的人只能修改不能删除
if ( canEdit ) {
if ( canEdit ) {