|
|
@@ -1,7 +1,6 @@
|
|
|
package com.uas.platform.b2c.prod.commodity.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
|
import com.uas.api.b2c_erp.core.model.OperateErrorStatus;
|
|
|
import com.uas.api.b2c_erp.seller.model.GoodsFUas;
|
|
|
import com.uas.api.b2c_erp.seller.model.GoodsSimpleUas;
|
|
|
@@ -492,7 +491,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
|
|
|
// 每次批次保存同时保存一遍历史信息
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.DeductReserve.getPhrase());
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.DeductReserve.getPhrase(),false);
|
|
|
goodsHistoryService.save(goodsHistory);
|
|
|
// 更新器件属性的库存
|
|
|
updateComponentTradeInfos(goods.getUuid());
|
|
|
@@ -530,7 +529,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
|
|
|
// 每次批次保存同时保存一遍历史信息
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.ReleaseReserve.getPhrase());
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.ReleaseReserve.getPhrase(),false);
|
|
|
goodsHistoryService.save(goodsHistory);
|
|
|
// 更新器件属性的库存
|
|
|
updateComponentTradeInfos(goods.getUuid());
|
|
|
@@ -716,7 +715,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
return null;
|
|
|
}
|
|
|
// updateGoodTransactional(goods);
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase());
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(),false);
|
|
|
//仅保存商品信息,不上架
|
|
|
if (goods.getId() == null || goods.getSold() == null) {
|
|
|
goods.setSold(IntegerConstant.NO_INT);
|
|
|
@@ -780,7 +779,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if (resultMap.getCode() != CodeType.OK.code()) {
|
|
|
continue;
|
|
|
}
|
|
|
- GoodsHistory g = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase());
|
|
|
+ GoodsHistory g = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(),false);
|
|
|
goodsHistorys.add(g);
|
|
|
list.add(goods);
|
|
|
if (goods.getUuid() != null) {
|
|
|
@@ -813,7 +812,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if (resultMap.getCode() != CodeType.OK.code()) {
|
|
|
continue;
|
|
|
}
|
|
|
- GoodsHistory g = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase());
|
|
|
+ GoodsHistory g = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Publish.getPhrase(),false);
|
|
|
goodsHistorys.add(g);
|
|
|
list.add(goods);
|
|
|
if (goods.getUuid() != null) {
|
|
|
@@ -1380,7 +1379,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
return resultMap;
|
|
|
}
|
|
|
// updateGoodTransactional(goods);
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.Publish.getPhrase());
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.Publish.getPhrase(),false);
|
|
|
Goods persistGoods = goodsDao.save(goods);
|
|
|
goodsHistoryDao.save(goodsHistory);
|
|
|
// TODO huxz 添加或修改商品价格信息
|
|
|
@@ -1441,7 +1440,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
goods.setStatus(Status.NO_SHELVE.value());
|
|
|
// updateGoodTransactional(goods);
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.ADD_GOODS.getPhrase());
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.ADD_GOODS.getPhrase(),false);
|
|
|
Goods persistGoods = goodsDao.save(goods);
|
|
|
if(product != null) {
|
|
|
ProductPrivate productPrivate = releaseProductByBatchService.findByPrId(product.getId());
|
|
|
@@ -1555,7 +1554,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsHistoryService
|
|
|
.converTGoodsHist
|
|
|
(nowGoods,
|
|
|
- OperateType.Update.getPhrase());
|
|
|
+ OperateType.Update.getPhrase(),false);
|
|
|
List<Order> orders = detailService.updateOrderDetailsByGoods(nowGoods);
|
|
|
//更新购物车信息
|
|
|
List<Cart> cartList = cartService.updateCartByGoods(nowGoods);
|
|
|
@@ -1661,7 +1660,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsHistoryService
|
|
|
.converTGoodsHist
|
|
|
(nowGoods,
|
|
|
- OperateType.Update.getPhrase());
|
|
|
+ OperateType.Update.getPhrase(),true);
|
|
|
List<Order> orders = detailService.updateOrderDetailsByGoods(nowGoods);
|
|
|
//更新购物车信息
|
|
|
List<Cart> cartList = cartService.updateCartByGoods(nowGoods);
|
|
|
@@ -1753,7 +1752,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsDao.deleteByBatchCode(batchCode);
|
|
|
|
|
|
GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods,
|
|
|
- GoodsHistory.OperateType.Down.getPhrase());
|
|
|
+ GoodsHistory.OperateType.Down.getPhrase(),false);
|
|
|
goodsHist.setMessage(goodsHist.getMessage() + "该批次下架");
|
|
|
goodsHistoryService.save(goodsHist);
|
|
|
uuids.add(goods.getUuid());
|
|
|
@@ -1939,7 +1938,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
} else {
|
|
|
goods.setStatus(Status.UNAVAILABLE.value());
|
|
|
}
|
|
|
- GoodsHistory converTGoodsHist = goodsHistoryService.converTGoodsHist(goods, OperateType.Update.getPhrase());
|
|
|
+ GoodsHistory converTGoodsHist = goodsHistoryService.converTGoodsHist(goods, OperateType.Update.getPhrase(),true);
|
|
|
goodsHistoryService.save(converTGoodsHist);
|
|
|
Goods good = goodsDao.save(goods);
|
|
|
if (good == null) {
|
|
|
@@ -1962,7 +1961,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goods.setStatus(Status.UNAVAILABLE.value());
|
|
|
}
|
|
|
// 每次批次保存同时保存一遍历史信息
|
|
|
- GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods, OperateType.OrderPaied.getPhrase());
|
|
|
+ GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods, OperateType.OrderPaied.getPhrase(),true);
|
|
|
goodsHist.setMessage(goodsHist.getMessage() + "接口变更库存之后,扣除意向采购单 和正式采购单的购买数量");
|
|
|
goodsHistoryService.save(goodsHist);
|
|
|
good = goodsDao.save(goods);
|
|
|
@@ -2128,7 +2127,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
} else {
|
|
|
goods.setStatus(Status.REMOVED.value());
|
|
|
- GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase(),false);
|
|
|
goodsHist.setMessage(goodsHist.getMessage() + "该批次产品下架(UAS接口)");
|
|
|
goodsHistoryService.save(goodsHist);
|
|
|
goodsDao.delete(goods);
|
|
|
@@ -2857,7 +2856,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
for (Goods goods : goodsList) {
|
|
|
goods.setStatus(Status.REMOVED.value());
|
|
|
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, "批量下架公司产品");
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, "批量下架公司产品",false);
|
|
|
goodsHistory.setMessage(goodsHistory.getMessage() + "该批次下架");
|
|
|
goodsHistoryService.save(goodsHistory);
|
|
|
histories.add(goodsHistory);
|
|
|
@@ -2900,13 +2899,13 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if (goods.getStatus().equals(Status.AVAILABLE.value()) || goods.getStatus().equals(Status.UNAVAILABLE.value())) {
|
|
|
//先做下架记录
|
|
|
goods.setStatus(Status.REMOVED.value());
|
|
|
- GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase(),false);
|
|
|
histories.add(goodsHistoryRemoved);
|
|
|
}
|
|
|
|
|
|
goods.setStatus(Status.GOODS_DELETE.value());
|
|
|
//删除库存信息
|
|
|
- GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase());
|
|
|
+ GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase(),false);
|
|
|
histories.add(goodsHistoryDelete);
|
|
|
goodsHistoryService.save(histories);
|
|
|
|
|
|
@@ -2985,7 +2984,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
goods.setStatus(Status.REMOVED.value());
|
|
|
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, "批量下架公司产品");
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, "批量下架公司产品",false);
|
|
|
goodsHistory.setMessage(goodsHistory.getMessage() + "该批次下架");
|
|
|
goodsHistoryService.save(goodsHistory);
|
|
|
histories.add(goodsHistory);
|
|
|
@@ -3103,7 +3102,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goods.setStatus(Status.AVAILABLE.value());
|
|
|
}
|
|
|
GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods,
|
|
|
- GoodsHistory.OperateType.Publish.getPhrase());
|
|
|
+ GoodsHistory.OperateType.Publish.getPhrase(),false);
|
|
|
goodsHist.setMessage(goodsHist.getMessage() + "该批次上架");
|
|
|
goodsHistoryService.save(goodsHist);
|
|
|
Product product = productDao.findOne(id);
|
|
|
@@ -3192,13 +3191,13 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if (goods.getStatus().equals(Status.AVAILABLE.value()) || goods.getStatus().equals(Status.UNAVAILABLE.value())) {
|
|
|
//先做下架记录
|
|
|
goods.setStatus(Status.REMOVED.value());
|
|
|
- GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase(),false);
|
|
|
histories.add(goodsHistoryRemoved);
|
|
|
}
|
|
|
|
|
|
goods.setStatus(Status.GOODS_DELETE.value());
|
|
|
//删除库存信息
|
|
|
- GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase());
|
|
|
+ GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase(),false);
|
|
|
histories.add(goodsHistoryDelete);
|
|
|
goodsHistoryService.save(histories);
|
|
|
|
|
|
@@ -3273,12 +3272,12 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
if (goods.getStatus().equals(Status.AVAILABLE.value()) || goods.getStatus().equals(Status.UNAVAILABLE.value())) {
|
|
|
goods.setStatus(Status.REMOVED.value());
|
|
|
- GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase());
|
|
|
+ GoodsHistory goodsHistoryRemoved = goodsHistoryService.converTGoodsHist(goods, OperateType.Down.getPhrase(),false);
|
|
|
histories.add(goodsHistoryRemoved);
|
|
|
}
|
|
|
//删除库存信息
|
|
|
goods.setStatus(Status.GOODS_DELETE.value());
|
|
|
- GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase());
|
|
|
+ GoodsHistory goodsHistoryDelete = goodsHistoryService.converTGoodsHist(goods, OperateType.DELETE.getPhrase(),false);
|
|
|
histories.add(goodsHistoryDelete);
|
|
|
goodses1.add(goods);
|
|
|
gids.add(goods.getId());
|
|
|
@@ -3516,7 +3515,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
if (isModify) {
|
|
|
goods.setQtyPrice(FastjsonUtils.toJson(list));
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.MODIFY_PRICE.getPhrase());
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.MODIFY_PRICE.getPhrase(),false);
|
|
|
histories.add(goodsHistory);
|
|
|
goodses.add(goods);
|
|
|
}
|