fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java
@@ -214,7 +214,8 @@ // 统计商品数量 long totalgoods = 0; // 商品id Long auctionId = null; CommonGoods commonGoods = null; if (StringUtil.isNullOrEmpty(picture)) { try { List<PushGoodsGroup> listGroup = pushGoodsGroupService.getAllInfoByPushId(pushId); @@ -225,10 +226,9 @@ PushGoodsGroup pushGoodsGroup = listGroup.get(0); if (pushGoodsGroup != null) { CommonGoods commonGoods = pushGoodsGroup.getCommonGoods(); commonGoods = pushGoodsGroup.getCommonGoods(); if (commonGoods != null) { picture = commonGoods.getPicture(); auctionId = commonGoods.getGoodsId(); } } } @@ -265,8 +265,8 @@ JumpDetailV2 jumpDetail = null; if (totalgoods == 1) { params = JumpDetailParamsFactory.createGoodsParams(auctionId); params = JumpDetailParamsFactory.createGoodsParams(commonGoods.getGoodsId(), commonGoods.getGoodsType()); // 单个商品跳转商品详情 jumpDetail = jumpDetailV2Service.getByTypeCache("goodsdetail", Constant.getPlatformCode(acceptData.getPlatform()), fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java
@@ -26,6 +26,7 @@ import com.yeshi.fanli.service.inter.brand.TaoBaoShopHistoryService; import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService; import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService; import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService; import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService; import com.yeshi.fanli.util.Constant; @@ -64,6 +65,9 @@ @Resource private DaTaoKeGoodsService daTaoKeGoodsService; @Resource private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService; /** * 店铺列表 * @@ -83,7 +87,8 @@ * 店铺足迹 * * @param acceptData * @param type 精选1, 足迹列表2 * @param type * 精选1, 足迹列表2 * @param out */ @RequestMapping(value = "getHistory", method = RequestMethod.POST) @@ -298,6 +303,8 @@ data.put("count", array.size()); data.put("list", array); out.print(JsonUtil.loadTrueResult(data)); // 添加到更新列表 taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief); } } fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
@@ -141,8 +141,8 @@ List<TaoBaoGoodsBrief> updateGoodsList = new ArrayList<>(); // 精选库数据为空时,网络进行查询 if (listQuery == null || listQuery.size() == 0) { // 精选库数据小于10时,网络进行查询 if (listQuery == null || listQuery.size() < 10) { long count = qualityGoodsService.countQueryClassId(gcid); int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); page = page - totalPage; fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -123,10 +123,7 @@ // 去除前后空格 text = text.trim(); if (text.length() > 256) { out.print(JsonUtil.loadFalseResult("值过长")); return; } TaoBaoGoodsBrief tb = null; String URL_REGEX = "(((http|https)://)|(www\\.))[a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6}(:[0-9]{1,4})?(/[a-zA-Z0-9\\&%_\\./-~-]*)?"; @@ -134,6 +131,10 @@ Pattern p = Pattern.compile(URL_REGEX); Matcher matcher = p.matcher(text); if (!matcher.find()) {// 不包含链接 if (text.length() > 256) { out.print(JsonUtil.loadFalseResult("值过长")); return; } String pattern = "^[A-Za-z0-9-]+$"; if (Pattern.matches(pattern, text.replace(" ", ""))) {//删除空格 out.println(JsonUtil.loadFalseResult("不支持推荐")); fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderCountMapper.xml
@@ -65,7 +65,7 @@ FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= ${uid} AND (v2.`hb_type` = 1 OR v2.`hb_type` = 2) WHERE v2.`hb_uid`= ${uid} and v2.hb_state!=4 AND (v2.`hb_type` = 1 OR v2.`hb_type` = 2) ) hb ON hb.hb_id=ho.`ho_hongbao_id` <!-- 自购订单 --> LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id IS NOT NULL @@ -95,11 +95,11 @@ FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= ${uid} AND v2.`hb_type` = 20 WHERE v2.`hb_uid`= ${uid} AND v2.`hb_type` = 20 and v2.hb_state!=4 ) hb ON hb.hb_id=ho.`ho_hongbao_id` <!-- 分享订单 --> LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id IS NOT NULL WHERE hb.hb_id IS NOT NULL and hb.hb_state!=4 <if test="state != null"> AND co.`co_state` = ${state} </if> @@ -128,10 +128,10 @@ SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= ${uid} AND (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR v2.`hb_type` = 21 OR v2.`hb_type` = 22 ) OR v2.`hb_type` = 21 OR v2.`hb_type` = 22 ) and v2.hb_state!=4 ) hbp ON hbp.hb_pid=ho.`ho_hongbao_id` LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL WHERE hbp.hb_id IS NOT NULL and hbp.hb_state!=4 <if test="state != null"> AND co.`co_state` = ${state} </if> fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -484,7 +484,7 @@ hb.hb_id=ho.`ho_hongbao_id` <!-- 自购订单 --> LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id IS NOT NULL WHERE hb.hb_id IS NOT NULL and hb.hb_state!=4 <if test="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) @@ -517,7 +517,7 @@ = 20 ) hb ON hb.hb_id=ho.`ho_hongbao_id` <!-- 分享订单 --> LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id IS NOT NULL WHERE hb.hb_id IS NOT NULL and hb.hb_state!=4 <if test="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) @@ -550,7 +550,7 @@ (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR v2.`hb_type` = 21 OR v2.`hb_type` = 22 ) ) hbp ON hbp.hb_pid=ho.`ho_hongbao_id` LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL and hbp.hb_state!=4 <if test="day != null and day == 1"> <!-- 今天 --> AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java
@@ -29,6 +29,7 @@ import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService; import com.yeshi.fanli.service.inter.lable.QualityGoodsService; import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService; import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; @@ -63,6 +64,9 @@ @Resource private TaoBaoGoodsBriefService taoBaoGoodsBriefService; @Resource private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService; @Override public List<BrandClassShop> getExistByShopIds(List<Long> list) { @@ -128,8 +132,8 @@ @Override @Transactional public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top,String key) throws BrandClassShopException { public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top, String key) throws BrandClassShopException { if (id == null) { throw new BrandClassShopException(1, "数据为空:请选择店铺"); @@ -150,7 +154,7 @@ } // 自定义图片 taoBaoShopService.changeInfo(file, shop.getId(), shopName,key); taoBaoShopService.changeInfo(file, shop.getId(), shopName, key); BrandClassShop updateshop = new BrandClassShop(); updateshop.setState(state); @@ -170,7 +174,8 @@ for (BrandClassShop brandClassShop : listQuery) { TaoBaoShop shop = brandClassShop.getShop(); if (shop != null) { long couponNum = commonGoodsService.countBySellerIdAndHasCoupon(shop.getId(), Constant.SOURCE_TYPE_TAOBAO); long couponNum = commonGoodsService.countBySellerIdAndHasCoupon(shop.getId(), Constant.SOURCE_TYPE_TAOBAO); brandClassShop.setCouponNum(couponNum); String shopLink = shop.getShopLink(); @@ -337,8 +342,6 @@ return data; } @Override @Cacheable(value = "brandCache", key = "'listEffectiveCacheV2-'+#page+'-'+#cid") public JSONObject listEffectiveCacheV2(int page, Long cid) { @@ -361,14 +364,14 @@ for (BrandClassShop brandClassShop : list) { TaoBaoShop shop = brandClassShop.getShop(); if (shop != null) { Integer userType = shop.getUserType(); if (userType == null || userType == 0) { shop.setUserType(10); } else { shop.setUserType(11); } String shopLink = shop.getShopLink(); if (StringUtil.isNullOrEmpty(shopLink)) { shop.setShopLink(TaoBaoUtil.getShopLink(shop.getId())); @@ -412,7 +415,7 @@ } else { taoBaoShopVO.setUserType(11); } String shopLink = taoBaoShopVO.getShopLink(); if (StringUtil.isNullOrEmpty(shopLink)) { taoBaoShopVO.setShopLink(TaoBaoUtil.getShopLink(taoBaoShopVO.getId())); @@ -430,8 +433,11 @@ List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>(); List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief(); // 商品添加到更新队列 taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief); for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate); GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate); listGoods.add(goodsDetailVO); } taoBaoShopVO.setListGoodsVO(listGoods); @@ -441,9 +447,7 @@ return data; } @Override public void addClick(Long shopId) { BrandClassShop brandClassShop = brandClassShopMapper.getByShopId(shopId); fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java
@@ -479,23 +479,23 @@ } catch (Exception e) { } TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe); BigDecimal proportion = hongBaoManageService.getFanLiRate(); TaoBaoGoodsBriefExtra goodsExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null); TaoBaoGoodsBriefExtra goodsExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null); if (!goodsExtra.isCoupon() || (goodsExtra.getState() != null && goodsExtra.getState() == 1)) { return addSuccess; // 已下架 、无券 不加入 return addSuccess; // 已下架 、无券 不加入 } List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>(); listGoods.add(taoBaoGoodsBrief); goodsExtra.setTkRate(taoBaoGoodsBrief.getTkRate()); goodsExtra.setUpdatetime(new Date()); goodsExtra.setCouponInfo(null); GoodsPicture goodsPicture = getGoodsPicture(daTaoKe); goodsPicture.setGoods(goodsExtra); // 商品列表 @@ -527,7 +527,7 @@ } } goodsExtra.setImgList(imgList); // 分享奖金 BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief); ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO(); @@ -556,7 +556,7 @@ // 保存信息 dynamicInfoDao.insert(dynamicInfo); addSuccess = true; return addSuccess; } @@ -915,17 +915,18 @@ return list; } @Override @Cacheable(value = "dynamicCache", key = "'queryV2-'+#platform+'-'+#version+'-'+#start+'-'+#count+'-'+#cid+'-'+#subId") public List<DynamicInfo> queryV2(int platform, int version, int start, int count, Long cid, Long subId) { List<DynamicInfo> listNew = new ArrayList<DynamicInfo>(); List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId); // 需要更新的商品 List<TaoBaoGoodsBrief> taoBaoGoodsUpdateList = new ArrayList<>(); if (list != null && list.size() > 0) { BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); BigDecimal shareRate = hongBaoManageService.getShareRate(); for (DynamicInfo dynamicInfo: list) { for (DynamicInfo dynamicInfo : list) { DynamicInfo dynamicNew = new DynamicInfo(); try { PropertyUtils.copyProperties(dynamicNew, dynamicInfo); @@ -933,7 +934,7 @@ e.printStackTrace(); continue; } // 店铺信息 TaoBaoShop shop = dynamicNew.getShop(); if (shop != null) { @@ -952,17 +953,19 @@ } dynamicNew.setShop(shopNew); } List<GoodsPicture> imgsNew = new ArrayList<GoodsPicture>(); List<GoodsPicture> imgs = dynamicNew.getImgs(); if (imgs != null && imgs.size() > 0) { for (GoodsPicture goodsPicture: imgs) { for (GoodsPicture goodsPicture : imgs) { TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods(); if (goods == null) { imgsNew.add(goodsPicture); continue; } taoBaoGoodsUpdateList.add(goods); GoodsPicture goodsNew = new GoodsPicture(); try { PropertyUtils.copyProperties(goodsNew, goodsPicture); @@ -970,19 +973,21 @@ e.printStackTrace(); continue; } GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate, shareRate); GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate, shareRate); goodsNew.setGoodsVO(detailVO); goodsNew.setGoods(null); JumpDetailV2 jumpDetail = goodsNew.getJumpDetail(); if (jumpDetail != null) { JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache(jumpDetail.getType(), platform, version); JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache(jumpDetail.getType(), platform, version); if (jumpDetailV2 != null) { goodsNew.setJumpDetail(jumpDetailV2); } } imgsNew.add(goodsNew); } dynamicNew.setImgs(imgsNew); @@ -990,7 +995,7 @@ listNew.add(dynamicNew); } } // 更新商品信息 executor.execute(new Runnable() { @Override @@ -998,9 +1003,10 @@ updateGoodInfo(list); } }); taoBaoGoodsUpdateService.addUpdateQueueAsync(taoBaoGoodsUpdateList); return listNew; } /** * 更新商品信息 @@ -1013,7 +1019,7 @@ if (list == null || list.size() == 0) { return; } try { BigDecimal proportion = hongBaoManageService.getFanLiRate(); for (DynamicInfo dynamicInfo : list) { @@ -1110,16 +1116,16 @@ dynamicInfo.setDesc(shareMoneyDesc); } } // 需要更新信息; needUpdate = true; } // 无效更新信息 if (!needUpdate) { continue; } // 更新商品信息 dynamicInfo.setImgs(listPicture); fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java
@@ -60,13 +60,12 @@ @Resource private AccountMessageMapper accountMessageMapper; @Resource private AppVersionService appVersionService; @Override public void pushGoods(Long uid, String title, String content, String url, List<String> listIOS, public void pushGoods(Long uid, String title, String content, String url, List<String> listIOS, List<String> listAndroid) throws PushException { String gids = url.split("id=")[1]; String gid = gids.split("&")[0]; @@ -75,28 +74,33 @@ if (StringUtil.isNullOrEmpty(title)) throw new PushException(1, "请填写推送标题"); if (StringUtil.isNullOrEmpty(content)) throw new PushException(1, "请填写推送内容"); /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ throw new PushException(1, "请填写推送内容"); /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listIOS == null || listIOS.size() > 0) { // 限制推送版本号:0 String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if(listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes); } } /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listAndroid == null || listAndroid.size() > 0) { // 限制推送版本号:0 String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if(listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions); } // 华为推送 if (listAndroid == null || listAndroid.size() > 0) { List<Integer> versionCodeList = null; if (listAndroid != null) versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid); hwPushService.pushGoods(uid, Long.parseLong(gid), title, content, versionCodeList); } } PushRecord pushRecord = new PushRecord(); pushRecord.setUid(uid); pushRecord.setState(1); @@ -109,7 +113,6 @@ pushRecordMapper.insertSelective(pushRecord); } @Override public void pushUrl(Long uid, String title, String content, String url, List<String> listIOS, List<String> listAndroid) throws PushException { @@ -120,27 +123,33 @@ throw new PushException(1, "无推送标题"); if (StringUtil.isNullOrEmpty(content)) throw new PushException(1, "无推送内容"); /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listIOS == null || listIOS.size() > 0) { // 限制推送版本号:0 String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if(listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { iosPushService.pushUrl(uid, url, title, content, codes); } } /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listAndroid == null || listAndroid.size() > 0) { // 限制推送版本号:0 String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if(listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { xmPushService.pushUrl(uid, url, title, content, versions); } // 华为推送 if (listAndroid == null || listAndroid.size() > 0) { List<Integer> versionCodeList = null; if (listAndroid != null) versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid); hwPushService.pushUrl(uid, url, title, content, versionCodeList); } } PushRecord pushRecord = new PushRecord(); pushRecord.setUid(uid); pushRecord.setState(1); @@ -152,10 +161,9 @@ pushRecordMapper.insertSelective(pushRecord); } @Override public void pushZNX(Long uId, String title, String content, List<String> listIOS, List<String> listAndroid) throws PushException { public void pushZNX(Long uId, String title, String content, List<String> listIOS, List<String> listAndroid) throws PushException { if (StringUtil.isNullOrEmpty(title)) throw new PushException(1, "无推送标题"); if (StringUtil.isNullOrEmpty(content)) @@ -163,7 +171,7 @@ SystemZnx systemZnx = null; AccountMessage accountMessage = null; /* 无uid , 广播 数据插入系统表 */ if (uId == null || uId == 0) { // 插入数据库(系统站内信数据) @@ -181,27 +189,33 @@ accountMessage.setContent(content); accountMessageMapper.insertSelective(accountMessage); } /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listIOS == null || listIOS.size() > 0) { // 限制推送版本号:0 String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if(listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { iosPushService.pushZNX(uId, accountMessage, systemZnx, codes); } } /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listAndroid == null || listAndroid.size() > 0) { // 限制推送版本号:0 String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if(listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { xmPushService.pushZNX(uId, accountMessage, systemZnx, versions); } // 华为推送 if (listAndroid == null || listAndroid.size() > 0) { List<Integer> versionCodeList = null; if (listAndroid != null) versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid); hwPushService.pushZNX(uId, title, content, versionCodeList); } } // 插入推送记录 PushRecord pushRecord = new PushRecord(); pushRecord.setUid(uId); @@ -213,7 +227,6 @@ pushRecordMapper.insertSelective(pushRecord); } @Override public void pushWEEX(Long uid, String title, String content, String weexUrl, List<String> listIOS, List<String> listAndroid) throws PushException { @@ -221,28 +234,35 @@ throw new PushException(1, "无推送标题"); if (StringUtil.isNullOrEmpty(content)) throw new PushException(1, "无推送内容"); // 适用版本 1.4.8及以后 推送weex页面 /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listIOS == null || listIOS.size() > 0) { // 限制推送版本号:0 String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if(listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { iosPushService.pushWEEX(uid, title, content, weexUrl, codes); } } /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listAndroid == null || listAndroid.size() > 0) { // 限制推送版本号:31 String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if(listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { xmPushService.pushWEEX(uid, title, content, weexUrl, versions); } } // 华为推送 if (listAndroid == null || listAndroid.size() > 0) { List<Integer> versionCodeList = null; if (listAndroid != null) versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid); hwPushService.pushWEEX(uid, title, content, weexUrl, versionCodeList); } // 插入推送记录 PushRecord pushRecord = new PushRecord(); pushRecord.setTitle(title); @@ -254,37 +274,43 @@ pushRecordMapper.insertSelective(pushRecord); } @Override public void pushBaiChuanUrl(Long uid, String title, String content, String url, List<String> listIOS, List<String> listAndroid) throws PushException { if (StringUtil.isNullOrEmpty(title)) throw new PushException(1, "无推送标题"); if (StringUtil.isNullOrEmpty(content)) throw new PushException(1, "无推送内容"); // 适用版本 1.4.8及以后 推送百川网页 /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listIOS == null || listIOS.size() > 0) { // 限制推送版本号:0 String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if(listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { iosPushService.pushBaiChuanUrl(uid, title, content, url, codes); } } /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listAndroid == null || listAndroid.size() > 0) { // 限制推送版本号:31 String versions = getEffectiveVersions(31, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if(listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { String versions = getEffectiveVersions(31, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { xmPushService.pushBaiChuanUrl(uid, title, content, url, versions); } } // 华为推送 if (listAndroid == null || listAndroid.size() > 0) { List<Integer> versionCodeList = null; if (listAndroid != null) versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid); hwPushService.pushBaiChuanUrl(uid, title, content, url, versionCodeList); } // 插入推送记录 PushRecord pushRecord = new PushRecord(); pushRecord.setUrl(url); @@ -297,36 +323,41 @@ pushRecordMapper.insertSelective(pushRecord); } @Override public void pushWelfareCenter(Long uid, String title, String content, List<String> listIOS, List<String> listAndroid) throws PushException { if (StringUtil.isNullOrEmpty(title)) throw new PushException(1, "无推送标题"); if (StringUtil.isNullOrEmpty(content)) throw new PushException(1, "无推送内容"); /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* IOS端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listIOS == null || listIOS.size() > 0) { // 限制推送版本号:0 String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if(listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS); if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { iosPushService.pushWelfareCenter(uid, title, content, codes); } } /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ /* Android端推送 (注明:list等于 'null' 时全推, size等于0 不做推送) */ if (listAndroid == null || listAndroid.size() > 0) { // 限制推送版本号:36 String versions = getEffectiveVersions(36, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if(listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { String versions = getEffectiveVersions(36, AppVersionInfo.PLATFORM_ANDROID, listAndroid); if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { xmPushService.pushWelfareCenter(uid, title, content, versions); } } // 华为推送 if (listAndroid == null || listAndroid.size() > 0) { List<Integer> versionCodeList = null; if (listAndroid != null) versionCodeList = appVersionService.listVersionCodeByVersions("android", listAndroid); hwPushService.pushWelfareCenter(uid, title, content, versionCodeList); } // 插入推送记录 PushRecord pushRecord = new PushRecord(); pushRecord.setTitle(title); @@ -338,20 +369,19 @@ pushRecordMapper.insertSelective(pushRecord); } /** * 查询能推送版本号 * * @param versionCode * @param listVersion * @return */ private String getEffectiveVersions(int minCode, String type, List<String> listVersion) throws PushException{ private String getEffectiveVersions(int minCode, String type, List<String> listVersion) throws PushException { if (minCode == 0 && listVersion == null) { return null; } String versions = ""; if (listVersion == null) { List<AppVersionInfo> list = appVersionService.listByPlatformAndMinVersionCode(type, minCode); @@ -364,34 +394,34 @@ List<AppVersionInfo> list = appVersionService.listByVersions(type, listVersion); if (list != null) { for (AppVersionInfo appVersion : list) { Integer code = appVersion.getVersionCode(); Integer code = appVersion.getVersionCode(); if (code != null && code >= minCode) { versions += appVersion.getVersion() + ","; } } } } } if (versions.endsWith(",")) { versions = versions.substring(0, versions.length() - 1); } return versions; } /** * 查询能推送版本号code * * @param versionCode * @param listVersion * @return */ private String getEffectiveVersionCodes(int minCode, String type, List<String> listVersion) throws PushException{ private String getEffectiveVersionCodes(int minCode, String type, List<String> listVersion) throws PushException { if (minCode == 0 && listVersion == null) { return null; } String versionCodes = ""; if (listVersion == null) { List<AppVersionInfo> list = appVersionService.listByPlatformAndMinVersionCode(type, minCode); @@ -404,19 +434,19 @@ List<AppVersionInfo> list = appVersionService.listByVersions(type, listVersion); if (list != null) { for (AppVersionInfo appVersion : list) { Integer code = appVersion.getVersionCode(); Integer code = appVersion.getVersionCode(); if (code != null && code >= minCode) { versionCodes += appVersion.getVersionCode() + ","; } } } } } if (versionCodes.endsWith(",")) { versionCodes = versionCodes.substring(0, versionCodes.length() - 1); } return versionCodes; } } fanli/src/main/java/com/yeshi/fanli/util/factory/JumpDetailParamsFactory.java
@@ -70,9 +70,11 @@ * @param auctionId * @return */ public static String createGoodsParams(Long auctionId) { public static String createGoodsParams(Long auctionId, Integer goodsType) { JSONObject data = new JSONObject(); data.put("id", auctionId); if (goodsType != null) data.put("goodsType", goodsType); return data.toString(); } fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -77,7 +77,7 @@ ca.setTime(time); ca.add(Calendar.MONTH, -1); String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年MM月"); String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M"); UserMoneyDetail detail = new UserMoneyDetail(); detail.setCreateTime(new Date()); @@ -119,7 +119,7 @@ ca.setTime(time); ca.add(Calendar.MONTH, -1); String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年MM月"); String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M"); UserMoneyDetail detail = new UserMoneyDetail(); detail.setCreateTime(new Date()); fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java
@@ -544,14 +544,20 @@ } static String jdGoodsJs = null; public static String getJDGoodsId(String url) { static ScriptEngine engine = null; static { if (jdGoodsJs == null) jdGoodsJs = getJDGoodsJS(); ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("javascript"); engine = manager.getEngineByName("javascript"); try { engine.eval(jdGoodsJs); } catch (Exception e) { } } public static String getJDGoodsId(String url) { try { if (engine instanceof Invocable) { Invocable in = (Invocable) engine; String goodsId = in.invokeFunction("getGoodsId", url).toString(); fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoUtil.java
@@ -13,6 +13,7 @@ import javax.script.Invocable; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.PostMethod; @@ -496,14 +497,23 @@ } static String jdGoodsJs = null; public static String getPDDGoodsId(String url) { static ScriptEngine engine = null; static { if (jdGoodsJs == null) jdGoodsJs = getJDGoodsJS(); ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("javascript"); engine = manager.getEngineByName("javascript"); try { engine.eval(jdGoodsJs); } catch (ScriptException e) { e.printStackTrace(); } } public static String getPDDGoodsId(String url) { try { if (engine instanceof Invocable) { Invocable in = (Invocable) engine; String goodsId = in.invokeFunction("getGoodsId", url).toString();