From 010760fd974453a70948fef465284d8c817314f5 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期三, 25 三月 2020 11:27:28 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div-1 --- fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java | 82 +++++++++++++++++++++++++--------------- 1 files changed, 51 insertions(+), 31 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java index 8520dd0..00ed15f 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java @@ -38,6 +38,7 @@ import com.yeshi.fanli.entity.order.HongBaoOrder; import com.yeshi.fanli.entity.order.InviteOrderSubsidy; import com.yeshi.fanli.entity.pdd.PDDOrder; +import com.yeshi.fanli.entity.system.ConfigKeyEnum; import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.entity.taobao.TaoBaoOrder; @@ -70,9 +71,9 @@ import com.yeshi.fanli.util.jd.JDApiUtil; import com.yeshi.fanli.util.jd.JDUtil; import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; -import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil; import com.yeshi.fanli.util.taobao.TaoBaoUtil; import com.yeshi.fanli.util.taobao.TaoKeApiUtil; +import com.yeshi.fanli.util.user.UserLevelUtil; import com.yeshi.fanli.vo.msg.ClientTextStyleVO; import com.yeshi.fanli.vo.order.CommonOrderGoodsVO; import com.yeshi.fanli.vo.order.CommonOrderVO; @@ -210,7 +211,11 @@ } // 鏁版嵁鍔犲伐閲嶆柊缁勭粐 - orderVOFactory(acceptData, listOrder, listGoods, uid); + if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + orderVOFactoryNew(acceptData, listOrder, listGoods, uid); + } else { + orderVOFactory(acceptData, listOrder, listGoods, uid); + } return listOrder; } @@ -267,6 +272,7 @@ } Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList); + // 璁剧疆鏄惁涓簐ip璁㈠崟 for (CommonOrderVO order : listOrder) { if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI @@ -293,10 +299,10 @@ boolean vip = userVIPInfoService.isVIP(uid); // 鏄惁瀛樺湪濂栧姳鍒� boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid); - for (CommonOrderVO order : listOrder) { String orderNo = order.getOrderNo(); Integer sourceType = order.getSourceType(); + Integer hongBaoType = order.getHongBaoType(); // 鍟嗗搧淇℃伅缁勫悎 for (CommonOrderVO commonOrder : listGoods) { @@ -327,7 +333,7 @@ } commonGoodsVO.setActualPay("浠樻閲戦锛毬�" + totalSettlement); - Integer hongBaoType = order.getHongBaoType(); + // 閭�璇疯鍗曚俊鎭繚鎶� if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType @@ -356,10 +362,8 @@ } Date thirdCreateTime = order.getThirdCreateTime(); - if (thirdCreateTime != null) { - order.setDownTime("涓嬪崟鏃堕棿锛�" + format.format(thirdCreateTime)); - order.setObtainTime(thirdCreateTime.getTime()); - } + order.setDownTime("涓嬪崟鏃堕棿锛�" + format.format(thirdCreateTime)); + order.setObtainTime(thirdCreateTime.getTime()); Date settleTime = order.getSettleTime(); if (settleTime != null) { @@ -446,7 +450,6 @@ // 璁㈠崟鏍囪瘑 List<String> signList = new ArrayList<String>(); /* 璁㈠崟杩斿埄绫诲瀷 杞崲 */ - Integer hongBaoType = order.getHongBaoType(); if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) { // 鑷喘 hongbaoInfo = "杩斿埄"; @@ -902,7 +905,7 @@ wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO; for (TaoBaoOrder taoBaoOrder : taoBaoOrders) { - CommonOrder newCommonOrder = TaoBaoOrderUtil.convert(taoBaoOrder); + CommonOrder newCommonOrder = CommonOrderFactory.create(taoBaoOrder); CommonOrderGoods cog = new CommonOrderGoods(); cog.setGoodsId(taoBaoOrder.getAuctionId() + ""); cog.setGoodsType(Constant.SOURCE_TYPE_TAOBAO); @@ -1240,7 +1243,7 @@ @Override public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state, Integer type, Integer orderState, String startTime, String endTime, Integer source, List<Long> listShopId, - List<Long> listGoodsId, Date minTime, BigDecimal money,BigDecimal payment) throws CommonOrderException { + List<Long> listGoodsId, Date minTime, BigDecimal money, BigDecimal payment) throws CommonOrderException { List<CommonOrderVO> list = null; @@ -1249,7 +1252,7 @@ startTime, endTime, source, payment); } else { list = commonOrderMapper.listQuery(start, count, keyType, key, state, type, orderState, startTime, endTime, - source, listShopId, listGoodsId, minTime, money,payment); + source, listShopId, listGoodsId, minTime, money, payment); } if (list == null) { @@ -1436,7 +1439,7 @@ @Override public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState, String startTime, String endTime, Integer source, List<Long> listShopId, List<Long> listGoodsId, - Date minTime, BigDecimal money,BigDecimal payment) throws CommonOrderException { + Date minTime, BigDecimal money, BigDecimal payment) throws CommonOrderException { if (StringUtil.isNullOrEmpty(key) || keyType == 1) {// 鎼滅储妗嗘棤鍊兼垨鑰呮寜璁㈠崟鍙锋悳绱㈡椂閮藉彧鎼滅储涓昏鍗� return commonOrderMapper.countQueryWithNoChild(keyType, key, state, type, orderState, startTime, endTime, source, payment); @@ -1673,7 +1676,8 @@ } @Override - public List<CommonOrderVO> searchOrderByUid(int page, int size, Long uid, List<ESOrder> list) throws Exception { + public List<CommonOrderVO> searchOrderByUid(AcceptData acceptData, int page, int size, Long uid, List<ESOrder> list) + throws Exception { List<CommonOrderVO> listVO = commonOrderMapper.searchOrderByUid((page - 1) * size, size, uid, list); // 璁㈠崟淇℃伅涓虹┖ @@ -1690,7 +1694,7 @@ } // 鏁版嵁鍔犲伐閲嶆柊缁勭粐 - orderVOFactoryNew(listVO, listGoods, uid); + orderVOFactoryNew(acceptData, listVO, listGoods, uid); return listVO; } @@ -1703,8 +1707,8 @@ * @param listGoods * @param uid */ - private void orderVOFactoryNew(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) - throws Exception { + private void orderVOFactoryNew(AcceptData acceptData, List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, + Long uid) throws Exception { List<String> listTB = new ArrayList<String>(); List<String> listJD = new ArrayList<String>(); List<String> listPDD = new ArrayList<String>(); @@ -1745,23 +1749,19 @@ || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) needSelectVIPUidList.add(Long.parseLong(order.getUserId())); } - Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList); - // 璁剧疆鏄惁涓簐ip璁㈠崟 for (CommonOrderVO order : listOrder) { if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI || order.getHongBaoType() == HongBaoV2.TYPE_SHARE_ERJI) { - if (vipUserMap.get(Long.parseLong(order.getUserId())) != null - && vipUserMap.get(Long.parseLong(order.getUserId())) == true) - order.setVipOrder(true); - else - order.setVipOrder(false); - } else - order.setVipOrder(false); - - if (order.isVipOrder()) - order.setVipOrderDesc("璁㈠崟鏉ユ簮锛氱敱瓒呯骇浼氬憳鐨勭矇涓濅骇鐢�"); + Integer urank = order.getUrank(); + if (urank != null) { + String levelName = UserLevelUtil.getLevelName(urank); + if (!StringUtil.isNullOrEmpty(levelName)) { + order.setOrderDesc("璁㈠崟鏉ユ簮锛�" + levelName); + } + } + } } SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); @@ -1777,6 +1777,7 @@ for (CommonOrderVO order : listOrder) { String orderNo = order.getOrderNo(); Integer sourceType = order.getSourceType(); + Integer hongBaoType = order.getHongBaoType(); // 鍟嗗搧淇℃伅缁勫悎 for (CommonOrderVO commonOrder : listGoods) { @@ -1807,7 +1808,6 @@ } commonGoodsVO.setActualPay("浠樻閲戦锛毬�" + totalSettlement); - Integer hongBaoType = order.getHongBaoType(); // 閭�璇疯鍗曚俊鎭繚鎶� if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType @@ -1830,6 +1830,11 @@ order.setOrderType(2); } } + + Integer goodsType = commonGoodsVO.getGoodsType(); + if (goodsType != null & goodsType == 6) { + order.setOrderType(5); // 楗夸簡涔堣鍗� + } order.getListOrderGoods().add(commonGoodsVO); } @@ -1839,6 +1844,14 @@ if (thirdCreateTime != null) { order.setDownTime("涓嬪崟鏃堕棿锛�" + format.format(thirdCreateTime)); order.setObtainTime(thirdCreateTime.getTime()); + } + + // 2.1鏄剧ず杩斿埄璇存槑杩炴帴> + if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + if (thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)) { + String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey()); + order.setRebateLink(rebateLink + "?orderNo=" + orderNo +"&sourceType=" + sourceType); + } } Date settleTime = order.getSettleTime(); @@ -1915,7 +1928,6 @@ // 璁㈠崟鏍囪瘑 List<String> signList = new ArrayList<String>(); /* 璁㈠崟杩斿埄绫诲瀷 杞崲 */ - Integer hongBaoType = order.getHongBaoType(); if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) { // 鑷喘 hongbaoInfo = "杩斿埄"; @@ -2184,4 +2196,12 @@ } } + @Override + public Date getThirdCreateTime(String orderId, int sourceType) { + List<CommonOrder> list = listBySourceTypeAndOrderId(sourceType, orderId); + if (list == null || list.size() == 0) + return null; + return list.get(0).getThirdCreateTime(); + } + } -- Gitblit v1.8.0