Commit 3774969a by 浪涛飞

新增 社群运营 新客自动拉群 功能

1 parent 5e36081d
package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.wecom.domain.dto.WeCommunityNewGroupDto;
import com.linkwechat.wecom.service.IWeCommunityNewGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* 社群运营 新客自动拉群 Controller
*
* @author kewen
* @date 2021-02-19
*/
@Controller
@RequestMapping(value = "communityNewGroup")
public class WeCommunityNewGroupController {
@Autowired
private IWeCommunityNewGroupService weCommunityNewGroupService;
/**
* 新增员工活码
*/
@PreAuthorize("@ss.hasPermi('wecom:code:add')")
@Log(title = "员工活码", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody @Validated WeCommunityNewGroupDto communityNewGroupDto) {
try {
weCommunityNewGroupService.add(communityNewGroupDto);
return AjaxResult.success();
} catch (Exception e) {
e.printStackTrace();
if (e instanceof WeComException){
return AjaxResult.error(e.getMessage());
}else {
return AjaxResult.error("请求接口异常!");
}
}
}
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
@Data
public class WeCommunityNewGroup extends BaseEntity {
/**
*主键ID
*/
private Long newGroupId;
/**
*员工活码ID
*/
private Long empleCodeId;
/**
* 员工活码名称
*/
private Long empleCodeName;
/**
* 群活码ID
*/
private Long groupCodeId;
/**
* 0 未删除 1 已删除
*/
private int delFlag;
}
package com.linkwechat.wecom.domain.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import com.linkwechat.wecom.domain.WeEmpleCodeUseScop;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
@Data
public class WeCommunityNewGroupDto {
/**
* 活动场景
*/
private String activityScene;
/**
* 欢迎语
*/
private String welcomeMsg;
@NotEmpty(message = "员工信息不能为空")
/** 使用员工 */
@TableField(exist = false)
private List<WeEmpleCodeUseScop> weEmpleCodeUseScops;
/**
* 扫码标签
*/
@TableField(exist = false)
private List<WeEmpleCodeTag> weEmpleCodeTags;
/**
* 群活码ID
*/
private Long groupCodeId;
/**
* 客户添加时无需经过确认自动成为好友:1:是;0:否
*/
private Boolean isJoinConfirmFriends;
}
package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeCommunityNewGroup;
/**
* 社群运营 新客自动拉群 mapper接口
*
* @author kewen
* @date 2021-02-19
*/
public interface WeCommunityNewGroupMapper extends BaseMapper<WeCommunityNewGroup> {
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCommunityNewGroup;
import com.linkwechat.wecom.domain.dto.WeCommunityNewGroupDto;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
public interface IWeCommunityNewGroupService extends IService<WeCommunityNewGroup> {
/**
* 添加新客自动拉群信息
*
* @param communityNewGroupDto 信息
* @return 结果
*/
int add(WeCommunityNewGroupDto communityNewGroupDto);
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCommunityNewGroup;
import com.linkwechat.wecom.domain.dto.WeCommunityNewGroupDto;
import com.linkwechat.wecom.mapper.WeCommunityNewGroupMapper;
import com.linkwechat.wecom.service.IWeCommunityNewGroupService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
@Service
@Slf4j
public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGroupMapper, WeCommunityNewGroup> implements IWeCommunityNewGroupService {
@Override
public int add(WeCommunityNewGroupDto communityNewGroupDto) {
//检查群活码是否存在
//生成员工活码信息
//保存新客自动拉群信息
return 0;
}
}
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCommunityNewGroupMapper">
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!