Authored by mali

Merge branch 'dev'

@@ -73,8 +73,8 @@ public class ExpressInfoController { @@ -73,8 +73,8 @@ public class ExpressInfoController {
73 * @return 73 * @return
74 */ 74 */
75 @RequestMapping(params = "method=ufo.order.expressDetailInfo") 75 @RequestMapping(params = "method=ufo.order.expressDetailInfo")
76 - public ApiResponse queryExpressDetailInfo(@RequestParam("uid") Integer uid,@RequestParam("orderCode") Long orderCode) {  
77 - ExpressInfoRespBo expressInfoRespBo = expressInfoService.queryExpressDetailInfo(uid,orderCode); 76 + public ApiResponse queryExpressDetailInfo(@RequestParam("orderCode") Long orderCode) {
  77 + ExpressInfoRespBo expressInfoRespBo = expressInfoService.queryExpressDetailInfo(orderCode);
78 return new ApiResponse.ApiResponseBuilder().code(200).data(expressInfoRespBo).build(); 78 return new ApiResponse.ApiResponseBuilder().code(200).data(expressInfoRespBo).build();
79 } 79 }
80 } 80 }
@@ -42,7 +42,7 @@ public interface IExpressInfoService { @@ -42,7 +42,7 @@ public interface IExpressInfoService {
42 * @param orderCode 42 * @param orderCode
43 * @return 43 * @return
44 */ 44 */
45 - ExpressInfoRespBo queryExpressDetailInfo(Integer uid,Long orderCode); 45 + ExpressInfoRespBo queryExpressDetailInfo(Long orderCode);
46 46
47 47
48 /** 48 /**
@@ -68,23 +68,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -68,23 +68,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
68 public void deliverToDepot(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode) { 68 public void deliverToDepot(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode) {
69 LOGGER.info("deliverToDepot uid={} ,expressCompanyId = {}, orderCode = {}, wayBillCode = {}", new Object[]{uid ,expressCompanyId, orderCode, wayBillCode}); 69 LOGGER.info("deliverToDepot uid={} ,expressCompanyId = {}, orderCode = {}, wayBillCode = {}", new Object[]{uid ,expressCompanyId, orderCode, wayBillCode});
70 70
71 - //保存物流信息+更新订单状态  
72 - saveExpressAndUpdateBuyerOrderStatus(uid,expressCompanyId,orderCode,wayBillCode,ExpressInfoConstant.EXPRESS_TYPE_1,OrderStatus.SELLER_SEND_OUT); 71 + //保存物流信息+更新订单状态;
  72 + //本阶段的物流类型和订单状态
  73 + Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_1;
  74 + OrderStatus orderStatus=OrderStatus.SELLER_SEND_OUT;
73 75
74 - // 发送mq获取物流信息  
75 - sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode);  
76 - LOGGER.info("deliverToDepot end ! send express to erp ");  
77 - }  
78 -  
79 - /**  
80 - * 保存物流信息  
81 - * 更新订单状态  
82 - * @param uid  
83 - * @param expressCompanyId  
84 - * @param orderCode  
85 - * @param wayBillCode  
86 - */  
87 - private void saveExpressAndUpdateBuyerOrderStatus(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer expressType,OrderStatus orderStatus){  
88 LOGGER.info("deliverToDepot saveExpressAndUpdateBuyerOrderStatus uid={} ,expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + 76 LOGGER.info("deliverToDepot saveExpressAndUpdateBuyerOrderStatus uid={} ,expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
89 ",expressType = {} ,orderStatus = {}", new Object[]{uid ,expressCompanyId, orderCode, wayBillCode,expressType,orderStatus}); 77 ",expressType = {} ,orderStatus = {}", new Object[]{uid ,expressCompanyId, orderCode, wayBillCode,expressType,orderStatus});
90 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode); 78 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
@@ -94,6 +82,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -94,6 +82,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
94 throw new ServiceException(ServiceError.ORDER_NULL); 82 throw new ServiceException(ServiceError.ORDER_NULL);
95 } 83 }
96 84
  85 + if(uid!=buyerOrder.getUid()){
  86 + LOGGER.warn("deliverToDepot saveExpressAndUpdateBuyerOrderStatus uid {} not equal buyer order uid {}",uid, buyerOrder.getUid());
  87 + throw new ServiceException(ServiceError.ORDER_NULL);
  88 + }
  89 +
97 // 保存订单物流信息 90 // 保存订单物流信息
98 int ts=DateUtil.getCurrentTimeSecond(); 91 int ts=DateUtil.getCurrentTimeSecond();
99 ExpressInfo expressInfo=new ExpressInfo(); 92 ExpressInfo expressInfo=new ExpressInfo();
@@ -112,6 +105,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -112,6 +105,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
112 buyerOrder.setUpdateTime(ts); 105 buyerOrder.setUpdateTime(ts);
113 LOGGER.info("deliverToDepot update buyer order {} ", buyerOrder); 106 LOGGER.info("deliverToDepot update buyer order {} ", buyerOrder);
114 buyerOrderMapper.updateByPrimaryKeySelective(buyerOrder); 107 buyerOrderMapper.updateByPrimaryKeySelective(buyerOrder);
  108 +
  109 + // 发送mq获取物流信息
  110 + sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode);
  111 + LOGGER.info("deliverToDepot end ! send express to erp ");
115 } 112 }
116 113
117 @Override 114 @Override
@@ -151,8 +148,16 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -151,8 +148,16 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
151 * @return 148 * @return
152 */ 149 */
153 @Override 150 @Override
154 - public ExpressInfoRespBo queryExpressDetailInfo(Integer uid,Long orderCode) { 151 + public ExpressInfoRespBo queryExpressDetailInfo(Long orderCode) {
155 LOGGER.info("queryExpressDetailInfo orderCode = {}", orderCode); 152 LOGGER.info("queryExpressDetailInfo orderCode = {}", orderCode);
  153 + BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
  154 +
  155 + if (buyerOrder == null){
  156 + LOGGER.warn("getOrderInfo order not exist, orderCode is {}", orderCode);
  157 + throw new ServiceException(ServiceError.ORDER_NULL);
  158 + }
  159 +
  160 + Integer uid=buyerOrder.getUid();
156 ExpressInfoRespBo expressInfoRespBo = new ExpressInfoRespBo(); 161 ExpressInfoRespBo expressInfoRespBo = new ExpressInfoRespBo();
157 Integer expressType = getExpressType(orderCode); 162 Integer expressType = getExpressType(orderCode);
158 LOGGER.info("getExpressType result = {}", expressType); 163 LOGGER.info("getExpressType result = {}", expressType);
No preview for this file type
This diff could not be displayed because it is too large.
@@ -58,11 +58,11 @@ a { @@ -58,11 +58,11 @@ a {
58 58
59 .goods-detail-page .swiper-container { 59 .goods-detail-page .swiper-container {
60 width: 18.75rem; 60 width: 18.75rem;
61 - height: 18.75rem;  
62 } 61 }
63 62
64 .goods-detail-page .swiper-container img { 63 .goods-detail-page .swiper-container img {
65 width: 100%; 64 width: 100%;
  65 + height: 18.75rem;
66 } 66 }
67 67
68 .goods-detail-page .goods-title { 68 .goods-detail-page .goods-title {
@@ -99,21 +99,25 @@ @@ -99,21 +99,25 @@
99 $('title').html(data.product_name || '商品详情'); 99 $('title').html(data.product_name || '商品详情');
100 100
101 goodsList.image_list.map(function(item) { 101 goodsList.image_list.map(function(item) {
102 - $('.swiper-wrapper').append('<div class="swiper-slide"><img src="' + item.image_url + '"></div>'); 102 + if(item.image_url) {
  103 + $('.swiper-wrapper').append('<div class="swiper-slide"><img src="' + item.image_url + '"></div>');
  104 + }
103 }); 105 });
104 106
105 - new Swiper('.swiper-container', {  
106 - autoplay: true,  
107 - pagination: {  
108 - el: '.swiper-pagination',  
109 - type: 'fraction',  
110 - renderFraction: function (currentClass, totalClass) {  
111 - return '<span class="' + currentClass + '"></span>' +  
112 - '|' +  
113 - '<span class="' + totalClass + '"></span>'; 107 + if ($('.swiper-slide').length > 0) {
  108 + new Swiper('.swiper-container', {
  109 + autoplay: true,
  110 + pagination: {
  111 + el: '.swiper-pagination',
  112 + type: 'fraction',
  113 + renderFraction: function (currentClass, totalClass) {
  114 + return '<span class="' + currentClass + '"></span>' +
  115 + '|' +
  116 + '<span class="' + totalClass + '"></span>';
  117 + }
114 } 118 }
115 - }  
116 - }); 119 + });
  120 + }
117 } 121 }
118 }) 122 })
119 }); 123 });