wuxw
2024-01-22 afe3952e5fbf565cba6a2e4da82eec89f383fd4c
service-job/src/main/java/com/java110/job/msgNotify/WechatTemplateImpl.java
@@ -84,9 +84,10 @@
        JSONObject paramOut = JSONObject.parseObject(responseEntity.getBody());
        String industryName = paramOut.getJSONObject("primary_industry").getString("second_class");
       // String industryName = paramOut.getJSONObject("primary_industry").getString("second_class");
        if ("物业".equals(industryName)) { //如果是物业 直接 返回 无需设置
        JSONObject primaryIndustry = paramOut.getJSONObject("primary_industry");
        if (primaryIndustry != null && "物业".equals(primaryIndustry.getString("second_class"))) { //如果是物业 直接 返回 无需设置
            return;
        }
@@ -267,4 +268,28 @@
        return accessToken;
    }
    @Override
    public String getAppId(String communityId) {
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setWeChatType(SmallWeChatDto.WECHAT_TYPE_PUBLIC);
        smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY);
        smallWeChatDto.setObjId(communityId);
        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
        if (smallWeChatDtos == null || smallWeChatDtos.size() < 1) {
            String appIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appId");
            String appSecretCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appSecret");
            String mchIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "mchId");
            String keyCache = MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "key");
            smallWeChatDto = new SmallWeChatDto();
            smallWeChatDto.setAppId(appIdCache);
            smallWeChatDto.setAppSecret(appSecretCache);
            smallWeChatDto.setMchId(mchIdCache);
            smallWeChatDto.setPayPassword(keyCache);
        } else {
            smallWeChatDto = smallWeChatDtos.get(0);
        }
        return smallWeChatDto.getAppId();
    }
}