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 { ...@@ -27,6 +27,16 @@ public class ContentMaterialDTO implements Serializable {
private String link ; private String link ;
private String materialDesc;
public String getMaterialDesc() {
return materialDesc;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc;
}
public String getLink() { public String getLink() {
return link; return link;
} }
......
...@@ -92,4 +92,7 @@ public interface GroupChatPlanApiService { ...@@ -92,4 +92,7 @@ public interface GroupChatPlanApiService {
* @param params * @param params
*/ */
void noticeTimer(String params) ; void noticeTimer(String params) ;
Integer getTaskNum(String wxEnterpriseId, String enterpriseId, String storeId, String clerkId, String staffId);
} }
...@@ -66,7 +66,7 @@ public interface GroupChatPlanOwnerLogMapper { ...@@ -66,7 +66,7 @@ public interface GroupChatPlanOwnerLogMapper {
List<GroupChatPlanOwnerLogDTO> listForCancelSend() ; 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); 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 { ...@@ -75,4 +75,6 @@ public interface GroupChatPlanOwnerLogMapper {
int getInvalidTask(@Param("enterpriseId")String enterpriseId , @Param("clerkId")String clerkId , @Param("time")Date time ) ; 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 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 { ...@@ -44,4 +44,6 @@ public interface GroupChatPlanService {
String getQwMsgId(String staffId , Date sendTime, GroupMessageServiceImpl.GroupMsgChatType groupMsgChatType) ; String getQwMsgId(String staffId , Date sendTime, GroupMessageServiceImpl.GroupMsgChatType groupMsgChatType) ;
void noticeTimer(String params); 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 { ...@@ -523,6 +523,10 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
return; return;
} }
logger.info("开始群群发统计{}", ownerLog.getMsgid()); logger.info("开始群群发统计{}", ownerLog.getMsgid());
if(StringUtils.isBlank(ownerLog.getMsgid())) {
logger.info("msgid为空");
return ;
}
Long planId = ownerLog.getPlanId(); Long planId = ownerLog.getPlanId();
TabGroupChatPlan plan = this.groupChatPlanMapper.selectById(planId); TabGroupChatPlan plan = this.groupChatPlanMapper.selectById(planId);
if (null == plan) { if (null == plan) {
...@@ -741,6 +745,8 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -741,6 +745,8 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
String failRemark = qdto.getFailRemark() ; String failRemark = qdto.getFailRemark() ;
Date sendTime = qdto.getSendTime() ; Date sendTime = qdto.getSendTime() ;
this.groupChatPlanOwnerLogMapper.staffSendResult(staffId,planId,sendTime,failRemark) ; 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) { public void addOrDelTimer(Long planId, Date sendTime, int status) {
...@@ -836,6 +842,9 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -836,6 +842,9 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
private void updateMsgid(GroupChatPlanOwnerLogDTO dto) { private void updateMsgid(GroupChatPlanOwnerLogDTO dto) {
try{ try{
if(null == dto) {
return;
}
Long ownerLogId = dto.getOwnerLogId() ; Long ownerLogId = dto.getOwnerLogId() ;
String staffId = dto.getStaffId() ; String staffId = dto.getStaffId() ;
Date sendTime = dto.getSendTime() ; Date sendTime = dto.getSendTime() ;
...@@ -918,4 +927,14 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -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 { ...@@ -186,4 +186,9 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService {
public void noticeTimer(String params) { public void noticeTimer(String params) {
this.groupChatPlanService.noticeTimer(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 @@ ...@@ -103,7 +103,7 @@
</update> </update>
<update id="updateMsgid"> <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>
<update id="giveUp" parameterType="java.lang.Long"> <update id="giveUp" parameterType="java.lang.Long">
...@@ -160,6 +160,32 @@ ...@@ -160,6 +160,32 @@
order by a.create_time , a.owner_log_id order by a.create_time , a.owner_log_id
</select> </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 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.plan_id planId ,
...@@ -229,30 +255,6 @@ ...@@ -229,30 +255,6 @@
order by a.create_time desc , a.owner_log_id order by a.create_time desc , a.owner_log_id
</select> </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"> <select id="getTotalCount" resultType="java.lang.Integer">
SELECT SELECT
...@@ -320,5 +322,15 @@ ...@@ -320,5 +322,15 @@
where a.enterprise_id = #{enterpriseId} and b.end_time = now() 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 AND a.clerk_id = #{clerkId} AND a.send_status = 1 and a.delete_flag = 0
</select> </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> </mapper>
\ No newline at end of file
...@@ -15,10 +15,7 @@ import com.gic.haoban.manage.web.qo.GroupChatQO; ...@@ -15,10 +15,7 @@ import com.gic.haoban.manage.web.qo.GroupChatQO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -236,4 +233,19 @@ public class GroupChatPlanController { ...@@ -236,4 +233,19 @@ public class GroupChatPlanController {
return RestResponse.successResult(page.getResult()); 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