Commit 734e0a86 by 墨竹

fix:默认返回模板

parent 2301b10a
......@@ -11,10 +11,12 @@ import com.gic.haoban.manage.service.dao.mapper.ApplicationMapper;
import com.gic.haoban.manage.service.entity.TabHaobanApplication;
import com.gic.haoban.manage.service.entity.TabHaobanTemplateApplicationRelated;
import com.gic.haoban.manage.service.service.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
......@@ -22,71 +24,77 @@ 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();
List<String> applicationIds = new ArrayList<>();
//-1默认模版
if ("-1".equals(wxEnterpriseId) || StringUtils.isBlank(wxEnterpriseId)) {
applicationIds = Arrays.asList("11112", "11113", "11116", "11117", "11118");
} else {
TemplateEnterpriseRelatedDTO template = templateEnterpriseRelatedService.selectByWxEnterpriseId(wxEnterpriseId);
if (template == null) {
return Collections.EMPTY_LIST;
}
List<TabHaobanTemplateApplicationRelated> applicatinList = templateApplicationRelatedService.listByTemplateId(template.getApplicationTemplateId());
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);
}
}
}
}
<?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.TabHaobanTemplateEnterpriseRelationMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation" >
<id column="template_enterprise_relation_id" property="templateEnterpriseRelationId" jdbcType="VARCHAR" />
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" />
<result column="wx_enterprise_name" property="wxEnterpriseName" jdbcType="VARCHAR" />
<result column="application_template_id" property="applicationTemplateId" jdbcType="VARCHAR" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
template_enterprise_relation_id, wx_enterprise_id, application_template_id, status_flag,wx_enterprise_name,
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanTemplateEnterpriseRelationMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation">
<id column="template_enterprise_relation_id" property="templateEnterpriseRelationId" jdbcType="VARCHAR"/>
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR"/>
<result column="wx_enterprise_name" property="wxEnterpriseName" jdbcType="VARCHAR"/>
<result column="application_template_id" property="applicationTemplateId" jdbcType="VARCHAR"/>
<result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
template_enterprise_relation_id, wx_enterprise_id, application_template_id, status_flag,wx_enterprise_name,
create_time, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_template_enterprise_relation
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_template_enterprise_relation
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation" >
insert into tab_haoban_template_enterprise_relation (template_enterprise_relation_id, wx_enterprise_id,
application_template_id, status_flag, create_time,
update_time,wx_enterprise_name)
values (#{templateEnterpriseRelationId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{applicationTemplateId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{wxEnterpriseName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation" >
insert into tab_haoban_template_enterprise_relation
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="templateEnterpriseRelationId != null" >
template_enterprise_relation_id,
</if>
<if test="wxEnterpriseId != null" >
wx_enterprise_id,
</if>
<if test="wxEnterpriseName != null" >
wx_enterprise_name,
</if>
<if test="applicationTemplateId != null" >
application_template_id,
</if>
<if test="statusFlag != null" >
status_flag,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="templateEnterpriseRelationId != null" >
#{templateEnterpriseRelationId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null" >
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseName != null" >
#{wxEnterpriseName,jdbcType=VARCHAR},
</if>
<if test="applicationTemplateId != null" >
#{applicationTemplateId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation" >
update tab_haoban_template_enterprise_relation
<set >
<if test="wxEnterpriseId != null" >
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseName != null" >
wx_enterprise_name = #{wxEnterpriseName,jdbcType=VARCHAR},
</if>
<if test="applicationTemplateId != null" >
application_template_id = #{applicationTemplateId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" >
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation" >
update tab_haoban_template_enterprise_relation
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
wx_enterprise_name = #{wxEnterpriseName,jdbcType=VARCHAR},
application_template_id = #{applicationTemplateId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</update>
<select id="listEnterpriseByTemplateId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_template_enterprise_relation
where application_template_id = #{templateId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select id="selectByWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_template_enterprise_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select id="listEnterpriseByParams" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_template_enterprise_relation
where application_template_id = #{applicationTemplateId,jdbcType=VARCHAR}
and status_flag = 1
<if test="wxEnterpriseName != null and wxEnterpriseName != ''">
and wx_enterprise_name like CONCAT('%',#{wxEnterpriseName},'%')
</if>
<if test="wxEnterpriseIds != null and wxEnterpriseIds.size() > 0">
and wx_enterprise_id IN
<foreach collection="wxEnterpriseIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_template_enterprise_relation
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from tab_haoban_template_enterprise_relation
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation">
insert into tab_haoban_template_enterprise_relation (template_enterprise_relation_id, wx_enterprise_id,
application_template_id, status_flag, create_time,
update_time, wx_enterprise_name)
values (#{templateEnterpriseRelationId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{applicationTemplateId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{wxEnterpriseName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective"
parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation">
insert into tab_haoban_template_enterprise_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="templateEnterpriseRelationId != null">
template_enterprise_relation_id,
</if>
<if test="wxEnterpriseId != null">
wx_enterprise_id,
</if>
<if test="wxEnterpriseName != null">
wx_enterprise_name,
</if>
<if test="applicationTemplateId != null">
application_template_id,
</if>
<if test="statusFlag != null">
status_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="templateEnterpriseRelationId != null">
#{templateEnterpriseRelationId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null">
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseName != null">
#{wxEnterpriseName,jdbcType=VARCHAR},
</if>
<if test="applicationTemplateId != null">
#{applicationTemplateId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective"
parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation">
update tab_haoban_template_enterprise_relation
<set>
<if test="wxEnterpriseId != null">
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseName != null">
wx_enterprise_name = #{wxEnterpriseName,jdbcType=VARCHAR},
</if>
<if test="applicationTemplateId != null">
application_template_id = #{applicationTemplateId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey"
parameterType="com.gic.haoban.manage.service.entity.TabHaobanTemplateEnterpriseRelation">
update tab_haoban_template_enterprise_relation
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
wx_enterprise_name = #{wxEnterpriseName,jdbcType=VARCHAR},
application_template_id = #{applicationTemplateId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where template_enterprise_relation_id = #{templateEnterpriseRelationId,jdbcType=VARCHAR}
</update>
<select id="listEnterpriseByTemplateId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_template_enterprise_relation
where application_template_id = #{templateId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select id="selectByWxEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_template_enterprise_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select id="listEnterpriseByParams" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_template_enterprise_relation
where application_template_id = #{applicationTemplateId,jdbcType=VARCHAR}
and status_flag = 1
<if test="wxEnterpriseName != null and wxEnterpriseName != ''">
and wx_enterprise_name like CONCAT('%',#{wxEnterpriseName},'%')
</if>
<if test="wxEnterpriseIds != null and wxEnterpriseIds.size() > 0">
and wx_enterprise_id IN
<foreach collection="wxEnterpriseIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
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) {
......
......@@ -198,7 +198,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
String wxOpenUseId = staffLoginQO.getWxOpenUseId();
//-1 代表游客登录
if ("-1".equals(staffId) || StringUtils.isBlank(staffId)) {
return wellDoneLoginPrivacy(staffLoginQO, request, staffId, wxOpenUseId);
return wellDoneTouristsLogin(staffLoginQO, request, staffId, wxOpenUseId);
}
//用户登录
return wellDoneLogin(staffLoginQO, request, staffId);
......@@ -212,7 +212,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