提交 0ba2d058 authored 作者: 吴德鹏's avatar 吴德鹏

修改商品bug

上级 3a1b2142
...@@ -204,26 +204,26 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService { ...@@ -204,26 +204,26 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
int orederNum = 1; int orederNum = 1;
List<TbCfItemSkusEntity> itemList = itemSkus.getPrevItem(); List<TbCfItemSkusEntity> itemList = itemSkus.getPrevItem();
//先清空之前的sku //先清空之前的sku
tbCfItemSkusDao.deleteByItemId(itemId); //商品sku // tbCfItemSkusDao.deleteByItemId(itemId); //商品sku
//保存新的sku //保存新的sku
List<TbCfItemSkusEntity> item = itemSkus.getPrevItem(); List<TbCfItemSkusEntity> item = itemSkus.getPrevItem();
for (TbCfItemSkusEntity entity : item) { for (TbCfItemSkusEntity entity : item) {
TbCfItemSkusEntity skusEntity = new TbCfItemSkusEntity(); // TbCfItemSkusEntity skusEntity = new TbCfItemSkusEntity();
skusEntity.setId(IdUtil.createIdbyUUID()); // skusEntity.setId(IdUtil.createIdbyUUID());
skusEntity.setItemId(itemId); // skusEntity.setItemId(itemId);
skusEntity.setDelFlag(1); // skusEntity.setDelFlag(1);
skusEntity.setCreateTime(new Date()); // skusEntity.setCreateTime(new Date());
skusEntity.setUpdateTime(new Date()); // skusEntity.setUpdateTime(new Date());
skusEntity.setSkuName(entity.getSkuName()); // skusEntity.setSkuName(entity.getSkuName());
skusEntity.setSkuDesc(entity.getSkuDesc()); // skusEntity.setSkuDesc(entity.getSkuDesc());
skusEntity.setSkuPrice(entity.getSkuPrice()); // skusEntity.setSkuPrice(entity.getSkuPrice());
skusEntity.setSkuCount(entity.getSkuCount()); // skusEntity.setSkuCount(entity.getSkuCount());
skusEntity.setOrderNum(orederNum); // skusEntity.setOrderNum(orederNum);
skusEntity.setSkuImg(entity.getSkuImg()); // skusEntity.setSkuImg(entity.getSkuImg());
skusEntity.setSkuCode(entity.getSkuCode()); // skusEntity.setSkuCode(entity.getSkuCode());
tbCfItemSkusDao.save(skusEntity); tbCfItemSkusDao.update(entity);
count += entity.getSkuCount(); count += entity.getSkuCount();
orederNum++; // orederNum++;
} }
//先删除之前的商品参数 //先删除之前的商品参数
tbCfItemParamDao.deleteByItemId(itemId); tbCfItemParamDao.deleteByItemId(itemId);
...@@ -297,40 +297,40 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService { ...@@ -297,40 +297,40 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
tbCfItemDescDao.update(itemDescEntity); tbCfItemDescDao.update(itemDescEntity);
} }
//先删除之前的属性模板 //先删除之前的属性模板
tbCfCategoryDao.deleteByItemId(itemId); // tbCfCategoryDao.deleteByItemId(itemId);
tbCfOptionDao.deleteByItemId(itemId); // tbCfOptionDao.deleteByItemId(itemId);
//商品规格 // //商品规格
List<TbCfCategoryEntity> tree = itemSkus.getTree(); // List<TbCfCategoryEntity> tree = itemSkus.getTree();
for (int i = 0; i < tree.size(); i++) { // for (int i = 0; i < tree.size(); i++) {
String cid = IdUtil.createIdbyUUID(); // String cid = IdUtil.createIdbyUUID();
String categoryDesc = tree.get(i).getCategoryDesc(); // String categoryDesc = tree.get(i).getCategoryDesc();
TbCfCategoryEntity categoryEntity = new TbCfCategoryEntity(); // TbCfCategoryEntity categoryEntity = new TbCfCategoryEntity();
categoryEntity.setCategoryId(cid); // categoryEntity.setCategoryId(cid);
categoryEntity.setCreateTime(new Date()); // categoryEntity.setCreateTime(new Date());
categoryEntity.setUpdateTime(new Date()); // categoryEntity.setUpdateTime(new Date());
categoryEntity.setDelFlag(1); // categoryEntity.setDelFlag(1);
categoryEntity.setItemId(itemId); // categoryEntity.setItemId(itemId);
categoryEntity.setCategoryName(tree.get(i).getCategoryName()); // categoryEntity.setCategoryName(tree.get(i).getCategoryName());
categoryEntity.setCategoryDesc(categoryDesc); // categoryEntity.setCategoryDesc(categoryDesc);
int num = i + 1; // int num = i + 1;
categoryEntity.setOrderNum(num); // categoryEntity.setOrderNum(num);
categoryEntity.setOption("option" + num); // categoryEntity.setOption("option" + num);
tbCfCategoryDao.save(categoryEntity); // tbCfCategoryDao.save(categoryEntity);
String[] desc = categoryDesc.split(","); // String[] desc = categoryDesc.split(",");
for (int j = 0; j < desc.length; j++) { // for (int j = 0; j < desc.length; j++) {
//商品属性 // //商品属性
TbCfOptionEntity optionEntity = new TbCfOptionEntity(); // TbCfOptionEntity optionEntity = new TbCfOptionEntity();
optionEntity.setOptionId(IdUtil.createIdbyUUID()); // optionEntity.setOptionId(IdUtil.createIdbyUUID());
optionEntity.setCid(cid); // optionEntity.setCid(cid);
optionEntity.setItemId(itemId); // optionEntity.setItemId(itemId);
optionEntity.setOptiionSpecies(desc[j]); // optionEntity.setOptiionSpecies(desc[j]);
optionEntity.setCreateTime(new Date()); // optionEntity.setCreateTime(new Date());
optionEntity.setUpdateTime(new Date()); // optionEntity.setUpdateTime(new Date());
optionEntity.setDelFlag(1); // optionEntity.setDelFlag(1);
optionEntity.setOptionName("option" + num); // optionEntity.setOptionName("option" + num);
tbCfOptionDao.save(optionEntity); // tbCfOptionDao.save(optionEntity);
} // }
} // }
} }
@Override @Override
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#jdbc.username=root #jdbc.username=root
#jdbc.password=diaoyun666 #jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root jdbc.username: root
jdbc.password: Diaoyunnuli.8 jdbc.password: Diaoyunnuli.8
......
...@@ -712,6 +712,7 @@ let vm = new Vue({ ...@@ -712,6 +712,7 @@ let vm = new Vue({
_this.tmdSkudata = r.tbCfStationItem.itemSkusList _this.tmdSkudata = r.tbCfStationItem.itemSkusList
r.tbCfStationItem.itemSkusList.map(item => { r.tbCfStationItem.itemSkusList.map(item => {
_this.prevItem.push({ _this.prevItem.push({
id:item.id,
skuImg: null, skuImg: null,
skuName: item.skuName, skuName: item.skuName,
skuDesc: item.skuDesc, skuDesc: item.skuDesc,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论