This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-06-01 13:48:36 +08:00
parent 6400095500
commit 2bb9d1ee0a
3 changed files with 15 additions and 3 deletions

View File

@ -2,6 +2,8 @@ package com.ghy.web.controller.order;
import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.enums.OrderStatus;
import com.ghy.common.enums.PayStatus;
import com.ghy.common.utils.StringUtils;
import com.ghy.customer.domain.Customer;
import com.ghy.customer.service.CustomerService;
@ -180,6 +182,8 @@ public class OrderController extends BaseController {
Set<Long> goodsStandardIds = appGoodsList.stream().map(AppGoodsRequest::getGoodsStandardId).collect(Collectors.toSet());
// 所有商品
List<GoodsStandard> goodsList = goodsStandardService.selectByIds(goodsStandardIds);
// 商品所属师傅
Goods goods = goodsService.selectById(goodsList.get(0).getGoodsId());
// 商户ID
Long deptId = appOrderRequest.getDeptId();
Assert.notNull(deptId, "deptId is null!");
@ -189,10 +193,12 @@ public class OrderController extends BaseController {
orderMaster.setDeptId(deptId);
orderMaster.setCode(orderMasterService.createOrderCode());
orderMaster.setOrderType(1);
orderMaster.setOrderStatus(0);
orderMaster.setPayType(appOrderRequest.getPayType());
orderMaster.setOrderStatus(OrderStatus.PLAIN.getCode());
orderMaster.setCustomerId(appOrderRequest.getCustomerId());
orderMaster.setPayStatus(0);
orderMaster.setPayStatus(PayStatus.WAIT_PAY.getCode());
orderMaster.setCreateTime(new Date());
orderMaster.setWorkerId(goods.getWorkerId());
orderMasterService.insertOrderMaster(orderMaster);
Assert.notNull(orderMaster.getId(), "OrderMaster.id is null!");

View File

@ -33,6 +33,9 @@ public class Goods extends BaseEntity {
@Excel(name = "商品排序", cellType = Excel.ColumnType.NUMERIC)
private Integer goodsSort;
@Excel(name = "归属师傅", cellType = Excel.ColumnType.NUMERIC)
private Long workerId;
@Excel(name = "类别id,必须是关联到系统的第三级目录")
private Long deptGoodsCategoryId;

View File

@ -9,6 +9,7 @@
<result property="deptId" column="dept_id" />
<result property="goodsName" column="goods_name" />
<result property="goodsSort" column="goods_sort"/>
<result property="workerId" column="worker_id"/>
<result property="deptGoodsCategoryId" column="dept_goods_category_id"/>
<result property="goodsImgUrl" column="goods_img_url"/>
<result property="goodsVideoUrl" column="goods_video_url"/>
@ -21,7 +22,7 @@
</resultMap>
<sql id="selectGoods">
SELECT goods_id, goods_code, dept_id, goods_name, goods_sort,
SELECT goods_id, goods_code, dept_id, goods_name, goods_sort, worker_id,
dept_goods_category_id, goods_img_url, goods_video_url, status, create_by, create_time, remark
FROM goods
</sql>
@ -54,6 +55,7 @@
<if test="deptId != null and deptId != ''">dept_id,</if>
<if test="goodsName != null and goodsName != ''">goods_name,</if>
<if test="goodsSort != null and goodsSort != ''">goods_sort,</if>
<if test="workerId != null and workerId != ''">worker_id,</if>
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">dept_goods_category_id,</if>
<if test="goodsImgUrl != null and goodsImgUrl != ''">goods_img_url,</if>
<if test="goodsVideoUrl != null and goodsVideoUrl != ''">goods_video_url,</if>
@ -66,6 +68,7 @@
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
<if test="goodsSort != null and goodsSort != ''">#{goodsSort},</if>
<if test="workerId != null and workerId != ''">#{workerId},</if>
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">#{deptGoodsCategoryId},</if>
<if test="goodsImgUrl != null and goodsImgUrl != ''">#{goodsImgUrl},</if>
<if test="goodsVideoUrl != null and goodsVideoUrl != ''">#{goodsVideoUrl},</if>