From 38596b03540250dd7de85c49f53ece5dd6bfe5b7 Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期四, 10 十一月 2022 13:19:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWarehouseApplyServiceImpl.java | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWarehouseApplyServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWarehouseApplyServiceImpl.java
index e3c4936..420fa25 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWarehouseApplyServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWarehouseApplyServiceImpl.java
@@ -65,16 +65,15 @@
@Transactional(rollbackFor = Exception.class)
@Override
public R update(ComActWarehouseApply comActWarehouseApply) {
- ComActWarehouseApplyVO comActWarehouseApply1=this.comActWarehouseApplyDao.selectById(comActWarehouseApply.getId());
+ ComActWarehouseApply comActWarehouseApply1=this.comActWarehouseApplyDao.selectById(comActWarehouseApply.getId());
if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ylq)){
- ComActWarehouseDonates comActWarehouseDonates=this.comActWarehouseDonatesDao.selectById(comActWarehouseApply.getGoodsId());
- if(comActWarehouseDonates!=null&&comActWarehouseDonates.getSurplusQuantity()>0){
- comActWarehouseDonates.setSurplusQuantity(comActWarehouseDonates.getSurplusQuantity()-1);
+ ComActWarehouseDonates comActWarehouseDonates=this.comActWarehouseDonatesDao.selectById(comActWarehouseApply1.getGoodsId());
+ if(comActWarehouseDonates!=null&&comActWarehouseDonates.getSurplusQuantity()>=comActWarehouseApply1.getGoodsNum()){
+ comActWarehouseDonates.setSurplusQuantity(comActWarehouseDonates.getSurplusQuantity()-comActWarehouseApply1.getGoodsNum());
this.comActWarehouseDonatesDao.updateById(comActWarehouseDonates);
ComActWarehouseOperation comActWarehouseOperation=new ComActWarehouseOperation();
- comActWarehouseOperation.setGoodsId(comActWarehouseApply.getGoodsId());
+ comActWarehouseOperation.setGoodsId(comActWarehouseApply1.getGoodsId());
comActWarehouseOperation.setCreateTime(new Date());
- comActWarehouseOperation.setContent("爱心传递给了"+comActWarehouseApply1.getApplyName().charAt(0)+"**,"+"减少了"+comActWarehouseApply1.getReason()+"的困难,谢谢你的帮助");
comActWarehouseOperation.setType(ComActWarehouseOperation.type.xs);
comActWarehouseOperation.setApplyId(comActWarehouseApply.getId());
this.comActWarehouseOperationDao.insert(comActWarehouseOperation);
--
Gitblit v1.7.1