Authored by unknown

联盟订单优化

package com.yoho.unions.dal;
import com.yoho.unions.dal.model.OrdersAccessOry;
public interface OrdersAccessOryMapper {
OrdersAccessOry selectByPrimaryKey(Long orderCode);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal.model;
import java.math.BigDecimal;
public class OrdersAccessOry {
private Long orderCode;
private String isNew;
private Long unionid;
private String unionName;
private BigDecimal redenvelopesNumber;
private String promoCode;
private BigDecimal promoCodeDiscount;
private BigDecimal promoCodeAmount;
private Integer createTime;
private Integer storehouseId;
private String tailPayNoticePhone;
private BigDecimal orderDepositAmount;
private BigDecimal lastOrderDepositAmount;
private BigDecimal lastOrderTailPayAmount;
private String udid;
public Long getOrderCode() {
return orderCode;
}
public void setOrderCode(Long orderCode) {
this.orderCode = orderCode;
}
public String getIsNew() {
return isNew;
}
public void setIsNew(String isNew) {
this.isNew = isNew == null ? null : isNew.trim();
}
public Long getUnionid() {
return unionid;
}
public void setUnionid(Long unionid) {
this.unionid = unionid;
}
public String getUnionName() {
return unionName;
}
public void setUnionName(String unionName) {
this.unionName = unionName == null ? null : unionName.trim();
}
public BigDecimal getRedenvelopesNumber() {
return redenvelopesNumber;
}
public void setRedenvelopesNumber(BigDecimal redenvelopesNumber) {
this.redenvelopesNumber = redenvelopesNumber;
}
public String getPromoCode() {
return promoCode;
}
public void setPromoCode(String promoCode) {
this.promoCode = promoCode == null ? null : promoCode.trim();
}
public BigDecimal getPromoCodeDiscount() {
return promoCodeDiscount;
}
public void setPromoCodeDiscount(BigDecimal promoCodeDiscount) {
this.promoCodeDiscount = promoCodeDiscount;
}
public BigDecimal getPromoCodeAmount() {
return promoCodeAmount;
}
public void setPromoCodeAmount(BigDecimal promoCodeAmount) {
this.promoCodeAmount = promoCodeAmount;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getStorehouseId() {
return storehouseId;
}
public void setStorehouseId(Integer storehouseId) {
this.storehouseId = storehouseId;
}
public String getTailPayNoticePhone() {
return tailPayNoticePhone;
}
public void setTailPayNoticePhone(String tailPayNoticePhone) {
this.tailPayNoticePhone = tailPayNoticePhone == null ? null : tailPayNoticePhone.trim();
}
public BigDecimal getOrderDepositAmount() {
return orderDepositAmount;
}
public void setOrderDepositAmount(BigDecimal orderDepositAmount) {
this.orderDepositAmount = orderDepositAmount;
}
public BigDecimal getLastOrderDepositAmount() {
return lastOrderDepositAmount;
}
public void setLastOrderDepositAmount(BigDecimal lastOrderDepositAmount) {
this.lastOrderDepositAmount = lastOrderDepositAmount;
}
public BigDecimal getLastOrderTailPayAmount() {
return lastOrderTailPayAmount;
}
public void setLastOrderTailPayAmount(BigDecimal lastOrderTailPayAmount) {
this.lastOrderTailPayAmount = lastOrderTailPayAmount;
}
public String getUdid() {
return udid;
}
public void setUdid(String udid) {
this.udid = udid == null ? null : udid.trim();
}
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.OrdersAccessOryMapper" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.OrdersAccessOry" >
<id column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="is_new" property="isNew" jdbcType="CHAR" />
<result column="unionid" property="unionid" jdbcType="BIGINT" />
<result column="union_name" property="unionName" jdbcType="CHAR" />
<result column="redenvelopes_number" property="redenvelopesNumber" jdbcType="DECIMAL" />
<result column="promo_code" property="promoCode" jdbcType="VARCHAR" />
<result column="promo_code_discount" property="promoCodeDiscount" jdbcType="DECIMAL" />
<result column="promo_code_amount" property="promoCodeAmount" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="storehouse_id" property="storehouseId" jdbcType="INTEGER" />
<result column="tail_pay_notice_phone" property="tailPayNoticePhone" jdbcType="VARCHAR" />
<result column="order_deposit_amount" property="orderDepositAmount" jdbcType="DECIMAL" />
<result column="last_order_deposit_amount" property="lastOrderDepositAmount" jdbcType="DECIMAL" />
<result column="last_order_tail_pay_amount" property="lastOrderTailPayAmount" jdbcType="DECIMAL" />
<result column="udid" property="udid" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
order_code, is_new, unionid, union_name, redenvelopes_number, promo_code, promo_code_discount,
promo_code_amount, create_time, storehouse_id, tail_pay_notice_phone, order_deposit_amount,
last_order_deposit_amount, last_order_tail_pay_amount, udid
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from orders_accessory
where order_code = #{orderCode,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -14,14 +14,8 @@ import com.yoho.unions.common.enums.OrderStatusEnum;
import com.yoho.unions.common.enums.PaymentTypeEnum;
import com.yoho.unions.common.service.IBusinessExportService;
import com.yoho.unions.common.utils.DateUtil;
import com.yoho.unions.dal.IMktMarketingUrlDAO;
import com.yoho.unions.dal.IOrdersMapper;
import com.yoho.unions.dal.IUserOrdersDAO;
import com.yoho.unions.dal.OrdersCouponsMapper;
import com.yoho.unions.dal.model.MktMarketingUrl;
import com.yoho.unions.dal.model.Orders;
import com.yoho.unions.dal.model.OrdersCoupons;
import com.yoho.unions.dal.model.UserOrders;
import com.yoho.unions.dal.*;
import com.yoho.unions.dal.model.*;
import com.yoho.unions.server.service.IUserOrdersService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -52,6 +46,8 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport
OrdersCouponsMapper ordersCouponsMapper;
@Autowired
IMktMarketingUrlDAO mktMarketingUrlDAO;
@Autowired
OrdersAccessOryMapper ordersAccessOryMapper;
public PageUnionOrderRspBO queryUnionOrders(UnionOrderReqBO reqBO){
... ... @@ -107,15 +103,21 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport
//运费
orderRspBO.setShipmentAmount(orders.getShippingCost());
//实际支付金额
orderRspBO.setRealPayAmount(orders.getLastOrderAmount());
orderRspBO.setRealPayAmount(orders.getLastOrderAmount().subtract(orders.getShippingCost()));
//订单状态
orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus())));
//附加信息
orderRspBO.setExetInfmoation(orders.getRemark());
//支付方式
orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType())));
//是否新客
orderRspBO.setIsNew(NewUserEnum.getNameByCode(orders.getNewUserOrders()));
//是否新客---从新的表中获取
OrdersAccessOry ordersAccessOry = ordersAccessOryMapper.selectByPrimaryKey(Long.valueOf(userOrders.getOrderCode()));
if(null !=ordersAccessOry){
orderRspBO.setIsNew(NewUserEnum.getNameByCode(ordersAccessOry.getIsNew()==null?"N":ordersAccessOry.getIsNew()));
}else {
orderRspBO.setIsNew(NewUserEnum.getNameByCode("N"));
}
orderRspBO.setUid(orders.getUid());
}
... ...
... ... @@ -97,6 +97,7 @@ datasources:
- com.yoho.unions.dal.ErpOrdersGoodsMapper
- com.yoho.unions.dal.IOrdersMapper
- com.yoho.unions.dal.OrdersCouponsMapper
- com.yoho.unions.dal.OrdersAccessOryMapper
yh_guang:
servers:
... ...
... ... @@ -98,6 +98,7 @@ datasources:
- com.yoho.unions.dal.ErpOrdersGoodsMapper
- com.yoho.unions.dal.IOrdersMapper
- com.yoho.unions.dal.OrdersCouponsMapper
- com.yoho.unions.dal.OrdersAccessOryMapper
yh_guang:
servers:
... ...