|
|
@ -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("添加失败"); |
|
|
|
} |
|
|
|