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
ccb1a7c3
Commit
ccb1a7c3
authored
Mar 10, 2025
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
朋友圈
parent
8ca07d24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
393 additions
and
2 deletions
+393
-2
MomentPlanExcelHandler.java
.../manage/web/controller/moment/MomentPlanExcelHandler.java
+61
-0
QwMomentController.java
...oban/manage/web/controller/moment/QwMomentController.java
+50
-2
MomentPlanExcelVO.java
...om/gic/haoban/manage/web/vo/moment/MomentPlanExcelVO.java
+282
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/moment/MomentPlanExcelHandler.java
0 → 100644
View file @
ccb1a7c3
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
moment
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO
;
import
com.gic.haoban.manage.api.qdto.moment.QwMomentPlanQDTO
;
import
com.gic.haoban.manage.api.service.moment.QwMomentApiService
;
import
com.gic.haoban.manage.web.vo.moment.MomentPlanExcelVO
;
import
com.gic.web.common.download.DownloadHandlerAbstract
;
import
com.gic.web.common.download.context.Context
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
@Service
public
class
MomentPlanExcelHandler
extends
DownloadHandlerAbstract
<
MomentPlanExcelVO
>
{
@Autowired
private
QwMomentApiService
qwMomentApiService
;
@Override
public
List
<
MomentPlanExcelVO
>
getData
(
Context
context
,
String
json
,
Integer
currentPage
)
{
QwMomentPlanQDTO
qdto
=
JSON
.
parseObject
(
json
,
QwMomentPlanQDTO
.
class
);
BasePageInfo
pageInfo
=
new
BasePageInfo
()
;
pageInfo
.
setPageSize
(
this
.
getPageSize
());
pageInfo
.
setPageNum
(
currentPage
);
ServiceResponse
<
Page
<
QwMomentPlanDTO
>>
pageResp
=
this
.
qwMomentApiService
.
planList
(
qdto
);
List
<
MomentPlanExcelVO
>
voList
=
new
ArrayList
<>();
if
(
null
!=
pageResp
&&
CollectionUtils
.
isNotEmpty
(
pageResp
.
getResult
().
getResult
()))
{
EnterpriseDTO
en
=
this
.
enterpriseService
.
getEnterpriseById
(
qdto
.
getEnterpriseId
())
;
for
(
QwMomentPlanDTO
item
:
pageResp
.
getResult
().
getResult
())
{
MomentPlanExcelVO
vo
=
EntityUtil
.
changeEntityByJSON
(
MomentPlanExcelVO
.
class
,
item
)
;
voList
.
add
(
vo
)
;
}
}
return
voList
;
}
@Override
public
List
<
String
>
getColumnNames
()
{
return
Arrays
.
asList
(
"活动信息"
,
"执行方式"
,
"活动状态"
,
"下发任务数"
,
"完成任务数"
,
"完成率"
,
"点赞数"
,
"评论数"
);
}
@Override
public
LinkedHashMap
<
String
,
List
<
String
>>
doubleColumnNames
()
{
return
null
;
}
@Override
public
List
<
String
>
getColumns
()
{
return
Arrays
.
asList
(
"title"
,
"execTypeExcel"
,
"statusFlagExcel"
,
"taskClerkNum"
,
"doneNum"
,
"execRateFloat"
,
"totalLikeCount"
,
"totalCommentCount"
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/moment/QwMomentController.java
View file @
ccb1a7c3
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
moment
;
import
cn.hutool.core.date.DatePattern
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.AuthorizedUser
;
...
...
@@ -31,6 +35,10 @@ import com.gic.log.record.anno.GicLogRecord;
import
com.gic.log.record.util.GicLogRecordCategoryEnum
;
import
com.gic.log.record.util.GicLogRecordEvaluationContext
;
import
com.gic.log.record.util.GicLogRecordOptTypeEnum
;
import
com.gic.qcloud.BucketNameEnum
;
import
com.gic.web.common.download.DownloadTask
;
import
com.gic.web.common.download.DownloadTaskUtil
;
import
com.gic.web.common.download.constants.TaskTypeEnum
;
import
com.gic.web.common.utils.SessionContextUtils
;
import
com.google.common.collect.Sets
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -60,6 +68,8 @@ public class QwMomentController {
@Autowired
private
QwMomentApiService
qwMomentApiService
;
@Autowired
private
MomentPlanExcelHandler
momentPlanExcelHandler
;
/**
* 新建任务
...
...
@@ -358,8 +368,46 @@ public class QwMomentController {
@RequestMapping
(
"plan-list-excel"
)
public
RestResponse
<
String
>
planListExcel
(
@RequestBody
PlanListQO
qo
)
{
QwMomentPlanQDTO
qdto
=
new
QwMomentPlanQDTO
()
;
ServiceResponse
<
Page
<
QwMomentPlanDTO
>>
resp
=
this
.
qwMomentApiService
.
planList
(
qdto
)
;
return
RestResponse
.
successResult
(
null
);
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
qdto
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
qdto
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
BasePageInfo
basePageInfo
=
new
BasePageInfo
();
basePageInfo
.
setPageNum
(
1
);
basePageInfo
.
setPageSize
(
1
);
ServiceResponse
<
Page
<
QwMomentPlanDTO
>>
pageResp
=
this
.
qwMomentApiService
.
planList
(
qdto
);
final
int
totalCount
=
pageResp
.
getResult
().
getTotalCount
();
if
(
totalCount
==
0
)
{
return
RestResponse
.
failure
(
"9999"
,
"导出数据条数为0"
);
}
AuthorizedUser
user
=
new
AuthorizedUser
();
user
.
setUserId
(
loginUser
.
getClerkId
());
user
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
user
.
setRealName
(
loginUser
.
getClerkName
());
String
fileName
=
"企微朋友圈-活动列表"
;
Date
startDate
=
qo
.
getStartTime
()
;
Date
endDate
=
qo
.
getEndTime
()
;
if
(
null
!=
startDate
&&
null
!=
endDate
)
{
fileName
=
fileName
+
"-"
+
DateUtil
.
formatString
(
startDate
,
"yyyy-MM-dd"
)
+
"到"
+
DateUtil
.
formatString
(
endDate
,
"yyyy-MM-dd"
);
}
// 1.组装数据查询条件
DownloadTask
task
=
new
DownloadTask
();
task
.
setTaskTypeEnum
(
TaskTypeEnum
.
QYWX_MOMENT
);
task
.
setUser
(
user
);
task
.
setDataType
(
1
);
task
.
setTotalCount
(
totalCount
);
task
.
setFileName
(
fileName
);
task
.
setChannelName
(
TaskTypeEnum
.
QYWX_MOMENT
.
getName
());
task
.
setBucketName
(
BucketNameEnum
.
REPORT_50000
.
getName
());
task
.
setSearchDataParams
(
JSON
.
toJSONStringWithDateFormat
(
qdto
,
DatePattern
.
NORM_DATETIME_PATTERN
));
task
.
setHandler
(
momentPlanExcelHandler
);
JSONResponse
jsonResponse
=
DownloadTaskUtil
.
createDownloadTask
(
task
);
final
String
reportId
;
if
(
jsonResponse
.
isSuccess
())
{
reportId
=
(
String
)
jsonResponse
.
getResult
();
}
else
{
return
RestResponse
.
failure
(
"9999"
,
jsonResponse
.
getErrorMessage
());
}
return
RestResponse
.
successResult
(
reportId
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/moment/MomentPlanExcelVO.java
0 → 100644
View file @
ccb1a7c3
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
moment
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
*
* @ClassName: TabHaobanQwMomentPlan
* @Description: TODO
* @Author 徐高华
* @Date 2025年03月05日 10:27:20
* @Modify
* @CopyRight 杭州
*/
public
class
MomentPlanExcelVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
67027585759300L
;
/**
* 活动id
*/
private
Long
planId
;
/**
* 名称
*/
private
String
title
;
/**
* 描述
*/
private
String
remark
;
/**
* 开始时间
*/
private
Date
beginDate
;
/**
* 结束结束
*/
private
Date
endDate
;
/**
* 几天后失效
*/
private
int
expireDays
;
/**
* 执行方式 0企微1好办小程序
*/
private
Integer
execType
;
private
String
execTypeExcel
;
/**
* 创建人
*/
private
String
creatorName
;
/**
* 1进行中 2终止 0未开始 3 已结束
*/
private
Integer
statusFlag
;
private
String
statusFlagExcel
;
/**
* 1立即发布2定时发布
*/
private
Integer
publishType
;
/**
* 发布时间
*/
private
Date
publishTime
;
/**
* 0全部导购 1部分导购
*/
private
Integer
planClerkType
;
/**
* 总任务数
*/
private
Integer
totalNum
;
/**
* 成功下发导购数据
*/
private
Integer
taskClerkNum
;
/**
* 执行任务数
*/
private
Integer
doneNum
;
/**
* 完成率
*/
private
Double
execRateFloat
;
/**
* 终止时间
*/
private
Date
stopTime
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 总点赞数
*/
private
Integer
totalLikeCount
;
/**
* 总评论数
*/
private
Integer
totalCommentCount
;
public
Long
getPlanId
()
{
return
planId
;
}
public
void
setPlanId
(
Long
planId
)
{
this
.
planId
=
planId
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Date
getBeginDate
()
{
return
beginDate
;
}
public
void
setBeginDate
(
Date
beginDate
)
{
this
.
beginDate
=
beginDate
;
}
public
Date
getEndDate
()
{
return
endDate
;
}
public
void
setEndDate
(
Date
endDate
)
{
this
.
endDate
=
endDate
;
}
public
int
getExpireDays
()
{
return
expireDays
;
}
public
void
setExpireDays
(
int
expireDays
)
{
this
.
expireDays
=
expireDays
;
}
public
Integer
getExecType
()
{
return
execType
;
}
public
void
setExecType
(
Integer
execType
)
{
this
.
execType
=
execType
;
}
public
String
getExecTypeExcel
()
{
return
execTypeExcel
;
}
public
void
setExecTypeExcel
(
String
execTypeExcel
)
{
this
.
execTypeExcel
=
execTypeExcel
;
}
public
String
getCreatorName
()
{
return
creatorName
;
}
public
void
setCreatorName
(
String
creatorName
)
{
this
.
creatorName
=
creatorName
;
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
public
String
getStatusFlagExcel
()
{
return
statusFlagExcel
;
}
public
void
setStatusFlagExcel
(
String
statusFlagExcel
)
{
this
.
statusFlagExcel
=
statusFlagExcel
;
}
public
Integer
getPublishType
()
{
return
publishType
;
}
public
void
setPublishType
(
Integer
publishType
)
{
this
.
publishType
=
publishType
;
}
public
Date
getPublishTime
()
{
return
publishTime
;
}
public
void
setPublishTime
(
Date
publishTime
)
{
this
.
publishTime
=
publishTime
;
}
public
Integer
getPlanClerkType
()
{
return
planClerkType
;
}
public
void
setPlanClerkType
(
Integer
planClerkType
)
{
this
.
planClerkType
=
planClerkType
;
}
public
Integer
getTotalNum
()
{
return
totalNum
;
}
public
void
setTotalNum
(
Integer
totalNum
)
{
this
.
totalNum
=
totalNum
;
}
public
Integer
getTaskClerkNum
()
{
return
taskClerkNum
;
}
public
void
setTaskClerkNum
(
Integer
taskClerkNum
)
{
this
.
taskClerkNum
=
taskClerkNum
;
}
public
Integer
getDoneNum
()
{
return
doneNum
;
}
public
void
setDoneNum
(
Integer
doneNum
)
{
this
.
doneNum
=
doneNum
;
}
public
Double
getExecRateFloat
()
{
return
execRateFloat
;
}
public
void
setExecRateFloat
(
Double
execRateFloat
)
{
this
.
execRateFloat
=
execRateFloat
;
}
public
Date
getStopTime
()
{
return
stopTime
;
}
public
void
setStopTime
(
Date
stopTime
)
{
this
.
stopTime
=
stopTime
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getTotalLikeCount
()
{
return
totalLikeCount
;
}
public
void
setTotalLikeCount
(
Integer
totalLikeCount
)
{
this
.
totalLikeCount
=
totalLikeCount
;
}
public
Integer
getTotalCommentCount
()
{
return
totalCommentCount
;
}
public
void
setTotalCommentCount
(
Integer
totalCommentCount
)
{
this
.
totalCommentCount
=
totalCommentCount
;
}
}
\ 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