Commit 18991f5f by 徐高华

企微加密类型

parent 1bebc84d
......@@ -221,6 +221,8 @@ public interface WxEnterpriseApiService {
public void updateWxSecurityType(String wxEnterpriseId) ;
public int calcSecretType(String wxEnterpriseId) ;
/**
*
* @Title: stopHaoban
......
......@@ -91,6 +91,8 @@ public interface WxEnterpriseService {
void updateWxSecurityType(String wxEnterpriseId) ;
public int calcSecretType(String wxEnterpriseId) ;
void stopHaoban(String enterpriseId);
}
......@@ -178,6 +178,31 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
@Override
public void updateWxSecurityType(String wxEnterpriseId) {
int wxSecurityType = this.calcSecretType(wxEnterpriseId);
if(wxSecurityType < 1 || wxSecurityType > 4) {
return ;
}
this.mapper.updateWxSecurityType(wxEnterpriseId, wxSecurityType);
}
private int getType (boolean mix3th , boolean mixdk) {
if(!mix3th && !mixdk) {
return 1 ;
}
if(mix3th && mixdk) {
return 2 ;
}
if(!mix3th && mixdk) {
return 3 ;
}
if(mix3th && !mixdk) {
return 4 ;
}
return 0 ;
}
@Override
public int calcSecretType(String wxEnterpriseId) {
List<TabHaobanWxApplication> applictionList = this.wxApplicationMapper.listApplication(wxEnterpriseId) ;
String corpid3th = null , corpidDk=null;
boolean mix3th = false ;
......@@ -194,7 +219,7 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
};
}
if(StringUtils.isBlank(corpid3th) || StringUtils.isBlank(corpidDk)) {
return ;
return 0 ;
}
if(corpid3th.length() > len) {
mix3th = true ;
......@@ -202,31 +227,12 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
if(corpidDk.length() > len) {
mixdk = true ;
}
int wxSecurityType = this.getType(mix3th, mixdk) ;
logger.info("更新企微加密类型,corpid3th={},corpidDk={},wxSecurityType={}",corpid3th,corpidDk,wxSecurityType);
if(wxSecurityType < 1 || wxSecurityType > 4) {
return ;
}
this.mapper.updateWxSecurityType(wxEnterpriseId, wxSecurityType);
int wxType = this.getType(mix3th, mixdk) ;
logger.info("更新企微加密类型,corpid3th={},corpidDk={},wxSecurityType={}",corpid3th,corpidDk,wxType);
return wxType ;
}
public int getType (boolean mix3th , boolean mixdk) {
if(!mix3th && !mixdk) {
return 1 ;
}
if(mix3th && mixdk) {
return 2 ;
}
if(!mix3th && mixdk) {
return 3 ;
}
if(mix3th && !mixdk) {
return 4 ;
}
return 0 ;
}
private void alert(String title, Map<String, Object> map) {
String msg = title + JSON.toJSONString(map);
String dingUrl = "https://oapi.dingtalk.com/robot/send?access_token=c38fdc53d26e9a019640755bdada1ce07ebd44a2555d1c8acc299de7a7b5b857";
......
......@@ -484,6 +484,11 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
}
@Override
public int calcSecretType(String wxEnterpriseId) {
return this.wxEnterpriseService.calcSecretType(wxEnterpriseId) ;
}
@Override
public SecretSettingDTO getSecretSettingById(String secretId) {
return secretSettingService.getSecretSettingById(secretId);
}
......
......@@ -445,10 +445,6 @@ public class TestController extends WebBaseController {
map.put("当前企业加密方式", getCorpid(qwDTO)) ;
map.put("企微信息", qwDTO) ;
return map ;
}
......
......@@ -208,8 +208,10 @@ public class WxEnterpriseController extends WebBaseController {
private String getCorpid(WxEnterpriseDTO wxEnterpriseDTO) {
Integer wxType = wxEnterpriseDTO.getWxSecurityType() ;
String wxEnterpriseId = wxEnterpriseDTO.getWxEnterpriseId() ;
if(null == wxType || 0==wxType) {
this.wxEnterpriseApiService.updateWxSecurityType(wxEnterpriseDTO.getWxEnterpriseId());
this.wxEnterpriseApiService.updateWxSecurityType(wxEnterpriseId);
wxType = this.wxEnterpriseApiService.calcSecretType(wxEnterpriseId) ;
}
String desc = " (企微加密方式待确认,请联系运营人员) " ;
if(wxType==1) {
......@@ -224,7 +226,12 @@ public class WxEnterpriseController extends WebBaseController {
if(wxType==4) {
desc = "(第三方明文,代开密文)" ;
}
return Arrays.asList(wxEnterpriseDTO.getWxCorpid(),wxEnterpriseDTO.getOpenCorpid()).stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc;
int newType = this.wxEnterpriseApiService.calcSecretType(wxEnterpriseId) ;
String diff = "";
if(null != wxType && wxType.intValue() != newType) {
diff = "*";
}
return Arrays.asList(wxEnterpriseDTO.getWxCorpid(),wxEnterpriseDTO.getOpenCorpid()).stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc + diff;
}
//gic企业列表
......
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