Commit 24e87b5e by 陶光胜

微信和gic消息推送处理

parent 32080dba
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
/**
* Created by tgs on 2020/2/20.
*/
public class GicMessageDTO implements Serializable {
private String enterpriseId;
private String parentId;
private String parentChain;
private String id;
//1gic企业部门,2分组,3门店
private Integer type;
private String name;
//1新增,2修改,3删除
private Integer changeType;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getChangeType() {
return changeType;
}
public void setChangeType(Integer changeType) {
this.changeType = changeType;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getParentChain() {
return parentChain;
}
public void setParentChain(String parentChain) {
this.parentChain = parentChain;
}
}
package com.gic.haoban.manage.api.dto;
import javax.persistence.criteria.CriteriaBuilder;
import java.io.Serializable;
/**
* Created by tgs on 2020/2/15.
*/
public class QywxCallBackDTO implements Serializable{
private String suiteId;
private String infoType;
private String timeStamp;
private String authCode;
private String suiteTicket;
private String authCorpId;
private String userid;
private String userName;
/**1男 2女***/
private Integer gender;
private String alias;
private String[] department;
private String newUserid;
private String mobile;
private Integer id;
private String departmentName;
private Integer parentId;
private Integer order;
/**部门创建:create_party;部门修改:update_party;部门删除:delete_party*
* 成员创建:create_user;成员修改:update_user;成员删除:delete_user*/
private String changeType;
public String getSuiteId() {
return suiteId;
}
public void setSuiteId(String suiteId) {
this.suiteId = suiteId;
}
public String getInfoType() {
return infoType;
}
public void setInfoType(String infoType) {
this.infoType = infoType;
}
public String getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(String timeStamp) {
this.timeStamp = timeStamp;
}
public String getAuthCode() {
return authCode;
}
public void setAuthCode(String authCode) {
this.authCode = authCode;
}
public String getSuiteTicket() {
return suiteTicket;
}
public void setSuiteTicket(String suiteTicket) {
this.suiteTicket = suiteTicket;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
public String getNewUserid() {
return newUserid;
}
public void setNewUserid(String newUserid) {
this.newUserid = newUserid;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getAuthCorpId() {
return authCorpId;
}
public void setAuthCorpId(String authCorpId) {
this.authCorpId = authCorpId;
}
public String getChangeType() {
return changeType;
}
public void setChangeType(String changeType) {
this.changeType = changeType;
}
public String[] getDepartment() {
return department;
}
public void setDepartment(String[] department) {
this.department = department;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
}
package com.gic.haoban.manage.api.enums;
/**
* Created by tgs on 2020/2/20.
*/
public enum GicDataType {
DEPARTMENT(1, "企业部门"),
GROUP(2,"门店分组"),
STORE(3,"门店");
GicDataType(Integer type, String desc){
this.code = type;
this.desc = desc;
}
private int code;
private String desc;
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
package com.gic.haoban.manage.api.enums;
/**
* Created by tgs on 2020/2/20.
*/
public enum GicEditType {
ADD(1, "新增"),
UPDATE(2,"修改"),
DELETE(3,"删除");
GicEditType(Integer type, String desc){
this.code = type;
this.desc = desc;
}
private int code;
private String desc;
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
package com.gic.haoban.manage.api.enums;
/**
* Created by tgs on 2020/2/20.
*/
public enum WxEditType {
ADDDEPART("create_party", "创建部门"),
UPDATEDEPART("update_party", "更新部门"),
DELETEDEPART("delete_party", "删除部门"),
ADDUSER("create_user", "新增用户"),
UPDATEUSER("update_user", "更新用户"),
DELETEUSER("delete_user", "删除用户");
WxEditType(String type, String desc){
this.code = type;
this.desc = desc;
}
private String code;
private String desc;
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.gic.haoban.manage.api.service;
import com.gic.haoban.manage.api.dto.GicMessageDTO;
import com.gic.haoban.manage.api.dto.QywxCallBackDTO;
/**
* Created by tgs on 2020/2/20.
*/
public interface MessageApiService {
/**接收企业微信的推送消息*/
void gicMessageReceive(GicMessageDTO gicMessageDTO);
/**接收企业微信的推送消息*/
void wxMessageReceive(QywxCallBackDTO qywxCallBackDTO);
/**
* 队列消费gic推送数据
* @param param
*/
void dealGicMessage(String param);
/**
* 队列消费企业微信推送数据
* @param param
*/
void dealWxMessage(String param);
}
...@@ -26,6 +26,8 @@ public interface DepartmentMapper { ...@@ -26,6 +26,8 @@ public interface DepartmentMapper {
int selectMaxSort(@Param("parentDepartmentId")String parentDepartmentId); int selectMaxSort(@Param("parentDepartmentId")String parentDepartmentId);
TabHaobanDepartment selectByRelatedId(@Param("relatedId")String relatedId); TabHaobanDepartment selectByRelatedId(@Param("relatedId")String relatedId);
TabHaobanDepartment getByWxId(@Param("wxDepartmentId")String wxDepartmentId);
List<TabHaobanDepartment> listByDepartmentIds(@Param("departmentIds")List<String> departmentIds,@Param("storeFlag")int storeFlag); List<TabHaobanDepartment> listByDepartmentIds(@Param("departmentIds")List<String> departmentIds,@Param("storeFlag")int storeFlag);
......
...@@ -5,6 +5,7 @@ import java.util.List; ...@@ -5,6 +5,7 @@ import java.util.List;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import org.apache.ibatis.annotations.Param;
public interface StaffDepartmentRelatedMapper { public interface StaffDepartmentRelatedMapper {
int deleteByPrimaryKey(String staffDepartmentRelatedId); int deleteByPrimaryKey(String staffDepartmentRelatedId);
...@@ -31,4 +32,6 @@ public interface StaffDepartmentRelatedMapper { ...@@ -31,4 +32,6 @@ public interface StaffDepartmentRelatedMapper {
TabHaobanStaffDepartmentRelated getById(String staffDepartmentRelatedId); TabHaobanStaffDepartmentRelated getById(String staffDepartmentRelatedId);
int delByUserid(@Param("userid") String userId);
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.dao.mapper; ...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.dao.mapper;
import java.util.List; import java.util.List;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import org.apache.ibatis.annotations.Param;
public interface WxEnterpriseMapper { public interface WxEnterpriseMapper {
int deleteByPrimaryKey(String wxEnterpriseId); int deleteByPrimaryKey(String wxEnterpriseId);
...@@ -18,4 +19,6 @@ public interface WxEnterpriseMapper { ...@@ -18,4 +19,6 @@ public interface WxEnterpriseMapper {
int updateByPrimaryKey(TabHaobanWxEnterprise record); int updateByPrimaryKey(TabHaobanWxEnterprise record);
List<TabHaobanWxEnterprise> list(); List<TabHaobanWxEnterprise> list();
List<TabHaobanWxEnterprise> listBycorpId(@Param("corpId") String corpId);
} }
\ No newline at end of file
...@@ -19,5 +19,6 @@ public interface WxEnterpriseRelatedMapper { ...@@ -19,5 +19,6 @@ public interface WxEnterpriseRelatedMapper {
List<TabHaobanWxEnterpriseRelated> listByWxenterpriseId(String wxEnterpriseId); List<TabHaobanWxEnterpriseRelated> listByWxenterpriseId(String wxEnterpriseId);
TabHaobanWxEnterpriseRelated findOneByEnterpriseId(String enterpriseId); List<TabHaobanWxEnterpriseRelated> findOneByEnterpriseId(String enterpriseId);
} }
\ No newline at end of file
...@@ -20,6 +20,8 @@ public interface DepartmentService { ...@@ -20,6 +20,8 @@ public interface DepartmentService {
TabHaobanDepartment selectByRelatedId(String relatedId); TabHaobanDepartment selectByRelatedId(String relatedId);
TabHaobanDepartment getByWxId(String wxDepartmentId);
void recycle(String departmentId); void recycle(String departmentId);
Page<TabHaobanDepartment> pageDepartmentByParams(String wxEnterpriseId, String keyword, Integer storeFlag, Integer recycleFlag); Page<TabHaobanDepartment> pageDepartmentByParams(String wxEnterpriseId, String keyword, Integer storeFlag, Integer recycleFlag);
......
...@@ -18,5 +18,5 @@ public interface StaffDepartmentRelatedService { ...@@ -18,5 +18,5 @@ public interface StaffDepartmentRelatedService {
void del(StaffDepartmentRelatedDTO related); void del(StaffDepartmentRelatedDTO related);
void delByUserid(String userid);
} }
...@@ -18,4 +18,6 @@ public interface StaffService { ...@@ -18,4 +18,6 @@ public interface StaffService {
TabHaobanStaff selectByUserId(String userId); TabHaobanStaff selectByUserId(String userId);
void updateByPrimaryKey(TabHaobanStaff tab); void updateByPrimaryKey(TabHaobanStaff tab);
int delByuserid(String staffId);
} }
...@@ -2,8 +2,11 @@ package com.gic.haoban.manage.service.service; ...@@ -2,8 +2,11 @@ package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import java.util.List;
public interface WxEnterpriseRelatedService { public interface WxEnterpriseRelatedService {
TabHaobanWxEnterpriseRelated getByGicEnterpriseIdByEnterpriseRelatedId(String wxEnterpriseRelatedId); TabHaobanWxEnterpriseRelated getByGicEnterpriseIdByEnterpriseRelatedId(String wxEnterpriseRelatedId);
TabHaobanWxEnterpriseRelated getEnterpriseByGicEnterpriseId(String gicEnterpriseId);
} }
package com.gic.haoban.manage.service.service; package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
public interface WxEnterpriseService { public interface WxEnterpriseService {
...@@ -8,4 +9,11 @@ public interface WxEnterpriseService { ...@@ -8,4 +9,11 @@ public interface WxEnterpriseService {
WxEnterpriseDTO selectById(String wxEnterpriseId); WxEnterpriseDTO selectById(String wxEnterpriseId);
/**
* 通过微信企业ID查询好办企业ID
* @param corpId
* @return
*/
TabHaobanWxEnterprise getEnterpriseBycorpId(String corpId);
} }
...@@ -78,6 +78,11 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -78,6 +78,11 @@ public class DepartmentServiceImpl implements DepartmentService {
} }
@Override @Override
public TabHaobanDepartment getByWxId(String wxDepartmentId) {
return null;
}
@Override
public void recycle(String departmentId) { public void recycle(String departmentId) {
TabHaobanDepartment tab = mapper.selectByPrimaryKey(departmentId); TabHaobanDepartment tab = mapper.selectByPrimaryKey(departmentId);
if(tab != null) { if(tab != null) {
......
...@@ -59,6 +59,10 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated ...@@ -59,6 +59,10 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated
} }
@Override
public void delByUserid(String userid) {
}
} }
...@@ -56,4 +56,12 @@ public class StaffServiceImpl implements StaffService { ...@@ -56,4 +56,12 @@ public class StaffServiceImpl implements StaffService {
mapper.updateByPrimaryKey(tab); mapper.updateByPrimaryKey(tab);
} }
@Override
public int delByuserid(String staffId) {
TabHaobanStaff staff = new TabHaobanStaff();
staff.setStaffId(staffId);
staff.setStatusFlag(0);
return this.mapper.updateByPrimaryKey(staff);
}
} }
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -7,6 +8,8 @@ import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper; ...@@ -7,6 +8,8 @@ import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService; import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import java.util.List;
@Service @Service
public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedService { public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedService {
@Autowired @Autowired
...@@ -18,4 +21,13 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic ...@@ -18,4 +21,13 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
return mapper.selectByPrimaryKey(wxEnterpriseRelatedId); return mapper.selectByPrimaryKey(wxEnterpriseRelatedId);
} }
@Override
public TabHaobanWxEnterpriseRelated getEnterpriseByGicEnterpriseId(String gicEnterpriseId) {
List<TabHaobanWxEnterpriseRelated> list = mapper.findOneByEnterpriseId(gicEnterpriseId);
if(CollectionUtils.isNotEmpty(list)){
return list.get(0);
}
return null;
}
} }
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.Date; import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -34,4 +36,13 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService { ...@@ -34,4 +36,13 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
return null; return null;
} }
@Override
public TabHaobanWxEnterprise getEnterpriseBycorpId(String corpId) {
List<TabHaobanWxEnterprise> list = this.mapper.listBycorpId(corpId);
if(CollectionUtils.isNotEmpty(list)){
return list.get(0);
}
return null;
}
} }
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService" ref="wxEnterpriseRelatedApiServiceImpl" timeout="10000" /> <dubbo:service interface="com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService" ref="wxEnterpriseRelatedApiServiceImpl" timeout="10000" />
<dubbo:service interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService" ref="staffDepartmentRelatedApiServiceImpl" timeout="10000" /> <dubbo:service interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService" ref="staffDepartmentRelatedApiServiceImpl" timeout="10000" />
<dubbo:service interface="com.gic.haoban.manage.api.service.WxEnterpriseApiService" ref="wxEnterpriseApiServiceImpl" timeout="10000" /> <dubbo:service interface="com.gic.haoban.manage.api.service.WxEnterpriseApiService" ref="wxEnterpriseApiServiceImpl" timeout="10000" />
<dubbo:service interface="com.gic.haoban.manage.api.service.MessageApiService" ref="messageApiService" timeout="10000" />
<dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/> <dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService" id="qywxDepartmentApiService"/> <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService" id="qywxDepartmentApiService"/>
......
...@@ -224,7 +224,14 @@ ...@@ -224,7 +224,14 @@
where related_id = #{relatedId,jdbcType=VARCHAR} where related_id = #{relatedId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="getByWxId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_department
where wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select id="pageDepartmentByParams" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="pageDepartmentByParams" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
......
...@@ -192,5 +192,10 @@ ...@@ -192,5 +192,10 @@
where staff_id = #{staffId,jdbcType=VARCHAR} where staff_id = #{staffId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
</select> </select>
<update id="delByUserid" >
update tab_haoban_staff_department_related
set
status_flag = 0
where wx_user_id = #{userid,jdbcType=VARCHAR}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_haoban_staff from tab_haoban_staff
where user_id = #{userId,jdbcType=VARCHAR} where wx_user_id = #{userId,jdbcType=VARCHAR}
and staus_flag = 1 and staus_flag = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -352,13 +352,18 @@ ...@@ -352,13 +352,18 @@
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</update> </update>
<select id="list" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="list" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_haoban_wx_enterprise from tab_haoban_wx_enterprise
where status_flag = 1 where status_flag = 1
</select> </select>
<select id="listBycorpId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise
where status_flag = 1 and corpid= #{corpId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -129,5 +129,4 @@ ...@@ -129,5 +129,4 @@
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR} where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment