Ver Fonte

增加朋友圈发送功能

xueyiming há 3 semanas atrás
pai
commit
a24ddd51db

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java

@@ -20,9 +20,9 @@ public class MybatisGeneratorMain {
             throws SQLException, IOException, InterruptedException, InvalidConfigurationException, XMLParserException {
         List<String> warnings = new ArrayList<>();
 
-//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-generator-config.xml").getFile());
+        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-generator-config.xml").getFile());
 //        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-generator-config.xml").getFile());
-        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-contentPlatform-generator-config.xml").getFile());
+//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-contentPlatform-generator-config.xml").getFile());
         ConfigurationParser cp = new ConfigurationParser(warnings);
         Configuration config = cp.parseConfiguration(configFile);
         DefaultShellCallback callback = new DefaultShellCallback(true);

+ 1 - 1
api-module/src/main/resources/mybatis-generator-config.xml

@@ -58,7 +58,7 @@
 <!--        <table tableName="we_com_special_pre_send_message" domainObjectName="PreSpecialSendMessage" alias=""/>-->
 <!--        <table tableName="we_com_send_msg_result" domainObjectName="SendMsgResult" alias=""/>-->
 <!--        <table tableName="we_com_corp" domainObjectName="Corp" alias=""/>-->
-        <table tableName="we_com_user_with_tag" domainObjectName="UserWithTag" alias=""/>
+        <table tableName="we_com_moment_send_message" domainObjectName="MomentSendMessage" alias=""/>
 
 
     </context>

+ 3 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/constant/WeComConstant.java

@@ -40,4 +40,7 @@ public interface WeComConstant {
 
     //用户增加新标签
     String POST_WE_COM_ADD_USER_TAG = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/mark_tag";
+
+    //发送朋友圈
+    String POST_WE_COM_ADD_MOMENT_TASK = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_moment_task";
 }

+ 35 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/MomentSendMessageMapper.java

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.MomentSendMessage;
+import com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface MomentSendMessageMapper {
+    long countByExample(MomentSendMessageExample example);
+
+    int deleteByExample(MomentSendMessageExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(MomentSendMessage record);
+
+    int insertSelective(MomentSendMessage record);
+
+    List<MomentSendMessage> selectByExample(MomentSendMessageExample example);
+
+    MomentSendMessage selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") MomentSendMessage record, @Param("example") MomentSendMessageExample example);
+
+    int updateByExample(@Param("record") MomentSendMessage record, @Param("example") MomentSendMessageExample example);
+
+    int updateByPrimaryKeySelective(MomentSendMessage record);
+
+    int updateByPrimaryKey(MomentSendMessage record);
+}

+ 103 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/MomentSendMessage.java

@@ -0,0 +1,103 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class MomentSendMessage {
+    private Long id;
+
+    private String preSendDate;
+
+    private Long staffId;
+
+    private String content;
+
+    private String attachmentIds;
+
+    private Integer isSend;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getPreSendDate() {
+        return preSendDate;
+    }
+
+    public void setPreSendDate(String preSendDate) {
+        this.preSendDate = preSendDate;
+    }
+
+    public Long getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(Long staffId) {
+        this.staffId = staffId;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getAttachmentIds() {
+        return attachmentIds;
+    }
+
+    public void setAttachmentIds(String attachmentIds) {
+        this.attachmentIds = attachmentIds;
+    }
+
+    public Integer getIsSend() {
+        return isSend;
+    }
+
+    public void setIsSend(Integer isSend) {
+        this.isSend = isSend;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", preSendDate=").append(preSendDate);
+        sb.append(", staffId=").append(staffId);
+        sb.append(", content=").append(content);
+        sb.append(", attachmentIds=").append(attachmentIds);
+        sb.append(", isSend=").append(isSend);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 722 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/MomentSendMessageExample.java

@@ -0,0 +1,722 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class MomentSendMessageExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public MomentSendMessageExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateIsNull() {
+            addCriterion("pre_send_date is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateIsNotNull() {
+            addCriterion("pre_send_date is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateEqualTo(String value) {
+            addCriterion("pre_send_date =", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateNotEqualTo(String value) {
+            addCriterion("pre_send_date <>", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateGreaterThan(String value) {
+            addCriterion("pre_send_date >", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateGreaterThanOrEqualTo(String value) {
+            addCriterion("pre_send_date >=", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateLessThan(String value) {
+            addCriterion("pre_send_date <", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateLessThanOrEqualTo(String value) {
+            addCriterion("pre_send_date <=", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateLike(String value) {
+            addCriterion("pre_send_date like", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateNotLike(String value) {
+            addCriterion("pre_send_date not like", value, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateIn(List<String> values) {
+            addCriterion("pre_send_date in", values, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateNotIn(List<String> values) {
+            addCriterion("pre_send_date not in", values, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateBetween(String value1, String value2) {
+            addCriterion("pre_send_date between", value1, value2, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPreSendDateNotBetween(String value1, String value2) {
+            addCriterion("pre_send_date not between", value1, value2, "preSendDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIsNull() {
+            addCriterion("staff_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIsNotNull() {
+            addCriterion("staff_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdEqualTo(Long value) {
+            addCriterion("staff_id =", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotEqualTo(Long value) {
+            addCriterion("staff_id <>", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdGreaterThan(Long value) {
+            addCriterion("staff_id >", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("staff_id >=", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdLessThan(Long value) {
+            addCriterion("staff_id <", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdLessThanOrEqualTo(Long value) {
+            addCriterion("staff_id <=", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIn(List<Long> values) {
+            addCriterion("staff_id in", values, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotIn(List<Long> values) {
+            addCriterion("staff_id not in", values, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdBetween(Long value1, Long value2) {
+            addCriterion("staff_id between", value1, value2, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotBetween(Long value1, Long value2) {
+            addCriterion("staff_id not between", value1, value2, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIsNull() {
+            addCriterion("content is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIsNotNull() {
+            addCriterion("content is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentEqualTo(String value) {
+            addCriterion("content =", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotEqualTo(String value) {
+            addCriterion("content <>", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentGreaterThan(String value) {
+            addCriterion("content >", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentGreaterThanOrEqualTo(String value) {
+            addCriterion("content >=", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentLessThan(String value) {
+            addCriterion("content <", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentLessThanOrEqualTo(String value) {
+            addCriterion("content <=", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentLike(String value) {
+            addCriterion("content like", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotLike(String value) {
+            addCriterion("content not like", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIn(List<String> values) {
+            addCriterion("content in", values, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotIn(List<String> values) {
+            addCriterion("content not in", values, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentBetween(String value1, String value2) {
+            addCriterion("content between", value1, value2, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotBetween(String value1, String value2) {
+            addCriterion("content not between", value1, value2, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsIsNull() {
+            addCriterion("attachment_ids is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsIsNotNull() {
+            addCriterion("attachment_ids is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsEqualTo(String value) {
+            addCriterion("attachment_ids =", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsNotEqualTo(String value) {
+            addCriterion("attachment_ids <>", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsGreaterThan(String value) {
+            addCriterion("attachment_ids >", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsGreaterThanOrEqualTo(String value) {
+            addCriterion("attachment_ids >=", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsLessThan(String value) {
+            addCriterion("attachment_ids <", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsLessThanOrEqualTo(String value) {
+            addCriterion("attachment_ids <=", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsLike(String value) {
+            addCriterion("attachment_ids like", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsNotLike(String value) {
+            addCriterion("attachment_ids not like", value, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsIn(List<String> values) {
+            addCriterion("attachment_ids in", values, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsNotIn(List<String> values) {
+            addCriterion("attachment_ids not in", values, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsBetween(String value1, String value2) {
+            addCriterion("attachment_ids between", value1, value2, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdsNotBetween(String value1, String value2) {
+            addCriterion("attachment_ids not between", value1, value2, "attachmentIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendIsNull() {
+            addCriterion("is_send is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendIsNotNull() {
+            addCriterion("is_send is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendEqualTo(Integer value) {
+            addCriterion("is_send =", value, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendNotEqualTo(Integer value) {
+            addCriterion("is_send <>", value, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendGreaterThan(Integer value) {
+            addCriterion("is_send >", value, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendGreaterThanOrEqualTo(Integer value) {
+            addCriterion("is_send >=", value, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendLessThan(Integer value) {
+            addCriterion("is_send <", value, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendLessThanOrEqualTo(Integer value) {
+            addCriterion("is_send <=", value, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendIn(List<Integer> values) {
+            addCriterion("is_send in", values, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendNotIn(List<Integer> values) {
+            addCriterion("is_send not in", values, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendBetween(Integer value1, Integer value2) {
+            addCriterion("is_send between", value1, value2, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsSendNotBetween(Integer value1, Integer value2) {
+            addCriterion("is_send not between", value1, value2, "isSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 29 - 2
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageServiceImpl.java

@@ -21,8 +21,7 @@ import java.io.IOException;
 import java.util.List;
 
 import static com.tzld.piaoquan.growth.common.common.constant.MessageConstant.specialStaffIdList;
-import static com.tzld.piaoquan.growth.common.common.constant.WeComConstant.POST_WE_COM_ADD_MSG_TEMPLATE;
-import static com.tzld.piaoquan.growth.common.common.constant.WeComConstant.POST_WE_COM_SEND_WELCOME_MSG;
+import static com.tzld.piaoquan.growth.common.common.constant.WeComConstant.*;
 
 
 @Slf4j
@@ -123,5 +122,33 @@ public class MessageServiceImpl implements MessageService {
         return msgResult;
     }
 
+    @Override
+    public boolean pushMomentMessage(JSONObject jsonObject, Long corpId) {
+        try {
+            String accessToken = weComAccessTokenService.getWeComAccessToken(corpId);
+            String url = POST_WE_COM_ADD_MOMENT_TASK
+                    + "?access_token=" + accessToken;
+            String s;
+            if (corpId == 1L) {
+                s = httpPoolClient.post(url, jsonObject.toJSONString());
+            } else {
+                s = proxyHttpPoolClient.post(url, jsonObject.toJSONString());
+            }
+            JSONObject res = JSONObject.parseObject(s);
+            log.info("pushMomentMessage res={}", res);
+            Integer code = res.getInteger("errcode");
+            if (code != 0) {
+                LarkRobotUtil.sendMessage("pushMomentMessage error" + "res:" + res.toJSONString());
+            }
+            return code == 0;
+        } catch (IOException e) {
+            LarkRobotUtil.sendMessage("pushMomentMessage error" + e.getMessage());
+            log.error("pushMomentMessage error", e);
+        }
+        return false;
+    }
+
+}
+
 
 }

+ 2 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/MessageService.java

@@ -16,4 +16,6 @@ public interface MessageService {
     CommonResponse<Void> createPreSpecialAssembleSendMessage(List<PreSpecialSendMessage> preSpecialSendMessages);
 
     MsgResult sendAutoReplyMessage(JSONObject jsonObject, Long corpId);
+
+    boolean pushMomentMessage(JSONObject jsonObject, Long corpId);
 }

+ 261 - 0
common-module/src/main/resources/mapper/MomentSendMessageMapper.xml

@@ -0,0 +1,261 @@
+<?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.tzld.piaoquan.growth.common.dao.mapper.MomentSendMessageMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="pre_send_date" jdbcType="VARCHAR" property="preSendDate" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="content" jdbcType="VARCHAR" property="content" />
+    <result column="attachment_ids" jdbcType="VARCHAR" property="attachmentIds" />
+    <result column="is_send" jdbcType="INTEGER" property="isSend" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, pre_send_date, staff_id, content, attachment_ids, is_send, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_moment_send_message
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from we_com_moment_send_message
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_moment_send_message
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample">
+    delete from we_com_moment_send_message
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
+    insert into we_com_moment_send_message (id, pre_send_date, staff_id, 
+      content, attachment_ids, is_send, 
+      create_time, update_time)
+    values (#{id,jdbcType=BIGINT}, #{preSendDate,jdbcType=VARCHAR}, #{staffId,jdbcType=BIGINT}, 
+      #{content,jdbcType=VARCHAR}, #{attachmentIds,jdbcType=VARCHAR}, #{isSend,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
+    insert into we_com_moment_send_message
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="preSendDate != null">
+        pre_send_date,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="content != null">
+        content,
+      </if>
+      <if test="attachmentIds != null">
+        attachment_ids,
+      </if>
+      <if test="isSend != null">
+        is_send,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="preSendDate != null">
+        #{preSendDate,jdbcType=VARCHAR},
+      </if>
+      <if test="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="content != null">
+        #{content,jdbcType=VARCHAR},
+      </if>
+      <if test="attachmentIds != null">
+        #{attachmentIds,jdbcType=VARCHAR},
+      </if>
+      <if test="isSend != null">
+        #{isSend,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample" resultType="java.lang.Long">
+    select count(*) from we_com_moment_send_message
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_moment_send_message
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.preSendDate != null">
+        pre_send_date = #{record.preSendDate,jdbcType=VARCHAR},
+      </if>
+      <if test="record.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.content != null">
+        content = #{record.content,jdbcType=VARCHAR},
+      </if>
+      <if test="record.attachmentIds != null">
+        attachment_ids = #{record.attachmentIds,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isSend != null">
+        is_send = #{record.isSend,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_moment_send_message
+    set id = #{record.id,jdbcType=BIGINT},
+      pre_send_date = #{record.preSendDate,jdbcType=VARCHAR},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      content = #{record.content,jdbcType=VARCHAR},
+      attachment_ids = #{record.attachmentIds,jdbcType=VARCHAR},
+      is_send = #{record.isSend,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
+    update we_com_moment_send_message
+    <set>
+      <if test="preSendDate != null">
+        pre_send_date = #{preSendDate,jdbcType=VARCHAR},
+      </if>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="content != null">
+        content = #{content,jdbcType=VARCHAR},
+      </if>
+      <if test="attachmentIds != null">
+        attachment_ids = #{attachmentIds,jdbcType=VARCHAR},
+      </if>
+      <if test="isSend != null">
+        is_send = #{isSend,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
+    update we_com_moment_send_message
+    set pre_send_date = #{preSendDate,jdbcType=VARCHAR},
+      staff_id = #{staffId,jdbcType=BIGINT},
+      content = #{content,jdbcType=VARCHAR},
+      attachment_ids = #{attachmentIds,jdbcType=VARCHAR},
+      is_send = #{isSend,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 121 - 0
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComMomentDataJob.java

@@ -0,0 +1,121 @@
+package com.tzld.piaoquan.offline.job;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.growth.common.common.enums.MessageAttachmentTypeEnum;
+import com.tzld.piaoquan.growth.common.dao.mapper.MomentSendMessageMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.StaffMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.UserWithTagMapper;
+import com.tzld.piaoquan.growth.common.model.po.MessageAttachment;
+import com.tzld.piaoquan.growth.common.model.po.MomentSendMessage;
+import com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample;
+import com.tzld.piaoquan.growth.common.model.po.Staff;
+import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
+import com.tzld.piaoquan.growth.common.service.MessageService;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.Objects;
+
+
+@Component
+public class WeComMomentDataJob {
+
+    @Autowired
+    private StaffMapper staffMapper;
+
+    @Autowired
+    private MessageService messageService;
+
+    @Autowired
+    private MessageAttachmentService messageAttachmentService;
+
+    @Autowired
+    UserWithTagMapper userWithTagMapper;
+
+    @Autowired
+    private MomentSendMessageMapper momentSendMessageMapper;
+
+
+    @XxlJob("sendMomentMessageJob")
+    public ReturnT<String> sendMomentMessage(String param) {
+        String thatDayDateString = DateUtil.getThatDayDateString();
+        MomentSendMessageExample example = new MomentSendMessageExample();
+        example.createCriteria().andPreSendDateEqualTo(thatDayDateString).andIsSendEqualTo(0);
+        List<MomentSendMessage> momentSendMessages = momentSendMessageMapper.selectByExample(example);
+        for (MomentSendMessage momentSendMessage : momentSendMessages) {
+            Staff staff = staffMapper.selectByPrimaryKey(momentSendMessage.getStaffId());
+            JSONObject jsonObject = new JSONObject();
+            JSONObject text = new JSONObject();
+            if (StringUtils.isNotEmpty(momentSendMessage.getContent())) {
+                text.put("content", momentSendMessage.getContent());
+            }
+            jsonObject.put("text", text);
+            String attachmentIds = momentSendMessage.getAttachmentIds();
+            JSONArray attachments = new JSONArray();
+            if (StringUtils.isNotEmpty(attachmentIds)) {
+                List<Long> attachmentIdList = JSONArray.parseArray(attachmentIds, Long.class);
+                if (!CollectionUtils.isEmpty(attachmentIdList)) {
+                    List<MessageAttachment> messageAttachments = messageAttachmentService.getMessageAttachment(attachmentIdList);
+                    if (!CollectionUtils.isEmpty(messageAttachments)) {
+                        for (MessageAttachment messageAttachment : messageAttachments) {
+                            Integer type = messageAttachment.getType();
+                            if (Objects.equals(MessageAttachmentTypeEnum.LINK.getCode(), type)) {
+                                JSONObject linkAttachment = new JSONObject();
+                                JSONObject link = new JSONObject();
+                                link.put("title", messageAttachment.getTitle());
+                                link.put("picurl", messageAttachment.getPicUrl());
+                                link.put("desc", messageAttachment.getDesc());
+                                link.put("url", messageAttachment.getUrl());
+                                linkAttachment.put("msgtype", "link");
+                                linkAttachment.put("link", link);
+                                attachments.add(linkAttachment);
+                            }
+
+                            if (Objects.equals(MessageAttachmentTypeEnum.IMAGE.getCode(), type)) {
+                                JSONObject imageAttachment = new JSONObject();
+                                JSONObject image = new JSONObject();
+                                image.put("media_id", messageAttachment.getMediaId());
+                                imageAttachment.put("msgtype", "image");
+                                imageAttachment.put("image", image);
+                                attachments.add(imageAttachment);
+                            }
+
+                            if (Objects.equals(MessageAttachmentTypeEnum.VIDEO.getCode(), type)) {
+                                JSONObject videoAttachment = new JSONObject();
+                                JSONObject image = new JSONObject();
+                                image.put("media_id", messageAttachment.getMediaId());
+                                videoAttachment.put("msgtype", "video");
+                                videoAttachment.put("video", image);
+                                attachments.add(videoAttachment);
+                            }
+                        }
+
+                    }
+                }
+            }
+            if (!attachments.isEmpty()) {
+                jsonObject.put("attachments", attachments);
+            }
+            JSONObject visibleRange = new JSONObject();
+            JSONObject senderList = new JSONObject();
+            JSONArray userList = new JSONArray();
+            userList.add(staff.getCarrierId());
+            senderList.put("user_list", userList);
+            visibleRange.put("sender_list", senderList);
+            jsonObject.put("visible_range", visibleRange);
+            boolean flag = messageService.pushMomentMessage(jsonObject, staff.getCorpId());
+            if (flag) {
+                momentSendMessage.setIsSend(1);
+                momentSendMessageMapper.updateByPrimaryKeySelective(momentSendMessage);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+}