Commit 6db279ef by 徐高华

Merge branch 'feature/社群' into 'developer'

sql

See merge request !536
parents 1b5eba68 35d5fcc2
package com.gic.haoban.manage.service.service.chat;
import java.util.Date;
import java.util.List;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
......@@ -18,5 +19,7 @@ public interface GroupChatPlanOwnerLogService {
public Page<GroupChatPlanOwnerLogDTO> listPage(Long planId, GroupChatPlanSearchQDTO qdto,
BasePageInfo basePageInfo);
List<TabGroupChatPlanOwnerLog> listForTimer() ;
}
\ No newline at end of file
......@@ -133,5 +133,10 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
}
this.groupChatPlanOwnerLogMapper.insert(log);
}
@Override
public List<TabGroupChatPlanOwnerLog> listForTimer() {
return null;
}
}
\ No newline at end of file
......@@ -153,51 +153,55 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
@Override
public void doPlanSendInfoTimer(String params) {
Long owner_log_id = 472092751301763073L;
TabGroupChatPlanOwnerLog ownerLog = this.groupChatPlanOwnerLogService.getById(owner_log_id);
String wxEnterpriseId = ownerLog.getWxEnterpriseId();
String enterpriseId = ownerLog.getEnterpriseId();
String msgid = ownerLog.getMsgid();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (qwDTO != null) {
}
List<TabGroupChatPlanOwnerLog> logList = this.groupChatPlanOwnerLogService.listForTimer() ;
for(TabGroupChatPlanOwnerLog log : logList) {
Long ownerLogId = log.getOwnerLogId();
TabGroupChatPlanOwnerLog ownerLog = this.groupChatPlanOwnerLogService.getById(ownerLogId);
String wxEnterpriseId = ownerLog.getWxEnterpriseId();
String enterpriseId = ownerLog.getEnterpriseId();
String msgid = ownerLog.getMsgid();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (qwDTO != null) {
}
String staffId = ownerLog.getStaffId();
String staffId = ownerLog.getStaffId();
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId);
String userid = staff.getWxUserId();
if (qwDTO.needOpenUserId3th()) {
userid = staff.getWxOpenUseId();
}
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId);
String userid = staff.getWxUserId();
if (qwDTO.needOpenUserId3th()) {
userid = staff.getWxOpenUseId();
}
JSONResponse respon = qywxSuiteApiService.resultExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(),
msgid, null, userid);
logger.info(JSON.toJSONString(respon));
if (respon.getErrorCode() == 0) {
List<QywxSendMessageResultDTO> list = (List<QywxSendMessageResultDTO>) respon.getList();
if (CollectionUtils.isNotEmpty(list)) {
int sendCount = list.size();
this.groupChatPlanOwnerLogService.updateSendCount(ownerLog.getOwnerLogId(), sendCount,
list.get(0).getSendTime());
for (QywxSendMessageResultDTO item : list) {
String wxChatId3th = item.getChatId();
Date sendTime = item.getSendTime();
TabGroupChatPlanLog entity = new TabGroupChatPlanLog();
entity.setLogId(UniqueIdUtils.uniqueLong());
entity.setPlanId(ownerLog.getPlanId());
entity.setOwnLogId(ownerLog.getOwnerLogId());
entity.setWxEnterpriseId(wxEnterpriseId);
entity.setEnterpriseId(enterpriseId);
entity.setWxChatId3th(wxChatId3th);
GroupChatBO chat = this.groupChatService.getByWxChatId3th(wxEnterpriseId, wxChatId3th);
if (null != chat) {
entity.setGroupChatId(chat.getGroupChatId());
JSONResponse respon = qywxSuiteApiService.resultExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(),
msgid, null, userid);
logger.info(JSON.toJSONString(respon));
if (respon.getErrorCode() == 0) {
List<QywxSendMessageResultDTO> list = (List<QywxSendMessageResultDTO>) respon.getList();
if (CollectionUtils.isNotEmpty(list)) {
int sendCount = list.size();
this.groupChatPlanOwnerLogService.updateSendCount(ownerLog.getOwnerLogId(), sendCount,
list.get(0).getSendTime());
for (QywxSendMessageResultDTO item : list) {
String wxChatId3th = item.getChatId();
Date sendTime = item.getSendTime();
TabGroupChatPlanLog entity = new TabGroupChatPlanLog();
entity.setLogId(UniqueIdUtils.uniqueLong());
entity.setPlanId(ownerLog.getPlanId());
entity.setOwnLogId(ownerLog.getOwnerLogId());
entity.setWxEnterpriseId(wxEnterpriseId);
entity.setEnterpriseId(enterpriseId);
entity.setWxChatId3th(wxChatId3th);
entity.setStaffId(staffId);
GroupChatBO chat = this.groupChatService.getByWxChatId3th(wxEnterpriseId, wxChatId3th);
if (null != chat) {
entity.setGroupChatId(chat.getGroupChatId());
}
entity.setSendTime(sendTime);
entity.setSendStatus(1);
this.groupChatPlanLogMapper.insert(entity);
}
entity.setSendTime(sendTime);
entity.setSendStatus(1);
this.groupChatPlanLogMapper.insert(entity);
}
}
}
}
}
......
......@@ -80,6 +80,6 @@
LEFT JOIN tab_haoban_group_chat_plan_owner_log b ON a.`own_log_id` = b.`owner_log_id`
LEFT JOIN tab_haoban_staff c ON a.`staff_id` = c.`staff_id`
LEFT JOIN tab_haoban_group_chat d ON a.group_chat_id = d.group_chat_id
where a.wx_enterprise_id = #{wxEnterpriseId} and plan_id = #{planId}
where a.wx_enterprise_id = #{wxEnterpriseId} and a.plan_id = #{planId}
</select>
</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