Commit 549b4df4 by 徐高华

朋友圈

parent 257d35f7
......@@ -5,17 +5,21 @@ import com.gic.api.base.commons.BasePageInfo;
import java.util.Date;
public class PlanClerkListQDTO extends BasePageInfo {
private Long planId ;
/**
* 成员名称
*/
private String staffName ;
private String staffNameLike ;
/**
* 导购条件
*/
private String clerkParams ;
private String clerkParamsLike ;
/**
* 0已失效 1待完成 2已完成
*/
......@@ -35,6 +39,29 @@ public class PlanClerkListQDTO extends BasePageInfo {
*/
private String sortType ;
public String getStaffNameLike() {
return staffNameLike;
}
public void setStaffNameLike(String staffNameLike) {
this.staffNameLike = staffNameLike;
}
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public String getClerkParamsLike() {
return clerkParamsLike;
}
public void setClerkParamsLike(String clerkParamsLike) {
this.clerkParamsLike = clerkParamsLike;
}
public String getSortColumn() {
return sortColumn;
......
......@@ -6,16 +6,23 @@ import java.util.Date;
public class PlanDataListQDTO extends BasePageInfo {
private Long planId ;
/**
* 成员名称
*/
private String staffName ;
private String staffNameLike ;
/**
* 导购条件
*/
private String clerkParams ;
private String clerkParamsLike ;
/**
* 1点赞 2评论
*/
......@@ -25,6 +32,56 @@ public class PlanDataListQDTO extends BasePageInfo {
private Date endTime ;
/**
* 排序字段 完成率:exec_rate 点赞:total_like_count 评论:total_comment_count
*/
private String sortColumn ;
/**
* desc / asc
*/
private String sortType ;
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public String getStaffNameLike() {
return staffNameLike;
}
public void setStaffNameLike(String staffNameLike) {
this.staffNameLike = staffNameLike;
}
public String getSortColumn() {
return sortColumn;
}
public void setSortColumn(String sortColumn) {
this.sortColumn = sortColumn;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
public String getClerkParamsLike() {
return clerkParamsLike;
}
public void setClerkParamsLike(String clerkParamsLike) {
this.clerkParamsLike = clerkParamsLike;
}
public Integer getType() {
return type;
}
......
package com.gic.haoban.manage.service.dao.mapper.moment;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import org.apache.ibatis.annotations.Param;
......@@ -31,4 +31,5 @@ public interface QwMomentPlanAttendMapper {
*/
void delClerks(@Param("planId") Long planId , @Param("list") List<String> clerkIdList) ;
List<QwMomentPlanAttendDTO> list(PlanClerkListQDTO qdto);
}
package com.gic.haoban.manage.service.dao.mapper.moment;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDataDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanDataListQDTO;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanData;
import java.util.List;
public interface QwMomentPlanDataMapper {
......@@ -8,4 +12,5 @@ public interface QwMomentPlanDataMapper {
void update(QwMomentPlanDataDTO dto) ;
List<QwMomentPlanDataDTO> list(PlanDataListQDTO qdto);
}
......@@ -4,13 +4,18 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO;
import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanAttendMapper;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -32,7 +37,22 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
@Override
public ServiceResponse<Page<QwMomentPlanAttendDTO>> attendList(PlanClerkListQDTO qdto) {
return null;
PageHelper.startPage(qdto);
if(StringUtils.isNotEmpty(qdto.getClerkParams())) {
qdto.setClerkParamsLike("%"+qdto.getClerkParams()+"%");
}
if(StringUtils.isNotBlank(qdto.getStaffName())) {
qdto.setStaffNameLike("%"+qdto.getStaffName()+"%");
}
if(StringUtils.isBlank(qdto.getSortColumn())) {
qdto.setSortColumn("create_time");
}
if(StringUtils.isBlank(qdto.getSortType())) {
qdto.setSortType("desc");
}
List<QwMomentPlanAttendDTO> list = this.qwMomentPlanAttendMapper.list(qdto);
Page<QwMomentPlanAttendDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, QwMomentPlanAttendDTO.class);
return ServiceResponse.success(retPage);
}
@Override
......
......@@ -2,12 +2,16 @@ package com.gic.haoban.manage.service.service.moment.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDataDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanDataListQDTO;
import com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanDataMapper;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanDataService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("qwMomentPlanDataService")
public class QwMomentPlanDataServiceImpl implements QwMomentPlanDataService {
......@@ -17,7 +21,22 @@ public class QwMomentPlanDataServiceImpl implements QwMomentPlanDataService {
@Override
public ServiceResponse<Page<QwMomentPlanDataDTO>> dataList(PlanDataListQDTO qdto) {
return null;
PageHelper.startPage(qdto);
if(StringUtils.isNotEmpty(qdto.getClerkParams())) {
qdto.setClerkParamsLike("%"+qdto.getClerkParams()+"%");
}
if(StringUtils.isNotBlank(qdto.getStaffName())) {
qdto.setStaffNameLike("%"+qdto.getStaffName()+"%");
}
if(StringUtils.isBlank(qdto.getSortColumn())) {
qdto.setSortColumn("create_time");
}
if(StringUtils.isBlank(qdto.getSortType())) {
qdto.setSortType("desc");
}
List<QwMomentPlanDataDTO> list = this.qwMomentPlanDataMapper.list(qdto);
Page<QwMomentPlanDataDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, QwMomentPlanDataDTO.class);
return ServiceResponse.success(retPage);
}
......
......@@ -17,6 +17,7 @@ import com.gic.enterprise.api.service.StoreService;
import com.gic.enterprise.api.service.StoreWidgetService;
import com.gic.haoban.manage.api.dto.ContentMaterialDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO;
import com.gic.haoban.manage.api.qdto.moment.QwMomentPlanQDTO;
......@@ -25,10 +26,12 @@ 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.moment.TabQwMomentPlan;
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;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanService;
import com.gic.quartz.api.dto.QuartzTaskDTO;
import com.gic.quartz.api.service.QuartzService;
import com.gic.wechat.api.service.qywx.QywxExternalUserService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -66,6 +69,10 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
private StoreWidgetService storeWidgetService ;
@Autowired
private QywxSendService qywxSendService ;
@Autowired
private QywxExternalUserService qywxExternalUserService;
@Autowired
private WxEnterpriseService wxEnterpriseService ;
@Override
public ServiceResponse<Page<QwMomentPlanDTO>> planList(QwMomentPlanQDTO qdto) {
......@@ -291,6 +298,13 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
imageList.add(d1) ;
ServiceResponse<String> resp = this.qywxSendService.share(plan.getWxEnterpriseId(),Arrays.asList("b2ef17cce11f476b996d0b27ebadf7fb"),"朋友圈",imageList) ;
logger.info("发企微朋友={}",JSONObject.toJSONString(resp));
String jobId = resp.getResult() ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(plan.getWxEnterpriseId());
ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(),
qwDTO.getSelf3thSecret(), jobId,qwDTO.isSelf(),qwDTO.getUrlHost()) ;
logger.info("获取moment_id={}",JSONObject.toJSONString(resp2));
String moment_id = resp2.getResult().toString() ;
}
@Override
......
......@@ -43,6 +43,37 @@
store_id , status_flag
</sql>
<select id="list" resultType="com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO"
parameterType="com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO">
select a.attend_id,
a.plan_id,
a.wx_enterprise_id,
a.enterprise_id,
a.staff_id,
a.clerk_id,
a.clerk_code,
a.clerk_name,
a.create_time,
a.update_time,
a.delete_flag,
a.comment_count,
a.like_count,
a.task_status,
a.send_time,
a.moment_id,
a.qw_data_time,
a.store_id , a.status_flag from tab_haoban_qw_moment_plan_attend a left join tab_haoban_staff b on a.staff_id = b.staff_id
where a.plan_id =#{planId} and a.delete_flag = 0
<if test="null != staffNameLike">
and b.staff_name like #{staffNameLike}
</if>
<if test="null != clerkParamsLike">
and (a.clerk_code like #{clerkParamsLike} or a.clerk_name like #{clerkParamsLike})
</if>
<if test="null != startTime">
and ( a.create_time >= #{startTime} and a.create_time <![CDATA[ <= ]]> #{endTime} )
</if>
</select>
<select id="listExistClerkIds" resultType="java.lang.String">
select clerk_id from tab_haoban_qw_moment_plan_attend where plan_id = #{planId} and clerk_id in (
......
......@@ -19,7 +19,7 @@
<result column="like_flag" javaType="int" jdbcType="INTEGER" property="likeFlag"/>
</resultMap>
<sql id="Base_Column_List">
data_id,
data_id,
plan_id,
wx_enterprise_id,
enterprise_id,
......@@ -36,6 +36,30 @@
like_flag
</sql>
<!-- ===================== 新增 ======================== -->
<select id="list" resultType="com.gic.haoban.manage.api.dto.moment.QwMomentPlanDataDTO"
parameterType="com.gic.haoban.manage.api.qdto.moment.PlanDataListQDTO">
select <include refid="Base_Column_List" /> from tab_haoban_qw_moment_plan_data a left join tab_haoban_staff b on a.staff_id = b.staff_id where a.plan_id=#{planId} and a.delete_flag = 0
<if test="null != staffNameLike">
and b.staff_name like #{staffNameLike}
</if>
<if test="null != clerkParamsLike">
and (a.clerk_code like #{clerkParamsLike} or a.clerk_name like #{clerkParamsLike})
</if>
<if test="type==1">
and a.like_flag = 1
<if test="null != startTime">
and ( a.like_time >= #{startTime} and a.like_time <![CDATA[ <= ]]> #{endTime} )
</if>
</if>
<if test="type==2">
and a.comment_flag = 1
<if test="null != startTime">
and ( a.comment_time >= #{startTime} and a.comment_time <![CDATA[ <= ]]> #{endTime} )
</if>
</if>
</select>
<insert id="insert">
<![CDATA[
INSERT INTO tab_haoban_qw_moment_plan_data(
......
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.content.api.qdto.activity.ContentActivityQDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatActivityHmDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatActivityRewardDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatActivityRewardDetailDTO;
......@@ -12,9 +14,12 @@ import com.gic.haoban.manage.api.service.chat.GroupChatActivityApiService;
import com.gic.haoban.manage.api.service.chat.GroupChatActivityShareApiService;
import com.gic.haoban.manage.service.pojo.bo.chat.GroupChatActivityBaseContext;
import com.gic.haoban.manage.service.pojo.bo.chat.GroupChatActivityContext;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.chat.GroupChatActivityInviteLogService;
import com.gic.haoban.manage.service.service.chat.GroupChatActivityRewardLogService;
import com.gic.haoban.manage.service.service.chat.GroupChatActivityService;
import com.gic.wechat.api.dto.qywx.chat.GroupChatListDTO;
import com.gic.wechat.api.service.qywx.QywxChatApiService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
......@@ -39,6 +44,21 @@ public class GroupChatTest {
private GroupChatActivityShareApiService groupChatActivityShareApiService;
@Autowired
private GroupChatActivityInviteLogService groupChatActivityInviteLogService;
@Autowired
private WxEnterpriseService wxEnterpriseService ;
@Autowired
private QywxChatApiService qywxChatApiService ;
@Test
public void test() {
String wxEnterpriseId = "4b18675afa7e4dfaa7b9c66b11ca6474";
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
ServiceResponse<GroupChatListDTO> resp = this.qywxChatApiService.groupchatList(qwDTO.getThirdCorpid(),
qwDTO.getSelf3thSecret() , Arrays.asList("15277046187","17703215186"), 1, null , qwDTO.isSelf(), qwDTO.getUrlHost());
System.out.println("*****************同步群列表"+JSON.toJSONString(resp));
}
@Test
public void saveActivity() throws Exception{
......
......@@ -3,6 +3,8 @@ import com.gic.commons.util.DateUtil;
import com.gic.haoban.manage.api.dto.ContentMaterialDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanDataListQDTO;
import com.gic.haoban.manage.api.qdto.moment.QwMomentPlanQDTO;
import com.gic.haoban.manage.api.service.moment.QwMomentApiService;
import com.gic.haoban.manage.service.service.chat.GroupChatPlanService;
......@@ -39,7 +41,7 @@ public class MomentTest {
dto.setExecType(0);
dto.setExpireDays(10);
dto.setPlanClerkType(1);
// ,"b2ef17cce11f476b996d0b27ebadf7fb"
// ,"b2ef17cce11f476b996d0b27ebadf7fb"
List<String> clerkIds = Arrays.asList("a02065ae51594fb9832e4199d4e3a1b0","753a367d709d40a38b17ed25847d3b4b") ;
dto.setSelectClerkIdList(clerkIds);
this.qwMomentApiService.save(dto) ;
......@@ -63,6 +65,30 @@ public class MomentTest {
}
@Test
public void dataPage() {
PlanDataListQDTO qdto = new PlanDataListQDTO();
qdto.setPlanId(1111l);
qdto.setPageNum(1);
qdto.setPageSize(2);
qdto.setStaffName("111");
qdto.setClerkParams("2222");
qdto.setType(1);
this.qwMomentApiService.dataList(qdto) ;
}
@Test
public void clerkPage() {
PlanClerkListQDTO qdto = new PlanClerkListQDTO();
qdto.setPlanId(1111l);
qdto.setPageNum(1);
qdto.setPageSize(2);
qdto.setStaffName("111");
qdto.setClerkParams("2222");
this.qwMomentApiService.attendList(qdto) ;
}
}
......@@ -5,6 +5,7 @@ import java.util.Date;
public class PlanClerkListQO extends BasePageInfo {
private Long planId ;
/**
* 成员名称
*/
......@@ -34,6 +35,13 @@ public class PlanClerkListQO extends BasePageInfo {
*/
private String sortType ;
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public String getSortColumn() {
return sortColumn;
......
......@@ -5,7 +5,7 @@ import com.gic.api.base.commons.BasePageInfo;
import java.util.Date;
public class PlanDataListQO extends BasePageInfo {
private Long planId ;
/**
* 成员名称
*/
......@@ -25,6 +25,14 @@ public class PlanDataListQO extends BasePageInfo {
private Date endTime ;
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public Integer getType() {
return type;
}
......
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