| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.push.PushGoods;
|
| | | import com.yeshi.fanli.entity.push.PushGoodsGroup;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.exception.push.PushGoodsException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public PushGoods selectByPrimaryKey(Long id) throws PushGoodsException {
|
| | | public PushGoods selectByPrimaryKey(Long id) {
|
| | | return pushGoodsMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | |
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList();
|
| | | if (imgList != null && imgList.size() > 0) {
|
| | | for (ImgInfo imgInfo: imgList) {
|
| | | if (imgInfo.getType() == ImgEnum.img && !StringUtil.isNullOrEmpty(imgInfo.getUrl())) {
|
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getUrl()) && StringUtil.isNullOrEmpty(picUrl)
|
| | | && (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.activity)) {
|
| | | picUrl = imgInfo.getUrl();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | |
|
| | | // 定时时间
|
| | | if (StringUtil.isNullOrEmpty(record.getControlTime_str())) {
|
| | | if (!StringUtil.isNullOrEmpty(record.getControlTime_str())) {
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
| | | record.setControlTime(format.parse(record.getControlTime_str().replaceAll("T", " ")));
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<PushGoods> listQuery(long start, int count, String key, Integer state) {
|
| | | return pushGoodsMapper.listQuery(start, count, key, state);
|
| | | public List<PushGoods> listQuery(long start, int count, String key, Integer state, SystemEnum system) {
|
| | | return pushGoodsMapper.listQuery(start, count, key, state,system);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer state) {
|
| | | return pushGoodsMapper.countQuery(key, state);
|
| | | public long countQuery(String key, Integer state, SystemEnum system) {
|
| | | return pushGoodsMapper.countQuery(key, state,system);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<PushGoods> listHistoryByPushTime(long start, int count, Long uid, Date pushTime) {
|
| | | return pushGoodsMapper.listHistoryByPushTime(start, count, uid, pushTime);
|
| | | public List<PushGoods> listHistoryByPushTime(long start, int count, Long uid, Date pushTime, SystemEnum system) {
|
| | | return pushGoodsMapper.listHistoryByPushTime(start, count, uid, pushTime,system);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countHistoryByPushTime(Long uid, Date pushTime) {
|
| | | return pushGoodsMapper.countHistoryByPushTime(uid, pushTime);
|
| | | public long countHistoryByPushTime(Long uid, Date pushTime, SystemEnum system) {
|
| | | return pushGoodsMapper.countHistoryByPushTime(uid, pushTime,system);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<PushGoods> listTask() {
|
| | | return pushGoodsMapper.listTask();
|
| | | public List<PushGoods> listTask( SystemEnum system) {
|
| | | return pushGoodsMapper.listTask(system);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | String url = configService.get(ConfigKeyEnum.pushActivityLink.getKey());
|
| | | String url = configService.getValue(ConfigKeyEnum.pushActivityLink.getKey(),pushGoods.getSystem());
|
| | | if (StringUtil.isNullOrEmpty(url)) {
|
| | | throw new PushGoodsException(1, "推送页面链接不存在");
|
| | | }
|
| | | url = url + "?id=" + pushGoods.getId() + "&otherId=" + pushGoods.getOtherId();
|
| | | |
| | | url = url + "?id=" + pushGoods.getId();
|
| | | // h活动全推
|
| | | pushService.pushUrl(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url, listIOS, listAndroid);
|
| | | pushService.pushUrl(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url, listIOS, listAndroid,pushGoods.getSystem());
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | Long goodsId = commonGoods.getGoodsId();
|
| | | String url = "https://item.taobao.com/item.htm?id=" + goodsId;
|
| | | pushService.pushGoods(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url,listIOS, listAndroid);
|
| | | pushService.pushGoods(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url,listIOS, listAndroid,pushGoods.getSystem());
|
| | | } else {
|
| | | /* 多个商品推送 */
|
| | | String url = configService.get(ConfigKeyEnum.pushGoodsDetails.getKey());
|
| | | String url = configService.getValue(ConfigKeyEnum.pushGoodsDetails.getKey(),pushGoods.getSystem());
|
| | | if (StringUtil.isNullOrEmpty(url)) {
|
| | | throw new PushGoodsException(1, "推送页面链接不存在");
|
| | | }
|
| | | // 生成链接
|
| | | url = url + "?id=" + id;
|
| | | pushService.pushUrl(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url, listIOS, listAndroid);
|
| | | pushService.pushUrl(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url, listIOS, listAndroid,pushGoods.getSystem());
|
| | | }
|
| | | }
|
| | |
|