Commit 037d1d98 by 墨竹

fix:增加企微报错日志表

parent b5bd4190
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 企微报错日志(TabQywxErrorLog)实体类
*
* @author mozhu
* @since 2022-04-18 15:28:12
*/
public class QywxErrorLogDTO implements Serializable {
private static final long serialVersionUID = -2297821152064066567L;
private Long id;
private String scenario;
private String errorContent;
private String weworkErrorUrl;
private String traceId;
private Integer qywxErrorType;
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getScenario() {
return scenario;
}
public void setScenario(String scenario) {
this.scenario = scenario;
}
public String getErrorContent() {
return errorContent;
}
public void setErrorContent(String errorContent) {
this.errorContent = errorContent;
}
public String getWeworkErrorUrl() {
return weworkErrorUrl;
}
public void setWeworkErrorUrl(String weworkErrorUrl) {
this.weworkErrorUrl = weworkErrorUrl;
}
public String getTraceId() {
return traceId;
}
public void setTraceId(String traceId) {
this.traceId = traceId;
}
public Integer getQywxErrorType() {
return qywxErrorType;
}
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.api.dto.qdto;
import com.gic.haoban.base.api.common.BasePageInfo;
import java.io.Serializable;
/**
* @author mozhu
* @date 2022/4/18 16:49
*/
public class QywxErrorLogListQDTO extends BasePageInfo implements Serializable {
private static final long serialVersionUID = 6652319673885815810L;
/**
* 场景
*/
private String scenario;
/**
* 1:好办后台;2:好办小程序;3:会员小程序
*/
private Integer qywxErrorType;
private String startDate;
private String endDate;
public String getScenario() {
return scenario;
}
public void setScenario(String scenario) {
this.scenario = scenario;
}
public Integer getQywxErrorType() {
return qywxErrorType;
}
public void setQywxErrorType(Integer qywxErrorType) {
this.qywxErrorType = qywxErrorType;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
@Override
public String toString() {
return "QywxErrorLogListQDTO{" +
"scenario='" + scenario + '\'' +
", qywxErrorType=" + qywxErrorType +
", startDate='" + startDate + '\'' +
", endDate='" + endDate + '\'' +
'}';
}
}
package com.gic.haoban.manage.api.dto.qdto;
import java.io.Serializable;
import java.util.Date;
/**
* @author mozhu
* @date 2022/4/18 16:04
*/
public class QywxErrorLogQDTO implements Serializable {
private static final long serialVersionUID = 3149075149054963526L;
private Long id;
private String scenario;
private String errorContent;
private String weworkErrorUrl;
private String traceId;
private Integer qywxErrorType;
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getScenario() {
return scenario;
}
public void setScenario(String scenario) {
this.scenario = scenario;
}
public String getErrorContent() {
return errorContent;
}
public void setErrorContent(String errorContent) {
this.errorContent = errorContent;
}
public String getWeworkErrorUrl() {
return weworkErrorUrl;
}
public void setWeworkErrorUrl(String weworkErrorUrl) {
this.weworkErrorUrl = weworkErrorUrl;
}
public String getTraceId() {
return traceId;
}
public void setTraceId(String traceId) {
this.traceId = traceId;
}
public Integer getQywxErrorType() {
return qywxErrorType;
}
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.api.service;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.QywxErrorLogDTO;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
/**
* 企微报错日志(TabQywxErrorLog)表服务接口
*
* @author mozhu
* @date 2022-04-18 15:28:02
*/
public interface TabQywxErrorLogApiService {
/**
* 新增数据
* "routerName": "qywxErrorLogMq",
* @param param 参数
* @return {@link QywxErrorLogDTO }
* @author mozhu
* @date 2022-04-18 17:02:40
*/
void insertQywxErrorLog(String param);
/**
* 通过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);
}
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.service.entity.TabQywxErrorLog;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 企微报错日志(TabQywxErrorLog)表数据库访问层
*
* @author mozhu
* @date 2022-04-18 15:28:11
*/
@Repository
public interface TabQywxErrorLogMapper {
/**
* 新增数据
*
* @param tabQywxErrorLog 选项卡qywx错误日志
* @return int
* @author mozhu
* @date 2022-04-18 16:18:25
*/
int insert(TabQywxErrorLog tabQywxErrorLog);
/**
* 修改数据
*
* @param tabQywxErrorLog 选项卡qywx错误日志
* @return int
* @author mozhu
* @date 2022-04-18 16:18:28
*/
int update(TabQywxErrorLog tabQywxErrorLog);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Long id);
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TabQywxErrorLog queryById(Long id);
/**
* 分页列表
*
* @param qywxErrorLogListQDTO qdto qywx错误日志列表
* @return {@link List }<{@link TabQywxErrorLog }>
* @author mozhu
* @date 2022-04-18 16:55:23
*/
List<TabQywxErrorLog> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO);
}
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 选项卡qywx错误日志
* 企微报错日志(TabQywxErrorLog)实体类
*
* @author mozhu
* @date 2022-04-18 15:28:10
*/
public class TabQywxErrorLog implements Serializable {
private static final long serialVersionUID = -2508513770725265072L;
private Long id;
/**
* 场景
*/
private String scenario;
/**
* 报错内容
*/
private String errorContent;
/**
* 企微报错url
*/
private String weworkErrorUrl;
/**
* 链路id
*/
private String traceId;
/**
* 1:好办后台;2:好办小程序;3:会员小程序
*/
private Integer qywxErrorType;
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getScenario() {
return scenario;
}
public void setScenario(String scenario) {
this.scenario = scenario;
}
public String getErrorContent() {
return errorContent;
}
public void setErrorContent(String errorContent) {
this.errorContent = errorContent;
}
public String getWeworkErrorUrl() {
return weworkErrorUrl;
}
public void setWeworkErrorUrl(String weworkErrorUrl) {
this.weworkErrorUrl = weworkErrorUrl;
}
public String getTraceId() {
return traceId;
}
public void setTraceId(String traceId) {
this.traceId = traceId;
}
public Integer getQywxErrorType() {
return qywxErrorType;
}
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;
import java.io.Serializable;
import java.util.Date;
/**
* 企微报错日志(TabQywxErrorLog)实体类
*
* @author mozhu
* @since 2022-04-18 15:28:12
*/
public class TabQywxErrorLogBO implements Serializable {
private static final long serialVersionUID = -2297821152064066567L;
private Long id;
private String scenario;
private String errorContent;
private String weworkErrorUrl;
private String traceId;
private Integer qywxErrorType;
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getScenario() {
return scenario;
}
public void setScenario(String scenario) {
this.scenario = scenario;
}
public String getErrorContent() {
return errorContent;
}
public void setErrorContent(String errorContent) {
this.errorContent = errorContent;
}
public String getWeworkErrorUrl() {
return weworkErrorUrl;
}
public void setWeworkErrorUrl(String weworkErrorUrl) {
this.weworkErrorUrl = weworkErrorUrl;
}
public String getTraceId() {
return traceId;
}
public void setTraceId(String traceId) {
this.traceId = traceId;
}
public Integer getQywxErrorType() {
return qywxErrorType;
}
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.service;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import java.util.List;
/**
* 企微报错日志(TabQywxErrorLog)表服务接口
*
* @author mozhu
* @date 2022-04-18 15:28:02
*/
public interface TabQywxErrorLogService {
/**
* 新增数据
*
* @param tabQywxErrorLogBO 实例对象
* @return 实例对象
*/
TabQywxErrorLogBO insert(TabQywxErrorLogBO tabQywxErrorLogBO);
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TabQywxErrorLogBO queryById(Long id);
/**
* 查询分页列表
*
* @param qywxErrorLogListQDTO qdto qywx错误日志列表
* @return {@link Page }<{@link TabQywxErrorLogBO }>
* @author mozhu
* @date 2022-04-18 16:50:32
*/
List<TabQywxErrorLogBO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO);
}
package com.gic.haoban.manage.service.service.impl;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper;
import com.gic.haoban.manage.service.entity.TabQywxErrorLog;
import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import com.gic.haoban.manage.service.service.TabQywxErrorLogService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 企微报错日志(TabQywxErrorLog)表服务实现类
*
* @author mozhu
* @date 2022-04-18 15:28:02
*/
@Service
public class TabQywxErrorLogServiceImpl implements TabQywxErrorLogService {
@Autowired
private TabQywxErrorLogMapper tabQywxErrorLogMapper;
@Override
public TabQywxErrorLogBO insert(TabQywxErrorLogBO tabQywxErrorLogBO) {
TabQywxErrorLog tabQywxErrorLog = new TabQywxErrorLog();
BeanUtils.copyProperties(tabQywxErrorLogBO,tabQywxErrorLog);
tabQywxErrorLogBO.setCreateTime(new Date());
this.tabQywxErrorLogMapper.insert(tabQywxErrorLog);
return tabQywxErrorLogBO;
}
@Override
public TabQywxErrorLogBO queryById(Long id) {
TabQywxErrorLog tabQywxErrorLog = this.tabQywxErrorLogMapper.queryById(id);
return EntityUtil.changeEntityByOrika(TabQywxErrorLogBO.class,tabQywxErrorLog);
}
@Override
public List<TabQywxErrorLogBO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO) {
return EntityUtil.changeEntityListByOrika(TabQywxErrorLogBO.class,this.tabQywxErrorLogMapper.queryListByPage(qywxErrorLogListQDTO));
}
}
package com.gic.haoban.manage.service.service.out.impl;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.QywxErrorLogDTO;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.api.service.TabQywxErrorLogApiService;
import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import com.gic.haoban.manage.service.service.TabQywxErrorLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 企微报错日志(TabQywxErrorLog)表服务实现类
*
* @author mozhu
* @date 2022-04-18 15:28:02
*/
@Service
public class TabQywxErrorLogApiServiceImpl implements TabQywxErrorLogApiService {
@Autowired
private TabQywxErrorLogService tabQywxErrorLogService;
@Override
public void insertQywxErrorLog(String param) {
TabQywxErrorLogBO tabQywxErrorLogBO = JSON.parseObject(param, TabQywxErrorLogBO.class);
tabQywxErrorLogService.insert(tabQywxErrorLogBO);
}
@Override
public QywxErrorLogDTO queryById(Long id) {
return EntityUtil.changeEntityByOrika(QywxErrorLogDTO.class,tabQywxErrorLogService.queryById(id));
}
@Override
public Page<QywxErrorLogDTO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO) {
PageHelper.startPage(qywxErrorLogListQDTO.getPageNum(), qywxErrorLogListQDTO.getPageSize());
List<TabQywxErrorLogBO> list = this.tabQywxErrorLogService.queryListByPage(qywxErrorLogListQDTO);
return PageUtil.changePageHelperToCurrentPage(new PageInfo<>(list), QywxErrorLogDTO.class);
}
}
<?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.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper">
<resultMap type="com.gic.haoban.manage.service.entity.TabQywxErrorLog" id="TabQywxErrorLogMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="scenario" column="scenario" jdbcType="VARCHAR"/>
<result property="errorContent" column="error_content" jdbcType="VARCHAR"/>
<result property="weworkErrorUrl" column="wework_error_url" jdbcType="VARCHAR"/>
<result property="traceId" column="trace_id" jdbcType="VARCHAR"/>
<result property="qywxErrorType" column="qywx_error_type" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, scenario, error_content, wework_error_url, trace_id, qywx_error_type, create_time </sql>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true" parameterType="com.gic.haoban.manage.service.entity.TabQywxErrorLog">
INSERT INTO tab_qywx_error_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="scenario != null and scenario != ''">
scenario,
</if>
<if test="errorContent != null and errorContent != ''">
error_content,
</if>
<if test="weworkErrorUrl != null and weworkErrorUrl != ''">
wework_error_url,
</if>
<if test="traceId != null and traceId != ''">
trace_id,
</if>
<if test="qywxErrorType != null">
qywx_error_type,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="scenario != null and scenario != ''">
#{scenario},
</if>
<if test="errorContent != null and errorContent != ''">
#{errorContent},
</if>
<if test="weworkErrorUrl != null and weworkErrorUrl != ''">
#{weworkErrorUrl},
</if>
<if test="traceId != null and traceId != ''">
#{traceId},
</if>
<if test="qywxErrorType != null">
#{qywxErrorType},
</if>
<if test="createTime != null">
#{createTime},
</if>
</trim>
</insert>
<!--通过主键修改数据-->
<update id="update" parameterType="com.gic.haoban.manage.service.entity.TabQywxErrorLog">
update tab_qywx_error_log
<set>
<if test="scenario != null and scenario != ''">
scenario = #{scenario},
</if>
<if test="errorContent != null and errorContent != ''">
error_content = #{errorContent},
</if>
<if test="weworkErrorUrl != null and weworkErrorUrl != ''">
wework_error_url = #{weworkErrorUrl},
</if>
<if test="traceId != null and traceId != ''">
trace_id = #{traceId},
</if>
<if test="qywxErrorType != null">
qywx_error_type = #{qywxErrorType},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tab_qywx_error_log
where id = #{id}
</delete>
<!--查询单个-->
<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" resultMap="TabQywxErrorLogMap">
select
<include refid="Base_Column_List"/>
from tab_qywx_error_log
<where>
<if test="scenario != null and scenario != ''">
and scenario = #{scenario}
</if>
<if test="qywxErrorType != null">
and qywx_error_type = #{qywxErrorType}
</if>
<if test="startDate != null">
and create_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null">
and create_time <![CDATA[ <= ]]> #{endDate}
</if>
</where>
</select>
</mapper>
...@@ -8,7 +8,6 @@ import com.gic.haoban.manage.api.dto.StoreRangeInfoDTO; ...@@ -8,7 +8,6 @@ import com.gic.haoban.manage.api.dto.StoreRangeInfoDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.StoreGroupVo; import com.gic.haoban.manage.web.vo.StoreGroupVo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -53,12 +51,8 @@ public class GicDepartmentController extends WebBaseController{ ...@@ -53,12 +51,8 @@ public class GicDepartmentController extends WebBaseController{
List<WxEnterpriseDTO> wxEnterpriseDTOS = wxEnterpriseRelatedApiService.listWxEnterpriseByEid(enterpriseId); List<WxEnterpriseDTO> wxEnterpriseDTOS = wxEnterpriseRelatedApiService.listWxEnterpriseByEid(enterpriseId);
if (CollectionUtils.isNotEmpty(wxEnterpriseDTOS)) { if (CollectionUtils.isNotEmpty(wxEnterpriseDTOS)) {
Map<String, WxEnterpriseDTO> wxEnterpriseDTOMap = wxEnterpriseDTOS.stream().collect(Collectors.toMap(dto -> dto.getWxEnterpriseId(), dto -> dto)); Map<String, WxEnterpriseDTO> wxEnterpriseDTOMap = wxEnterpriseDTOS.stream().collect(Collectors.toMap(dto -> dto.getWxEnterpriseId(), dto -> dto));
storeRangeMap = rangeInfoDTOList.stream().filter(dto -> (!dto.getWxEnterpriseId().equals(wxEnterpriseId)) && dto.getRelationType() == 1) storeRangeMap = rangeInfoDTOList.stream().filter(dto -> (!dto.getWxEnterpriseId().equals(wxEnterpriseId)) && dto.getRelationType() == 1)
.map(dto -> { .peek(dto -> dto.setWxEnterpriseName(wxEnterpriseDTOMap.get(dto.getWxEnterpriseId()).getCorpName())).collect(Collectors.toMap(dto -> dto.getRelationId(), dto -> dto));
dto.setWxEnterpriseName(wxEnterpriseDTOMap.get(dto.getWxEnterpriseId()).getCorpName());
return dto;
}).collect(Collectors.toMap(dto -> dto.getRelationId(), dto -> dto));
} }
} }
Map<String, StoreRangeInfoDTO> finalStoreRangeMap = storeRangeMap; Map<String, StoreRangeInfoDTO> finalStoreRangeMap = storeRangeMap;
......
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