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

修改商品bug

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