浏览代码

客服群发新增流程

Eric 2 年之前
父节点
当前提交
362f2afdae
共有 19 个文件被更改,包括 1323 次插入0 次删除
  1. 148 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/CustomerServiceBatchSendingController.java
  2. 118 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/CustomerServiceReceiveController.java
  3. 95 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/im/CustomerServiceBatchSendingVo.java
  4. 59 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/im/CustomerServiceReceiveVo.java
  5. 83 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CustomerServiceBatchSending.java
  6. 44 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CustomerServiceReceive.java
  7. 28 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/im/EImReceiveType.java
  8. 30 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/im/EImSendStatus.java
  9. 28 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/im/EImSendType.java
  10. 25 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/CustomerServiceBatchSendingMapper.java
  11. 25 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/CustomerServiceReceiveMapper.java
  12. 43 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CustomerServiceBatchSendingService.java
  13. 43 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CustomerServiceReceiveService.java
  14. 183 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CustomerServiceBatchSendingServiceImpl.java
  15. 65 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CustomerServiceReceiveServiceImpl.java
  16. 176 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/im/CustomerServiceBatchSendingWrapper.java
  17. 77 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/im/CustomerServiceReceiveWrapper.java
  18. 32 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CustomerServiceBatchSendingMapper.xml
  19. 21 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CustomerServiceReceiveMapper.xml

+ 148 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/CustomerServiceBatchSendingController.java

@@ -0,0 +1,148 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.admin.io.request.im.CustomerServiceBatchSendingVo;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.enums.im.EImReceiveType;
+import com.yonge.cooleshow.biz.dal.enums.im.EImSendStatus;
+import com.yonge.cooleshow.biz.dal.service.CustomerServiceBatchSendingService;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceBatchSendingWrapper;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.exception.BizException;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.mybatis.support.PageUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Objects;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/batchSending")
+@Api(tags = "客服群发")
+public class CustomerServiceBatchSendingController extends BaseController {
+
+    @Autowired
+    private CustomerServiceBatchSendingService customerServiceBatchSendingService;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	/**
+	 * 查询单条
+	 * @param id 详情ID
+	 * @return R<CustomerServiceBatchSendingVo.CustomerServiceBatchSending>
+	 */
+	@ApiOperation(value = "详情", notes = "客服群发-根据详情ID查询单条, 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+    @GetMapping("/detail/{id}")
+    public HttpResponseResult<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> detail(@PathVariable("id") Long id) {
+
+		CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending wrapper = customerServiceBatchSendingService.detail(id);
+        
+        return HttpResponseResult.succeed(wrapper);
+	}
+    
+    /**
+	 * 查询分页
+	 * @param query CustomerServiceBatchSendingVo.CustomerServiceBatchSendingQuery
+	 * @return R<PageInfo<CustomerServiceBatchSendingVo.CustomerServiceBatchSending>>
+	 */
+    @ApiOperation(value = "查询分页", notes = "客服群发- 传入 CustomerServiceBatchSendingVo.CustomerServiceBatchSendingQuery") 
+    @PostMapping("/page")
+    public HttpResponseResult<PageInfo<CustomerServiceBatchSendingVo.CustomerServiceBatchSending>> page(@RequestBody CustomerServiceBatchSendingWrapper.CustomerServiceBatchSendingQuery query) {
+    
+        // 查询数据
+        IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> pages = customerServiceBatchSendingService.selectPage(PageUtil.getPage(query), query);
+        // 数据类型转换
+        List<CustomerServiceBatchSendingVo.CustomerServiceBatchSending> records = JSON.parseArray(JSON.toJSONString(pages.getRecords()),
+        	CustomerServiceBatchSendingVo.CustomerServiceBatchSending.class);
+        
+        return HttpResponseResult.succeed(PageUtil.getPageInfo(pages, records));
+	}
+    
+    /**
+	 * 新增
+	 * @param info CustomerServiceBatchSendingVo.CustomerServiceBatchSending
+	 * @return R<Boolean>
+	 */
+    @ApiOperation(value = "新增", notes = "客服群发- 传入 CustomerServiceBatchSendingVo.CustomerServiceBatchSending")
+	@PostMapping("/save")
+	public HttpResponseResult<Boolean> add(@RequestBody CustomerServiceBatchSendingVo.CustomerServiceBatchSending info) {
+
+		// 获取当前用户ID
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || null == user.getId()) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		info.setCreateBy(user.getId());
+
+		if (EImReceiveType.PORTION == info.getReceiveType()
+				&& CollectionUtils.isEmpty(info.getReceives())) {
+			throw new BizException("接收用户不能为空");
+		}
+		// 设置默认参数
+		info.setSendStatus(EImSendStatus.WAIT);
+
+        // 新增数据
+        customerServiceBatchSendingService.add(JSON.parseObject(info.jsonString(),
+				CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending.class));
+        
+        return HttpResponseResult.succeed();
+	}
+    
+    /**
+	 * 修改
+	 * @param info CustomerServiceBatchSendingVo.CustomerServiceBatchSending
+	 * @return R<Boolean>
+	 */
+    @ApiOperation(value = "修改", notes = "客服群发- 传入 CustomerServiceBatchSendingVo.CustomerServiceBatchSending")
+	@PostMapping("/update")
+	public HttpResponseResult<Boolean> update(@Validated @RequestBody CustomerServiceBatchSendingVo.CustomerServiceBatchSending info) {
+
+		if (Objects.isNull(info.getId())) {
+			throw new BizException("请求参数异常");
+		}
+
+        // 更新数据
+        customerServiceBatchSendingService.update(JSON.parseObject(info.jsonString(),
+				CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending.class));
+        
+        return HttpResponseResult.succeed();
+	}
+
+ 	/**
+	 * 删除
+	 * @param id 详情ID
+	 * @return R<Boolean>
+	 */
+	@ApiOperation(value = "删除", notes = "客服群发- 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+	@PostMapping("/remove")
+	public HttpResponseResult<Boolean> remove(@RequestParam Long id) {
+    
+		return HttpResponseResult.succeed(customerServiceBatchSendingService.removeById(id));
+	}
+}

+ 118 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/CustomerServiceReceiveController.java

@@ -0,0 +1,118 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.admin.io.request.im.CustomerServiceReceiveVo;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceReceive;
+import com.yonge.cooleshow.biz.dal.service.CustomerServiceReceiveService;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceReceiveWrapper;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.mybatis.support.PageUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/batchReceive")
+@Api(tags = "客服群发接收")
+public class CustomerServiceReceiveController {
+
+    @Autowired
+    private CustomerServiceReceiveService customerServiceReceiveService;
+
+	/**
+	 * 查询单条
+	 * @param id 详情ID
+	 * @return R<CustomerServiceReceiveVo.CustomerServiceReceive>
+	 */
+	@ApiOperation(value = "详情", notes = "客服群发接收-根据详情ID查询单条, 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+    @GetMapping("/detail/{id}")
+    public HttpResponseResult<CustomerServiceReceiveVo.CustomerServiceReceive> detail(@PathVariable("id") Long id) {
+    
+    	CustomerServiceReceive wrapper = customerServiceReceiveService.detail(id);
+        
+        return HttpResponseResult.succeed(CustomerServiceReceiveVo.CustomerServiceReceive.from(JSON.toJSONString(wrapper)));
+	}
+    
+    /**
+	 * 查询分页
+	 * @param query CustomerServiceReceiveVo.CustomerServiceReceiveQuery
+	 * @return R<PageInfo<CustomerServiceReceiveVo.CustomerServiceReceive>>
+	 */
+    @ApiOperation(value = "查询分页", notes = "客服群发接收- 传入 CustomerServiceReceiveVo.CustomerServiceReceiveQuery") 
+    @PostMapping("/page")
+    public HttpResponseResult<PageInfo<CustomerServiceReceiveVo.CustomerServiceReceive>> page(@RequestBody CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery query) {
+    
+        // 查询数据
+        IPage<CustomerServiceReceive> pages = customerServiceReceiveService.selectPage(PageUtil.getPage(query), query);
+        // 数据类型转换
+        List<CustomerServiceReceiveVo.CustomerServiceReceive> records = JSON.parseArray(JSON.toJSONString(pages.getRecords()), 
+        	CustomerServiceReceiveVo.CustomerServiceReceive.class);
+        
+        return HttpResponseResult.succeed(PageUtil.getPageInfo(pages, records));
+	}
+    
+    /**
+	 * 新增
+	 * @param info CustomerServiceReceiveVo.CustomerServiceReceive
+	 * @return R<Boolean>
+	 */
+    @ApiOperation(value = "新增", notes = "客服群发接收- 传入 CustomerServiceReceiveVo.CustomerServiceReceive")
+	@PostMapping("/save")
+	public HttpResponseResult<Boolean> add(@Validated @RequestBody CustomerServiceReceiveVo.CustomerServiceReceive info) {
+    
+        // 新增数据
+        customerServiceReceiveService.save(JSON.parseObject(info.jsonString(), CustomerServiceReceive.class));
+        
+        return HttpResponseResult.succeed();
+	}
+    
+    /**
+	 * 修改
+	 * @param info CustomerServiceReceiveVo.CustomerServiceReceive
+	 * @return R<Boolean>
+	 */
+    @ApiOperation(value = "修改", notes = "客服群发接收- 传入 CustomerServiceReceiveVo.CustomerServiceReceive")
+	@PostMapping("/update")
+	public HttpResponseResult<Boolean> update(@Validated @RequestBody CustomerServiceReceiveVo.CustomerServiceReceive info) {
+                
+        // 更新数据
+        customerServiceReceiveService.updateById(JSON.parseObject(info.jsonString(), CustomerServiceReceive.class));
+        
+        return HttpResponseResult.succeed();
+	}
+
+ 	/**
+	 * 删除
+	 * @param id 详情ID
+	 * @return R<Boolean>
+	 */
+	@ApiOperation(value = "删除", notes = "客服群发接收- 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+	@PostMapping("/remove")
+	public HttpResponseResult<Boolean> remove(@RequestParam Long id) {
+    
+		return HttpResponseResult.succeed(customerServiceReceiveService.removeById(id));
+	}
+}

+ 95 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/im/CustomerServiceBatchSendingVo.java

@@ -0,0 +1,95 @@
+package com.yonge.cooleshow.admin.io.request.im;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.cooleshow.biz.dal.enums.im.EImReceiveType;
+import com.yonge.cooleshow.biz.dal.enums.im.EImSendStatus;
+import com.yonge.cooleshow.biz.dal.enums.im.EImSendType;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 客服群发
+ * 2022-12-09 10:49:10
+ */
+@ApiModel(value = "CustomerServiceBatchSendingVo对象", description = "客服群发查询视图对象")
+public class CustomerServiceBatchSendingVo {
+
+    @ApiModel(" CustomerServiceBatchSendingQuery-客服群发")
+    public static class CustomerServiceBatchSendingQuery extends QueryInfo {
+    
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceBatchSendingQuery from(String json) {
+            return JSON.parseObject(json, CustomerServiceBatchSendingQuery.class);
+        }
+    }
+    
+    @Data
+    @ApiModel(" CustomerServiceBatchSending-客服群发")
+    public static class CustomerServiceBatchSending {
+    	
+                
+		@ApiModelProperty("主键ID") 
+        private Long id;
+                
+		@ApiModelProperty("目标群体")
+        private String targetGroup;
+                
+		@ApiModelProperty("发送声部")
+        private String sendSubject;
+                
+		@ApiModelProperty("接收人数")
+        private Integer receiveNumber;
+                
+		@ApiModelProperty("目标人群")
+        private EImReceiveType receiveType;
+                
+		@ApiModelProperty("发送方式")
+        private EImSendType sendType;
+                
+		@ApiModelProperty("发送状态")
+        private EImSendStatus sendStatus;
+                
+		@ApiModelProperty("发送时间")
+        private Date sendTime;
+                
+		@ApiModelProperty("消息标题")
+        private String title;
+                
+		@ApiModelProperty("文本消息")
+        private String textMessage;
+                
+		@ApiModelProperty("图片消息")
+        private String imgMessage;
+                
+		@ApiModelProperty("图片地址")
+        private String imgUrl;
+                
+		@ApiModelProperty("创建用户")
+        private Long createBy;
+                
+		@ApiModelProperty("创建时间")
+        private Date createTime;
+
+        @ApiModelProperty("目标人群")
+        private List<CustomerServiceReceiveVo.CustomerServiceReceive> receives;
+                
+                
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceBatchSending from(String json) {
+            return JSON.parseObject(json, CustomerServiceBatchSending.class);
+        }
+    }
+    
+}

+ 59 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/im/CustomerServiceReceiveVo.java

@@ -0,0 +1,59 @@
+package com.yonge.cooleshow.admin.io.request.im;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 客服群发接收
+ * 2022-12-09 10:49:10
+ */
+@ApiModel(value = "CustomerServiceReceiveVo对象", description = "客服群发接收查询视图对象")
+public class CustomerServiceReceiveVo {
+
+    @ApiModel(" CustomerServiceReceiveQuery-客服群发接收")
+    public static class CustomerServiceReceiveQuery extends QueryInfo {
+    
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceReceiveQuery from(String json) {
+            return JSON.parseObject(json, CustomerServiceReceiveQuery.class);
+        }
+    }
+    
+    @Data
+    @ApiModel(" CustomerServiceReceive-客服群发接收")
+    public static class CustomerServiceReceive {
+    	
+                
+		@ApiModelProperty("主键ID") 
+        private Long id;
+
+        @ApiModelProperty("群发消息ID")
+        private Long batchSendingId;
+                
+		@ApiModelProperty("用户ID") 
+        private Long userId;
+                
+		@ApiModelProperty("用户身份")
+        private String clientType;
+                
+		@ApiModelProperty("创建时间")
+        private Date createTime;
+                
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceReceive from(String json) {
+            return JSON.parseObject(json, CustomerServiceReceive.class);
+        }
+    }
+    
+}

+ 83 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CustomerServiceBatchSending.java

@@ -0,0 +1,83 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yonge.cooleshow.biz.dal.enums.im.EImReceiveType;
+import com.yonge.cooleshow.biz.dal.enums.im.EImSendStatus;
+import com.yonge.cooleshow.biz.dal.enums.im.EImSendType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 客服群发
+ * 2022-12-09 10:49:10
+ */
+@Data
+@ApiModel(" CustomerServiceBatchSending-客服群发")
+@TableName("customer_service_batch_sending")
+public class CustomerServiceBatchSending implements Serializable {
+
+    @ApiModelProperty("主键ID") 
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty("目标群体") 
+	@TableField(value = "target_group_")
+    private String targetGroup;
+
+    @ApiModelProperty("发送声部") 
+	@TableField(value = "send_subject_")
+    private String sendSubject;
+
+    @ApiModelProperty("接收人数") 
+	@TableField(value = "receive_number_")
+    private Integer receiveNumber;
+
+    @ApiModelProperty("目标人群") 
+	@TableField(value = "receive_type_")
+    private EImReceiveType receiveType;
+
+    @ApiModelProperty("发送方式") 
+	@TableField(value = "send_type_")
+    private EImSendType sendType;
+
+    @ApiModelProperty("发送状态") 
+	@TableField(value = "send_status_")
+    private EImSendStatus sendStatus;
+
+    @ApiModelProperty("发送时间") 
+	@TableField(value = "send_time_")
+    private Date sendTime;
+
+    @ApiModelProperty("消息标题") 
+	@TableField(value = "title_")
+    private String title;
+
+    @ApiModelProperty("文本消息") 
+	@TableField(value = "text_message_")
+    private String textMessage;
+
+    @ApiModelProperty("图片消息") 
+	@TableField(value = "img_message_")
+    private String imgMessage;
+
+    @ApiModelProperty("图片地址") 
+	@TableField(value = "img_url_")
+    private String imgUrl;
+
+    @ApiModelProperty("创建用户") 
+	@TableField(value = "create_by_")
+    private Long createBy;
+
+    @ApiModelProperty("创建时间") 
+	@TableField(value = "create_time_")
+    private Date createTime;
+
+}

+ 44 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CustomerServiceReceive.java

@@ -0,0 +1,44 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 客服群发接收
+ * 2022-12-09 10:49:10
+ */
+@Data
+@ApiModel(" CustomerServiceReceive-客服群发接收")
+@TableName("customer_service_receive")
+public class CustomerServiceReceive implements Serializable {
+
+    @ApiModelProperty("主键ID") 
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty("群发消息ID")
+    @TableField(value = "batch_sending_id_")
+    private Long batchSendingId;
+
+    @ApiModelProperty("用户ID") 
+	@TableField(value = "user_id_")
+    private Long userId;
+
+    @ApiModelProperty("用户身份") 
+	@TableField(value = "client_type_")
+    private String clientType;
+
+    @ApiModelProperty("创建时间") 
+	@TableField(value = "create_time_")
+    private Date createTime;
+
+}

+ 28 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/im/EImReceiveType.java

@@ -0,0 +1,28 @@
+package com.yonge.cooleshow.biz.dal.enums.im;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.yonge.toolset.base.enums.BaseEnum;
+import lombok.Getter;
+
+/**
+ * IM群发接收方式
+ * Created by Eric.Shang on 2022/12/9.
+ */
+@Getter
+public enum EImReceiveType implements BaseEnum<String, EImReceiveType> {
+
+    ALL("全部"),
+    PORTION("一部分"),
+    ;
+
+    @EnumValue
+    private final String code;
+
+    private final String msg;
+
+    EImReceiveType(String msg) {
+        this.msg = msg;
+
+        this.code = this.name();
+    }
+}

+ 30 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/im/EImSendStatus.java

@@ -0,0 +1,30 @@
+package com.yonge.cooleshow.biz.dal.enums.im;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.yonge.toolset.base.enums.BaseEnum;
+import lombok.Getter;
+
+/**
+ * IM群发消息状态
+ * Created by Eric.Shang on 2022/12/9.
+ */
+@Getter
+public enum EImSendStatus implements BaseEnum<String, EImSendStatus> {
+
+    WAIT("待发送"),
+    SEND("已发送"),
+    DISABLE("已停用"),
+    EXPIRE("已失效"),
+    ;
+
+    @EnumValue
+    private final String code;
+
+    private final String msg;
+
+    EImSendStatus(String msg) {
+        this.msg = msg;
+
+        this.code = this.name();
+    }
+}

+ 28 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/im/EImSendType.java

@@ -0,0 +1,28 @@
+package com.yonge.cooleshow.biz.dal.enums.im;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.yonge.toolset.base.enums.BaseEnum;
+import lombok.Getter;
+
+/**
+ * IM群发方式
+ * Created by Eric.Shang on 2022/12/9.
+ */
+@Getter
+public enum EImSendType implements BaseEnum<String, EImSendType> {
+
+    IMMEDIATELY("即时发送"),
+    SCHEDULED("定时发送"),
+    ;
+
+    @EnumValue
+    private final String code;
+
+    private final String msg;
+
+    EImSendType(String msg) {
+        this.msg = msg;
+
+        this.code = this.name();
+    }
+}

+ 25 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/CustomerServiceBatchSendingMapper.java

@@ -0,0 +1,25 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceBatchSending;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceBatchSendingWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 客服群发
+ * 2022-12-09 10:49:10
+ */
+public interface CustomerServiceBatchSendingMapper extends BaseMapper<CustomerServiceBatchSending> {
+
+	/**
+	 * 分页查询
+	 * @param page IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending>
+	 * @param param CustomerServiceBatchSendingWrapper.CustomerServiceBatchSendingQuery
+	 * @return List<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending>
+	 */
+	List<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> selectPage(@Param("page") IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> page, @Param("param") CustomerServiceBatchSendingWrapper.CustomerServiceBatchSendingQuery param);
+	
+}

+ 25 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/CustomerServiceReceiveMapper.java

@@ -0,0 +1,25 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceReceive;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceReceiveWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 客服群发接收
+ * 2022-12-09 10:49:10
+ */
+public interface CustomerServiceReceiveMapper extends BaseMapper<CustomerServiceReceive> {
+
+	/**
+	 * 分页查询
+	 * @param page IPage<CustomerServiceReceiveWrapper.CustomerServiceReceive>
+	 * @param param CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery
+	 * @return List<CustomerServiceReceiveWrapper.CustomerServiceReceive>
+	 */
+	List<CustomerServiceReceive> selectPage(@Param("page") IPage<CustomerServiceReceive> page, @Param("param") CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery param);
+	
+}

+ 43 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CustomerServiceBatchSendingService.java

@@ -0,0 +1,43 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceBatchSending;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceBatchSendingWrapper;
+
+/**
+ * 客服群发
+ * 2022-12-09 10:49:10
+ */
+public interface CustomerServiceBatchSendingService extends IService<CustomerServiceBatchSending>  {
+
+	/**
+     * 查询详情
+     * @param id 详情ID
+     * @return CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending
+     */
+    CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending detail(Long id);
+
+    /**
+     * 分页查询
+     * @param page IPage<CustomerServiceBatchSending>
+     * @param query CustomerServiceBatchSendingWrapper.CustomerServiceBatchSendingQuery
+     * @return IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending>
+     */
+    IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> selectPage(IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> page, CustomerServiceBatchSendingWrapper.CustomerServiceBatchSendingQuery query);
+	
+    /**
+     * 添加
+     * @param customerServiceBatchSending CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending
+     * @return Boolean
+     */
+     Boolean add(CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending customerServiceBatchSending);   
+
+    /**
+     * 更新
+     * @param customerServiceBatchSending CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending
+     * @return Boolean
+     */
+     Boolean update(CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending customerServiceBatchSending);
+     
+}

+ 43 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CustomerServiceReceiveService.java

@@ -0,0 +1,43 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceReceive;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceReceiveWrapper;
+
+/**
+ * 客服群发接收
+ * 2022-12-09 10:49:10
+ */
+public interface CustomerServiceReceiveService extends IService<CustomerServiceReceive>  {
+
+	/**
+     * 查询详情
+     * @param id 详情ID
+     * @return CustomerServiceReceive
+     */
+	CustomerServiceReceive detail(Long id);
+
+    /**
+     * 分页查询
+     * @param page IPage<CustomerServiceReceive>
+     * @param query CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery
+     * @return IPage<CustomerServiceReceive>
+     */
+    IPage<CustomerServiceReceive> selectPage(IPage<CustomerServiceReceive> page, CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery query);
+	
+    /**
+     * 添加
+     * @param customerServiceReceive CustomerServiceReceiveWrapper.CustomerServiceReceive
+     * @return Boolean
+     */
+     Boolean add(CustomerServiceReceiveWrapper.CustomerServiceReceive customerServiceReceive);   
+
+    /**
+     * 更新
+     * @param customerServiceReceive CustomerServiceReceiveWrapper.CustomerServiceReceive
+     * @return Boolean
+     */
+     Boolean update(CustomerServiceReceiveWrapper.CustomerServiceReceive customerServiceReceive);
+     
+}

+ 183 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CustomerServiceBatchSendingServiceImpl.java

@@ -0,0 +1,183 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceBatchSending;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceReceive;
+import com.yonge.cooleshow.biz.dal.entity.Subject;
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.mapper.CustomerServiceBatchSendingMapper;
+import com.yonge.cooleshow.biz.dal.service.CustomerServiceBatchSendingService;
+import com.yonge.cooleshow.biz.dal.service.CustomerServiceReceiveService;
+import com.yonge.cooleshow.biz.dal.service.SubjectService;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceBatchSendingWrapper;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceReceiveWrapper;
+import com.yonge.toolset.base.exception.BizException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * 客服群发
+ * 2022-12-09 10:49:10
+ */
+@Slf4j
+@Service
+public class CustomerServiceBatchSendingServiceImpl extends ServiceImpl<CustomerServiceBatchSendingMapper, CustomerServiceBatchSending> implements CustomerServiceBatchSendingService {
+
+    @Autowired
+    private CustomerServiceReceiveService customerServiceReceiveService;
+    @Autowired
+    private SubjectService subjectService;
+
+	/**
+     * 查询详情
+     * @param id 详情ID
+     * @return CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending
+     */
+	@Override
+    public CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending detail(Long id) {
+
+        CustomerServiceBatchSending sending = baseMapper.selectById(id);
+        if (Objects.isNull(sending)) {
+            throw new BizException("无效的请求ID");
+        }
+
+        CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending record = CustomerServiceBatchSendingWrapper
+                .CustomerServiceBatchSending.from(JSON.toJSONString(sending));
+
+        // 填充声部,目标群体
+        List<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> records = Lists.newArrayList(record);
+
+        // 返回消息封闭
+        getBatchSendingPaddingData(records);
+
+        return record;
+    }
+    
+    /**
+     * 分页查询
+     * @param page IPage<CustomerServiceBatchSending>
+     * @param query CustomerServiceBatchSendingWrapper.CustomerServiceBatchSendingQuery
+     * @return IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending>
+     */
+    @Override
+    public IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> selectPage(IPage<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> page,
+                                                                                            CustomerServiceBatchSendingWrapper.CustomerServiceBatchSendingQuery query){
+
+        // 群发消息记录
+        List<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> sendings = baseMapper.selectPage(page, query);
+
+        // 返回消息封闭
+        getBatchSendingPaddingData(sendings);
+
+        return page.setRecords(sendings);
+    }
+
+    /**
+     * 群发消息返回封装
+     * @param sendings List<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending>
+     */
+    private void getBatchSendingPaddingData(List<CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending> sendings) {
+
+        // 声部信息
+        List<Long> subjectIds = sendings.stream()
+                .flatMap(x -> Arrays.stream(x.getSendSubject().split(",")))
+                .map(Long::parseLong).distinct().collect(Collectors.toList());
+
+        Map<Long, String> subjectNameMap = subjectService.findBySubjectByIdList(subjectIds).stream()
+                .collect(Collectors.toMap(Subject::getId, Subject::getName, (o, n) -> n));
+
+        // 发送群体,发送声部
+        for (CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending item : sendings) {
+
+            List<Long> collect = Arrays.stream(Optional.ofNullable(item.getSendSubject()).orElse("").split(","))
+                    .map(Long::parseLong).distinct().collect(Collectors.toList());
+
+            // 发送声部
+            String subjectName = subjectNameMap.entrySet().stream()
+                    .filter(x -> collect.contains(x.getKey()))
+                    .map(Map.Entry::getValue).collect(Collectors.joining(","));
+            item.setSubjectName(subjectName);
+
+            // 发送群体
+            List<String> clientTypes = Arrays.stream(Optional.ofNullable(item.getTargetGroup()).orElse("").split(","))
+                    .collect(Collectors.toList());
+
+            String targetGroup = Arrays.stream(ClientEnum.values())
+                    .filter(x -> clientTypes.contains(x.getCode())).map(ClientEnum::getMsg)
+                    .collect(Collectors.joining(","));
+            item.setTargetGroupName(targetGroup);
+        }
+    }
+
+    /**
+     * 添加
+     * @param info CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending
+     * @return Boolean
+     */
+    @Transactional
+    @Override
+    public Boolean add(CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending info) {
+
+        // 推送消息
+        CustomerServiceBatchSending sending = JSON.parseObject(info.jsonString(),
+                CustomerServiceBatchSending.class);
+
+        // 保存推送群发消息
+        save(sending);
+
+        // 部分推送用户
+       if (CollectionUtils.isNotEmpty(info.getReceives())) {
+           for (CustomerServiceReceiveWrapper.CustomerServiceReceive item : info.getReceives()) {
+               item.setBatchSendingId(sending.getId());
+           }
+           customerServiceReceiveService.saveBatch(JSON.parseArray(JSON.toJSONString(info.getReceives()),
+                   CustomerServiceReceive.class));
+       }
+
+        return true;
+    }
+
+    /**
+     * 更新
+     * @param info CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending
+     * @return Boolean
+     */
+    @Transactional
+    @Override
+    public Boolean update(CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending info){
+
+        CustomerServiceBatchSending sending = JSON.parseObject(info.jsonString(),
+                CustomerServiceBatchSending.class);
+        // 更新群发消息
+        this.updateById(sending);
+
+        if (CollectionUtils.isNotEmpty(info.getReceives())) {
+
+            // 先清除数据,后重新插入
+            customerServiceReceiveService.remove(Wrappers.<CustomerServiceReceive>lambdaQuery()
+                    .eq(CustomerServiceReceive::getBatchSendingId, sending.getId()));
+
+            for (CustomerServiceReceiveWrapper.CustomerServiceReceive item : info.getReceives()) {
+                item.setBatchSendingId(sending.getId());
+            }
+            customerServiceReceiveService.saveBatch(JSON.parseArray(JSON.toJSONString(info.getReceives()),
+                    CustomerServiceReceive.class));
+        }
+
+        return true;
+    }
+}

+ 65 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CustomerServiceReceiveServiceImpl.java

@@ -0,0 +1,65 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.entity.CustomerServiceReceive;
+import com.yonge.cooleshow.biz.dal.mapper.CustomerServiceReceiveMapper;
+import com.yonge.cooleshow.biz.dal.service.CustomerServiceReceiveService;
+import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceReceiveWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * 客服群发接收
+ * 2022-12-09 10:49:10
+ */
+@Slf4j
+@Service
+public class CustomerServiceReceiveServiceImpl extends ServiceImpl<CustomerServiceReceiveMapper, CustomerServiceReceive> implements CustomerServiceReceiveService {
+
+	/**
+     * 查询详情
+     * @param id 详情ID
+     * @return CustomerServiceReceive
+     */
+	@Override
+    public CustomerServiceReceive detail(Long id) {
+        
+        return baseMapper.selectById(id);
+    }
+    
+    /**
+     * 分页查询
+     * @param page IPage<CustomerServiceReceive>
+     * @param query CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery
+     * @return IPage<CustomerServiceReceive>
+     */
+    @Override
+    public IPage<CustomerServiceReceive> selectPage(IPage<CustomerServiceReceive> page, CustomerServiceReceiveWrapper.CustomerServiceReceiveQuery query){
+        
+        return page.setRecords(baseMapper.selectPage(page, query));
+    }
+	
+    /**
+     * 添加
+     * @param customerServiceReceive CustomerServiceReceiveWrapper.CustomerServiceReceive
+     * @return Boolean
+     */
+    @Override
+    public Boolean add(CustomerServiceReceiveWrapper.CustomerServiceReceive customerServiceReceive) {    	
+        
+        return this.save(JSON.parseObject(customerServiceReceive.jsonString(), CustomerServiceReceive.class));
+    }
+
+    /**
+     * 更新
+     * @param customerServiceReceive CustomerServiceReceiveWrapper.CustomerServiceReceive
+     * @return Boolean
+     */
+    @Override
+    public Boolean update(CustomerServiceReceiveWrapper.CustomerServiceReceive customerServiceReceive){
+
+        return this.updateById(JSON.parseObject(customerServiceReceive.jsonString(), CustomerServiceReceive.class));       
+    }
+}

+ 176 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/im/CustomerServiceBatchSendingWrapper.java

@@ -0,0 +1,176 @@
+package com.yonge.cooleshow.biz.dal.wrapper.im;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.cooleshow.biz.dal.enums.im.EImReceiveType;
+import com.yonge.cooleshow.biz.dal.enums.im.EImSendStatus;
+import com.yonge.cooleshow.biz.dal.enums.im.EImSendType;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * 客服群发
+ * 2022-12-09 10:49:10
+ */
+@ApiModel(value = "CustomerServiceBatchSendingWrapper对象", description = "客服群发查询对象")
+public class CustomerServiceBatchSendingWrapper {
+
+    @Data
+	@Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" CustomerServiceBatchSendingQuery-客服群发")
+    public static class CustomerServiceBatchSendingQuery extends QueryInfo {
+    
+        @ApiModelProperty("关键字匹配")
+		private String keyword;
+
+        @ApiModelProperty("发送声部")
+        private String sendSubject;
+
+        @ApiModelProperty("发送群体")
+        private String targetGroup;
+
+        @ApiModelProperty("发送方式")
+        private EImSendType sendType;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+
+        @ApiModelProperty("发送时间")
+        private Date sendTime;
+
+        @ApiModelProperty("发送状态")
+        private EImSendStatus sendStatus;
+
+        @ApiModelProperty("发送用户ID")
+        private Long sendId;
+
+        @ApiModelProperty(value = "声部", hidden = true)
+        private List<String> subjectIds;
+
+        @ApiModelProperty(value = "用户身份", hidden = true)
+        private List<String> clientTypes;
+        
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+
+        public List<String> getSubjectIds() {
+            if (StringUtils.isNotBlank(getSendSubject())) {
+                return Arrays.stream(getSendSubject().split(",")).collect(Collectors.toList());
+            }
+            return subjectIds;
+        }
+
+        public List<String> getClientTypes() {
+            if (StringUtils.isNotBlank(getTargetGroup())) {
+                return Arrays.stream(getTargetGroup().split(",")).collect(Collectors.toList());
+            }
+            return clientTypes;
+        }
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceBatchSendingQuery from(String json) {
+            return JSON.parseObject(json, CustomerServiceBatchSendingQuery.class);
+        }
+    }  
+
+    @Data
+	@ApiModel(" CustomerServiceBatchSending-客服群发")
+    public static class CustomerServiceBatchSending {
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+        @ApiModelProperty("目标群体")
+        private String targetGroup;
+
+        @ApiModelProperty("发送声部")
+        private String sendSubject;
+
+        @ApiModelProperty("接收人数")
+        private Integer receiveNumber;
+
+        @ApiModelProperty("目标人群")
+        private EImReceiveType receiveType;
+
+        @ApiModelProperty("发送方式")
+        private EImSendType sendType;
+
+        @ApiModelProperty("发送状态")
+        private EImSendStatus sendStatus;
+
+        @ApiModelProperty("发送时间")
+        private Date sendTime;
+
+        @ApiModelProperty("消息标题")
+        private String title;
+
+        @ApiModelProperty("文本消息")
+        private String textMessage;
+
+        @ApiModelProperty("图片消息")
+        private String imgMessage;
+
+        @ApiModelProperty("图片地址")
+        private String imgUrl;
+
+        @ApiModelProperty("创建用户")
+        private Long createBy;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+
+        @ApiModelProperty("创建用户")
+        private String createUser;
+
+        @ApiModelProperty("目标人群")
+        private List<CustomerServiceReceiveWrapper.CustomerServiceReceive> receives;
+
+        @ApiModelProperty("声部名称")
+        private String subjectName;
+
+        @ApiModelProperty("目标群体名称")
+        private String targetGroupName;
+        
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceBatchSending from(String json) {
+            return JSON.parseObject(json, CustomerServiceBatchSending.class);
+        }
+
+
+        public CustomerServiceBatchSending targetGroup(String targetGroup) {
+            this.targetGroup = targetGroup;
+            return this;
+        }
+
+        public CustomerServiceBatchSending sendSubject(String sendSubject) {
+            this.sendSubject = sendSubject;
+            return this;
+        }
+
+        public CustomerServiceBatchSending createUser(String createUser) {
+            this.createUser = createUser;
+            return this;
+        }
+    }
+
+}

+ 77 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/im/CustomerServiceReceiveWrapper.java

@@ -0,0 +1,77 @@
+package com.yonge.cooleshow.biz.dal.wrapper.im;
+
+import com.alibaba.fastjson.JSON;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Date;
+import java.util.Optional;
+
+/**
+ * 客服群发接收
+ * 2022-12-09 10:49:10
+ */
+@ApiModel(value = "CustomerServiceReceiveWrapper对象", description = "客服群发接收查询对象")
+public class CustomerServiceReceiveWrapper {
+
+    @Data
+	@Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" CustomerServiceReceiveQuery-客服群发接收")
+    public static class CustomerServiceReceiveQuery extends QueryInfo {
+    
+        @ApiModelProperty("关键字匹配")
+		private String keyword;
+        
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+        
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceReceiveQuery from(String json) {
+            return JSON.parseObject(json, CustomerServiceReceiveQuery.class);
+        }
+    }  
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+	@ApiModel(" CustomerServiceReceive-客服群发接收")
+    public static class CustomerServiceReceive {
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+        @ApiModelProperty("群发消息ID")
+        private Long batchSendingId;
+
+        @ApiModelProperty("用户ID")
+        private Long userId;
+
+        @ApiModelProperty("用户身份")
+        private String clientType;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+        
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static CustomerServiceReceive from(String json) {
+            return JSON.parseObject(json, CustomerServiceReceive.class);
+        }
+	}
+
+}

+ 32 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CustomerServiceBatchSendingMapper.xml

@@ -0,0 +1,32 @@
+<?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.yonge.cooleshow.biz.dal.mapper.CustomerServiceBatchSendingMapper">
+
+	 
+    
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+         t.id_ AS id
+        , t.target_group_ AS targetGroup
+        , t.send_subject_ AS sendSubject
+        , t.receive_number_ AS receiveNumber
+        , t.receive_type_ AS receiveType
+        , t.send_type_ AS sendType
+        , t.send_status_ AS sendStatus
+        , t.send_time_ AS sendTime
+        , t.title_ AS title
+        , t.text_message_ AS textMessage
+        , t.img_message_ AS imgMessage
+        , t.img_url_ AS imgUrl
+        , t.create_by_ AS createBy
+        , t.create_time_ AS createTime
+    </sql>
+    
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.im.CustomerServiceBatchSendingWrapper$CustomerServiceBatchSending">
+		SELECT         
+        	<include refid="baseColumns" />
+		FROM customer_service_batch_sending t
+        ORDER BY t.id_ DESC
+	</select>
+    
+</mapper>

+ 21 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CustomerServiceReceiveMapper.xml

@@ -0,0 +1,21 @@
+<?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.yonge.cooleshow.biz.dal.mapper.CustomerServiceReceiveMapper">
+
+	 
+    
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+         t.id_ AS id
+        , t.user_id_ AS userId
+        , t.client_type_ AS clientType
+        , t.create_time_ AS createTime
+    </sql>
+    
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.CustomerServiceReceive">
+		SELECT         
+        	<include refid="baseColumns" />
+		FROM customer_service_receive t
+	</select>
+    
+</mapper>