Commit d8caa5cd by 徐高华

朋友圈

parent 2c0e9895
......@@ -14,6 +14,8 @@ import java.util.List;
public interface QwMomentPlanAttendMapper {
TabQwMomentPlanAttend getById(Long attendId) ;
void batchInsert(List<TabQwMomentPlanAttend> list) ;
/**
......
......@@ -37,7 +37,7 @@ public interface QwMomentPlanService {
* 拉取企微点赞、评论
* @param task
*/
void getQwData(TabQwMomentPlanAttend task) ;
void getQwData(TabQwMomentPlanAttend task , int type) ;
void getMomentId(Long planId) ;
......
......@@ -26,6 +26,7 @@ import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.pojo.ClerkStaffBO;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanService;
import com.gic.wechat.api.dto.qdto.group.QywxMomentInfoQDTO;
import com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
......@@ -61,6 +62,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
private QwMomentPlanMapper qwMomentPlanMapper ;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService ;
@Autowired
private QwMomentPlanService qwMomentPlanService ;
@Override
public ServiceResponse<Page<QwMomentPlanAttendDTO>> attendList(PlanClerkListQDTO qdto) {
......@@ -177,6 +180,9 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
@Override
public ServiceResponse<TaskDetailDTO> taskDetail(Long planId, String execClerkId) {
TaskDetailDTO dto = this.qwMomentPlanAttendMapper.taskDetail(planId,execClerkId) ;
Long attendId = dto.getAttendId() ;
TabQwMomentPlanAttend attend = this.qwMomentPlanAttendMapper.getById(attendId) ;
this.qwMomentPlanService.getQwData(attend,1);
return ServiceResponse.success(dto);
}
......
......@@ -473,7 +473,7 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
List< TabQwMomentPlanAttend> list = this.qwMomentPlanAttendMapper.listForData(planId) ;
for(TabQwMomentPlanAttend item : list) {
item.setMomentId(plan.getMomentId());
this.getQwData(item);
this.getQwData(item , 0);
}
CountBO bo = this.qwMomentPlanAttendMapper.getQwCount(planId) ;
if (null != bo && (null != bo.getLinkCount() || null != bo.getCommentCount())) {
......@@ -490,10 +490,24 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}
@Override
public void getQwData(TabQwMomentPlanAttend task) {
public void getQwData(TabQwMomentPlanAttend task , int type) {
MomentResultDTO dto = this.getQwData(task.getStaffId(),task.getMomentId(),task.getWxEnterpriseId()) ;
if(null != dto) {
this.qwMomentPlanDataService.save(task, dto);
if(type==1) {
CountBO bo = this.qwMomentPlanAttendMapper.getQwCount(task.getPlanId()) ;
if (null != bo && (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(task.getPlanId() , like , comment) ;
}
}
}
}
......
......@@ -167,6 +167,11 @@
like_count is not null and comment_count is not null
</select>
<select id="getById" resultMap="result-map-tabHaobanQwMomentPlanAttend"
parameterType="java.lang.Long">
select <include refid="Base_Column_List" /> from tab_haoban_qw_moment_plan_attend where attend_id = #{attendId}
</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">
......@@ -210,7 +215,7 @@
</update>
<update id="updateQwData">
update tab_haoban_qw_moment_plan_attend set like_count = #{likeCount} , comment_count=#{momentCount} where plan_id = #{planId} and clerk_id = #{clerkId}
update tab_haoban_qw_moment_plan_attend set like_count = #{likeCount} , comment_count=#{momentCount}, qw_data_time = now() where plan_id = #{planId} and clerk_id = #{clerkId}
</update>
<!-- ===================== 新增 ======================== -->
......
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