|
|
|
|
@ -2,11 +2,14 @@ package com.flossom.system.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.flossom.common.core.domain.R;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxUserMember;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxUserRemark;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxUserIntegralVm;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxUserMemberVm;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxUserRemarkReq;
|
|
|
|
|
import com.flossom.common.core.enums.IntegralChangeTypeEnum;
|
|
|
|
|
import com.flossom.common.core.exception.ServiceException;
|
|
|
|
|
@ -17,6 +20,7 @@ import com.flossom.common.core.web.page.TableDataInfo;
|
|
|
|
|
import com.flossom.common.log.annotation.Log;
|
|
|
|
|
import com.flossom.common.log.enums.BusinessType;
|
|
|
|
|
import com.flossom.common.security.annotation.RequiresPermissions;
|
|
|
|
|
import com.flossom.system.service.IWxUserMemberService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@ -34,6 +38,9 @@ public class WxUserRemarkController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IWxUserRemarkService wxUserRemarkService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IWxUserMemberService wxUserMemberService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询微信用户备注列列表
|
|
|
|
|
*/
|
|
|
|
|
@ -101,7 +108,25 @@ public class WxUserRemarkController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/batchAddRemark")
|
|
|
|
|
public R batchAddRemark(@RequestBody @Validated WxUserRemarkReq wxUserRemarkReq) {
|
|
|
|
|
if(wxUserRemarkReq.getUserIdList() == null || wxUserRemarkReq.getUserIdList().size() == 0) {
|
|
|
|
|
return R.fail("请选择用户");
|
|
|
|
|
}
|
|
|
|
|
wxUserRemarkService.batchAddRemark(wxUserRemarkReq);
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 全量 添加备注
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/allAddRemark")
|
|
|
|
|
public R allAddRemark(@RequestBody @Validated WxUserRemarkReq wxUserRemarkReq, WxUserMemberVm wxUserMemberVm) {
|
|
|
|
|
wxUserRemarkService.batchAddRemark(wxUserRemarkReq);
|
|
|
|
|
List<WxUserMember> list = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
|
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
|
List<Long> collect = list.stream().map(wxUserMember -> wxUserMember.getId()).collect(Collectors.toList());
|
|
|
|
|
wxUserRemarkReq.setUserIdList(collect);
|
|
|
|
|
wxUserRemarkService.batchAddRemark(wxUserRemarkReq);
|
|
|
|
|
}
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|