| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | |
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.ImageToBase64;
|
| | | import com.yeshi.fanli.util.ImageUtil;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | if (robotId == null)
|
| | | throw new UserCloudException(1, "云发单机器人不存在");
|
| | |
|
| | | List<WeiXinGroupDTO> list = AitaokerApiUtil.getContract(robotId);
|
| | | List<String> list = AitaokerApiUtil.getContract(12793);
|
| | | if (list == null || list.size() == 0)
|
| | | throw new UserCloudException(1, "未检索到对应群");
|
| | |
|
| | | String wxId = userCloud.getWxId();
|
| | | for (WeiXinGroupDTO dto : list) {
|
| | | String groupId = dto.getGroupId();
|
| | | // 检测是否匹配群
|
| | | String key = RedisKeyEnum.cloudMatchGroup.getKey() + StringUtil.Md5(wxId + "_" + groupId);
|
| | | for (String roomId : list) {
|
| | | String key = RedisKeyEnum.cloudMatchGroup.getKey() + StringUtil.Md5(wxId + "_" + roomId);
|
| | | String result = redisManager.getCommonString(key);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | userCloudGroupService.addGroup(uid, dto.getGroupId(), dto.getGroupName(), userCloud.getGroupNum());
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | String groupName = null;
|
| | | WeiXinGroupDTO groupDetail = AitaokerApiUtil.getGroupDetail(12793, roomId);
|
| | | if (groupDetail != null) {
|
| | | groupName = groupDetail.getGroupName();
|
| | | }
|
| | | userCloudGroupService.addGroup(uid, roomId, groupName, userCloud.getGroupNum());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | throw new UserCloudException(1, "该内容包含可转链口令或链接");
|
| | |
|
| | |
|
| | | String qrCode = null;
|
| | | ImgInfo imgVideo = null;
|
| | | List<String> listImg = new ArrayList<>();
|
| | |
|
| | |
| | | sendContent.setType(UserCloudSendContent.TYPE_CIRCLE);
|
| | |
|
| | | if (imgVideo == null) {
|
| | | // 发送图文
|
| | | String picUrl = "";
|
| | | if (!StringUtil.isNullOrEmpty(qrCode))
|
| | | picUrl += qrCode;
|
| | | |
| | | if (listImg.size() > 0) {
|
| | | for (String img: listImg) {
|
| | | picUrl += img + ";" ;
|
| | | picUrl += TbImgUtil.getTBSize220Img(img) + ";" ;
|
| | | }
|
| | | if (picUrl.endsWith(";")) |
| | | picUrl = picUrl.substring(0, picUrl.length()-1);
|
| | | }
|
| | | |
| | | if (picUrl.endsWith(";")) |
| | | picUrl = picUrl.substring(0, picUrl.length()-1);
|
| | | sendContent.setTitle(title);
|
| | | sendContent.setPicUrl(picUrl);
|
| | | // 发送图文
|
| | | circleId = AitaokerApiUtil.macsendCircle(robotId, title, picUrl);
|
| | | } else {
|
| | | // 发送视频
|
| | | sendContent.setPicUrl(imgVideo.getUrl());
|
| | | sendContent.setVideoUrl(imgVideo.getVideoUrl());
|
| | | // 发送视频
|
| | | circleId = AitaokerApiUtil.macsendCircleVideo(robotId, imgVideo.getVideoUrl(), imgVideo.getUrl());
|
| | | }
|
| | |
|
| | |
| | | String picUrl = "";
|
| | | if (listImg.size() > 0) {
|
| | | for (String img: listImg) {
|
| | | picUrl += img + ";" ;
|
| | | picUrl += TbImgUtil.getTBSize220Img(img) + ";" ;
|
| | | }
|
| | | }
|
| | |
|
| | | if (picUrl.endsWith(";"))
|
| | | picUrl = picUrl.substring(0, picUrl.length()-1);
|
| | | |
| | | sendContent.setTitle(title);
|
| | | sendContent.setPicUrl(picUrl);
|
| | | |
| | | // 发圈内容
|
| | | String circleId = AitaokerApiUtil.macsendCircle(robotId, title, picUrl);
|
| | | // 评论文本
|