代客下单 单位回填
This commit is contained in:
@@ -72,6 +72,10 @@ public class TbProduct implements Serializable {
|
||||
@ApiModelProperty(value = "单位Id")
|
||||
private Integer unitId;
|
||||
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private String unitName;
|
||||
|
||||
@Column(name = "`cover_img`")
|
||||
@ApiModelProperty(value = "商品封面图")
|
||||
private String coverImg;
|
||||
|
||||
@@ -790,12 +790,19 @@ public class TbProductServiceImpl implements TbProductService {
|
||||
if (productId != null) {
|
||||
queryWrapper.eq("id", productId);
|
||||
}
|
||||
|
||||
Map<Integer, String> unitMap = new HashMap<>();
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TbProduct> tbProductPage = productMapper.selectPage(page1, queryWrapper);
|
||||
tbProductPage.getRecords().forEach(item -> {
|
||||
if ("package".equals(item.getType())) {
|
||||
item.setProGroupVo(JSONUtil.parseJSONStrTList(item.getGroupSnap(), ProductGroupVo.class));
|
||||
}
|
||||
if (item.getUnitId() != null) {
|
||||
if (!unitMap.containsKey(item.getUnitId())) {
|
||||
TbShopUnit tbShopUnit = tbShopUnitRepository.searchUnit(item.getUnitId());
|
||||
unitMap.put(item.getId(), tbShopUnit.getName());
|
||||
}
|
||||
item.setUnitName(unitMap.get(item.getUnitId()));
|
||||
}
|
||||
TbProductSkuResult skuResult = productSkuResultRepository.findById(item.getId()).orElse(null);
|
||||
List<TbProductSku> tbProductSkus = producSkutMapper.selectList(new LambdaQueryWrapper<TbProductSku>().eq(TbProductSku::getIsDel, 0)
|
||||
.eq(TbProductSku::getIsPauseSale, 0)
|
||||
|
||||
@@ -28,6 +28,7 @@ public class TbProductNewVo {
|
||||
private String name;
|
||||
//售价
|
||||
private String lowPrice;
|
||||
private String type;
|
||||
//类型 单规格/多规格
|
||||
private String typeEnum;
|
||||
//库存
|
||||
@@ -53,26 +54,30 @@ public class TbProductNewVo {
|
||||
private Integer sort;
|
||||
|
||||
public void setTypeEnum(String typeEnum) {
|
||||
switch (typeEnum) {
|
||||
switch (this.type) {
|
||||
case "normal":
|
||||
this.typeEnum = "单规格";
|
||||
break;
|
||||
case "sku":
|
||||
this.typeEnum = "多规格";
|
||||
break;
|
||||
case "weight":
|
||||
this.typeEnum = "普通商品";
|
||||
case "weigh":
|
||||
this.typeEnum = "称重商品";
|
||||
break;
|
||||
case "currentPrice":
|
||||
this.typeEnum = "时价商品";
|
||||
case "coupon":
|
||||
this.typeEnum = "优惠券";
|
||||
break;
|
||||
case "group":
|
||||
this.typeEnum = "套餐商品/团购卷";
|
||||
case "package":
|
||||
this.typeEnum = "套餐商品";
|
||||
break;
|
||||
default:
|
||||
this.typeEnum = typeEnum;
|
||||
break;
|
||||
}
|
||||
switch (typeEnum) {
|
||||
case "normal":
|
||||
this.typeEnum = this.typeEnum + ":单规格";
|
||||
break;
|
||||
case "sku":
|
||||
this.typeEnum = this.typeEnum + "多规格";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
Reference in New Issue
Block a user