Commit 5e0382af by 徐高华

更新企微加密类型字段

parent 8a197569
...@@ -219,6 +219,8 @@ public interface WxEnterpriseApiService { ...@@ -219,6 +219,8 @@ public interface WxEnterpriseApiService {
*/ */
SecretSettingDTO getSecretSettingById(String secretId); SecretSettingDTO getSecretSettingById(String secretId);
public void updateWxSecurityType(String wxEnterpriseId) ;
/** /**
* *
* @Title: stopHaoban * @Title: stopHaoban
......
...@@ -83,13 +83,13 @@ public interface WxEnterpriseMapper { ...@@ -83,13 +83,13 @@ public interface WxEnterpriseMapper {
* @date 2022-08-03 17:27:13 * @date 2022-08-03 17:27:13
*/ */
int updateAutoActiveFlagById(@Param("autoActiveFlag") Integer autoActiveFlag, @Param("wxEnterpriseId") String wxEnterpriseId); int updateAutoActiveFlagById(@Param("autoActiveFlag") Integer autoActiveFlag, @Param("wxEnterpriseId") String wxEnterpriseId);
void updateWxSecurityType(@Param("wxEnterpriseId") String wxEnterpriseId , @Param("wxSecurityType") Integer wxSecurityType) ;
/** /**
* 列出所有企业(与gic关联) * 列出所有企业(与gic关联)
* *
* @return {@link List }<{@link WxEnterpriseDTO }>
* @author mozhu
* @date 2022-08-08 13:45:30
*/ */
List<WxEnterpriseDTO> listAllEnterprise(); List<WxEnterpriseDTO> listAllEnterprise();
} }
\ No newline at end of file
...@@ -6,6 +6,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; ...@@ -6,6 +6,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface WxEnterpriseService { public interface WxEnterpriseService {
String add(WxEnterpriseDTO wxDTO); String add(WxEnterpriseDTO wxDTO);
...@@ -87,6 +89,8 @@ public interface WxEnterpriseService { ...@@ -87,6 +89,8 @@ public interface WxEnterpriseService {
*/ */
int updateAutoActiveFlagById(Integer autoActiveFlag, String wxEnterpriseId); int updateAutoActiveFlagById(Integer autoActiveFlag, String wxEnterpriseId);
void updateWxSecurityType(String wxEnterpriseId) ;
void stopHaoban(String enterpriseId); void stopHaoban(String enterpriseId);
} }
...@@ -11,9 +11,7 @@ import com.gic.haoban.base.api.common.BasePageInfo; ...@@ -11,9 +11,7 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO; 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.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.MemberUnionidRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.service.MemberUnionRelatedService; import com.gic.haoban.manage.service.service.MemberUnionRelatedService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -23,8 +21,6 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService ...@@ -23,8 +21,6 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
@Autowired @Autowired
private MemberUnionidRelatedMapper mapper; private MemberUnionidRelatedMapper mapper;
@Autowired
private StaffMapper staffMapper ;
@Override @Override
public MemberUnionidRelatedDTO getByWxUserIdAndUnionId(String wxEnterpriseId, String staffId, String unionid) { public MemberUnionidRelatedDTO getByWxUserIdAndUnionId(String wxEnterpriseId, String staffId, String unionid) {
...@@ -68,7 +64,6 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService ...@@ -68,7 +64,6 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
return; return;
} }
mapper.cleanStaffRelated(wxEnterpriseId,staffIds); mapper.cleanStaffRelated(wxEnterpriseId,staffIds);
} }
@Override @Override
......
...@@ -175,6 +175,57 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService { ...@@ -175,6 +175,57 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
public int updateAutoActiveFlagById(Integer autoActiveFlag, String wxEnterpriseId) { public int updateAutoActiveFlagById(Integer autoActiveFlag, String wxEnterpriseId) {
return mapper.updateAutoActiveFlagById(autoActiveFlag,wxEnterpriseId); 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) { private void alert(String title, Map<String, Object> map) {
String msg = title + JSON.toJSONString(map); String msg = title + JSON.toJSONString(map);
......
...@@ -181,6 +181,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -181,6 +181,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
secretSettingService.saveSecretSetting(secretSetting); secretSettingService.saveSecretSetting(secretSetting);
} }
agreeExternalUseridFlag(wxEnterpriseId, 1); agreeExternalUseridFlag(wxEnterpriseId, 1);
this.wxEnterpriseService.updateWxSecurityType(wxEnterpriseId);
log.info("企业微信授权处理完成"); log.info("企业微信授权处理完成");
} }
...@@ -476,7 +477,12 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -476,7 +477,12 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
staffPrivacyUseLogService.insert(staffPrivacyUseLogBO); staffPrivacyUseLogService.insert(staffPrivacyUseLogBO);
} }
} }
@Override
public void updateWxSecurityType(String wxEnterpriseId) {
this.wxEnterpriseService.updateWxSecurityType(wxEnterpriseId);
}
@Override @Override
public SecretSettingDTO getSecretSettingById(String secretId) { public SecretSettingDTO getSecretSettingById(String secretId) {
return secretSettingService.getSecretSettingById(secretId); return secretSettingService.getSecretSettingById(secretId);
......
...@@ -503,6 +503,13 @@ ...@@ -503,6 +503,13 @@
update_time = now() update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
</update> </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 id="listAllEnterprise" resultType="com.gic.haoban.manage.api.dto.WxEnterpriseDTO" >
select select
......
...@@ -468,7 +468,7 @@ public class TestController extends WebBaseController { ...@@ -468,7 +468,7 @@ public class TestController extends WebBaseController {
if(wxType==4) { if(wxType==4) {
desc = "(第三方明文,代开密文)" ; 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 { ...@@ -208,12 +208,15 @@ public class WxEnterpriseController extends WebBaseController {
private String getCorpid(WxEnterpriseDTO wxEnterpriseDTO) { private String getCorpid(WxEnterpriseDTO wxEnterpriseDTO) {
Integer wxType = wxEnterpriseDTO.getWxSecurityType() ; Integer wxType = wxEnterpriseDTO.getWxSecurityType() ;
String desc = " -- " ; if(null == wxType || 0==wxType) {
this.wxEnterpriseApiService.updateWxSecurityType(wxEnterpriseDTO.getWxEnterpriseId());
}
String desc = " (企微加密方式待确认,请联系运营人员) " ;
if(wxType==1) { if(wxType==1) {
desc = "(全明文)" ; desc = "(全明文)" ;
} }
if(wxType==2) { if(wxType==2) {
desc = "(全密文)" ; desc = "(全密文)" ;
} }
if(wxType==3) { if(wxType==3) {
desc = "(第三方密文,代开明文)" ; 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