Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
37a6ad83
Commit
37a6ad83
authored
Sep 01, 2020
by
吴博
Committed by
桂前礼
Sep 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1003495] 第三方链接在资讯中走文章素材流程,并添加开关控制修改流程
parent
98809ecb
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
203 additions
and
32 deletions
+203
-32
AppletThirdResourcesDTO.java
...a/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
+4
-0
BookConstant.java
...main/java/com/pcloud/book/book/constant/BookConstant.java
+1
-5
AppletThirdResourcesBizImpl.java
...oud/book/applet/biz/impl/AppletThirdResourcesBizImpl.java
+31
-13
AppletThirdResourcesDTO.java
...a/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
+12
-0
AppletThirdResources.java
...a/com/pcloud/book/applet/entity/AppletThirdResources.java
+11
-0
AppletThirdResourcesFacade.java
...pcloud/book/applet/facade/AppletThirdResourcesFacade.java
+2
-1
BizMaterialBiz.java
...c/main/java/com/pcloud/book/group/biz/BizMaterialBiz.java
+15
-0
BizMaterialBizImpl.java
...va/com/pcloud/book/group/biz/impl/BizMaterialBizImpl.java
+71
-0
UseTypeEnum.java
...rc/main/java/com/pcloud/book/group/enums/UseTypeEnum.java
+1
-1
BizMaterialMapper.java
.../java/com/pcloud/book/group/mapper/BizMaterialMapper.java
+3
-0
AppletThirdResources.xml
...src/main/resources/mapper/applet/AppletThirdResources.xml
+39
-11
BizMaterialMapper.xml
...ook/src/main/resources/mapper/group/BizMaterialMapper.xml
+13
-1
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
View file @
37a6ad83
...
@@ -39,4 +39,7 @@ public class AppletThirdResourcesDTO extends BaseDto {
...
@@ -39,4 +39,7 @@ public class AppletThirdResourcesDTO extends BaseDto {
@ApiModelProperty
(
"修改人"
)
@ApiModelProperty
(
"修改人"
)
private
Long
updator
;
private
Long
updator
;
@ApiModelProperty
(
"资讯自定义引导语"
)
private
String
guide
;
}
}
\ No newline at end of file
pcloud-facade-book/src/main/java/com/pcloud/book/book/constant/BookConstant.java
View file @
37a6ad83
...
@@ -379,11 +379,7 @@ public class BookConstant {
...
@@ -379,11 +379,7 @@ public class BookConstant {
/**
/**
* 群二维码永久图文素材,html 源代码
* 群二维码永久图文素材,html 源代码
*/
*/
public
static
final
String
GROUP_QRCODE_NEWS_MATERIAL_HTML
=
"<div style=\"margin:10px 0;box-sizing: border-box;\"><header style=\"display: flex;padding:0 20px;\">"
+
public
static
final
String
GROUP_QRCODE_NEWS_MATERIAL_HTML
=
"<div style='margin:10px 0;box-sizing: border-box;'><header style='display: flex;padding:0 20px;'><img style='width: 60px;height: 60px;'src='${groupHeadImg}'alt=''><div style='display: flex;flex: 1;align-items: center;margin-left:10px;color:#000;font-size: 16px;font-weight: bold;'>${groupName}</div></header><div style='margin:55px auto 32px;width: 275px;height: 255px;'><div style='width: 275px;height: 255px;background-color: #ffffff;border-radius: 6px;border: solid 1px #66c84f'><div style='margin-top:-16px;margin-left:53px;width: 168px;height: 32px;line-height: 32px;text-align: center; font-size: 14px;color: #ffffff; background-color: #66c84f;border-radius: 6px;'>长按识别下面二维码</div><div style='height: 23px;display: block;text-align: center;margin: 10px auto;letter-spacing: 6px;'>\uD83D\uDC47\uD83D\uDC47\uD83D\uDC47</div><div style='width: 172px;height:172px;display: block;margin: 0 auto;'><img class='qrcode'src='${qrcodeUrl}'alt=''></div></div></div></div>"
;
"<img style=\"width: 64px;height: 64px;\" src=\"${groupHeadImg}\" alt=\"\"><div style=\"display: flex;flex: 1;align-items: center;margin-left:10px;"
+
"color:#000;font-size: 16px;font-weight: bold;\"> ${groupName}</div></header><div style=\"padding:10px 20px;\"> <p style=\"margin: 10px 0 20px;text-align:center;\">"
+
" <span style=\"padding:2px 35px;background-color: #dbf5d9;color:#5bc341;border-radius: 35px;\">\uD83D\uDC47长按识别下面二维码</span> </p>"
+
"<img style=\"width:100%;\" src=\"${qrcodeUrl}\" alt=\"\"></div></div>"
;
public
static
final
String
BOOK_CITY_MAP
=
CacheConstant
.
BOOK
+
"BOOK_CITY_MAP"
;
public
static
final
String
BOOK_CITY_MAP
=
CacheConstant
.
BOOK
+
"BOOK_CITY_MAP"
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletThirdResourcesBizImpl.java
View file @
37a6ad83
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
import
java.util.ArrayList
;
import
cn.hutool.core.util.StrUtil
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.MapUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesBiz
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesBiz
;
import
com.pcloud.book.applet.dao.AppletLinkClickDao
;
import
com.pcloud.book.applet.dao.AppletLinkClickDao
;
import
com.pcloud.book.applet.dao.AppletNewsDao
;
import
com.pcloud.book.applet.dao.AppletNewsDao
;
...
@@ -26,11 +14,24 @@ import com.pcloud.book.applet.entity.AppletThirdResourcesClick;
...
@@ -26,11 +14,24 @@ import com.pcloud.book.applet.entity.AppletThirdResourcesClick;
import
com.pcloud.book.applet.enums.DataRecordTypeEnum
;
import
com.pcloud.book.applet.enums.DataRecordTypeEnum
;
import
com.pcloud.book.applet.enums.DataTypeEnum
;
import
com.pcloud.book.applet.enums.DataTypeEnum
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.group.biz.BizMaterialBiz
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.MapUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
@Service
(
"appletThirdResourcesBiz"
)
@Service
(
"appletThirdResourcesBiz"
)
...
@@ -44,6 +45,8 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -44,6 +45,8 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
private
AppletThirdResourcesClickDao
thirdResourcesClickDao
;
private
AppletThirdResourcesClickDao
thirdResourcesClickDao
;
@Autowired
@Autowired
private
AppletNewsDao
appletNewsDao
;
private
AppletNewsDao
appletNewsDao
;
@Autowired
private
BizMaterialBiz
bizMaterialBiz
;
@Override
@Override
public
PageBeanNew
<
AppletThirdResourcesDTO
>
getListThirdResourcesAnalysis
(
String
keyValue
,
String
source
,
public
PageBeanNew
<
AppletThirdResourcesDTO
>
getListThirdResourcesAnalysis
(
String
keyValue
,
String
source
,
...
@@ -169,6 +172,7 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -169,6 +172,7 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
public
void
updateThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
Boolean
exist
=
appletNewsDao
.
newsSourceExist
(
thirdResourcesDTO
.
getSource
(),
0L
);
Boolean
exist
=
appletNewsDao
.
newsSourceExist
(
thirdResourcesDTO
.
getSource
(),
0L
);
...
@@ -185,8 +189,17 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -185,8 +189,17 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
}
}
}
}
// 链接发生变化,更新素材
if
(
Objects
.
nonNull
(
thirdResourcesDTO
.
getRouteCode
())
&&
thirdResourcesDTO
.
getRouteCode
()
==
1
){
AppletThirdResources
byId
=
thirdResourcesDao
.
getById
(
thirdResourcesDTO
.
getId
());
if
(!(
StrUtil
.
equals
(
byId
.
getUrl
(),
thirdResourcesDTO
.
getUrl
())
&&
StrUtil
.
equals
(
byId
.
getName
(),
thirdResourcesDTO
.
getName
()))){
bizMaterialBiz
.
createMaterial4ThirdResource
(
thirdResourcesDTO
.
getName
(),
thirdResourcesDTO
.
getUrl
(),
Math
.
toIntExact
(
thirdResourcesDTO
.
getId
()));
}
}
BeanUtils
.
copyProperties
(
thirdResourcesDTO
,
thirdResources
);
BeanUtils
.
copyProperties
(
thirdResourcesDTO
,
thirdResources
);
thirdResourcesDao
.
update
(
thirdResources
);
thirdResourcesDao
.
update
(
thirdResources
);
}
}
@Override
@Override
...
@@ -195,6 +208,7 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -195,6 +208,7 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
createThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
public
void
createThirdResources
(
AppletThirdResourcesDTO
thirdResourcesDTO
)
{
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
AppletThirdResources
thirdResources
=
new
AppletThirdResources
();
...
@@ -213,6 +227,10 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
...
@@ -213,6 +227,10 @@ public class AppletThirdResourcesBizImpl implements AppletThirdResourcesBiz {
BeanUtils
.
copyProperties
(
thirdResourcesDTO
,
thirdResources
);
BeanUtils
.
copyProperties
(
thirdResourcesDTO
,
thirdResources
);
thirdResourcesDao
.
insert
(
thirdResources
);
thirdResourcesDao
.
insert
(
thirdResources
);
if
(
Objects
.
nonNull
(
thirdResourcesDTO
.
getRouteCode
())&&
thirdResourcesDTO
.
getRouteCode
()==
1
&&
StrUtil
.
isNotBlank
(
thirdResourcesDTO
.
getUrl
())){
bizMaterialBiz
.
createMaterial4ThirdResource
(
thirdResourcesDTO
.
getName
(),
thirdResourcesDTO
.
getUrl
(),
Math
.
toIntExact
(
thirdResources
.
getId
()));
}
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourcesDTO.java
View file @
37a6ad83
...
@@ -8,6 +8,7 @@ import com.pcloud.common.dto.BaseDto;
...
@@ -8,6 +8,7 @@ import com.pcloud.common.dto.BaseDto;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
@Data
@Data
@ApiModel
(
"第三方资源"
)
@ApiModel
(
"第三方资源"
)
...
@@ -77,8 +78,19 @@ public class AppletThirdResourcesDTO extends BaseDto {
...
@@ -77,8 +78,19 @@ public class AppletThirdResourcesDTO extends BaseDto {
)
)
protected
Date
updateTime
;
protected
Date
updateTime
;
@ApiModelProperty
(
"第三方资源路径 默认0:客服窗口 1:公众号文章素材"
)
private
Integer
routeCode
;
@ApiModelProperty
(
"引导语,限制30字符"
)
@Length
(
max
=
30
,
message
=
"引导语最大长度未30个字符"
)
private
String
guide
;
@ApiModelProperty
(
"文章素材地址"
)
private
String
materialUrl
;
private
List
<
AppletChartDateDTO
>
clickList
;
private
List
<
AppletChartDateDTO
>
clickList
;
private
List
<
AppletChartDateDTO
>
browseList
;
private
List
<
AppletChartDateDTO
>
browseList
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletThirdResources.java
View file @
37a6ad83
...
@@ -36,4 +36,14 @@ public class AppletThirdResources extends BaseEntity {
...
@@ -36,4 +36,14 @@ public class AppletThirdResources extends BaseEntity {
@ApiModelProperty
(
"修改人"
)
@ApiModelProperty
(
"修改人"
)
private
Long
updator
;
private
Long
updator
;
@ApiModelProperty
(
"第三方资源路径 默认0:客服窗口 1:公众号文章素材"
)
private
Integer
routeCode
;
@ApiModelProperty
(
"引导语,限制30字符"
)
private
String
guide
;
@ApiModelProperty
(
"素材地址"
)
private
String
materialUrl
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/facade/AppletThirdResourcesFacade.java
View file @
37a6ad83
package
com
.
pcloud
.
book
.
applet
.
facade
;
package
com
.
pcloud
.
book
.
applet
.
facade
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -139,7 +140,7 @@ public class AppletThirdResourcesFacade {
...
@@ -139,7 +140,7 @@ public class AppletThirdResourcesFacade {
@ApiOperation
(
"创建第三方资源"
)
@ApiOperation
(
"创建第三方资源"
)
@PostMapping
(
"createThirdResources"
)
@PostMapping
(
"createThirdResources"
)
public
ResponseDto
<?>
createThirdResources
(
@RequestHeader
(
"token"
)
String
token
,
public
ResponseDto
<?>
createThirdResources
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
AppletThirdResourcesDTO
thirdResourcesDTO
)
throws
PermissionException
{
@RequestBody
@ApiParam
@Validated
AppletThirdResourcesDTO
thirdResourcesDTO
)
throws
PermissionException
{
SessionUtil
.
getInfoToken4Redis
(
token
);
SessionUtil
.
getInfoToken4Redis
(
token
);
if
(
thirdResourcesDTO
!=
null
&&
Long
.
compare
(
thirdResourcesDTO
.
getType
(),
0
)
==
0
if
(
thirdResourcesDTO
!=
null
&&
Long
.
compare
(
thirdResourcesDTO
.
getType
(),
0
)
==
0
&&
thirdResourcesDTO
.
getAppletsId
()
==
null
)
{
&&
thirdResourcesDTO
.
getAppletsId
()
==
null
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BizMaterialBiz.java
0 → 100644
View file @
37a6ad83
package
com
.
pcloud
.
book
.
group
.
biz
;
public
interface
BizMaterialBiz
{
/**
* 第三方资源链接创建文章素材
*
*
* @param name
* @param link 创建文章素材
* @return 结果
*/
void
createMaterial4ThirdResource
(
String
name
,
String
link
,
Integer
resourceId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BizMaterialBizImpl.java
0 → 100644
View file @
37a6ad83
package
com
.
pcloud
.
book
.
group
.
biz
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.group.biz.BizMaterialBiz
;
import
com.pcloud.book.group.biz.GroupMaterialAccountBiz
;
import
com.pcloud.book.group.entity.BizMaterial
;
import
com.pcloud.book.group.entity.GroupMaterialAccount
;
import
com.pcloud.book.group.enums.UseTypeEnum
;
import
com.pcloud.book.group.mapper.BizMaterialMapper
;
import
com.pcloud.common.utils.QrcodeUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.facade.wechat.material.dto.GroupNewsMaterialAddDTO
;
import
com.pcloud.facade.wechat.material.service.MaterialService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.Objects
;
@Component
(
"bizMaterialBiz"
)
public
class
BizMaterialBizImpl
implements
BizMaterialBiz
{
public
static
final
String
THIRD_RESOURCE_MATERIAL_HTML_TEMPLATE
=
"<div style='margin:10px 0;box-sizing: border-box;'><div style='margin:55px auto 32px;width: 275px;height: 255px;'><div style='width: 275px;height: 255px;background-color: #ffffff;border-radius: 6px;border: solid 1px #66c84f'><div style='margin-top:-16px;margin-left:53px;width: 168px;height: 32px;line-height: 32px;text-align: center; font-size: 14px;color: #ffffff; background-color: #66c84f;border-radius: 6px;'>长按识别下面二维码</div><div style='height: 23px;display: block;text-align: center;margin: 10px auto;letter-spacing: 6px;'>\uD83D\uDC47\uD83D\uDC47\uD83D\uDC47</div><div style='width: 172px;height:172px;display: block;margin: 0 auto;'><img class='qrcode'src='${qrcodeUrl}'alt=''></div></div></div></div>"
;
@Autowired
private
BizMaterialMapper
bizMaterialMapper
;
@Autowired
private
GroupMaterialAccountBiz
groupMaterialAccountBiz
;
@Autowired
private
MaterialService
materialService
;
@Override
public
void
createMaterial4ThirdResource
(
String
name
,
String
link
,
Integer
resourceId
)
{
String
qrcodeUrl
=
QrcodeUtils
.
create
(
link
);
GroupMaterialAccount
account
=
groupMaterialAccountBiz
.
getActiveAccount
(
UseTypeEnum
.
THIRD_GROUP
.
value
);
if
(
null
==
account
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"公众号素材不足,请联系管理员"
);
}
GroupNewsMaterialAddDTO
groupNewsMaterialAddDTO
=
new
GroupNewsMaterialAddDTO
();
groupNewsMaterialAddDTO
.
setGroupName
(
name
);
groupNewsMaterialAddDTO
.
setQrcodeUrl
(
qrcodeUrl
);
// 存在则更新
BizMaterial
material
=
bizMaterialMapper
.
getByBizId
(
resourceId
,
UseTypeEnum
.
THIRD_GROUP
.
value
);
if
(
Objects
.
nonNull
(
material
)){
groupNewsMaterialAddDTO
.
setMediaId
(
material
.
getMediaId
());
}
groupNewsMaterialAddDTO
.
setAccountId
(
account
.
getAccountId
());
groupNewsMaterialAddDTO
.
setCoverMediaId
(
account
.
getCoverMediaId
());
groupNewsMaterialAddDTO
.
setHtml
(
THIRD_RESOURCE_MATERIAL_HTML_TEMPLATE
);
groupNewsMaterialAddDTO
.
setGroupHeadImg
(
account
.
getHeadMediaId
());
String
mediaId
=
ResponseHandleUtil
.
parseResponse
(
materialService
.
getGroupNewsMaterial
(
groupNewsMaterialAddDTO
),
String
.
class
);
if
(
StrUtil
.
isBlank
(
mediaId
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"公众号素材不足,请联系管理员"
);
}
String
materialUrl
=
ResponseHandleUtil
.
parseResponse
(
materialService
.
getGroupNewsMaterialByMediaId
(
mediaId
),
String
.
class
);
if
(
StrUtil
.
isBlank
(
materialUrl
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"公众号素材不足,请联系管理员"
);
}
BizMaterial
bizMaterial
=
new
BizMaterial
();
bizMaterial
.
setAccountId
(
Math
.
toIntExact
(
account
.
getId
()));
bizMaterial
.
setBizId
(
resourceId
);
bizMaterial
.
setBizType
(
UseTypeEnum
.
THIRD_GROUP
.
value
);
bizMaterial
.
setCreateTime
(
new
Date
());
bizMaterial
.
setMaterialUrl
(
materialUrl
);
bizMaterial
.
setMediaId
(
mediaId
);
bizMaterialMapper
.
insertOrUpdate
(
bizMaterial
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/enums/UseTypeEnum.java
View file @
37a6ad83
...
@@ -3,7 +3,7 @@ package com.pcloud.book.group.enums;
...
@@ -3,7 +3,7 @@ package com.pcloud.book.group.enums;
public
enum
UseTypeEnum
{
public
enum
UseTypeEnum
{
//普通社群
//普通社群
NORMAL_GROUP
(
0
),
NORMAL_GROUP
(
0
),
//第三方群
//第三方群
;第三方资源
THIRD_GROUP
(
1
);
THIRD_GROUP
(
1
);
public
final
Integer
value
;
public
final
Integer
value
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/mapper/BizMaterialMapper.java
View file @
37a6ad83
...
@@ -78,4 +78,6 @@ public interface BizMaterialMapper {
...
@@ -78,4 +78,6 @@ public interface BizMaterialMapper {
void
insertOrUpdate
(
BizMaterial
bizMaterial
);
void
insertOrUpdate
(
BizMaterial
bizMaterial
);
String
selectMaterialUrl4Biz
(
@Param
(
"bizId"
)
Long
bizId
,
@Param
(
"bizType"
)
Integer
bizType
);
String
selectMaterialUrl4Biz
(
@Param
(
"bizId"
)
Long
bizId
,
@Param
(
"bizType"
)
Integer
bizType
);
BizMaterial
getByBizId
(
@Param
(
"bizId"
)
Integer
bizId
,
@Param
(
"bizType"
)
Integer
bizType
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/applet/AppletThirdResources.xml
View file @
37a6ad83
...
@@ -15,10 +15,12 @@
...
@@ -15,10 +15,12 @@
<result
column=
"updator"
property=
"updator"
jdbcType=
"BIGINT"
/>
<result
column=
"updator"
property=
"updator"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"route_code"
property=
"routeCode"
jdbcType=
"TINYINT"
/>
<result
column=
"guide"
property=
"guide"
jdbcType=
"VARCHAR"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id,resource_number,resource_type,resource_name,app_Id,resource_source,resource_img_url,resource_url,remark,create_time,update_time,creator,updator
id,resource_number,resource_type,resource_name,app_Id,resource_source,resource_img_url,resource_url,remark,create_time,update_time,creator,updator
,route_code,guide
</sql>
</sql>
...
@@ -47,21 +49,37 @@
...
@@ -47,21 +49,37 @@
</select>
</select>
<select
id=
"getThirdResources"
parameterType=
"map"
result
Map=
"BaseResultMap
"
>
<select
id=
"getThirdResources"
parameterType=
"map"
result
Type=
"com.pcloud.book.applet.entity.AppletThirdResources
"
>
select
select
<include
refid=
"Base_Column_List"
/>
a.id AS id,
from applet_third_resources
a.resource_number AS number,
a.resource_type AS type,
a.resource_name AS name,
a.app_Id AS appletsId,
a.resource_source AS source,
a.resource_img_url AS resourceImgUrl,
a.resource_url AS url,
a.remark AS remark,
a.create_time AS creator,
a.update_time AS updator,
a.creator AS createTime,
a.updator AS updateTime,
a.route_code AS routeCode,
a.guide AS guide,
b.material_url AS materialUrl
from applet_third_resources a
left join biz_material b on a.id = b.biz_id and b.biz_type = 1
where 1=1
where 1=1
<if
test=
"type!=null"
>
<if
test=
"type!=null"
>
and resource_type=#{type}
and
a.
resource_type=#{type}
</if>
</if>
<if
test=
"source!=null"
>
<if
test=
"source!=null"
>
and resource_source=#{source}
and
a.
resource_source=#{source}
</if>
</if>
<if
test=
"keyValue!=null"
>
<if
test=
"keyValue!=null"
>
and (
resource_number LIKE concat('%',#{keyValue},'%') OR
resource_name LIKE concat('%',#{keyValue},'%'))
and (
a.resource_number LIKE concat('%',#{keyValue},'%') OR a.
resource_name LIKE concat('%',#{keyValue},'%'))
</if>
</if>
order by update_time desc
order by
a.
update_time desc
</select>
</select>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
...
@@ -79,10 +97,14 @@
...
@@ -79,10 +97,14 @@
third.resource_number number,
third.resource_number number,
third.resource_type type,
third.resource_type type,
third.resource_img_url resourceImgUrl,
third.resource_img_url resourceImgUrl,
third.resource_url url
third.resource_url url,
bm.material_url materialUrl,
third.route_code routeCode,
third.guide
FROM
FROM
applet_third_resources_relation relation
applet_third_resources_relation relation
LEFT JOIN applet_third_resources third ON relation.third_resources_id = third.id
LEFT JOIN applet_third_resources third ON relation.third_resources_id = third.id
LEFT JOIN biz_material bm ON third.id = bm.biz_id AND bm.biz_type = 1
where relation.from_id = #{newsId}
where relation.from_id = #{newsId}
</select>
</select>
...
@@ -135,12 +157,12 @@
...
@@ -135,12 +157,12 @@
insert into applet_third_resources ( resource_number,resource_type,resource_name,
insert into applet_third_resources ( resource_number,resource_type,resource_name,
app_Id,resource_source,resource_img_url,
app_Id,resource_source,resource_img_url,
resource_url,remark,create_time,
resource_url,remark,create_time,
update_time,creator,updator
update_time,creator,updator
,route_code,guide
)
)
values (#{number,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{name,jdbcType=VARCHAR},
values (#{number,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{name,jdbcType=VARCHAR},
#{appletsId,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{resourceImgUrl,jdbcType=VARCHAR},
#{appletsId,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{resourceImgUrl,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, now(),
#{url,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, now(),
now(), #{creator,jdbcType=BIGINT}, #{updator,jdbcType=BIGINT}
now(), #{creator,jdbcType=BIGINT}, #{updator,jdbcType=BIGINT}
,#{routeCode,jdbcType=TINYINT}, #{guide,jdbcType=VARCHAR}
)
)
</insert>
</insert>
...
@@ -172,6 +194,12 @@
...
@@ -172,6 +194,12 @@
<if
test=
"remark != null"
>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"routeCode != null"
>
route_code = #{routeCode,jdbcType=TINYINT},
</if>
<if
test=
"guide != null"
>
guide = #{guide,jdbcType=VARCHAR},
</if>
update_time = NOW(),
update_time = NOW(),
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
...
...
pcloud-service-book/src/main/resources/mapper/group/BizMaterialMapper.xml
View file @
37a6ad83
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
SELECT
SELECT
b.id AS id,
b.id AS id,
a.group_name AS groupName,
a.group_name AS groupName,
a.weixin_
group
_id AS wxGroupId,
a.weixin_
qrcode
_id AS wxGroupId,
a.id AS bookGroupQrcodeId,
a.id AS bookGroupQrcodeId,
a.qrcode_url AS qrcodeUrl,
a.qrcode_url AS qrcodeUrl,
b.account_id AS accountId,
b.account_id AS accountId,
...
@@ -174,5 +174,16 @@
...
@@ -174,5 +174,16 @@
<select
id=
"selectMaterialUrl4Biz"
resultType=
"java.lang.String"
>
<select
id=
"selectMaterialUrl4Biz"
resultType=
"java.lang.String"
>
select material_url from biz_material where biz_id = #{bizId} AND biz_type=#{bizType} limit 1
select material_url from biz_material where biz_id = #{bizId} AND biz_type=#{bizType} limit 1
</select>
</select>
<select
id=
"getByBizId"
resultMap=
"BizMaterialMap"
>
select id,
media_id,
material_url,
account_id,
biz_type,
biz_id,
create_time,
update_time
from biz_material where biz_id = #{bizId} AND biz_type=#{bizType} limit 1
</select>
</mapper>
</mapper>
\ 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