Commit c1716341 authored by 罗林杰's avatar 罗林杰

修改退单

parent f957b7d6
......@@ -275,7 +275,10 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
storeGoodsLog.setApplyId(storeGoodsApply.getBusinessId());
//根据id查询子表
for (StoreGoodsLog box : storeGoodsLogServiceImpl.findAll(storeGoodsLog)) {
StoreGoodsStock goodsStock = storeGoodsStockRepository.selectByGoodsId(box.getGoodsId());
StoreGoodsStock oldStoreGoodsStock = new StoreGoodsStock();
oldStoreGoodsStock.setGoodsId(box.getGoodsId());
oldStoreGoodsStock.setStoreId(CyUserUtil.getAuthenDept());
StoreGoodsStock goodsStock = storeGoodsStockRepository.selectByGoodsId(oldStoreGoodsStock);
goodsStock.setGoodsCounts(goodsStock.getGoodsCounts() + box.getGoodsCounts());
// 返回库存
storeGoodsStockRepositoryImpl.updateCounts(goodsStock);
......
......@@ -110,7 +110,10 @@ public class StoreGoodsLogServiceImpl extends ServiceImpl<StoreGoodsLogRepositor
if(storeGoodsLog.getIsReturn().equals("1")){
for (StoreGoodsLog box : storeGoodsLogServiceImpl.findAll(oldStoreGoodsLog)) {
StoreGoodsStock goodsStock = storeGoodsStockRepository.selectByGoodsId(box.getGoodsId());
StoreGoodsStock oldStoreGoodsStock = new StoreGoodsStock();
oldStoreGoodsStock.setGoodsId(box.getGoodsId());
oldStoreGoodsStock.setStoreId(CyUserUtil.getAuthenDept());
StoreGoodsStock goodsStock = storeGoodsStockRepository.selectByGoodsId(oldStoreGoodsStock);
goodsStock.setGoodsCounts(goodsStock.getGoodsCounts() + box.getGoodsCounts());
// 返回库存
storeGoodsStockRepositoryImpl.updateCounts(goodsStock);
......
......@@ -26,6 +26,6 @@ public interface StoreGoodsStockRepository extends CyBaseMapper<StoreGoodsStock>
StoreGoodsStock selectByIdOut(int id);
StoreGoodsStock selectByGoodsId(int id);
StoreGoodsStock selectByGoodsId(@Param("entity") StoreGoodsStock storeGoodsStock);
}
......@@ -178,6 +178,7 @@
<select id="selectByGoodsId" resultType="org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock">
select *
from store_goods_stock
where goods_id = #{goodsId}
where goods_id = #{entity.goodsId}
and store_id = #{entity.storeId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment