Commit 0c2ac03b by 1539136324@qq.com

修改新客自动拉群接口BUG

1 parent 5b43c84e
......@@ -19,7 +19,6 @@ public interface WeAppClient {
@Request(url = "/agent/list")
WeAppDto findAgentList();
/**
* 根据应用id获取应用详情
* @param agentid
......@@ -28,7 +27,6 @@ public interface WeAppClient {
@Request(url = "/agent/get")
WeAppDetailDto findAgentById(@Query("agentid") Integer agentid);
/**
* 设置应用
* @param weAppDetailDto
......@@ -36,6 +34,4 @@ public interface WeAppClient {
*/
@Request(url = "/agent/set")
WeResultDto updateAgentById(@DataObject WeAppDetailDto weAppDetailDto);
}
package com.linkwechat.wecom.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import io.swagger.annotations.ApiModel;
......@@ -14,11 +16,13 @@ import lombok.Data;
*/
@ApiModel
@Data
@TableName("we_community_new_group")
public class WeCommunityNewGroup extends BaseEntity {
/**
*主键ID
*/
@TableId
private Long newGroupId= SnowFlakeUtil.nextId();
/**
......
......@@ -26,12 +26,6 @@ public class WeAppDetailDto extends WeResultDto{
private Integer isreportenter;
//应用主页url
private String home_url;
//企业应用头像的mediaid,通过素材管理接口上传图片获得mediaid,上传后会自动裁剪成方形和圆形两个头像
private String logo_mediaid;
}
......@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import com.linkwechat.wecom.domain.WeEmpleCodeUseScop;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
......@@ -17,63 +14,59 @@ import java.util.List;
* @author kewen
* @date 2021-02-19
*/
@ApiModel
@Data
public class WeCommunityNewGroupDto {
/**
* 主键
*/
private String newGroupId;
/**
* 活动场景
*/
@ApiModelProperty("活动场景")
private String activityScene;
/**
* 欢迎语
*/
@ApiModelProperty("欢迎语")
private String welcomeMsg;
@NotNull(message = "员工信息不能为空")
/** 使用员工 */
@TableField(exist = false)
@ApiModelProperty("使用员工")
private List<WeEmpleCodeUseScop> weEmpleCodeUseScops;
/**
* 扫码标签
*/
@TableField(exist = false)
@ApiModelProperty("扫码标签")
private List<WeEmpleCodeTag> weEmpleCodeTags;
/**
* 群活码ID
*/
@ApiModelProperty("群活码ID")
private Long groupCodeId;
/**
* 客户添加时无需经过确认自动成为好友:1:是;0:否
*/
@ApiModelProperty("客户添加时无需经过确认自动成为好友:1:是;0:否")
private Boolean isJoinConfirmFriends;
/**
* 新增联系方式的配置id
*/
@ApiModelProperty("新增联系方式的配置id")
private String configId;
/**
* 二维码链接
*/
@ApiModelProperty("二维码链接")
private String qrCode;
/**
* 素材的id
*/
@ApiModelProperty("素材的id")
private Long mediaId;
}
......@@ -20,6 +20,7 @@ import com.linkwechat.wecom.service.IWeGroupCodeActualService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
......@@ -58,6 +59,7 @@ public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGr
private IWeGroupCodeActualService weGroupCodeActualService;
@Override
@Transactional(rollbackFor = Exception.class)
public int add(WeCommunityNewGroupDto communityNewGroupDto) {
//检查群活码是否存在
......@@ -71,6 +73,7 @@ public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGr
WeExternalContactDto.WeContactWay weContactWay = weEmpleCodeService.getWeContactWay(weEmpleCode);
WeExternalContactDto qrCode = weEmpleCodeService.getQrCode(weContactWay);
//保存新客自动拉群信息
WeCommunityNewGroup communityNewGroup = new WeCommunityNewGroup();
communityNewGroup.setGroupCodeId(weGroupCode.getId());
......@@ -166,6 +169,7 @@ public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGr
}
@Override
@Transactional(rollbackFor = Exception.class)
public int updateWeCommunityNewGroup(WeCommunityNewGroupDto communityNewGroupDto) {
//检查群活码是否存在
......@@ -173,11 +177,10 @@ public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGr
if (null == weGroupCode) {
throw new WeComException("群活码不存在!");
}
//查询新客自动拉群信息
WeCommunityNewGroup communityNewGroup = weCommunityNewGroupMapper.selectOne(new LambdaQueryWrapper<WeCommunityNewGroup>()
.eq(WeCommunityNewGroup::getGroupCodeId, communityNewGroupDto.getGroupCodeId()));
// WeCommunityNewGroup communityNewGroup = weCommunityNewGroupMapper.selectById(communityNewGroupDto.getGroupCodeId());
// WeCommunityNewGroup communityNewGroup = weCommunityNewGroupMapper.selectOne(new LambdaQueryWrapper<WeCommunityNewGroup>()
// .eq(WeCommunityNewGroup::getGroupCodeId, communityNewGroupDto.getGroupCodeId()));
WeCommunityNewGroup communityNewGroup = weCommunityNewGroupMapper.selectById(communityNewGroupDto.getNewGroupId());
if (null == communityNewGroup) {
throw new WeComException("信息不存在!");
}
......@@ -192,7 +195,6 @@ public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGr
} catch (Exception e) {
e.printStackTrace();
}
communityNewGroup.setEmpleCodeName(communityNewGroupDto.getActivityScene());
communityNewGroup.setDelFlag(0);
communityNewGroup.setCreateTime(new Date());
......@@ -207,11 +209,11 @@ public class WeCommunityNewGroupServiceImpl extends ServiceImpl<WeCommunityNewGr
if (this.updateById(communityNewGroup)) {
if (CollectionUtil.isNotEmpty(weEmpleCode.getWeEmpleCodeUseScops())) {
weEmpleCode.getWeEmpleCodeUseScops().forEach(item -> item.setEmpleCodeId(communityNewGroup.getNewGroupId()));
iWeEmpleCodeUseScopService.updateBatchById(weEmpleCode.getWeEmpleCodeUseScops());
iWeEmpleCodeUseScopService.saveOrUpdateBatch(weEmpleCode.getWeEmpleCodeUseScops());
}
if (CollectionUtil.isNotEmpty(weEmpleCode.getWeEmpleCodeTags())) {
weEmpleCode.getWeEmpleCodeTags().forEach(item -> item.setEmpleCodeId(communityNewGroup.getNewGroupId()));
weEmpleCodeTagService.updateBatchById(weEmpleCode.getWeEmpleCodeTags());
weEmpleCodeTagService.saveOrUpdateBatch(weEmpleCode.getWeEmpleCodeTags());
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!