师傅端派单接口bug修复

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-06-10 18:20:58 +08:00
parent 05d4c03cd6
commit d8cceb58ac
3 changed files with 7 additions and 1 deletions

View File

@ -142,9 +142,12 @@ public class OrderController extends BaseController {
// 批量生成订单商品 // 批量生成订单商品
request.getGoodsList().forEach(goods -> { request.getGoodsList().forEach(goods -> {
// 查询规格信息
GoodsStandard goodsStandard = goodsStandardService.selectById(goods.getGoodsStandardId());
OrderGoods orderGoods = new OrderGoods(); OrderGoods orderGoods = new OrderGoods();
orderGoods.setGoodsStandardId(goods.getGoodsStandardId()); orderGoods.setGoodsStandardId(goods.getGoodsStandardId());
orderGoods.setGoodsNum(goods.getNum()); orderGoods.setGoodsNum(goods.getNum());
orderGoods.setGoodsName(goodsStandard.getGoodsStandardName());
orderGoods.setOrderDetailId(od.getId()); orderGoods.setOrderDetailId(od.getId());
orderGoods.setServerGoodsNum(0); orderGoods.setServerGoodsNum(0);
orderGoodsService.insertOrderGoods(orderGoods); orderGoodsService.insertOrderGoods(orderGoods);

View File

@ -116,7 +116,7 @@
create_time create_time
)VALUES( )VALUES(
<if test="code != null and code != ''">#{code},</if> <if test="code != null and code != ''">#{code},</if>
<if test="orderMasterId != null and orderMasterId != 0">o#{orderMasterId},</if> <if test="orderMasterId != null and orderMasterId != 0">#{orderMasterId},</if>
<if test="orderMasterCode != null and orderMasterCode != ''">#{orderMasterCode},</if> <if test="orderMasterCode != null and orderMasterCode != ''">#{orderMasterCode},</if>
<if test="customerId != null and customerId != 0">#{customerId},</if> <if test="customerId != null and customerId != 0">#{customerId},</if>
<if test="orderType != null">#{orderType},</if> <if test="orderType != null">#{orderType},</if>

View File

@ -7,6 +7,7 @@
<resultMap id="OrderGoodsResult" type="com.ghy.order.domain.OrderGoods"> <resultMap id="OrderGoodsResult" type="com.ghy.order.domain.OrderGoods">
<id property="orderGoodsId" column="order_goods_id"/> <id property="orderGoodsId" column="order_goods_id"/>
<result property="orderId" column="order_id"/> <result property="orderId" column="order_id"/>
<result property="orderDetailId" column="order_detail_id"/>
<result property="goodsStandardId" column="goods_standard_id"/> <result property="goodsStandardId" column="goods_standard_id"/>
<result property="goodsName" column="goods_name"/> <result property="goodsName" column="goods_name"/>
<result property="goodsNum" column="goods_num"/> <result property="goodsNum" column="goods_num"/>
@ -44,6 +45,7 @@
keyProperty="orderGoodsId"> keyProperty="orderGoodsId">
INSERT INTO order_goods( INSERT INTO order_goods(
<if test="orderId != null and orderId != 0">order_id,</if> <if test="orderId != null and orderId != 0">order_id,</if>
<if test="orderDetailId != null and orderDetailId != 0">order_detail_id,</if>
<if test="goodsStandardId != null and goodsStandardId != 0">goods_standard_id,</if> <if test="goodsStandardId != null and goodsStandardId != 0">goods_standard_id,</if>
<if test="goodsName != null and goodsName != ''">goods_name,</if> <if test="goodsName != null and goodsName != ''">goods_name,</if>
<if test="goodsNum != null">goods_num,</if> <if test="goodsNum != null">goods_num,</if>
@ -53,6 +55,7 @@
create_time create_time
)VALUES( )VALUES(
<if test="orderId != null and orderId != 0">#{orderId},</if> <if test="orderId != null and orderId != 0">#{orderId},</if>
<if test="orderDetailId != null and orderDetailId != 0">#{orderDetailId},</if>
<if test="goodsStandardId != null and goodsStandardId != 0">#{goodsStandardId},</if> <if test="goodsStandardId != null and goodsStandardId != 0">#{goodsStandardId},</if>
<if test="goodsName != null and goodsName != ''">#{goodsName},</if> <if test="goodsName != null and goodsName != ''">#{goodsName},</if>
<if test="goodsNum != null">#{goodsNum},</if> <if test="goodsNum != null">#{goodsNum},</if>