打票机完善
This commit is contained in:
parent
79cd942d3a
commit
a918f6fdb3
@ -1,6 +1,7 @@
|
||||
package com.suisung.mall.common.api;
|
||||
|
||||
import com.suisung.mall.common.utils.I18nUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
@ -15,7 +16,20 @@ public class StateCode {
|
||||
public static final int DELIVERY_TYPE_SELF_PICK_UP = 5; // 自提(运费 0 元)
|
||||
public static final int DELIVERY_TYPE_EXP = 10; // 普通快递
|
||||
public static final int DELIVERY_TYPE_IN_STORE_SERVICE = 15; // 店铺配送
|
||||
public static final int DELIVERY_TYPE_SAME_CITY= 16;//同城配送,一般是顺丰同城,达达,蜂鸟
|
||||
public static final int DELIVERY_TYPE_SAME_CITY= 16;//顺丰同城配送
|
||||
|
||||
public static final Map<Integer,String> DELIVERY_TYPE_MAP = new HashMap(){
|
||||
{
|
||||
put(DELIVERY_TYPE_EXPRESS,"快递配送");
|
||||
put(DELIVERY_TYPE_EMS,"EMS");
|
||||
put(DELIVERY_TYPE_MAIL,"平邮");
|
||||
put(DELIVERY_TYPE_AIR_FREIGHT,"货运");
|
||||
put(DELIVERY_TYPE_SELF_PICK_UP,"到店自提");
|
||||
put(DELIVERY_TYPE_EXP,"普通快递");
|
||||
put(DELIVERY_TYPE_IN_STORE_SERVICE,"店铺配送");
|
||||
put(DELIVERY_TYPE_SAME_CITY,"顺丰同城");
|
||||
}
|
||||
};
|
||||
|
||||
public static final int DELIVERY_TIME_NO_LIMIT = 1; //不限送货时间:周一至周日
|
||||
public static final int DELIVERY_TIME_WORKING_DAY = 2; //工作日送货:周一至周五
|
||||
|
||||
@ -8266,14 +8266,32 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
orderItems.add(ent.rebuild());
|
||||
}
|
||||
|
||||
// 7位数取单号,位数不够向左补0
|
||||
// 7位数取单号,位数不够向左补0 (同城配送的取单号)
|
||||
m.put("order_pickup_num_str", String.format("%07d", m.get("order_pickup_num")));
|
||||
m.put("seller_message", "");//卖家留言
|
||||
m.put("order_items", orderItems);//订单商品列表
|
||||
m.put("order_items_count", orderItems.size());//商品数量
|
||||
|
||||
// 运费处理
|
||||
BigDecimal orderShippingFee = NumberUtil.toBigDecimal(m.getOrDefault("order_shipping_fee", "0").toString());
|
||||
BigDecimal orderShippingFeeAmount = NumberUtil.toBigDecimal(m.getOrDefault("order_shipping_fee_amount", "0").toString());
|
||||
m.put("order_shipping_fee", orderShippingFee.compareTo(BigDecimal.ZERO) > 0 ? orderShippingFee : orderShippingFeeAmount);
|
||||
|
||||
// 支付渠道处理
|
||||
m.put("payment_channel_name", m.getOrDefault("payment_channel_name", "线上支付").toString());
|
||||
|
||||
// 配送时间= 支付时间+25分钟
|
||||
m.put("delivery_time", DateUtil.offsetMinute((Date) m.get("payment_time"), 25));
|
||||
// 配送方式
|
||||
String deliveryTypeName = StateCode.DELIVERY_TYPE_MAP.getOrDefault(m.getOrDefault("delivery_type_id",StateCode.DELIVERY_TYPE_SAME_CITY),"普通快递");
|
||||
m.put("delivery_type_name", deliveryTypeName);
|
||||
|
||||
// 预留字段
|
||||
m.put("quanyi", 0.00); // 会员权益
|
||||
m.put("miaosha", 0.00); // 秒杀
|
||||
m.put("yajin", 0.00); // 押金
|
||||
m.put("cashier", m.getOrDefault("store_name", "店长")); // 收银员
|
||||
m.put("order_source", "微信小程序"); // 订单来源
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
@ -521,17 +521,20 @@
|
||||
|
||||
<select id="getOrderPrintInfo" resultType="java.util.Map">
|
||||
select
|
||||
a.order_id,a.store_id,a.store_name,a.buyer_user_id, a.buyer_user_name,a.order_time,a.order_payment_amount,a.order_product_amount,
|
||||
b.order_title, b.delivery_type_id, b.payment_type_id, b.payment_time, b.order_pickup_num,
|
||||
c.order_message, c.order_item_amount, c.order_shipping_fee,c.delivery_time,
|
||||
e.store_tel,
|
||||
f.da_province,f.da_city,f.da_address,f.da_mobile, f.order_id
|
||||
a.order_id,a.store_id,a.store_name,a.buyer_user_id, a.buyer_user_name,a.order_time,a.order_payment_amount,a.order_product_amount,
|
||||
b.order_title, b.delivery_type_id, b.payment_type_id, b.payment_time, b.order_pickup_num,
|
||||
c.order_message, c.order_item_amount, c.order_shipping_fee,c.delivery_time, c.order_shipping_fee_amount,
|
||||
e.store_tel,
|
||||
f.da_province,f.da_city,f.da_address,f.da_mobile, f.order_id,
|
||||
g.payment_channel_id, h.payment_channel_name
|
||||
from shop_order_base a
|
||||
inner join shop_order_info b on a.order_id=b.order_id
|
||||
inner join shop_order_data c on a.order_id=c.order_id
|
||||
inner join shop_store_base d on a.store_id=d.store_id
|
||||
inner join shop_store_info e on a.store_id=e.store_id
|
||||
inner join shop_order_delivery_address f on a.order_id=f.order_id
|
||||
left join pay_consume_trade g on a.order_id=g.order_id
|
||||
left join pay_payment_channel h on g.payment_channel_id=h.payment_channel_id
|
||||
<where>
|
||||
<if test="orderId!=null ">
|
||||
and a.order_id=#{orderId}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user