| | |
| | | import com.java110.dto.task.TaskDto; |
| | | import com.java110.entity.wechat.Content; |
| | | import com.java110.entity.wechat.Data; |
| | | import com.java110.entity.wechat.Miniprogram; |
| | | import com.java110.entity.wechat.PropertyFeeTemplateMessage; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWeChatInnerServiceSMO; |
| | |
| | | import com.java110.job.quartz.TaskSystemQuartz; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.WechatConstant; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | List<BillOweFeeDto> billOweFeeDtos = feeInnerServiceSMOImpl.queryBillOweFees(billOweFeeDto); |
| | | |
| | | String url = sendMsgUrl + accessToken; |
| | | String oweUrl = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN,WechatConstant.OWE_FEE_PAGE); |
| | | String oweUrl = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.OWE_FEE_PAGE); |
| | | Miniprogram miniprogram = null; |
| | | if (oweUrl.contains("@@")) { |
| | | miniprogram = new Miniprogram(); |
| | | miniprogram.setAppid(oweUrl.split("@@")[0]); |
| | | } |
| | | for (BillOweFeeDto fee : billOweFeeDtos) { |
| | | for (OwnerAppUserDto appUserDto : ownerAppUserDtos) { |
| | | if (fee.getOwnerId().equals(appUserDto.getMemberId())) { |
| | |
| | | PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage(); |
| | | templateMessage.setTemplate_id(templateId); |
| | | templateMessage.setTouser(appUserDto.getOpenId()); |
| | | data.setFirst(new Content("物业费缴费提醒")); |
| | | /*data.setFirst(new Content("物业费缴费提醒"));*/ |
| | | data.setFirst(new Content(fee.getFeeTypeName() + "提醒")); |
| | | data.setKeyword1(new Content(fee.getPayerObjName())); |
| | | data.setKeyword2(new Content(year + "年-" + month + "月")); |
| | | data.setKeyword3(new Content(fee.getAmountOwed())); |
| | | data.setKeyword2(new Content(fee.getAmountOwed())); |
| | | data.setKeyword3(new Content(year + "年-" + (month + 1) + "月")); |
| | | data.setRemark(new Content("请您及时缴费,如有疑问请联系相关物业人员")); |
| | | templateMessage.setUrl(oweUrl + fee.getPayObjId()); |
| | | if (!StringUtil.isEmpty(oweUrl)) { |
| | | if (miniprogram == null) { |
| | | templateMessage.setUrl(oweUrl + fee.getPayObjId()); |
| | | } else { |
| | | miniprogram.setPagepath(oweUrl.split("@@")[1] + fee.getPayObjId()); |
| | | templateMessage.setMiniprogram(miniprogram); |
| | | } |
| | | } |
| | | templateMessage.setData(data); |
| | | logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage)); |
| | | ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class); |