eb01643e lauka

菠萝派接口修改订单备注,统一使用writeDao,防止数据不一致

1 个父辈 cd8dab59
1 package com.sibu.orderHelper.mall.member.write; 1 package com.sibu.orderHelper.mall.member.write;
2 2
3 import com.sibu.orderHelper.integral.pineapple.model.Orders;
4
3 import java.util.Map; 5 import java.util.Map;
4 6
5 public interface MemberWriteDao { 7 public interface MemberWriteDao {
6 Integer count(); 8 Integer count();
7 9
8 /** 10 /**
11 * 根据订单号查询订单信息 只查询不是主订单的订单
12 * @param params
13 * @return
14 */
15 Orders getOrdersByMap(Map<String,Object> params);
16
17
18 /**
9 * 修改订单备注 19 * 修改订单备注
10 * @param params 20 * @param params
11 * @return 21 * @return
......
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
8 select count(*) from member 8 select count(*) from member
9 </select> 9 </select>
10 10
11 <!-- 根据订单号查询订单信息 只查询不是主订单的订单 -->
12 <select id="getOrdersByMap" parameterType="java.util.Map" resultMap="orders">
13 select * from orders where order_sn=#{orderSn,jdbcType=VARCHAR} AND seller_id=#{sellerId,jdbcType=INTEGER} AND is_parent = 0
14 </select>
15
11 <!-- 修改订单备注 --> 16 <!-- 修改订单备注 -->
12 <update id="updateOdersRemark" parameterType="java.util.Map"> 17 <update id="updateOdersRemark" parameterType="java.util.Map">
13 UPDATE orders SET remark = #{remark},update_time = now() WHERE order_sn = #{orderSn} AND seller_id = #{sellerId} 18 UPDATE orders SET remark = #{remark},update_time = now() WHERE order_sn = #{orderSn} AND seller_id = #{sellerId}
......
...@@ -27,9 +27,6 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS ...@@ -27,9 +27,6 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS
27 27
28 private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class); 28 private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class);
29 29
30
31 @Resource
32 private MemberReadDao memberReadDao;
33 @Resource 30 @Resource
34 private MemberWriteDao memberWriteDao; 31 private MemberWriteDao memberWriteDao;
35 32
...@@ -40,7 +37,7 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS ...@@ -40,7 +37,7 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS
40 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); 37 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
41 params.put("remark",callRequest.getBizModel().getSellerMemo()); 38 params.put("remark",callRequest.getBizModel().getSellerMemo());
42 params.put("sellerId",callRequest.getSupplier().getId()); 39 params.put("sellerId",callRequest.getSupplier().getId());
43 Orders orders = memberReadDao.getOrdersByMap(params); 40 Orders orders = memberWriteDao.getOrdersByMap(params);
44 if(StringUtil.isNull(orders)){ 41 if(StringUtil.isNull(orders)){
45 log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 42 log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
46 throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 43 throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
......