Commit 202c28f3 by jinxin

新增自建应用配置信息

parent 78b23b59
...@@ -41,7 +41,19 @@ public class YwWxEnterpriseDTO implements Serializable { ...@@ -41,7 +41,19 @@ public class YwWxEnterpriseDTO implements Serializable {
* 是否开启历史好友关联 true 开启 false 关闭 * 是否开启历史好友关联 true 开启 false 关闭
*/ */
private Boolean openMassFlag; private Boolean openMassFlag;
/**
* 应用类型,0第三方 1自建
*/
private Integer appType;
public Integer getAppType() {
return appType;
}
public void setAppType(Integer appType) {
this.appType = appType;
}
private List<EnterpriseDetailDTO> enList ; private List<EnterpriseDetailDTO> enList ;
public List<EnterpriseDetailDTO> getEnList() { public List<EnterpriseDetailDTO> getEnList() {
......
...@@ -26,6 +26,7 @@ public interface WxEnterpriseApiService { ...@@ -26,6 +26,7 @@ public interface WxEnterpriseApiService {
* @param version 版本 * @param version 版本
* @param enterpriseIdsNotIn 企业不存在列表 * @param enterpriseIdsNotIn 企业不存在列表
* @param loginUserId 登录用户id * @param loginUserId 登录用户id
* @param appType 应用类型,0第三方 1自建
* @return : {@link Page< YwWxEnterpriseDTO>} * @return : {@link Page< YwWxEnterpriseDTO>}
* @author : YongEn * @author : YongEn
* @date : 2022/2/15 * @date : 2022/2/15
...@@ -36,7 +37,8 @@ public interface WxEnterpriseApiService { ...@@ -36,7 +37,8 @@ public interface WxEnterpriseApiService {
Integer gicContactFlag, Integer gicContactFlag,
String version, String version,
List<String> enterpriseIdsNotIn, List<String> enterpriseIdsNotIn,
String loginUserId); String loginUserId,
Integer appType);
/** /**
* 获取一个 * 获取一个
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.authcenter.commons.dto.AuthcenterUserDetails; import com.gic.authcenter.commons.dto.AuthcenterUserDetails;
...@@ -32,6 +31,7 @@ import com.gic.haoban.manage.api.service.WxEnterpriseApiService; ...@@ -32,6 +31,7 @@ import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
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.qo.WxEnterpriseBindQo; import com.gic.haoban.manage.web.qo.WxEnterpriseBindQo;
import com.gic.haoban.manage.web.qo.WxEnterpriseQO;
import com.gic.haoban.manage.web.vo.EnterpriseDetailVo; import com.gic.haoban.manage.web.vo.EnterpriseDetailVo;
import com.gic.haoban.manage.web.vo.EnterpriseSearchVO; import com.gic.haoban.manage.web.vo.EnterpriseSearchVO;
import com.gic.haoban.manage.web.vo.StoreGroupVo; import com.gic.haoban.manage.web.vo.StoreGroupVo;
...@@ -110,6 +110,7 @@ public class EnterpriseController extends WebBaseController { ...@@ -110,6 +110,7 @@ public class EnterpriseController extends WebBaseController {
* @param gicContactHelper 是否开启通讯录应用1是0否 * @param gicContactHelper 是否开启通讯录应用1是0否
* @param loginUserId 登录用户id * @param loginUserId 登录用户id
* @param version 版本 * @param version 版本
* @param appType 应用类型,0第三方 1自建 null全部
* @return res * @return res
*/ */
@RequestMapping("wx-enterprise-list") @RequestMapping("wx-enterprise-list")
...@@ -119,7 +120,8 @@ public class EnterpriseController extends WebBaseController { ...@@ -119,7 +120,8 @@ public class EnterpriseController extends WebBaseController {
String gicEnterpriseName, String gicEnterpriseName,
Integer gicContactHelper, Integer gicContactHelper,
String loginUserId, String loginUserId,
String version) { String version,
Integer appType) {
List<String> wxEnterpriseIdInList = Lists.newArrayList(); List<String> wxEnterpriseIdInList = Lists.newArrayList();
...@@ -141,15 +143,15 @@ public class EnterpriseController extends WebBaseController { ...@@ -141,15 +143,15 @@ public class EnterpriseController extends WebBaseController {
Page<YwWxEnterpriseDTO> page = new Page<>(); Page<YwWxEnterpriseDTO> page = new Page<>();
if (Objects.nonNull(openTagFlag) && ALL == openTagFlag) { if (Objects.nonNull(openTagFlag) && ALL == openTagFlag) {
page = queryAll(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId); page = queryAll(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId,appType);
} }
if (Objects.nonNull(openTagFlag) && OPEN == openTagFlag) { if (Objects.nonNull(openTagFlag) && OPEN == openTagFlag) {
page = queryOpen(pageInfo, keyword, gicEnterpriseName, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId); page = queryOpen(pageInfo, keyword, gicEnterpriseName, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId,appType);
} }
if (Objects.nonNull(openTagFlag) && CLOSE == openTagFlag) { if (Objects.nonNull(openTagFlag) && CLOSE == openTagFlag) {
page = queryClose(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId); page = queryClose(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId,appType);
} }
doProcessOpenSendMass(page.getResult()); doProcessOpenSendMass(page.getResult());
...@@ -222,9 +224,10 @@ public class EnterpriseController extends WebBaseController { ...@@ -222,9 +224,10 @@ public class EnterpriseController extends WebBaseController {
String version, String version,
List<String> wxEnterpriseIdInList, List<String> wxEnterpriseIdInList,
Set<String> wxEnterpriseIdSetInCache, Set<String> wxEnterpriseIdSetInCache,
String loginUserId) { String loginUserId,
Integer appType) {
// 查询所有状态 // 查询所有状态
Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, null, loginUserId); Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, null, loginUserId,appType);
if (CollectionUtil.isEmpty(page.getResult())) { if (CollectionUtil.isEmpty(page.getResult())) {
return page; return page;
} }
...@@ -250,14 +253,15 @@ public class EnterpriseController extends WebBaseController { ...@@ -250,14 +253,15 @@ public class EnterpriseController extends WebBaseController {
String version, String version,
List<String> wxEnterpriseIdInList, List<String> wxEnterpriseIdInList,
Set<String> wxEnterpriseIdSetInCache, Set<String> wxEnterpriseIdSetInCache,
String loginUserId) { String loginUserId,
Integer appType) {
// 查询开启状态 // 查询开启状态
if (haveCondition(gicEnterpriseName)) { if (haveCondition(gicEnterpriseName)) {
// 有条件-取交集 // 有条件-取交集
wxEnterpriseIdSetInCache.retainAll(wxEnterpriseIdInList); wxEnterpriseIdSetInCache.retainAll(wxEnterpriseIdInList);
} }
List<String> queryList = new ArrayList<>(wxEnterpriseIdSetInCache); List<String> queryList = new ArrayList<>(wxEnterpriseIdSetInCache);
Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, queryList, gicContactHelper, version, null, loginUserId); Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, queryList, gicContactHelper, version, null, loginUserId,appType);
if (CollectionUtil.isEmpty(page.getResult())) { if (CollectionUtil.isEmpty(page.getResult())) {
return page; return page;
} }
...@@ -279,9 +283,10 @@ public class EnterpriseController extends WebBaseController { ...@@ -279,9 +283,10 @@ public class EnterpriseController extends WebBaseController {
String version, String version,
List<String> wxEnterpriseIdInList, List<String> wxEnterpriseIdInList,
Set<String> wxEnterpriseIdSetInCache, Set<String> wxEnterpriseIdSetInCache,
String loginUserId) { String loginUserId,
Integer appType) {
// 查询关闭状态 // 查询关闭状态
Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, new ArrayList<>(wxEnterpriseIdSetInCache), loginUserId); Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, new ArrayList<>(wxEnterpriseIdSetInCache), loginUserId,appType);
if (CollectionUtil.isEmpty(page.getResult())) { if (CollectionUtil.isEmpty(page.getResult())) {
return page; return page;
} }
...@@ -630,4 +635,19 @@ public class EnterpriseController extends WebBaseController { ...@@ -630,4 +635,19 @@ public class EnterpriseController extends WebBaseController {
WxEnterpriseRelationDetailDTO bindInfo = wxEnterpriseRelatedApiService.getEnterpriseBindInfo(wxEnterpriseId, enterpriseId); WxEnterpriseRelationDetailDTO bindInfo = wxEnterpriseRelatedApiService.getEnterpriseBindInfo(wxEnterpriseId, enterpriseId);
return resultResponse(HaoBanErrCode.ERR_1, bindInfo); return resultResponse(HaoBanErrCode.ERR_1, bindInfo);
} }
/**
* 新增或者修改企业微信自建应用信息
* @return
*/
@RequestMapping("saveOrUpdate-WxEnterprise-detail")
public RestResponse<Boolean> saveOrUpdateEnterpriseDetail(WxEnterpriseQO qo){
WxEnterpriseDTO wxEnterpriseDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, qo);
com.gic.api.base.commons.ServiceResponse<Boolean> response = wxEnterpriseApiService.saveOrUpdate(wxEnterpriseDTO);
if (response.isSuccess()){
return RestResponse.successResult(true);
}
return RestResponse.failure(response.getCode(),response.getMessage());
}
} }
package com.gic.haoban.manage.web.qo;
import java.io.Serializable;
public class WxEnterpriseQO implements Serializable {
private static final long serialVersionUID = 1L;
private String wxEnterpriseId;
/**
* 企业名称
*/
private String corpName;
/**
* 企业头像
*/
private String corpSquareLogoUrl;
/**
* 应用名称
*/
private String name;
/**
* wx的秘钥
*/
private String wxSecretKey;
/**
* 明文corpid
*/
private String wxCorpid;
/**
* 自建小程序appid
*/
private String wxaAppid;
/**
* 自建请求url
*/
private String urlHost;
/**
* 应用类型,0第三方 1自建
*/
private Integer appType;
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getCorpName() {
return corpName;
}
public void setCorpName(String corpName) {
this.corpName = corpName;
}
public String getCorpSquareLogoUrl() {
return corpSquareLogoUrl;
}
public void setCorpSquareLogoUrl(String corpSquareLogoUrl) {
this.corpSquareLogoUrl = corpSquareLogoUrl;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWxSecretKey() {
return wxSecretKey;
}
public void setWxSecretKey(String wxSecretKey) {
this.wxSecretKey = wxSecretKey;
}
public String getWxCorpid() {
return wxCorpid;
}
public void setWxCorpid(String wxCorpid) {
this.wxCorpid = wxCorpid;
}
public String getWxaAppid() {
return wxaAppid;
}
public void setWxaAppid(String wxaAppid) {
this.wxaAppid = wxaAppid;
}
public String getUrlHost() {
return urlHost;
}
public void setUrlHost(String urlHost) {
this.urlHost = urlHost;
}
public Integer getAppType() {
return appType;
}
public void setAppType(Integer appType) {
this.appType = appType;
}
}
...@@ -22,7 +22,8 @@ public interface WxEnterpriseMapper { ...@@ -22,7 +22,8 @@ public interface WxEnterpriseMapper {
@Param("enterpriseIds") List<String> enterpriseIds, @Param("enterpriseIds") List<String> enterpriseIds,
@Param("gicContactFlag") Integer gicContactFlag, @Param("gicContactFlag") Integer gicContactFlag,
@Param("version") String version, @Param("version") String version,
@Param("enterpriseIdsNotIn") List<String> enterpriseIdsNotIn); @Param("enterpriseIdsNotIn") List<String> enterpriseIdsNotIn,
@Param("appType") Integer appType);
List<TabHaobanWxEnterprise> listAll(); List<TabHaobanWxEnterprise> listAll();
......
...@@ -193,10 +193,10 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -193,10 +193,10 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
@Override @Override
public com.gic.api.base.commons.Page<YwWxEnterpriseDTO> list(BasePageInfo pageInfo, String keyword, public com.gic.api.base.commons.Page<YwWxEnterpriseDTO> list(BasePageInfo pageInfo, String keyword,
List<String> enterpriseIds, Integer gicContactFlag, String version, List<String> enterpriseIdsNotIn, List<String> enterpriseIds, Integer gicContactFlag, String version, List<String> enterpriseIdsNotIn,
String loginUserId) { String loginUserId,Integer appType) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize()); PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
Page<TabHaobanWxEnterprise> page = wxEnterpriseMapper.list(keyword, enterpriseIds, gicContactFlag, version, Page<TabHaobanWxEnterprise> page = wxEnterpriseMapper.list(keyword, enterpriseIds, gicContactFlag, version,
enterpriseIdsNotIn); enterpriseIdsNotIn,appType);
// 数据转换+白名单过滤 // 数据转换+白名单过滤
if (Objects.isNull(page) || CollectionUtils.isEmpty(page.getResult())) { if (Objects.isNull(page) || CollectionUtils.isEmpty(page.getResult())) {
com.gic.api.base.commons.Page<Object> objectPage = new com.gic.api.base.commons.Page<>(); com.gic.api.base.commons.Page<Object> objectPage = new com.gic.api.base.commons.Page<>();
......
...@@ -443,6 +443,9 @@ ...@@ -443,6 +443,9 @@
<if test="gicContactFlag != null"> <if test="gicContactFlag != null">
and contact_flag = #{gicContactFlag,jdbcType=INTEGER} and contact_flag = #{gicContactFlag,jdbcType=INTEGER}
</if> </if>
<if test=" appType != null">
and app_type = #{appType}
</if>
<if test="version != null and version == 2"> <if test="version != null and version == 2">
<if test="keyword != null and keyword != '' and enterpriseIds != null and enterpriseIds.size() > 0"> <if test="keyword != null and keyword != '' and enterpriseIds != null and enterpriseIds.size() > 0">
and (corp_name like CONCAT('%',#{keyword},'%') and (corp_name like CONCAT('%',#{keyword},'%')
......
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