Commit 4ca7f9fd by guojx

Merge remote-tracking branch 'origin/feature-canvas' into feature-canvas

parents 3ee459cf 7085fbb6
......@@ -27,6 +27,16 @@ public class ContentMaterialDTO implements Serializable {
private String link ;
private String materialDesc;
public String getMaterialDesc() {
return materialDesc;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc;
}
public String getLink() {
return link;
}
......
......@@ -92,4 +92,7 @@ public interface GroupChatPlanApiService {
* @param params
*/
void noticeTimer(String params) ;
Integer getTaskNum(String wxEnterpriseId, String enterpriseId, String storeId, String clerkId, String staffId);
}
......@@ -66,7 +66,7 @@ public interface GroupChatPlanOwnerLogMapper {
List<GroupChatPlanOwnerLogDTO> listForCancelSend() ;
void updateMsgid(@Param("planId")Long id , @Param("msgid")String msgid) ;
void updateMsgid(@Param("id")Long id , @Param("msgid")String msgid) ;
void staffSendResult(@Param("staffId")String staffId, @Param("planId")Long planId, @Param("sendTime")Date sendTime, @Param("failRemark")String failRemark);
......@@ -75,4 +75,6 @@ public interface GroupChatPlanOwnerLogMapper {
int getInvalidTask(@Param("enterpriseId")String enterpriseId , @Param("clerkId")String clerkId , @Param("time")Date time ) ;
int getOverdueTask(@Param("enterpriseId")String enterpriseId , @Param("clerkId")String clerkId , @Param("time")Date time ) ;
int getTaskNum(@Param("enterpriseId")String enterpriseId, @Param("clerkId")String clerkId, @Param("storeId")String storeId, @Param("staffId")String staffId);
}
\ No newline at end of file
......@@ -44,4 +44,6 @@ public interface GroupChatPlanService {
String getQwMsgId(String staffId , Date sendTime, GroupMessageServiceImpl.GroupMsgChatType groupMsgChatType) ;
void noticeTimer(String params);
Integer getTaskNum(String wxEnterpriseId, String enterpriseId, String storeId, String clerkId, String staffId);
}
\ No newline at end of file
......@@ -523,6 +523,10 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
return;
}
logger.info("开始群群发统计{}", ownerLog.getMsgid());
if(StringUtils.isBlank(ownerLog.getMsgid())) {
logger.info("msgid为空");
return ;
}
Long planId = ownerLog.getPlanId();
TabGroupChatPlan plan = this.groupChatPlanMapper.selectById(planId);
if (null == plan) {
......@@ -741,6 +745,8 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
String failRemark = qdto.getFailRemark() ;
Date sendTime = qdto.getSendTime() ;
this.groupChatPlanOwnerLogMapper.staffSendResult(staffId,planId,sendTime,failRemark) ;
GroupChatPlanOwnerLogDTO dto = this.groupChatPlanOwnerLogService.getOwnerInfo(planId,staffId,null,wxEnterpriseId) ;
this.updateMsgid(dto);
}
public void addOrDelTimer(Long planId, Date sendTime, int status) {
......@@ -836,6 +842,9 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
private void updateMsgid(GroupChatPlanOwnerLogDTO dto) {
try{
if(null == dto) {
return;
}
Long ownerLogId = dto.getOwnerLogId() ;
String staffId = dto.getStaffId() ;
Date sendTime = dto.getSendTime() ;
......@@ -918,4 +927,14 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
}
}
}
@Override
public Integer getTaskNum(String wxEnterpriseId, String enterpriseId, String storeId, String clerkId, String staffId) {
ClerkDTO clerkDTO = this.clerkService.getclerkById(clerkId) ;
if(clerkDTO.getClerkType()==1) {
clerkId = null ;
}
int total = this.groupChatPlanOwnerLogMapper.getTaskNum(enterpriseId,clerkId,storeId,staffId) ;
return total;
}
}
\ No newline at end of file
......@@ -186,4 +186,9 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService {
public void noticeTimer(String params) {
this.groupChatPlanService.noticeTimer(params) ;
}
@Override
public Integer getTaskNum(String wxEnterpriseId, String enterpriseId, String storeId, String clerkId, String staffId) {
return this.groupChatPlanService.getTaskNum(wxEnterpriseId,enterpriseId,storeId,clerkId,staffId);
}
}
......@@ -103,7 +103,7 @@
</update>
<update id="updateMsgid">
update tab_haoban_group_chat_plan_owner_log set msg_id=#{msgid} where owner_log_id = #{id}
update tab_haoban_group_chat_plan_owner_log set msgid=#{msgid} where owner_log_id = #{id}
</update>
<update id="giveUp" parameterType="java.lang.Long">
......@@ -159,21 +159,47 @@
</if>
order by a.create_time , a.owner_log_id
</select>
<select id="getOwnerInfo" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO">
select
a.owner_log_id ownerLogId ,
b.plan_id planId ,
b.name planName ,
b.exec_type execType ,
a.staff_id staffId ,
a.clerk_id clerkId ,
a.store_id storeId ,
a.send_status sendStatus ,
a.send_count sendCount ,
a.fail_count failCount ,
a.send_time sendTime ,
a.create_time createTime ,
b.end_time expireDate ,
b.end_time endTime ,
b.start_time startTime ,
a.done_flag doneFlag ,
a.msgid msgid
from tab_haoban_group_chat_plan_owner_log a left join tab_haoban_group_chat_plan b on a.plan_id = b.plan_id
where a.wx_enterprise_id = #{wxEnterpriseId} and a.plan_id = #{planId} and b.delete_flag = 0 and a.staff_id = #{staffId}
<if test="null != clerkId">
and a.clerk_id = #{clerkId}
</if>
</select>
<select id="listOwnerLogPageForWxaTotal" parameterType="com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO" resultType="com.gic.haoban.manage.api.dto.chat.ChatOwnerTotalDTO">
select
select
b.plan_id planId ,
b.name planName ,
b.start_time startTime ,
b.start_time startTime ,
b.end_time endTime ,
b.exec_type execType ,
<!-- 已发送 -->
SUM(CASE a.send_status WHEN 2 THEN 1 ELSE 0 END ) sendCount,
<!-- 待发送 -->
SUM(CASE a.send_status WHEN 1 THEN 1 ELSE 0 END ) notSendCount
from tab_haoban_group_chat_plan_owner_log a left join tab_haoban_group_chat_plan b on a.plan_id = b.plan_id
where
SUM(CASE a.send_status WHEN 1 THEN 1 ELSE 0 END ) notSendCount
from tab_haoban_group_chat_plan_owner_log a left join tab_haoban_group_chat_plan b on a.plan_id = b.plan_id
where
a.wx_enterprise_id = #{wxEnterpriseId} and b.delete_flag = 0
<if test="null != storeId">
and a.store_id = #{storeId}
......@@ -196,17 +222,17 @@
group by b.plan_id
order by b.end_time desc , a.create_time desc
</select>
<select id="listOwnerLogPageForWxa" parameterType="com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO">
select
select
a.owner_log_id ownerLogId ,
b.plan_id planId ,
b.plan_id planId ,
b.name planName ,
a.staff_id staffId ,
a.staff_id staffId ,
a.clerk_id clerkId ,
a.store_id storeId ,
a.send_status sendStatus ,
a.send_count sendCount ,
a.send_count sendCount ,
a.fail_count failCount ,
a.send_time sendTime ,
a.create_time createTime ,
......@@ -214,8 +240,8 @@
b.end_time endTime ,
b.start_time startTime ,
a.done_flag doneFlag ,
a.msgid msgid
from tab_haoban_group_chat_plan_owner_log a left join tab_haoban_group_chat_plan b on a.plan_id = b.plan_id
a.msgid msgid
from tab_haoban_group_chat_plan_owner_log a left join tab_haoban_group_chat_plan b on a.plan_id = b.plan_id
where a.wx_enterprise_id = #{wxEnterpriseId} and a.plan_id = #{planId} and b.delete_flag = 0
<if test="null != storeId">
and a.store_id = #{storeId}
......@@ -228,30 +254,6 @@
</if>
order by a.create_time desc , a.owner_log_id
</select>
<select id="getOwnerInfo" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO">
select
a.owner_log_id ownerLogId ,
b.plan_id planId ,
b.name planName ,
b.exec_type execType ,
a.staff_id staffId ,
a.clerk_id clerkId ,
a.store_id storeId ,
a.send_status sendStatus ,
a.send_count sendCount ,
a.fail_count failCount ,
a.send_time sendTime ,
a.create_time createTime ,
b.end_time expireDate ,
b.end_time endTime ,
b.start_time startTime ,
a.done_flag doneFlag ,
a.msgid msgid
from tab_haoban_group_chat_plan_owner_log a left join tab_haoban_group_chat_plan b on a.plan_id = b.plan_id
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">
......@@ -320,5 +322,15 @@
where a.enterprise_id = #{enterpriseId} and b.end_time = now()
AND a.clerk_id = #{clerkId} AND a.send_status = 1 and a.delete_flag = 0
</select>
<select id="getTaskNum" resultType="java.lang.Integer">
select count(1) from tab_haoban_group_chat_plan_owner_log a LEFT JOIN tab_haoban_group_chat_plan b ON a.plan_id = b.plan_id
where a.enterprise_id = #{enterpriseId}
and a.store_id = #{storeId}
<if test="null != clerkId">
AND a.clerk_id = #{clerkId}
</if>
and b.end_time <![CDATA[<=]]> now()
AND a.send_status = 1 and a.delete_flag = 0
</select>
</mapper>
\ No newline at end of file
......@@ -15,10 +15,7 @@ import com.gic.haoban.manage.web.qo.GroupChatQO;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -236,4 +233,19 @@ public class GroupChatPlanController {
return RestResponse.successResult(page.getResult());
}
/**
* 获取社群群发任务数
* @param wxEnterpriseId
* @param enterpriseId
* @param storeId
* @param clerkId
* @return
*/
@RequestMapping("get-task-num")
@ResponseBody
public RestResponse<Integer> getTaskNum(String wxEnterpriseId , String enterpriseId , String storeId , String clerkId , String staffId) {
return RestResponse.successResult(this.groupChatPlanApiService.getTaskNum(wxEnterpriseId,enterpriseId,storeId,clerkId,staffId)) ;
}
}
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