|
|
@@ -491,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());
|
|
|
@@ -529,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());
|
|
|
@@ -715,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);
|
|
|
@@ -779,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) {
|
|
|
@@ -812,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) {
|
|
|
@@ -1379,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 添加或修改商品价格信息
|
|
|
@@ -1440,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());
|
|
|
@@ -1554,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);
|
|
|
@@ -1660,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);
|
|
|
@@ -1752,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());
|
|
|
@@ -1938,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) {
|
|
|
@@ -1961,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);
|
|
|
@@ -2127,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);
|
|
|
@@ -2380,7 +2380,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultMap offShelfGoodsByProvider(String batchCodes) {
|
|
|
+ public ResultMap offShelfGoodsByProvider(String batchCodes, Boolean isERP) {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
logger.info(String.format("%s 商城测试下架时间记录1", dateFormat.format(new Date())));
|
|
|
if (StringUtils.isEmpty(batchCodes)) {
|
|
|
@@ -2397,7 +2397,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
logger.info(String.format("%s 商城测试下架时间记录2", dateFormat.format(new Date())));
|
|
|
for (String batchCode : batchCodeArr) {
|
|
|
logger.info(String.format("%s 商城测试下架时间记录 调用下架方法开始", dateFormat.format(new Date())));
|
|
|
- ResultMap resultMap = offShelfOneGoodsByProvider(batchCode);
|
|
|
+ ResultMap resultMap = offShelfOneGoodsByProvider(batchCode,isERP);
|
|
|
logger.info(String.format("%s 商城测试下架时间记录 调用下架方法结束", dateFormat.format(new Date())));
|
|
|
if (resultMap.isSuccess()) {
|
|
|
Goods goods = (Goods) resultMap.getData();
|
|
|
@@ -2436,7 +2436,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
* @param batchCode 商品批次号
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public ResultMap offShelfOneGoodsByProvider(String batchCode) {
|
|
|
+ public ResultMap offShelfOneGoodsByProvider(String batchCode, Boolean isERP) {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
logger.info(String.format("%s 商城测试下架时间记录 进入下架方法", dateFormat.format(new Date())));
|
|
|
if (StringUtils.isEmpty(batchCode)) {
|
|
|
@@ -2465,7 +2465,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
logger.info(String.format("%s 商城测试下架时间记录 转历史库存 开始", dateFormat.format(new Date())));
|
|
|
GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods,
|
|
|
- GoodsHistory.OperateType.Down.getPhrase());
|
|
|
+ GoodsHistory.OperateType.Down.getPhrase(), isERP);
|
|
|
logger.info(String.format("%s 商城测试下架时间记录 转历史库存 结束", dateFormat.format(new Date())));
|
|
|
goodsHist.setMessage(goodsHist.getMessage() + "该批次下架");
|
|
|
goodsHistoryService.save(goodsHist);
|
|
|
@@ -2856,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);
|
|
|
@@ -2899,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);
|
|
|
|
|
|
@@ -2984,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);
|
|
|
@@ -3102,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);
|
|
|
@@ -3191,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);
|
|
|
|
|
|
@@ -3272,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());
|
|
|
@@ -3515,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);
|
|
|
}
|