Commit 5e0382af by 徐高华

更新企微加密类型字段

parent 8a197569
......@@ -219,6 +219,8 @@ public interface WxEnterpriseApiService {
*/
SecretSettingDTO getSecretSettingById(String secretId);
public void updateWxSecurityType(String wxEnterpriseId) ;
/**
*
* @Title: stopHaoban
......
......@@ -84,12 +84,12 @@ public interface WxEnterpriseMapper {
*/
int updateAutoActiveFlagById(@Param("autoActiveFlag") Integer autoActiveFlag, @Param("wxEnterpriseId") String wxEnterpriseId);
void updateWxSecurityType(@Param("wxEnterpriseId") String wxEnterpriseId , @Param("wxSecurityType") Integer wxSecurityType) ;
/**
* 列出所有企业(与gic关联)
*
* @return {@link List }<{@link WxEnterpriseDTO }>
* @author mozhu
* @date 2022-08-08 13:45:30
*/
List<WxEnterpriseDTO> listAllEnterprise();
}
\ No newline at end of file
......@@ -6,6 +6,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface WxEnterpriseService {
String add(WxEnterpriseDTO wxDTO);
......@@ -87,6 +89,8 @@ public interface WxEnterpriseService {
*/
int updateAutoActiveFlagById(Integer autoActiveFlag, String wxEnterpriseId);
void updateWxSecurityType(String wxEnterpriseId) ;
void stopHaoban(String enterpriseId);
}
......@@ -11,9 +11,7 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.service.MemberUnionRelatedService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -23,8 +21,6 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
@Autowired
private MemberUnionidRelatedMapper mapper;
@Autowired
private StaffMapper staffMapper ;
@Override
public MemberUnionidRelatedDTO getByWxUserIdAndUnionId(String wxEnterpriseId, String staffId, String unionid) {
......@@ -68,7 +64,6 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
return;
}
mapper.cleanStaffRelated(wxEnterpriseId,staffIds);
}
@Override
......
......@@ -176,6 +176,57 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
return mapper.updateAutoActiveFlagById(autoActiveFlag,wxEnterpriseId);
}
@Override
public void updateWxSecurityType(String wxEnterpriseId) {
List<TabHaobanWxApplication> applictionList = this.wxApplicationMapper.listApplication(wxEnterpriseId) ;
String corpid3th = null , corpidDk=null;
boolean mix3th = false ;
boolean mixdk = false ;
int len = 20 ;
if(CollectionUtils.isNotEmpty(applictionList)) {
for(TabHaobanWxApplication app : applictionList) {
Integer appType = app.getApplicationType() ;
if(appType==2) {
corpid3th= app.getCorpid() ;
}else if(appType.equals(3)) {
corpidDk = app.getCorpid() ;
}
};
}
if(StringUtils.isBlank(corpid3th) || StringUtils.isBlank(corpidDk)) {
return ;
}
if(corpid3th.length() > len) {
mix3th = true ;
}
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);
}
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";
......
......@@ -181,6 +181,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
secretSettingService.saveSecretSetting(secretSetting);
}
agreeExternalUseridFlag(wxEnterpriseId, 1);
this.wxEnterpriseService.updateWxSecurityType(wxEnterpriseId);
log.info("企业微信授权处理完成");
}
......@@ -478,6 +479,11 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
}
@Override
public void updateWxSecurityType(String wxEnterpriseId) {
this.wxEnterpriseService.updateWxSecurityType(wxEnterpriseId);
}
@Override
public SecretSettingDTO getSecretSettingById(String secretId) {
return secretSettingService.getSecretSettingById(secretId);
}
......
......@@ -504,6 +504,13 @@
where wx_enterprise_id = #{wxEnterpriseId}
</update>
<update id="updateWxSecurityType">
update tab_haoban_wx_enterprise
set wx_security_type = #{wxSecurityType},
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
</update>
<select id="listAllEnterprise" resultType="com.gic.haoban.manage.api.dto.WxEnterpriseDTO" >
select
b.wx_enterprise_id wxEnterpriseId,
......
......@@ -468,7 +468,7 @@ public class TestController extends WebBaseController {
if(wxType==4) {
desc = "(第三方明文,代开密文)" ;
}
return Arrays.asList(wxEnterpriseDTO.getThirdCorpid()+"(第三方)",wxEnterpriseDTO.getDkCorpid()+"()").stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc;
return Arrays.asList(wxEnterpriseDTO.getThirdCorpid()+"(第三方)",wxEnterpriseDTO.getDkCorpid()+"(代开发)").stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc;
}
}
......@@ -208,12 +208,15 @@ public class WxEnterpriseController extends WebBaseController {
private String getCorpid(WxEnterpriseDTO wxEnterpriseDTO) {
Integer wxType = wxEnterpriseDTO.getWxSecurityType() ;
String desc = " -- " ;
if(null == wxType || 0==wxType) {
this.wxEnterpriseApiService.updateWxSecurityType(wxEnterpriseDTO.getWxEnterpriseId());
}
String desc = " (企微加密方式待确认,请联系运营人员) " ;
if(wxType==1) {
desc = "(全明文)" ;
desc = "(全明文)" ;
}
if(wxType==2) {
desc = "(全密文)" ;
desc = "(全密文)" ;
}
if(wxType==3) {
desc = "(第三方密文,代开明文)" ;
......
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