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
94070cbd
Commit
94070cbd
authored
Oct 16, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1003729] 跟谁学第三方接口数据获取
parent
d80c70e8
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1349 additions
and
14 deletions
+1349
-14
AppletService.java
...in/java/com/pcloud/book/applet/service/AppletService.java
+4
-0
BookConstant.java
...main/java/com/pcloud/book/book/constant/BookConstant.java
+9
-0
AppletThirdResourcesChooseBiz.java
...pcloud/book/applet/biz/AppletThirdResourcesChooseBiz.java
+73
-0
AppletThirdResourcesStaticBiz.java
...pcloud/book/applet/biz/AppletThirdResourcesStaticBiz.java
+56
-0
AppletThirdResourcesChooseBizImpl.java
...ok/applet/biz/impl/AppletThirdResourcesChooseBizImpl.java
+145
-0
AppletThirdResourcesStaticBizImpl.java
...ok/applet/biz/impl/AppletThirdResourcesStaticBizImpl.java
+164
-0
AppletThirdResourcesChooseDao.java
...pcloud/book/applet/dao/AppletThirdResourcesChooseDao.java
+15
-0
AppletThirdResourcesStaticDao.java
...pcloud/book/applet/dao/AppletThirdResourcesStaticDao.java
+15
-0
AppletThirdResourcesChooseDaoImpl.java
...ok/applet/dao/impl/AppletThirdResourcesChooseDaoImpl.java
+18
-0
AppletThirdResourcesStaticDaoImpl.java
...ok/applet/dao/impl/AppletThirdResourcesStaticDaoImpl.java
+18
-0
AppletThirdResourceDataDTO.java
...om/pcloud/book/applet/dto/AppletThirdResourceDataDTO.java
+12
-0
AppletThirdResourceQueryDTO.java
...m/pcloud/book/applet/dto/AppletThirdResourceQueryDTO.java
+13
-0
AppletThirdResourceResponseDTO.java
...cloud/book/applet/dto/AppletThirdResourceResponseDTO.java
+10
-0
AppletThirdResourcesStaticDTO.java
...pcloud/book/applet/dto/AppletThirdResourcesStaticDTO.java
+72
-0
PageDto.java
...ook/src/main/java/com/pcloud/book/applet/dto/PageDto.java
+11
-0
AppletThirdResourcesChoose.java
...pcloud/book/applet/entity/AppletThirdResourcesChoose.java
+47
-0
AppletThirdResourcesStatic.java
...pcloud/book/applet/entity/AppletThirdResourcesStatic.java
+72
-0
AppletThirdResourceTypeEnum.java
...pcloud/book/applet/enums/AppletThirdResourceTypeEnum.java
+33
-0
AppletThirdResourcesChooseFacade.java
.../book/applet/facade/AppletThirdResourcesChooseFacade.java
+117
-0
AppletThirdResourcesStaticFacade.java
.../book/applet/facade/AppletThirdResourcesStaticFacade.java
+79
-0
AppletServiceImpl.java
...om/pcloud/book/applet/service/impl/AppletServiceImpl.java
+9
-0
AppletThirdResourcesChoose.Mapper.xml
...urces/mapper/applet/AppletThirdResourcesChoose.Mapper.xml
+184
-0
AppletThirdResourcesStatic.Mapper.xml
...urces/mapper/applet/AppletThirdResourcesStatic.Mapper.xml
+173
-0
rebel.xml
pcloud-service-book/src/main/resources/rebel.xml
+0
-14
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/applet/service/AppletService.java
View file @
94070cbd
...
...
@@ -44,4 +44,8 @@ public interface AppletService {
@ApiOperation
(
"定时推送答案订阅提醒"
)
@GetMapping
(
"sendAppletMsg4Answer"
)
void
sendAppletMsg4Answer
();
@ApiOperation
(
"获取第三方跟谁学统计数据"
)
@GetMapping
(
"getAppletThirdResourceStatic"
)
void
getAppletThirdResourceStatic
(
@RequestParam
(
value
=
"isAll"
,
required
=
false
)
@ApiParam
Integer
isAll
);
}
pcloud-facade-book/src/main/java/com/pcloud/book/book/constant/BookConstant.java
View file @
94070cbd
...
...
@@ -390,4 +390,13 @@ public class BookConstant {
* 书刊标签缓存
*/
public
static
final
String
BOOK_LABEL_CACHE
=
CacheConstant
.
BOOK
+
"BOOK_LABEL"
;
//听课 初中高中
public
static
final
String
chatRoomUrl
=
"http://m-qun.umeng100.com/uqun/growth/luopan/client/business/operationData/chatRoom/list.ajax"
;
//裂变 小学
public
static
final
String
fissionChatRoomUrl
=
"http://m-qun.umeng100.com/uqun/growth/luopan/client/business/operationData/fissionChatroom/list.ajax"
;
//真人
public
static
final
String
humanUrl
=
"http://m-qun.umeng100.com/uqun/growth/luopan/client/business/operationData/human/list.ajax"
;
//公众号
public
static
final
String
wxOfficialAccountUrl
=
"http://m-qun.umeng100.com/uqun/growth/luopan/client/business/operationData/wxOfficialAccountUrl/list.ajax"
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletThirdResourcesChooseBiz.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
biz
;
import
com.pcloud.book.applet.dto.AppletThirdResourcesStaticDTO
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesChoose
;
import
com.pcloud.common.page.PageBeanNew
;
/**
* (AppletThirdResourcesChoose)表服务接口
*
* @author makejava
* @since 2020-10-14 16:22:28
*/
public
interface
AppletThirdResourcesChooseBiz
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
AppletThirdResourcesChoose
getById
(
Long
id
);
/**
* 分页查询
*/
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
);
/**
* 新增数据
*
* @param appletThirdResourcesChoose 实例对象
* @return 主键
*/
Long
insert
(
AppletThirdResourcesChoose
appletThirdResourcesChoose
);
/**
* 修改数据
*
* @param appletThirdResourcesChoose 实例对象
*/
void
update
(
AppletThirdResourcesChoose
appletThirdResourcesChoose
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
void
deleteById
(
Long
id
);
/**
* 查询统计数据
* @param currentPage
* @param numPerPage
* @param source
* @param keyValue
* @param queryDate
* @return
*/
PageBeanNew
<
AppletThirdResourcesStaticDTO
>
getListThirdResourcesStatic
(
Integer
currentPage
,
Integer
numPerPage
,
String
source
,
String
keyValue
,
String
queryDate
);
/**
* 导出统计数据
* @param currentPage
* @param numPerPage
* @param source
* @param keyValue
* @param queryDate
* @param partyId
*/
void
exportListThirdResourcesStatic
(
Integer
currentPage
,
Integer
numPerPage
,
String
source
,
String
keyValue
,
String
queryDate
,
Long
partyId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletThirdResourcesStaticBiz.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
biz
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesStatic
;
import
com.pcloud.common.page.PageBeanNew
;
/**
* (AppletThirdResourcesStatic)表服务接口
*
* @author makejava
* @since 2020-10-14 16:19:03
*/
public
interface
AppletThirdResourcesStaticBiz
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
AppletThirdResourcesStatic
getById
(
Long
id
);
/**
* 分页查询
*/
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
);
/**
* 新增数据
*
* @param appletThirdResourcesStatic 实例对象
* @return 主键
*/
Long
insert
(
AppletThirdResourcesStatic
appletThirdResourcesStatic
);
/**
* 修改数据
*
* @param appletThirdResourcesStatic 实例对象
*/
void
update
(
AppletThirdResourcesStatic
appletThirdResourcesStatic
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
void
deleteById
(
Long
id
);
/**
* 获取跟谁学统计数据
* @param isAll
*/
void
getAppletThirdResourceStatic
(
Integer
isAll
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletThirdResourcesChooseBizImpl.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesChooseBiz
;
import
com.pcloud.book.applet.dao.AppletThirdResourcesChooseDao
;
import
com.pcloud.book.applet.dto.AppletThirdResourcesStaticDTO
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesChoose
;
import
com.pcloud.book.applet.enums.AppletThirdResourceTypeEnum
;
import
com.pcloud.book.consumer.common.ExportConsr
;
import
com.pcloud.book.consumer.message.MessageConsr
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* (AppletThirdResourcesChoose)表服务实现类
*
* @author makejava
* @since 2020-10-14 16:22:28
*/
@Service
(
"appletThirdResourcesChooseBiz"
)
public
class
AppletThirdResourcesChooseBizImpl
implements
AppletThirdResourcesChooseBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletThirdResourcesChooseBizImpl
.
class
);
@Autowired
private
AppletThirdResourcesChooseDao
appletThirdResourcesChooseDao
;
@Autowired
private
ExportConsr
exportConsr
;
@Autowired
private
MessageConsr
messageConsr
;
@Override
@ParamLog
(
"通过ID查询单条数据"
)
public
AppletThirdResourcesChoose
getById
(
Long
id
)
{
return
appletThirdResourcesChooseDao
.
getById
(
id
);
}
@Override
@ParamLog
(
"查询多条数据"
)
public
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
)
{
PageBeanNew
pageBeanNew
=
appletThirdResourcesChooseDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
null
,
"getList"
);
List
recordList
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
))
{
return
pageBeanNew
;
}
// 加载其它数据
return
pageBeanNew
;
}
@Override
@ParamLog
(
"新增"
)
public
Long
insert
(
AppletThirdResourcesChoose
appletThirdResourcesChoose
)
{
appletThirdResourcesChooseDao
.
insert
(
appletThirdResourcesChoose
);
return
appletThirdResourcesChoose
.
getId
();
}
@Override
@ParamLog
(
"修改"
)
public
void
update
(
AppletThirdResourcesChoose
appletThirdResourcesChoose
)
{
if
(
appletThirdResourcesChoose
==
null
||
!
NumberUtil
.
isNumber
(
appletThirdResourcesChoose
.
getId
()))
{
throw
BizException
.
PARAM_IS_NULL
;
}
appletThirdResourcesChooseDao
.
update
(
appletThirdResourcesChoose
);
}
@Override
@ParamLog
(
"删除"
)
public
void
deleteById
(
Long
id
)
{
appletThirdResourcesChooseDao
.
deleteById
(
id
);
}
@Override
@ParamLog
(
value
=
"查询跟谁学统计数据"
,
isAfterReturn
=
false
)
public
PageBeanNew
<
AppletThirdResourcesStaticDTO
>
getListThirdResourcesStatic
(
Integer
currentPage
,
Integer
numPerPage
,
String
source
,
String
keyValue
,
String
queryDate
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"source"
,
source
);
paramMap
.
put
(
"keyValue"
,
keyValue
);
paramMap
.
put
(
"queryDate"
,
queryDate
);
PageBeanNew
<
AppletThirdResourcesStaticDTO
>
pageBeanNew
=
appletThirdResourcesChooseDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"getListThirdResourcesStatic"
);
return
pageBeanNew
;
}
@Override
public
void
exportListThirdResourcesStatic
(
Integer
currentPage
,
Integer
numPerPage
,
String
source
,
String
keyValue
,
String
queryDate
,
Long
partyId
)
{
ThreadPoolUtils
.
EXPORT_THREAD_POOL
.
execute
(()
->
{
PageBeanNew
<
AppletThirdResourcesStaticDTO
>
resourcesStatic
=
this
.
getListThirdResourcesStatic
(
currentPage
,
numPerPage
,
source
,
keyValue
,
queryDate
);
List
<
AppletThirdResourcesStaticDTO
>
recordList
=
resourcesStatic
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
))
{
return
;
}
// 字段名
String
[]
rowsName
=
{
"资源编号"
,
"资源名称"
,
"资源链接"
,
"来源"
,
"渠道名称"
,
"类别"
,
"获取二维码人数"
,
"长按扫码人数"
,
"进群次数"
,
"留存数"
};
List
<
Object
[]>
dataList
=
new
ArrayList
<>();
Object
[]
objs
;
for
(
int
i
=
0
;
i
<
recordList
.
size
();
i
++)
{
AppletThirdResourcesStaticDTO
resourcesStaticDTO
=
recordList
.
get
(
i
);
objs
=
new
Object
[
rowsName
.
length
];
objs
[
0
]
=
resourcesStaticDTO
.
getResourceNumber
();
objs
[
1
]
=
resourcesStaticDTO
.
getResourceName
();
objs
[
2
]
=
resourcesStaticDTO
.
getResourceUrl
();
objs
[
3
]
=
resourcesStaticDTO
.
getResourceSource
();
objs
[
4
]
=
resourcesStaticDTO
.
getChannelName
();
objs
[
5
]
=
AppletThirdResourceTypeEnum
.
FISSIONCHATROOM
.
code
.
equals
(
resourcesStaticDTO
.
getResourceType
())
?
AppletThirdResourceTypeEnum
.
FISSIONCHATROOM
.
tyepName
:
AppletThirdResourceTypeEnum
.
CHATROOM
.
tyepName
;
objs
[
6
]
=
null
==
resourcesStaticDTO
.
getGetQrCodeUv
()
?
0
:
resourcesStaticDTO
.
getGetQrCodeUv
();
objs
[
7
]
=
null
==
resourcesStaticDTO
.
getPressQrCodeUv
()
?
0
:
resourcesStaticDTO
.
getPressQrCodeUv
();
objs
[
8
]
=
null
==
resourcesStaticDTO
.
getJoinChatroomCount
()
?
0
:
resourcesStaticDTO
.
getJoinChatroomCount
();
objs
[
9
]
=
null
==
resourcesStaticDTO
.
getStayUserCount
()
?
0
:
resourcesStaticDTO
.
getStayUserCount
();
dataList
.
add
(
objs
);
}
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
fileName
=
"研发-跟谁学第三方接口数据获取-"
+
simpleDateFormat
.
format
(
new
Date
());
String
fileUrl
=
exportConsr
.
exportExcel
(
fileName
,
rowsName
,
dataList
);
if
(!
StringUtil
.
isEmpty
(
fileUrl
))
{
JSONObject
content
=
new
JSONObject
();
content
.
put
(
"commitTime"
,
DateUtils
.
formatDate
(
new
Date
()));
content
.
put
(
"type"
,
"跟谁学第三方接口数据获取导出"
);
messageConsr
.
sendLetter
(
partyId
,
partyId
,
content
.
toJSONString
(),
SystemCode
.
pcloud
.
code
,
"book_download"
,
fileUrl
,
fileName
);
}
});
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletThirdResourcesStaticBizImpl.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesStaticBiz
;
import
com.pcloud.book.applet.dao.AppletThirdResourcesStaticDao
;
import
com.pcloud.book.applet.dto.AppletThirdResourceQueryDTO
;
import
com.pcloud.book.applet.dto.AppletThirdResourceResponseDTO
;
import
com.pcloud.book.applet.dto.AppletThirdResourcesStaticDTO
;
import
com.pcloud.book.applet.dto.PageDto
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesStatic
;
import
com.pcloud.book.applet.enums.AppletThirdResourceTypeEnum
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.constant.BookConstant
;
import
com.pcloud.book.group.tools.Kit
;
import
com.pcloud.book.util.common.YesOrNoEnums
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.BeanUtils
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* (AppletThirdResourcesStatic)表服务实现类
*
* @author makejava
* @since 2020-10-14 16:19:03
*/
@Service
(
"appletThirdResourcesStaticBiz"
)
public
class
AppletThirdResourcesStaticBizImpl
implements
AppletThirdResourcesStaticBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletThirdResourcesStaticBizImpl
.
class
);
@Autowired
private
AppletThirdResourcesStaticDao
appletThirdResourcesStaticDao
;
@Override
@ParamLog
(
"通过ID查询单条数据"
)
public
AppletThirdResourcesStatic
getById
(
Long
id
)
{
return
appletThirdResourcesStaticDao
.
getById
(
id
);
}
@Override
@ParamLog
(
"查询多条数据"
)
public
PageBeanNew
getList
(
Integer
currentPage
,
Integer
numPerPage
)
{
PageBeanNew
pageBeanNew
=
appletThirdResourcesStaticDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
null
,
"getList"
);
List
recordList
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
))
{
return
pageBeanNew
;
}
// 加载其它数据
return
pageBeanNew
;
}
@Override
@ParamLog
(
"新增"
)
public
Long
insert
(
AppletThirdResourcesStatic
appletThirdResourcesStatic
)
{
appletThirdResourcesStaticDao
.
insert
(
appletThirdResourcesStatic
);
return
appletThirdResourcesStatic
.
getId
();
}
@Override
@ParamLog
(
"修改"
)
public
void
update
(
AppletThirdResourcesStatic
appletThirdResourcesStatic
)
{
if
(
appletThirdResourcesStatic
==
null
||
!
NumberUtil
.
isNumber
(
appletThirdResourcesStatic
.
getId
()))
{
throw
BizException
.
PARAM_IS_NULL
;
}
appletThirdResourcesStaticDao
.
update
(
appletThirdResourcesStatic
);
}
@Override
@ParamLog
(
"删除"
)
public
void
deleteById
(
Long
id
)
{
appletThirdResourcesStaticDao
.
deleteById
(
id
);
}
@Override
@ParamLog
(
"获取跟谁学统计数据"
)
public
void
getAppletThirdResourceStatic
(
Integer
isAll
)
{
PageBeanNew
pageBeanNew
=
null
;
//PageBeanNew pageBeanNew = appletThirdResourcesStaticDao.listPageNew(new PageParam(0, 10), null, "getList");
if
(
null
!=
pageBeanNew
&&
!
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
())
&&
YesOrNoEnums
.
YES
.
getValue
().
equals
(
isAll
))
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"当统计数据表不为空时不能导入全部数据只能导入昨日数据"
);
}
AppletThirdResourceQueryDTO
queryDTO
=
new
AppletThirdResourceQueryDTO
();
PageDto
pageDto
=
new
PageDto
();
pageDto
.
setPageNum
(
1
);
pageDto
.
setPageSize
(
100
);
queryDTO
.
setStage
(
"PRIMARY"
);
String
url
=
BookConstant
.
fissionChatRoomUrl
;
Integer
resourceType
=
null
;
resourceType
=
AppletThirdResourceTypeEnum
.
FISSIONCHATROOM
.
code
;
if
(
YesOrNoEnums
.
YES
.
getValue
().
equals
(
isAll
))
{
try
{
Date
endDate
=
DateUtils
.
subDays
(
1000
);
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
pageDto
.
setPageNum
(
2
);
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
url
=
BookConstant
.
chatRoomUrl
;
resourceType
=
AppletThirdResourceTypeEnum
.
CHATROOM
.
code
;
pageDto
.
setPageNum
(
1
);
queryDTO
.
setStage
(
"MIDDLE"
);
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
queryDTO
.
setStage
(
"HIGH"
);
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取跟谁学统计数据失败"
,
e
);
}
}
else
{
Date
endDate
=
DateUtils
.
subDays
(
1
);
try
{
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
url
=
BookConstant
.
chatRoomUrl
;
resourceType
=
AppletThirdResourceTypeEnum
.
CHATROOM
.
code
;
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
queryDTO
.
setStage
(
"MIDDLE"
);
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
queryDTO
.
setStage
(
"HIGH"
);
insertResourceStatic
(
queryDTO
,
pageDto
,
url
,
endDate
,
resourceType
);
}
catch
(
ParseException
e
)
{
LOGGER
.
error
(
"获取跟谁学统计数据失败"
,
e
);
}
}
}
private
void
insertResourceStatic
(
AppletThirdResourceQueryDTO
queryDTO
,
PageDto
pageDto
,
String
url
,
Date
endDate4Query
,
Integer
resourceType
)
throws
ParseException
{
String
s
=
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd 00:00:00"
);
String
s1
=
DateFormatUtils
.
format
(
endDate4Query
,
"yyyy-MM-dd 00:00:00"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
//定义时间格式
Date
endDate
=
sdf
.
parse
(
s
);
//将String字符串类型转换为date时间类型
Date
startDate
=
sdf
.
parse
(
s1
);
//将String字符串类型转换为date时间类型
queryDTO
.
setStartTime
(
startDate
.
getTime
());
queryDTO
.
setEndTime
(
endDate
.
getTime
());
queryDTO
.
setPageDto
(
pageDto
);
String
resultStr
=
Kit
.
post
(
url
,
JSON
.
toJSONString
(
queryDTO
));
AppletThirdResourceResponseDTO
appletThirdResourceResponseDTO
=
JSON
.
parseObject
(
resultStr
,
AppletThirdResourceResponseDTO
.
class
);
if
(
null
!=
appletThirdResourceResponseDTO
&&
null
!=
appletThirdResourceResponseDTO
.
getData
())
{
List
<
AppletThirdResourcesStaticDTO
>
list
=
appletThirdResourceResponseDTO
.
getData
().
getList
();
List
<
AppletThirdResourcesStatic
>
appletThirdResourcesStatics
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
list
))
{
BeanUtils
.
copyListProperties
(
list
,
appletThirdResourcesStatics
,
AppletThirdResourcesStatic
.
class
);
appletThirdResourcesStatics
.
stream
().
forEach
(
e
->
e
.
setResourceType
(
resourceType
));
appletThirdResourcesStaticDao
.
insert
(
appletThirdResourcesStatics
);
}
}
LOGGER
.
info
(
"=========resultStr========End"
+
resultStr
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletThirdResourcesChooseDao.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dao
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesChoose
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* (AppletThirdResourcesChoose)表数据库访问层
*
* @author makejava
* @since 2020-10-14 16:22:27
*/
public
interface
AppletThirdResourcesChooseDao
extends
BaseDao
<
AppletThirdResourcesChoose
>
{
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletThirdResourcesStaticDao.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dao
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesStatic
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* (AppletThirdResourcesStatic)表数据库访问层
*
* @author makejava
* @since 2020-10-14 16:19:03
*/
public
interface
AppletThirdResourcesStaticDao
extends
BaseDao
<
AppletThirdResourcesStatic
>
{
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletThirdResourcesChooseDaoImpl.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dao
.
impl
;
import
com.pcloud.book.applet.dao.AppletThirdResourcesChooseDao
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesChoose
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
/**
* (AppletThirdResourcesChoose)表数据库访问层
*
* @author makejava
* @since 2020-10-14 16:22:28
*/
@Repository
(
"appletThirdResourcesChooseDaoImpl"
)
public
class
AppletThirdResourcesChooseDaoImpl
extends
BaseDaoImpl
<
AppletThirdResourcesChoose
>
implements
AppletThirdResourcesChooseDao
{
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletThirdResourcesStaticDaoImpl.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dao
.
impl
;
import
com.pcloud.book.applet.dao.AppletThirdResourcesStaticDao
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesStatic
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
/**
* (AppletThirdResourcesStatic)表数据库访问层
*
* @author makejava
* @since 2020-10-14 16:19:03
*/
@Repository
(
"appletThirdResourcesStaticDaoImpl"
)
public
class
AppletThirdResourcesStaticDaoImpl
extends
BaseDaoImpl
<
AppletThirdResourcesStatic
>
implements
AppletThirdResourcesStaticDao
{
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourceDataDTO.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
lombok.Data
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
@Data
public
class
AppletThirdResourceDataDTO
{
private
PageDto
pageDto
;
private
List
<
AppletThirdResourcesStaticDTO
>
list
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourceQueryDTO.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
lombok.Data
;
@Data
public
class
AppletThirdResourceQueryDTO
{
private
String
stage
;
private
String
keyword
;
private
Long
startTime
;
private
Long
endTime
;
private
PageDto
pageDto
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourceResponseDTO.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
lombok.Data
;
@Data
public
class
AppletThirdResourceResponseDTO
{
private
Integer
code
;
private
String
msg
;
private
AppletThirdResourceDataDTO
data
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletThirdResourcesStaticDTO.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
AppletThirdResourcesStaticDTO
{
@ApiModelProperty
(
"id"
)
private
Long
id
;
@ApiModelProperty
(
"资源链接"
)
private
String
resourceNumber
;
@ApiModelProperty
(
"资源链接"
)
private
String
resourceUrl
;
@ApiModelProperty
(
"资源名称"
)
private
String
resourceName
;
@ApiModelProperty
(
"资源来源"
)
private
String
resourceSource
;
@ApiModelProperty
(
"渠道名称"
)
private
String
channelName
;
@ApiModelProperty
(
"日期"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
date
;
@ApiModelProperty
(
"学部(中文)"
)
private
String
stageStr
;
@ApiModelProperty
(
"学部(英文)"
)
private
String
stage
;
@ApiModelProperty
(
"备注"
)
private
String
channelRemark
;
@ApiModelProperty
(
"推送人数"
)
private
Integer
pushUv
;
@ApiModelProperty
(
"获取二维码人数"
)
private
Integer
getQrCodeUv
;
@ApiModelProperty
(
"长按扫码数"
)
private
Integer
pressQrCodeUv
;
@ApiModelProperty
(
"入群数"
)
private
Integer
joinChatroomCount
;
@ApiModelProperty
(
"入群率"
)
private
String
joinChatroomRate
;
@ApiModelProperty
(
"存留数"
)
private
Integer
stayUserCount
;
private
String
shareRate
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
@ApiModelProperty
(
"群类型"
)
private
Integer
resourceType
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/PageDto.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
lombok.Data
;
@Data
public
class
PageDto
{
private
Integer
pageNum
;
private
Integer
pageSize
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletThirdResourcesChoose.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* (AppletThirdResourcesChoose)实体类
*
* @author makejava
* @since 2020-10-14 16:22:26
*/
@Data
public
class
AppletThirdResourcesChoose
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
78995913394877881L
;
private
Long
id
;
@ApiModelProperty
(
"资源编号"
)
private
String
resourceNumber
;
@ApiModelProperty
(
"资源链接"
)
private
String
resourceUrl
;
@ApiModelProperty
(
"资源名称"
)
private
String
resourceName
;
@ApiModelProperty
(
"资源来源"
)
private
String
resourceSource
;
@ApiModelProperty
(
"渠道名称"
)
private
String
channelName
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
upateTime
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletThirdResourcesStatic.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* (AppletThirdResourcesStatic)实体类
*
* @author makejava
* @since 2020-10-14 16:19:02
*/
@Data
public
class
AppletThirdResourcesStatic
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
17545518067833673L
;
@ApiModelProperty
(
"id"
)
private
Long
id
;
@ApiModelProperty
(
"日期"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
date
;
@ApiModelProperty
(
"学部(中文)"
)
private
String
stageStr
;
@ApiModelProperty
(
"学部(英文)"
)
private
String
stage
;
@ApiModelProperty
(
"渠道名称"
)
private
String
channelName
;
@ApiModelProperty
(
"备注"
)
private
String
channelRemark
;
@ApiModelProperty
(
"推送人数"
)
private
Integer
pushUv
;
@ApiModelProperty
(
"获取二维码人数"
)
private
Integer
getQrCodeUv
;
@ApiModelProperty
(
"长按扫码数"
)
private
Integer
pressQrCodeUv
;
@ApiModelProperty
(
"入群数"
)
private
Integer
joinChatroomCount
;
@ApiModelProperty
(
"入群率"
)
private
String
joinChatroomRate
;
@ApiModelProperty
(
"存留数"
)
private
Integer
stayUserCount
;
private
String
shareRate
;
@ApiModelProperty
(
"创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
@ApiModelProperty
(
"群类型"
)
private
Integer
resourceType
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/enums/AppletThirdResourceTypeEnum.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
enums
;
/**
* 答案订阅发送状态
*/
public
enum
AppletThirdResourceTypeEnum
{
/**
* 听课群
*/
CHATROOM
(
1
,
"听课群"
),
/**
*裂变群
*/
FISSIONCHATROOM
(
2
,
"裂变群"
),
/**
* 真人群
*/
HUMAN
(
3
,
"真人群"
),
/**
* 微信群
*/
WEIXIN
(
4
,
"微信群"
);
public
Integer
code
;
public
String
tyepName
;
AppletThirdResourceTypeEnum
(
Integer
code
,
String
typeName
)
{
this
.
code
=
code
;
this
.
tyepName
=
typeName
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/facade/AppletThirdResourcesChooseFacade.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
facade
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesChooseBiz
;
import
com.pcloud.book.applet.dto.AppletThirdResourcesStaticDTO
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesChoose
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.wechatgroup.message.enums.IsSystem
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
sun.reflect.generics.tree.VoidDescriptor
;
import
java.util.Map
;
/**
* (AppletThirdResourcesChoose)表控制层
*
* @author makejava
* @since 2020-10-14 16:22:28
*/
@RestController
(
"appletThirdResourcesChooseFacade"
)
@RequestMapping
(
"appletThirdResourcesChoose"
)
public
class
AppletThirdResourcesChooseFacade
{
@Autowired
private
AppletThirdResourcesChooseBiz
appletThirdResourcesChooseBiz
;
@ApiOperation
(
"通过主键查询单条数据"
)
@GetMapping
(
"getById"
)
public
ResponseDto
<?>
getById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletThirdResourcesChooseBiz
.
getById
(
id
));
}
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"getList"
)
public
ResponseDto
<?>
getList
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"0"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
defaultValue
=
"10"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletThirdResourcesChooseBiz
.
getList
(
currentPage
,
numPerPage
));
}
@ApiOperation
(
"新增"
)
@PostMapping
(
"insert"
)
public
ResponseDto
<?>
insert
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletThirdResourcesChoose
appletThirdResourcesChoose
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletThirdResourcesChooseBiz
.
insert
(
appletThirdResourcesChoose
));
}
@ApiOperation
(
"更新"
)
@PostMapping
(
"update"
)
public
ResponseDto
<?>
update
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletThirdResourcesChoose
appletThirdResourcesChoose
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
appletThirdResourcesChooseBiz
.
update
(
appletThirdResourcesChoose
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"删除"
)
@GetMapping
(
"deleteById"
)
public
ResponseDto
<?>
deleteById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
if
(
null
==
id
)
{
throw
BookBizException
.
PARAM_DELETION
;
}
appletThirdResourcesChooseBiz
.
deleteById
(
id
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"getListThirdResourcesStatic"
)
public
ResponseDto
<
PageBeanNew
<
AppletThirdResourcesStaticDTO
>>
getListThirdResourcesStatic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"0"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
defaultValue
=
"10"
)
Integer
numPerPage
,
@RequestParam
(
value
=
"source"
,
required
=
false
)
String
source
,
@RequestParam
(
value
=
"keyValue"
,
required
=
false
)
String
keyValue
,
@RequestParam
(
value
=
"queryDate"
,
required
=
false
)
String
queryDate
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<
PageBeanNew
<
AppletThirdResourcesStaticDTO
>>(
appletThirdResourcesChooseBiz
.
getListThirdResourcesStatic
(
currentPage
,
numPerPage
,
source
,
keyValue
,
queryDate
));
}
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"exportListThirdResourcesStatic"
)
public
ResponseDto
<?>
exportListThirdResourcesStatic
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
,
defaultValue
=
"0"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
,
defaultValue
=
"10000"
)
Integer
numPerPage
,
@RequestParam
(
value
=
"source"
,
required
=
false
)
String
source
,
@RequestParam
(
value
=
"keyValue"
,
required
=
false
)
String
keyValue
,
@RequestParam
(
value
=
"queryDate"
,
required
=
false
)
String
queryDate
)
throws
BizException
,
PermissionException
{
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
String
isSystem
=
(
String
)
map
.
get
(
SessionUtil
.
IS_SYSTEM
);
Long
partyId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
if
(
IsSystem
.
NOT_SYSTEM
.
code
.
equals
(
isSystem
))
{
partyId
=
(
Long
)
map
.
get
(
SessionUtil
.
MEMBER_ID
);
}
appletThirdResourcesChooseBiz
.
exportListThirdResourcesStatic
(
currentPage
,
numPerPage
,
source
,
keyValue
,
queryDate
,
partyId
);
return
new
ResponseDto
<>();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/facade/AppletThirdResourcesStaticFacade.java
0 → 100644
View file @
94070cbd
package
com
.
pcloud
.
book
.
applet
.
facade
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesStaticBiz
;
import
com.pcloud.book.applet.entity.AppletThirdResourcesStatic
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* (AppletThirdResourcesStatic)表控制层
*
* @author makejava
* @since 2020-10-14 16:19:03
*/
@RestController
(
"appletThirdResourcesStaticFacade"
)
@RequestMapping
(
"appletThirdResourcesStatic"
)
public
class
AppletThirdResourcesStaticFacade
{
@Autowired
private
AppletThirdResourcesStaticBiz
appletThirdResourcesStaticBiz
;
@ApiOperation
(
"通过主键查询单条数据"
)
@GetMapping
(
"getById"
)
public
ResponseDto
<?>
getById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletThirdResourcesStaticBiz
.
getById
(
id
));
}
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"getList"
)
public
ResponseDto
<?>
getList
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"0"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
defaultValue
=
"10"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletThirdResourcesStaticBiz
.
getList
(
currentPage
,
numPerPage
));
}
@ApiOperation
(
"新增"
)
@PostMapping
(
"insert"
)
public
ResponseDto
<?>
insert
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletThirdResourcesStatic
appletThirdResourcesStatic
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
appletThirdResourcesStaticBiz
.
insert
(
appletThirdResourcesStatic
));
}
@ApiOperation
(
"更新"
)
@PostMapping
(
"update"
)
public
ResponseDto
<?>
update
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
AppletThirdResourcesStatic
appletThirdResourcesStatic
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
appletThirdResourcesStaticBiz
.
update
(
appletThirdResourcesStatic
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"删除"
)
@GetMapping
(
"deleteById"
)
public
ResponseDto
<?>
deleteById
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
if
(
null
==
id
)
{
throw
BookBizException
.
PARAM_DELETION
;
}
appletThirdResourcesStaticBiz
.
deleteById
(
id
);
return
new
ResponseDto
<>();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/service/impl/AppletServiceImpl.java
View file @
94070cbd
...
...
@@ -4,6 +4,7 @@ import com.pcloud.book.applet.biz.AnswerSubscribeBiz;
import
com.pcloud.book.applet.biz.AppletBooklistBiz
;
import
com.pcloud.book.applet.biz.AppletBookClassifyBiz
;
import
com.pcloud.book.applet.biz.AppletNewsBiz
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesStaticBiz
;
import
com.pcloud.book.applet.dto.AppletNewsVO
;
import
com.pcloud.book.applet.dto.AppletOuterBookDTO
;
import
com.pcloud.book.applet.dto.PcloudGroupActivityDTO
;
...
...
@@ -45,6 +46,8 @@ public class AppletServiceImpl implements AppletService {
private
AppletBookClassifyBiz
appletBookClassifyBiz
;
@Autowired
private
AnswerSubscribeBiz
answerSubscribeBiz
;
@Autowired
private
AppletThirdResourcesStaticBiz
appletThirdResourcesStaticBiz
;
@Override
...
...
@@ -85,4 +88,10 @@ public class AppletServiceImpl implements AppletService {
public
void
sendAppletMsg4Answer
(){
answerSubscribeBiz
.
sendAppletMsg4Answer
();
}
@Override
@GetMapping
(
"getAppletThirdResourceStatic"
)
public
void
getAppletThirdResourceStatic
(
@RequestParam
(
value
=
"isAll"
,
required
=
false
)
@ApiParam
Integer
isAll
)
{
appletThirdResourcesStaticBiz
.
getAppletThirdResourceStatic
(
isAll
);
}
}
pcloud-service-book/src/main/resources/mapper/applet/AppletThirdResourcesChoose.Mapper.xml
0 → 100644
View file @
94070cbd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.applet.dao.impl.AppletThirdResourcesChooseDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.applet.entity.AppletThirdResourcesChoose"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"resource_url"
property=
"resourceUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"resource_name"
property=
"resourceName"
jdbcType=
"VARCHAR"
/>
<result
column=
"resource_source"
property=
"resourceSource"
jdbcType=
"VARCHAR"
/>
<result
column=
"channel_name"
property=
"channelName"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"upate_time"
property=
"upateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"resource_number"
property=
"resourceNumber"
jdbcType=
"VARCHAR"
/>
</resultMap>
<resultMap
id=
"BaseResultMap4DTO"
type=
"com.pcloud.book.applet.dto.AppletThirdResourcesStaticDTO"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"resource_number"
property=
"resourceNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"resource_url"
property=
"resourceUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"resource_name"
property=
"resourceName"
jdbcType=
"VARCHAR"
/>
<result
column=
"resource_source"
property=
"resourceSource"
jdbcType=
"VARCHAR"
/>
<result
column=
"channel_name"
property=
"channelName"
jdbcType=
"VARCHAR"
/>
<result
column=
"date"
property=
"date"
jdbcType=
"DATE"
/>
<result
column=
"stage_str"
property=
"stageStr"
jdbcType=
"VARCHAR"
/>
<result
column=
"stage"
property=
"stage"
jdbcType=
"VARCHAR"
/>
<result
column=
"channel_remark"
property=
"channelRemark"
jdbcType=
"VARCHAR"
/>
<result
column=
"push_uv"
property=
"pushUv"
jdbcType=
"INTEGER"
/>
<result
column=
"get_qr_code_uv"
property=
"getQrCodeUv"
jdbcType=
"INTEGER"
/>
<result
column=
"press_qr_code_uv"
property=
"pressQrCodeUv"
jdbcType=
"INTEGER"
/>
<result
column=
"join_chatroom_count"
property=
"joinChatroomCount"
jdbcType=
"INTEGER"
/>
<result
column=
"join_chatroom_rate"
property=
"joinChatroomRate"
jdbcType=
"VARCHAR"
/>
<result
column=
"stay_user_count"
property=
"stayUserCount"
jdbcType=
"INTEGER"
/>
<result
column=
"share_rate"
property=
"shareRate"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"resource_type"
property=
"resourceType"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, resource_url, resource_name, resource_source, channel_name, create_time, upate_time, resource_number
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_third_resources_choose
WHERE id = #{id}
</select>
<select
id=
"getList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_third_resources_choose
</select>
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
INSERT INTO applet_third_resources_choose(
resource_url,
resource_name,
resource_source,
channel_name,
create_time,
upate_time
) VALUES (
#{resourceUrl, jdbcType=VARCHAR},
#{resourceName, jdbcType=VARCHAR},
#{resourceSource, jdbcType=VARCHAR},
#{channelName, jdbcType=VARCHAR},
#{createTime, jdbcType=TIMESTAMP},
#{upateTime, jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"batchInsert"
>
INSERT INTO applet_third_resources_choose (
resource_url,
resource_name,
resource_source,
channel_name,
create_time,
upate_time
) VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
#{item.resourceUrl, jdbcType=VARCHAR},
#{item.resourceName, jdbcType=VARCHAR},
#{item.resourceSource, jdbcType=VARCHAR},
#{item.channelName, jdbcType=VARCHAR},
#{item.createTime, jdbcType=TIMESTAMP},
#{item.upateTime, jdbcType=TIMESTAMP}
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
UPDATE applet_third_resources_choose
<set>
<if
test=
"resourceUrl != null and resourceUrl != ''"
>
resource_url = #{resourceUrl},
</if>
<if
test=
"resourceName != null and resourceName != ''"
>
resource_name = #{resourceName},
</if>
<if
test=
"resourceSource != null and resourceSource != ''"
>
resource_source = #{resourceSource},
</if>
<if
test=
"channelName != null and channelName != ''"
>
channel_name = #{channelName},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"upateTime != null"
>
upate_time = #{upateTime},
</if>
</set>
WHERE id = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
DELETE FROM applet_third_resources_choose where id = #{id}
</delete>
<select
id=
"getListThirdResourcesStatic"
resultMap=
"BaseResultMap4DTO"
parameterType=
"map"
>
SELECT
m.id,
m.resource_number,
m.resource_url,
m.resource_name,
m.resource_source,
m.channel_name,
n.stage_str,
n.stage,
n.channel_remark,
m.resource_type,
n.push_uv,
n.get_qr_code_uv,
n.press_qr_code_uv,
n.join_chatroom_count,
n.stay_user_count
FROM
applet_third_resources_choose m
LEFT JOIN (
SELECT
b.stage_str,
b.stage,
b.channel_remark,
b.channel_name,
sum(push_uv) push_uv,
sum(get_qr_code_uv) get_qr_code_uv,
sum(press_qr_code_uv) press_qr_code_uv,
sum(join_chatroom_count) join_chatroom_count,
sum(stay_user_count) stay_user_count
FROM
applet_third_resources_static b
<where>
<if
test=
"queryDate!=null"
>
and b.date = #{queryDate}
</if>
</where>
GROUP BY
b.channel_name
) n ON m.channel_name= n.channel_name
<where>
<if
test=
"source!=null"
>
m.resource_source = #{source}
</if>
<if
test=
"keyValue!=null"
>
and
(
m.resource_name like concat("%", #{keyValue}, "%")
or
m.resource_number like concat("%", #{keyValue}, "%")
)
</if>
</where>
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/applet/AppletThirdResourcesStatic.Mapper.xml
0 → 100644
View file @
94070cbd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.applet.dao.impl.AppletThirdResourcesStaticDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.applet.entity.AppletThirdResourcesStatic"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"date"
property=
"date"
jdbcType=
"DATE"
/>
<result
column=
"stage_str"
property=
"stageStr"
jdbcType=
"VARCHAR"
/>
<result
column=
"stage"
property=
"stage"
jdbcType=
"VARCHAR"
/>
<result
column=
"channel_name"
property=
"channelName"
jdbcType=
"VARCHAR"
/>
<result
column=
"channel_remark"
property=
"channelRemark"
jdbcType=
"VARCHAR"
/>
<result
column=
"push_uv"
property=
"pushUv"
jdbcType=
"INTEGER"
/>
<result
column=
"get_qr_code_uv"
property=
"getQrCodeUv"
jdbcType=
"INTEGER"
/>
<result
column=
"press_qr_code_uv"
property=
"pressQrCodeUv"
jdbcType=
"INTEGER"
/>
<result
column=
"join_chatroom_count"
property=
"joinChatroomCount"
jdbcType=
"INTEGER"
/>
<result
column=
"join_chatroom_rate"
property=
"joinChatroomRate"
jdbcType=
"VARCHAR"
/>
<result
column=
"stay_user_count"
property=
"stayUserCount"
jdbcType=
"INTEGER"
/>
<result
column=
"share_rate"
property=
"shareRate"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, date, stage_str, stage, channel_name, channel_remark, push_uv, get_qr_code_uv, press_qr_code_uv, join_chatroom_count, join_chatroom_rate, stay_user_count, share_rate, create_time, update_time
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_third_resources_static
WHERE id = #{id}
</select>
<select
id=
"getList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM applet_third_resources_static
</select>
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
INSERT INTO applet_third_resources_static(
date,
stage_str,
stage,
channel_name,
channel_remark,
push_uv,
get_qr_code_uv,
press_qr_code_uv,
join_chatroom_count,
join_chatroom_rate,
stay_user_count,
share_rate,
create_time,
update_time,
resource_type
) VALUES (
#{date, jdbcType=DATE},
#{stageStr, jdbcType=VARCHAR},
#{stage, jdbcType=VARCHAR},
#{channelName, jdbcType=VARCHAR},
#{channelRemark, jdbcType=VARCHAR},
#{pushUv, jdbcType=INTEGER},
#{getQrCodeUv, jdbcType=INTEGER},
#{pressQrCodeUv, jdbcType=INTEGER},
#{joinChatroomCount, jdbcType=INTEGER},
#{joinChatroomRate, jdbcType=VARCHAR},
#{stayUserCount, jdbcType=INTEGER},
#{shareRate, jdbcType=VARCHAR},
now(),
now(),
#{resourceType, jdbcType=INTEGER},
)
</insert>
<insert
id=
"batchInsert"
>
INSERT INTO applet_third_resources_static (
date,
stage_str,
stage,
channel_name,
channel_remark,
push_uv,
get_qr_code_uv,
press_qr_code_uv,
join_chatroom_count,
join_chatroom_rate,
stay_user_count,
share_rate,
create_time,
update_time,
resource_type
) VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
#{item.date, jdbcType=DATE},
#{item.stageStr, jdbcType=VARCHAR},
#{item.stage, jdbcType=VARCHAR},
#{item.channelName, jdbcType=VARCHAR},
#{item.channelRemark, jdbcType=VARCHAR},
#{item.pushUv, jdbcType=INTEGER},
#{item.getQrCodeUv, jdbcType=INTEGER},
#{item.pressQrCodeUv, jdbcType=INTEGER},
#{item.joinChatroomCount, jdbcType=INTEGER},
#{item.joinChatroomRate, jdbcType=VARCHAR},
#{item.stayUserCount, jdbcType=INTEGER},
#{item.shareRate, jdbcType=VARCHAR},
now(),
now(),
#{item.resourceType}
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
UPDATE applet_third_resources_static
<set>
<if
test=
"date != null"
>
date = #{date},
</if>
<if
test=
"stageStr != null and stageStr != ''"
>
stage_str = #{stageStr},
</if>
<if
test=
"stage != null and stage != ''"
>
stage = #{stage},
</if>
<if
test=
"channelName != null and channelName != ''"
>
channel_name = #{channelName},
</if>
<if
test=
"channelRemark != null and channelRemark != ''"
>
channel_remark = #{channelRemark},
</if>
<if
test=
"pushUv != null"
>
push_uv = #{pushUv},
</if>
<if
test=
"getQrCodeUv != null"
>
get_qr_code_uv = #{getQrCodeUv},
</if>
<if
test=
"pressQrCodeUv != null"
>
press_qr_code_uv = #{pressQrCodeUv},
</if>
<if
test=
"joinChatroomCount != null"
>
join_chatroom_count = #{joinChatroomCount},
</if>
<if
test=
"joinChatroomRate != null"
>
join_chatroom_rate = #{joinChatroomRate},
</if>
<if
test=
"stayUserCount != null"
>
stay_user_count = #{stayUserCount},
</if>
<if
test=
"shareRate != null"
>
share_rate = #{shareRate},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</set>
WHERE id = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
DELETE FROM applet_third_resources_static where id = #{id}
</delete>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/rebel.xml
deleted
100644 → 0
View file @
d80c70e8
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application
generated-by=
"intellij"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://www.zeroturnaround.com"
xsi:schemaLocation=
"http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd"
>
<classpath>
<dir
name=
"C:/project/书籍资源数据/prod/pcloud-book/pcloud-service-book/target/classes"
>
</dir>
</classpath>
</application>
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