Commit 1791eeb0 by 徐高华

parent 2addd96a
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.chat.GroupChatDTO; import com.gic.haoban.manage.api.dto.chat.GroupChatDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatOwnerDTO; import com.gic.haoban.manage.api.dto.chat.GroupChatOwnerDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatOwnerHistoryDTO; import com.gic.haoban.manage.api.dto.chat.GroupChatOwnerHistoryDTO;
...@@ -105,7 +106,7 @@ public interface GroupChatService { ...@@ -105,7 +106,7 @@ public interface GroupChatService {
* @return * @return
* @throws * @throws
*/ */
public void transfer(String wxEnterpriseId, String staffId, List<Long> groupChatIdList); public ServiceResponse<Void> transfer(String wxEnterpriseId, String staffId, List<Long> groupChatIdList);
/** /**
* *
......
...@@ -693,7 +693,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -693,7 +693,7 @@ public class GroupChatServiceImpl implements GroupChatService {
// 匹配群成员-客户 // 匹配群成员-客户
private void matchGicMember(String wxEnterpriseId, String enterpriseId, String unionid, String externalUserId, private void matchGicMember(String wxEnterpriseId, String enterpriseId, String unionid, String externalUserId,
TabGroupChatUser user) { TabGroupChatUser user) {
logger.info("入群匹配群客户,unionid={},exteruserid={}",unionid,externalUserId); logger.info("入群匹配群客户,unionid={},exteruserid={}", unionid, externalUserId);
if (StringUtils.isBlank(enterpriseId)) { if (StringUtils.isBlank(enterpriseId)) {
return; return;
} }
...@@ -849,11 +849,11 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -849,11 +849,11 @@ public class GroupChatServiceImpl implements GroupChatService {
} }
@Override @Override
public void transfer(String wxEnterpriseId, String staffId, List<Long> groupChatIdList) { public ServiceResponse<Void> transfer(String wxEnterpriseId, String staffId, List<Long> groupChatIdList) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (null == qwDTO) { if (null == qwDTO) {
logger.info("wxEnterpriseId不存在,id={}", wxEnterpriseId); logger.info("wxEnterpriseId不存在,id={}", wxEnterpriseId);
return; return ServiceResponse.failure("9999", "企业不存在");
} }
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId); TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId);
String userid = staff.getWxUserId(); String userid = staff.getWxUserId();
...@@ -865,6 +865,14 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -865,6 +865,14 @@ public class GroupChatServiceImpl implements GroupChatService {
ServiceResponse<List<FailChatListDTO>> resp = this.qywxChatApiService.transfer(qwDTO.getThirdCorpid(), ServiceResponse<List<FailChatListDTO>> resp = this.qywxChatApiService.transfer(qwDTO.getThirdCorpid(),
config.getWxSuiteid(), wxChatIdList, userid); config.getWxSuiteid(), wxChatIdList, userid);
logger.info("群继承={}", JSON.toJSONString(resp)); logger.info("群继承={}", JSON.toJSONString(resp));
if (!resp.isSuccess()) {
return ServiceResponse.failure("9999", resp.getMessage());
} else {
if (CollectionUtils.isNotEmpty(resp.getResult())) {
return ServiceResponse.failure("9999", JSON.toJSONString(resp.getResult()));
}
}
return ServiceResponse.success();
} }
// 如果群的人数达到上限,则群GIC侧的下线,记录状态,且从活码中剔除 // 如果群的人数达到上限,则群GIC侧的下线,记录状态,且从活码中剔除
......
...@@ -205,8 +205,7 @@ public class GroupChatApiServiceImpl implements GroupChatApiService { ...@@ -205,8 +205,7 @@ public class GroupChatApiServiceImpl implements GroupChatApiService {
@Override @Override
public ServiceResponse<Void> transfer(String wxEnterpriseId, String staffId, List<Long> groupChatIdList) { public ServiceResponse<Void> transfer(String wxEnterpriseId, String staffId, List<Long> groupChatIdList) {
this.groupChatService.transfer(wxEnterpriseId, staffId, groupChatIdList); return this.groupChatService.transfer(wxEnterpriseId, staffId, groupChatIdList);
return ServiceResponse.success();
} }
@Override @Override
......
...@@ -191,6 +191,10 @@ public class GroupChatController { ...@@ -191,6 +191,10 @@ public class GroupChatController {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId(); String wxEnterpriseId = loginUser.getWxEnterpriseId();
ServiceResponse<Void> resp = this.groupChatApiService.transfer(wxEnterpriseId, staffId, idList); ServiceResponse<Void> resp = this.groupChatApiService.transfer(wxEnterpriseId, staffId, idList);
if(!resp.isSuccess()) {
GicLogRecordEvaluationContext.noWriteLog();
return RestResponse.failure("9999", resp.getMessage());
}
StaffDTO staff = this.staffApiService.selectById(staffId); StaffDTO staff = this.staffApiService.selectById(staffId);
String logContent = "将【" + this.getChatNames(wxEnterpriseId, idList) + "】分配给【" + staff.getStaffName() + "】继承"; String logContent = "将【" + this.getChatNames(wxEnterpriseId, idList) + "】分配给【" + staff.getStaffName() + "】继承";
GicLogRecordEvaluationContext.putAttribute("logValue", logContent); GicLogRecordEvaluationContext.putAttribute("logValue", logContent);
......
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