| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.java110.core.factory.WechatFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.fee.BillOweFeeDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | |
| | | import com.java110.intf.user.IOwnerAppUserInnerServiceSMO; |
| | | import com.java110.job.quartz.TaskSystemQuartz; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.cache.UrlCache; |
| | | import com.java110.utils.constant.WechatConstant; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto); |
| | | |
| | | if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) { |
| | | logger.info("未配置微信公众号信息,定时任务执行结束"); |
| | | logger.error("未配置微信公众号信息,定时任务执行结束"); |
| | | return; |
| | | } |
| | | SmallWeChatDto weChatDto = smallWeChatDtos.get(0); |
| | |
| | | List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto); |
| | | |
| | | if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) { |
| | | logger.info("未配置微信公众号消息模板"); |
| | | logger.error("未配置微信公众号消息模板"); |
| | | return; |
| | | } |
| | | |
| | |
| | | String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret()); |
| | | |
| | | if (StringUtil.isEmpty(accessToken)) { |
| | | logger.info("推送微信模板,获取accessToken失败:{}", accessToken); |
| | | logger.error("推送微信模板,获取accessToken失败:{}", accessToken); |
| | | return; |
| | | } |
| | | |
| | |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto); |
| | | |
| | | if (ownerAppUserDtos.size() <= 0 || ownerAppUserDtos == null) { |
| | | logger.info("未查询到业主与微信公众号绑定关系"); |
| | | logger.error("未查询到业主与微信公众号绑定关系"); |
| | | return; |
| | | } |
| | | |
| | | List<String> memberIdList = new ArrayList<>(ownerAppUserDtos.size()); |
| | | for (OwnerAppUserDto appUserDto : ownerAppUserDtos) { |
| | | if (StringUtil.isEmpty(appUserDto.getMemberId()) || "-1".equals(appUserDto.getMemberId())) { |
| | | continue; |
| | | } |
| | | memberIdList.add(appUserDto.getMemberId()); |
| | | } |
| | | |
| | |
| | | } |
| | | String url = sendTemplate + accessToken; |
| | | |
| | | String oweRoomUrl = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.OWE_FEE_PAGE); |
| | | String oweCarUrl = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.OWE_CAR_FEE_PAGE); |
| | | String oweRoomUrl = UrlCache.getOwnerUrl()+MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.OWE_FEE_PAGE); |
| | | String oweCarUrl = UrlCache.getOwnerUrl()+MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.OWE_CAR_FEE_PAGE); |
| | | Miniprogram miniprogram = null; |
| | | if (oweRoomUrl.contains("@@")) { |
| | | miniprogram = new Miniprogram(); |