Commit e4b9d013 by 徐高华

Merge remote-tracking branch 'origin/feature/社群' into developer

Conflicts:
	haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/QywxErrorLogDTO.java
	haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/QywxErrorLogListQDTO.java
	haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/QywxErrorLogApiService.java
	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabQywxErrorLog.java
	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/TabQywxErrorLogBO.java
	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/QywxErrorLogService.java
	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/TabQywxErrorLogServiceImpl.java
	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxErrorLogApiServiceImpl.java
parents 3d7c9bc5 19040ddd
package com.gic.haoban.manage.api.dto; package com.gic.haoban.manage.api.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 企微报错日志(TabQywxErrorLog)实体类 * 企微报错日志(TabQywxErrorLog)实体类
* *
* @author mozhu * @author mozhu
* @since 2022-04-18 15:28:12 * @since 2022-04-18 15:28:12
*/ */
public class QywxErrorLogDTO implements Serializable { public class QywxErrorLogDTO implements Serializable {
private static final long serialVersionUID = -2297821152064066567L; private static final long serialVersionUID = -2297821152064066567L;
private Long id; private Long id;
private String wxEnterpriseId; private String wxEnterpriseId;
private String corpid; private String scenario;
private String qywxInterface; private String errorContent;
private String scenario; private String traceId;
private String errorContent; private Integer qywxErrorType;
private String weworkErrorUrl; private Date createTime;
private String traceId; private String memberId ;
private Integer qywxErrorType; private String externalUserId ;
private Date createTime;
public String getMemberId() {
public Long getId() { return memberId;
return id; }
}
public String getExternalUserId() {
public void setId(Long id) { return externalUserId;
this.id = id; }
}
public void setMemberId(String memberId) {
public String getWxEnterpriseId() { this.memberId = memberId;
return wxEnterpriseId; }
}
public void setExternalUserId(String externalUserId) {
public void setWxEnterpriseId(String wxEnterpriseId) { this.externalUserId = externalUserId;
this.wxEnterpriseId = wxEnterpriseId; }
}
public Long getId() {
public String getCorpid() { return id;
return corpid; }
}
public void setId(Long id) {
public void setCorpid(String corpid) { this.id = id;
this.corpid = corpid; }
}
public String getWxEnterpriseId() {
public String getQywxInterface() { return wxEnterpriseId;
return qywxInterface; }
}
public void setWxEnterpriseId(String wxEnterpriseId) {
public void setQywxInterface(String qywxInterface) { this.wxEnterpriseId = wxEnterpriseId;
this.qywxInterface = qywxInterface; }
}
public String getScenario() {
public String getScenario() { return scenario;
return scenario; }
}
public void setScenario(String scenario) {
public void setScenario(String scenario) { this.scenario = scenario;
this.scenario = scenario; }
}
public String getErrorContent() {
public String getErrorContent() { return errorContent;
return errorContent; }
}
public void setErrorContent(String errorContent) {
public void setErrorContent(String errorContent) { this.errorContent = errorContent;
this.errorContent = errorContent; }
}
public String getTraceId() {
public String getWeworkErrorUrl() { return traceId;
return weworkErrorUrl; }
}
public void setTraceId(String traceId) {
public void setWeworkErrorUrl(String weworkErrorUrl) { this.traceId = traceId;
this.weworkErrorUrl = weworkErrorUrl; }
}
public Integer getQywxErrorType() {
public String getTraceId() { return qywxErrorType;
return traceId; }
}
public void setQywxErrorType(Integer qywxErrorType) {
public void setTraceId(String traceId) { this.qywxErrorType = qywxErrorType;
this.traceId = traceId; }
}
public Date getCreateTime() {
public Integer getQywxErrorType() { return createTime;
return qywxErrorType; }
}
public void setCreateTime(Date createTime) {
public void setQywxErrorType(Integer qywxErrorType) { this.createTime = createTime;
this.qywxErrorType = qywxErrorType; }
} }
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
package com.gic.haoban.manage.api.dto.qdto; package com.gic.haoban.manage.api.dto.qdto;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import java.io.Serializable; import java.io.Serializable;
/** /**
* @author mozhu * @author mozhu
* @date 2022/4/18 16:49 * @date 2022/4/18 16:49
*/ */
public class QywxErrorLogListQDTO extends BasePageInfo implements Serializable { public class QywxErrorLogListQDTO extends BasePageInfo implements Serializable {
private static final long serialVersionUID = 6652319673885815810L; private static final long serialVersionUID = 6652319673885815810L;
/** /**
* 场景 * 场景
*/ */
private String scenario; private String scenario;
private String wxEnterpriseId; private String wxEnterpriseId;
private String corpid; private String corpid;
/** /**
* 1:好办后台;2:好办小程序;3:会员小程序 * 1:好办后台;2:好办小程序;3:会员小程序
*/ */
private Integer qywxErrorType; private Integer qywxErrorType;
private String startDate; private String startDate;
private String endDate; private String endDate;
public String getScenario() { private String memberId ;
return scenario; private String externalUserId ;
}
public String getMemberId() {
public void setScenario(String scenario) { return memberId;
this.scenario = scenario; }
}
public String getExternalUserId() {
public Integer getQywxErrorType() { return externalUserId;
return qywxErrorType; }
}
public void setMemberId(String memberId) {
public void setQywxErrorType(Integer qywxErrorType) { this.memberId = memberId;
this.qywxErrorType = qywxErrorType; }
}
public void setExternalUserId(String externalUserId) {
public String getStartDate() { this.externalUserId = externalUserId;
return startDate; }
}
public String getScenario() {
public void setStartDate(String startDate) { return scenario;
this.startDate = startDate; }
}
public void setScenario(String scenario) {
public String getEndDate() { this.scenario = scenario;
return endDate; }
}
public Integer getQywxErrorType() {
public void setEndDate(String endDate) { return qywxErrorType;
this.endDate = endDate; }
}
public void setQywxErrorType(Integer qywxErrorType) {
public String getWxEnterpriseId() { this.qywxErrorType = qywxErrorType;
return wxEnterpriseId; }
}
public String getStartDate() {
public void setWxEnterpriseId(String wxEnterpriseId) { return startDate;
this.wxEnterpriseId = wxEnterpriseId; }
}
public void setStartDate(String startDate) {
public String getCorpid() { this.startDate = startDate;
return corpid; }
}
public String getEndDate() {
public void setCorpid(String corpid) { return endDate;
this.corpid = corpid; }
}
} public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getCorpid() {
return corpid;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
}
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.QywxErrorLogDTO; import com.gic.haoban.manage.api.dto.QywxErrorLogDTO;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO; import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
/** /**
* 企微报错日志(TabQywxErrorLog)表服务接口 * 企微报错日志(TabQywxErrorLog)表服务接口
* *
* @author mozhu * @author mozhu
* @date 2022-04-18 15:28:02 * @date 2022-04-18 15:28:02
*/ */
public interface QywxErrorLogApiService { public interface QywxErrorLogApiService {
/** /**
* 新增数据 * 新增数据
* "routerName": "addQywxErrorLogMq", * "routerName": "addQywxErrorLogMq",
* @param param 参数 */
* @return {@link QywxErrorLogDTO } void insertQywxErrorLog(String param);
* @author mozhu
* @date 2022-04-18 17:02:40 /**
*/ * 查询分页列表
void insertQywxErrorLog(String param); */
Page<QywxErrorLogDTO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO);
/** }
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
QywxErrorLogDTO queryById(Long id);
/**
* 查询分页列表
*
* @param qywxErrorLogListQDTO qdto qywx错误日志列表
* @return {@link Page }<{@link QywxErrorLogDTO }>
* @author mozhu
* @date 2022-04-18 17:01:14
*/
Page<QywxErrorLogDTO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO);
}
...@@ -21,14 +21,6 @@ public interface TabQywxErrorLogMapper { ...@@ -21,14 +21,6 @@ public interface TabQywxErrorLogMapper {
int insert(TabQywxErrorLog tabQywxErrorLog); int insert(TabQywxErrorLog tabQywxErrorLog);
/** /**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TabQywxErrorLog queryById(Long id);
/**
* 分页列表 * 分页列表
* *
* @param qywxErrorLogListQDTO qdto qywx错误日志列表 * @param qywxErrorLogListQDTO qdto qywx错误日志列表
......
package com.gic.haoban.manage.service.entity; package com.gic.haoban.manage.service.entity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 选项卡qywx错误日志 * 选项卡qywx错误日志
* 企微报错日志(TabQywxErrorLog)实体类 * 企微报错日志(TabQywxErrorLog)实体类
* *
* @author mozhu * @author mozhu
* @date 2022-04-18 15:28:10 * @date 2022-04-18 15:28:10
*/ */
public class TabQywxErrorLog implements Serializable { public class TabQywxErrorLog implements Serializable {
private static final long serialVersionUID = -2508513770725265072L; private static final long serialVersionUID = -2508513770725265072L;
private Long id; private Long id;
private String wxEnterpriseId; private String wxEnterpriseId;
private String corpid; /**
private String qywxInterface; * 场景
/** */
* 场景 private String scenario;
*/ /**
private String scenario; * 报错内容
/** */
* 报错内容 private String errorContent;
*/
private String errorContent; private String memberId;
/** private String externalUserId;
* 企微报错url
*/ /**
private String weworkErrorUrl; * 链路id
/** */
* 链路id private String traceId;
*/ /**
private String traceId; * 1:好办后台;2:好办小程序;3:会员小程序
/** */
* 1:好办后台;2:好办小程序;3:会员小程序 private Integer qywxErrorType;
*/
private Integer qywxErrorType; private Date createTime;
private Date createTime; public Long getId() {
return id;
public Long getId() { }
return id;
} public void setId(Long id) {
this.id = id;
public void setId(Long id) { }
this.id = id;
} public String getWxEnterpriseId() {
return wxEnterpriseId;
public String getWxEnterpriseId() { }
return wxEnterpriseId;
} public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
public void setWxEnterpriseId(String wxEnterpriseId) { }
this.wxEnterpriseId = wxEnterpriseId;
} public String getScenario() {
return scenario;
public String getCorpid() { }
return corpid;
} public void setScenario(String scenario) {
this.scenario = scenario;
public void setCorpid(String corpid) { }
this.corpid = corpid;
} public String getErrorContent() {
return errorContent;
public String getQywxInterface() { }
return qywxInterface;
} public void setErrorContent(String errorContent) {
this.errorContent = errorContent;
public void setQywxInterface(String qywxInterface) { }
this.qywxInterface = qywxInterface;
} public String getMemberId() {
return memberId;
public String getScenario() { }
return scenario;
} public String getExternalUserId() {
return externalUserId;
public void setScenario(String scenario) { }
this.scenario = scenario;
} public void setMemberId(String memberId) {
this.memberId = memberId;
public String getErrorContent() { }
return errorContent;
} public void setExternalUserId(String externalUserId) {
this.externalUserId = externalUserId;
public void setErrorContent(String errorContent) { }
this.errorContent = errorContent;
} public String getTraceId() {
return traceId;
public String getWeworkErrorUrl() { }
return weworkErrorUrl;
} public void setTraceId(String traceId) {
this.traceId = traceId;
public void setWeworkErrorUrl(String weworkErrorUrl) { }
this.weworkErrorUrl = weworkErrorUrl;
} public Integer getQywxErrorType() {
return qywxErrorType;
public String getTraceId() { }
return traceId;
} public void setQywxErrorType(Integer qywxErrorType) {
this.qywxErrorType = qywxErrorType;
public void setTraceId(String traceId) { }
this.traceId = traceId;
} public Date getCreateTime() {
return createTime;
public Integer getQywxErrorType() { }
return qywxErrorType;
} public void setCreateTime(Date createTime) {
this.createTime = createTime;
public void setQywxErrorType(Integer qywxErrorType) { }
this.qywxErrorType = qywxErrorType; }
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
package com.gic.haoban.manage.service.pojo.bo; package com.gic.haoban.manage.service.pojo.bo;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 企微报错日志(TabQywxErrorLog)实体类 * 企微报错日志(TabQywxErrorLog)实体类
* *
* @author mozhu * @author mozhu
* @since 2022-04-18 15:28:12 * @since 2022-04-18 15:28:12
*/ */
public class TabQywxErrorLogBO implements Serializable { public class TabQywxErrorLogBO implements Serializable {
private static final long serialVersionUID = -2297821152064066567L; private static final long serialVersionUID = -2297821152064066567L;
private Long id; private Long id;
private String wxEnterpriseId; private String wxEnterpriseId;
private String corpid; private String memberId;
private String qywxInterface; private String externalUserId;
private String scenario; private String scenario;
private String errorContent; private String errorContent;
private String weworkErrorUrl; private String traceId;
private String traceId; private Integer qywxErrorType;
private Integer qywxErrorType; private Date createTime;
private Date createTime;
public Long getId() {
public Long getId() { return id;
return id; }
}
public void setId(Long id) {
public void setId(Long id) { this.id = id;
this.id = id; }
}
public String getWxEnterpriseId() {
public String getWxEnterpriseId() { return wxEnterpriseId;
return wxEnterpriseId; }
}
public void setWxEnterpriseId(String wxEnterpriseId) {
public void setWxEnterpriseId(String wxEnterpriseId) { this.wxEnterpriseId = wxEnterpriseId;
this.wxEnterpriseId = wxEnterpriseId; }
}
public String getScenario() {
public String getCorpid() { return scenario;
return corpid; }
}
public void setScenario(String scenario) {
public void setCorpid(String corpid) { this.scenario = scenario;
this.corpid = corpid; }
}
public String getErrorContent() {
public String getQywxInterface() { return errorContent;
return qywxInterface; }
}
public void setErrorContent(String errorContent) {
public void setQywxInterface(String qywxInterface) { this.errorContent = errorContent;
this.qywxInterface = qywxInterface; }
}
public String getMemberId() {
public String getScenario() { return memberId;
return scenario; }
}
public String getExternalUserId() {
public void setScenario(String scenario) { return externalUserId;
this.scenario = scenario; }
}
public void setMemberId(String memberId) {
public String getErrorContent() { this.memberId = memberId;
return errorContent; }
}
public void setExternalUserId(String externalUserId) {
public void setErrorContent(String errorContent) { this.externalUserId = externalUserId;
this.errorContent = errorContent; }
}
public String getTraceId() {
public String getWeworkErrorUrl() { return traceId;
return weworkErrorUrl; }
}
public void setTraceId(String traceId) {
public void setWeworkErrorUrl(String weworkErrorUrl) { this.traceId = traceId;
this.weworkErrorUrl = weworkErrorUrl; }
}
public Integer getQywxErrorType() {
public String getTraceId() { return qywxErrorType;
return traceId; }
}
public void setQywxErrorType(Integer qywxErrorType) {
public void setTraceId(String traceId) { this.qywxErrorType = qywxErrorType;
this.traceId = traceId; }
}
public Date getCreateTime() {
public Integer getQywxErrorType() { return createTime;
return qywxErrorType; }
}
public void setCreateTime(Date createTime) {
public void setQywxErrorType(Integer qywxErrorType) { this.createTime = createTime;
this.qywxErrorType = qywxErrorType; }
} }
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
package com.gic.haoban.manage.service.service; package com.gic.haoban.manage.service.service;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO; import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.service.entity.TabQywxErrorLog; import com.gic.haoban.manage.service.entity.TabQywxErrorLog;
import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO; import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import java.util.List; import java.util.List;
/** /**
* 企微报错日志(TabQywxErrorLog)表服务接口 * 企微报错日志(TabQywxErrorLog)表服务接口
* *
* @author mozhu * @author mozhu
* @date 2022-04-18 15:28:02 * @date 2022-04-18 15:28:02
*/ */
public interface QywxErrorLogService { public interface QywxErrorLogService {
/** /**
* 新增数据 * 新增数据
* *
* @param tabQywxErrorLogBO 实例对象 * @param tabQywxErrorLogBO 实例对象
* @return 实例对象 * @return 实例对象
*/ */
TabQywxErrorLogBO insert(TabQywxErrorLogBO tabQywxErrorLogBO); TabQywxErrorLogBO insert(TabQywxErrorLogBO tabQywxErrorLogBO);
/**
/** * 查询分页列表
* 通过ID查询单条数据 *
* * @param qywxErrorLogListQDTO qdto qywx错误日志列表
* @param id 主键 * @return {@link Page }<{@link TabQywxErrorLogBO }>
* @return 实例对象 * @author mozhu
*/ * @date 2022-04-18 16:50:32
TabQywxErrorLogBO queryById(Long id); */
List<TabQywxErrorLog> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO);
/**
* 查询分页列表 }
*
* @param qywxErrorLogListQDTO qdto qywx错误日志列表
* @return {@link Page }<{@link TabQywxErrorLogBO }>
* @author mozhu
* @date 2022-04-18 16:50:32
*/
List<TabQywxErrorLog> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO);
}
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import com.gic.commons.util.UniqueIdUtils; import java.util.Date;
import com.gic.haoban.common.utils.EntityUtil; import java.util.List;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper; import org.apache.commons.lang3.StringUtils;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication; import org.springframework.beans.factory.annotation.Autowired;
import com.gic.haoban.manage.service.entity.TabQywxErrorLog; import org.springframework.stereotype.Service;
import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import com.gic.haoban.manage.service.service.QywxErrorLogService; import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.service.service.WxApplicationService; import com.gic.haoban.common.utils.EntityUtil;
import org.apache.commons.lang3.StringUtils; import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import org.apache.logging.log4j.LogManager; import com.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper;
import org.apache.logging.log4j.Logger; import com.gic.haoban.manage.service.entity.TabQywxErrorLog;
import org.springframework.beans.factory.annotation.Autowired; import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import org.springframework.stereotype.Service; import com.gic.haoban.manage.service.service.QywxErrorLogService;
import java.util.Date; /**
import java.util.List; * 企微报错日志(TabQywxErrorLog)表服务实现类
*
/** * @author mozhu
* 企微报错日志(TabQywxErrorLog)表服务实现类 * @date 2022-04-18 15:28:02
* */
* @author mozhu @Service
* @date 2022-04-18 15:28:02 public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
*/
@Service @Autowired
public class TabQywxErrorLogServiceImpl implements QywxErrorLogService { private TabQywxErrorLogMapper tabQywxErrorLogMapper;
private static final Logger logger = LogManager.getLogger(TabQywxErrorLogServiceImpl.class);
@Override
@Autowired public TabQywxErrorLogBO insert(TabQywxErrorLogBO tabQywxErrorLogBO) {
private TabQywxErrorLogMapper tabQywxErrorLogMapper; String wxEnterpriseId = tabQywxErrorLogBO.getWxEnterpriseId();
@Autowired if (StringUtils.isBlank(wxEnterpriseId)) {
private WxApplicationService wxApplicationService; return null;
}
tabQywxErrorLogBO.setId(UniqueIdUtils.uniqueLong());
@Override tabQywxErrorLogBO.setCreateTime(new Date());
public TabQywxErrorLogBO insert(TabQywxErrorLogBO tabQywxErrorLogBO) { this.tabQywxErrorLogMapper.insert(EntityUtil.changeEntityByOrika(TabQywxErrorLog.class, tabQywxErrorLogBO));
String wxEnterpriseId = tabQywxErrorLogBO.getWxEnterpriseId(); return tabQywxErrorLogBO;
String corpid = tabQywxErrorLogBO.getCorpid(); }
if (StringUtils.isBlank(wxEnterpriseId)) {
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationService.selectByCorpId(corpid); @Override
if (tabHaobanWxApplication != null) { public List<TabQywxErrorLog> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO) {
tabQywxErrorLogBO.setWxEnterpriseId(tabHaobanWxApplication.getWxEnterpriseId()); return this.tabQywxErrorLogMapper.queryListByPage(qywxErrorLogListQDTO);
} }
}
wxEnterpriseId = tabQywxErrorLogBO.getWxEnterpriseId(); }
if (StringUtils.isBlank(wxEnterpriseId)) {
logger.error("企业微信id为空,corpid:{}", corpid);
return null;
}
tabQywxErrorLogBO.setId(UniqueIdUtils.uniqueLong());
tabQywxErrorLogBO.setCreateTime(new Date());
this.tabQywxErrorLogMapper.insert(EntityUtil.changeEntityByOrika(TabQywxErrorLog.class, tabQywxErrorLogBO));
return tabQywxErrorLogBO;
}
@Override
public TabQywxErrorLogBO queryById(Long id) {
TabQywxErrorLog tabQywxErrorLog = this.tabQywxErrorLogMapper.queryById(id);
return EntityUtil.changeEntityByOrika(TabQywxErrorLogBO.class, tabQywxErrorLog);
}
@Override
public List<TabQywxErrorLog> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO) {
return this.tabQywxErrorLogMapper.queryListByPage(qywxErrorLogListQDTO);
}
}
...@@ -214,6 +214,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -214,6 +214,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private QywxSendService qywxSendService ; private QywxSendService qywxSendService ;
@Autowired @Autowired
private GroupChatService groupChatService ; private GroupChatService groupChatService ;
private static GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
@Override @Override
...@@ -480,7 +482,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -480,7 +482,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
TabHaobanClerkMainStoreRelated mainStoreRelated = clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId); TabHaobanClerkMainStoreRelated mainStoreRelated = clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId);
if (mainStoreRelated == null) { if (mainStoreRelated == null) {
log.info("【新增外部联系人】主门店为空:staffId={}", staffId); log.info("【新增外部联系人】主门店为空:staffId={}", staffId);
this.sendWelcome(dto, qwDTO, null, staffId, null); this.sendWelcome(dto, qwDTO, null, staffId, null , null);
return; return;
} }
staffClerkRelationDTO = staffClerkRelationService.getOneBindByStoreId(staffId, mainStoreRelated.getStoreId()); staffClerkRelationDTO = staffClerkRelationService.getOneBindByStoreId(staffId, mainStoreRelated.getStoreId());
...@@ -645,7 +647,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -645,7 +647,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} }
String storeId = staffClerkRelationDTO.getStoreId(); String storeId = staffClerkRelationDTO.getStoreId();
this.saveExternalClerk(memberId, staffId, dto, staffClerkRelationDTO , 1); this.saveExternalClerk(memberId, staffId, dto, staffClerkRelationDTO , 1);
this.sendWelcome(dto, qwDTO, enterpriseId, staffId, clerkId); this.sendWelcome(dto, qwDTO, enterpriseId, staffId, clerkId,memberId);
//同步好友标签 //同步好友标签
this.pushTagSync(memberId, wxEnterpriseId, enterpriseId); this.pushTagSync(memberId, wxEnterpriseId, enterpriseId);
//回调给会员,更新是否为企微好友 //回调给会员,更新是否为企微好友
...@@ -787,7 +789,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -787,7 +789,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String clerkId = staffClerkRelationDTO.getClerkId(); String clerkId = staffClerkRelationDTO.getClerkId();
String enterpriseId = staffClerkRelationDTO.getEnterpriseId(); String enterpriseId = staffClerkRelationDTO.getEnterpriseId();
//发送欢迎语 //发送欢迎语
sendWelcome(dto, qwDTO, enterpriseId, staffId, clerkId); sendWelcome(dto, qwDTO, enterpriseId, staffId, clerkId,null);
//保存好友关系 //保存好友关系
this.saveExternalClerk(null, staffId, dto, staffClerkRelationDTO, 4); this.saveExternalClerk(null, staffId, dto, staffClerkRelationDTO, 4);
} }
...@@ -800,40 +802,37 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -800,40 +802,37 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @param enterpriseId * @param enterpriseId
* @param staffId * @param staffId
*/ */
private void sendWelcome(MemberUnionidRelatedDTO dto, WxEnterpriseQwDTO wxEnterpriseDTO, String enterpriseId, String staffId, String clerkId) { private void sendWelcome(MemberUnionidRelatedDTO dto, WxEnterpriseQwDTO wxEnterpriseDTO, String enterpriseId, String staffId, String clerkId , String memberId) {
log.info("发送欢迎语:dto:{},staffId:{}", JSONObject.toJSONString(dto), staffId); log.info("发送欢迎语:dto:{},staffId:{}", JSONObject.toJSONString(dto), staffId);
String welcomeCode = dto.getWelcomeCode(); String welcomeCode = dto.getWelcomeCode();
String state = dto.getState(); String state = dto.getState();
String wxEnterpriseId = wxEnterpriseDTO.getWxEnterpriseId(); String wxEnterpriseId = wxEnterpriseDTO.getWxEnterpriseId();
QywxErrorLogDTO errLog = new QywxErrorLogDTO();
errLog.setWxEnterpriseId(wxEnterpriseId);
errLog.setMemberId(memberId);
errLog.setExternalUserId(dto.getExternalUserid());
errLog.setTraceId(ProviderLocalTag.tag.get().traceId);
errLog.setQywxErrorType(1);
if (StringUtils.isBlank(welcomeCode)) { if (StringUtils.isBlank(welcomeCode)) {
log.error("welcomeCode为空,请检查是否使用企微的欢迎语:{}", wxEnterpriseId); log.error("welcomeCode为空,请检查是否使用企微的欢迎语:{}", wxEnterpriseId);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
QywxErrorLogDTO qywxErrorLogDTO = new QywxErrorLogDTO(); errLog.setScenario("欢迎语");
qywxErrorLogDTO.setWxEnterpriseId(wxEnterpriseId); errLog.setErrorContent("welcomeCode空,GIC不处理,使用企微发送欢迎语");
qywxErrorLogDTO.setCorpid(dto.getCorpid()); clientInstance.sendMessage(Manage3Constants.QYWX_ERROR_MSG, JSON.toJSONString(errLog));
qywxErrorLogDTO.setScenario("欢迎语不发送");
qywxErrorLogDTO.setErrorContent("welcomeCode为空,请检查是否使用企微的欢迎语");
qywxErrorLogDTO.setTraceId(ProviderLocalTag.tag.get().traceId);
qywxErrorLogDTO.setQywxErrorType(1);
clientInstance.sendMessage(Manage3Constants.QYWX_ERROR_MSG, JSON.toJSONString(qywxErrorLogDTO));
} catch (Exception e) { } catch (Exception e) {
log.error("发送消息失败:{}", e.getMessage(), e); log.error("发送消息失败:{}", e.getMessage(), e);
} }
return; return;
} }
String relationKey = SecureUtil.md5(staffId + dto.getExternalUserid()); String relationKey = SecureUtil.md5(staffId + dto.getExternalUserid());
WelcomeDetailBO welcomeDetailBO = null; WelcomeDetailBO welcomeDetailBO = null;
if (StringUtils.isNotBlank(state) && (state.startsWith(Manage3Constants.HM) || state.startsWith(Manage3Constants.DT))) { if (StringUtils.isNotBlank(state) && (state.startsWith(Manage3Constants.HM) || state.startsWith(Manage3Constants.DT))) {
//"HM+id" "DT+key"
log.info("特殊欢迎语 state:{}", state); log.info("特殊欢迎语 state:{}", state);
WelcomeReferBO welcomeReferBo = getWelcomeReferBo(state); WelcomeReferBO welcomeReferBo = getWelcomeReferBo(state);
welcomeDetailBO = welcomeService.getMatchWelcomeWithReferId(staffId, wxEnterpriseId, welcomeReferBo); welcomeDetailBO = welcomeService.getMatchWelcomeWithReferId(staffId, wxEnterpriseId, welcomeReferBo);
} else { } else {
welcomeDetailBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId); welcomeDetailBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId);
} }
if (Objects.isNull(welcomeDetailBO)) { if (Objects.isNull(welcomeDetailBO)) {
log.info("欢迎语未配置:wxEnterpriseId:{}", wxEnterpriseId); log.info("欢迎语未配置:wxEnterpriseId:{}", wxEnterpriseId);
return; return;
...@@ -877,12 +876,25 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -877,12 +876,25 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} }
qywxWelcomeMsgDTO.setWelcomeCode(welcomeCode); qywxWelcomeMsgDTO.setWelcomeCode(welcomeCode);
log.info("[sendWelcome] 发送欢迎语 params:{}", JSON.toJSONString(qywxWelcomeMsgDTO)); log.info("[sendWelcome] 发送欢迎语 params:{}", JSON.toJSONString(qywxWelcomeMsgDTO));
String result = null ;
if (dto.getSuiteid().equals(SELF_APP)) { if (dto.getSuiteid().equals(SELF_APP)) {
//好办助手和代开发
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(dto.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal()); SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(dto.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal());
qywxUserApiService.sendSelfWelcomeMsgByExternal(dto.getCorpid(), secretSetting.getSecretVal(), qywxWelcomeMsgDTO); result = qywxUserApiService.sendSelfWelcomeMsgByExternal(dto.getCorpid(), secretSetting.getSecretVal(), qywxWelcomeMsgDTO);
} else { } else {
qywxUserApiService.sendWelcomeMsgByExternal(dto.getCorpid(), config.getWxSuiteid(), qywxWelcomeMsgDTO); result = qywxUserApiService.sendWelcomeMsgByExternal(dto.getCorpid(), config.getWxSuiteid(), qywxWelcomeMsgDTO);
}
if(StringUtils.isNotBlank(result)) {
JSONObject json = JSON.parseObject(result) ;
int errcode = json.getIntValue("errcode") ;
if(0 != errcode) {
try {
errLog.setScenario("欢迎语");
errLog.setErrorContent(result);
clientInstance.sendMessage(Manage3Constants.QYWX_ERROR_MSG, JSON.toJSONString(errLog));
} catch (Exception e) {
log.error("发送消息失败:{}", e.getMessage(), e);
}
}
} }
} }
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.date.DatePattern; import java.util.List;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import org.springframework.beans.factory.annotation.Autowired;
import com.gic.api.base.commons.Page; import org.springframework.stereotype.Service;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.PageUtil; import com.alibaba.fastjson.JSON;
import com.gic.haoban.manage.api.dto.QywxErrorLogDTO; import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.service.QywxErrorLogApiService; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.service.entity.TabQywxErrorLog; import com.gic.haoban.manage.api.dto.QywxErrorLogDTO;
import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO; import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.service.service.QywxErrorLogService; import com.gic.haoban.manage.api.service.QywxErrorLogApiService;
import com.github.pagehelper.PageHelper; import com.gic.haoban.manage.service.entity.TabQywxErrorLog;
import com.github.pagehelper.PageInfo; import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import org.apache.logging.log4j.LogManager; import com.gic.haoban.manage.service.service.QywxErrorLogService;
import org.apache.logging.log4j.Logger; import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired; import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import cn.hutool.core.date.DatePattern;
import java.util.List; import cn.hutool.core.date.DateUtil;
/** /**
* 企微报错日志(TabQywxErrorLog)表服务实现类 * 企微报错日志(TabQywxErrorLog)表服务实现类
* *
* @author mozhu * @author mozhu
* @date 2022-04-18 15:28:02 * @date 2022-04-18 15:28:02
*/ */
@Service @Service
public class QywxErrorLogApiServiceImpl implements QywxErrorLogApiService { public class QywxErrorLogApiServiceImpl implements QywxErrorLogApiService {
private static final Logger log = LogManager.getLogger(QywxErrorLogApiServiceImpl.class); @Autowired
@Autowired private QywxErrorLogService tabQywxErrorLogService;
private QywxErrorLogService tabQywxErrorLogService;
@Override
@Override public void insertQywxErrorLog(String param) {
public void insertQywxErrorLog(String param) { QywxErrorLogDTO qywxErrorLogDTO = JSON.parseObject(param, QywxErrorLogDTO.class);
log.info("请求企微报错日志:{}", param); tabQywxErrorLogService.insert(EntityUtil.changeEntityByOrika(TabQywxErrorLogBO.class, qywxErrorLogDTO));
QywxErrorLogDTO qywxErrorLogDTO = JSON.parseObject(param, QywxErrorLogDTO.class); }
tabQywxErrorLogService.insert(EntityUtil.changeEntityByOrika(TabQywxErrorLogBO.class, qywxErrorLogDTO));
} @Override
public Page<QywxErrorLogDTO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO) {
@Override qywxErrorLogListQDTO.setStartDate(DateUtil.format(DateUtil.beginOfDay(DateUtil.parse(qywxErrorLogListQDTO.getStartDate())), DatePattern.NORM_DATETIME_PATTERN));
public QywxErrorLogDTO queryById(Long id) { qywxErrorLogListQDTO.setEndDate(DateUtil.format(DateUtil.beginOfDay(DateUtil.parse(qywxErrorLogListQDTO.getEndDate())), DatePattern.NORM_DATETIME_PATTERN));
return EntityUtil.changeEntityByOrika(QywxErrorLogDTO.class, tabQywxErrorLogService.queryById(id)); PageHelper.startPage(qywxErrorLogListQDTO.getPageNum(), qywxErrorLogListQDTO.getPageSize());
} List<TabQywxErrorLog> list = this.tabQywxErrorLogService.queryListByPage(qywxErrorLogListQDTO);
return PageUtil.changePageHelperToCurrentPage(new PageInfo<>(list), QywxErrorLogDTO.class);
@Override }
public Page<QywxErrorLogDTO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO) { }
qywxErrorLogListQDTO.setStartDate(DateUtil.format(DateUtil.beginOfDay(DateUtil.parse(qywxErrorLogListQDTO.getStartDate())), DatePattern.NORM_DATETIME_PATTERN));
qywxErrorLogListQDTO.setEndDate(DateUtil.format(DateUtil.beginOfDay(DateUtil.parse(qywxErrorLogListQDTO.getEndDate())), DatePattern.NORM_DATETIME_PATTERN));
PageHelper.startPage(qywxErrorLogListQDTO.getPageNum(), qywxErrorLogListQDTO.getPageSize());
List<TabQywxErrorLog> list = this.tabQywxErrorLogService.queryListByPage(qywxErrorLogListQDTO);
return PageUtil.changePageHelperToCurrentPage(new PageInfo<>(list), QywxErrorLogDTO.class);
}
}
...@@ -3,19 +3,20 @@ ...@@ -3,19 +3,20 @@
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper"> <mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper">
<resultMap type="com.gic.haoban.manage.service.entity.TabQywxErrorLog" id="TabQywxErrorLogMap"> <resultMap type="com.gic.haoban.manage.service.entity.TabQywxErrorLog" id="TabQywxErrorLogMap">
<result property="id" column="id" jdbcType="INTEGER"/> <result property="id" column="id" />
<result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/> <result property="wxEnterpriseId" column="wx_enterprise_id" />
<result property="corpid" column="corpid" jdbcType="VARCHAR"/> <result property="member_id" column="memberId"/>
<result property="qywxInterface" column="qywx_interface" jdbcType="VARCHAR"/> <result property="external_user_id" column="externalUserId" />
<result property="scenario" column="scenario" jdbcType="VARCHAR"/> <result property="scenario" column="scenario" />
<result property="errorContent" column="error_content" jdbcType="VARCHAR"/> <result property="errorContent" column="error_content" />
<result property="weworkErrorUrl" column="wework_error_url" jdbcType="VARCHAR"/> <result property="weworkErrorUrl" column="wework_error_url" />
<result property="traceId" column="trace_id" jdbcType="VARCHAR"/> <result property="traceId" column="trace_id" />
<result property="qywxErrorType" column="qywx_error_type" jdbcType="INTEGER"/> <result property="qywxErrorType" column="qywx_error_type" />
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, wx_enterprise_id,corpid,qywx_interface,scenario, error_content, wework_error_url, trace_id, qywx_error_type, create_time </sql> id, wx_enterprise_id, member_id , external_user_id ,scenario, error_content, trace_id, qywx_error_type, create_time
</sql>
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true" <insert id="insert" keyProperty="id" useGeneratedKeys="true"
...@@ -28,11 +29,11 @@ ...@@ -28,11 +29,11 @@
<if test="wxEnterpriseId != null and wxEnterpriseId != ''"> <if test="wxEnterpriseId != null and wxEnterpriseId != ''">
wx_enterprise_id, wx_enterprise_id,
</if> </if>
<if test="corpid != null and corpid != ''"> <if test="memberId != null and memberId != ''">
corpid, member_id,
</if> </if>
<if test="qywxInterface != null and qywxInterface != ''"> <if test="externalUserId != null and externalUserId != ''">
qywx_interface, external_user_id,
</if> </if>
<if test="scenario != null and scenario != ''"> <if test="scenario != null and scenario != ''">
scenario, scenario,
...@@ -40,9 +41,6 @@ ...@@ -40,9 +41,6 @@
<if test="errorContent != null and errorContent != ''"> <if test="errorContent != null and errorContent != ''">
error_content, error_content,
</if> </if>
<if test="weworkErrorUrl != null and weworkErrorUrl != ''">
wework_error_url,
</if>
<if test="traceId != null and traceId != ''"> <if test="traceId != null and traceId != ''">
trace_id, trace_id,
</if> </if>
...@@ -60,11 +58,11 @@ ...@@ -60,11 +58,11 @@
<if test="wxEnterpriseId != null and wxEnterpriseId != ''"> <if test="wxEnterpriseId != null and wxEnterpriseId != ''">
#{wxEnterpriseId}, #{wxEnterpriseId},
</if> </if>
<if test="corpid != null and corpid != ''"> <if test="memberId != null and memberId != ''">
#{corpid}, #{memberId},
</if> </if>
<if test="qywxInterface != null and qywxInterface != ''"> <if test="externalUserId != null and externalUserId != ''">
#{qywxInterface}, #{externalUserId},
</if> </if>
<if test="scenario != null and scenario != ''"> <if test="scenario != null and scenario != ''">
#{scenario}, #{scenario},
...@@ -72,9 +70,6 @@ ...@@ -72,9 +70,6 @@
<if test="errorContent != null and errorContent != ''"> <if test="errorContent != null and errorContent != ''">
#{errorContent}, #{errorContent},
</if> </if>
<if test="weworkErrorUrl != null and weworkErrorUrl != ''">
#{weworkErrorUrl},
</if>
<if test="traceId != null and traceId != ''"> <if test="traceId != null and traceId != ''">
#{traceId}, #{traceId},
</if> </if>
...@@ -88,14 +83,6 @@ ...@@ -88,14 +83,6 @@
</insert> </insert>
<!--查询单个-->
<select id="queryById" resultMap="TabQywxErrorLogMap">
select
<include refid="Base_Column_List"/>
from tab_qywx_error_log
where id = #{id}
</select>
<!--通过实体作为筛选条件查询--> <!--通过实体作为筛选条件查询-->
<select id="queryListByPage" parameterType="com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO" <select id="queryListByPage" parameterType="com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO"
resultMap="TabQywxErrorLogMap"> resultMap="TabQywxErrorLogMap">
...@@ -109,6 +96,12 @@ ...@@ -109,6 +96,12 @@
<if test="scenario != null and scenario != ''"> <if test="scenario != null and scenario != ''">
and scenario like CONCAT('%',#{scenario},'%') and scenario like CONCAT('%',#{scenario},'%')
</if> </if>
<if test="memberId != null and memberId != ''">
and member_id = #{memberId}
</if>
<if test="externalUserId != null and externalUserId != ''">
and external_user_id = #{externalUserId}
</if>
<if test="qywxErrorType != null"> <if test="qywxErrorType != null">
and qywx_error_type = #{qywxErrorType} and qywx_error_type = #{qywxErrorType}
</if> </if>
......
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