From a345536e57cbe746e37e56a6f0cdc7ae43a0cce8 Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Sat, 6 Jan 2024 15:51:41 +0800 Subject: [PATCH] no message --- .../convenienceSore/service/LJGoodsService.java | 5 +++++ .../service/impl/IntegralOrdersServiceImpl.java | 14 ++++++++++++++ .../fuint/business/store/service/StoreService.java | 2 -- .../store/service/impl/StoreServiceImpl.java | 11 ----------- .../storeInformation/service/ILJStoreService.java | 3 +++ .../service/impl/LJStoreServiceImpl.java | 13 +++++++++++++ 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java index 21a7b5683..ce8853f60 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java @@ -73,5 +73,10 @@ public interface LJGoodsService extends IService { public int updateLJGoods(LJGoods goods); + /** + * 修改商品库存 + * @param goods + * @return + */ boolean editGoodsInventory(LJGoodsDto goods); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java index 48e5202c9..90410faf2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java @@ -7,6 +7,8 @@ import com.fuint.api.fuyou.entity.MerchantConfig; import com.fuint.api.fuyou.entity.ReceiveParameter; import com.fuint.api.fuyou.service.FyPayService; import com.fuint.api.fuyou.service.MerchantConfigService; +import com.fuint.business.convenienceSore.dto.LJGoodsDto; +import com.fuint.business.convenienceSore.service.LJGoodsService; import com.fuint.business.integral.dto.IntegralOrdersDTO; import com.fuint.business.integral.entity.IntegralDetail; import com.fuint.business.integral.entity.IntegralGift; @@ -256,6 +258,9 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { CardFavorableRecordService cardFavorableRecordService; @Resource LJStaffMapper ljStaffMapper; + + @Resource + LJGoodsService ljGoodsService; @Override public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) { @@ -305,6 +310,15 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { cardFavorableRecord.setStatus("0"); cardFavorableRecord.setExchangeFrom("积分兑换"); cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord); + }else if(integralGift.getGiftType().equals("实物商品")) { + // 查询礼品信息 + + // 修改商品库存并增加记录 + LJGoodsDto goods = new LJGoodsDto(); + + goods.setId(integralGift.getGoodsId()); +// goods.setDocument(); + ljGoodsService.editGoodsInventory(goods); } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java index 752d868ac..1c160ae59 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/StoreService.java @@ -110,7 +110,5 @@ public interface StoreService extends IService { void flowflowConfiguration(); void petrolStationsAreExpired(); - // 假删除店铺 - boolean ifDeleteByDeptId(Long deptId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java index 4eedebb28..d691553cb 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/service/impl/StoreServiceImpl.java @@ -546,16 +546,5 @@ public class StoreServiceImpl extends ServiceImpl implem } - @Override - public boolean ifDeleteByDeptId(Long deptId) { - - // 创建 UpdateWrapper,用于更新 if_delete 列 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("if_delete", "1"); - updateWrapper.eq("contract_dept_id",deptId); - // 使用 MyBatis-Plus 提供的 update 方法更新 - int affectedRows = mtStoreMapper.update(null, updateWrapper); - return affectedRows>0; - } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/ILJStoreService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/ILJStoreService.java index f99509481..1effab01e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/ILJStoreService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/ILJStoreService.java @@ -76,4 +76,7 @@ public interface ILJStoreService extends IService { // * @return // */ // public int updateStoreRule(Map map); + + // 假删除店铺 + boolean ifDeleteByDeptId(Long deptId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java index 6e5dbae71..886586984 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/LJStoreServiceImpl.java @@ -1,9 +1,11 @@ package com.fuint.business.storeInformation.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.petrolStationManagement.service.OilNumberService; import com.fuint.business.petrolStationManagement.vo.OilNumberNameVo; +import com.fuint.business.store.entity.MtStore; import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.mapper.LJStoreMapper; import com.fuint.business.storeInformation.service.ILJStoreService; @@ -210,4 +212,15 @@ public class LJStoreServiceImpl extends ServiceImpl impl int row = baseMapper.updateById(store); return row; } + + @Override + public boolean ifDeleteByDeptId(Long deptId) { + // 创建 UpdateWrapper,用于更新 if_delete 列 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.set("if_delete", "1"); + updateWrapper.eq("contract_dept_id",deptId); + // 使用 MyBatis-Plus 提供的 update 方法更新 + int affectedRows = baseMapper.update(null, updateWrapper); + return affectedRows>0; + } }