fanli/src/main/java/com/yeshi/fanli/controller/client/v1/LostOrderController.java
@@ -138,14 +138,37 @@ @RequestMapping("findLostOrder") public void findLostOrder(AcceptData acceptData, LostOrder lostOrder, HttpServletRequest request, PrintWriter out) { Integer type = lostOrder.getType(); if (type == null) { type = Constant.SOURCE_TYPE_TAOBAO; } boolean orderNum = true; if (!NumberUtil.isNumeric(lostOrder.getOrderId())) { orderNum = false; } else if (lostOrder.getOrderId().length() < 12 || lostOrder.getOrderId().length() > 20) { orderNum = false; } else orderNum = Utils.isOrderNum(lostOrder.getOrderId()); String orderId = lostOrder.getOrderId(); if (type == Constant.SOURCE_TYPE_TAOBAO) { if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 12 || orderId.length() > 20)) { orderNum = false; } else { orderNum = Utils.isOrderNum(orderId); } } else if (type == Constant.SOURCE_TYPE_JD) { if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 6 || orderId.length() > 20)) { orderNum = false; } } else if (type == Constant.SOURCE_TYPE_PDD) { if (!orderId.contains("-")) { orderNum = false; } else { String[] split = orderId.split("-"); if (split == null || split.length != 2) { orderNum = false; } else { if (!NumberUtil.isNumeric(split[0]) || !NumberUtil.isNumeric(split[1])) { orderNum = false; } } } } if (lostOrder.getUserInfo() == null || lostOrder.getUserInfo().getId() == null || lostOrder.getUserInfo().getId() <= 0) { fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -514,7 +514,7 @@ * @param out */ private void getIndexPDDGoods(AcceptData acceptData, int page, PrintWriter out) { PDDGoodsResult result = pddGoodsService.getIndexPDDGoods(page); PDDGoodsResult result = pddGoodsService.getTopGoodsList(page, 1); int count = 0; JSONArray array = new JSONArray(); if (result != null) { fanli/src/main/java/com/yeshi/fanli/dto/common/PDDCommonContentTypeEnum.java
@@ -2,7 +2,7 @@ public enum PDDCommonContentTypeEnum { _1k9("1.9包邮", "0"), todayTop("今日爆款", "1"), brandClear("品牌清仓", "2"), brandGoods("品牌好货", null); _1k9("1.9包邮", "0"), todayTop("今日爆款", "1"), brandClear("品牌清仓", "2"), hotSaleGoods("热卖爆款", null); private final String desc; private final String content; fanli/src/main/java/com/yeshi/fanli/service/impl/goods/PDDCommonTemplateContentServiceImpl.java
@@ -3,40 +3,33 @@ import java.util.ArrayList; import java.util.List; import javax.annotation.Resource; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import com.yeshi.fanli.dto.common.CommonContentNav; import com.yeshi.fanli.dto.common.PDDCommonContentTypeEnum; import com.yeshi.fanli.dto.pdd.PDDGoodsResult; import com.yeshi.fanli.dto.pdd.PDDSearchFilter; import com.yeshi.fanli.service.inter.goods.PDDCommonTemplateContentService; import com.yeshi.fanli.service.inter.pdd.PDDGoodsService; import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil; @Service public class PDDCommonTemplateContentServiceImpl implements PDDCommonTemplateContentService { @Resource private PDDGoodsService pddGoodsService; @Cacheable(value = "pddCommonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize") @Override public PDDGoodsResult getContentList(PDDCommonContentTypeEnum type, String cid, int page, int pageSize) { if (type == PDDCommonContentTypeEnum._1k9 || type == PDDCommonContentTypeEnum.todayTop || type == PDDCommonContentTypeEnum.brandClear) { return PinDuoDuoApiUtil.searchByChannelType(page - 1, pageSize, type.getContent()); } else if (type == PDDCommonContentTypeEnum.brandGoods) { PDDSearchFilter pddfilter = new PDDSearchFilter(); pddfilter.setPage(page); pddfilter.setPageSize(pageSize); pddfilter.setSortType(22); pddfilter.setHasCoupon(false); if ("-1".equalsIgnoreCase(cid)) { pddfilter.setOptId(-1L); } else { long catId = Long.parseLong(cid); pddfilter.setCatId(catId); pddfilter.setOptId(catId); } return PinDuoDuoUtil.getBrandGoods(pddfilter); } else if (type == PDDCommonContentTypeEnum.hotSaleGoods) { return pddGoodsService.getTopGoodsList(page, 1); } return null; } @@ -45,27 +38,8 @@ @Override public List<CommonContentNav> getNavList(PDDCommonContentTypeEnum type) { List<CommonContentNav> navList = new ArrayList<>(); if (type == PDDCommonContentTypeEnum.brandGoods) { navList.add(new CommonContentNav("-1", "精选")); //navList.add(new CommonContentNav("-11", "清仓")); navList.add(new CommonContentNav("15", "百货 ")); navList.add(new CommonContentNav("4", "母婴")); navList.add(new CommonContentNav("1", "食品")); navList.add(new CommonContentNav("14", "女装")); navList.add(new CommonContentNav("18", "电器")); navList.add(new CommonContentNav("1281", "鞋包")); navList.add(new CommonContentNav("1282", "内衣")); navList.add(new CommonContentNav("16", "美妆")); navList.add(new CommonContentNav("743", "男装")); navList.add(new CommonContentNav("13", "水果")); navList.add(new CommonContentNav("818", "家纺")); navList.add(new CommonContentNav("2478", "文具")); navList.add(new CommonContentNav("1451", "运动")); navList.add(new CommonContentNav("590", "虚拟")); navList.add(new CommonContentNav("2048", "汽车")); navList.add(new CommonContentNav("1917", "家装")); navList.add(new CommonContentNav("2974", "家具")); navList.add(new CommonContentNav("3279", "医药")); if (type == PDDCommonContentTypeEnum.hotSaleGoods) { } return navList; } fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoOrderServiceImpl.java
@@ -9,7 +9,6 @@ import com.yeshi.fanli.dao.mybatis.order.HongBaoOrderMapper; import com.yeshi.fanli.entity.order.HongBaoOrder; import com.yeshi.fanli.service.inter.order.HongBaoOrderService; import com.yeshi.fanli.util.Constant; @Service public class HongBaoOrderServiceImpl implements HongBaoOrderService { @@ -59,8 +58,8 @@ } @Override public long countByOrderNoAndHongBaoType(String orderNo, int type) { return hongBaoOrderMapper.countByOrderNoAndHongBaoType(orderNo, type, Constant.SOURCE_TYPE_TAOBAO); public long countByOrderNoAndHongBaoType(String orderNo, int hongBaotype, int sourceType) { return hongBaoOrderMapper.countByOrderNoAndHongBaoType(orderNo, hongBaotype, sourceType); } @Override fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
@@ -9,7 +9,6 @@ import javax.annotation.Resource; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -22,7 +21,6 @@ import com.yeshi.fanli.service.inter.order.HongBaoOrderService; import com.yeshi.fanli.service.inter.order.LostOrderService; import com.yeshi.fanli.service.inter.order.OrderService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.Utils; @Service @@ -73,7 +71,7 @@ } // 是否为分享赚订单 if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS) > 0) if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS, type) > 0) return -5; // 次数限制 @@ -106,7 +104,7 @@ lostOrderwriteLock.unlock(); } Order or = orderService.getSystemOrderByUid(Constant.TAOBAO, lostOrder.getUserInfo().getId()); Order or = orderService.getSystemOrderByUid(type, lostOrder.getUserInfo().getId()); if (or != null) { boolean b = Utils.isUserOrder(or.getOrderId(), lostOrder.getOrderId()); if (b) { fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderServiceImpl.java
@@ -43,9 +43,12 @@ if (find != null) { return false; } Integer orderType = order.getOrderType(); if (orderType == null) { orderType = Order.ORDER_TYPE_TAOBAO; } // 查找是否存在分享赚订单 if (hongBaoOrderService.countByOrderNoAndHongBaoType(order.getOrderId(), HongBaoV2.TYPE_SHARE_GOODS) > 0) if (hongBaoOrderService.countByOrderNoAndHongBaoType(order.getOrderId(), HongBaoV2.TYPE_SHARE_GOODS, orderType) > 0) return false; orderMapper.insertSelective(order); } finally { fanli/src/main/java/com/yeshi/fanli/service/impl/pdd/PDDGoodsServiceImpl.java
@@ -149,9 +149,9 @@ @Override @Cacheable(value = "pddSpecialCache", key = "'getIndexPDDGoods-'+#page") public PDDGoodsResult getIndexPDDGoods(int page) { return PinDuoDuoApiUtil.getTopList(PinDuoDuoApiUtil.PID_FANLI, page, Constant.PAGE_SIZE, 1); @Cacheable(value = "pddSpecialCache", key = "'getTopGoodsList-' + #page + '-' + #sortType") public PDDGoodsResult getTopGoodsList(int page, Integer sortType) { return PinDuoDuoApiUtil.getTopList(PinDuoDuoApiUtil.PID_FANLI, page, Constant.PAGE_SIZE, sortType); } } fanli/src/main/java/com/yeshi/fanli/service/inter/order/HongBaoOrderService.java
@@ -41,10 +41,11 @@ * 根据订单号和订单来源获取数量 * * @param orderNo * @param type * @param hongBaotype * @param sourceType * @return */ public long countByOrderNoAndHongBaoType(String orderNo, int type); public long countByOrderNoAndHongBaoType(String orderNo, int hongBaotype, int sourceType); /** * 获取详情 fanli/src/main/java/com/yeshi/fanli/service/inter/pdd/PDDGoodsService.java
@@ -39,10 +39,11 @@ public List<PDDGoodsDetail> specialSearch(Integer page, Long cid) throws PDDOrderException; /** * 首页底部商品 * 爆款排行商品接口 * @param page * @param sortType 1-实时热销榜;2-实时收益榜 * @return */ public PDDGoodsResult getIndexPDDGoods(int page); public PDDGoodsResult getTopGoodsList(int page, Integer sortType); }