@ -33,7 +33,6 @@ import weaver.systeminfo.SystemEnv;
import java.util.* ;
/ * *
* @description :
* @author : dxfeng
* @createTime : 2022 / 05 / 19
* @version : 1.0
@ -52,15 +51,14 @@ public class ExtendInfoBO {
Map < String , Object > col ;
int width = 100 / infoPOList . size ( ) ;
for ( int i = 0 ; infoPOList ! = null & & i < infoPOList . size ( ) ; i + + ) {
ExtendInfoPO extendInfoPO = infoPOList . get ( i ) ;
for ( ExtendInfoPO extendInfoPO : infoPOList ) {
String tmpkey = extendInfoPO . getFieldName ( ) ;
col = new HashMap < > ( ) ;
col . put ( "title" , extendInfoPO . getFieldNameDesc ( ) ) ;
col . put ( "key" , tmpkey ) ;
col . put ( "dataIndex" , tmpkey ) ;
col . put ( "com" , getFieldDet i alInfo( user , extendInfoPO , viewAttr , showLabel , width ) ) ;
col . put ( "com" , getFieldDet ai lInfo( user , extendInfoPO , viewAttr , showLabel , width ) ) ;
col . put ( "width" , width + "%" ) ;
@ -73,12 +71,11 @@ public class ExtendInfoBO {
/ * *
* 新 增 自 定 义 字 段 时 , 对 象 转 换
*
* @param user
* @param infoFieldParam
* @param extendGroupPO
* @param extendGroupId
* @param showOrder
* @return
* @param user 当 前 用 户
* @param infoFieldParam 拓 展 字 段
* @param extendGroupPO 分 组 实 体
* @param extendGroupId 分 组 ID
* @param showOrder 展 示 顺 序
* /
public static ExtendInfoPO convertFieldParam2ExtendInfo ( User user , ExtendInfoFieldParam infoFieldParam , ExtendGroupPO extendGroupPO , Long extendGroupId , Integer showOrder ) {
if ( null = = infoFieldParam ) {
@ -146,9 +143,8 @@ public class ExtendInfoBO {
/ * *
* 当 前 自 定 义 字 段 是 否 已 使 用
*
* @param tableName
* @param fieldName
* @return
* @param tableName 表 名
* @param fieldName 字 段 名
* /
public static boolean fieldIsUsed ( String tableName , String fieldName ) {
if ( StringUtils . isAnyEmpty ( tableName , fieldName ) ) {
@ -162,13 +158,12 @@ public class ExtendInfoBO {
/ * *
* 明 细 表 字 段
*
* @param user
* @param extendInfoPO
* @param viewAttr
* @return
* @param user 当 前 用 户
* @param extendInfoPO 名 字 表 字 段 实 体
* @param viewAttr 操 作 类 型
* /
private static List < FieldItem > getFieldDet i alInfo( User user , ExtendInfoPO extendInfoPO , int viewAttr , boolean showLabel , int width ) {
List < FieldItem > ls = new ArrayList < FieldItem > ( ) ;
private static List < FieldItem > getFieldDet ai lInfo( User user , ExtendInfoPO extendInfoPO , int viewAttr , boolean showLabel , int width ) {
List < FieldItem > ls = new ArrayList < > ( ) ;
FieldItem fieldItem = createField ( user , extendInfoPO , viewAttr , showLabel , width ) ;
ls . add ( fieldItem ) ;
return ls ;
@ -177,12 +172,11 @@ public class ExtendInfoBO {
/ * *
* 创 建 列 表 字 段 信 息
*
* @param user
* @param extendInfoPO
* @param viewAttr
* @param showLabel
* @param width
* @return
* @param user 当 前 用 户
* @param extendInfoPO 字 段 信 息
* @param viewAttr 操 作 类 型
* @param showLabel 展 示 名 字
* @param width 宽 度
* /
private static FieldItem createField ( User user , ExtendInfoPO extendInfoPO , int viewAttr , boolean showLabel , int width ) {
FieldItem fieldItem = new FieldItem ( ) ;
@ -192,7 +186,7 @@ public class ExtendInfoBO {
fieldItem . setLabel ( "" ) ;
}
fieldItem . setType ( getField htmlt ype( extendInfoPO . getControlType ( ) + "" ) ) ;
fieldItem . setType ( getField HtmlT ype( extendInfoPO . getControlType ( ) + "" ) ) ;
fieldItem . setKey ( extendInfoPO . getFieldName ( ) ) ;
// 查看操作 全部设置为只读
if ( 1 = = viewAttr ) {
@ -221,25 +215,32 @@ public class ExtendInfoBO {
/ * *
* 获 取 对 应 的 控 件 类 型
*
* @param fieldhtmltype
* @return
* @param fieldHtmlType 控 件 类 型
* /
private static FieldType getField htmltype( String fieldhtmlt ype) {
private static FieldType getField HtmlType( String fieldHtmlT ype) {
FieldType fieldtype = null ;
if ( fieldhtmltype . equals ( "1" ) ) {
fieldtype = FieldType . INPUT ;
} else if ( fieldhtmltype . equals ( "2" ) ) {
fieldtype = FieldType . TEXTAREA ;
} else if ( fieldhtmltype . equals ( "3" ) ) {
fieldtype = FieldType . BROWSER ;
} else if ( fieldhtmltype . equals ( "4" ) ) {
fieldtype = FieldType . CHECKBOX ;
} else if ( fieldhtmltype . equals ( "5" ) ) {
fieldtype = FieldType . SELECT ;
} else if ( fieldhtmltype . equals ( "6" ) ) {
fieldtype = FieldType . FILEUPLOAD ;
} else if ( fieldhtmltype . equals ( "7" ) ) {
fieldtype = FieldType . TEXT ;
switch ( fieldHtmlType ) {
case "1" :
fieldtype = FieldType . INPUT ;
break ;
case "2" :
fieldtype = FieldType . TEXTAREA ;
break ;
case "3" :
fieldtype = FieldType . BROWSER ;
break ;
case "4" :
fieldtype = FieldType . CHECKBOX ;
break ;
case "5" :
fieldtype = FieldType . SELECT ;
break ;
case "6" :
fieldtype = FieldType . FILEUPLOAD ;
break ;
case "7" :
fieldtype = FieldType . TEXT ;
break ;
}
return fieldtype ;
}
@ -256,208 +257,228 @@ public class ExtendInfoBO {
HrmFieldManager hrmFieldManager = new HrmFieldManager ( ) ;
String fieldid = Util . null2String ( extendInfoPO . getId ( ) ) ; //字段id
String fieldname = Util . null2String ( extendInfoPO . getFieldName ( ) ) ; //字段名
String fieldlabel = Util . null2String ( extendInfoPO . getFieldNameDesc ( ) ) ; //字段显示名
// String fieldlabel = Util.null2String(extendInfoPO.getFieldNameDesc());//字段显示名
String fieldlabel = "502327" ; //字段显示名
String fieldhtmltype = Util . null2String ( extendInfoPO . getControlType ( ) ) ; //字段类型
String detailtype = Util . null2String ( extendInfoPO . getBrowserType ( ) ) ; //字段二级类型(浏览框--单人力)
String customValue = Util . null2String ( extendInfoPO . getCustomValue ( ) ) ;
boolean isQuickSearch = true ;
boolean isScope = false ;
if ( fieldhtmltype . equals ( "1" ) ) { //单行文本框
if ( isScope ) { //范围
if ( Util . null2String ( fieldvalue ) . length ( ) = = 0 ) {
fieldvalue = new HashMap < String , Object > ( ) ;
}
searchConditionItem = conditionFactory . createCondition ( ConditionType . SCOPE , fieldlabel , new String [ ] { fieldname , fieldname + "to" } ) ;
} else if ( detailtype . equals ( "2" ) ) { //数字
searchConditionItem = conditionFactory . createCondition ( ConditionType . INPUTNUMBER , fieldlabel , fieldname , isQuickSearch ) ;
} else {
searchConditionItem = conditionFactory . createCondition ( ConditionType . INPUT , "25034" , fieldname , isQuickSearch ) ;
}
} else if ( fieldhtmltype . equals ( "2" ) ) { //多行文本框
searchConditionItem = conditionFactory . createCondition ( ConditionType . TEXTAREA , fieldlabel , fieldname ) ;
} else if ( fieldhtmltype . equals ( "3" ) ) { //浏览按钮
customValue = SelectOptionParam . getCustomBrowserId ( customValue ) ;
if ( detailtype . equals ( "2" ) ) {
if ( ! extendInfoPO . getTableName ( ) . toLowerCase ( ) . contains ( "_dt" ) ) {
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATEPICKER , fieldlabel , fieldname ) ;
} else {
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATE , fieldlabel , fieldname , detailtype ) ;
searchConditionItem . setDomkey ( new String [ ] { fieldname + DATE_SELECT , fieldname + DATE_FROM , fieldname + DATE_TO } ) ;
searchConditionItem . setOptions ( ServiceUtil . getDateSelectFromTo ( user . getLanguage ( ) ) ) ;
}
} else if ( detailtype . equals ( "19" ) ) {
searchConditionItem = conditionFactory . createCondition ( ConditionType . TIMEPICKER , fieldlabel , fieldname , detailtype ) ;
} else if ( detailtype . equals ( "402" ) ) { // 年
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATEPICKER , fieldlabel , fieldname , detailtype ) ;
searchConditionItem . setFormat ( "yyyy" ) ;
searchConditionItem . setMode ( "year" ) ;
searchConditionItem . setPlaceholder ( SystemEnv . getHtmlLabelNames ( "526306" , user . getLanguage ( ) ) ) ;
searchConditionItem . setShowTime ( false ) ;
} else if ( detailtype . equals ( "403" ) ) {
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATEPICKER , fieldlabel , fieldname , detailtype ) ;
searchConditionItem . setFormat ( "yyyy-MM" ) ;
searchConditionItem . setMode ( "month" ) ;
searchConditionItem . setPlaceholder ( SystemEnv . getHtmlLabelNames ( "126137" , user . getLanguage ( ) ) ) ;
searchConditionItem . setShowTime ( false ) ;
} else if ( detailtype . equals ( "RANGEPICKER" ) ) { //日期区间
String [ ] domkey = new String [ ] { DATE_FROM + fieldname , DATE_TO + fieldname } ;
searchConditionItem = conditionFactory . createCondition ( ConditionType . RANGEPICKER , fieldlabel , domkey ) ;
searchConditionItem . setValue ( fieldvalue ) ;
} else if ( detailtype . equals ( "TIMERANGEPICKER" ) ) { //时间区间
String [ ] domkey = new String [ ] { fieldname + DATE_Time_FROM , fieldname + DATE_Time_TO } ;
searchConditionItem = conditionFactory . createCondition ( ConditionType . TIMERANGEPICKER , fieldlabel , domkey ) ;
searchConditionItem . setValue ( fieldvalue ) ;
} else {
if ( detailtype . equals ( "161" ) | | detailtype . equals ( "162" ) | | detailtype . equals ( "256" ) | | detailtype . equals ( "257" ) ) {
BrowserBean browserbean = new BrowserBean ( detailtype + "" ) ;
BrowserInitUtil browserInitUtil = new BrowserInitUtil ( ) ;
String fielddbtype = customValue ;
if ( ! customValue . startsWith ( "browser." ) ) {
fielddbtype = "browser." + customValue ;
}
if ( detailtype . equals ( "161" ) | | detailtype . equals ( "162" ) ) {
browserInitUtil . initCustomizeBrow ( browserbean , fielddbtype , Util . getIntValue ( detailtype ) , user . getUID ( ) ) ;
} else {
browserbean . getDataParams ( ) . put ( "cube_treeid" , customValue ) ;
browserbean . getDataParams ( ) . put ( "currenttime" , System . currentTimeMillis ( ) ) ;
browserInitUtil . initBrowser ( browserbean , user . getLanguage ( ) ) ;
}
searchConditionItem = new SearchConditionItem ( ConditionType . BROWSER , fieldlabel , new String [ ] { fieldname } , browserbean ) ;
switch ( fieldhtmltype ) {
case "1" : //单行文本框
if ( detailtype . equals ( "2" ) ) { //数字
searchConditionItem = conditionFactory . createCondition ( ConditionType . INPUTNUMBER , fieldlabel , fieldname , isQuickSearch ) ;
} else {
searchConditionItem = conditionFactory . createCondition ( ConditionType . BROWSER, fieldlabel , fieldname , detailtype ) ;
searchConditionItem = conditionFactory . createCondition ( ConditionType . INPUT , "25034" , fieldname , isQuickSearch ) ;
}
//searchConditionItem.getBrowserConditionParam().setHideVirtualOrg(hrmFieldBean.getHideVirtualOrg());
List < Map < String , Object > > replaceDatas = new ArrayList < Map < String , Object > > ( ) ;
String tmpFieldValue = Util . null2String ( fieldvalue ) ;
if ( detailtype . equals ( "mkqshift" ) ) {
ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit ( ) ;
String [ ] fieldvalues = Util . splitString ( tmpFieldValue , "," ) ;
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . length ; i + + ) {
String fieldshowname = Util . null2String ( shiftManagementToolKit . getShiftOnOffWorkSections ( fieldvalues [ i ] , user . getLanguage ( ) ) ) ;
if ( fieldshowname . length ( ) = = 0 ) continue ;
Map < String , Object > replaceData = new HashMap < String , Object > ( ) ;
replaceData . put ( "id" , fieldvalues [ i ] ) ;
replaceData . put ( "name" , fieldshowname ) ;
replaceDatas . add ( replaceData ) ;
}
} else if ( detailtype . equals ( "sensitivewordstype" ) ) {
SensitiveWordTypeComInfo sensitiveWordTypeComInfo = new SensitiveWordTypeComInfo ( ) ;
String [ ] fieldvalues = Util . splitString ( tmpFieldValue , "," ) ;
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . length ; i + + ) {
String fieldshowname = Util . null2String ( sensitiveWordTypeComInfo . getName ( fieldvalues [ i ] ) ) ;
if ( fieldshowname . length ( ) = = 0 ) continue ;
Map < String , Object > replaceData = new HashMap < String , Object > ( ) ;
replaceData . put ( "id" , fieldvalues [ i ] ) ;
replaceData . put ( "name" , fieldshowname ) ;
replaceDatas . add ( replaceData ) ;
}
} else if ( detailtype . equals ( "doccategory" ) ) {
List < BrowserValueInfo > fieldvalues = new BrowserValueInfoService ( ) . getBrowserValueInfo ( detailtype , Util . null2String ( fieldvalue ) ) ;
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . size ( ) ; i + + ) {
BrowserValueInfo valueInfo = fieldvalues . get ( i ) ;
String fieldshowname = valueInfo . getName ( ) ;
if ( fieldshowname . length ( ) = = 0 ) {
continue ;
break ;
case "2" : //多行文本框
searchConditionItem = conditionFactory . createCondition ( ConditionType . TEXTAREA , fieldlabel , fieldname ) ;
break ;
case "3" : //浏览按钮
customValue = SelectOptionParam . getCustomBrowserId ( customValue ) ;
switch ( detailtype ) {
case "2" :
if ( ! extendInfoPO . getTableName ( ) . toLowerCase ( ) . contains ( "_dt" ) ) {
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATEPICKER , fieldlabel , fieldname ) ;
} else {
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATE , fieldlabel , fieldname , detailtype ) ;
searchConditionItem . setDomkey ( new String [ ] { fieldname + DATE_SELECT , fieldname + DATE_FROM , fieldname + DATE_TO } ) ;
searchConditionItem . setOptions ( ServiceUtil . getDateSelectFromTo ( user . getLanguage ( ) ) ) ;
}
Map < String , Object > replaceData = new HashMap < String , Object > ( ) ;
replaceData . put ( "id" , valueInfo . getId ( ) ) ;
replaceData . put ( "name" , fieldshowname ) ;
replaceDatas . add ( replaceData ) ;
break ;
case "19" :
searchConditionItem = conditionFactory . createCondition ( ConditionType . TIMEPICKER , fieldlabel , fieldname , detailtype ) ;
break ;
case "402" : // 年
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATEPICKER , fieldlabel , fieldname , detailtype ) ;
searchConditionItem . setFormat ( "yyyy" ) ;
searchConditionItem . setMode ( "year" ) ;
searchConditionItem . setPlaceholder ( SystemEnv . getHtmlLabelNames ( "526306" , user . getLanguage ( ) ) ) ;
searchConditionItem . setShowTime ( false ) ;
break ;
case "403" :
searchConditionItem = conditionFactory . createCondition ( ConditionType . DATEPICKER , fieldlabel , fieldname , detailtype ) ;
searchConditionItem . setFormat ( "yyyy-MM" ) ;
searchConditionItem . setMode ( "month" ) ;
searchConditionItem . setPlaceholder ( SystemEnv . getHtmlLabelNames ( "126137" , user . getLanguage ( ) ) ) ;
searchConditionItem . setShowTime ( false ) ;
break ;
case "RANGEPICKER" : { //日期区间
String [ ] domkey = new String [ ] { DATE_FROM + fieldname , DATE_TO + fieldname } ;
searchConditionItem = conditionFactory . createCondition ( ConditionType . RANGEPICKER , fieldlabel , domkey ) ;
searchConditionItem . setValue ( fieldvalue ) ;
break ;
}
} else {
if ( tmpFieldValue . length ( ) > 0 ) {
String fieldshowname = hrmFieldManager . getFieldvalue ( user , customValue , Util . getIntValue ( fieldid ) , Util . getIntValue ( fieldhtmltype ) , Util . getIntValue ( detailtype ) , tmpFieldValue , 0 ) ;
String [ ] fieldvalues = Util . splitString ( tmpFieldValue , "," ) ;
String [ ] fieldshownames = Util . splitString ( fieldshowname , "," ) ;
if ( detailtype . equals ( "257" ) ) {
if ( fieldshowname . endsWith ( " " ) ) {
fieldshowname = fieldshowname . substring ( 0 , fieldshowname . length ( ) - 5 ) ;
case "TIMERANGEPICKER" : { //时间区间
String [ ] domkey = new String [ ] { fieldname + DATE_Time_FROM , fieldname + DATE_Time_TO } ;
searchConditionItem = conditionFactory . createCondition ( ConditionType . TIMERANGEPICKER , fieldlabel , domkey ) ;
searchConditionItem . setValue ( fieldvalue ) ;
break ;
}
default :
if ( detailtype . equals ( "161" ) | | detailtype . equals ( "162" ) | | detailtype . equals ( "256" ) | | detailtype . equals ( "257" ) ) {
BrowserBean browserbean = new BrowserBean ( detailtype + "" ) ;
BrowserInitUtil browserInitUtil = new BrowserInitUtil ( ) ;
String fielddbtype = customValue ;
if ( ! customValue . startsWith ( "browser." ) ) {
fielddbtype = "browser." + customValue ;
}
if ( detailtype . equals ( "161" ) | | detailtype . equals ( "162" ) ) {
browserInitUtil . initCustomizeBrow ( browserbean , fielddbtype , Util . getIntValue ( detailtype ) , user . getUID ( ) ) ;
} else {
browserbean . getDataParams ( ) . put ( "cube_treeid" , customValue ) ;
browserbean . getDataParams ( ) . put ( "currenttime" , System . currentTimeMillis ( ) ) ;
browserInitUtil . initBrowser ( browserbean , user . getLanguage ( ) ) ;
}
fieldshownames = Util . splitString ( fieldshowname , " " ) ;
searchConditionItem = new SearchConditionItem ( ConditionType . BROWSER , fieldlabel , new String [ ] { fieldname } , browserbean ) ;
} else {
searchConditionItem = conditionFactory . createCondition ( ConditionType . BROWSER , fieldlabel , fieldname , detailtype ) ;
}
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . length ; i + + ) {
if ( fieldvalues . length ! = fieldshownames . length ) {
List < Map < String , Object > > replaceDatas = new ArrayList < > ( ) ;
String tmpFieldValue = Util . null2String ( fieldvalue ) ;
switch ( detailtype ) {
case "mkqshift" : {
ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit ( ) ;
String [ ] fieldvalues = Util . splitString ( tmpFieldValue , "," ) ;
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . length ; i + + ) {
String fieldshowname = Util . null2String ( shiftManagementToolKit . getShiftOnOffWorkSections ( fieldvalues [ i ] , user . getLanguage ( ) ) ) ;
if ( fieldshowname . length ( ) = = 0 ) continue ;
Map < String , Object > replaceData = new HashMap < > ( ) ;
replaceData . put ( "id" , fieldvalues [ i ] ) ;
replaceData . put ( "name" , fieldshowname ) ;
replaceDatas . add ( replaceData ) ;
}
break ;
}
case "sensitivewordstype" : {
SensitiveWordTypeComInfo sensitiveWordTypeComInfo = new SensitiveWordTypeComInfo ( ) ;
String [ ] fieldvalues = Util . splitString ( tmpFieldValue , "," ) ;
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . length ; i + + ) {
String fieldshowname = Util . null2String ( sensitiveWordTypeComInfo . getName ( fieldvalues [ i ] ) ) ;
if ( fieldshowname . length ( ) = = 0 ) continue ;
Map < String , Object > replaceData = new HashMap < > ( ) ;
replaceData . put ( "id" , fieldvalues [ i ] ) ;
replaceData . put ( "name" , fieldshowname ) ;
replaceDatas . add ( replaceData ) ;
}
break ;
}
if ( Util . null2String ( fieldshownames [ i ] ) . length ( ) = = 0 ) {
continue ;
case "doccategory" : {
List < BrowserValueInfo > fieldvalues = new BrowserValueInfoService ( ) . getBrowserValueInfo ( detailtype , Util . null2String ( fieldvalue ) ) ;
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . size ( ) ; i + + ) {
BrowserValueInfo valueInfo = fieldvalues . get ( i ) ;
String fieldshowname = valueInfo . getName ( ) ;
if ( fieldshowname . length ( ) = = 0 ) {
continue ;
}
Map < String , Object > replaceData = new HashMap < > ( ) ;
replaceData . put ( "id" , valueInfo . getId ( ) ) ;
replaceData . put ( "name" , fieldshowname ) ;
replaceDatas . add ( replaceData ) ;
}
break ;
}
Map < String , Object > replaceData = new HashMap < String , Object > ( ) ;
replaceData . put ( "id" , fieldvalues [ i ] ) ;
replaceData . put ( "name" , fieldshownames [ i ] ) ;
replaceDatas . add ( replaceData ) ;
default :
if ( tmpFieldValue . length ( ) > 0 ) {
String fieldshowname = hrmFieldManager . getFieldvalue ( user , customValue , Util . getIntValue ( fieldid ) , Util . getIntValue ( fieldhtmltype ) , Util . getIntValue ( detailtype ) , tmpFieldValue , 0 ) ;
String [ ] fieldvalues = Util . splitString ( tmpFieldValue , "," ) ;
String [ ] fieldshownames = Util . splitString ( fieldshowname , "," ) ;
if ( detailtype . equals ( "257" ) ) {
if ( fieldshowname . endsWith ( " " ) ) {
fieldshowname = fieldshowname . substring ( 0 , fieldshowname . length ( ) - 5 ) ;
}
fieldshownames = Util . splitString ( fieldshowname , " " ) ;
}
for ( int i = 0 ; fieldvalues ! = null & & i < fieldvalues . length ; i + + ) {
if ( fieldvalues . length ! = fieldshownames . length ) {
break ;
}
if ( Util . null2String ( fieldshownames [ i ] ) . length ( ) = = 0 ) {
continue ;
}
Map < String , Object > replaceData = new HashMap < > ( ) ;
replaceData . put ( "id" , fieldvalues [ i ] ) ;
replaceData . put ( "name" , fieldshownames [ i ] ) ;
replaceDatas . add ( replaceData ) ;
}
}
break ;
}
}
fieldvalue = replaceDatas ;
break ;
}
break ;
case "4" : //Check框
searchConditionItem = conditionFactory . createCondition ( ConditionType . CHECKBOX , fieldlabel , fieldname ) ;
if ( detailtype . equals ( "2" ) ) {
searchConditionItem . setConditionType ( ConditionType . SWITCH ) ;
}
fieldvalue = replaceDatas ;
}
} else if ( fieldhtmltype . equals ( "4" ) ) { //Check框
searchConditionItem = conditionFactory . createCondition ( ConditionType . CHECKBOX , fieldlabel , fieldname ) ;
if ( detailtype . equals ( "2" ) ) {
searchConditionItem . setConditionType ( ConditionType . SWITCH ) ;
}
} else if ( fieldhtmltype . equals ( "5" ) ) { //选择框
break ;
case "5" : //选择框
List < SearchConditionOption > searchConditionOptions = SelectOptionParam . convertJsonToListOption ( customValue ) ;
searchConditionItem = conditionFactory . createCondition ( ConditionType . SELECT , fieldlabel , fieldname , searchConditionOptions ) ;
if ( detailtype . equals ( "" ) | | detailtype . equals ( "0" ) ) {
detailtype = "1" ;
}
searchConditionItem . setKey ( Util . null2String ( fieldvalue ) ) ;
searchConditionItem . setValue ( fieldvalue + "" ) ;
searchConditionItem . setDetailtype ( Util . getIntValue ( detailtype , 3 ) ) ;
} else if ( fieldhtmltype . equals ( "6" ) ) { //附件
if ( fieldname . equals ( "resourceimageid" ) ) {
searchConditionItem = conditionFactory . createCondition ( ConditionType . RESOURCEIMG , fieldlabel , fieldname , isQuickSearch ) ;
} else {
searchConditionItem = conditionFactory . createCondition ( ConditionType . UPLOAD , fieldlabel , fieldname , isQuickSearch ) ;
searchConditionItem . setUploadUrl ( "/api/doc/upload/uploadFile" ) ;
searchConditionItem . setCategory ( "category" ) ;
searchConditionItem . setMaxFilesNumber ( 10 ) ;
searchConditionItem . setMultiSelection ( true ) ;
Map < String , Object > otherParamsMap = new HashMap < > ( ) ;
otherParamsMap . put ( "showClearAll" , false ) ;
otherParamsMap . put ( "showOrder" , true ) ;
searchConditionItem . setOtherParams ( otherParamsMap ) ;
if ( Util . null2String ( fieldvalue ) . length ( ) > 0 ) {
List < Object > datas = new ArrayList < Object > ( ) ;
Map < String , Object > data = null ;
String [ ] tmpIds = Util . splitString ( Util . null2String ( fieldvalue ) , "," ) ;
for ( int i = 0 ; i < tmpIds . length ; i + + ) {
String fileid = tmpIds [ i ] ;
ImageFileManager manager = new ImageFileManager ( ) ;
manager . getImageFileInfoById ( Util . getIntValue ( fileid ) ) ;
String filename = manager . getImageFileName ( ) ;
String extname = filename . contains ( "." ) ? filename . substring ( filename . lastIndexOf ( "." ) + 1 ) : "" ;
data = new HashMap < String , Object > ( ) ;
data . put ( "acclink" , "/weaver/weaver.file.FileDownload?fileid=" + fileid ) ;
data . put ( "fileExtendName" , extname ) ;
data . put ( "fileid" , fileid ) ;
//if (Util.null2String(this.isMobile).equals("1")) {
// data.put("filelink", "/spa/document/static4mobile/index.html#/attach/" + fileid);
//} else {
data . put ( "filelink" , "/spa/document/index2file.jsp?imagefileId=" + fileid + "#/main/document/fileView" ) ;
//}
data . put ( "filename" , filename ) ;
data . put ( "filesize" , manager . getImgsize ( ) ) ;
data . put ( "imgSrc" , "" ) ;
data . put ( "isImg" , "" ) ;
data . put ( "loadlink" , "/weaver/weaver.file.FileDownload?fileid=" + fileid + "&download=1" ) ;
data . put ( "showDelete" , "true" ) ;
data . put ( "showLoad" , "true" ) ;
datas . add ( data ) ;
List < SearchConditionOption > searchConditionOptions = SelectOptionParam . convertJsonToListOption ( customValue ) ;
searchConditionItem = conditionFactory . createCondition ( ConditionType . SELECT , fieldlabel , fieldname , searchConditionOptions ) ;
if ( detailtype . equals ( "" ) | | detailtype . equals ( "0" ) ) {
detailtype = "1" ;
}
searchConditionItem . setKey ( Util . null2String ( fieldvalue ) ) ;
searchConditionItem . setValue ( fieldvalue + "" ) ;
searchConditionItem . setDetailtype ( Util . getIntValue ( detailtype , 3 ) ) ;
break ;
case "6" : //附件
if ( fieldname . equals ( "resourceimageid" ) ) {
searchConditionItem = conditionFactory . createCondition ( ConditionType . RESOURCEIMG , fieldlabel , fieldname , isQuickSearch ) ;
} else {
searchConditionItem = conditionFactory . createCondition ( ConditionType . UPLOAD , fieldlabel , fieldname , isQuickSearch ) ;
searchConditionItem . setUploadUrl ( "/api/doc/upload/uploadFile" ) ;
searchConditionItem . setCategory ( "category" ) ;
searchConditionItem . setMaxFilesNumber ( 10 ) ;
searchConditionItem . setMultiSelection ( true ) ;
Map < String , Object > otherParamsMap = new HashMap < > ( ) ;
otherParamsMap . put ( "showClearAll" , false ) ;
otherParamsMap . put ( "showOrder" , true ) ;
searchConditionItem . setOtherParams ( otherParamsMap ) ;
if ( Util . null2String ( fieldvalue ) . length ( ) > 0 ) {
List < Object > datas = new ArrayList < > ( ) ;
Map < String , Object > data ;
String [ ] tmpIds = Util . splitString ( Util . null2String ( fieldvalue ) , "," ) ;
for ( String fileid : tmpIds ) {
ImageFileManager manager = new ImageFileManager ( ) ;
manager . getImageFileInfoById ( Util . getIntValue ( fileid ) ) ;
String filename = manager . getImageFileName ( ) ;
String extname = filename . contains ( "." ) ? filename . substring ( filename . lastIndexOf ( "." ) + 1 ) : "" ;
data = new HashMap < > ( ) ;
data . put ( "acclink" , "/weaver/weaver.file.FileDownload?fileid=" + fileid ) ;
data . put ( "fileExtendName" , extname ) ;
data . put ( "fileid" , fileid ) ;
//if (Util.null2String(this.isMobile).equals("1")) {
// data.put("filelink", "/spa/document/static4mobile/index.html#/attach/" + fileid);
//} else {
data . put ( "filelink" , "/spa/document/index2file.jsp?imagefileId=" + fileid + "#/main/document/fileView" ) ;
//}
data . put ( "filename" , filename ) ;
data . put ( "filesize" , manager . getImgsize ( ) ) ;
data . put ( "imgSrc" , "" ) ;
data . put ( "isImg" , "" ) ;
data . put ( "loadlink" , "/weaver/weaver.file.FileDownload?fileid=" + fileid + "&download=1" ) ;
data . put ( "showDelete" , "true" ) ;
data . put ( "showLoad" , "true" ) ;
datas . add ( data ) ;
}
searchConditionItem . setDatas ( datas ) ;
}
searchConditionItem . setDatas ( datas ) ;
}
}
} else if ( fieldhtmltype . equals ( "7" ) ) { //颜色选择
searchConditionItem = conditionFactory . createCondition ( ConditionType . COLORPICKER , fieldlabel , fieldname , true ) ;
searchConditionItem . setValue ( fieldvalue ) ;
} else if ( fieldhtmltype . equals ( "8" ) ) { //DESCRIPTION
searchConditionItem = conditionFactory . createCondition ( ConditionType . DESCRIPTION , fieldlabel , fieldname ) ;
searchConditionItem . setValue ( fieldvalue ) ;
break ;
case "7" : //颜色选择
searchConditionItem = conditionFactory . createCondition ( ConditionType . COLORPICKER , fieldlabel , fieldname , true ) ;
searchConditionItem . setValue ( fieldvalue ) ;
break ;
case "8" : //DESCRIPTION
searchConditionItem = conditionFactory . createCondition ( ConditionType . DESCRIPTION , fieldlabel , fieldname ) ;
searchConditionItem . setValue ( fieldvalue ) ;
break ;
}
if ( searchConditionItem ! = null ) {
BrowserInitUtil . setConditionItemDefaultValue ( searchConditionItem , fieldvalue , 2 ) ;