Authored by chenchao

fix appraise order

@@ -15,7 +15,7 @@ public interface AppraiseOrderGoodsMapper { @@ -15,7 +15,7 @@ public interface AppraiseOrderGoodsMapper {
15 15
16 List<AppraiseOrderGoods> selectByOrderCode(Long orderCode); 16 List<AppraiseOrderGoods> selectByOrderCode(Long orderCode);
17 17
18 - int updateByPrimaryKeySelective(AppraiseOrderGoods record); 18 + int updateDepotNo(AppraiseOrderGoods record);
19 19
20 int updateByPrimaryKey(AppraiseOrderGoods record); 20 int updateByPrimaryKey(AppraiseOrderGoods record);
21 21
@@ -52,33 +52,14 @@ @@ -52,33 +52,14 @@
52 52
53 53
54 54
55 - <update id="updateByPrimaryKeySelective" parameterType="com.yohoufo.dal.order.model.AppraiseOrderGoods"> 55 + <update id="updateDepotNo" parameterType="com.yohoufo.dal.order.model.AppraiseOrderGoods">
56 update appraise_order_goods 56 update appraise_order_goods
57 <set> 57 <set>
58 - <if test="orderCode != null">  
59 - order_code = #{orderCode,jdbcType=BIGINT},  
60 - </if>  
61 - <if test="productId != null">  
62 - product_id = #{productId,jdbcType=INTEGER},  
63 - </if>  
64 - <if test="productName != null">  
65 - product_name = #{productName,jdbcType=VARCHAR},  
66 - </if>  
67 - <if test="productCode != null">  
68 - product_code = #{productCode,jdbcType=VARCHAR},  
69 - </if>  
70 - <if test="imageUrl != null">  
71 - image_url = #{imageUrl,jdbcType=VARCHAR},  
72 - </if>  
73 - <if test="depotNo != null">  
74 - depot_no = #{depotNo,jdbcType=INTEGER},  
75 - </if>  
76 - <if test="num != null">  
77 - num = #{num,jdbcType=INTEGER},  
78 - </if> 58 + depot_no = #{depotNo,jdbcType=INTEGER}
79 </set> 59 </set>
80 - where id = #{id,jdbcType=INTEGER} 60 + where order_code = #{orderCode,jdbcType=BIGINT}
81 </update> 61 </update>
  62 +
82 <update id="updateByPrimaryKey" parameterType="com.yohoufo.dal.order.model.AppraiseOrderGoods"> 63 <update id="updateByPrimaryKey" parameterType="com.yohoufo.dal.order.model.AppraiseOrderGoods">
83 update appraise_order_goods 64 update appraise_order_goods
84 set order_code = #{orderCode,jdbcType=BIGINT}, 65 set order_code = #{orderCode,jdbcType=BIGINT},
@@ -3,7 +3,9 @@ package com.yohoufo.order.service.impl; @@ -3,7 +3,9 @@ package com.yohoufo.order.service.impl;
3 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus; 3 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
4 import com.yohobuy.ufo.model.order.req.DeliverToDepotReq; 4 import com.yohobuy.ufo.model.order.req.DeliverToDepotReq;
5 import com.yohoufo.common.utils.DateUtil; 5 import com.yohoufo.common.utils.DateUtil;
  6 +import com.yohoufo.dal.order.AppraiseOrderGoodsMapper;
6 import com.yohoufo.dal.order.AppraiseOrderMapper; 7 import com.yohoufo.dal.order.AppraiseOrderMapper;
  8 +import com.yohoufo.dal.order.model.AppraiseOrderGoods;
7 import com.yohoufo.order.service.IGoodsService; 9 import com.yohoufo.order.service.IGoodsService;
8 import com.yohoufo.order.service.proxy.OrderStatusFlowService; 10 import com.yohoufo.order.service.proxy.OrderStatusFlowService;
9 import com.yohoufo.order.utils.LoggerUtils; 11 import com.yohoufo.order.utils.LoggerUtils;
@@ -18,6 +20,9 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService { @@ -18,6 +20,9 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
18 @Autowired 20 @Autowired
19 private OrderStatusFlowService orderStatusFlowService; 21 private OrderStatusFlowService orderStatusFlowService;
20 22
  23 + @Autowired
  24 + private AppraiseOrderGoodsMapper appraiseOrderGoodsMapper;
  25 +
21 @Override 26 @Override
22 public int deliver2Depot(DeliverToDepotReq req){ 27 public int deliver2Depot(DeliverToDepotReq req){
23 Long orderCode = req.getOrderCode(); 28 Long orderCode = req.getOrderCode();
@@ -25,7 +30,14 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService { @@ -25,7 +30,14 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
25 expectedStatus = AppraiseOrderStatus.HAS_PAYED; 30 expectedStatus = AppraiseOrderStatus.HAS_PAYED;
26 31
27 int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus); 32 int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus);
28 - logger.info("appraise order deliver2Depot update status, orderCode {} rows {}", orderCode, rows); 33 + logger.info("appraise order deliver2Depot update status, req {} rows {}", req, rows);
  34 + if (rows>0){
  35 + AppraiseOrderGoods aogc = new AppraiseOrderGoods();
  36 + aogc.setOrderCode(orderCode);
  37 + aogc.setDepotNo(req.getDepotNum());
  38 + int depotPrdCnt = appraiseOrderGoodsMapper.updateDepotNo(aogc);
  39 + logger.info("appraise order deliver2Depot update status, req {} depotPrdCnt {}", req, depotPrdCnt);
  40 + }
29 return rows; 41 return rows;
30 } 42 }
31 43
@@ -54,6 +66,15 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService { @@ -54,6 +66,15 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
54 return rows; 66 return rows;
55 } 67 }
56 68
  69 + public int platformChecking(long orderCode){
  70 + AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_CHECKING,
  71 + expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
  72 +
  73 + int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus);
  74 + logger.info("appraise order platformChecking update status, orderCode {} rows {}", orderCode, rows);
  75 + return rows;
  76 + }
  77 +
57 /** 78 /**
58 * 鉴定通过 79 * 鉴定通过
59 * @param orderCode 80 * @param orderCode
@@ -61,7 +82,7 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService { @@ -61,7 +82,7 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
61 @Override 82 @Override
62 public int appraisePass(long orderCode){ 83 public int appraisePass(long orderCode){
63 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.JUDGE_PASS, 84 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.JUDGE_PASS,
64 - expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE; 85 + expectedStatus = AppraiseOrderStatus.PLATFORM_CHECKING;
65 86
66 int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus); 87 int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus);
67 logger.info("appraise order appraisePass update status, orderCode {} rows {}", orderCode, rows); 88 logger.info("appraise order appraisePass update status, orderCode {} rows {}", orderCode, rows);
@@ -199,7 +199,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -199,7 +199,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
199 */ 199 */
200 @Override 200 @Override
201 public int platformReceiveGoods(long orderCode){ 201 public int platformReceiveGoods(long orderCode){
202 - return 0; 202 + int rows = super.platformReceiveGoods(orderCode);
  203 + return rows;
203 } 204 }
204 205
205 /** 206 /**
@@ -208,7 +209,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -208,7 +209,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
208 */ 209 */
209 @Override 210 @Override
210 public int appraisePass(long orderCode){ 211 public int appraisePass(long orderCode){
211 - return 0; 212 + int rows = super.appraisePass(orderCode);
  213 + return rows;
212 } 214 }
213 215
214 /** 216 /**
@@ -217,7 +219,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -217,7 +219,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
217 */ 219 */
218 @Override 220 @Override
219 public int appraiseFake(long orderCode){ 221 public int appraiseFake(long orderCode){
220 - return 0; 222 + int rows = super.appraiseFake(orderCode);
  223 + return rows;
221 } 224 }
222 225
223 /** 226 /**
@@ -226,6 +229,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -226,6 +229,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
226 */ 229 */
227 @Override 230 @Override
228 public int unsure(long orderCode){ 231 public int unsure(long orderCode){
229 - return 0; 232 + int rows = super.unsure(orderCode);
  233 + return rows;
230 } 234 }
231 } 235 }