Commit 132525f8 by 徐高华

删除无效接口

parent 18991f5f
......@@ -253,26 +253,5 @@ public interface MemberUnionidRelatedApiService {
*/
void updateSelfExternalUseridById(String selfExternalUserid, String memberUnionidRelatedId);
/**
* 更新新userid corpid
*
* @param wxEnterpriseId wx企业标识
* @return {@link ServiceResponse }
* @author mozhu
* @date 2022-06-30 13:54:12
*/
ServiceResponse updateNewUseridCorpid(String wxEnterpriseId);
/**
* 更新新userid corpid mq
* "routerName": "updateNewUseridCorpidMq"
*
* @param params 参数个数
* @author mozhu
* @date 2022-06-30 13:56:27
*/
void updateNewUseridCorpidMq(String params);
}
......@@ -95,8 +95,6 @@ public class EnterpriseController extends WebBaseController {
private QywxUserApiService qywxUserApiService;
@Autowired
private StoreGroupService storeGroupService ;
@Autowired
private MemberUnionidRelatedApiService memberUnionidRelatedApiService;
private static final String QYWX_TAG_OPRN_KEY = "qywx-tag-open";
private static final String QYWX_TAG_OPRN_KEY_LOCK = "qywx-tag-open-lock";
......@@ -628,22 +626,4 @@ public class EnterpriseController extends WebBaseController {
WxEnterpriseRelationDetailDTO bindInfo = wxEnterpriseRelatedApiService.getEnterpriseBindInfo(wxEnterpriseId, enterpriseId);
return resultResponse(HaoBanErrCode.ERR_1, bindInfo);
}
/**
* 转换corpid、userid、external_userid
* @param wxEnterpriseId
* @return
*/
@RequestMapping("/updateNewUseridCorpid")
public HaobanResponse updateNewUseridCorpid(String wxEnterpriseId) {
ServiceResponse serviceResponse = memberUnionidRelatedApiService.updateNewUseridCorpid(wxEnterpriseId);
int code = serviceResponse.getCode();
if (HaoBanErrCode.ERR_1.getCode() == code) {
return resultResponse(HaoBanErrCode.ERR_1);
} else {
String message = serviceResponse.getMessage();
return resultResponse(HaoBanErrCode.ERR_0, message);
}
}
}
......@@ -14,7 +14,6 @@ public interface MemberUnionidRelatedMapper {
int updateByPrimaryKeySelective(MemberUnionidRelated record);
int cleanByCid(@Param("cid") String cid);
MemberUnionidRelated getByUnionId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId, @Param("unionid") String unionid);
......@@ -63,13 +62,4 @@ public interface MemberUnionidRelatedMapper {
*/
List<MemberUnionidRelated> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 更新外部userid wx企业id
*
* @param wxEnterpriseId wx企业标识
* @return int
* @author mozhu
* @date 2022-06-30 19:36:00
*/
int updateExternalUseridByWxEnterpriseId(String wxEnterpriseId);
}
\ No newline at end of file
......@@ -64,16 +64,6 @@ public interface MemberUnionRelatedService {
*/
List<MemberUnionidRelatedDTO> listBySelfExternalUserId(String staffId, String wxEnterpriseId, String selfExternalUserId);
/**
* 更新外部userid wx企业id
*
* @param wxEnterpriseId wx企业标识
* @return int
* @author mozhu
* @date 2022-06-30 19:34:27
*/
int updateExternalUseridByWxEnterpriseId(String wxEnterpriseId);
/**
* 分页查询外部联系人id
......
......@@ -85,11 +85,6 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
}
@Override
public int updateExternalUseridByWxEnterpriseId(String wxEnterpriseId) {
return mapper.updateExternalUseridByWxEnterpriseId(wxEnterpriseId);
}
@Override
public PageInfo<MemberUnionidRelated> listByWxEnterpriseId(String wxEnterpriseId, BasePageInfo basePageInfo) {
PageHelper.startPage(basePageInfo);
List<MemberUnionidRelated> memberUnionidRelateds = mapper.listByWxEnterpriseId(wxEnterpriseId);
......
......@@ -26,7 +26,6 @@ import com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum;
import com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum;
import com.gic.haoban.app.customer.service.api.service.CustomerApiService;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon;
import com.gic.haoban.manage.api.constants.Manage3Constants;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO;
......@@ -1877,106 +1876,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return EntityUtil.changeEntityNew(MemberUnionidRelatedDTO.class, memberUnionidRelated);
}
@Override
public ServiceResponse updateNewUseridCorpid(String wxEnterpriseId) {
String lockKey = "updateNewUseridCorpid_" + wxEnterpriseId;
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
ServiceResponse serviceResponse = new ServiceResponse();
if (wxEnterpriseDTO == null) {
serviceResponse.setCode(HaoBanErrCodeCommon.ERR_0.getCode());
serviceResponse.setMessage("企微应用不存在");
return serviceResponse;
}
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 3);
if (tabHaobanWxApplication == null) {
serviceResponse.setCode(HaoBanErrCodeCommon.ERR_0.getCode());
serviceResponse.setMessage("企微代开发应用不存在");
return serviceResponse;
}
if (RedisUtil.isLocked(lockKey)) {
log.info("redis锁,lockKey:{}", lockKey);
String corpName = tabHaobanWxApplication.getCorpid();
serviceResponse.setCode(HaoBanErrCodeCommon.ERR_0.getCode());
serviceResponse.setMessage(corpName + "已经在转换中,请勿重复操作!");
return serviceResponse;
}
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.CUSTOMIZED_APP.getVal());
if (secretSetting == null) {
serviceResponse.setCode(HaoBanErrCodeCommon.ERR_0.getCode());
serviceResponse.setMessage("代开发密钥不存在");
return serviceResponse;
}
String corpid = tabHaobanWxApplication.getCorpid();
RedisUtil.lock(lockKey, 2L, TimeUnit.HOURS, 0L);
wxEnterpriseService.updateUseridFlagById(2, null, wxEnterpriseId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("corpid", corpid);
jsonObject.put("wxEnterpriseId", wxEnterpriseId);
jsonObject.put("secret", secretSetting.getSecretVal());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendMessage("updateNewUseridCorpidMq", jsonObject.toJSONString());
} catch (Exception e) {
log.info("企微转换id发送消息队列异常:{}", e.getMessage(), e);
}
serviceResponse.setCode(HaoBanErrCodeCommon.ERR_1.getCode());
return serviceResponse;
}
@Override
public void updateNewUseridCorpidMq(String params) {
if (StringUtils.isBlank(params)) {
log.error("传入为空");
return;
}
log.info("转换corpid、userid start params:{}", params);
JSONObject jsonObject = JSON.parseObject(params);
String wxEnterpriseId = jsonObject.getString("wxEnterpriseId");
String corpid = jsonObject.getString("corpid");
// 每1秒产生5个令牌
//更新自建外部联系人id
memberUnionRelatedService.updateExternalUseridByWxEnterpriseId(wxEnterpriseId);
log.info("转换corpid、userid end params:{}", params);
//迁移完成
updateUseridFlagById(wxEnterpriseId, corpid);
}
/**
* 迁移完成
*
* @param wxEnterpriseId
* @param corpid
*/
private void updateUseridFlagById(String wxEnterpriseId, String corpid) {
String serviceCorpid = config.getCorpid();
String openCorpid = qywxUserApiService.toOpenCorpid(corpid, serviceCorpid);
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 3);
if (tabHaobanWxApplication == null) {
log.info("代开发应用不存在:{}", corpid);
return;
}
String[] openidType = {"1", "3"};
//调用完成接口
boolean flag = qywxUserApiService.finishOpenidMigration(corpid, serviceCorpid, tabHaobanWxApplication.getAgentId(), openidType);
if (flag) {
wxApplicationMapper.updateCorpidById(tabHaobanWxApplication.getWxApplicationId(), openCorpid);
wxEnterpriseService.updateUseridFlagById(1, null, wxEnterpriseId);
} else {
wxEnterpriseService.updateUseridFlagById(3, null, wxEnterpriseId);
}
String lockKey = "updateNewUseridCorpid_" + wxEnterpriseId;
RedisUtil.unlock(lockKey);
}
/**
* 获取客户详情列表
*
......
......@@ -186,11 +186,4 @@
and status_flag = 1
</select>
<update id="updateExternalUseridByWxEnterpriseId">
UPDATE
tab_haoban_member_unionid_related
SET self_external_userid = external_userid,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
</update>
</mapper>
\ No newline at end of file
......@@ -110,7 +110,7 @@ public class ApplicationController extends WebBaseController {
}
// 11123E袋洗 11124佣金结算
if(CollectionUtils.isNotEmpty(tempIdList)) {
if(Arrays.asList("11123","11124").contains(s.getApplicationId())) {
if(Arrays.asList("11124").contains(s.getApplicationId())) {
if(!tempIdList.contains(s.getApplicationId())) {
it.remove();
}
......
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