101captain
2022-01-14 6fc1e7f179acaeec4df755f72895b3b4fb50d4bb
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java
@@ -6,6 +6,10 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.vos.user.SysTemplateConfigVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.model.dos.ComActDO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@@ -39,6 +43,10 @@
    private ComActMessageBackDAO comActMessageBackDAO;
    @Resource
    private ComActActSignDAO comActActSignDAO;
    @Resource
    private ComActDAO comActDAO;
    @Resource
    private UserService userService;
    @Override
    public R addMessage(ComActMessageVO comActMessageVO) {
@@ -198,9 +206,11 @@
            if (map != null) {
                String openid = map.get("openid");
                WxXCXTempSend util = new WxXCXTempSend();
                ComActDO comActDO=comActDAO.selectById(comActMessageBackVO.getCommunityId());
                R<SysTemplateConfigVO> r=userService.selectTemplate(comActDO.getAreaCode(),2);
                try {
                    WxUtil.sendSubscribeLYHF(openid, util.getAppAccessToken(), comActMessageBackVO.getUserName(),
                        DateUtils.format(new Date(), DateUtils.ymdhms_format), comActMessageBackVO.getMsgContent());
                        DateUtils.format(new Date(), DateUtils.ymdhms_format), comActMessageBackVO.getMsgContent(),r.getData().getTemplateId());
                } catch (Exception e) {
                    log.error("消息推送失败,失败原因:" + e.getMessage());
                }