Commit 0f25fc60 by 墨竹

Merge branch 'feature-04-26' into developer

# Conflicts:
#	haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
parents 5b76aa85 037d1d98
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));
}
}
......@@ -22,71 +22,71 @@ import java.util.stream.Collectors;
@Service
public class ApplicationApiServiceImpl implements ApplicationApiService {
@Autowired
private ApplicationService applicationService;
@Autowired
private ApplicationMapper applicationMapper;
@Autowired
private TemplateEnterpriseRelatedService templateEnterpriseRelatedService;
@Autowired
private TemplateApplicationRelatedService templateApplicationRelatedService;
@Autowired
private ApplicationTemplateService applicationTemplateService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Override
public List<ApplicationDTO> listApplication() {
List<TabHaobanApplication> list = applicationService.listApplication();
return EntityUtil.changeEntityListByJSON(ApplicationDTO.class, list);
}
@Autowired
private ApplicationService applicationService;
@Autowired
private ApplicationMapper applicationMapper;
@Autowired
private TemplateEnterpriseRelatedService templateEnterpriseRelatedService;
@Autowired
private TemplateApplicationRelatedService templateApplicationRelatedService;
@Autowired
private ApplicationTemplateService applicationTemplateService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Override
public List<ApplicationDTO> listByApplications(List<String> applicationIds) {
List<TabHaobanApplication> list = applicationMapper.listByApplicationIds(applicationIds);
if(CollectionUtil.isEmpty(list)){
return null;
}
List<ApplicationDTO> result = EntityUtil.changeEntityListByJSON(ApplicationDTO.class, list);
return result;
}
@Override
public List<ApplicationDTO> listApplication() {
List<TabHaobanApplication> list = applicationService.listApplication();
return EntityUtil.changeEntityListByJSON(ApplicationDTO.class, list);
}
@Override
public List<ApplicationDTO> listApplicationByWxEnterpriseId(String wxEnterpriseId) {
List<TabHaobanApplication> list = applicationService.listApplication();
TemplateEnterpriseRelatedDTO template = templateEnterpriseRelatedService.selectByWxEnterpriseId(wxEnterpriseId);
if(template == null){
return Collections.EMPTY_LIST;
}
List<TabHaobanTemplateApplicationRelated> applicatinList = templateApplicationRelatedService.listByTemplateId(template.getApplicationTemplateId());
List<String> applicationIds = applicatinList.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
List<TabHaobanApplication> result = new ArrayList<TabHaobanApplication>();
for (TabHaobanApplication tabHaobanApplication : list) {
if(applicationIds.contains(tabHaobanApplication.getApplicationId())){
result.add(tabHaobanApplication);
}
}
@Override
public List<ApplicationDTO> listByApplications(List<String> applicationIds) {
List<TabHaobanApplication> list = applicationMapper.listByApplicationIds(applicationIds);
if (CollectionUtil.isEmpty(list)) {
return null;
}
List<ApplicationDTO> result = EntityUtil.changeEntityListByJSON(ApplicationDTO.class, list);
return result;
}
return EntityUtil.changeEntityListByJSON(ApplicationDTO.class, result);
}
@Override
public void insertApplicationRelation(String wxEnterpriseId) {
TemplateEnterpriseRelatedDTO dto = templateEnterpriseRelatedService.selectByWxEnterpriseId(wxEnterpriseId);
if(dto == null){
ApplicationTemplateDTO defaultTemplate = applicationTemplateService.selectDefaultTemplate();
if(defaultTemplate != null){
dto = new TemplateEnterpriseRelatedDTO();
dto.setApplicationTemplateId(defaultTemplate.getApplicationTemplateId());
dto.setWxEnterpriseId(wxEnterpriseId);
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
if(enterprise != null){
dto.setWxEnterpriseName(enterprise.getCorpName());
}
templateEnterpriseRelatedService.insert(dto);
}
}
}
@Override
public List<ApplicationDTO> listApplicationByWxEnterpriseId(String wxEnterpriseId) {
List<TabHaobanApplication> list = applicationService.listApplication();
TemplateEnterpriseRelatedDTO template = templateEnterpriseRelatedService.selectByWxEnterpriseId(wxEnterpriseId);
if (template == null) {
return Collections.EMPTY_LIST;
}
List<TabHaobanTemplateApplicationRelated> applicatinList = templateApplicationRelatedService.listByTemplateId(template.getApplicationTemplateId());
List<String> applicationIds = applicatinList.stream().map(TabHaobanTemplateApplicationRelated::getApplicationId).collect(Collectors.toList());
List<TabHaobanApplication> result = new ArrayList<TabHaobanApplication>();
for (TabHaobanApplication tabHaobanApplication : list) {
if (applicationIds.contains(tabHaobanApplication.getApplicationId())) {
result.add(tabHaobanApplication);
}
}
return EntityUtil.changeEntityListByJSON(ApplicationDTO.class, result);
}
@Override
public void insertApplicationRelation(String wxEnterpriseId) {
TemplateEnterpriseRelatedDTO dto = templateEnterpriseRelatedService.selectByWxEnterpriseId(wxEnterpriseId);
if (dto == null) {
ApplicationTemplateDTO defaultTemplate = applicationTemplateService.selectDefaultTemplate();
if (defaultTemplate != null) {
dto = new TemplateEnterpriseRelatedDTO();
dto.setApplicationTemplateId(defaultTemplate.getApplicationTemplateId());
dto.setWxEnterpriseId(wxEnterpriseId);
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
if (enterprise != null) {
dto.setWxEnterpriseName(enterprise.getCorpName());
}
templateEnterpriseRelatedService.insert(dto);
}
}
}
}
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;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.StoreGroupVo;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
......@@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -53,12 +51,8 @@ public class GicDepartmentController extends WebBaseController{
List<WxEnterpriseDTO> wxEnterpriseDTOS = wxEnterpriseRelatedApiService.listWxEnterpriseByEid(enterpriseId);
if (CollectionUtils.isNotEmpty(wxEnterpriseDTOS)) {
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)
.map(dto -> {
dto.setWxEnterpriseName(wxEnterpriseDTOMap.get(dto.getWxEnterpriseId()).getCorpName());
return dto;
}).collect(Collectors.toMap(dto -> dto.getRelationId(), dto -> dto));
.peek(dto -> dto.setWxEnterpriseName(wxEnterpriseDTOMap.get(dto.getWxEnterpriseId()).getCorpName())).collect(Collectors.toMap(dto -> dto.getRelationId(), dto -> dto));
}
}
Map<String, StoreRangeInfoDTO> finalStoreRangeMap = storeRangeMap;
......
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.web.vo.SdkVersionLimitVo;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.collection.CollectionUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.ApplicationDTO;
import com.gic.haoban.manage.api.dto.ApplicationSettingDTO;
import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.api.service.ApplicationSettingApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.SdkVersionLimitVo;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
@RestController
public class ApplicationController extends WebBaseController{
@Autowired
private ApplicationApiService applicationApiService;
@Autowired
private ApplicationSettingApiService applicationSettingApiService;
public class ApplicationController extends WebBaseController {
@Autowired
private ApplicationApiService applicationApiService;
@Autowired
private ApplicationSettingApiService applicationSettingApiService;
private static final String SDKVERSION_KEY = "haoban-wx-sdk-version";
@RequestMapping("application-list")
public HaobanResponse applicationList(String wxEnterpriseId) {
List<ApplicationDTO> list = applicationApiService.listApplicationByWxEnterpriseId(wxEnterpriseId);
List<String> applicationIds = list.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
List<ApplicationSettingDTO> settings = applicationSettingApiService.listOpenByWxEnterpriseIdAndApplicationIds(wxEnterpriseId, applicationIds);
List<String> openApplicationIds = new ArrayList<String>();
if(CollectionUtil.isNotEmpty(settings)){
openApplicationIds = settings.stream().map(s->s.getApplicationId()).collect(Collectors.toList());
}
Iterator<ApplicationDTO> it = list.listIterator();
while(it.hasNext()){
ApplicationDTO app = it.next();
if(!openApplicationIds.contains(app.getApplicationId())){
it.remove();
continue ;
}
if("通讯录".equals(app.getApplicationName())){
it.remove();
continue ;
}
if("卡券赠送".equals(app.getApplicationName())){
it.remove();
continue ;
}
if("内购券".equals(app.getApplicationName())){
it.remove();
continue ;
}
}
return resultResponse(HaoBanErrCode.ERR_1,list);
}
@RequestMapping("application-list")
public HaobanResponse applicationList(String wxEnterpriseId) {
List<ApplicationDTO> list = applicationApiService.listApplicationByWxEnterpriseId(wxEnterpriseId);
List<String> applicationIds = list.stream().map(s -> s.getApplicationId()).collect(Collectors.toList());
List<ApplicationSettingDTO> settings = applicationSettingApiService.listOpenByWxEnterpriseIdAndApplicationIds(wxEnterpriseId, applicationIds);
List<String> openApplicationIds = new ArrayList<String>();
if (CollectionUtil.isNotEmpty(settings)) {
openApplicationIds = settings.stream().map(s -> s.getApplicationId()).collect(Collectors.toList());
}
Iterator<ApplicationDTO> it = list.listIterator();
while (it.hasNext()) {
ApplicationDTO app = it.next();
if (!openApplicationIds.contains(app.getApplicationId())) {
it.remove();
continue;
}
if ("通讯录".equals(app.getApplicationName())) {
it.remove();
continue;
}
if ("卡券赠送".equals(app.getApplicationName())) {
it.remove();
continue;
}
if ("内购券".equals(app.getApplicationName())) {
it.remove();
continue;
}
}
return resultResponse(HaoBanErrCode.ERR_1, list);
}
@RequestMapping("sdk-version-check")
public HaobanResponse sdkVersionCheck(String skdVersion) {
......@@ -85,8 +78,8 @@ public class ApplicationController extends WebBaseController{
String limitSdkVersion = cache.toString();
sdkVersionLimitVo.setLimitSdkVersion(limitSdkVersion);
String[] limitSdk = StringUtils.split(limitSdkVersion, ".");
String[] versionSplit = StringUtils.split(skdVersion, ".");
String[] limitSdk = StringUtils.split(limitSdkVersion, ".");
String[] versionSplit = StringUtils.split(skdVersion, ".");
int checkFlag = checkNum(Integer.valueOf(limitSdk[0]), Integer.valueOf(versionSplit[0]));
if (checkFlag != 0) {
......
......@@ -197,8 +197,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
String staffId = staffLoginQO.getStaffId();
String wxOpenUseId = staffLoginQO.getWxOpenUseId();
//-1 代表游客登录
if (StringUtils.isBlank(staffId) || "-1".equals(staffId)) {
return wellDoneLoginPrivacy(staffLoginQO, request, staffId, wxOpenUseId);
if ("-1".equals(staffId) || StringUtils.isBlank(staffId)) {
return wellDoneTouristsLogin(staffLoginQO, request, staffId, wxOpenUseId);
}
//用户登录
return wellDoneLogin(staffLoginQO, request, staffId);
......@@ -213,7 +213,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
* @param wxOpenUseId
* @return
*/
private RestResponse<String> wellDoneLoginPrivacy(StaffLoginQO staffLoginQO, HttpServletRequest request, String staffId, String wxOpenUseId) {
private RestResponse<String> wellDoneTouristsLogin(StaffLoginQO staffLoginQO, HttpServletRequest request, String staffId, String wxOpenUseId) {
logger.info("游客登录,wxOpenUseId:{}", wxOpenUseId);
//登录和刷新token兼容
String headerToken = AuthRequestWellDoneUtil.getHeaderToken();
......
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