| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import org.yeshi.utils.taobao.TbImgUtil; |
| | | |
| | | import com.aliyun.openservices.ons.api.Message; |
| | | import com.aliyun.openservices.ons.api.Producer; |
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper; |
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper; |
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper; |
| | |
| | | import com.yeshi.fanli.entity.suning.SuningOrderInfo; |
| | | 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.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | |
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService; |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService; |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService; |
| | | import com.yeshi.fanli.service.manger.msg.RocketMQManager; |
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TimeUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.yeshi.fanli.util.VersionUtil; |
| | | import com.yeshi.fanli.util.account.UserUtil; |
| | | import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory; |
| | |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.util.user.UserLevelUtil; |
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil; |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO; |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | import com.yeshi.fanli.vo.order.CommonOrderGoodsVO; |
| | | import com.yeshi.fanli.vo.order.CommonOrderVO; |
| | | import com.yeshi.fanli.vo.order.HongBaoCountVO; |
| | |
| | | @Resource |
| | | private TaoBaoOrderGoodsMapper taoBaoOrderGoodsMapper; |
| | | |
| | | @Resource(name = "producer") |
| | | private Producer orderProducer; |
| | | @Resource |
| | | private RocketMQManager rocketMQManager; |
| | | |
| | | // 奖励订单图片 |
| | | public final static String PIC_REWARD = "http://img.flqapp.com/resource/order/order_state_reward.png"; |
| | |
| | | * @param hasRewardCoupon |
| | | * @param hongBaoState |
| | | * @param list |
| | | * @param signList |
| | | */ |
| | | private void couponFactory(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState, Integer hongBaoType, |
| | | List<UserSystemCouponRecord> list, Long uid, boolean vip, AcceptData acceptData, BigDecimal hongBao) |
| | |
| | | settlement, firstOrder.getUserInfo().getId(), placeDate, new Date()); |
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.orderConfirm, |
| | | mqMsg); |
| | | orderProducer.send(msg); |
| | | rocketMQManager.sendNormalMsg(msg, null); |
| | | } |
| | | } |
| | | } |
| | |
| | | * |
| | | * @param commonOrder |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private CommonOrderAddResultDTO addCommonOrder(CommonOrder commonOrder) throws CommonOrderException { |
| | | // 判断商品是否存在 |
| | | if (commonOrder == null) |
| | |
| | | @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,SystemEnum system) throws CommonOrderException { |
| | | |
| | | List<CommonOrderVO> list = null; |
| | | |
| | | if (StringUtil.isNullOrEmpty(key) || keyType == 1) {// 搜索框无值或者按订单号搜索时都只搜索主订单 |
| | | list = commonOrderMapper.listQueryWithNoChild(start, count, keyType, key, state, type, orderState, |
| | | startTime, endTime, source, payment); |
| | | startTime, endTime, source, payment,system); |
| | | } 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,system); |
| | | } |
| | | |
| | | if (list == null) { |
| | |
| | | |
| | | @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 { |
| | | String startTime, String endTime, Integer source, List<Long> listShopId, List<Long> listGoodsId, |
| | | Date minTime, BigDecimal money, BigDecimal payment, SystemEnum system) throws CommonOrderException { |
| | | if (StringUtil.isNullOrEmpty(key) || keyType == 1) {// 搜索框无值或者按订单号搜索时都只搜索主订单 |
| | | return commonOrderMapper.countQueryWithNoChild(keyType, key, state, type, orderState, startTime, endTime, |
| | | source, payment); |
| | | source, payment,system); |
| | | } else { |
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime, source, |
| | | listShopId, listGoodsId, minTime, money, payment); |
| | | listShopId, listGoodsId, minTime, money, payment,system); |
| | | } |
| | | } |
| | | |
| | |
| | | return commonOrderMapper.getByOrderNo(uid, orderNO); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<CommonOrder> getByOrderNoAndSourceType(Long uid, String orderNO, int sourceType) { |
| | | return commonOrderMapper.getByOrderNoAndSourceType(uid, orderNO, sourceType); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public CommonOrder selectLatestValidByUid(Long uid) { |
| | | List<Integer> stateList = new ArrayList<>(); |
| | |
| | | Integer goodsType = commonGoodsVO.getGoodsType(); |
| | | if (goodsType != null & goodsType == Constant.SOURCE_TYPE_ELME) { |
| | | order.setOrderType(Constant.SOURCE_TYPE_ELME); // 饿了么订单 |
| | | commonGoodsVO.setGoodsId("0"); |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | |
| | | // 显示返利说明连接> 未失效 |
| | | if (CommonOrder.STATE_SX != orderState |
| | | && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)) { |
| | | String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey()); |
| | | String rebateLink = configService.getValue(ConfigKeyEnum.orderRebateDescLink.getKey(),acceptData.getSystem()); |
| | | order.setRebateLink(rebateLink + "?orderNo=" + orderNo + "&sourceType=" + sourceType); |
| | | } |
| | | |
| | |
| | | return commonOrderMapper.listByOrderNo(orderNo); |
| | | } |
| | | |
| | | @Override |
| | | public CommonOrder getFirstOrder(Long uid) { |
| | | return commonOrderMapper.getFirstOrder(uid); |
| | | } |
| | | |
| | | } |