bec237c6 lauka

菠萝派接口-订单下载,更改查询语句,返回信息

1 个父辈 447edb3c
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
56 <result property="moneyBack" column="money_back" /> 56 <result property="moneyBack" column="money_back" />
57 <result property="moneyIntegral" column="money_integral" /> 57 <result property="moneyIntegral" column="money_integral" />
58 <result property="payTime" column="pay_time" /> 58 <result property="payTime" column="pay_time" />
59 <result property="couponMoney" column="couponMoney" />
59 </resultMap> 60 </resultMap>
60 61
61 <!-- 根据订单号查询订单信息 只查询不是主订单的订单 --> 62 <!-- 根据订单号查询订单信息 只查询不是主订单的订单 -->
...@@ -152,7 +153,7 @@ ...@@ -152,7 +153,7 @@
152 <select id="getOrdersList" parameterType="java.util.Map" resultMap="orders"> 153 <select id="getOrdersList" parameterType="java.util.Map" resultMap="orders">
153 select o.order_sn,o.order_state,o.remark,o.create_time,p.regionName AS regionName1, 154 select o.order_sn,o.order_state,o.remark,o.create_time,p.regionName AS regionName1,
154 c.regionName AS regionName2,a.regionName AS regionName3, 155 c.regionName AS regionName2,a.regionName AS regionName3,
155 o.address_info,o.mobile,o.zip_code,o.zip_code,o.money_logistics,o.money_product-o.money_order-o.money_logistics AS couponMoney, 156 o.address_info,o.mobile,o.zip_code,o.zip_code,o.money_logistics,o.money_product-o.money_order+o.money_logistics AS couponMoney,
156 o.money_order,o.money_product,o.pay_time,o.member_name FROM orders o 157 o.money_order,o.money_product,o.pay_time,o.member_name FROM orders o
157 LEFT JOIN regions p ON p.id = o.province_id 158 LEFT JOIN regions p ON p.id = o.province_id
158 LEFT JOIN regions c ON c.id = o.city_id 159 LEFT JOIN regions c ON c.id = o.city_id
...@@ -225,6 +226,8 @@ ...@@ -225,6 +226,8 @@
225 <result property="moneyPrice" column="money_price" /> 226 <result property="moneyPrice" column="money_price" />
226 <result property="number" column="number" /> 227 <result property="number" column="number" />
227 <result property="moneyAmount" column="money_amount" /> 228 <result property="moneyAmount" column="money_amount" />
229 <result property="moneyFullAoumt" column="money_full_amount" />
230 <result property="deductionProductVbMoney" column="deduction_product_vb_money" />
228 <result property="moneyActSingle" column="money_act_single" /> 231 <result property="moneyActSingle" column="money_act_single" />
229 <result property="actSingleId" column="act_single_id" /> 232 <result property="actSingleId" column="act_single_id" />
230 <result property="actGroupId" column="act_group_id" /> 233 <result property="actGroupId" column="act_group_id" />
...@@ -240,12 +243,13 @@ ...@@ -240,12 +243,13 @@
240 <result property="createTime" column="create_time" /> 243 <result property="createTime" column="create_time" />
241 <result property="updateTime" column="update_time" /> 244 <result property="updateTime" column="update_time" />
242 <result property="isEvaluate" column="is_evaluate" /> 245 <result property="isEvaluate" column="is_evaluate" />
246 <result property="moneyCouponAmount" column="money_coupon_amount" />
243 </resultMap> 247 </resultMap>
244 248
245 249
246 <!-- 查询子订单--> 250 <!-- 查询子订单-->
247 <select id="getOrdersProductList" resultType="java.lang.String" resultMap="ordersProduct"> 251 <select id="getOrdersProductList" parameterType="java.lang.String" resultMap="ordersProduct">
248 SELECT product_sku,id,product_name,spec_info,number,money_price,money_act_single FROM orders_product 252 SELECT product_sku,id,product_name,spec_info,number,money_price,money_act_single,money_coupon_amount,money_full_amount FROM orders_product
249 WHERE orders_sn = #{orderSn} 253 WHERE orders_sn = #{orderSn}
250 </select> 254 </select>
251 255
......
...@@ -74,6 +74,8 @@ public class Orders implements Serializable{ ...@@ -74,6 +74,8 @@ public class Orders implements Serializable{
74 private String regionName1; 74 private String regionName1;
75 private String regionName2; 75 private String regionName2;
76 private String regionName3; 76 private String regionName3;
77 private BigDecimal deductionVbMoney;
78 private BigDecimal couponMoney;
77 79
78 private List<OrdersProduct> goodinfos; 80 private List<OrdersProduct> goodinfos;
79 81
......
...@@ -43,6 +43,10 @@ public class OrdersProduct { ...@@ -43,6 +43,10 @@ public class OrdersProduct {
43 private Date createTime; 43 private Date createTime;
44 private Date updateTime; 44 private Date updateTime;
45 private Integer isEvaluate; 45 private Integer isEvaluate;
46 private BigDecimal moneyFullAoumt;
47 private BigDecimal moneyCouponAmount;
48 private BigDecimal deductionProductVbMoney;
49
46 50
47 51
48 } 52 }
......
...@@ -123,24 +123,24 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> ...@@ -123,24 +123,24 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
123 private OrderResponse getOrderResponse(Orders orders){ 123 private OrderResponse getOrderResponse(Orders orders){
124 OrderStatusEnum orderStatusEnum = this.convertAndCheckOrderStatusEnum(orders); 124 OrderStatusEnum orderStatusEnum = this.convertAndCheckOrderStatusEnum(orders);
125 OrderResponse orderResponse = new OrderResponse(); 125 OrderResponse orderResponse = new OrderResponse();
126 orderResponse.setTradeStatus(orderStatusEnum.getCode()); 126 orderResponse.setTradeStatus(orderStatusEnum.getCode());//订单状态
127 orderResponse.setTradeStatusDescription(orderStatusEnum.getMsg()); 127 orderResponse.setTradeStatusDescription(orderStatusEnum.getMsg());
128 orderResponse.setPlatOrderNo(orders.getOrderSn()); 128 orderResponse.setPlatOrderNo(orders.getOrderSn());//订单号
129 orderResponse.setTradeStatusDescription(orders.getRemark()); 129 orderResponse.setTradeStatusDescription(orders.getRemark());//订单备注
130 orderResponse.setTradeTime(this.buildDefaultSimpleDateFormat().format(orders.getCreateTime())); 130 orderResponse.setTradeTime(this.buildDefaultSimpleDateFormat().format(orders.getCreateTime()));//交易时间
131 orderResponse.setCountry("中国"); 131 orderResponse.setProvince(orders.getRegionName1());//省
132 orderResponse.setProvince(orders.getRegionName1()); 132 orderResponse.setCity(orders.getRegionName2());//市
133 orderResponse.setCity(orders.getRegionName2()); 133 orderResponse.setArea(orders.getRegionName3());//区
134 orderResponse.setArea(orders.getRegionName3()); 134 orderResponse.setAddress(orders.getAddressInfo());//地址
135 orderResponse.setAddress(orders.getAddressInfo()); 135 orderResponse.setNick(orders.getMemberName());//买家昵称
136 orderResponse.setNick(orders.getMemberName()); 136 orderResponse.setPhone(orders.getMobile());//电话
137 orderResponse.setPhone(orders.getMobile());
138 orderResponse.setMobile(orders.getMobile()); 137 orderResponse.setMobile(orders.getMobile());
139 orderResponse.setPostFee(this.convertAndCheckFreight(orders.getMoneyLogistics())); 138 orderResponse.setPostFee(this.convertAndCheckFreight(orders.getMoneyLogistics()));//邮费
140 orderResponse.setGoodsFee(this.convertAndCheckFreight(orders.getMoneyProduct())); 139 orderResponse.setGoodsFee(this.convertAndCheckFreight(orders.getMoneyProduct()));//货款金额
141 orderResponse.setTotalMoney(this.convertAndCheckFreight(orders.getMoneyOrder())); 140 orderResponse.setTotalMoney(this.convertAndCheckFreight(orders.getMoneyOrder()));//支付金额
142 orderResponse.setPayTime(orders.getPayTime()==null?"":this.buildDefaultSimpleDateFormat().format(orders.getPayTime())); 141 orderResponse.setFavourableMoney(this.convertAndCheckFreight(orders.getCouponMoney()));//优惠金额
143 orderResponse.setShouldPayType("银行收款"); 142 orderResponse.setPayTime(orders.getPayTime()==null?"":this.buildDefaultSimpleDateFormat().format(orders.getPayTime()));//支付时间
143 orderResponse.setShouldPayType("银行收款");//结算方式
144 orderResponse.setTown(""); 144 orderResponse.setTown("");
145 orderResponse.setTaxAmount(""); 145 orderResponse.setTaxAmount("");
146 orderResponse.setCommissionValue(""); 146 orderResponse.setCommissionValue("");
...@@ -161,6 +161,7 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> ...@@ -161,6 +161,7 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
161 return orderResponse; 161 return orderResponse;
162 } 162 }
163 163
164
164 /** 165 /**
165 * 子订单数据 166 * 子订单数据
166 * @param ordersProduct 167 * @param ordersProduct
...@@ -168,14 +169,14 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> ...@@ -168,14 +169,14 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
168 */ 169 */
169 private OrderGoodResponse getOrderGoodResponse(OrdersProduct ordersProduct){ 170 private OrderGoodResponse getOrderGoodResponse(OrdersProduct ordersProduct){
170 OrderGoodResponse orderGoodResponse = new OrderGoodResponse(); 171 OrderGoodResponse orderGoodResponse = new OrderGoodResponse();
171 orderGoodResponse.setProductId(ordersProduct.getProductSku()); 172 orderGoodResponse.setProductId(ordersProduct.getProductSku());//平台商品ID或SKUID(SKUID优先)
172 orderGoodResponse.setSubOrderNo(String.valueOf(ordersProduct.getId())); 173 orderGoodResponse.setSubOrderNo(String.valueOf(ordersProduct.getId()));//子订单号(若需要支持拆单发货,则必填)
173 orderGoodResponse.setTradeGoodsNo(ordersProduct.getProductSku()); 174 orderGoodResponse.setTradeGoodsNo(ordersProduct.getProductSku());//外部商家编码或外部SKU编码(SKU编码优先)。注意,如果要与管家对接,这里一般返回管家的商品编码,作为平台的外部商家编码,与管家商品映射
174 orderGoodResponse.setTradeGoodsName(ordersProduct.getProductName()); 175 orderGoodResponse.setTradeGoodsName(ordersProduct.getProductName());//商品交易名称
175 orderGoodResponse.setTradeGoodsSpec(ordersProduct.getSpecInfo()); 176 orderGoodResponse.setTradeGoodsSpec(ordersProduct.getSpecInfo());//商品交易规格
176 orderGoodResponse.setGoodsCount(String.valueOf(ordersProduct.getNumber())); 177 orderGoodResponse.setGoodsCount(String.valueOf(ordersProduct.getNumber()));//商品数量
177 orderGoodResponse.setPrice(this.convertAndCheckFreight(ordersProduct.getMoneyPrice())); 178 orderGoodResponse.setPrice(this.convertAndCheckFreight(ordersProduct.getMoneyPrice()));//单价
178 orderGoodResponse.setDiscountMoney(this.convertAndCheckFreight(ordersProduct.getMoneyActSingle())); 179 orderGoodResponse.setDiscountMoney(this.convertAndCheckFreight(getOrdersProductDiscountMoney(ordersProduct)));//子订单优惠金额
179 orderGoodResponse.setTaxAmount(""); 180 orderGoodResponse.setTaxAmount("");
180 orderGoodResponse.setRefundStatus(""); 181 orderGoodResponse.setRefundStatus("");
181 orderGoodResponse.setStatus(""); 182 orderGoodResponse.setStatus("");
...@@ -183,6 +184,19 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> ...@@ -183,6 +184,19 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
183 return orderGoodResponse; 184 return orderGoodResponse;
184 } 185 }
185 186
187 private BigDecimal getOrdersProductDiscountMoney(OrdersProduct ordersProduct){
188 BigDecimal moneyActSingle = ordersProduct.getMoneyActSingle() ==null? BigDecimal.ZERO : ordersProduct.getMoneyActSingle();//立减优惠金额
189 BigDecimal moneyFullAmount = ordersProduct.getMoneyFullAoumt() ==null? BigDecimal.ZERO:ordersProduct.getMoneyFullAoumt();//网单满减金额和
190 BigDecimal moneyCouponAmount = ordersProduct.getMoneyCouponAmount() ==null?BigDecimal.ZERO:ordersProduct.getMoneyCouponAmount();//网单优惠券优惠金额和
191 BigDecimal deductionProductVbMoney = ordersProduct.getDeductionProductVbMoney() ==null?BigDecimal.ZERO:ordersProduct.getDeductionProductVbMoney();
192 BigDecimal sumDiscountMoney =BigDecimal.ZERO;
193 sumDiscountMoney = sumDiscountMoney.add(moneyActSingle);
194 sumDiscountMoney = sumDiscountMoney.add(moneyFullAmount);
195 sumDiscountMoney = sumDiscountMoney.add(moneyCouponAmount);
196 sumDiscountMoney = sumDiscountMoney.add(deductionProductVbMoney);
197 return sumDiscountMoney;
198 }
199
186 200
187 private OrderStatusEnum convertAndCheckOrderStatusEnum(Orders orders) { 201 private OrderStatusEnum convertAndCheckOrderStatusEnum(Orders orders) {
188 OrderStatusEnum orderStatusEnum = OrderStatusEnum.resolveByPlatformOrderStatus(orders.getOrderState()); 202 OrderStatusEnum orderStatusEnum = OrderStatusEnum.resolveByPlatformOrderStatus(orders.getOrderState());
......