eb01643e lauka

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

1 个父辈 cd8dab59
package com.sibu.orderHelper.mall.member.write;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import java.util.Map;
public interface MemberWriteDao {
Integer count();
/**
* 根据订单号查询订单信息 只查询不是主订单的订单
* @param params
* @return
*/
Orders getOrdersByMap(Map<String,Object> params);
/**
* 修改订单备注
* @param params
* @return
......
......@@ -8,6 +8,11 @@
select count(*) from member
</select>
<!-- 根据订单号查询订单信息 只查询不是主订单的订单 -->
<select id="getOrdersByMap" parameterType="java.util.Map" resultMap="orders">
select * from orders where order_sn=#{orderSn,jdbcType=VARCHAR} AND seller_id=#{sellerId,jdbcType=INTEGER} AND is_parent = 0
</select>
<!-- 修改订单备注 -->
<update id="updateOdersRemark" parameterType="java.util.Map">
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
private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class);
@Resource
private MemberReadDao memberReadDao;
@Resource
private MemberWriteDao memberWriteDao;
......@@ -40,7 +37,7 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS
params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
params.put("remark",callRequest.getBizModel().getSellerMemo());
params.put("sellerId",callRequest.getSupplier().getId());
Orders orders = memberReadDao.getOrdersByMap(params);
Orders orders = memberWriteDao.getOrdersByMap(params);
if(StringUtil.isNull(orders)){
log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
......