Commit 543b8cc8 by jinxin

营销任务查询待发送数量

parent cb4441a6
......@@ -65,4 +65,13 @@ public interface GroupChatPlanApiService {
public ServiceResponse<Void> del(String clerkId, String clerkName, Long planId);
public ServiceResponse<Void> stop(String clerkId, String clerkName, Long planId);
/**
* 查询社群群发待发送总数
* @param enterpriseId gic企业id
* @param clerkId 导购id
* @param storeId 门店id
* @return
*/
public ServiceResponse<Integer> getTotalCount(String enterpriseId,String clerkId,String storeId);
}
......@@ -44,4 +44,13 @@ public interface GroupChatPlanOwnerLogMapper {
public List<GroupChatPlanOwnerLogDTO> listOwnerLogPageForWxa(GroupChatPlanSearchQDTO qdto);
public GroupChatPlanOwnerLogDTO getOwnerInfo(@Param("planId")Long planId, @Param("staffId")String staffId, @Param("clerkId")String clerkId, @Param("wxEnterpriseId")String wxEnterpriseId);
/**
* 查询社群群发待发送总数
* @param enterpriseId gic企业id
* @param clerkId 导购id
* @param storeId 门店id
* @return
*/
Integer getTotalCount(@Param("enterpriseId")String enterpriseId,@Param("clerkId")String clerkId,@Param("storeId")String storeId);
}
\ No newline at end of file
......@@ -35,4 +35,13 @@ public interface GroupChatPlanOwnerLogService {
public GroupChatPlanOwnerLogDTO getOwnerInfo(Long planId, String staffId, String clerkId, String wxEnterpriseId);
/**
* 查询社群群发待发送总数
* @param enterpriseId gic企业id
* @param clerkId 导购id
* @param storeId 门店id
* @return
*/
Integer getTotalCount(String enterpriseId,String clerkId,String storeId);
}
\ No newline at end of file
......@@ -255,4 +255,9 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
return dto;
}
@Override
public Integer getTotalCount(String enterpriseId, String clerkId, String storeId) {
return groupChatPlanOwnerLogMapper.getTotalCount(enterpriseId,clerkId,storeId);
}
}
\ No newline at end of file
......@@ -148,6 +148,11 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService {
}
@Override
public ServiceResponse<Integer> getTotalCount(String enterpriseId, String clerkId, String storeId) {
return ServiceResponse.success(groupChatPlanOwnerLogService.getTotalCount(enterpriseId,clerkId,storeId));
}
@Override
public ServiceResponse<Page<GroupChatPlanOwnerLogDTO>> listOwnerLogPageForWxa(GroupChatPlanSearchQDTO qdto,
BasePageInfo basePageInfo) {
Page<GroupChatPlanOwnerLogDTO> page = this.groupChatPlanOwnerLogService.listOwnerLogPageForWxa(qdto,
......
......@@ -229,6 +229,23 @@
where a.wx_enterprise_id = #{wxEnterpriseId} and a.plan_id = #{planId} and b.delete_flag = 0 and a.staff_id = #{staffId}
and a.clerk_id = #{clerkId}
</select>
<select id="getTotalCount" resultType="java.lang.Integer">
SELECT
count(*)
FROM
tab_haoban_group_chat_plan_owner_log
WHERE
enterprise_id = #{enterpriseId}
<if test="null != storeId">
AND store_id = #{storeId}
</if>
<if test="null != clerkId">
AND clerk_id = #{clerkId}
</if>
AND send_status = 1
</select>
......
......@@ -236,6 +236,16 @@
<artifactId>gic-member-source-api</artifactId>
<version>${gic-member-source-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-task-manage-api</artifactId>
<version>${haoban-task-manage-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-task-api</artifactId>
<version>${haoban-task-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -2,24 +2,30 @@ package com.gic.haoban.manage.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.web.qo.PageQo;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO;
import com.gic.haoban.manage.api.dto.notify.dto.PendingTaskDetailDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.PendingListQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageCategoryTypeEnum;
import com.gic.haoban.manage.api.enums.PendingTaskTypeEnum;
import com.gic.haoban.manage.api.service.chat.GroupChatPlanApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.api.service.notify.PendingTaskApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.CommonQO;
import com.gic.haoban.manage.web.qo.PendingListQO;
import com.gic.haoban.manage.web.qo.notify.MessageListQO;
import com.gic.haoban.manage.web.vo.MarketingCountVO;
import com.gic.haoban.manage.web.vo.notify.PairValVO;
import com.gic.haoban.task.api.service.TelTaskApiService;
import com.gic.haoban.task.manage.api.service.IMarketClueTaskApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -39,12 +45,23 @@ import java.util.Map;
@RestController
public class NotifyController extends WebBaseController {
private static final Logger logger = LoggerFactory.getLogger(NotifyController.class);
@Autowired
private PendingTaskApiService pendingTaskApiService;
@Autowired
private NoticeMessageApiService noticeMessageService;
@Autowired
private GroupChatPlanApiService groupChatPlanApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private IMarketClueTaskApiService iMarketClueTaskApiService;
@Autowired
private TelTaskApiService telTaskApiService;
/**
* 待办列表
*
......@@ -58,7 +75,7 @@ public class NotifyController extends WebBaseController {
if (qo.getFilterStatus() == 1) {
pendingListQDTO.setOverdueFlag(1);
}
if (qo.getShowSelf()==0) {
if (qo.getShowSelf() == 0) {
pendingListQDTO.setClerkId(null);
}
ServiceResponse<Page<PendingTaskDetailDTO>> retPage = pendingTaskApiService.pagePendingTask(pendingListQDTO, qo.getBasePageInfo());
......@@ -136,7 +153,7 @@ public class NotifyController extends WebBaseController {
@RequestMapping("/message/read")
public RestResponse readSingle(Long noticeMessageId) {
if (noticeMessageId == null) {
return RestResponse.failure(HaoBanErrCode.ERR_2.getCode()+"",HaoBanErrCode.ERR_2.getMsg());
return RestResponse.failure(HaoBanErrCode.ERR_2.getCode() + "", HaoBanErrCode.ERR_2.getMsg());
}
noticeMessageService.updateReadFlagById(noticeMessageId);
return RestResponse.successResult();
......@@ -183,5 +200,50 @@ public class NotifyController extends WebBaseController {
return RestResponse.successResult(ret.getResult());
}
/**
* 查询营销模块未完成任务数量
*
* @param qo
* @return
*/
@RequestMapping("/marketing/count")
public RestResponse marketingCount(@RequestBody @Valid CommonQO qo) {
String clerkId = qo.getClerkId();
String enterpriseId = qo.getEnterpriseId();
String storeId = qo.getStoreId();
MarketingCountVO marketingCountVO = new MarketingCountVO();
logger.info("查询是否店长:{}", clerkId);
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO != null) {
Integer groupChatCount, telTaskCount, groupMessageCount, total = 0;
Integer clerkType = clerkDTO.getClerkType();
if (clerkType == 1 || clerkType == 2) {
//店长维度
//社群群发
groupChatCount = groupChatPlanApiService.getTotalCount(enterpriseId, null, storeId).getResult();
//话务群发
telTaskCount = telTaskApiService.getTotalCount(enterpriseId, null, storeId).getResult();
//群发
groupMessageCount = iMarketClueTaskApiService.getTotalCount(enterpriseId, null, storeId).getResult();
total = groupChatCount + telTaskCount + groupMessageCount;
} else {
//导购维度
//社群群发
groupChatCount = groupChatPlanApiService.getTotalCount(enterpriseId, clerkId, storeId).getResult();
//话务群发
telTaskCount = telTaskApiService.getTotalCount(enterpriseId, clerkId, storeId).getResult();
//群发
groupMessageCount = iMarketClueTaskApiService.getTotalCount(enterpriseId, clerkId, storeId).getResult();
total = groupChatCount + telTaskCount + groupMessageCount;
}
marketingCountVO.setGroupChatCount(groupChatCount);
marketingCountVO.setGroupMessageCount(groupMessageCount);
marketingCountVO.setTelTaskCount(telTaskCount);
marketingCountVO.setTotal(total);
}
return RestResponse.successResult(marketingCountVO);
}
}
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
/**
* @description: 营销任务待发送数量VO
* @Author: wenhua
* @Date: 2023/5/15 16:36
*/
public class MarketingCountVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 社群群发待发送数量
*/
private Integer groupChatCount;
/**
* 群发待发送数量
*/
private Integer groupMessageCount;
/**
* 话务群发待发送数量
*/
private Integer telTaskCount;
/**
* 营销任务待发送总量
*/
private Integer total;
public Integer getGroupChatCount() {
return groupChatCount;
}
public void setGroupChatCount(Integer groupChatCount) {
this.groupChatCount = groupChatCount;
}
public Integer getGroupMessageCount() {
return groupMessageCount;
}
public void setGroupMessageCount(Integer groupMessageCount) {
this.groupMessageCount = groupMessageCount;
}
public Integer getTelTaskCount() {
return telTaskCount;
}
public void setTelTaskCount(Integer telTaskCount) {
this.telTaskCount = telTaskCount;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
}
......@@ -141,4 +141,7 @@
<dubbo:reference id="evaluateDataApiService" interface="com.gic.evaluate.manage.api.service.EvaluateDataApiService" timeout="100000" retries="0" check="false" />
<dubbo:reference interface="com.gic.membersource.api.service.MemberOutsideApiService" id="memberOutsideApiService" timeout="10000" retries="0" check="false" />
<dubbo:reference interface="com.gic.haoban.task.manage.api.service.IMarketClueTaskApiService" id="iMarketClueTaskApiService" timeout="10000" retries="0" check="false" />
<dubbo:reference interface="com.gic.haoban.task.api.service.TelTaskApiService" id="telTaskApiService" timeout="10000" retries="0" check="false" />
</beans>
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