| | |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderGoodsMapper commonOrderGoodsMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserSystemCouponRecordService userSystemCouponRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SystemCouponService systemCouponService;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | // 奖励订单图片
|
| | | public final static String PIC_REWARD= "http://img.flqapp.com/resource/order/order_state_reward.png";
|
| | | |
| | | public final static String PIC_REWARD = "http://img.flqapp.com/resource/order/order_state_reward.png";
|
| | |
|
| | | // 免单状态图片
|
| | | public final static String PIC_FREE_ON = "http://img.flqapp.com/resource/order/order_state_freeing.png";
|
| | | public final static String PIC_FREE_FAIL = "http://img.flqapp.com/resource/order/order_state_free_fail.png";
|
| | | public final static String PIC_FREE_SUCCEED = "http://img.flqapp.com/resource/order/order_state_free_suc.png";
|
| | |
|
| | | public final static String PIC_FREE_FAIL = "http://img.flqapp.com/resource/order/order_state_free_fail.png";
|
| | | public final static String PIC_FREE_SUCCEED = "http://img.flqapp.com/resource/order/order_state_free_suc.png";
|
| | |
|
| | | @Override
|
| | | public int insert(CommonOrder record) {
|
| | |
| | |
|
| | | return listOrder;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day) {
|
| | | return commonOrderMapper.countHistoryOrder(uid, day);
|
| | |
| | | public void listDataFactory(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
|
| | |
|
| | | List<String> listNo = new ArrayList<String>();
|
| | | for (CommonOrderVO commonOrderVO: listOrder) {
|
| | | for (CommonOrderVO commonOrderVO : listOrder) {
|
| | | listNo.add(commonOrderVO.getOrderNo());
|
| | | }
|
| | | |
| | |
|
| | | // 已经使用券订单
|
| | | List<UserSystemCouponRecord> couponRecordList = userSystemCouponRecordService.getRecordByOrderNoList(listNo);
|
| | | |
| | | |
| | |
|
| | | /* 组合商品信息 */
|
| | | for (CommonOrderVO commonOrder : listGoods) {
|
| | |
|
| | |
| | | totalSettlement = commonOrder.getTotalPayment();
|
| | | }
|
| | | // 实付款
|
| | | commonGoodsVO.setActualPay("实付款:¥" + totalSettlement);
|
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement);
|
| | |
|
| | | listOrderGoods.add(commonGoodsVO);
|
| | |
|
| | |
| | |
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd");
|
| | | |
| | |
|
| | | // 是否存在奖励券
|
| | | boolean hasRewardCoupon = userSystemCouponService.hasRewardCoupon(uid);
|
| | | |
| | |
|
| | | /* 组织订单状态 等信息 */
|
| | | for (CommonOrderVO order : listOrder) {
|
| | |
|
| | |
| | | order.setOrderOrigin("2");
|
| | | order.setHongBaoTypePic(CommonOrder.TYPE_SHARE);
|
| | | signList.add(CommonOrder.TYPE_SHARE);
|
| | | |
| | |
|
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | |
| | | hongBaoMap.put("content", hongbaoInfo + " ¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | hongBaoMap.put("fontColor", hongbaoInfoFontColor);
|
| | | order.setHongBaoInfo(hongBaoMap);
|
| | | |
| | |
|
| | | // 非自购的订单 不显示返利、免单详情
|
| | | if (HongBaoV2.TYPE_ZIGOU != hongBaoType) {
|
| | | // 订单标识
|
| | | order.setSignList(signList);
|
| | | |
| | |
|
| | | } else {
|
| | | |
| | |
|
| | | // 是否免单商品
|
| | | boolean freeOrder = false;
|
| | | // 是否奖励成功
|
| | | boolean rewardSuccess = false;
|
| | | |
| | |
|
| | | // 奖励订单、免单 使用记录
|
| | | if (couponRecordList != null && couponRecordList.size() > 0) {
|
| | | |
| | | for (UserSystemCouponRecord couponRecord: couponRecordList) {
|
| | |
|
| | | for (UserSystemCouponRecord couponRecord : couponRecordList) {
|
| | | // 订单号匹配
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | | |
| | |
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | Integer state = couponRecord.getState();
|
| | | |
| | |
|
| | | // 奖励订单: 且成功
|
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType)
|
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | rewardSuccess = true;
|
| | | signList.add(PIC_REWARD); // 加入奖励成功图片
|
| | | |
| | |
|
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
|
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
|
| | | |
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) {
|
| | |
|
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) {
|
| | | // 免单中
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_ON);
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_ON);
|
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | // 免单成功
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_SUCCEED);
|
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) {
|
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state
|
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) {
|
| | | // 规则不匹配、退款
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_FAIL);
|
| | | } |
| | | }
|
| | | }
|
| | | |
| | |
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 订单标识
|
| | | order.setSignList(signList);
|
| | | |
| | |
|
| | | boolean rewardOrder = false;
|
| | | |
| | | int type = 1; // 1 常规跳转页面 2弹出选项(奖励券)
|
| | |
|
| | | int type = 1; // 1 常规跳转页面 2弹出选项(奖励券)
|
| | | if (rewardSuccess) {
|
| | | // 奖励成功
|
| | | rewardOrder = true; |
| | | } else if(hasRewardCoupon && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType &&
|
| | | HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | rewardOrder = true;
|
| | | } else if (hasRewardCoupon && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType
|
| | | && HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | // 有可用的奖励券 、非免单订单 、且已到账的 、返利订单
|
| | | type = 2;
|
| | | rewardOrder = true; |
| | | rewardOrder = true;
|
| | | }
|
| | | |
| | | if (rewardOrder) { |
| | |
|
| | | if (rewardOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 奖励券进度详情
|
| | | rewardStyleVO.setContent("返利奖励 >");
|
| | | rewardStyleVO.setColor( "#E5005C");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | | |
| | | Map<String, Object> jumpLink = new HashMap<String,Object>();
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | |
| | | Map<String, Object> jump = new HashMap<String,Object>();
|
| | | jump.put("type", type); |
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String,Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | | |
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", type);
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | | |
| | | if (freeOrder) { |
| | |
|
| | | if (freeOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 返利、免单详情
|
| | | rewardStyleVO.setContent("免单详情 >");
|
| | | rewardStyleVO.setColor( "#E5005C");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | | |
| | | Map<String, Object> jumpLink = new HashMap<String,Object>();
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | |
| | | Map<String, Object> jump = new HashMap<String,Object>();
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 1); // 页面跳转
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
|
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String,Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | | |
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | | }
|
| | |
| | | taoBaoGoods = TaoKeApiUtil.getSimpleGoodsInfo(taoBaoOrder.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | taoBaoGoods=TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
|
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
|
| | | }
|
| | | if (taoBaoGoods != null) {
|
| | | goods = CommonOrderGoodsFactory.create(taoBaoGoods);
|
| | |
| | | order.setHongBaoState(3);
|
| | | }
|
| | |
|
| | | List<HongBaoV2> listhb = hongBaoV2Service.listChildrenById(order.getHongbaoId());
|
| | | if (listhb != null && listhb.size() > 0) {
|
| | | if (listhb.size() == 1) {
|
| | | UserInfo userInfo = listhb.get(0).getUserInfo();
|
| | | if (userInfo != null) {
|
| | | order.setLevelOneId(userInfo.getId() + "");
|
| | | order.setLevelOneMoney(listhb.get(0).getMoney() + "");
|
| | | }
|
| | | } else if (listhb.size() == 2) {
|
| | | UserInfo userInfo = listhb.get(0).getUserInfo();
|
| | | if (userInfo != null) {
|
| | | order.setLevelOneId(userInfo.getId() + "");
|
| | | order.setLevelOneMoney(listhb.get(0).getMoney() + "");
|
| | | }
|
| | |
|
| | | UserInfo userInfo2 = listhb.get(1).getUserInfo();
|
| | | if (userInfo2 != null) {
|
| | | order.setLevelTwoId(userInfo2.getId() + "");
|
| | | order.setLevelTwoMoney(listhb.get(1).getMoney() + "");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | return list;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonOrderVO getInfoByOrderNo(Long uid,String orderNo) throws CommonOrderException{
|
| | | public CommonOrderVO getInfoByOrderNo(Long uid, String orderNo) throws CommonOrderException {
|
| | | List<CommonOrderVO> list = getOrderByUid(1, uid, null, null, null, orderNo, null, null, null);
|
| | | if (list == null || list.size() == 0) {
|
| | | return null;
|
| | |
| | | return list.get(0);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public CommonOrderVO getCommonOrderByOrderNo(Long uid, String orderNo, Integer orderState) throws CommonOrderException {
|
| | | public CommonOrderVO getCommonOrderByOrderNo(Long uid, String orderNo, Integer orderState)
|
| | | throws CommonOrderException {
|
| | |
|
| | | CommonOrderVO commonOrderVO = commonOrderMapper.getCommonOrderByOrderNo(uid, orderNo, orderState);
|
| | | // 订单信息为空
|
| | |
| | | totalSettlement = commonOrder.getTotalPayment();
|
| | | }
|
| | | // 实付款
|
| | | commonGoodsVO.setActualPay("实付款:¥" + totalSettlement);
|
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement);
|
| | |
|
| | | listOrderGoods.add(commonGoodsVO);
|
| | |
|
| | |
| | |
|
| | | return commonOrderVO;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer hongBaoState, String orderNo) throws CommonOrderException {
|
| | | public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer hongBaoState, String orderNo)
|
| | | throws CommonOrderException {
|
| | |
|
| | | List<CommonOrderVO> listOrder = commonOrderMapper.getCouponHongbaoByOrderNo(uid, hongBaoState, orderNo);
|
| | |
|
| | |
| | | return listOrder;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public JSONObject getRewardJumpInfo(String orderNo) {
|
| | | |
| | |
|
| | | JSONObject map = new JSONObject();
|
| | | // 订单标识
|
| | | List<String> signList = new ArrayList<String>();
|
| | | signList.add(CommonOrder.TYPE_FANLI);
|
| | | signList.add(PIC_REWARD); // 加入奖励成功图片
|
| | | map.put("signList", signList);
|
| | | |
| | | |
| | |
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 奖励券进度详情
|
| | | rewardStyleVO.setContent("返利奖励 >");
|
| | | rewardStyleVO.setColor( "#E5005C");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | | |
| | | Map<String, Object> jumpLink = new HashMap<String,Object>();
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", orderNo);
|
| | | |
| | | Map<String, Object> jump = new HashMap<String,Object>();
|
| | | jump.put("type", 1); |
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | | |
| | | Map<String, Object> rewardMap = new HashMap<String,Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | | |
| | | map.put("rewardDetail", rewardMap);
|
| | | |
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 1);
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | map.put("rewardDetail", rewardMap);
|
| | |
|
| | | return map;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CommonOrder selectBySourceTypeAndTradeId(int sourceType, String tradeId) {
|
| | |
|
| | | return commonOrderMapper.selectBySourceTypeAndTradeId(sourceType, tradeId);
|
| | | }
|
| | | }
|