提交 0fe526e1 authored 作者: zgy's avatar zgy

商品优化

上级 7e7780ed
......@@ -9,7 +9,7 @@ import java.util.Date;
* 表名 tb_cf_station_item
*
* @author lipengjun
* @date 2020-01-14 18:31:13
* @date 2020-04-07 16:24:13
*/
public class TbCfStationItemEntity implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -42,6 +42,10 @@ public class TbCfStationItemEntity implements Serializable {
* 商品折扣价
*/
private BigDecimal discountPrice;
/**
* 成本价
*/
private BigDecimal costPrice;
/**
* 商品链接
*/
......@@ -106,6 +110,10 @@ public class TbCfStationItemEntity implements Serializable {
* 商品品名
*/
private String itemDescritionId;
/**
* 创建人
*/
private String creator;
/**
* 设置:商品id
......@@ -198,6 +206,19 @@ public class TbCfStationItemEntity implements Serializable {
public BigDecimal getDiscountPrice() {
return discountPrice;
}
/**
* 设置:成本价
*/
public void setCostPrice(BigDecimal costPrice) {
this.costPrice = costPrice;
}
/**
* 获取:成本价
*/
public BigDecimal getCostPrice() {
return costPrice;
}
/**
* 设置:商品链接
*/
......@@ -225,18 +246,31 @@ public class TbCfStationItemEntity implements Serializable {
return itemImg;
}
/**
* 设置:商品标签
* 设置:搜索关键字
*/
public void setItemTags(String itemTags) {
this.itemTags = itemTags;
}
/**
* 获取:商品标签
* 获取:搜索关键字
*/
public String getItemTags() {
return itemTags;
}
/**
* 设置:商品标签
*/
public void setItemLabel(String itemLabel) {
this.itemLabel = itemLabel;
}
/**
* 获取:商品标签
*/
public String getItemLabel() {
return itemLabel;
}
/**
* 设置:浏览人数
*/
......@@ -393,12 +427,17 @@ public class TbCfStationItemEntity implements Serializable {
public String getItemDescritionId() {
return itemDescritionId;
}
public String getItemLabel() {
return itemLabel;
/**
* 设置:创建人
*/
public void setCreator(String creator) {
this.creator = creator;
}
public void setItemLabel(String itemLabel) {
this.itemLabel = itemLabel;
/**
* 获取:创建人
*/
public String getCreator() {
return creator;
}
}
......@@ -3,10 +3,7 @@ package com.platform.service.impl;
import com.platform.dao.*;
import com.platform.entity.*;
import com.platform.service.TbCfStationItemService;
import com.platform.utils.IdUtil;
import com.platform.utils.OssUtil;
import com.platform.utils.R;
import com.platform.utils.UuidUtil;
import com.platform.utils.*;
import com.platform.utils.excel.ExcelExport;
import com.platform.utils.excel.ExcelImport;
import com.platform.utils.util.StringUtil;
......@@ -111,6 +108,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
tbCfStationItem.setSupplier(itemSkus.getSupplier());
tbCfStationItem.setItemPrice(itemSkus.getItemPrice());
tbCfStationItem.setDiscountPrice(itemSkus.getDiscountPrice());
tbCfStationItem.setCostPrice(itemSkus.getCostPrice());
tbCfStationItem.setItemBrief(itemSkus.getItemBrief());
tbCfStationItem.setItemName(itemSkus.getItemName());
tbCfStationItem.setItemCode(itemSkus.getItemCode());
......@@ -126,6 +124,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
if (itemSkus.isPutaway()) {
tbCfStationItem.setEnableFlag(1);
}
tbCfStationItem.setCreator(ShiroUtils.getUserId());
tbCfStationItemDao.save(tbCfStationItem);
//商品描述
......@@ -232,6 +231,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
if (tbCfStationItem != null) {
tbCfStationItem.setItemPrice(itemSkus.getItemPrice());
tbCfStationItem.setDiscountPrice(itemSkus.getDiscountPrice());
tbCfStationItem.setCostPrice(itemSkus.getCostPrice());
tbCfStationItem.setItemUrl(itemSkus.getItemUrl());
tbCfStationItem.setSupplier(itemSkus.getSupplier());
tbCfStationItem.setItemBrief(itemSkus.getItemBrief());
......
......@@ -11,11 +11,13 @@
<result property="itemCategory" column="item_category"/>
<result property="itemPrice" column="item_price"/>
<result property="discountPrice" column="discount_price"/>
<result property="costPrice" column="cost_price"/>
<result property="itemUrl" column="item_url"/>
<result property="itemImg" column="item_img"/>
<result property="itemTags" column="item_tags"/>
<result property="itemLabel" column="item_label"/>
<result property="itemNum" column="item_num"/>
<result property="itemCollectionNum" column="item_collection_num"/>
<result property="itemCount" column="item_count"/>
<result property="itemSku" column="item_sku"/>
<result property="itemTop" column="item_top"/>
......@@ -26,6 +28,7 @@
<result property="createTime" column="create_time"/>
<result property="itemCategorytwo" column="item_categorytwo"/>
<result property="itemDescritionId" column="item_descrition_id"/>
<result property="creator" column="creator"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfStationItemEntityExtends">
......@@ -37,6 +40,7 @@
`item_category`,
`item_price`,
`discount_price`,
cost_price,
`item_url`,
`item_img`,
`item_tags`,
......@@ -52,6 +56,7 @@
i.create_time,
`item_categorytwo`,
`item_descrition_id`,
creator,
item_desc itemDesc
from tb_cf_station_item i left join tb_cf_item_desc d on i.item_id=d.item_id
where i.item_id = #{id}
......@@ -65,6 +70,7 @@
`item_category`,
`item_price`,
`discount_price`,
cost_price,
`item_url`,
`item_img`,
`item_tags`,
......@@ -80,6 +86,7 @@
i.create_time,
`item_categorytwo`,
`item_descrition_id`,
creator,
item_desc itemDesc
from tb_cf_station_item i left join tb_cf_item_desc d on i.item_id=d.item_id
where
......@@ -107,6 +114,7 @@
i.item_category,
i.item_price,
i.discount_price,
i.cost_price,
i.item_url,
i.item_img,
i.item_count,
......@@ -119,6 +127,7 @@
i.item_descrition_id,
i.item_top,
i.supplier,
i.creator,
d.descripition_name dname,
t.goodstwotype_title title,
o.goodstype_title goodtype
......@@ -205,19 +214,24 @@
`item_category`,
`item_price`,
`discount_price`,
`cost_price`,
`item_url`,
`item_img`,
`item_tags`,
`item_label`,
`item_num`,
`item_collection_num`,
`item_count`,
`item_sku`,
`item_top`,
`supplier`,
`platform_code`,
`platform_name`,
`enable_flag`,
`create_time`,
`item_categorytwo`,
`item_descrition_id`)
`item_descrition_id`,
`creator`)
values(
#{itemId},
#{itemCode},
......@@ -226,19 +240,24 @@
#{itemCategory},
#{itemPrice},
#{discountPrice},
#{costPrice},
#{itemUrl},
#{itemImg},
#{itemTags},
#{itemLabel},
#{itemNum},
#{itemCollectionNum},
#{itemCount},
#{itemSku},
#{itemTop},
#{supplier},
#{platformCode},
#{platformName},
#{enableFlag},
#{createTime},
#{itemCategorytwo},
#{itemDescritionId})
#{itemDescritionId},
#{creator})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfStationItemEntity">
......@@ -250,6 +269,7 @@
<if test="itemCategory != null">`item_category` = #{itemCategory},</if>
`item_price` = #{itemPrice},
<if test="discountPrice != null">`discount_price` = #{discountPrice},</if>
<if test="costPrice != null">`cost_price` = #{costPrice}, </if>
<if test="itemUrl != null">`item_url` = #{itemUrl},</if>
<if test="itemImg != null">`item_img` = #{itemImg},</if>
<if test="itemTags != null">`item_tags` = #{itemTags},</if>
......
......@@ -439,10 +439,13 @@
<!-- <Form-item label="商品库存" prop="item_count" style="width: 800px">
<i-input v-model="tbCfStationItem.itemCount" placeholder="商品库存"/>
</Form-item>-->
<Form-item label="成本价" prop="costPrice" style="width: 800px">
<i-input v-model="tbCfStationItem.costPrice" placeholder="成本价"/>
</Form-item>
<Form-item label="商品图片" prop="itemImg">
<!-- <i-input v-model="xPicture.pictureUrl" placeholder="图片地址"/> -->
<upload
multiple
action="../api/osstest/uploadtest"
:before-upload="handleBeforeUpload"
:on-success="handleSuccess" :show-upload-list="false" accept="image/jpeg, image/png">
......
......@@ -458,21 +458,17 @@ Dict = function () {
* @returns {string}
*/
imageFormat = function (cellvalue, options, rowObject) {
/**
*{path:https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/null/157865052589110168.mp4,type:video},
*{path:https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/null/157865053763610597.png,type:picture},
*{path:https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/null/157865053763510451.png,type:picture},
*{path:https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/null/157865053764010039.png,type:picture},
*{path:https://diaosaas-prod.oss-cn-shenzhen.aliyuncs.com/africa-shop/null/157865054451310852.png,type:picture}
*
*/
console.log(55555, cellvalue)
if (!cellvalue) {
cellvalue = "<i class=\"fa fa-file-picture-o\" style=\"font-size:30px;\" title='无图'></i>";
cellvalue = "<i class=\"fa fa-file-picture-o\" style=\"font-size:30px;\" title='无图'></i>";
} else {
if (cellvalue.indexOf(',')) {
let split = cellvalue.split(',');
cellvalue = '<img src="' + split[0] + '" style="width:30px;height:30px;" />';
} else {
cellvalue = '<img src="' + cellvalue + '" style="width:30px;height:30px;" />';
}
}
return cellvalue;
};
......
......@@ -66,8 +66,7 @@ let vm = new Vue({
isDisabled: false,
disabled: false,
itemLabel: null,
itemImg: null,
tagLists: [],//标签列表
subtaglist: [],//子便签
tagshow: false,
......@@ -139,12 +138,13 @@ let vm = new Vue({
resArr.push(item)
})
let label = null;
vm.tbCfStationItem.itemLabel = this.isSelectedArr.map(item=>item.id).join(',');
vm.tbCfStationItem.itemLabel = this.isSelectedArr.map(item => item.id).join(',');
vm.tbCfStationItem.prevItem = resArr
vm.tbCfStationItem.putaway = this.putaway
this.$set(vm.tbCfStationItem, 'tree', this.attrItem)
let _this = this
vm.tbCfStationItem.itemImg = vm.uploadList[0];
vm.tbCfStationItem.itemImg = vm.uploadList.map(res => res).join(',');
;
vm.tbCfStationItem.itemDesc = encodeURI(UE.getEditor('itemDesc').getContent()); // 富文本取值
vm.tbCfStationItem.itemDesc = vm.tbCfStationItem.itemDesc.replace(/&nbsp;/g, " ");
......@@ -233,11 +233,10 @@ let vm = new Vue({
})
console.log(r)
})()
console.log(123321, _this.attrItem)
vm.tbCfStationItem = r.tbCfStationItem.item;
vm.uploadList[0] = vm.tbCfStationItem.itemImg;
let img = vm.tbCfStationItem.itemImg;
vm.uploadList = img.split(',');
let itemDesc = vm.tbCfStationItem.itemDesc;
console.log(111, r.tbCfStationItem.item)
_this.changeGoodstype()
_this.changeGoodstype2()
vm.tbCfStationItem.enableFlag === 1 && (() => {
......@@ -350,13 +349,13 @@ let vm = new Vue({
alert('请上传不超过5M的图片');
return false;
}
const check = this.uploadList.length < 1;
if (!check) {
this.$Notice.warning({
title: '最多只能上传一张图片'
});
return false;
}
// const check = this.uploadList.length < 1;
// if (!check) {
// this.$Notice.warning({
// title: '最多只能上传一张图片'
// });
// return false;
// }
// 限制上传文件的宽高
// return this.checkImageWH(file,750,320);
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论