| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | private ComActMessageDAO comActMessageDAO; |
| | | @Resource |
| | | private ComActMessageBackDAO comActMessageBackDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | |
| | | @Override |
| | | public R addMessage(ComActMessageVO comActMessageVO) { |
| | |
| | | ComActMessageDO selectById = comActMessageDAO.selectById(comActMessageBackDO.getMsgId()); |
| | | selectById.setStatus(2); |
| | | comActMessageDAO.updateById(selectById); |
| | | |
| | | //回复成功给用户推送订阅消息 |
| | | Map<String,String> map = comActActSignDAO.getUserOpenId(selectById.getUserId()); |
| | | if(map != null){ |
| | | String openid = map.get("openid"); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeLYHF(openid,util.getAppAccessToken(),comActMessageBackVO.getUserName() |
| | | , DateUtils.format(comActMessageBackVO.getCreateAt(),DateUtils.ymdhms_format),comActMessageBackVO.getMsgContent()); |
| | | }catch (Exception e){ |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |