Commit 7afaeca0 by 徐高华

群发

parent 2b3ee035
package com.gic.haoban.manage.web.controller.chat;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
......@@ -50,8 +51,8 @@ public class GroupChatController {
@Autowired
private GroupChatApiService groupChatApiService;
@Autowired
private StaffApiService staffApiService ;
private StaffApiService staffApiService;
@RequestMapping("get-set-gic-flag")
public RestResponse<Object> getFlag() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
......@@ -81,25 +82,25 @@ public class GroupChatController {
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String enterpriseId = loginUser.getEnterpriseId();
this.groupChatApiService.updateChatEnterpriseId(wxEnterpriseId, enterpriseId, groupChatIdList);
String logContent = "认领【"+this.getChatNames(wxEnterpriseId, groupChatIdList)+"】";
String logContent = "认领【" + this.getChatNames(wxEnterpriseId, groupChatIdList) + "】";
GicLogRecordEvaluationContext.putAttribute("logValue", logContent);
GicLogRecordEvaluationContext.putOptTargetId(AuthWebRequestUtil.getLoginUser().getClerkId());
return RestResponse.successResult();
}
private String getChatNames(String wxEnterpriseId, List<Long> groupChatIdList) {
ServiceResponse<List<GroupChatDTO>> chatResp = this.groupChatApiService.listChatByIdList(wxEnterpriseId, groupChatIdList);
List<GroupChatDTO> chatList = chatResp.getResult() ;
StringBuilder content = new StringBuilder() ;
for(GroupChatDTO item : chatList) {
content.append(item.getGroupChatId()).append("-").append(item.getName()).append(",") ;
ServiceResponse<List<GroupChatDTO>> chatResp = this.groupChatApiService.listChatByIdList(wxEnterpriseId,
groupChatIdList);
List<GroupChatDTO> chatList = chatResp.getResult();
StringBuilder content = new StringBuilder();
for (GroupChatDTO item : chatList) {
content.append(item.getGroupChatId()).append("-").append(item.getName()).append(",");
}
return content.toString() ;
return content.toString();
}
@RequestMapping("page")
public RestResponse<Object> page(GroupChatSearchQDTO qdto, BasePageInfo basePageInfo) {
public RestResponse<Object> page(@RequestBody GroupChatSearchQDTO qdto, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String sortColumn = qdto.getSortColumn();
if (StringUtils.isBlank(sortColumn)) {
......@@ -135,7 +136,7 @@ public class GroupChatController {
@RequestMapping("detail")
public RestResponse<Object> detail(Long groupChatId) {
if(null == groupChatId) {
if (null == groupChatId) {
return RestResponse.failure("1", "群ID空");
}
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
......@@ -158,7 +159,7 @@ public class GroupChatController {
@RequestMapping("owner-history")
public RestResponse<Object> ownerHistory(Long groupChatId) {
if(null == groupChatId) {
if (null == groupChatId) {
return RestResponse.failure("1", "群ID空");
}
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
......@@ -170,18 +171,25 @@ public class GroupChatController {
@RequestMapping("transfer")
@GicLogRecord(value = "${#logValue}", category = GicLogRecordCategoryEnum.HUOMA, optType = GicLogRecordOptTypeEnum.HM_LINK_ADD, userFunc = LogRecordUserServiceImpl.class, optPage = "客户群列表")
public RestResponse<Object> transfer(String staffId, List<Long> groupChatIdList) {
if(StringUtils.isEmpty(staffId)) {
public RestResponse<Object> transfer(String staffId, String groupChatIdList) {
if (StringUtils.isEmpty(staffId)) {
return RestResponse.failure("1", "请选择继承的群主");
}
if(CollectionUtils.isEmpty(groupChatIdList)) {
if (StringUtils.isEmpty(groupChatIdList)) {
return RestResponse.failure("1", "请选择继承的群");
}
String[] arr = groupChatIdList.split(",");
List<Long> idList = new ArrayList<>();
for (int i = 0; i < arr.length; i++) {
if (StringUtils.isNotBlank(arr[i])) {
idList.add(Long.valueOf(arr[i]));
}
}
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
ServiceResponse<Void> resp = this.groupChatApiService.transfer(wxEnterpriseId, staffId, groupChatIdList);
StaffDTO staff = this.staffApiService.selectById(staffId) ;
String logContent = "将【"+this.getChatNames(wxEnterpriseId, groupChatIdList)+"】分配给【"+staff.getStaffName()+"】继承";
ServiceResponse<Void> resp = this.groupChatApiService.transfer(wxEnterpriseId, staffId, idList);
StaffDTO staff = this.staffApiService.selectById(staffId);
String logContent = "将【" + this.getChatNames(wxEnterpriseId, idList) + "】分配给【" + staff.getStaffName() + "】继承";
GicLogRecordEvaluationContext.putAttribute("logValue", logContent);
GicLogRecordEvaluationContext.putOptTargetId(AuthWebRequestUtil.getLoginUser().getClerkId());
return RestResponse.successResult(resp.getResult());
......
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller.chat;
import java.util.List;
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.RestController;
......@@ -34,7 +35,7 @@ public class GroupChatDataController {
private GroupChatDataApiService groupChatDataApiService;
@RequestMapping("total")
public RestResponse<Object> listTotalData(ChatDataSearchQDTO qdto) {
public RestResponse<Object> listTotalData(@RequestBody ChatDataSearchQDTO qdto) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
qdto.setWxEnterpriseId(wxEnterpriseId);
......@@ -44,7 +45,7 @@ public class GroupChatDataController {
}
@RequestMapping("list-chat")
public RestResponse<Object> listForChat(ChatDataSearchQDTO qdto) {
public RestResponse<Object> listForChat(@RequestBody ChatDataSearchQDTO qdto) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
qdto.setWxEnterpriseId(wxEnterpriseId);
......@@ -54,7 +55,7 @@ public class GroupChatDataController {
}
@RequestMapping("list-staff")
public RestResponse<Object> listStaffData(ChatDataSearchQDTO qdto, BasePageInfo basePageInfo) {
public RestResponse<Object> listStaffData(@RequestBody ChatDataSearchQDTO qdto, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
qdto.setWxEnterpriseId(wxEnterpriseId);
......
......@@ -235,7 +235,7 @@ public class GroupChatHmController {
@SuppressWarnings("deprecation")
@RequestMapping("download")
public RestResponse<Object> download(ChatHmSearchQDTO qdto, @RequestParam(defaultValue = "0") int allFlag) {
public RestResponse<Object> download(@RequestBody ChatHmSearchQDTO qdto, @RequestParam(defaultValue = "0") int allFlag) {
if (allFlag == 0 && CollectionUtils.isEmpty(qdto.getChatHmIdList())) {
return RestResponse.failure("1", "请选择要下载的群活码");
}
......
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