Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
1
Merge Requests
1
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
haoban3.0
haoban-manage3.0
Commits
baa8291d
Commit
baa8291d
authored
May 24, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购可编辑状态
parent
c73af46d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
+42
-3
MaterialApiService.java
...com/gic/haoban/manage/api/service/MaterialApiService.java
+8
-0
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+4
-0
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+30
-3
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MaterialApiService.java
View file @
baa8291d
...
...
@@ -59,4 +59,12 @@ public interface MaterialApiService {
*/
void
delMaterial
(
List
<
String
>
ids
);
/**
* 自动刷新madiaid的 获取素材
*
* @param materialId
* @return
*/
MaterialDTO
getHasChangeMadieMaterialById
(
String
materialId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
View file @
baa8291d
...
...
@@ -139,6 +139,10 @@ public class StoreRangeServiceImpl implements StoreRangeService {
return
true
;
}
private
void
dealStoreRelation
(
List
<
TabStoreRelation
>
storeRelations
,
String
enterpriseId
)
{
//todo 动态删除
}
/**
* 批量插入
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
baa8291d
...
...
@@ -12,6 +12,8 @@ import com.gic.haoban.manage.service.entity.TabMiniprogramSetting;
import
com.gic.haoban.manage.service.service.MiniprogramSettingService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -131,7 +133,11 @@ public class MaterialApiServiceImpl implements MaterialApiService {
fileType
=
QywxMediaTypeEnum
.
FILE
;
url
=
materialDTO
.
getLink
();
}
if
(
type
==
3
){
if
(
type
==
6
)
{
fileType
=
QywxMediaTypeEnum
.
IMAGE
;
url
=
materialDTO
.
getImgUrl
();
}
if
(
type
==
3
){
String
imgUrl
=
materialDTO
.
getImgUrl
();
logger
.
info
(
"【上传图片】imgUrl={}"
,
imgUrl
);
JSONResponse
response
=
qywxSuiteApiService
.
uploadImage
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
getFileByte
(
imgUrl
));
...
...
@@ -244,8 +250,11 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if
(
type
==
5
){
fileType
=
QywxMediaTypeEnum
.
FILE
;
url
=
old
.
getLink
();
}
String
[]
arr
=
url
.
split
(
"/"
);
}
else
if
(
type
==
6
)
{
fileType
=
QywxMediaTypeEnum
.
IMAGE
;
url
=
old
.
getImgUrl
();
}
String
[]
arr
=
url
.
split
(
"/"
);
int
count
=
arr
.
length
;
JSONResponse
jp
=
qywxSuiteApiService
.
uploadMedia
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
getFileByte
(
url
),
arr
[
count
-
1
],
fileType
.
getCode
());
if
(
jp
.
getErrorCode
()
==
0
){
...
...
@@ -337,4 +346,22 @@ public class MaterialApiServiceImpl implements MaterialApiService {
public
void
delMaterial
(
List
<
String
>
ids
)
{
materialService
.
delmaterialByIds
(
ids
);
}
@Override
public
MaterialDTO
getHasChangeMadieMaterialById
(
String
materialId
)
{
MaterialDTO
materialDTO
=
this
.
selectMaterialById
(
materialId
);
if
(
null
==
materialDTO
)
{
return
null
;
}
Date
lastUploadTime
=
materialDTO
.
getWxLastUploadTime
();
Date
date
=
new
Date
();
Date
compareDate
=
DateUtils
.
addDays
(
date
,
-
3
);
if
(
lastUploadTime
!=
null
&&
lastUploadTime
.
after
(
compareDate
)
&&
StringUtils
.
isNotBlank
(
materialDTO
.
getMediaId
()))
{
return
materialDTO
;
}
String
madiaId
=
this
.
reUpdalodMetail
(
materialId
);
materialDTO
.
setMediaId
(
madiaId
);
materialDTO
.
setWxLastUploadTime
(
date
);
return
materialDTO
;
}
}
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