mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 07:11:52 +08:00
mp:调整 tag 模块的整体结构
This commit is contained in:
parent
d6de233a47
commit
acee075260
@ -1,91 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO;
|
||||
import cn.iocoder.yudao.module.mp.convert.accountfanstag.WxAccountFansTagConvert;
|
||||
import cn.iocoder.yudao.module.mp.service.accountfanstag.WxAccountFansTagService;
|
||||
|
||||
@Api(tags = "管理后台 - 粉丝标签关联")
|
||||
@RestController
|
||||
@RequestMapping("/wechatMp/wx-account-fans-tag")
|
||||
@Validated
|
||||
public class WxAccountFansTagController {
|
||||
|
||||
@Resource
|
||||
private WxAccountFansTagService wxAccountFansTagService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建粉丝标签关联")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:create')")
|
||||
public CommonResult<Integer> createWxAccountFansTag(@Valid @RequestBody WxAccountFansTagCreateReqVO createReqVO) {
|
||||
return success(wxAccountFansTagService.createWxAccountFansTag(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新粉丝标签关联")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:update')")
|
||||
public CommonResult<Boolean> updateWxAccountFansTag(@Valid @RequestBody WxAccountFansTagUpdateReqVO updateReqVO) {
|
||||
wxAccountFansTagService.updateWxAccountFansTag(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除粉丝标签关联")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:delete')")
|
||||
public CommonResult<Boolean> deleteWxAccountFansTag(@RequestParam("id") Integer id) {
|
||||
wxAccountFansTagService.deleteWxAccountFansTag(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得粉丝标签关联")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')")
|
||||
public CommonResult<WxAccountFansTagRespVO> getWxAccountFansTag(@RequestParam("id") Integer id) {
|
||||
WxAccountFansTagDO wxAccountFansTag = wxAccountFansTagService.getWxAccountFansTag(id);
|
||||
return success(WxAccountFansTagConvert.INSTANCE.convert(wxAccountFansTag));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得粉丝标签关联列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')")
|
||||
public CommonResult<List<WxAccountFansTagRespVO>> getWxAccountFansTagList(@RequestParam("ids") Collection<Integer> ids) {
|
||||
List<WxAccountFansTagDO> list = wxAccountFansTagService.getWxAccountFansTagList(ids);
|
||||
return success(WxAccountFansTagConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得粉丝标签关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')")
|
||||
public CommonResult<PageResult<WxAccountFansTagRespVO>> getWxAccountFansTagPage(@Valid WxAccountFansTagPageReqVO pageVO) {
|
||||
PageResult<WxAccountFansTagDO> pageResult = wxAccountFansTagService.getWxAccountFansTagPage(pageVO);
|
||||
return success(WxAccountFansTagConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* 粉丝标签关联 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class WxAccountFansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "用户标识")
|
||||
private String openid;
|
||||
|
||||
@ApiModelProperty(value = "标签ID")
|
||||
private String tagId;
|
||||
|
||||
@ApiModelProperty(value = "微信账号ID")
|
||||
private String wxAccountId;
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 粉丝标签关联创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WxAccountFansTagCreateReqVO extends WxAccountFansTagBaseVO {
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 粉丝标签关联 Excel VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class WxAccountFansTagExcelVO {
|
||||
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@ExcelProperty("用户标识")
|
||||
private String openid;
|
||||
|
||||
@ExcelProperty("标签ID")
|
||||
private String tagId;
|
||||
|
||||
@ExcelProperty("微信账号ID")
|
||||
private String wxAccountId;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 粉丝标签关联 Excel 导出 Request VO", description = "参数和 WxAccountFansTagPageReqVO 是一致的")
|
||||
@Data
|
||||
public class WxAccountFansTagExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "用户标识")
|
||||
private String openid;
|
||||
|
||||
@ApiModelProperty(value = "标签ID")
|
||||
private String tagId;
|
||||
|
||||
@ApiModelProperty(value = "微信账号ID")
|
||||
private String wxAccountId;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始创建时间")
|
||||
private Date beginCreateTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束创建时间")
|
||||
private Date endCreateTime;
|
||||
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 粉丝标签关联分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WxAccountFansTagPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "用户标识")
|
||||
private String openid;
|
||||
|
||||
@ApiModelProperty(value = "标签ID")
|
||||
private String tagId;
|
||||
|
||||
@ApiModelProperty(value = "微信账号ID")
|
||||
private String wxAccountId;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始创建时间")
|
||||
private Date beginCreateTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束创建时间")
|
||||
private Date endCreateTime;
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 粉丝标签关联 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WxAccountFansTagRespVO extends WxAccountFansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 粉丝标签关联更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WxAccountFansTagUpdateReqVO extends WxAccountFansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Integer id;
|
||||
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert;
|
||||
import cn.iocoder.yudao.module.mp.service.tag.FansTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.mp.bean.tag.WxUserTag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@Api(tags = "管理后台 - 粉丝标签")
|
||||
@RestController
|
||||
@RequestMapping("/wechatMp/fans-tag")
|
||||
@Validated
|
||||
public class FansTagController {
|
||||
|
||||
@Resource
|
||||
private FansTagService fansTagService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建粉丝标签")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:create')")
|
||||
public CommonResult<WxUserTag> createWxFansTag(@Valid @RequestBody FansTagCreateReqVO createReqVO) throws WxErrorException {
|
||||
return success(fansTagService.createWxFansTag(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新粉丝标签")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:update')")
|
||||
public CommonResult<Boolean> updateWxFansTag(@Valid @RequestBody FansTagUpdateReqVO updateReqVO) throws WxErrorException {
|
||||
return success(fansTagService.updateWxFansTag(updateReqVO));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除粉丝标签")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:delete')")
|
||||
public CommonResult<Boolean> deleteWxFansTag(@RequestParam("id") Long id,
|
||||
@RequestParam("appId") String appId) throws WxErrorException {
|
||||
return success(fansTagService.deleteWxFansTag(id, appId));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获取公众号已创建的标签")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')")
|
||||
public CommonResult<List<FansTagRespVO>> getWxFansTagList(@NotEmpty(message = "公众号appId不能为空")
|
||||
@RequestParam("appId") String appId) throws WxErrorException {
|
||||
List<WxUserTag> list = fansTagService.getWxFansTagList(appId);
|
||||
return success(WxFansTagConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获取公众号已创建的标签")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')")
|
||||
public CommonResult<PageResult<FansTagRespVO>> page() throws WxErrorException {
|
||||
PageResult<WxUserTag> page = new PageResult<>();
|
||||
return success(WxFansTagConvert.INSTANCE.convertPage(page));
|
||||
}
|
||||
|
||||
@GetMapping("/tagListUser")
|
||||
@ApiOperation("获取标签下粉丝列表")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')")
|
||||
public CommonResult<String> tagListUser(@Valid FansTagPageReqVO pageVO) {
|
||||
return success("");
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出粉丝标签 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportWxFansTagExcel(@Valid FansTagExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<WxUserTag> list = fansTagService.getWxFansTagList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<FansTagExcelVO> datas = WxFansTagConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "粉丝标签.xls", "数据", FansTagExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Data
|
||||
public class FansTagBaseVO {
|
||||
|
||||
@NotBlank(message = "标签名不能为空")
|
||||
@ApiModelProperty(value = "标签名,UTF8编码")
|
||||
private String name;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 粉丝标签创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagCreateReqVO extends FansTagBaseVO {
|
||||
@NotBlank(message = "公众号appId不能为空")
|
||||
@ApiModelProperty("微信公众号appId")
|
||||
private String appId;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Excel VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class FansTagExcelVO {
|
||||
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@ExcelProperty("标签名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("粉丝数量")
|
||||
private Integer count;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 粉丝标签 Excel 导出 Request VO", description = "参数和 WxFansTagPageReqVO 是一致的")
|
||||
@Data
|
||||
public class FansTagExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "粉丝数量")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty(value = "微信账号ID")
|
||||
private String wxAccountId;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "开始创建时间")
|
||||
private Date beginCreateTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@ApiModelProperty(value = "结束创建时间")
|
||||
private Date endCreateTime;
|
||||
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 粉丝标签分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagPageReqVO extends PageParam {
|
||||
|
||||
@NotEmpty(message = "公众号appId不能为空")
|
||||
@ApiModelProperty("微信公众号appId")
|
||||
private String appId;
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 粉丝标签 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagRespVO extends FansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "标签id,由微信分配.")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 粉丝标签更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagUpdateReqVO extends FansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "标签id,由微信分配", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "公众号appId不能为空")
|
||||
@ApiModelProperty("微信公众号appId")
|
||||
private String appId;
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.tag;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagRespVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.convert.tag.MpTagConvert;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO;
|
||||
import cn.iocoder.yudao.module.mp.service.tag.MpTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 公众号标签")
|
||||
@RestController
|
||||
@RequestMapping("/mp/tag")
|
||||
@Validated
|
||||
public class MpTagController {
|
||||
|
||||
@Resource
|
||||
private MpTagService mpTagService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建公众号标签")
|
||||
@PreAuthorize("@ss.hasPermission('mp:tag:create')")
|
||||
public CommonResult<Long> createTag(@Valid @RequestBody MpTagCreateReqVO createReqVO) {
|
||||
return success(mpTagService.createTag(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新公众号标签")
|
||||
@PreAuthorize("@ss.hasPermission('mp:tag:update')")
|
||||
public CommonResult<Boolean> updateTag(@Valid @RequestBody MpTagUpdateReqVO updateReqVO) {
|
||||
mpTagService.updateTag(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除公众号标签")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('mp:tag:delete')")
|
||||
public CommonResult<Boolean> deleteTag(@RequestParam("id") Long id) {
|
||||
mpTagService.deleteTag(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获取公众号标签分页")
|
||||
@PreAuthorize("@ss.hasPermission('mp:tag:query')")
|
||||
public CommonResult<PageResult<MpTagRespVO>> getTagPage(MpTagPageReqVO pageReqVO) {
|
||||
PageResult<MpTagDO> pageResult = mpTagService.getTagPage(pageReqVO);
|
||||
return success(MpTagConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.tag.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* 公众号标签 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Data
|
||||
public class MpTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "标签名", required = true, example = "土豆")
|
||||
@NotEmpty(message = "标签名不能为空")
|
||||
private String name;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.tag.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 公众号标签创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpTagCreateReqVO extends MpTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048")
|
||||
@NotNull(message = "公众号账号的编号不能为空")
|
||||
private Long accountId;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.tag.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("管理后台 - 公众号标签分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpTagPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048")
|
||||
@NotEmpty(message = "公众号账号的编号不能为空")
|
||||
private Long accountId;
|
||||
|
||||
@ApiModelProperty(value = "标签名", example = "哈哈", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.tag.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("管理后台 - 公众号标签 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpTagRespVO extends MpTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true)
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.tag.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 公众号标签更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpTagUpdateReqVO extends MpTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true)
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.convert.accountfanstag;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO;
|
||||
|
||||
/**
|
||||
* 粉丝标签关联 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface WxAccountFansTagConvert {
|
||||
|
||||
WxAccountFansTagConvert INSTANCE = Mappers.getMapper(WxAccountFansTagConvert.class);
|
||||
|
||||
WxAccountFansTagDO convert(WxAccountFansTagCreateReqVO bean);
|
||||
|
||||
WxAccountFansTagDO convert(WxAccountFansTagUpdateReqVO bean);
|
||||
|
||||
WxAccountFansTagRespVO convert(WxAccountFansTagDO bean);
|
||||
|
||||
List<WxAccountFansTagRespVO> convertList(List<WxAccountFansTagDO> list);
|
||||
|
||||
PageResult<WxAccountFansTagRespVO> convertPage(PageResult<WxAccountFansTagDO> page);
|
||||
|
||||
List<WxAccountFansTagExcelVO> convertList02(List<WxAccountFansTagDO> list);
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.convert.fanstag;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import me.chanjar.weixin.mp.bean.tag.WxUserTag;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Convert
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Mapper
|
||||
public interface WxFansTagConvert {
|
||||
|
||||
WxFansTagConvert INSTANCE = Mappers.getMapper(WxFansTagConvert.class);
|
||||
|
||||
WxUserTag convert(FansTagCreateReqVO bean);
|
||||
|
||||
WxUserTag convert(FansTagUpdateReqVO bean);
|
||||
|
||||
FansTagRespVO convert(WxUserTag bean);
|
||||
|
||||
List<FansTagRespVO> convertList(List<WxUserTag> list);
|
||||
|
||||
PageResult<FansTagRespVO> convertPage(PageResult<WxUserTag> page);
|
||||
|
||||
List<FansTagExcelVO> convertList02(List<WxUserTag> list);
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.mp.convert.tag;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagRespVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO;
|
||||
import me.chanjar.weixin.mp.bean.tag.WxUserTag;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MpTagConvert {
|
||||
|
||||
MpTagConvert INSTANCE = Mappers.getMapper(MpTagConvert.class);
|
||||
|
||||
WxUserTag convert(MpTagCreateReqVO bean);
|
||||
|
||||
WxUserTag convert(MpTagUpdateReqVO bean);
|
||||
|
||||
MpTagRespVO convert(WxUserTag bean);
|
||||
|
||||
List<MpTagRespVO> convertList(List<WxUserTag> list);
|
||||
|
||||
PageResult<MpTagRespVO> convertPage(PageResult<MpTagDO> page);
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 粉丝标签关联 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("wx_account_fans_tag")
|
||||
@KeySequence("wx_account_fans_tag_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WxAccountFansTagDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
private String openid;
|
||||
/**
|
||||
* 标签ID
|
||||
*/
|
||||
private String tagId;
|
||||
/**
|
||||
* 微信账号ID
|
||||
*/
|
||||
private String wxAccountId;
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.mp.dal.dataobject.tag;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO;
|
||||
import lombok.*;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 公众号标签 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("mp_tag")
|
||||
@KeySequence("mp_tag_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MpTagDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private Long id;
|
||||
/**
|
||||
* 公众号标签 id
|
||||
*/
|
||||
private Long tagId;
|
||||
/**
|
||||
* 标签名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 微信公众号 ID
|
||||
*
|
||||
* 关联 {@link MpAccountDO#getId()}
|
||||
*/
|
||||
private Long accountId;
|
||||
/**
|
||||
* 微信公众号 appid
|
||||
*
|
||||
* 冗余 {@link MpAccountDO#getAppId()}
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.dal.mysql.accountfanstag;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*;
|
||||
|
||||
/**
|
||||
* 粉丝标签关联 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface WxAccountFansTagMapper extends BaseMapperX<WxAccountFansTagDO> {
|
||||
|
||||
default PageResult<WxAccountFansTagDO> selectPage(WxAccountFansTagPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountFansTagDO>()
|
||||
.eqIfPresent(WxAccountFansTagDO::getOpenid, reqVO.getOpenid())
|
||||
.eqIfPresent(WxAccountFansTagDO::getTagId, reqVO.getTagId())
|
||||
.eqIfPresent(WxAccountFansTagDO::getWxAccountId, reqVO.getWxAccountId())
|
||||
.betweenIfPresent(WxAccountFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc(WxAccountFansTagDO::getId));
|
||||
}
|
||||
|
||||
default List<WxAccountFansTagDO> selectList(WxAccountFansTagExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<WxAccountFansTagDO>()
|
||||
.eqIfPresent(WxAccountFansTagDO::getOpenid, reqVO.getOpenid())
|
||||
.eqIfPresent(WxAccountFansTagDO::getTagId, reqVO.getTagId())
|
||||
.eqIfPresent(WxAccountFansTagDO::getWxAccountId, reqVO.getWxAccountId())
|
||||
.betweenIfPresent(WxAccountFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc(WxAccountFansTagDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.mp.dal.mysql.tag;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface MpTagMapper extends BaseMapperX<MpTagDO> {
|
||||
|
||||
default PageResult<MpTagDO> selectPage(MpTagPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MpTagDO>()
|
||||
.eqIfPresent(MpTagDO::getAccountId, reqVO.getAccountId())
|
||||
.likeIfPresent(MpTagDO::getName, reqVO.getName())
|
||||
.orderByDesc(MpTagDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.service.accountfanstag;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpUser;
|
||||
|
||||
/**
|
||||
* 粉丝标签关联 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface WxAccountFansTagService {
|
||||
|
||||
/**
|
||||
* 创建粉丝标签关联
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createWxAccountFansTag(@Valid WxAccountFansTagCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新粉丝标签关联
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateWxAccountFansTag(@Valid WxAccountFansTagUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除粉丝标签关联
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteWxAccountFansTag(Integer id);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签关联
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 粉丝标签关联
|
||||
*/
|
||||
WxAccountFansTagDO getWxAccountFansTag(Integer id);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签关联列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 粉丝标签关联列表
|
||||
*/
|
||||
List<WxAccountFansTagDO> getWxAccountFansTagList(Collection<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签关联分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 粉丝标签关联分页
|
||||
*/
|
||||
PageResult<WxAccountFansTagDO> getWxAccountFansTagPage(WxAccountFansTagPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签关联列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 粉丝标签关联列表
|
||||
*/
|
||||
List<WxAccountFansTagDO> getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO);
|
||||
|
||||
void processFansTags(MpAccountDO wxAccount, WxMpUser wxmpUser);
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.service.accountfanstag;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpUser;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.convert.accountfanstag.WxAccountFansTagConvert;
|
||||
import cn.iocoder.yudao.module.mp.dal.mysql.accountfanstag.WxAccountFansTagMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 粉丝标签关联 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class WxAccountFansTagServiceImpl implements WxAccountFansTagService {
|
||||
|
||||
@Resource
|
||||
private WxAccountFansTagMapper wxAccountFansTagMapper;
|
||||
|
||||
@Override
|
||||
public Integer createWxAccountFansTag(WxAccountFansTagCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
WxAccountFansTagDO wxAccountFansTag = WxAccountFansTagConvert.INSTANCE.convert(createReqVO);
|
||||
wxAccountFansTagMapper.insert(wxAccountFansTag);
|
||||
// 返回
|
||||
return wxAccountFansTag.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWxAccountFansTag(WxAccountFansTagUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
this.validateWxAccountFansTagExists(updateReqVO.getId());
|
||||
// 更新
|
||||
WxAccountFansTagDO updateObj = WxAccountFansTagConvert.INSTANCE.convert(updateReqVO);
|
||||
wxAccountFansTagMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWxAccountFansTag(Integer id) {
|
||||
// 校验存在
|
||||
this.validateWxAccountFansTagExists(id);
|
||||
// 删除
|
||||
wxAccountFansTagMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateWxAccountFansTagExists(Integer id) {
|
||||
if (wxAccountFansTagMapper.selectById(id) == null) {
|
||||
throw exception(COMMON_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxAccountFansTagDO getWxAccountFansTag(Integer id) {
|
||||
return wxAccountFansTagMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxAccountFansTagDO> getWxAccountFansTagList(Collection<Integer> ids) {
|
||||
return wxAccountFansTagMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WxAccountFansTagDO> getWxAccountFansTagPage(WxAccountFansTagPageReqVO pageReqVO) {
|
||||
return wxAccountFansTagMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxAccountFansTagDO> getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO) {
|
||||
return wxAccountFansTagMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processFansTags(MpAccountDO wxAccountDO, WxMpUser wxmpUser) {
|
||||
WxAccountFansTagExportReqVO wxAccountFansTagTpl = new WxAccountFansTagExportReqVO();
|
||||
wxAccountFansTagTpl.setOpenid(wxmpUser.getOpenId());
|
||||
List<WxAccountFansTagDO> wxAccountFansTagList = this.getWxAccountFansTagList(wxAccountFansTagTpl);
|
||||
wxAccountFansTagList.forEach(temp -> this.deleteWxAccountFansTag(temp.getId()));
|
||||
|
||||
Long[] tagIds = wxmpUser.getTagIds();
|
||||
for (Long tagId : tagIds) {
|
||||
WxAccountFansTagCreateReqVO wxAccountFansTag = new WxAccountFansTagCreateReqVO();
|
||||
wxAccountFansTag.setOpenid(wxmpUser.getOpenId());
|
||||
wxAccountFansTag.setTagId(String.valueOf(tagId));
|
||||
wxAccountFansTag.setWxAccountId(String.valueOf(wxAccountDO.getId()));
|
||||
this.createWxAccountFansTag(wxAccountFansTag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.service.tag;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagCreateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagExportReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagPageReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagUpdateReqVO;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.mp.bean.tag.WxUserTag;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Service 接口
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
public interface FansTagService {
|
||||
|
||||
/**
|
||||
* 创建粉丝标签
|
||||
*
|
||||
* @param createReqVO 创建标签信息
|
||||
* @return {@link WxUserTag} 用户标签对象
|
||||
* @throws WxErrorException 微信异常
|
||||
*/
|
||||
WxUserTag createWxFansTag(FansTagCreateReqVO createReqVO) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 更新粉丝标签
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
* @return {@link Boolean}
|
||||
* @throws WxErrorException 微信异常
|
||||
*/
|
||||
Boolean updateWxFansTag(@Valid FansTagUpdateReqVO updateReqVO) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 删除粉丝标签
|
||||
*
|
||||
* @param id 编号
|
||||
* @param appId 公众号appId
|
||||
* @return {@link Boolean}
|
||||
* @throws WxErrorException 微信异常
|
||||
*/
|
||||
Boolean deleteWxFansTag(Long id, String appId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取公众号已创建的标签
|
||||
*
|
||||
* @param appId 公众号appId
|
||||
* @return 粉丝标签列表
|
||||
* @throws WxErrorException 微信异常
|
||||
*/
|
||||
List<WxUserTag> getWxFansTagList(String appId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获得粉丝标签分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 粉丝标签分页
|
||||
*/
|
||||
PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 粉丝标签列表
|
||||
*/
|
||||
List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mp.service.tag;
|
||||
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagCreateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagExportReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagPageReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagUpdateReqVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.bean.tag.WxUserTag;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Service 实现类
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Validated
|
||||
public class FansTagServiceImpl implements FansTagService {
|
||||
@Resource
|
||||
private WxMpService wxMpService;
|
||||
|
||||
@Override
|
||||
public WxUserTag createWxFansTag(FansTagCreateReqVO createReqVO) throws WxErrorException {
|
||||
// TODO 切换公众号操作 调整为 aop 或者 过滤器\拦截器 处理
|
||||
wxMpService.switchover(createReqVO.getAppId());
|
||||
return wxMpService.getUserTagService().tagCreate(createReqVO.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateWxFansTag(FansTagUpdateReqVO updateReqVO) throws WxErrorException {
|
||||
wxMpService.switchover(updateReqVO.getAppId());
|
||||
return wxMpService.getUserTagService().tagUpdate(updateReqVO.getId(), updateReqVO.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWxFansTag(Long id, String appId) throws WxErrorException {
|
||||
wxMpService.switchover(appId);
|
||||
return wxMpService.getUserTagService().tagDelete(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<WxUserTag> getWxFansTagList(String appId) throws WxErrorException {
|
||||
wxMpService.switchover(appId);
|
||||
return wxMpService.getUserTagService().tagGet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.mp.service.tag;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 公众号标签 Service 接口
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
public interface MpTagService {
|
||||
|
||||
/**
|
||||
* 创建公众号标签
|
||||
*
|
||||
* @param createReqVO 创建标签信息
|
||||
* @return 标签编号
|
||||
*/
|
||||
Long createTag(@Valid MpTagCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新公众号标签
|
||||
*
|
||||
* @param updateReqVO 更新标签信息
|
||||
*/
|
||||
void updateTag(@Valid MpTagUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除公众号标签
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteTag(Long id);
|
||||
|
||||
/**
|
||||
* 获得公众号标签分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 公众号标签分页
|
||||
*/
|
||||
PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.mp.service.tag;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO;
|
||||
import cn.iocoder.yudao.module.mp.dal.mysql.tag.MpTagMapper;
|
||||
import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 公众号标签 Service 实现类
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Validated
|
||||
public class MpTagServiceImpl implements MpTagService {
|
||||
|
||||
@Resource
|
||||
private MpTagMapper mpTagMapper;
|
||||
|
||||
@Resource
|
||||
@Lazy // 延迟加载,为了解决延迟加载
|
||||
private MpServiceFactory mpServiceFactory;
|
||||
|
||||
@Override
|
||||
public Long createTag(MpTagCreateReqVO createReqVO) {
|
||||
// return wxMpService.getUserTagService().tagCreate(createReqVO.getName());
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTag(MpTagUpdateReqVO updateReqVO) {
|
||||
// return wxMpService.getUserTagService().tagUpdate(updateReqVO.getId(), updateReqVO.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTag(Long id) {
|
||||
// return wxMpService.getUserTagService().tagDelete(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -1,245 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户标识" prop="openid">
|
||||
<el-input v-model="queryParams.openid" placeholder="请输入用户标识" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签ID" prop="tagId">
|
||||
<el-input v-model="queryParams.tagId" placeholder="请输入标签ID" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信账号ID" prop="wxAccountId">
|
||||
<el-input v-model="queryParams.wxAccountId" placeholder="请输入微信账号ID" clearable
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
|
||||
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['wechatMp:wx-account-fans-tag:create']">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['wechatMp:wx-account-fans-tag:export']">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="主键" align="center" prop="id"/>
|
||||
<el-table-column label="用户标识" align="center" prop="openid"/>
|
||||
<el-table-column label="标签ID" align="center" prop="tagId"/>
|
||||
<el-table-column label="微信账号ID" align="center" prop="wxAccountId"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wechatMp:wx-account-fans-tag:update']">修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wechatMp:wx-account-fans-tag:delete']">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户标识" prop="openid">
|
||||
<el-input v-model="form.openid" placeholder="请输入用户标识"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签ID" prop="tagId">
|
||||
<el-input v-model="form.tagId" placeholder="请输入标签ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信账号ID" prop="wxAccountId">
|
||||
<el-input v-model="form.wxAccountId" placeholder="请输入微信账号ID"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
createWxAccountFansTag,
|
||||
updateWxAccountFansTag,
|
||||
deleteWxAccountFansTag,
|
||||
getWxAccountFansTag,
|
||||
getWxAccountFansTagPage,
|
||||
exportWxAccountFansTagExcel
|
||||
} from "@/api/wechatMp/wxAccountFansTag";
|
||||
|
||||
export default {
|
||||
name: "WxAccountFansTag",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 粉丝标签关联列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
dateRangeCreateTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
openid: null,
|
||||
tagId: null,
|
||||
wxAccountId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||
// 执行查询
|
||||
getWxAccountFansTagPage(params).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
openid: undefined,
|
||||
tagId: undefined,
|
||||
wxAccountId: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRangeCreateTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加粉丝标签关联";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getWxAccountFansTag(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改粉丝标签关联";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateWxAccountFansTag(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createWxAccountFansTag(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除粉丝标签关联编号为"' + id + '"的数据项?').then(function () {
|
||||
return deleteWxAccountFansTag(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||
// 执行导出
|
||||
this.$modal.confirm('是否确认导出所有粉丝标签关联数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportWxAccountFansTagExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '粉丝标签关联.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user