Commit cb5cf6be by 徐高华

朋友圈

parent e43b2628
......@@ -6,6 +6,7 @@ import com.gic.haoban.manage.api.dto.moment.TaskListWxaDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO;
import com.gic.haoban.manage.api.qdto.moment.TaskListWxaQDTO;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.pojo.bo.moment.CountBO;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
......@@ -52,4 +53,6 @@ public interface QwMomentPlanAttendMapper {
void updateSuccessStaff(@Param("planId") Long planId, @Param("clerkId") String clerkId , @Param("staffId") String staffId) ;
void updateQwData(@Param("planId") Long planId, @Param("clerkId") String clerkId, @Param("likeCount")int likeCount, @Param("momentCount")int momentCount);
CountBO getQwCount(@Param("planId")Long planId);
}
......@@ -34,4 +34,5 @@ public interface QwMomentPlanMapper {
void updateMomentId(@Param("planId") Long planId, @Param("momentId") String jobId);
void updateQwData(@Param("planId") Long planId, @Param("like") int like, @Param("comment") int comment);
}
package com.gic.haoban.manage.service.pojo.bo.moment;
public class CountBO {
private Integer linkCount ;
private Integer commentCount ;
public Integer getLinkCount() {
return linkCount;
}
public void setLinkCount(Integer linkCount) {
this.linkCount = linkCount;
}
public Integer getCommentCount() {
return commentCount;
}
public void setCommentCount(Integer commentCount) {
this.commentCount = commentCount;
}
}
......@@ -29,6 +29,9 @@ public interface QwMomentPlanService {
ServiceResponse<Page<QwMomentPlanWxaDTO>> planListWxa(PlanListWxaQDTO qdto);
void getQwData(Long planId) ;
/**
* 拉取企微点赞、评论
* @param task
......
......@@ -34,6 +34,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.pojo.ClerkStaffBO;
import com.gic.haoban.manage.service.pojo.bo.moment.CountBO;
import com.gic.haoban.manage.service.service.QywxSendService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
......@@ -456,6 +457,28 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}
@Override
public void getQwData(Long planId) {
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ;
List< TabQwMomentPlanAttend> list = this.qwMomentPlanAttendMapper.listForData(planId) ;
for(TabQwMomentPlanAttend item : list) {
item.setMomentId(plan.getMomentId());
this.getQwData(item);
}
CountBO bo = this.qwMomentPlanAttendMapper.getQwCount(planId) ;
if (null != bo.getLinkCount() || null != bo.getCommentCount()) {
int like = 0 ;
int comment = 0 ;
if(bo.getLinkCount() == null) {
like = 0 ;
}
if(bo.getCommentCount() == null) {
comment = 0 ;
}
this.qwMomentPlanMapper.updateQwData(planId , like , comment) ;
}
}
@Override
public void getQwData(TabQwMomentPlanAttend task) {
MomentResultDTO dto = this.getQwData(task.getStaffId(),task.getMomentId(),task.getWxEnterpriseId()) ;
if(null != dto) {
......
......@@ -162,6 +162,11 @@
select <include refid="Base_Column_List" /> from tab_haoban_qw_moment_plan_attend where plan_id =#{planId} and delete_flag = 0
</select>
<select id="getQwCount" resultType="com.gic.haoban.manage.service.pojo.bo.moment.CountBO">
select sum(like_count) , sum(comment_count) from tab_haoban_qw_moment_plan_attend where plan_id=#{planId} and delete_flag = 0 and
like_count is not null and comment_count is not null
</select>
<update id="delClerks">
update tab_haoban_qw_moment_plan_attend set delete_flag = 1 , update_time=now() where plan_id = #{planId}
<if test="null != list">
......
......@@ -299,4 +299,8 @@
<update id="updateMomentId">
update tab_haoban_qw_moment_plan set moment_id = #{momentId} where plan_id = #{planId}
</update>
<update id="updateQwData">
update tab_haoban_qw_moment_plan set total_like_count = #{like} , total_comment_count = #{comment} where plan_id = #{planId}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment