Authored by unknown

联盟订单优化

  1 +package com.yoho.unions.dal;
  2 +
  3 +
  4 +import com.yoho.unions.dal.model.OrdersAccessOry;
  5 +
  6 +public interface OrdersAccessOryMapper {
  7 +
  8 + OrdersAccessOry selectByPrimaryKey(Long orderCode);
  9 +}
  1 +package com.yoho.unions.dal.model;
  2 +
  3 +import java.math.BigDecimal;
  4 +
  5 +public class OrdersAccessOry {
  6 + private Long orderCode;
  7 +
  8 + private String isNew;
  9 +
  10 + private Long unionid;
  11 +
  12 + private String unionName;
  13 +
  14 + private BigDecimal redenvelopesNumber;
  15 +
  16 + private String promoCode;
  17 +
  18 + private BigDecimal promoCodeDiscount;
  19 +
  20 + private BigDecimal promoCodeAmount;
  21 +
  22 + private Integer createTime;
  23 +
  24 + private Integer storehouseId;
  25 +
  26 + private String tailPayNoticePhone;
  27 +
  28 + private BigDecimal orderDepositAmount;
  29 +
  30 + private BigDecimal lastOrderDepositAmount;
  31 +
  32 + private BigDecimal lastOrderTailPayAmount;
  33 +
  34 + private String udid;
  35 +
  36 + public Long getOrderCode() {
  37 + return orderCode;
  38 + }
  39 +
  40 + public void setOrderCode(Long orderCode) {
  41 + this.orderCode = orderCode;
  42 + }
  43 +
  44 + public String getIsNew() {
  45 + return isNew;
  46 + }
  47 +
  48 + public void setIsNew(String isNew) {
  49 + this.isNew = isNew == null ? null : isNew.trim();
  50 + }
  51 +
  52 + public Long getUnionid() {
  53 + return unionid;
  54 + }
  55 +
  56 + public void setUnionid(Long unionid) {
  57 + this.unionid = unionid;
  58 + }
  59 +
  60 + public String getUnionName() {
  61 + return unionName;
  62 + }
  63 +
  64 + public void setUnionName(String unionName) {
  65 + this.unionName = unionName == null ? null : unionName.trim();
  66 + }
  67 +
  68 + public BigDecimal getRedenvelopesNumber() {
  69 + return redenvelopesNumber;
  70 + }
  71 +
  72 + public void setRedenvelopesNumber(BigDecimal redenvelopesNumber) {
  73 + this.redenvelopesNumber = redenvelopesNumber;
  74 + }
  75 +
  76 + public String getPromoCode() {
  77 + return promoCode;
  78 + }
  79 +
  80 + public void setPromoCode(String promoCode) {
  81 + this.promoCode = promoCode == null ? null : promoCode.trim();
  82 + }
  83 +
  84 + public BigDecimal getPromoCodeDiscount() {
  85 + return promoCodeDiscount;
  86 + }
  87 +
  88 + public void setPromoCodeDiscount(BigDecimal promoCodeDiscount) {
  89 + this.promoCodeDiscount = promoCodeDiscount;
  90 + }
  91 +
  92 + public BigDecimal getPromoCodeAmount() {
  93 + return promoCodeAmount;
  94 + }
  95 +
  96 + public void setPromoCodeAmount(BigDecimal promoCodeAmount) {
  97 + this.promoCodeAmount = promoCodeAmount;
  98 + }
  99 +
  100 + public Integer getCreateTime() {
  101 + return createTime;
  102 + }
  103 +
  104 + public void setCreateTime(Integer createTime) {
  105 + this.createTime = createTime;
  106 + }
  107 +
  108 + public Integer getStorehouseId() {
  109 + return storehouseId;
  110 + }
  111 +
  112 + public void setStorehouseId(Integer storehouseId) {
  113 + this.storehouseId = storehouseId;
  114 + }
  115 +
  116 + public String getTailPayNoticePhone() {
  117 + return tailPayNoticePhone;
  118 + }
  119 +
  120 + public void setTailPayNoticePhone(String tailPayNoticePhone) {
  121 + this.tailPayNoticePhone = tailPayNoticePhone == null ? null : tailPayNoticePhone.trim();
  122 + }
  123 +
  124 + public BigDecimal getOrderDepositAmount() {
  125 + return orderDepositAmount;
  126 + }
  127 +
  128 + public void setOrderDepositAmount(BigDecimal orderDepositAmount) {
  129 + this.orderDepositAmount = orderDepositAmount;
  130 + }
  131 +
  132 + public BigDecimal getLastOrderDepositAmount() {
  133 + return lastOrderDepositAmount;
  134 + }
  135 +
  136 + public void setLastOrderDepositAmount(BigDecimal lastOrderDepositAmount) {
  137 + this.lastOrderDepositAmount = lastOrderDepositAmount;
  138 + }
  139 +
  140 + public BigDecimal getLastOrderTailPayAmount() {
  141 + return lastOrderTailPayAmount;
  142 + }
  143 +
  144 + public void setLastOrderTailPayAmount(BigDecimal lastOrderTailPayAmount) {
  145 + this.lastOrderTailPayAmount = lastOrderTailPayAmount;
  146 + }
  147 +
  148 + public String getUdid() {
  149 + return udid;
  150 + }
  151 +
  152 + public void setUdid(String udid) {
  153 + this.udid = udid == null ? null : udid.trim();
  154 + }
  155 +}
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.yoho.unions.dal.OrdersAccessOryMapper" >
  4 + <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.OrdersAccessOry" >
  5 + <id column="order_code" property="orderCode" jdbcType="BIGINT" />
  6 + <result column="is_new" property="isNew" jdbcType="CHAR" />
  7 + <result column="unionid" property="unionid" jdbcType="BIGINT" />
  8 + <result column="union_name" property="unionName" jdbcType="CHAR" />
  9 + <result column="redenvelopes_number" property="redenvelopesNumber" jdbcType="DECIMAL" />
  10 + <result column="promo_code" property="promoCode" jdbcType="VARCHAR" />
  11 + <result column="promo_code_discount" property="promoCodeDiscount" jdbcType="DECIMAL" />
  12 + <result column="promo_code_amount" property="promoCodeAmount" jdbcType="DECIMAL" />
  13 + <result column="create_time" property="createTime" jdbcType="INTEGER" />
  14 + <result column="storehouse_id" property="storehouseId" jdbcType="INTEGER" />
  15 + <result column="tail_pay_notice_phone" property="tailPayNoticePhone" jdbcType="VARCHAR" />
  16 + <result column="order_deposit_amount" property="orderDepositAmount" jdbcType="DECIMAL" />
  17 + <result column="last_order_deposit_amount" property="lastOrderDepositAmount" jdbcType="DECIMAL" />
  18 + <result column="last_order_tail_pay_amount" property="lastOrderTailPayAmount" jdbcType="DECIMAL" />
  19 + <result column="udid" property="udid" jdbcType="VARCHAR" />
  20 + </resultMap>
  21 + <sql id="Base_Column_List" >
  22 + order_code, is_new, unionid, union_name, redenvelopes_number, promo_code, promo_code_discount,
  23 + promo_code_amount, create_time, storehouse_id, tail_pay_notice_phone, order_deposit_amount,
  24 + last_order_deposit_amount, last_order_tail_pay_amount, udid
  25 + </sql>
  26 + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  27 + select
  28 + <include refid="Base_Column_List" />
  29 + from orders_accessory
  30 + where order_code = #{orderCode,jdbcType=BIGINT}
  31 + </select>
  32 +</mapper>
@@ -14,14 +14,8 @@ import com.yoho.unions.common.enums.OrderStatusEnum; @@ -14,14 +14,8 @@ import com.yoho.unions.common.enums.OrderStatusEnum;
14 import com.yoho.unions.common.enums.PaymentTypeEnum; 14 import com.yoho.unions.common.enums.PaymentTypeEnum;
15 import com.yoho.unions.common.service.IBusinessExportService; 15 import com.yoho.unions.common.service.IBusinessExportService;
16 import com.yoho.unions.common.utils.DateUtil; 16 import com.yoho.unions.common.utils.DateUtil;
17 -import com.yoho.unions.dal.IMktMarketingUrlDAO;  
18 -import com.yoho.unions.dal.IOrdersMapper;  
19 -import com.yoho.unions.dal.IUserOrdersDAO;  
20 -import com.yoho.unions.dal.OrdersCouponsMapper;  
21 -import com.yoho.unions.dal.model.MktMarketingUrl;  
22 -import com.yoho.unions.dal.model.Orders;  
23 -import com.yoho.unions.dal.model.OrdersCoupons;  
24 -import com.yoho.unions.dal.model.UserOrders; 17 +import com.yoho.unions.dal.*;
  18 +import com.yoho.unions.dal.model.*;
25 import com.yoho.unions.server.service.IUserOrdersService; 19 import com.yoho.unions.server.service.IUserOrdersService;
26 import org.apache.commons.collections.CollectionUtils; 20 import org.apache.commons.collections.CollectionUtils;
27 import org.apache.commons.lang3.StringUtils; 21 import org.apache.commons.lang3.StringUtils;
@@ -52,6 +46,8 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport @@ -52,6 +46,8 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport
52 OrdersCouponsMapper ordersCouponsMapper; 46 OrdersCouponsMapper ordersCouponsMapper;
53 @Autowired 47 @Autowired
54 IMktMarketingUrlDAO mktMarketingUrlDAO; 48 IMktMarketingUrlDAO mktMarketingUrlDAO;
  49 + @Autowired
  50 + OrdersAccessOryMapper ordersAccessOryMapper;
55 51
56 52
57 public PageUnionOrderRspBO queryUnionOrders(UnionOrderReqBO reqBO){ 53 public PageUnionOrderRspBO queryUnionOrders(UnionOrderReqBO reqBO){
@@ -107,15 +103,21 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport @@ -107,15 +103,21 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport
107 //运费 103 //运费
108 orderRspBO.setShipmentAmount(orders.getShippingCost()); 104 orderRspBO.setShipmentAmount(orders.getShippingCost());
109 //实际支付金额 105 //实际支付金额
110 - orderRspBO.setRealPayAmount(orders.getLastOrderAmount()); 106 + orderRspBO.setRealPayAmount(orders.getLastOrderAmount().subtract(orders.getShippingCost()));
111 //订单状态 107 //订单状态
112 orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus()))); 108 orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus())));
113 //附加信息 109 //附加信息
114 orderRspBO.setExetInfmoation(orders.getRemark()); 110 orderRspBO.setExetInfmoation(orders.getRemark());
115 //支付方式 111 //支付方式
116 orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType()))); 112 orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType())));
117 - //是否新客  
118 - orderRspBO.setIsNew(NewUserEnum.getNameByCode(orders.getNewUserOrders())); 113 + //是否新客---从新的表中获取
  114 + OrdersAccessOry ordersAccessOry = ordersAccessOryMapper.selectByPrimaryKey(Long.valueOf(userOrders.getOrderCode()));
  115 + if(null !=ordersAccessOry){
  116 + orderRspBO.setIsNew(NewUserEnum.getNameByCode(ordersAccessOry.getIsNew()==null?"N":ordersAccessOry.getIsNew()));
  117 + }else {
  118 + orderRspBO.setIsNew(NewUserEnum.getNameByCode("N"));
  119 + }
  120 +
119 orderRspBO.setUid(orders.getUid()); 121 orderRspBO.setUid(orders.getUid());
120 } 122 }
121 123
@@ -97,6 +97,7 @@ datasources: @@ -97,6 +97,7 @@ datasources:
97 - com.yoho.unions.dal.ErpOrdersGoodsMapper 97 - com.yoho.unions.dal.ErpOrdersGoodsMapper
98 - com.yoho.unions.dal.IOrdersMapper 98 - com.yoho.unions.dal.IOrdersMapper
99 - com.yoho.unions.dal.OrdersCouponsMapper 99 - com.yoho.unions.dal.OrdersCouponsMapper
  100 + - com.yoho.unions.dal.OrdersAccessOryMapper
100 101
101 yh_guang: 102 yh_guang:
102 servers: 103 servers:
@@ -98,6 +98,7 @@ datasources: @@ -98,6 +98,7 @@ datasources:
98 - com.yoho.unions.dal.ErpOrdersGoodsMapper 98 - com.yoho.unions.dal.ErpOrdersGoodsMapper
99 - com.yoho.unions.dal.IOrdersMapper 99 - com.yoho.unions.dal.IOrdersMapper
100 - com.yoho.unions.dal.OrdersCouponsMapper 100 - com.yoho.unions.dal.OrdersCouponsMapper
  101 + - com.yoho.unions.dal.OrdersAccessOryMapper
101 102
102 yh_guang: 103 yh_guang:
103 servers: 104 servers: