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
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
haoban3.0
haoban-manage3.0
Commits
5c0014a9
Commit
5c0014a9
authored
Apr 19, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店信息包含总部还是代理信息
parent
7f003d14
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
58 deletions
+86
-58
MaterialApiService.java
...com/gic/haoban/manage/api/service/MaterialApiService.java
+2
-0
TabHaobanMaterialMapper.java
...an/manage/service/dao/mapper/TabHaobanMaterialMapper.java
+2
-0
MaterialService.java
...om/gic/haoban/manage/service/service/MaterialService.java
+2
-0
MaterialServiceImpl.java
...oban/manage/service/service/impl/MaterialServiceImpl.java
+9
-4
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+58
-53
TabHaobanMaterialMapper.xml
...ice/src/main/resources/mapper/TabHaobanMaterialMapper.xml
+13
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MaterialApiService.java
View file @
5c0014a9
...
...
@@ -26,6 +26,8 @@ public interface MaterialApiService {
MaterialDTO
selectMaterialById
(
String
materialId
);
List
<
MaterialDTO
>
listMaterialByIds
(
List
<
String
>
materialIds
);
void
editMaterial
(
MaterialDTO
materialDTO
);
Page
<
MaterialDTO
>
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
,
BasePageInfo
pageInfo
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanMaterialMapper.java
View file @
5c0014a9
...
...
@@ -16,6 +16,8 @@ public interface TabHaobanMaterialMapper {
TabHaobanMaterial
selectByPrimaryKey
(
String
materialId
);
List
<
TabHaobanMaterial
>
listByids
(
@Param
(
"materialIds"
)
List
<
String
>
materialIds
);
int
updateByPrimaryKeySelective
(
TabHaobanMaterial
record
);
int
updateByPrimaryKey
(
TabHaobanMaterial
record
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/MaterialService.java
View file @
5c0014a9
...
...
@@ -12,6 +12,8 @@ public interface MaterialService {
MaterialDTO
selectMaterialById
(
String
materialId
);
List
<
MaterialDTO
>
listMaterialByIds
(
List
<
String
>
materialIds
);
void
edit
(
MaterialDTO
materialDTO
);
com
.
github
.
pagehelper
.
Page
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/MaterialServiceImpl.java
View file @
5c0014a9
...
...
@@ -42,9 +42,14 @@ public class MaterialServiceImpl implements MaterialService {
}
@Override
public
void
edit
(
MaterialDTO
materialDTO
)
{
materialDTO
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanMaterial
.
class
,
materialDTO
));
public
List
<
MaterialDTO
>
listMaterialByIds
(
List
<
String
>
materialIds
)
{
return
EntityUtil
.
changeEntityListByOrika
(
MaterialDTO
.
class
,
mapper
.
listByids
(
materialIds
));
}
@Override
public
void
edit
(
MaterialDTO
materialDTO
)
{
materialDTO
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanMaterial
.
class
,
materialDTO
));
//
// List<TabHaobanMaterial> materials = mapper.listByfromMaterialId(materialDTO.getMaterialId());
// if (CollectionUtils.isEmpty(materials)) {
...
...
@@ -52,7 +57,7 @@ public class MaterialServiceImpl implements MaterialService {
// return;
// }
}
}
@Override
public
Page
<
TabHaobanMaterial
>
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
5c0014a9
...
...
@@ -151,59 +151,64 @@ public class MaterialApiServiceImpl implements MaterialApiService {
}
@Override
public
void
editMaterial
(
MaterialDTO
materialDTO
)
{
Integer
type
=
materialDTO
.
getMaterialType
();
String
materialId
=
materialDTO
.
getMaterialId
();
MaterialDTO
old
=
materialService
.
selectMaterialById
(
materialId
);
String
wxEnterpriseId
=
old
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
type
==
null
){
return
;
}
if
(
enterprise
==
null
){
return
;
}
QywxMediaTypeEnum
fileType
=
null
;
String
url
=
""
;
String
oldUrl
=
""
;
if
(
type
==
2
){
fileType
=
QywxMediaTypeEnum
.
IMAGE
;
url
=
materialDTO
.
getImgUrl
();
oldUrl
=
old
.
getImgUrl
();
}
if
(
type
==
4
){
fileType
=
QywxMediaTypeEnum
.
VIDEO
;
url
=
materialDTO
.
getLink
();
oldUrl
=
old
.
getLink
();
}
if
(
type
==
5
){
fileType
=
QywxMediaTypeEnum
.
FILE
;
url
=
materialDTO
.
getLink
();
oldUrl
=
old
.
getLink
();
}
if
(
type
==
3
){
String
imgUrl
=
materialDTO
.
getImgUrl
();
String
oldImgUrl
=
materialDTO
.
getImgUrl
();
if
(!
imgUrl
.
equals
(
oldImgUrl
)){
JSONResponse
response
=
qywxSuiteApiService
.
uploadImage
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
getFileByte
(
imgUrl
));
String
wxImgUrl
=
response
.
getResult
()
==
null
?
""
:
response
.
getResult
().
toString
();
materialDTO
.
setWxImgUrl
(
wxImgUrl
);
}
}
if
(
fileType
!=
null
&&
!
url
.
equals
(
oldUrl
)){
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
){
materialDTO
.
setWxLastUploadTime
(
new
Date
());
materialDTO
.
setMediaId
(
jp
.
getResult
().
toString
());
materialService
.
edit
(
materialDTO
);
}
}
else
{
materialService
.
edit
(
materialDTO
);
}
}
public
List
<
MaterialDTO
>
listMaterialByIds
(
List
<
String
>
materialIds
)
{
return
materialService
.
listMaterialByIds
(
materialIds
);
}
@Override
public
void
editMaterial
(
MaterialDTO
materialDTO
)
{
Integer
type
=
materialDTO
.
getMaterialType
();
String
materialId
=
materialDTO
.
getMaterialId
();
MaterialDTO
old
=
materialService
.
selectMaterialById
(
materialId
);
String
wxEnterpriseId
=
old
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
type
==
null
){
return
;
}
if
(
enterprise
==
null
){
return
;
}
QywxMediaTypeEnum
fileType
=
null
;
String
url
=
""
;
String
oldUrl
=
""
;
if
(
type
==
2
){
fileType
=
QywxMediaTypeEnum
.
IMAGE
;
url
=
materialDTO
.
getImgUrl
();
oldUrl
=
old
.
getImgUrl
();
}
if
(
type
==
4
){
fileType
=
QywxMediaTypeEnum
.
VIDEO
;
url
=
materialDTO
.
getLink
();
oldUrl
=
old
.
getLink
();
}
if
(
type
==
5
){
fileType
=
QywxMediaTypeEnum
.
FILE
;
url
=
materialDTO
.
getLink
();
oldUrl
=
old
.
getLink
();
}
if
(
type
==
3
){
String
imgUrl
=
materialDTO
.
getImgUrl
();
String
oldImgUrl
=
materialDTO
.
getImgUrl
();
if
(!
imgUrl
.
equals
(
oldImgUrl
)){
JSONResponse
response
=
qywxSuiteApiService
.
uploadImage
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
getFileByte
(
imgUrl
));
String
wxImgUrl
=
response
.
getResult
()
==
null
?
""
:
response
.
getResult
().
toString
();
materialDTO
.
setWxImgUrl
(
wxImgUrl
);
}
}
if
(
fileType
!=
null
&&
!
url
.
equals
(
oldUrl
)){
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
){
materialDTO
.
setWxLastUploadTime
(
new
Date
());
materialDTO
.
setMediaId
(
jp
.
getResult
().
toString
());
materialService
.
edit
(
materialDTO
);
}
}
else
{
materialService
.
edit
(
materialDTO
);
}
}
@Override
public
String
reUpdalodMetail
(
String
materialId
){
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanMaterialMapper.xml
View file @
5c0014a9
...
...
@@ -32,7 +32,19 @@
from tab_haoban_material
where material_id = #{materialId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
<select
id=
"listByids"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_material
where status_flag =1
AND material_id in
<foreach
collection=
"materialIds"
item=
"item"
open=
"("
close=
")"
>
#{item,jdbcType=VARCHAR}
</foreach>
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_haoban_material
where material_id = #{materialId,jdbcType=VARCHAR}
</delete>
...
...
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