Authored by mali

Merge branch 'gray' into test6.9.7

... ... @@ -9,5 +9,5 @@ import java.util.List;
*/
public interface OrderCouponMapper {
OrderCoupon selectByOrderCode(@Param("orderCode") long orderCode);
List<OrderCoupon> selectByOrderCode(@Param("orderCode") long orderCode);
}
... ...
... ... @@ -17,6 +17,5 @@
<include refid="Base_Column_List"/>
from order_coupon
where order_code = #{orderCode,jdbcType=BIGINT}
limit 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ public enum TradeStatusEnum {
fail_200_fail(200,"打款失败"),
fail_201_no_alipayAccount(201,"没有支付宝账号"),
fail_202_invalid_money(202,"金额不合法"),
fail_203_wait_payment(203,"海外卖家待付款"),
fail_299_transfer_failure(299,"转账失败");
private Integer code;
private String desc;
... ...
... ... @@ -217,6 +217,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
private static final String SELLER_ORDER_META_KEY_FEE = "fee";
private static final String ORDER_CONFIG_INNER_BUYER_FOR_OFFLINE = "inner_buyer_for_offline";
private static final String ORDER_CONFIG_INNER_BUYER_FOR_AMMOUNT = "amount_detail"; // 优惠详情
private static final Integer EXPRESS_TYPE_SELLER_TO_JUDGE = EnumExpressType.EXPRESS_TYPE_1.getCode();
... ... @@ -1715,10 +1717,25 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setPlatformWaybillCode(judgeExpressRecord.getWaybillCode());
}
resp.setCouponCode(Optional.ofNullable(Long.valueOf(buyerOrder.getOrderCode())).map(orderCouponMapper::selectByOrderCode).map(OrderCoupon::getCouponCode).orElse(null));
completeAmountInfo(resp, orderCode); // 补充优惠券的信息
return resp;
}
private void completeAmountInfo(OrderDetailResp resp, String orderCode) {
BuyerOrderMeta buyerMeta = buyerOrderMetaMapper.selectByOrderCodeAndKey(orderCode, ORDER_CONFIG_INNER_BUYER_FOR_AMMOUNT);
if (null == buyerMeta) {
return;
}
JSONObject metaValue = JSONObject.parseObject(buyerMeta.getMetaValue());
resp.setShipFee(String.format("%.2f", metaValue.getDoubleValue("shippingAmount")));// 运费
resp.setCouponCutAmount(String.format("%.2f", metaValue.getDoubleValue("couponCutAmount") + metaValue.getDoubleValue("shippingCouponCutAmount")));
List<OrderCoupon> orderCoupons = orderCouponMapper.selectByOrderCode(Long.valueOf(orderCode));
resp.setCouponCodeList(orderCoupons.stream().map(OrderCoupon::getCouponCode).collect(Collectors.toList()));
}
@Override
public QcOrderDetailResp getQcOrderDetail(String orderCode) {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
... ...
... ... @@ -75,7 +75,7 @@
<div id="markPaidConfirmDialog" class="easyui-dialog" style="width:400px;height:300px;"
data-options="title:'确定完成打款?',buttons:'#markPaidConfirmDialog_tb',modal:true,closed:true">
data-options="title:'确定财务已经完成打款?',buttons:'#markPaidConfirmDialog_tb',modal:true,closed:true">
<div style="padding:20px;">
<input id="mark_paid_tradeBillsId" type="hidden" />
<input id="mark_paid_uid" type="hidden" />
... ...
... ... @@ -510,8 +510,14 @@ function getOrderInfo(orderCode){
$("#colorName").html(result.data.colorName);
$("#sizeName").html(result.data.sizeName);
$("#goodsPrice").html(result.data.goodsPrice);
if (result.data.couponCode) {
$("#couponCutAmount").html(result.data.couponCutAmount + '<br/>(券号:'+ result.data.couponCode + ')');
if (result.data.couponCodeList) {
var codeListStr = '';
for(var item in result.data.couponCodeList) {
codeListStr += '<br/>(券号:'+ result.data.couponCodeList[item] + ')';
}
$("#couponCutAmount").html(result.data.couponCutAmount + codeListStr);
} else {
$("#couponCutAmount").html(result.data.couponCutAmount);
}
... ...