新增配件管理模块
This commit is contained in:
@@ -2,6 +2,7 @@ package com.gxwebsoft.tower.controller;
|
|||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.tower.entity.TowerPartStock;
|
||||||
import com.gxwebsoft.tower.service.TowerPartGoodsService;
|
import com.gxwebsoft.tower.service.TowerPartGoodsService;
|
||||||
import com.gxwebsoft.tower.entity.TowerPartGoods;
|
import com.gxwebsoft.tower.entity.TowerPartGoods;
|
||||||
import com.gxwebsoft.tower.param.TowerPartGoodsParam;
|
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.PageParam;
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.tower.service.TowerPartStockService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -30,6 +32,8 @@ import java.util.List;
|
|||||||
public class TowerPartGoodsController extends BaseController {
|
public class TowerPartGoodsController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private TowerPartGoodsService towerPartGoodsService;
|
private TowerPartGoodsService towerPartGoodsService;
|
||||||
|
@Resource
|
||||||
|
private TowerPartStockService towerPartStockService;
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('tower:towerPartGoods:list')")
|
@PreAuthorize("hasAuthority('tower:towerPartGoods:list')")
|
||||||
@OperationLog
|
@OperationLog
|
||||||
@@ -73,6 +77,11 @@ public class TowerPartGoodsController extends BaseController {
|
|||||||
towerPartGoods.setUserId(loginUser.getUserId());
|
towerPartGoods.setUserId(loginUser.getUserId());
|
||||||
}
|
}
|
||||||
if (towerPartGoodsService.save(towerPartGoods)) {
|
if (towerPartGoodsService.save(towerPartGoods)) {
|
||||||
|
// 同步添加库存表
|
||||||
|
final TowerPartStock towerPartStock = new TowerPartStock();
|
||||||
|
towerPartStock.setGoodsId(towerPartGoods.getGoodsId());
|
||||||
|
towerPartStock.setTenantId(towerPartGoods.getTenantId());
|
||||||
|
towerPartStockService.save(towerPartStock);
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
|
|||||||
@@ -103,5 +103,4 @@ public class TowerPartGoods implements Serializable {
|
|||||||
@ApiModelProperty(value = "是否低于最低库存")
|
@ApiModelProperty(value = "是否低于最低库存")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer stockLower;
|
private Integer stockLower;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user