Commit 211032c8 by jinxin

过滤已经存在的自建应用appid

parent 62ddcd59
......@@ -241,4 +241,11 @@ public interface WxEnterpriseApiService {
*/
ServiceResponse<Boolean> saveOrUpdate(WxEnterpriseDTO enterpriseDTO);
/**
* 过滤已经存在的自建应用appid
* @param wxAppidList 好办自建应用appidList
* @return 过滤的好办自建应用appidList
*/
ServiceResponse<List<String>> filterWxAppidList(List<String> wxAppidList);
}
......@@ -78,4 +78,8 @@ public interface WxEnterpriseMapper {
* @return
*/
List<String> queryWxEnterpriseByEnterpriseId(@Param("enterpriseId") String enterpriseId);
/**
* 根据appidList查询appidList
*/
List<String> getWxAppidListByList(@Param("wxAppidList")List<String> wxAppidList);
}
\ No newline at end of file
......@@ -75,5 +75,9 @@ public interface WxEnterpriseService {
* @return
*/
List<String> queryWxEnterpriseWithEnterpriseId(String enterpriseId);
/**
* 根据appidList查询appidList
*/
List<String> getWxAppidListByList(List<String> wxAppidList);
}
......@@ -7,6 +7,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -292,4 +293,12 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
return this.mapper.queryWxEnterpriseByEnterpriseId(enterpriseId);
}
@Override
public List<String> getWxAppidListByList(List<String> wxAppidList) {
if (CollUtil.isEmpty(wxAppidList)){
return Collections.emptyList();
}
return this.mapper.getWxAppidListByList(wxAppidList);
}
}
package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
......@@ -527,4 +528,17 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
}
return ServiceResponse.success(true);
}
@Override
public ServiceResponse<List<String>> filterWxAppidList(List<String> wxAppidList) {
log.info("查询的wxAppidList:{}",JSON.toJSONString(wxAppidList));
if (CollUtil.isEmpty(wxAppidList)){
return ServiceResponse.failure("-9999","参数为空");
}
List<String> list = wxEnterpriseService.getWxAppidListByList(wxAppidList);
log.info("需要过滤的wxAppidList:{}",JSON.toJSONString(list));
//过滤
wxAppidList.removeAll(list);
return ServiceResponse.success(wxAppidList);
}
}
......@@ -554,4 +554,18 @@
and a.enterprise_id = #{enterpriseId}
</select>
<select id="getWxAppidListByList" resultType="java.lang.String">
select
wxa_appid
from tab_haoban_wx_enterprise
where
status_flag = 1
and app_type = 1
<if test="wxAppidList != null and wxAppidList.size() > 0">
and wxa_appid IN
<foreach collection="wxAppidList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment