master
袁野 6 months ago
parent c2f30d110d
commit 01a4c47220
  1. 9
      service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java
  2. 11
      service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java
  3. 1
      service/src/main/java/com/hfkj/service/order/BsOrderService.java
  4. 4
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java

@ -75,4 +75,13 @@ public interface GoodsMsgService {
*/
List<GoodsMsg> getList(Map<String , Object> map);
/**
* 查询订单列表
* @param goodsId
* @param num
* @return
*/
void addSaleNum(Long goodsId , Integer num);
}

@ -94,4 +94,15 @@ public class GoodsMsgServiceImpl implements GoodsMsgService {
return goodsMsgMapper.selectByExample(example);
}
@Override
public void addSaleNum(Long goodsId, Integer num) {
GoodsMsg goodsMsg = queryDetail(goodsId);
if (goodsMsg != null) {
goodsMsg.setSaleNum(goodsMsg.getSaleNum() + num);
update(goodsMsg);
}
}
}

@ -82,4 +82,5 @@ public interface BsOrderService {
*/
List<BsOrder> getOrderList(Map<String,Object> param);
}

@ -218,14 +218,14 @@ public class OrderCreateService {
bsOrderGoodsService.create(orderGoods);
goodsMsgService.addSaleNum(orderGoods.getGoodsId() , orderGoods.getGoodsCount());
jsonObject.put("orderGoodsId", orderGoods.getId());
if (object.getLong("shopCartId") != null) {
shoppingCartService.delete(object.getLong("shopCartId"));
}
orderChild.setBusiness(jsonObject);
return orderChild;

Loading…
Cancel
Save