提交 59fa2c47 编写于 作者: Y YaoYuHang

Merge remote-tracking branch 'origin/back_end_dev' into back_end_dev

......@@ -8,6 +8,7 @@ import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.enums.MediaType;
import com.linkwechat.wecom.domain.WeMaterial;
import com.linkwechat.wecom.domain.dto.ResetCategoryDto;
import com.linkwechat.wecom.domain.dto.TemporaryMaterialDto;
import com.linkwechat.wecom.domain.dto.WeMediaDto;
import com.linkwechat.wecom.domain.vo.WeMaterialFileVO;
import com.linkwechat.wecom.service.IWeMaterialService;
......@@ -135,10 +136,12 @@ public class WeMaterialController extends BaseController {
//@PreAuthorize("@ss.hasPermi('wechat:material:temporaryMaterialMediaId')")
@Log(title = "获取素材media_id", businessType = BusinessType.OTHER)
@GetMapping("/temporaryMaterialMediaId")
@PostMapping("/temporaryMaterialMediaId")
@ApiOperation("获取素材media_id")
public AjaxResult temporaryMaterialMediaId(@RequestParam(value = "url") String url, @RequestParam(value = "type") String type,@RequestParam(value = "name") String name){
WeMediaDto weMediaDto = materialService.uploadTemporaryMaterial(url, type,name);
public AjaxResult temporaryMaterialMediaId(@RequestBody TemporaryMaterialDto temporaryMaterialDto){
WeMediaDto weMediaDto = materialService.uploadTemporaryMaterial(temporaryMaterialDto.getUrl(),
temporaryMaterialDto.getType()
,temporaryMaterialDto.getName());
return AjaxResult.success(weMediaDto);
}
......
......@@ -10,26 +10,26 @@ import lombok.Data;
@Data
public class ConversationArchiveQuery extends BaseEntity {
/** 发送人Id */
private String fromId;
private String fromId="";
/** 成员名称 */
private String userName;
private String userName="";
/** 接收人Id */
private String receiveId;
private String receiveId="";
/** 客户姓名 */
private String customerName;
private String customerName="";
/** 群聊Id */
private String roomId;
private String roomId="";
/** 类型 */
private String msgType;
private String msgType="";
/** 关键词 **/
private String keyWord;
private String keyWord="";
/** 消息动作 */
private String action;
private String action="";
}
......@@ -121,8 +121,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/wecom/ticket/**").anonymous()
.antMatchers("/wecom/user/getUserInfo").anonymous()
// .antMatchers("/common/uploadFile2Cos").anonymous()
.antMatchers("/wecom/material/temporaryMaterialMediaId").anonymous()
// .antMatchers("/common/uploadFile2Cos").anonymous()
// .antMatchers("/wecom/material/temporaryMaterialMediaId").anonymous()
.antMatchers("/wecom/portrait/**").anonymous()
.antMatchers("/wecom/fission/poster", "/wecom/fission/*/progress/*").anonymous()
// 获取实际群活码和社群运营H5页面不需要登录
......
package com.linkwechat.wecom.domain.dto;
import lombok.Data;
/**
* @description: 群发参数相关
* @author: HaoN
* @create: 2021-03-31 17:20
**/
@Data
public class TemporaryMaterialDto {
private String url;
private String type;
private String name;
}
package com.linkwechat.wecom.domain.vo;
import com.linkwechat.wecom.domain.WeTag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
......@@ -11,6 +14,9 @@ import java.util.List;
* @create: 2020-10-24 20:09
**/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WeMakeCustomerTag {
private String externalUserid;
private List<WeTag> addTag;
......
package com.linkwechat.wecom.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
......@@ -70,14 +71,20 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
private WeCustomerMessageTimeTaskMapper customerMessageTimeTaskMapper;
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void addWeCustomerMessagePush(CustomerMessagePushDto customerMessagePushDto) throws JsonProcessingException, ParseException {
if ((null != customerMessagePushDto.getSettingTime() && !"".equals(customerMessagePushDto.getSettingTime()))
&& DateUtils.diffTime(new Date(), DateUtil.parse(customerMessagePushDto.getSettingTime(), "yyyy-MM-dd HH:mm:ss")) > 0) {
throw new WeComException("发送时间不能小于当前时间");
// if ((null != customerMessagePushDto.getSettingTime() && !"".equals(customerMessagePushDto.getSettingTime()))
// && DateUtils.diffTime(new Date(), DateUtil.parse(customerMessagePushDto.getSettingTime(), "yyyy-MM-dd HH:mm")) > 0) {
// throw new WeComException("发送时间不能小于当前时间");
// }
if(StrUtil.isBlank(customerMessagePushDto.getSettingTime())){
throw new WeComException("发送时间不能为空");
}
List<WeCustomer> customers = Lists.newArrayList();
List<WeGroup> groups = new ArrayList<>();
// 0 发给客户
......
......@@ -148,7 +148,8 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM
weCustomerMessagePushDto.setText(customerMessagePushDto.getTextMessage());
}
if (customerMessagePushDto.getMessageType().equals(GroupMessageType.IMAGE.getMessageType())) {
if (customerMessagePushDto.getMessageType().equals(GroupMessageType.IMAGE.getType())) {
weCustomerMessagePushDto.setImage(customerMessagePushDto.getImageMessage());
weCustomerMessagePushDto.setLink(null);
weCustomerMessagePushDto.setMiniprogram(null);
......
......@@ -347,14 +347,23 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
if (CollectionUtil.isNotEmpty(addTags)) {
addTags.removeAll(Collections.singleton(null));
//移除重复标签(避免客户重复打标签)
this.removeLabel(WeMakeCustomerTag.builder()
.externalUserid(weMakeCustomerTag.getExternalUserid())
.addTag(addTags)
.build());
List<WeFlowerCustomerTagRel> tagRels = new ArrayList<>();
List<CutomerTagEdit> cutomerTagEdits = new ArrayList<>();
flowerCustomerRels.stream().forEach(customer -> {
CutomerTagEdit cutomerTagEdit = CutomerTagEdit.builder()
.userid(customer.getUserId())
.external_userid(customer.getExternalUserid())
.build();
List<String> tags = new ArrayList<>();
addTags.stream().forEach(tag -> {
tags.add(tag.getTagId());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册