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
4b83f772
Commit
4b83f772
authored
Feb 21, 2023
by
胡懿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
货品,二维码,入库,台账jsp
parent
d8b7e90f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
3 deletions
+83
-3
GoodsService.java
...jeeplus/modules/warehouse/goods/service/GoodsService.java
+7
-3
IKSegmenterTest.java
...jeeplus/modules/warehouse/ikanalyzer/IKSegmenterTest.java
+57
-0
LedgerService.java
...eplus/modules/warehouse/ledger/service/LedgerService.java
+1
-0
IKAnalyzer.cfg.xml
src/main/resources/IKAnalyzer.cfg.xml
+11
-0
ext.dic
src/main/resources/ext.dic
+7
-0
No files found.
src/main/java/com/jeeplus/modules/warehouse/goods/service/GoodsService.java
View file @
4b83f772
...
...
@@ -94,7 +94,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
*/
@Transactional
(
readOnly
=
false
)
public
GoodsInfo
printQr
(
String
infoId
)
{
String
qrImgPath
=
Global
.
get
UserfilesBase
Dir
()
+
"image"
;
String
qrImgPath
=
Global
.
get
Attachment
Dir
()
+
"image"
;
File
file
=
new
File
(
qrImgPath
);
if
(!
file
.
exists
()
&&
!
file
.
isDirectory
())
{
System
.
out
.
println
(
"//不存在"
);
...
...
@@ -135,7 +135,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
qrCode
.
setUrl
(
"image/"
+
numSeq
+
"_"
+
i
+
".png"
);
qrCode
.
setUrl
(
Global
.
getAttachmentUrl
()
+
"image/"
+
numSeq
+
"_"
+
i
+
".png"
);
qrCodeMapper
.
insert
(
qrCode
);
qrCodeList
.
add
(
qrCode
);
...
...
@@ -171,7 +171,11 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
for
(
QrCode
qrCode
:
qrCodeList
)
{
if
(
StringUtils
.
isNotBlank
(
qrCode
.
getUrl
()))
{
try
{
FileUtil
.
deleteFile
(
new
File
(
Global
.
getUserfilesBaseDir
()
+
qrCode
.
getUrl
()));
String
url
=
qrCode
.
getUrl
();
if
(
null
!=
url
&&
url
.
contains
(
"image"
))
{
String
photo
=
url
.
split
(
"image/"
)[
1
];
FileUtil
.
deleteFile
(
new
File
(
Global
.
getAttachmentDir
()
+
"image/"
+
photo
));
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
src/main/java/com/jeeplus/modules/warehouse/ikanalyzer/IKSegmenterTest.java
0 → 100644
View file @
4b83f772
package
com
.
jeeplus
.
modules
.
warehouse
.
ikanalyzer
;
import
java.io.StringReader
;
import
org.wltea.analyzer.cfg.DefaultConfig
;
import
org.wltea.analyzer.core.IKSegmenter
;
import
org.wltea.analyzer.core.Lexeme
;
import
org.wltea.analyzer.cfg.Configuration
;
public
class
IKSegmenterTest
{
private
static
Configuration
m_wordCut_cfg
;
public
String
parse
(
String
content
,
boolean
useSmart
)
throws
Exception
{
StringReader
sr
=
new
StringReader
(
content
);
// 参数2为是否使用智能分词
// true:使用智能分词
// false:使用最细粒度分词
IKSegmenter
ikSegmenter
=
new
IKSegmenter
(
sr
,
useSmart
);
Lexeme
word
=
null
;
String
w
=
null
;
StringBuffer
sb
=
new
StringBuffer
();
while
((
word
=
ikSegmenter
.
next
())
!=
null
){
w
=
word
.
getLexemeText
();
// int nTtype = word.getLexemeType();
// if (nTtype == 64) continue;
if
(
sb
.
length
()
>
0
){
sb
.
append
(
"|"
);
}
sb
.
append
(
w
);
}
return
sb
.
toString
();
}
/**
* 分词方法
* @param text 需要拆分的字符串
* @param b ture为智能拆分,false为最细粒度拆分
* @return
*/
public
static
String
splitStr
(
String
text
,
boolean
b
)
{
String
strs
=
text
;
m_wordCut_cfg
=
DefaultConfig
.
getInstance
();
try
{
IKSegmenterTest
ikSegmenterTest
=
new
IKSegmenterTest
();
strs
=
ikSegmenterTest
.
parse
(
text
,
b
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
strs
;
}
public
static
void
main
(
String
[]
args
)
{
String
text
=
"185的绿色军鞋15双"
;
System
.
out
.
println
(
"使用智能分词结果:"
+
splitStr
(
text
,
true
));
System
.
out
.
println
(
"最细粒度分词结果:"
+
splitStr
(
text
,
false
));
}
}
src/main/java/com/jeeplus/modules/warehouse/ledger/service/LedgerService.java
View file @
4b83f772
...
...
@@ -49,6 +49,7 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
List
<
CountLedgerInfo
>
list
=
map
.
get
(
batchNum
);
if
(
null
==
list
)
{
list
=
new
ArrayList
<>();
list
.
add
(
countLedgerInfo
);
map
.
put
(
countLedgerInfo
.
getBatchNum
(),
list
);
}
else
{
...
...
src/main/resources/IKAnalyzer.cfg.xml
0 → 100644
View file @
4b83f772
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>
IK Analyzer 扩展配置
</comment>
<!--用户可以在这里配置自己的扩展字典 -->
<entry
key=
"ext_dict"
>
ext.dic;
</entry>
<!--用户可以在这里配置自己的扩展停止词字典 -->
<!-- <entry key="ext_stopwords">stopword.dic;org/wltea/analyzer/dic/main2012.dic;</entry>-->
</properties>
\ No newline at end of file
src/main/resources/ext.dic
0 → 100644
View file @
4b83f772
185
170
鞋子
衣服
裤子
绿军鞋
\ No newline at end of file
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