Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
d8b7458b
Commit
d8b7458b
authored
Aug 21, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkbox处理
parent
58867c4e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
170 additions
and
37 deletions
+170
-37
SnapshotServiceImpl.java
...lliance/mda/runtime/mda/snapshot/SnapshotServiceImpl.java
+84
-36
AttributeEnum.java
...brilliance/mda/runtime/mda/snapshot/bo/AttributeEnum.java
+20
-0
PackCheckboxBo.java
...ance/mda/runtime/mda/snapshot/bo/pack/PackCheckboxBo.java
+33
-0
PackDivBo.java
...rilliance/mda/runtime/mda/snapshot/bo/pack/PackDivBo.java
+3
-0
CheckboxBo.java
...liance/mda/runtime/mda/snapshot/bo/unpack/CheckboxBo.java
+22
-0
DivBo.java
.../brilliance/mda/runtime/mda/snapshot/bo/unpack/DivBo.java
+3
-0
DocumentBo.java
...liance/mda/runtime/mda/snapshot/bo/unpack/DocumentBo.java
+3
-0
LabelBo.java
...rilliance/mda/runtime/mda/snapshot/bo/unpack/LabelBo.java
+2
-1
No files found.
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/SnapshotServiceImpl.java
View file @
d8b7458b
package
com
.
brilliance
.
mda
.
runtime
.
mda
.
snapshot
;
import
com.brilliance.mda.runtime.mda.IModule
;
import
com.brilliance.mda.runtime.mda.snapshot.bo.AttributeEnum
;
import
com.brilliance.mda.runtime.mda.snapshot.bo.ValueVo
;
import
com.brilliance.mda.runtime.mda.snapshot.bo.pack.*
;
import
com.brilliance.mda.runtime.mda.snapshot.bo.unpack.*
;
...
...
@@ -81,11 +82,15 @@ public class SnapshotServiceImpl implements SnapshotService {
List
<
PackTextboxBo
>
textboxBoList
=
new
ArrayList
<>();
packDivBo
.
setTextboxBoList
(
textboxBoList
);
List
<
TextboxBo
>
textboxList
=
new
ArrayList
<>();
List
<
LabelBo
>
labelList
=
new
ArrayList
<>();
List
<
TextboxBo
>
xcomboboxList
=
new
ArrayList
<>();
List
<
TextboxBo
>
xdateboxList
=
new
ArrayList
<>();
List
<
TextboxBo
>
xdecimalboxList
=
new
ArrayList
<>();
List
<
PackCheckboxBo
>
checkboxBoList
=
new
ArrayList
<>();
packDivBo
.
setCheckboxBoList
(
checkboxBoList
);
List
<
TextboxBo
>
textboxList
;
List
<
LabelBo
>
labelList
;
List
<
TextboxBo
>
xcomboboxList
;
List
<
TextboxBo
>
xdateboxList
;
List
<
TextboxBo
>
xdecimalboxList
;
List
<
CheckboxBo
>
checkboxList
=
new
ArrayList
<>();
BorderlayoutBo
borderlayoutBo
=
documentBo
.
getBorderlayoutBo
();
if
(
borderlayoutBo
!=
null
)
{
...
...
@@ -96,24 +101,23 @@ public class SnapshotServiceImpl implements SnapshotService {
xcomboboxList
=
divBo
.
getXcomboboxList
();
xdateboxList
=
divBo
.
getXdateboxList
();
xdecimalboxList
=
divBo
.
getXdecimalboxList
();
checkboxList
=
divBo
.
getCheckboxList
();
}
else
{
textboxList
=
documentBo
.
getTextboxList
();
labelList
=
documentBo
.
getLabelList
();
xcomboboxList
=
documentBo
.
getXcomboboxList
();
xdateboxList
=
documentBo
.
getXdateboxList
();
xdecimalboxList
=
documentBo
.
getXdecimalboxList
();
checkboxList
=
documentBo
.
getCheckboxList
();
}
for
(
TextboxBo
textboxBo
:
textboxList
)
{
List
<
CustomAttributes
>
customAttributes
=
textboxBo
.
getCustomAttributes
();
String
text
=
""
;
for
(
CustomAttributes
customAttribute
:
customAttributes
)
{
text
=
customAttribute
.
getFieldUrl
();
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
));
break
;
}
String
text
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
FIELDURL
);
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
));
}
PackTextboxBo
data
=
new
PackTextboxBo
();
data
.
setText
(
"${"
+
text
+
"}"
);
data
.
setStyle
(
textboxBo
.
getStyle
());
...
...
@@ -124,10 +128,10 @@ public class SnapshotServiceImpl implements SnapshotService {
for
(
LabelBo
labelBo
:
labelList
)
{
PackLabelBo
data
=
new
PackLabelBo
();
CustomAttributes
customAttributes
=
labelBo
.
getCustomAttributes
();
String
value
=
customAttributes
.
getLabelId
(
);
List
<
CustomAttributes
>
customAttributes
=
labelBo
.
getCustomAttributes
();
String
value
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
LABELID
);
if
(
StringUtils
.
isBlank
(
value
))
{
value
=
customAttributes
.
getFieldUrl
(
);
value
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
FIELDURL
);
keySet
.
add
(
new
ValueVo
(
value
));
data
.
setValue
(
"${"
+
value
+
"}"
);
}
else
{
...
...
@@ -142,14 +146,12 @@ public class SnapshotServiceImpl implements SnapshotService {
for
(
TextboxBo
textboxBo
:
xcomboboxList
)
{
List
<
CustomAttributes
>
customAttributes
=
textboxBo
.
getCustomAttributes
();
String
text
=
""
;
for
(
CustomAttributes
customAttribute
:
customAttributes
)
{
text
=
customAttribute
.
getFieldUrl
();
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
,
null
,
customAttribute
.
getCodeTable
()));
break
;
}
String
text
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
FIELDURL
);
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
,
null
,
getAttributeValue
(
customAttributes
,
AttributeEnum
.
CODETABLE
)));
}
PackComboboxBo
data
=
new
PackComboboxBo
();
data
.
setText
(
"${"
+
text
+
"}"
);
data
.
setStyle
(
textboxBo
.
getStyle
());
...
...
@@ -158,13 +160,9 @@ public class SnapshotServiceImpl implements SnapshotService {
for
(
TextboxBo
textboxBo
:
xdateboxList
)
{
List
<
CustomAttributes
>
customAttributes
=
textboxBo
.
getCustomAttributes
();
String
text
=
""
;
for
(
CustomAttributes
customAttribute
:
customAttributes
)
{
text
=
customAttribute
.
getFieldUrl
();
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
,
textboxBo
.
getFormat
(),
null
));
break
;
}
String
text
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
FIELDURL
);
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
,
textboxBo
.
getFormat
(),
null
));
}
PackDateboxBo
data
=
new
PackDateboxBo
();
data
.
setText
(
"${"
+
text
+
"}"
);
...
...
@@ -175,13 +173,9 @@ public class SnapshotServiceImpl implements SnapshotService {
for
(
TextboxBo
textboxBo
:
xdecimalboxList
)
{
List
<
CustomAttributes
>
customAttributes
=
textboxBo
.
getCustomAttributes
();
String
text
=
""
;
for
(
CustomAttributes
customAttribute
:
customAttributes
)
{
text
=
customAttribute
.
getFieldUrl
();
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
));
break
;
}
String
text
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
FIELDURL
);
if
(
StringUtils
.
isNotBlank
(
text
))
{
keySet
.
add
(
new
ValueVo
(
text
));
}
PackDecimalboxBo
data
=
new
PackDecimalboxBo
();
data
.
setText
(
"${"
+
text
+
"}"
);
...
...
@@ -189,6 +183,27 @@ public class SnapshotServiceImpl implements SnapshotService {
data
.
setFormat
(
textboxBo
.
getFormat
());
decimalboxBoList
.
add
(
data
);
}
for
(
CheckboxBo
checkboxBo
:
checkboxList
)
{
PackCheckboxBo
data
=
new
PackCheckboxBo
();
List
<
CustomAttributes
>
customAttributes
=
checkboxBo
.
getCustomAttributes
();
String
fieldUrl
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
FIELDURL
);
String
labelId
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
LABELID
);
if
(
StringUtils
.
isBlank
(
labelId
))
{
labelId
=
getAttributeValue
(
customAttributes
,
AttributeEnum
.
FIELDURL
);
keySet
.
add
(
new
ValueVo
(
labelId
));
data
.
setLabel
(
"${"
+
labelId
+
"}"
);
}
else
{
// /bctp/LT000070/
String
[]
split
=
labelId
.
substring
(
1
,
labelId
.
length
()
-
1
).
split
(
"/"
);
String
i18NString
=
MdaUtils
.
getI18NString
(
split
[
0
],
split
[
1
]);
data
.
setLabel
(
i18NString
);
}
data
.
setChecked
(
"${"
+
fieldUrl
+
"}"
);
data
.
setStyle
(
checkboxBo
.
getStyle
());
checkboxBoList
.
add
(
data
);
}
// 组成xml需要的实体
PackBorderlayoutBo
packBorderlayoutBo
=
new
PackBorderlayoutBo
();
PackCenterBo
packCenterBo
=
new
PackCenterBo
();
...
...
@@ -281,10 +296,43 @@ public class SnapshotServiceImpl implements SnapshotService {
if
(
StringUtils
.
isNotBlank
(
format
)
&&
value
instanceof
Date
)
{
value
=
DateUtil
.
format
((
Date
)
value
,
format
.
replaceAll
(
"/"
,
"-"
));
}
// boolean 类型转换为String
if
(
value
instanceof
Boolean
)
{
value
=
String
.
valueOf
(
value
);
}
}
valueMap
.
put
(
originKey
,
value
==
null
?
""
:
value
);
}
/**
* 获取属性值
*
* @param list
* @param key
* @return
*/
private
String
getAttributeValue
(
List
<
CustomAttributes
>
list
,
AttributeEnum
key
)
{
for
(
CustomAttributes
customAttribute
:
list
)
{
if
(
AttributeEnum
.
LABELID
.
equals
(
key
))
{
if
(
StringUtils
.
isNotBlank
(
customAttribute
.
getLabelId
()))
{
return
customAttribute
.
getLabelId
();
}
}
if
(
AttributeEnum
.
FIELDURL
.
equals
(
key
))
{
if
(
StringUtils
.
isNotBlank
(
customAttribute
.
getFieldUrl
()))
{
return
customAttribute
.
getFieldUrl
();
}
}
if
(
AttributeEnum
.
CODETABLE
.
equals
(
key
))
{
if
(
StringUtils
.
isNotBlank
(
customAttribute
.
getCodeTable
()))
{
return
customAttribute
.
getCodeTable
();
}
}
}
return
""
;
}
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/bo/AttributeEnum.java
0 → 100644
View file @
d8b7458b
package
com
.
brilliance
.
mda
.
runtime
.
mda
.
snapshot
.
bo
;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/21
*/
public
enum
AttributeEnum
{
LABELID
(
"i18n"
),
FIELDURL
(
"fieldUrl"
),
CODETABLE
(
"codeTable"
);
private
String
value
;
AttributeEnum
(
String
value
)
{
this
.
value
=
value
;
}
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/bo/pack/PackCheckboxBo.java
0 → 100644
View file @
d8b7458b
package
com
.
brilliance
.
mda
.
runtime
.
mda
.
snapshot
.
bo
.
pack
;
import
lombok.Data
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/21
*/
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlRootElement
(
name
=
"checkbox"
)
@Data
public
class
PackCheckboxBo
{
@XmlAttribute
(
name
=
"style"
)
private
String
style
;
@XmlAttribute
(
name
=
"checked"
)
private
String
checked
;
@XmlAttribute
(
name
=
"disabled"
)
private
String
disabled
=
"true"
;
@XmlAttribute
(
name
=
"label"
)
private
String
label
;
@XmlAttribute
(
name
=
"zclass"
)
private
String
zclass
=
"z-checkbox"
;
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/bo/pack/PackDivBo.java
View file @
d8b7458b
...
...
@@ -33,4 +33,7 @@ public class PackDivBo {
@XmlElement
(
name
=
"datebox"
)
private
List
<
PackDateboxBo
>
dateboxBoList
;
@XmlElement
(
name
=
"checkbox"
)
private
List
<
PackCheckboxBo
>
checkboxBoList
;
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/bo/unpack/CheckboxBo.java
0 → 100644
View file @
d8b7458b
package
com
.
brilliance
.
mda
.
runtime
.
mda
.
snapshot
.
bo
.
unpack
;
import
lombok.Data
;
import
javax.xml.bind.annotation.*
;
import
java.util.List
;
/**
* @Description
* @Author s_guodong
* @Date 2023/8/21
*/
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlRootElement
(
name
=
"checkbox"
)
@Data
public
class
CheckboxBo
{
@XmlAttribute
(
name
=
"style"
)
private
String
style
;
@XmlElement
(
name
=
"custom-attributes"
)
private
List
<
CustomAttributes
>
customAttributes
;
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/bo/unpack/DivBo.java
View file @
d8b7458b
...
...
@@ -33,4 +33,7 @@ public class DivBo {
@XmlElement
(
name
=
"xdecimalbox"
)
private
List
<
TextboxBo
>
xdecimalboxList
;
@XmlElement
(
name
=
"checkbox"
)
private
List
<
CheckboxBo
>
checkboxList
;
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/bo/unpack/DocumentBo.java
View file @
d8b7458b
...
...
@@ -33,6 +33,9 @@ public class DocumentBo {
@XmlElement
(
name
=
"xdecimalbox"
)
private
List
<
TextboxBo
>
xdecimalboxList
;
@XmlElement
(
name
=
"checkbox"
)
private
List
<
CheckboxBo
>
checkboxList
;
@XmlElement
(
name
=
"borderlayout"
)
private
BorderlayoutBo
borderlayoutBo
;
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/snapshot/bo/unpack/LabelBo.java
View file @
d8b7458b
...
...
@@ -3,6 +3,7 @@ package com.brilliance.mda.runtime.mda.snapshot.bo.unpack;
import
lombok.Data
;
import
javax.xml.bind.annotation.*
;
import
java.util.List
;
/**
* @Description
...
...
@@ -15,7 +16,7 @@ import javax.xml.bind.annotation.*;
public
class
LabelBo
{
@XmlElement
(
name
=
"custom-attributes"
)
private
CustomAttributes
customAttributes
;
private
List
<
CustomAttributes
>
customAttributes
;
@XmlAttribute
(
name
=
"style"
)
private
String
style
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment