Commit 5a12df6e by 徐高华

Merge branch 'feature/xgh/202506迭代' into 'developer'

Feature/xgh/202506迭代

See merge request !3068
parents d0d7ad39 f4d76520
......@@ -22,6 +22,8 @@ public interface WxEnterpriseService {
* @throws
*/
WxEnterpriseQwDTO getQwInfo(String wxEnterpriseId);
void deleteQwInfoCache(String wxEnterpriseId) ;
/**
......
......@@ -39,6 +39,7 @@ public class SecretSettingServiceImpl implements SecretSettingService {
if (secretSetting.getSecretId() != null) {
secretSetting.setUpdateTime(new Date());
secretSettingMapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabSecretSetting.class, secretSetting));
this.wxEnterpriseService.deleteQwInfoCache(secretSetting.getWxEnterpriseId());
return true;
} else {
secretSetting.setSecretId(ToolUtil.randomUUID());
......@@ -46,6 +47,7 @@ public class SecretSettingServiceImpl implements SecretSettingService {
secretSetting.setUpdateTime(new Date());
secretSetting.setStatusFlag(1);
secretSettingMapper.insert(EntityUtil.changeEntityByJSON(TabSecretSetting.class, secretSetting));
this.wxEnterpriseService.deleteQwInfoCache(secretSetting.getWxEnterpriseId());
return true;
}
}
......@@ -57,6 +59,11 @@ public class SecretSettingServiceImpl implements SecretSettingService {
tabSecretSetting.setStatusFlag(0);
tabSecretSetting.setUpdateTime(new Date());
int i = secretSettingMapper.updateByPrimaryKeySelective(tabSecretSetting);
TabSecretSetting s = this.secretSettingMapper.selectByPrimaryKey(secretId) ;
if(null != s && null !=s.getWxEnterpriseId()) {
this.wxEnterpriseService.deleteQwInfoCache(s.getWxEnterpriseId());
}
return i > 0;
}
......
......@@ -2,8 +2,11 @@ package com.gic.haoban.manage.service.service.impl;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.service.dao.mapper.WxApplicationMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.WxApplicationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -14,6 +17,10 @@ public class WxApplicationServiceImpl implements WxApplicationService {
@Autowired
private WxApplicationMapper mapper;
@Autowired
private WxEnterpriseService wxEnterpriseService ;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper;
@Override
public TabHaobanWxApplication selectBySiteIdAndWxEnterpriseId(String siteId, String wxEnterpriseId) {
......@@ -29,14 +36,14 @@ public class WxApplicationServiceImpl implements WxApplicationService {
tab.setStatusFlag(1);
tab.setWxApplicationId(StringUtil.randomUUID());
mapper.insertSelective(tab);
this.wxEnterpriseService.deleteQwInfoCache(tab.getWxEnterpriseId());
}
@Override
public void update(TabHaobanWxApplication tab) {
tab.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(tab);
this.wxEnterpriseService.deleteQwInfoCache(tab.getWxEnterpriseId());
}
@Override
......@@ -46,7 +53,12 @@ public class WxApplicationServiceImpl implements WxApplicationService {
@Override
public int cancalWxApplication(String corpId, String suiteId) {
return this.mapper.cancelWxApplication(corpId, suiteId);
int i= this.mapper.cancelWxApplication(corpId, suiteId);
TabHaobanWxEnterprise tab = this.wxEnterpriseMapper.getEnterpriseBycorpId(corpId,1) ;
if(null != tab) {
this.wxEnterpriseService.deleteQwInfoCache(tab.getWxEnterpriseId());
}
return i;
}
@Override
......
......@@ -6,6 +6,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import cn.hutool.core.collection.CollUtil;
import com.gic.redis.data.util.RedisUtil;
......@@ -83,9 +84,32 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
return EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, mapper.selectByPrimaryKey(wxEnterpriseId));
}
private String getKey(String wxEnterpriseId) {
return "getQwInfo"+wxEnterpriseId ;
}
private WxEnterpriseQwDTO getQwInfoCache(String wxEnterpriseId) {
String key = this.getKey(wxEnterpriseId) ;
Object o = RedisUtil.getCache(key) ;
if(null != o) {
return (WxEnterpriseQwDTO) o ;
}
return null ;
}
public void deleteQwInfoCache(String wxEnterpriseId) {
String key = this.getKey(wxEnterpriseId) ;
RedisUtil.delCache(key) ;
}
@Override
public WxEnterpriseQwDTO getQwInfo(String wxEnterpriseId) {
WxEnterpriseQwDTO qwInfoCache = this.getQwInfoCache(wxEnterpriseId) ;
if(null != qwInfoCache) {
return qwInfoCache ;
}
TabHaobanWxEnterprise wxEnterprise = this.mapper.selectByPrimaryKey(wxEnterpriseId) ;
if(null == wxEnterprise) {
return null ;
......@@ -149,10 +173,10 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
qw.setAgentId(app.getAgentId());
qw.setAgentName(app.getAgentName());
}
}
qw.setHbWxaAppid(this.getHbAppid(qw, config.getAppid()));
logger.info("企微所有corpid信息={}",JSON.toJSON(qw));
RedisUtil.setCache(getKey(wxEnterpriseId),qw,2L, TimeUnit.MINUTES) ;
return qw;
}
......
......@@ -979,7 +979,9 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
if(CollectionUtils.isNotEmpty(hmBOList)) {
int sort = new Random().nextInt(hmBOList.size()) ;
GroupChatHmBO bo = hmBOList.get(sort) ;
return ServiceResponse.success(EntityUtil.changeEntityByJSON(StoreGroupChatHmDTO.class,bo)) ;
StoreGroupChatHmDTO dto = EntityUtil.changeEntityByJSON(StoreGroupChatHmDTO.class,bo);
dto.setChatHmCode(bo.getWxQrCode());
return ServiceResponse.success(dto) ;
}
return ServiceResponse.failure("-1","无群活码");
}
......
package com.gic.haoban.manage.service.service.out.impl.role;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.service.RightService;
import com.gic.commons.util.EntityUtil;
......@@ -143,6 +144,7 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
@Override
@Transactional(rollbackFor = Exception.class)
public ServiceResponse edit(HaobanRoleQDTO haobanRoleQDTO, WebLoginDTO login) {
logger.info("编辑权限={},{}",login.getWxEnterpriseId(), JSONObject.toJSONString(haobanRoleQDTO));
HaobanRoleMenuQDTO clerkMenus = haobanRoleQDTO.getClerkMenus();
HaobanRoleMenuQDTO manegeClerkMenus = haobanRoleQDTO.getManegeClerkMenus();
HaobanRoleMenuQDTO managerMenus = haobanRoleQDTO.getManagerMenus();
......
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