Commit 0c2ac03b by 1539136324@qq.com

修改新客自动拉群接口BUG

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