From 1a47ed7630c118f582c37c9c942035a9d3bfad58 Mon Sep 17 00:00:00 2001 From: gxwebsoft Date: Tue, 27 Feb 2024 20:45:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=85=8D=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tower/controller/TowerPartGoodsController.java | 11 ++++++++++- .../com/gxwebsoft/tower/entity/TowerPartGoods.java | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gxwebsoft/tower/controller/TowerPartGoodsController.java b/src/main/java/com/gxwebsoft/tower/controller/TowerPartGoodsController.java index 6c9527e..f073f18 100644 --- a/src/main/java/com/gxwebsoft/tower/controller/TowerPartGoodsController.java +++ b/src/main/java/com/gxwebsoft/tower/controller/TowerPartGoodsController.java @@ -2,6 +2,7 @@ package com.gxwebsoft.tower.controller; import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.tower.entity.TowerPartStock; import com.gxwebsoft.tower.service.TowerPartGoodsService; import com.gxwebsoft.tower.entity.TowerPartGoods; import com.gxwebsoft.tower.param.TowerPartGoodsParam; @@ -10,6 +11,7 @@ import com.gxwebsoft.common.core.web.PageResult; import com.gxwebsoft.common.core.web.PageParam; import com.gxwebsoft.common.core.web.BatchParam; import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.tower.service.TowerPartStockService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; @@ -30,6 +32,8 @@ import java.util.List; public class TowerPartGoodsController extends BaseController { @Resource private TowerPartGoodsService towerPartGoodsService; + @Resource + private TowerPartStockService towerPartStockService; @PreAuthorize("hasAuthority('tower:towerPartGoods:list')") @OperationLog @@ -73,7 +77,12 @@ public class TowerPartGoodsController extends BaseController { towerPartGoods.setUserId(loginUser.getUserId()); } if (towerPartGoodsService.save(towerPartGoods)) { - return success("添加成功"); + // 同步添加库存表 + final TowerPartStock towerPartStock = new TowerPartStock(); + towerPartStock.setGoodsId(towerPartGoods.getGoodsId()); + towerPartStock.setTenantId(towerPartGoods.getTenantId()); + towerPartStockService.save(towerPartStock); + return success("添加成功"); } return fail("添加失败"); } diff --git a/src/main/java/com/gxwebsoft/tower/entity/TowerPartGoods.java b/src/main/java/com/gxwebsoft/tower/entity/TowerPartGoods.java index 062c7fc..48e4b6e 100644 --- a/src/main/java/com/gxwebsoft/tower/entity/TowerPartGoods.java +++ b/src/main/java/com/gxwebsoft/tower/entity/TowerPartGoods.java @@ -103,5 +103,4 @@ public class TowerPartGoods implements Serializable { @ApiModelProperty(value = "是否低于最低库存") @TableField(exist = false) private Integer stockLower; - }