Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
9fb648e5
提交
9fb648e5
authored
1月 10, 2020
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品导入优化
上级
23782532
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
5 行删除
+22
-5
TbCfStationItemServiceImpl.java
...com/platform/service/impl/TbCfStationItemServiceImpl.java
+19
-2
OssUtil.java
...form-common/src/main/java/com/platform/utils/OssUtil.java
+3
-3
没有找到文件。
platform-admin/src/main/java/com/platform/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
9fb648e5
...
...
@@ -4,6 +4,7 @@ import com.platform.dao.*;
import
com.platform.entity.*
;
import
com.platform.service.TbCfStationItemService
;
import
com.platform.utils.IdUtil
;
import
com.platform.utils.OssUtil
;
import
com.platform.utils.UuidUtil
;
import
com.platform.utils.excel.ExcelExport
;
import
com.platform.utils.excel.ExcelImport
;
...
...
@@ -387,7 +388,8 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
item
.
setItemTags
(
values
[
3
]);
item
.
setItemPrice
(
new
BigDecimal
(
values
[
4
]));
item
.
setDiscountPrice
(
new
BigDecimal
(
values
[
5
]));
item
.
setItemImg
(
values
[
6
]);
String
url
=
OssUtil
.
upload
(
new
File
(
values
[
6
]),
"product"
);
item
.
setItemImg
(
url
);
item
.
setItemCount
(
Long
.
parseLong
(
values
[
7
]));
item
.
setItemCategory
(
values
[
8
]);
item
.
setItemCategorytwo
(
values
[
9
]);
...
...
@@ -397,9 +399,24 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
item
.
setItemNum
(
0L
);
tbCfStationItemDao
.
save
(
item
);
//商品详情
//<p><img src="https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop//157803966530910616.jpg" title="O1CN01KImpIp1MmVZT26VVW_!!132691477.jpg"/></p>
TbCfItemDescEntity
desc
=
new
TbCfItemDescEntity
();
desc
.
setItemId
(
itemId
);
desc
.
setItemDesc
(
values
[
13
]);
Date
date
=
new
Date
();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
time
=
format
.
format
(
date
);
String
image
=
null
;
if
(
values
[
13
].
contains
(
";"
))
{
String
[]
urlArr
=
values
[
13
].
split
(
";"
);
for
(
int
i
=
0
;
i
<
urlArr
.
length
;
i
++)
{
String
imageUrl
=
"<p><img src="
+
urlArr
[
i
]
+
" title="
+
time
+
i
+
"+.jpg/></p> "
;
image
+=
imageUrl
;
}
}
else
{
image
=
"<p><img src="
+
values
[
13
]
+
" title="
+
time
+
"+.jpg/></p> "
;
}
System
.
err
.
println
(
image
);
desc
.
setItemDesc
(
image
);
desc
.
setCreateTime
(
new
Date
());
desc
.
setUpdateTime
(
new
Date
());
desc
.
setDelFlag
(
1
);
...
...
platform-common/src/main/java/com/platform/utils/OssUtil.java
浏览文件 @
9fb648e5
...
...
@@ -382,11 +382,11 @@ public class OssUtil {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
file
=
new
File
(
"
D:\\123.mp4
"
);
File
file
=
new
File
(
"
C:\\Users\\Administrator\\Pictures\\四等奖_20190918194024.png
"
);
byte
[]
b
=
File2byte
(
file
);
//
System.out.println(b);
System
.
out
.
println
(
b
);
// boolean flag = deleteFile("https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/hello/hello.jpg");
String
s
=
upload
(
b
,
"hello.
mp4
"
,
"hello"
);
String
s
=
upload
(
b
,
"hello.
png
"
,
"hello"
);
System
.
out
.
println
(
s
);
// System.out.println(flag);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论