Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
ufo-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
mali
5 years ago
Commit
c929a235e94aa9eafbe18e039a195376842c7e8a
1 parent
31208dc9
测试代码
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
common/src/test/java/com/yohobuy/ufo/ExcelParseUtil.java
common/src/test/java/com/yohobuy/ufo/SizePoolImageDemo.java
common/src/test/java/com/yohobuy/ufo/ExcelParseUtil.java
View file @
c929a23
...
...
@@ -12,9 +12,9 @@ import java.util.List;
public
class
ExcelParseUtil
{
public
static
void
main
(
String
[]
args
)
{
try
{
List
<
ProductProfit
>
dataList
=
XlsxUtils
.
parse
(
new
File
(
"C:\\Users\\li.ma\\Desktop\\8月份新品爆款扣点调整fortiger0813.xlsx"
),
ProductProfit
.
class
);
List
<
SizePoolImageDemo
>
dataList
=
XlsxUtils
.
parse
(
new
File
(
"C:\\Users\\li.ma\\Desktop\\ml1.xlsx"
),
SizePoolImageDemo
.
class
);
for
(
ProductProfit
item
:
dataList
)
{
for
(
SizePoolImageDemo
item
:
dataList
)
{
//String l = String.format("curl 'http://172.31.70.39:8088/ufoPlatform/live/generateMp4Vedio?debug=XYZ&orderCode=%d&startTime=%d&endTime=%d&cameraCode=%d'", item.getOrderCode(), item.getStartTime(), item.getEndTime() + 1, item.getCameraCode());
/*if (item.getSeriesId() == 0) {
...
...
@@ -23,10 +23,10 @@ public class ExcelParseUtil {
System.out.println(String.format("update ufo_product.product set brand_id = %d, series_id = %d where id = %d;", item.getBrandId(), item.getSeriesId(), item.getId()));
}*/
System
.
out
.
println
(
String
.
format
(
"insert into ufo_product.product_profit(product_id, profit_rate) values(%d, %.3f);"
,
item
.
getProductId
(),
item
.
getProfitRate
()/
100
));
System
.
out
.
println
(
String
.
format
(
"insert into ufo_product.size_pool_image(size_pool_id, image_url,image_width,image_height) values(%d, '%s', %d, %d);"
,
item
.
getProductId
(),
item
.
getImageUrl
(),
item
.
getWidth
(),
item
.
getHeight
()));
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
common/src/test/java/com/yohobuy/ufo/SizePoolImageDemo.java
0 → 100644
View file @
c929a23
package
com
.
yohobuy
.
ufo
;
import
com.yoho.ufo.annotation.BatchImportField
;
import
lombok.Data
;
/**
* Created by li.ma on 2020/5/9.
*/
@Data
public
class
SizePoolImageDemo
{
@BatchImportField
(
index
=
0
)
private
Integer
productId
;
@BatchImportField
(
index
=
1
)
private
String
imageUrl
;
@BatchImportField
(
index
=
2
)
private
Integer
width
;
@BatchImportField
(
index
=
3
)
private
Integer
height
;
}
...
...
Please
register
or
login
to post a comment