Commit cdcd014c by 18356073052

群发消息

1 parent faac3098
Showing 25 changed files with 285 additions and 7 deletions
package com.linkwechat.web.controller.wecom; package com.linkwechat.web.controller.wecom;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController; import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.dto.message.CustomerMessagePushDto;
import com.linkwechat.wecom.service.IWeCustomerMessagePushService; import com.linkwechat.wecom.service.IWeCustomerMessagePushService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -11,12 +19,29 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -11,12 +19,29 @@ import org.springframework.web.bind.annotation.RestController;
* @author: KeWen * @author: KeWen
* @create: 2020-12-01 20:23 * @create: 2020-12-01 20:23
**/ **/
@Slf4j
@RestController @RestController
@RequestMapping("/wecom/customerMessagePush") @RequestMapping("/wecom/customerMessagePush")
public class WeCustomerMessagePushController extends BaseController { public class WeCustomerMessagePushController extends BaseController {
@Autowired @Autowired
private IWeCustomerMessagePushService weCustomerMessagePushService; private IWeCustomerMessagePushService weCustomerMessagePushService;
/**
* 新增群发消息发送
*/
@PreAuthorize("@ss.hasPermi('system:push:add')")
@Log(title = "新增群发消息发送", businessType = BusinessType.INSERT)
@PostMapping(value = "add")
public AjaxResult add(CustomerMessagePushDto customerMessagePushDto) {
try {
weCustomerMessagePushService.addWeCustomerMessagePush(customerMessagePushDto);
} catch (JsonProcessingException e) {
e.printStackTrace();
return AjaxResult.error("群发失败");
}
return AjaxResult.success();
}
} }
...@@ -47,11 +47,6 @@ public class WeCustomerMessageOriginal extends BaseEntity { ...@@ -47,11 +47,6 @@ public class WeCustomerMessageOriginal extends BaseEntity {
private String tag; private String tag;
/** /**
* 群组名称id
*/
private String group;
/**
* 部门id * 部门id
*/ */
private String department; private String department;
......
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerImageMessage;
public interface IWeCustomerImageMessageService extends IService<WeCustomerImageMessage> {
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerLinkMessage;
public interface IWeCustomerLinkMessageService extends IService<WeCustomerLinkMessage> {
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerMessageOriginal;
/**
* 群发消息 原始数据信息表 we_customer_messageOriginal
*
* @author kewen
* @date 2020-12-12
*/
public interface IWeCustomerMessageOriginalService extends IService<WeCustomerMessageOriginal> {
/**
* 保存原始数据信息
* @param weCustomerMessageOriginal 原始数据信息
* @return
*/
int saveWeCustomerMessageOriginal(WeCustomerMessageOriginal weCustomerMessageOriginal);
}
package com.linkwechat.wecom.service; package com.linkwechat.wecom.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.linkwechat.wecom.domain.dto.message.CustomerMessagePushDto;
/** /**
* @description: 群发消息服务类 * @description: 群发消息服务类
* @author: KeWen * @author: KeWen
* @create: 2020-12-01 20:23 * @create: 2020-12-01 20:23
**/ **/
public interface IWeCustomerMessagePushService { public interface IWeCustomerMessagePushService {
/**
* 新增群发消息发送
*
*@param customerMessagePushDto 原始数据信息
*/
public void addWeCustomerMessagePush(CustomerMessagePushDto customerMessagePushDto) throws JsonProcessingException;
} }
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerMessage;
/**
* 群发消息 微信消息表service接口
*
* @author kewen
* @date 2020-12-12
*/
public interface IWeCustomerMessageService extends IService<WeCustomerMessage> {
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerMessgaeResult;
/**
* 群发消息 微信消息发送结果表 we_customer_messgaeResult
*
* @author kewen
* @date 2020-12-12
*/
public interface IWeCustomerMessgaeResultService extends IService<WeCustomerMessgaeResult> {
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerMiniprogramMessage;
public interface IWeCustomerMiniprogramMessageService extends IService<WeCustomerMiniprogramMessage> {
}
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerTextMessag;
public interface IWeCustomerTextMessagService extends IService<WeCustomerTextMessag> {
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerImageMessage;
import com.linkwechat.wecom.mapper.WeCustomerImageMessageMapper;
import com.linkwechat.wecom.service.IWeCustomerImageMessageService;
import org.springframework.stereotype.Service;
/**
* 群发消息 图片消息表 we_customer_imageMessage
*
* @author kewen
* @date 2020-12-12
*/
@Service
public class WeCustomerImageMessageServiceImpl extends ServiceImpl<WeCustomerImageMessageMapper, WeCustomerImageMessage> implements IWeCustomerImageMessageService {
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerLinkMessage;
import com.linkwechat.wecom.mapper.WeCustomerLinkMessageMapper;
import com.linkwechat.wecom.service.IWeCustomerLinkMessageService;
import org.springframework.stereotype.Service;
/**
* 群发消息 链接消息表 we_customer_linkMessage
*
* @author kewen
* @date 2020-12-13
*/
@Service
public class WeCustomerLinkMessageServiceImpl extends ServiceImpl<WeCustomerLinkMessageMapper, WeCustomerLinkMessage> implements IWeCustomerLinkMessageService {
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerMessageOriginal;
import com.linkwechat.wecom.mapper.WeCustomerMessageOriginalMapper;
import com.linkwechat.wecom.service.IWeCustomerMessageOriginalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 群发消息 原始数据信息表 we_customer_messageOriginal
*
* @author kewen
* @date 2020-12-12
*/
@Service
public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomerMessageOriginalMapper,WeCustomerMessageOriginal>implements IWeCustomerMessageOriginalService {
@Autowired
private WeCustomerMessageOriginalMapper weCustomerMessageOriginalMapper;
@Override
public int saveWeCustomerMessageOriginal(WeCustomerMessageOriginal weCustomerMessageOriginal) {
return weCustomerMessageOriginalMapper.insert(weCustomerMessageOriginal);
}
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerMessage;
import com.linkwechat.wecom.mapper.WeCustomerMessageMapper;
import com.linkwechat.wecom.service.IWeCustomerMessageService;
import org.springframework.stereotype.Service;
/**
* 群发消息 微信消息表service接口
*
* @author kewen
* @date 2020-12-12
*/
@Service
public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageMapper, WeCustomerMessage> implements IWeCustomerMessageService {
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerMessgaeResult;
import com.linkwechat.wecom.mapper.WeCustomerMessgaeResultMapper;
import com.linkwechat.wecom.service.IWeCustomerMessgaeResultService;
import org.springframework.stereotype.Service;
/**
* 群发消息 微信消息发送结果表 we_customer_messgaeResult
*
* @author kewen
* @date 2020-12-12
*/
@Service
public class WeCustomerMessgaeResultServiceImpl extends ServiceImpl<WeCustomerMessgaeResultMapper, WeCustomerMessgaeResult> implements IWeCustomerMessgaeResultService {
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerMiniprogramMessage;
import com.linkwechat.wecom.mapper.WeCustomerMiniprogramMessageMapper;
import com.linkwechat.wecom.service.IWeCustomerMiniprogramMessageService;
import org.springframework.stereotype.Service;
/**
* 群发消息 小程序消息表 we_customer_miniprogramMessage
*
* @author kewen
* @date 2020-12-12
*/
@Service
public class WeCustomerMiniprogramMessageServiceImpl extends ServiceImpl<WeCustomerMiniprogramMessageMapper, WeCustomerMiniprogramMessage> implements IWeCustomerMiniprogramMessageService {
}
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerTextMessag;
import com.linkwechat.wecom.mapper.WeCustomerTextMessagMapper;
import com.linkwechat.wecom.service.IWeCustomerTextMessagService;
import org.springframework.stereotype.Service;
/**
* 群发消息 文本消息表 we_customer_textMessage
*
* @author kewen
* @date 2020-12-12
*/
@Service
public class WeCustomerTextMessagServiceImpl extends ServiceImpl<WeCustomerTextMessagMapper, WeCustomerTextMessag> implements IWeCustomerTextMessagService {
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerImageMessageMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerLinkMessageMapper">
</mapper>
...@@ -114,6 +114,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -114,6 +114,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND wt.tag_id=#{tagIds} AND wt.tag_id=#{tagIds}
</if> </if>
</if> </if>
<if test="departmentIds != null and departmentIds !=''">
<if test="departmentIds.indexOf(',') != -1">
AND wu.department in
<foreach item="item" index="index" collection="departmentIds.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="departmentIds.indexOf(',') == -1">
AND wu.department=#{departmentIds}
</if>
</if>
<if test="status !=null and status !=''"> <if test="status !=null and status !=''">
AND wfcr.status=#{status} AND wfcr.status=#{status}
...@@ -236,8 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -236,8 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wt.tag_id, wt.tag_id,
wt.create_time, wt.create_time,
wt.`name` as tagName, wt.`name` as tagName,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department, (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
wfcr.status
FROM FROM
we_customer wc we_customer wc
LEFT JOIN we_flower_customer_rel wfcr ON wc.external_userid=wfcr.external_userid LEFT JOIN we_flower_customer_rel wfcr ON wc.external_userid=wfcr.external_userid
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerMessageMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerMessageOriginalMapper">
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerMiniprogramMessageMapper">
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerTextMessagMapper">
</mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!