فهرست منبع

add(backend) [客服消息 版本]

wangxiao 4 سال پیش
والد
کامیت
d168996532
19فایلهای تغییر یافته به همراه694 افزوده شده و 31 حذف شده
  1. 90 0
      operation-backend/src/main/java/com/idiot/operationbackend/controller/group/CustomerMsgController.java
  2. 19 0
      operation-backend/src/main/java/com/idiot/operationbackend/controller/group/GroupMsgController.java
  3. 1 0
      operation-backend/src/main/java/com/idiot/operationbackend/controller/interactive/AccountMenuController.java
  4. 1 0
      operation-backend/src/main/java/com/idiot/operationbackend/controller/interactive/FollowReplyController.java
  5. 1 1
      operation-backend/src/main/java/com/idiot/operationbackend/controller/interactive/QrCodeController.java
  6. 109 0
      operation-backend/src/main/java/com/idiot/operationbackend/entity/AccountCustomerMsg.java
  7. 180 1
      operation-backend/src/main/java/com/idiot/operationbackend/entity/CustomerMsg.java
  8. 9 28
      operation-backend/src/main/java/com/idiot/operationbackend/entity/QrCode.java
  9. 11 0
      operation-backend/src/main/java/com/idiot/operationbackend/mappers/AccountCustomerMsgMapper.java
  10. 11 0
      operation-backend/src/main/java/com/idiot/operationbackend/mappers/CustomerMsgMapper.java
  11. 23 0
      operation-backend/src/main/java/com/idiot/operationbackend/service/facade/AccountCustomerMsgService.java
  12. 10 0
      operation-backend/src/main/java/com/idiot/operationbackend/service/facade/AuthUserService.java
  13. 26 0
      operation-backend/src/main/java/com/idiot/operationbackend/service/facade/CustomerMsgService.java
  14. 46 0
      operation-backend/src/main/java/com/idiot/operationbackend/service/impl/AccountCustomerMsgServiceImpl.java
  15. 13 0
      operation-backend/src/main/java/com/idiot/operationbackend/service/impl/AuthUserServiceImpl.java
  16. 40 0
      operation-backend/src/main/java/com/idiot/operationbackend/service/impl/CustomerMsgServiceImpl.java
  17. 17 0
      operation-backend/src/main/java/com/idiot/operationbackend/support/Constants.java
  18. 46 0
      operation-backend/src/main/java/com/idiot/operationbackend/vo/BaseType.java
  19. 41 1
      sql/dataBase.sql

+ 90 - 0
operation-backend/src/main/java/com/idiot/operationbackend/controller/group/CustomerMsgController.java

@@ -0,0 +1,90 @@
+package com.idiot.operationbackend.controller.group;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.idiot.operationbackend.entity.AccountCustomerMsg;
+import com.idiot.operationbackend.entity.CustomerMsg;
+import com.idiot.operationbackend.service.facade.AccountCustomerMsgService;
+import com.idiot.operationbackend.service.facade.AuthUserService;
+import com.idiot.operationbackend.service.facade.CustomerMsgService;
+import com.idiot.operationbackend.support.Constants;
+import com.idiot.operationbackend.support.JsonResult;
+import com.idiot.operationbackend.util.JwtTokenUtil;
+import com.idiot.operationbackend.vo.BaseType;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 客服消息
+ * @author wang xiao
+ * @date Created in 14:48 2020/9/22
+ */
+@RestController
+@RequestMapping("/customer")
+@Api(value = "CustomerMsgController", tags ="客服消息")
+public class CustomerMsgController {
+
+    private final Logger logger = LoggerFactory.getLogger(CustomerMsgController.class);
+
+    @Autowired
+    private AuthUserService userService;
+
+    @Autowired
+    private CustomerMsgService customerMsgService;
+
+    @Autowired
+    private AccountCustomerMsgService accountCustomerMsgService;
+
+
+    @GetMapping
+    @ApiOperation(value = "查询客服消息")
+    public ResponseEntity<JsonResult<Page<CustomerMsg>>> pageCustomerMsg (@RequestHeader String token,
+                                                                          @RequestParam int page,
+                                                                          @RequestParam(required = false) String status,
+                                                                          @RequestParam(required = false) String startDate,
+                                                                          @RequestParam(required = false) String endDate) {
+        String userId = JwtTokenUtil.getUserId(token);
+        String authId = userService.queryAuthId(userId);
+        logger.info("用户:{}查询客服消息列表 page:{},authId:{}",userId,page,authId);
+        Page<CustomerMsg> customerMsgPage = customerMsgService.queryPageCustomerMsg(status,page,startDate,endDate,authId);
+        return ResponseEntity.ok(JsonResult.success(customerMsgPage));
+
+    }
+
+    @GetMapping("/{msgId}")
+    @ApiOperation(value = "该客服消息下公众号发送详情")
+    public ResponseEntity<JsonResult<List<AccountCustomerMsg>>> accountMsg (@PathVariable String msgId) {
+
+        logger.info("查询客服消息公众号详情列表,nsgId:{}",msgId);
+        List<AccountCustomerMsg> accountCustomerMsgs = accountCustomerMsgService.queryByMsgId(msgId);
+        return ResponseEntity.ok(JsonResult.success(accountCustomerMsgs));
+    }
+
+    @GetMapping("/type")
+    @ApiOperation(value = "客服消息状态码")
+    public ResponseEntity<JsonResult<List<BaseType>>> customerStatus () {
+
+        List<BaseType> baseTypes = new ArrayList<>(4);
+        BaseType success  = new BaseType(Constants.SUCCESSED,"发送成功");
+        BaseType waiting  = new BaseType(Constants.WAITING,"未发送");
+        BaseType run  = new BaseType(Constants.RUNING,"发送中");
+        BaseType end  = new BaseType(Constants.END,"发送中止");
+        BaseType fail  = new BaseType(Constants.FAILD,"发送失败");
+        baseTypes.add(success);
+        baseTypes.add(waiting);
+        baseTypes.add(run);
+        baseTypes.add(end);
+        baseTypes.add(fail);
+        return ResponseEntity.ok(JsonResult.success(baseTypes));
+    }
+
+
+
+}

+ 19 - 0
operation-backend/src/main/java/com/idiot/operationbackend/controller/group/GroupMsgController.java

@@ -0,0 +1,19 @@
+package com.idiot.operationbackend.controller.group;
+
+import io.swagger.annotations.Api;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 高级群发
+ * @author wang xiao
+ * @date Created in 16:29 2020/9/22
+ */
+@RestController
+@RequestMapping("/group")
+@Api(value = "GroupMsgController", tags ="高级群发")
+public class GroupMsgController {
+
+
+
+}

+ 1 - 0
operation-backend/src/main/java/com/idiot/operationbackend/controller/interactive/AccountMenuController.java

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 /**
+ * 自定义菜单
  * @author wang xiao
  * @date Created in 20:15 2020/9/21
  */

+ 1 - 0
operation-backend/src/main/java/com/idiot/operationbackend/controller/interactive/FollowReplyController.java

@@ -19,6 +19,7 @@ import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
+ *  被关注回复
  * @author wang xiao
  * @date Created in 17:30 2020/9/21
  */

+ 1 - 1
operation-backend/src/main/java/com/idiot/operationbackend/controller/interactive/QrCodeController.java

@@ -70,7 +70,7 @@ public class QrCodeController {
         String accountId = qrCode.getAccountId();
         Account account = accountService.getById(accountId);
         qrCode.setNikeName(account.getNickName());
-        qrCode.setHeadImg(account.getHeadImg());
+        qrCode.setHeadImage(account.getHeadImg());
         qrCodeService.save(qrCode);
         String wxJson = weChatService.createQrCode(qrCode,accountId);
         boolean upResult = qrCodeService.upQrCode(qrCode,wxJson);

+ 109 - 0
operation-backend/src/main/java/com/idiot/operationbackend/entity/AccountCustomerMsg.java

@@ -0,0 +1,109 @@
+package com.idiot.operationbackend.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+ * 公众号客服消息
+ * @author wang xiao
+ * @date Created in 15:49 2020/9/22
+ */
+@TableName("t_account_customer_msg")
+public class AccountCustomerMsg {
+
+    @TableId
+    private String id;
+
+    private String msgId;
+
+    private String accountId;
+
+    private Long successNum;
+
+    private Long preSuccessNum;
+
+    private Integer status;
+
+    @TableField(exist = false)
+    private String nikeName;
+
+    @TableField(exist = false)
+    private String headImg;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getMsgId() {
+        return msgId;
+    }
+
+    public void setMsgId(String msgId) {
+        this.msgId = msgId;
+    }
+
+    public String getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(String accountId) {
+        this.accountId = accountId;
+    }
+
+    public Long getSuccessNum() {
+        return successNum;
+    }
+
+    public void setSuccessNum(Long successNum) {
+        this.successNum = successNum;
+    }
+
+    public Long getPreSuccessNum() {
+        return preSuccessNum;
+    }
+
+    public void setPreSuccessNum(Long preSuccessNum) {
+        this.preSuccessNum = preSuccessNum;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getNikeName() {
+        return nikeName;
+    }
+
+    public void setNikeName(String nikeName) {
+        this.nikeName = nikeName;
+    }
+
+    public String getHeadImg() {
+        return headImg;
+    }
+
+    public void setHeadImg(String headImg) {
+        this.headImg = headImg;
+    }
+
+    @Override
+    public String toString() {
+        return "AccountCustomerMsg{" +
+                "id='" + id + '\'' +
+                ", msgId='" + msgId + '\'' +
+                ", accountId='" + accountId + '\'' +
+                ", successNum=" + successNum +
+                ", preSuccessNum=" + preSuccessNum +
+                ", status=" + status +
+                '}';
+    }
+}

+ 180 - 1
operation-backend/src/main/java/com/idiot/operationbackend/entity/CustomerMsg.java

@@ -1,19 +1,198 @@
 package com.idiot.operationbackend.entity;
 
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 
 /**
  * 客服消息
  * @author wang xiao
  * @date Created in 13:55 2020/9/22
  */
+@TableName("t_customer_msg")
 public class CustomerMsg {
 
     @TableId
     private String id;
 
-    private String accountId;
+    private String accountIds;
 
     private String label;
 
+    private String contents;
+
+    private String sendTime;
+
+    /**
+     * 0 条件筛选 1 全部
+     */
+    private Integer type;
+
+    private Integer selectSex;
+
+    private String  selectSubscribeTime;
+
+    private String selectProvince;
+
+    private String selectCity;
+
+    private String selectTag;
+
+    private Long successNum;
+
+    private Long preSuccessNum;
+
+    private Integer status;
+
+    private String createTime;
+
+    private String authId;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public String getContents() {
+        return contents;
+    }
+
+    public void setContents(String contents) {
+        this.contents = contents;
+    }
+
+    public String getSendTime() {
+        return sendTime;
+    }
+
+    public void setSendTime(String sendTime) {
+        this.sendTime = sendTime;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getSelectSex() {
+        return selectSex;
+    }
+
+    public void setSelectSex(Integer selectSex) {
+        this.selectSex = selectSex;
+    }
+
+    public String getSelectSubscribeTime() {
+        return selectSubscribeTime;
+    }
+
+    public void setSelectSubscribeTime(String selectSubscribeTime) {
+        this.selectSubscribeTime = selectSubscribeTime;
+    }
+
+    public String getSelectProvince() {
+        return selectProvince;
+    }
+
+    public void setSelectProvince(String selectProvince) {
+        this.selectProvince = selectProvince;
+    }
+
+    public String getSelectCity() {
+        return selectCity;
+    }
+
+    public void setSelectCity(String selectCity) {
+        this.selectCity = selectCity;
+    }
+
+    public String getSelectTag() {
+        return selectTag;
+    }
+
+    public void setSelectTag(String selectTag) {
+        this.selectTag = selectTag;
+    }
+
+    public Long getSuccessNum() {
+        return successNum;
+    }
+
+    public void setSuccessNum(Long successNum) {
+        this.successNum = successNum;
+    }
+
+    public Long getPreSuccessNum() {
+        return preSuccessNum;
+    }
+
+    public void setPreSuccessNum(Long preSuccessNum) {
+        this.preSuccessNum = preSuccessNum;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getAccountIds() {
+        return accountIds;
+    }
+
+    public void setAccountIds(String accountIds) {
+        this.accountIds = accountIds;
+    }
+
+    public String getAuthId() {
+        return authId;
+    }
+
+    public void setAuthId(String authId) {
+        this.authId = authId;
+    }
+
+    @Override
+    public String toString() {
+        return "CustomerMsg{" +
+                "id='" + id + '\'' +
+                ", accountIds='" + accountIds + '\'' +
+                ", label='" + label + '\'' +
+                ", contents='" + contents + '\'' +
+                ", sendTime='" + sendTime + '\'' +
+                ", type=" + type +
+                ", selectSex=" + selectSex +
+                ", selectSubscribeTime='" + selectSubscribeTime + '\'' +
+                ", selectProvince='" + selectProvince + '\'' +
+                ", selectCity='" + selectCity + '\'' +
+                ", selectTag='" + selectTag + '\'' +
+                ", successNum=" + successNum +
+                ", preSuccessNum=" + preSuccessNum +
+                ", createTime='" + createTime + '\'' +
+                '}';
+    }
 }

+ 9 - 28
operation-backend/src/main/java/com/idiot/operationbackend/entity/QrCode.java

@@ -1,12 +1,12 @@
 package com.idiot.operationbackend.entity;
 
-import com.baomidou.mybatisplus.annotation.TableField;
+
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import org.springframework.beans.factory.annotation.Autowired;
+
 
 import javax.validation.constraints.NotEmpty;
-import java.util.List;
+
 
 /**
  * 二维码内容
@@ -21,7 +21,7 @@ public class QrCode {
 
     private String nikeName;
 
-    private String headImg;
+    private String headImage;
 
     @NotEmpty(message = "请选择公众号")
     private String accountId;
@@ -149,12 +149,12 @@ public class QrCode {
         this.nikeName = nikeName;
     }
 
-    public String getHeadImg() {
-        return headImg;
+    public String getHeadImage() {
+        return headImage;
     }
 
-    public void setHeadImg(String headImg) {
-        this.headImg = headImg;
+    public void setHeadImage(String headImage) {
+        this.headImage = headImage;
     }
 
     public String getTicket() {
@@ -173,24 +173,5 @@ public class QrCode {
         this.content = content;
     }
 
-    @Override
-    public String toString() {
-        return "QrCode{" +
-                "id='" + id + '\'' +
-                ", nikeName='" + nikeName + '\'' +
-                ", headImg='" + headImg + '\'' +
-                ", accountId='" + accountId + '\'' +
-                ", label='" + label + '\'' +
-                ", type=" + type +
-                ", totalNum=" + totalNum +
-                ", newNum=" + newNum +
-                ", followNum=" + followNum +
-                ", url='" + url + '\'' +
-                ", ticket='" + ticket + '\'' +
-                ", pushType=" + pushType +
-                ", content='" + content + '\'' +
-                ", createTime='" + createTime + '\'' +
-                ", expireTime='" + expireTime + '\'' +
-                '}';
-    }
+
 }

+ 11 - 0
operation-backend/src/main/java/com/idiot/operationbackend/mappers/AccountCustomerMsgMapper.java

@@ -0,0 +1,11 @@
+package com.idiot.operationbackend.mappers;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.idiot.operationbackend.entity.AccountCustomerMsg;
+
+/**
+ * @author wang xiao
+ * @date Created in 15:58 2020/9/22
+ */
+public interface AccountCustomerMsgMapper extends BaseMapper<AccountCustomerMsg> {
+}

+ 11 - 0
operation-backend/src/main/java/com/idiot/operationbackend/mappers/CustomerMsgMapper.java

@@ -0,0 +1,11 @@
+package com.idiot.operationbackend.mappers;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.idiot.operationbackend.entity.CustomerMsg;
+
+/**
+ * @author wang xiao
+ * @date Created in 15:14 2020/9/22
+ */
+public interface CustomerMsgMapper extends BaseMapper<CustomerMsg> {
+}

+ 23 - 0
operation-backend/src/main/java/com/idiot/operationbackend/service/facade/AccountCustomerMsgService.java

@@ -0,0 +1,23 @@
+package com.idiot.operationbackend.service.facade;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.idiot.operationbackend.entity.AccountCustomerMsg;
+
+import java.util.List;
+
+/**
+ * @author wang xiao
+ * @date Created in 15:58 2020/9/22
+ */
+public interface AccountCustomerMsgService  extends IService<AccountCustomerMsg> {
+
+
+    /**
+     *  查询
+     * @author wangxiao
+     * @date 16:07 2020/9/22
+     * @param msgId
+     * @return java.util.List<com.idiot.operationbackend.entity.AccountCustomerMsg>
+     */
+    List<AccountCustomerMsg> queryByMsgId(String msgId);
+}

+ 10 - 0
operation-backend/src/main/java/com/idiot/operationbackend/service/facade/AuthUserService.java

@@ -51,4 +51,14 @@ public interface AuthUserService extends IService<AuthUser> {
      * @return boolean
      */
     boolean saveUserAndDigPassword(AuthUser authUser);
+
+
+    /**
+     *  查询认证授权id
+     * @author wangxiao
+     * @date 15:06 2020/9/22
+     * @param userId
+     * @return java.lang.String
+     */
+    String queryAuthId(String userId);
 }

+ 26 - 0
operation-backend/src/main/java/com/idiot/operationbackend/service/facade/CustomerMsgService.java

@@ -0,0 +1,26 @@
+package com.idiot.operationbackend.service.facade;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.idiot.operationbackend.entity.CustomerMsg;
+
+/**
+ * @author wang xiao
+ * @date Created in 15:14 2020/9/22
+ */
+public interface CustomerMsgService extends IService<CustomerMsg> {
+
+
+    /**
+     *  查询客服消息
+     * @author wangxiao
+     * @date 15:19 2020/9/22
+     * @param status status
+     * @param page page
+     * @param startDate startDate
+     * @param endDate endDate
+     * @param authId authId
+     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.idiot.operationbackend.entity.CustomerMsg>
+     */
+    Page<CustomerMsg> queryPageCustomerMsg (String status,int page,String startDate,String endDate,String authId);
+}

+ 46 - 0
operation-backend/src/main/java/com/idiot/operationbackend/service/impl/AccountCustomerMsgServiceImpl.java

@@ -0,0 +1,46 @@
+package com.idiot.operationbackend.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.idiot.operationbackend.entity.AccountCustomerMsg;
+import com.idiot.operationbackend.mappers.AccountCustomerMsgMapper;
+import com.idiot.operationbackend.service.facade.AccountCustomerMsgService;
+import com.idiot.operationbackend.service.facade.AccountService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * @author wang xiao
+ * @date Created in 15:59 2020/9/22
+ */
+@Service
+public class AccountCustomerMsgServiceImpl extends ServiceImpl<AccountCustomerMsgMapper, AccountCustomerMsg>
+        implements AccountCustomerMsgService {
+
+
+    @Autowired
+    private AccountService accountService;
+
+    @Override
+    public List<AccountCustomerMsg> queryByMsgId(String msgId) {
+        List<AccountCustomerMsg> accountCustomerMsgs =  list(Wrappers.<AccountCustomerMsg>lambdaQuery()
+                .eq(AccountCustomerMsg::getMsgId,msgId)
+                .orderByAsc(AccountCustomerMsg::getStatus));
+
+        if (CollectionUtils.isNotEmpty(accountCustomerMsgs)) {
+            for (AccountCustomerMsg customerMsg : accountCustomerMsgs) {
+                Optional.ofNullable(accountService.getById(customerMsg.getAccountId()))
+                        .map(e->{
+                            customerMsg.setNikeName(e.getNickName());
+                            customerMsg.setHeadImg(e.getHeadImg());
+                            return customerMsg;
+                        });
+            }
+        }
+        return accountCustomerMsgs;
+    }
+}

+ 13 - 0
operation-backend/src/main/java/com/idiot/operationbackend/service/impl/AuthUserServiceImpl.java

@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.idiot.operationbackend.entity.AuthUser;
 import com.idiot.operationbackend.mappers.AuthUserMapper;
 import com.idiot.operationbackend.service.facade.AuthUserService;
+import com.idiot.operationbackend.support.CustomException;
 import org.springframework.stereotype.Service;
 import org.springframework.util.DigestUtils;
 import org.springframework.util.StringUtils;
 
 import java.util.List;
+import java.util.Objects;
 
 
 /**
@@ -53,4 +55,15 @@ public class AuthUserServiceImpl extends ServiceImpl<AuthUserMapper, AuthUser>
         }
         return save(authUser);
     }
+
+
+    @Override
+    public String queryAuthId(String userId) {
+        AuthUser user  = getById(userId);
+        if (Objects.isNull(user)) {
+            throw new CustomException(500,"用户不存在");
+        }
+        String authId = Objects.nonNull(user.getParentUserId())?user.getParentUserId():userId;
+        return authId;
+    }
 }

+ 40 - 0
operation-backend/src/main/java/com/idiot/operationbackend/service/impl/CustomerMsgServiceImpl.java

@@ -0,0 +1,40 @@
+package com.idiot.operationbackend.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.idiot.operationbackend.entity.CustomerMsg;
+import com.idiot.operationbackend.mappers.CustomerMsgMapper;
+import com.idiot.operationbackend.service.facade.CustomerMsgService;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * @author wang xiao
+ * @date Created in 15:15 2020/9/22
+ */
+@Service
+public class CustomerMsgServiceImpl extends ServiceImpl<CustomerMsgMapper, CustomerMsg>
+        implements CustomerMsgService {
+
+    @Override
+    public Page<CustomerMsg> queryPageCustomerMsg(String status, int page, String startDate, String endDate, String authId) {
+
+        Page<CustomerMsg> queryPage = new Page<>(page,15);
+        LambdaQueryWrapper<CustomerMsg> queryWrapper = Wrappers.<CustomerMsg>lambdaQuery();
+        queryWrapper.eq(CustomerMsg::getAuthId,authId);
+        if (StringUtils.isNotBlank(status)) {
+            queryWrapper.eq(CustomerMsg::getStatus,status);
+        }
+        if (StringUtils.isNotBlank(startDate)) {
+            queryWrapper.ge(CustomerMsg::getCreateTime,startDate);
+        }
+        if (StringUtils.isNotBlank(endDate)) {
+            queryWrapper.le(CustomerMsg::getCreateTime,endDate);
+        }
+        queryWrapper.orderByDesc(CustomerMsg::getCreateTime);
+        return page(queryPage,queryWrapper);
+    }
+}

+ 17 - 0
operation-backend/src/main/java/com/idiot/operationbackend/support/Constants.java

@@ -84,6 +84,23 @@ public class Constants {
 
     public static final String THUMB = "thumb";
 
+
+    /**
+     *  '0'-已发送,'1'-未发送,'2'-发送中, '3'-发送终止,4'-发送失败
+     * @author wangxiao
+     */
+     public static final Integer SUCCESSED = 0;
+
+     public static final Integer WAITING = 1;
+
+     public static final Integer RUNING = 2;
+
+     public static final Integer END = 3;
+
+     public static final Integer FAILD = 4;
+
+
+
     /**
      *  计算 比率
      * @author wangxiao

+ 46 - 0
operation-backend/src/main/java/com/idiot/operationbackend/vo/BaseType.java

@@ -0,0 +1,46 @@
+package com.idiot.operationbackend.vo;
+
+/**
+ * 无聊才会建个这个类 json 不香嘛???????
+ * @author wang xiao
+ * @date Created in 15:34 2020/9/22
+ */
+public class BaseType {
+
+    private Integer code;
+
+    private String label;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+
+    public BaseType() {
+    }
+
+    public BaseType(Integer code, String label) {
+        this.code = code;
+        this.label = label;
+    }
+
+    @Override
+    public String toString() {
+        return "BaseType{" +
+                "code='" + code + '\'' +
+                ", label='" + label + '\'' +
+                '}';
+    }
+}

+ 41 - 1
sql/dataBase.sql

@@ -285,13 +285,14 @@ CREATE TABLE `t_qr_code`  (
   `ticket` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'ticket',
   `push_type` int(0) NULL DEFAULT NULL COMMENT '推送方式',
   `nike_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '公众号名称 冗余',
-  `head_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '公众号头像 冗余',
+  `head_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '公众号头像 冗余',
   `expire_time` datetime(0) NULL DEFAULT NULL COMMENT '过期时间',
   `contents` json NULL COMMENT '扫描二维码推送内容',
   `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '二维码' ROW_FORMAT = Dynamic;
 
+
 -- ----------------------------
 -- Table structure for t_account_menu 公众号菜单
 -- ----------------------------
@@ -335,3 +336,42 @@ INSERT INTO `t_menu_type` VALUES (8, 'location_select', '弹出地理位置选
 INSERT INTO `t_menu_type` VALUES (9, 'media_id', '下发消息(除文本消息)用户点击media_id类型按钮后,微信服务器会将开发者填写的永久素材id对应的素材下发给用户,永久素材类型可以是图片、音频、视频、图文消息');
 INSERT INTO `t_menu_type` VALUES (10, 'view_limited', '跳转图文消息URL用户点击view_limited类型按钮后,微信客户端将打开开发者在按钮中填写的永久素材id对应的图文消息URL,永久素材类型只支持图文消息');
 
+
+
+-- ----------------------------
+-- Table structure for t_customer_msg 客服消息
+-- ----------------------------
+DROP TABLE IF EXISTS `t_customer_msg`;
+CREATE TABLE `t_customer_msg`  (
+  `id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'id',
+  `account_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '公众号id',
+  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '消息名称',
+  `contents` json NULL COMMENT '消息内容',
+  `send_time` datetime(0) NULL DEFAULT NULL COMMENT '发送时间',
+  `type` int(0) NULL DEFAULT NULL COMMENT '类型 0 全部粉丝 1 筛选粉丝',
+  `select_sex` int(0) NULL DEFAULT NULL COMMENT '筛选性别',
+  `select_subscribe_time` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '筛选关注时间',
+  `select_province` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '省份',
+  `select_city` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '城市',
+  `select_tag` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '标签',
+  `success_num` int(0) NULL DEFAULT NULL COMMENT '发送成功',
+  `pre_success_num` int(0) NULL DEFAULT NULL COMMENT '预计成功',
+  `status` int(0) NULL DEFAULT NULL COMMENT '状态',
+  `auth_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '认证权限id parentUserId',
+  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '客服消息' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for t_account_customer_msg 公众客服消息 
+-- ----------------------------
+DROP TABLE IF EXISTS `t_account_customer_msg`;
+CREATE TABLE `t_account_customer_msg`  (
+  `id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'id',
+  `msg_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '消息id',
+  `account_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '公众号id',
+  `success_num` int(0) NULL DEFAULT NULL COMMENT '成功人数',
+  `pre_success_num` int(0) NULL DEFAULT NULL COMMENT '预计成功',
+  `status` int(0) NULL DEFAULT NULL COMMENT '状态码',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '公众号客服消息' ROW_FORMAT = Dynamic;