Commit 6d23ca18 by 徐高华

通知画布

parent 3f6ad1ec
...@@ -85,4 +85,11 @@ public interface GroupChatPlanApiService { ...@@ -85,4 +85,11 @@ public interface GroupChatPlanApiService {
* @return * @return
*/ */
String getQwMsgId(String staffId , Date sendTime) ; String getQwMsgId(String staffId , Date sendTime) ;
/**
*
* @param params
*/
void noticeTimer(String params) ;
} }
...@@ -69,4 +69,10 @@ public interface GroupChatPlanOwnerLogMapper { ...@@ -69,4 +69,10 @@ public interface GroupChatPlanOwnerLogMapper {
void updateMsgid(@Param("planId")Long id , @Param("msgid")String msgid) ; void updateMsgid(@Param("planId")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);
int getTotalTask(@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 ) ;
} }
\ No newline at end of file
...@@ -42,4 +42,6 @@ public interface GroupChatPlanService { ...@@ -42,4 +42,6 @@ public interface GroupChatPlanService {
void stopByMsgid(Long planId); void stopByMsgid(Long planId);
String getQwMsgId(String staffId , Date sendTime, GroupMessageServiceImpl.GroupMsgChatType groupMsgChatType) ; String getQwMsgId(String staffId , Date sendTime, GroupMessageServiceImpl.GroupMsgChatType groupMsgChatType) ;
void noticeTimer(String params);
} }
\ No newline at end of file
...@@ -18,11 +18,15 @@ import com.gic.haoban.manage.api.dto.qdto.chat.OwnerSearchQDTO; ...@@ -18,11 +18,15 @@ import com.gic.haoban.manage.api.dto.qdto.chat.OwnerSearchQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.qdto.StaffSendResultQDTO; import com.gic.haoban.manage.api.qdto.StaffSendResultQDTO;
import com.gic.haoban.manage.api.service.HaobanCommonMQApiService; import com.gic.haoban.manage.api.service.HaobanCommonMQApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil; import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.chat.*; import com.gic.haoban.manage.service.dao.mapper.chat.*;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.content.impl.GroupMessageServiceImpl; import com.gic.haoban.manage.service.service.content.impl.GroupMessageServiceImpl;
import com.gic.haoban.manage.service.util.StreamUtils; import com.gic.haoban.manage.service.util.StreamUtils;
import com.gic.haoban.task.manage.api.service.QywxGroupSendCanvasApiService;
import com.gic.thirdparty.cloudfile.CloudFileUtil; import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum; import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum; import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
...@@ -125,6 +129,12 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -125,6 +129,12 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
private GroupChatMapper groupChatMapper ; private GroupChatMapper groupChatMapper ;
@Autowired @Autowired
private HaobanCommonMQApiService haobanCommonMQApiService ; private HaobanCommonMQApiService haobanCommonMQApiService ;
@Autowired
private QywxGroupSendCanvasApiService qywxGroupSendCanvasApiService ;
@Autowired
private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper;
@Autowired
private StaffClerkRelationService staffClerkRelationService ;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance(); private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
...@@ -878,4 +888,34 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -878,4 +888,34 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
} }
return resp.getResult().getGroupMessageInfos(); return resp.getResult().getGroupMessageInfos();
} }
@Override
public void noticeTimer(String params) {
// 生成数据
//获取所有的企业
List<String> enterpriseIdList = this.wxEnterpriseRelatedMapper.findAllEnterpriseId();
if (CollectionUtils.isEmpty(enterpriseIdList)) {
logger.info("任务自动刷新定时器触发, 企业id列表为空");
return;
}
for (String enterpriseId : enterpriseIdList) {
this.massTaskData(enterpriseId);
}
}
private void massTaskData(String enterpriseId) {
logger.info("生成社群数据={}",enterpriseId);
Date date = DateUtil.getEndTimeOfDay() ;
List<String> clerkIdList = this.staffClerkRelationService.listAllClerkIdsByEnterpriseId(enterpriseId) ;
if(CollectionUtils.isNotEmpty(clerkIdList)) {
for(String clerkId : clerkIdList) {
int total = this.groupChatPlanOwnerLogMapper.getTotalTask(enterpriseId,clerkId,date) ;
if(total>0) {
int invalid = this.groupChatPlanOwnerLogMapper.getInvalidTask(enterpriseId,clerkId,date) ;
int overdue = this.groupChatPlanOwnerLogMapper.getOverdueTask(enterpriseId,clerkId,date) ;
this.qywxGroupSendCanvasApiService.saveNoticeLog(enterpriseId,clerkId,total,overdue,invalid,"chat") ;
}
}
}
}
} }
\ No newline at end of file
...@@ -181,4 +181,9 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService { ...@@ -181,4 +181,9 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService {
public String getQwMsgId(String staffId, Date sendTime) { public String getQwMsgId(String staffId, Date sendTime) {
return this.groupChatPlanService.getQwMsgId(staffId,sendTime, GroupMessageServiceImpl.GroupMsgChatType.single); return this.groupChatPlanService.getQwMsgId(staffId,sendTime, GroupMessageServiceImpl.GroupMsgChatType.single);
} }
@Override
public void noticeTimer(String params) {
this.groupChatPlanService.noticeTimer(params) ;
}
} }
...@@ -252,5 +252,6 @@ ...@@ -252,5 +252,6 @@
<dubbo:reference id="memberCrowdApiService" interface="com.gic.member.ext.api.service.MemberCrowdApiService" timeout="10000" retries="0" check="false"/> <dubbo:reference id="memberCrowdApiService" interface="com.gic.member.ext.api.service.MemberCrowdApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference id="coupCardDistributionService" interface="com.gic.marketing.api.service.CoupCardDistributionService" timeout="30000" retries="0" check="false"/> <dubbo:reference id="coupCardDistributionService" interface="com.gic.marketing.api.service.CoupCardDistributionService" timeout="30000" retries="0" check="false"/>
<dubbo:reference id="enterpriseWxaLinkService" interface="com.gic.enterprise.api.service.EnterpriseWxaLinkService" timeout="30000" retries="0" check="false"/> <dubbo:reference id="enterpriseWxaLinkService" interface="com.gic.enterprise.api.service.EnterpriseWxaLinkService" timeout="30000" retries="0" check="false"/>
<dubbo:reference id="qywxGroupSendCanvasApiService" interface="com.gic.haoban.task.manage.api.service.QywxGroupSendCanvasApiService" timeout="10000" retries="0" check="false"/>
</beans> </beans>
\ No newline at end of file
...@@ -299,4 +299,26 @@ ...@@ -299,4 +299,26 @@
</select> </select>
<!-- 查询所有任务数-->
<select id="getTotalTask" resultType="int">
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 b.end_time <![CDATA[<=]]> now()
AND a.clerk_id = #{clerkId} AND a.send_status = 1 and a.delete_flag = 0
</select>
<!-- 查询逾期任务数-->
<select id="getInvalidTask" resultType="int">
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 b.end_time = #{time}
AND a.clerk_id = #{clerkId} AND a.send_status = 1 and a.delete_flag = 0
</select>
<!-- 查询失效任务数-->
<select id="getOverdueTask" resultType="int">
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 b.end_time = now()
AND a.clerk_id = #{clerkId} AND a.send_status = 1 and a.delete_flag = 0
</select>
</mapper> </mapper>
\ No newline at end of file
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