Commit d3495072 by 徐高华

朋友圈

parent 18c9d254
......@@ -25,6 +25,8 @@ public interface QwMomentPlanAttendMapper {
List<QwMomentPlanAttendDTO> listClerk(@Param("planId")Long planId);
List<TabQwMomentPlanAttend> listForData(@Param("planId")Long planId);
/**
* 删除
......
package com.gic.haoban.manage.service.pojo;
import java.io.Serializable;
public class ClerkStaffBO implements Serializable {
private String clerkId ;
private String staffId ;
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
}
......@@ -8,6 +8,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.SendResultQDTO;
import com.gic.haoban.manage.api.qdto.moment.TaskListWxaQDTO;
import com.gic.haoban.manage.service.pojo.ClerkStaffBO;
import java.util.List;
......@@ -20,7 +21,7 @@ public interface QwMomentPlanAttendService {
* @param enterpriseId
* @param planId
*/
void saveClerk(String wxEnterpriseId , String enterpriseId, Long planId , List<String> clerkIdList) ;
void saveClerk(String wxEnterpriseId , String enterpriseId, Long planId , List<ClerkStaffBO> clerkStaffList) ;
ServiceResponse<TaskDetailDTO> taskDetail(Long planId, String execClerkId);
......
......@@ -11,7 +11,6 @@ public interface QwMomentPlanDataService {
ServiceResponse<Page<QwMomentPlanDataDTO>> dataList(PlanDataListQDTO qdto) ;
ServiceResponse<Void> save(TabQwMomentPlanAttend task , MomentResultDTO dto) ;
}
......@@ -26,6 +26,7 @@ public interface QwMomentPlanService {
void sendPlanNoticeTimer(String params);
ServiceResponse<Integer> getTaskNum(TaskNumQDTO qdto);
ServiceResponse<Page<QwMomentPlanWxaDTO>> planListWxa(PlanListWxaQDTO qdto);
/**
......
......@@ -20,6 +20,7 @@ import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanAttendMapper;
import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
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.wechat.api.dto.qdto.group.QywxMomentInfoQDTO;
......@@ -76,7 +77,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
}
@Override
public void saveClerk(String wxEnterpriseId , String enterpriseId, Long planId , List<String> clerkIdList) {
public void saveClerk(String wxEnterpriseId , String enterpriseId, Long planId , List<ClerkStaffBO> clerkStaffList) {
List<String> clerkIdList = clerkStaffList.stream().map(o->o.getClerkId()).collect(Collectors.toList());
List<String> existClerkIdList = this.qwMomentPlanAttendMapper.listExistClerkIds(planId,clerkIdList) ;
if(CollectionUtils.isNotEmpty(existClerkIdList)) {
clerkIdList = clerkIdList.stream().filter(o->!existClerkIdList.contains(o)).collect(Collectors.toList());
......@@ -86,7 +88,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
return ;
}
List<TabQwMomentPlanAttend> list = new ArrayList<>() ;
for(String clerkId : clerkIdList) {
for(ClerkStaffBO bo : clerkStaffList) {
String clerkId = bo.getClerkId() ;
ClerkDTO clerkDTO = this.clerkService.getclerkById(clerkId) ;
if(null != clerkDTO) {
TabQwMomentPlanAttend attend = new TabQwMomentPlanAttend() ;
......@@ -94,6 +97,7 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
attend.setPlanId(planId);
attend.setWxEnterpriseId(wxEnterpriseId);
attend.setEnterpriseId(enterpriseId);
attend.setStaffId(bo.getStaffId());
attend.setClerkId(clerkId);
attend.setClerkCode(clerkDTO.getClerkCode());
attend.setClerkName(clerkDTO.getClerkName());
......
......@@ -33,6 +33,7 @@ import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanMapper;
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.service.QywxSendService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
......@@ -110,7 +111,6 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
return ServiceResponse.success(retPage);
}
@Override
public ServiceResponse<Page<QwMomentPlanWxaDTO>> planListWxa(PlanListWxaQDTO qdto) {
PageHelper.startPage(qdto);
......@@ -160,13 +160,27 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
// 参与导购
if(dto.getPlanClerkType()==1) {
if (createFlag) {
this.qwMomentPlanAttendService.saveClerk(wxEnterpriseId,enterpriseId, planId,dto.getSelectClerkIdList());
List<StaffClerkRelationDTO> list = this.staffClerkRelationApiService.listByClerkIdsWxEnterpriseId(dto.getSelectClerkIdList(),plan.getWxEnterpriseId()) ;
List<ClerkStaffBO> clerkStaffList = list.stream().map(o->{
ClerkStaffBO bo = new ClerkStaffBO() ;
bo.setClerkId(o.getClerkId());
bo.setStaffId(o.getStaffId());
return bo ;
}).collect(Collectors.toList()) ;
this.qwMomentPlanAttendService.saveClerk(wxEnterpriseId,enterpriseId, planId,clerkStaffList);
} else {
List<String> oldList = this.qwMomentPlanAttendMapper.listClerk(planId).stream().map(o -> o.getClerkId()).collect(Collectors.toList());
List<String> newList = dto.getSelectClerkIdList();
List<String> addList = newList.stream().filter(o -> !oldList.contains(o)).distinct().collect(Collectors.toList());
List<String> delList = oldList.stream().filter(o -> !newList.contains(o)).distinct().collect(Collectors.toList());
this.qwMomentPlanAttendService.saveClerk(wxEnterpriseId,enterpriseId, planId , addList);
List<StaffClerkRelationDTO> list = this.staffClerkRelationApiService.listByClerkIdsWxEnterpriseId(addList,plan.getWxEnterpriseId()) ;
List<ClerkStaffBO> clerkStaffList = list.stream().map(o->{
ClerkStaffBO bo = new ClerkStaffBO() ;
bo.setClerkId(o.getClerkId());
bo.setStaffId(o.getStaffId());
return bo ;
}).collect(Collectors.toList()) ;
this.qwMomentPlanAttendService.saveClerk(wxEnterpriseId,enterpriseId, planId , clerkStaffList);
if (CollectionUtils.isNotEmpty(delList)) {
this.qwMomentPlanAttendMapper.delClerks(planId, delList);
}
......@@ -287,9 +301,14 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}else {
storeIdList = this.getStoreIdList(clerkDTO) ;
}
List<StaffClerkRelationDTO> list = this.staffClerkRelationApiService.listByStoreIds(null , storeIdList) ;
List<String> clerkIdList = list.stream().map(o->o.getClerkId()).collect(Collectors.toList()) ;
Page<ClerkDTO> userPage = this.clerkService.pageUserBySearchName(plan.getEnterpriseId(),null,1,1000) ;
List<StaffClerkRelationDTO> list = this.staffClerkRelationApiService.listByStoreIds(plan.getWxEnterpriseId() , storeIdList) ;
List<ClerkStaffBO> clerkIdList = list.stream().map(o->{
ClerkStaffBO bo = new ClerkStaffBO() ;
bo.setClerkId(o.getClerkId());
bo.setStaffId(o.getStaffId());
return bo ;
}).collect(Collectors.toList()) ;
Page<ClerkDTO> userPage = this.clerkService.pageUserBySearchName(plan.getEnterpriseId(),null,1,10000) ;
List<String> userIdList = userPage.getResult().stream().map(o->o.getClerkId()).collect(Collectors.toList());
logger.info("管理员列表={}",userIdList);
clerkIdList.stream().filter(o->!userIdList.contains(o)).collect(Collectors.toList()) ;
......@@ -452,6 +471,7 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}
ServiceResponse<MomentResultDTO> resp = this.qywxExternalUserService.getMomentComments(qwDTO.getThirdCorpid(),
qwDTO.getSelf3thSecret(), momentId,wxUserId,qwDTO.isSelf(),qwDTO.getUrlHost()) ;
logger.info("企微统计返回={},{}",JSONObject.toJSONString(resp),staffId);
MomentResultDTO dto = resp.getResult() ;
return dto ;
}
......
......@@ -145,6 +145,9 @@
and a.task_status = 2
</if>
</select>
<select id="listForData" resultMap="result-map-tabHaobanQwMomentPlanAttend" parameterType="java.lang.Long">
select <include refid="Base_Column_List" /> from tab_haoban_qw_moment_plan_attend where plan_id =#{planId} and delete_flag = 0
</select>
<update id="delClerks">
update tab_haoban_qw_moment_plan_attend set delete_flag = 1 , update_time=now() where plan_id = #{planId}
......
......@@ -76,8 +76,8 @@
like_flag
)VALUES
<foreach collection="list" item="item" separator="," open="(" close=")" index="index">
#{item.dataId,jdbcType=BIGINT},
<foreach collection="list" item="item" separator="," index="index">
( #{item.dataId,jdbcType=BIGINT},
#{item.planId,jdbcType=BIGINT},
#{item.wxEnterpriseId,jdbcType=CHAR},
#{item.enterpriseId,jdbcType=CHAR},
......@@ -85,10 +85,10 @@
#{item.clerkId,jdbcType=CHAR},
#{item.storeId,jdbcType=CHAR},
#{item.memberId,jdbcType=CHAR},
#{commentTime,jdbcType=TIMESTAMP},
#{likeTime,jdbcType=TIMESTAMP},
#{commentFlag,jdbcType=INTEGER},
#{likeFlag,jdbcType=INTEGER}
#{item.commentTime,jdbcType=TIMESTAMP},
#{item.likeTime,jdbcType=TIMESTAMP},
#{item.commentFlag,jdbcType=INTEGER},
#{item.likeFlag,jdbcType=INTEGER} )
</foreach>
</update>
......
......@@ -31,6 +31,7 @@
<result column="qw_jobid" javaType="String" jdbcType="VARCHAR" property="qwJobid"/>
<result column="exec_rate" javaType="int" jdbcType="INTEGER" property="execRate"/>
<result column="task_clerk_num" property="taskClerkNum" />
<result column="moment_id" property="momentId" />
</resultMap>
<sql id="Base_Column_List">
plan_id,
......@@ -60,7 +61,7 @@
total_like_count,
total_comment_count,
qw_jobid,
exec_rate , task_clerk_num
exec_rate , task_clerk_num , moment_id
</sql>
<!-- ===================== 新增 ======================== -->
<insert id="insert">
......
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