Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warehouse
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
胡懿
warehouse
Commits
3f08c4fc
Commit
3f08c4fc
authored
Jul 21, 2023
by
胡懿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改盘盈入库代码逻辑,修改盘盈入库二维码生成逻辑
parent
43caaa0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
30 deletions
+15
-30
ProfitWarehousingInfoMapper.xml
...fitwarehousing/mapper/xml/ProfitWarehousingInfoMapper.xml
+1
-0
DrawQrcodeUtil.java
...jeeplus/modules/warehouse/qrcode/util/DrawQrcodeUtil.java
+14
-30
No files found.
src/main/java/com/jeeplus/modules/warehouse/profitwarehousing/mapper/xml/ProfitWarehousingInfoMapper.xml
View file @
3f08c4fc
...
...
@@ -15,6 +15,7 @@
a.marking AS "marking",
a.shelves_ids AS "shelvesIds",
a.warehouse_ids AS "warehouseIds",
a.num AS "num",
a.qr_id AS "qrCode.id",
qrCode.url AS "qrCode.url",
qrCode.state AS "qrCode.state",
...
...
src/main/java/com/jeeplus/modules/warehouse/qrcode/util/DrawQrcodeUtil.java
View file @
3f08c4fc
...
...
@@ -321,8 +321,9 @@ public class DrawQrcodeUtil {
public
static
BufferedImage
createAssetImageNew2
(
File
qrcodeFile
,
QrCode
qrCode
)
throws
IOException
{
ProfitWarehousingInfo
profitWarehousingInfo
=
qrCode
.
getProfitWarehousingInfo
();
QRcodeSize
qRcodeSize
=
null
;
qRcodeSize
=
new
QRcodeSize
(
8
,
200
,
1400
,
78
,
200
,
200
,
1200
,
1200
,
new
Color
(
34
,
25
,
21
));
BufferedImage
bgImage
=
new
BufferedImage
(
1600
,
2400
,
BufferedImage
.
TYPE_4BYTE_ABGR
);
qRcodeSize
=
new
QRcodeSize
(
8
,
800
,
1800
,
78
,
800
,
200
,
1600
,
1600
,
new
Color
(
34
,
25
,
21
));
// BufferedImage bgImage = new BufferedImage(1600, 2400, BufferedImage.TYPE_4BYTE_ABGR);
BufferedImage
bgImage
=
new
BufferedImage
(
3200
,
2400
,
BufferedImage
.
TYPE_INT_ARGB
);
Graphics2D
g2
=
bgImage
.
createGraphics
();
BufferedImage
qrcodeImage
=
ImageIO
.
read
(
qrcodeFile
);
...
...
@@ -334,12 +335,12 @@ public class DrawQrcodeUtil {
,
RenderingHints
.
VALUE_ALPHA_INTERPOLATION_QUALITY
);
g2
.
setRenderingHints
(
rh
);
Font
font
=
new
Font
(
"
黑体"
,
Font
.
BOLD
,
16
*
qRcodeSize
.
getInitfontSize
()
);
Font
font
=
new
Font
(
"
等线"
,
Font
.
PLAIN
,
100
);
g2
.
setFont
(
font
);
//设置字体:字体、字号、大小
g2
.
setColor
(
qRcodeSize
.
color
);
//设置背景颜色
// g2.setBackground(c);
int
contentX
=
qRcodeSize
.
getInitContentX
();
int
contentY
=
qRcodeSize
.
getInitContentY
()
+
20
0
;
int
contentY
=
qRcodeSize
.
getInitContentY
()
+
15
0
;
//写二维码
g2
.
drawImage
(
qrcodeImage
,
qRcodeSize
.
getQrcodeX
(),
qRcodeSize
.
getQrcodeY
(),
qRcodeSize
.
getQrcodeWidth
(),
qRcodeSize
.
getQrcodeHeight
(),
null
,
null
);
...
...
@@ -347,39 +348,22 @@ public class DrawQrcodeUtil {
String
contentTitle1
=
"货品名称:"
;
int
contentTitle1Width
=
g2
.
getFontMetrics
().
stringWidth
(
contentTitle1
);
g2
.
drawString
(
contentTitle1
,
contentX
,
contentY
);
String
name
=
formatContent
(
profitWarehousingInfo
.
getName
(),
10
);
String
name
=
formatContent
(
profitWarehousingInfo
.
get
Type
().
get
Name
(),
10
);
AttributedString
as
=
new
AttributedString
(
name
);
as
.
addAttribute
(
TextAttribute
.
FONT
,
font
);
as
.
addAttribute
(
TextAttribute
.
UNDERLINE
,
TextAttribute
.
UNDERLINE_LOW_DASHED
,
0
,
name
.
length
());
g2
.
drawString
(
as
.
getIterator
(),
contentX
+
contentTitle1Width
,
contentY
);
//写入货品类型
String
contentTitle2
=
"货品类型:"
;
int
contentTitle2Width
=
g2
.
getFontMetrics
().
stringWidth
(
contentTitle2
);
g2
.
drawString
(
contentTitle2
,
contentX
,
contentY
+
200
);
String
typeName
=
formatContent
(
profitWarehousingInfo
.
getType
().
getName
(),
10
);
as
=
new
AttributedString
(
typeName
);
as
.
addAttribute
(
TextAttribute
.
FONT
,
font
);
as
.
addAttribute
(
TextAttribute
.
UNDERLINE
,
TextAttribute
.
UNDERLINE_LOW_DASHED
,
0
,
typeName
.
length
());
g2
.
drawString
(
as
.
getIterator
(),
contentX
+
contentTitle2Width
,
contentY
+
200
);
//写入物资编码
String
contentTitle4
=
"物资编码:"
;
int
contentTitle4Width
=
g2
.
getFontMetrics
().
stringWidth
(
contentTitle4
);
g2
.
drawString
(
contentTitle4
,
contentX
,
contentY
+
40
0
);
g2
.
drawString
(
contentTitle4
,
contentX
,
contentY
+
15
0
);
String
code
=
qrCode
.
getCode
();
if
(
code
.
length
()
>
10
)
{
String
str1
=
code
.
substring
(
0
,
9
);
str1
=
formatContent
(
str1
,
10
);
as
=
new
AttributedString
(
str1
);
as
.
addAttribute
(
TextAttribute
.
FONT
,
font
);
as
.
addAttribute
(
TextAttribute
.
UNDERLINE
,
TextAttribute
.
UNDERLINE_LOW_DASHED
,
0
,
str1
.
length
());
g2
.
drawString
(
as
.
getIterator
(),
contentX
+
contentTitle4Width
,
contentY
+
400
);
String
str2
=
code
.
substring
(
9
,
code
.
length
());
str2
=
formatContent
(
str2
,
10
);
as
=
new
AttributedString
(
str2
);
as
.
addAttribute
(
TextAttribute
.
FONT
,
font
);
as
.
addAttribute
(
TextAttribute
.
UNDERLINE
,
TextAttribute
.
UNDERLINE_LOW_DASHED
,
0
,
str2
.
length
());
g2
.
drawString
(
as
.
getIterator
(),
contentX
+
contentTitle4Width
,
contentY
+
600
);
}
as
=
new
AttributedString
(
code
);
as
.
addAttribute
(
TextAttribute
.
FONT
,
font
);
as
.
addAttribute
(
TextAttribute
.
UNDERLINE
,
TextAttribute
.
UNDERLINE_LOW_DASHED
,
0
,
code
.
length
());
g2
.
drawString
(
as
.
getIterator
(),
contentX
+
contentTitle4Width
,
contentY
+
150
);
return
bgImage
;
...
...
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