商品模板支持虚拟商品

This commit is contained in:
lifenlong 2021-06-09 16:29:25 +08:00
parent a51e86fd98
commit cf4f9dd6bc
5 changed files with 15 additions and 12 deletions

View File

@ -151,4 +151,10 @@ public class DraftGoods extends BaseEntity {
@ApiModelProperty(value = "sku列表JSON")
private String skuListJson;
/**
* @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum
*/
@ApiModelProperty(value = "商品类型", required = true)
private String goodsType;
}

View File

@ -16,7 +16,6 @@ import cn.lili.modules.goods.service.GoodsGalleryService;
import cn.lili.modules.goods.service.GoodsSkuService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -70,7 +69,7 @@ public class DraftGoodsServiceImpl extends ServiceImpl<DraftGoodsMapper, DraftGo
draftGoods.setGoodsGalleryListJson(JSONUtil.toJsonStr(draftGoods.getGoodsGalleryList()));
draftGoods.setSkuListJson(JSONUtil.toJsonStr(this.getGoodsSkuList(draftGoods.getSkuList())));
draftGoods.setGoodsParamsListJson(JSONUtil.toJsonStr(draftGoods.getGoodsParamsList()));
this.saveOrUpdate(draftGoods);
this.save(draftGoods);
}
@Override

View File

@ -334,12 +334,12 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
//判断商品类型
switch (goods.getGoodsType()) {
case "PHYSICAL_GOODS":
if (goods.getTemplateId() == null) {
if (goods.getTemplateId().equals("0")) {
throw new ServiceException("实物商品需选择配送模板");
}
break;
case "VIRTUAL_GOODS":
if (goods.getTemplateId() != null) {
if (!goods.getTemplateId().equals("0")) {
throw new ServiceException("虚拟商品不需要选择配送模板");
}
break;

View File

@ -8,7 +8,6 @@ import cn.lili.modules.goods.entity.dos.GoodsSku;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
@ -225,6 +224,12 @@ public class EsGoodsIndex implements Serializable {
@Field(type = FieldType.Date, format = DateFormat.basic_date_time)
private Date releaseTime;
/**
* @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum
*/
@ApiModelProperty(value = "商品类型", required = true)
private String goodsType;
/**
* 商品属性参数和规格
*/

View File

@ -51,12 +51,9 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
//商家流水
@Autowired
private StoreFlowService storeFlowService;
<<<<<<< HEAD
=======
//结算单
@Resource
private BillMapper billMapper;
>>>>>>> master
@Override
public void createBill(String storeId, Date startTime, DateTime endTime) {
@ -86,10 +83,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
.eq("store_id",storeId)
.eq("flow_type",FlowTypeEnum.PAY.name())
.between("create_time",startTime,endTime));
<<<<<<< HEAD
=======
>>>>>>> master
Double orderPrice = 0D;
if (orderBill != null) {
bill.setOrderPrice(orderBill.getOrderPrice());