Commit 59fa2c47 by YaoYuHang

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

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