package com.example.erp.controller.mm;
|
|
|
import com.example.erp.common.Constants;
|
import com.example.erp.common.Result;
|
import com.example.erp.entity.mm.MaterialInventory;
|
import com.example.erp.entity.mm.MaterialOutbound;
|
import com.example.erp.entity.mm.MaterialOutboundDetail;
|
import com.example.erp.entity.mm.MaterialStore;
|
import com.example.erp.exception.ServiceException;
|
import com.example.erp.service.mm.MaterialInventoryService;
|
import com.example.erp.service.mm.MaterialStoreService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
import java.util.Map;
|
|
@RestController
|
@RequestMapping("/MaterialInventory")
|
@Api(value="物料库存controller",tags={"物料库存操作接口"})
|
public class MaterialInventoryController {
|
@Autowired
|
MaterialInventoryService materialInventoryService;
|
|
@ApiOperation("物料出库新增接口")
|
@PostMapping("/saveMaterialOutbound")
|
public Result saveMaterialOutbound( @RequestBody Map<String,Object> object){
|
if(materialInventoryService.saveMaterialOutbound(object)){
|
return Result.seccess();
|
}else {
|
throw new ServiceException(Constants.Code_500,"保存失败");
|
|
}
|
}
|
|
@ApiOperation("物料新增接口")
|
@PostMapping("/saveMaterialInventory")
|
public Result saveMaterialInventory( @RequestBody Map<String,Object> object){
|
if(materialInventoryService.saveMaterialInventory(object)){
|
return Result.seccess();
|
}else {
|
throw new ServiceException(Constants.Code_500,"保存失败");
|
|
}
|
}
|
|
@ApiOperation("物料库存加时间查询接口")
|
@PostMapping("/getSelectMaterialInventoryDate/{pageNum}/{pageSize}/{selectDate}")
|
public Result getSelectMaterialInventoryDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialInventory materialInventory){
|
return Result.seccess(materialInventoryService.getSelectMaterialInventoryDate(pageNum,pageSize,selectDate,materialInventory));
|
}
|
|
@ApiOperation("物料库存查询接口")
|
@PostMapping("/getSelectMaterialInventory/{pageNum}/{pageSize}")
|
public Result getSelectMaterialInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialInventory materialInventory){
|
return Result.seccess(materialInventoryService.getSelectMaterialInventory(pageNum,pageSize,materialInventory));
|
}
|
|
@ApiOperation("材料出库查询接口")
|
@PostMapping("/getSelectMaterialOutboundDate/{pageNum}/{pageSize}/{selectDate}")
|
public Result getSelectMaterialOutboundDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialOutbound materialOutbound){
|
return Result.seccess(materialInventoryService.getSelectMaterialOutboundDate(pageNum,pageSize,selectDate, materialOutbound));
|
}
|
|
@ApiOperation("材料出库查询接口")
|
@PostMapping("/getSelectMaterialOutbound/{pageNum}/{pageSize}")
|
public Result getSelectMaterialOutbound(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialOutboundDetail materialOutboundDetail){
|
return Result.seccess(materialInventoryService.getSelectMaterialOutbound(pageNum,pageSize,materialOutboundDetail));
|
}
|
|
@ApiOperation("材料出库修改接口")
|
@PostMapping("/updateMaterialOutboundToExamine")
|
public Result updateMaterialOutboundToExamine( @RequestBody Map<String,Object> object){
|
if(materialInventoryService.updateMaterialOutboundToExamine(object)){
|
return Result.seccess();
|
|
}else {
|
throw new ServiceException(Constants.Code_500,"审核失败");
|
|
}
|
}
|
|
@ApiOperation("物料删除接口")
|
@PostMapping("/deleteMaterialOutbound")
|
public Result deleteMaterialOutbound( @RequestBody Map<String,Object> object){
|
if(materialInventoryService.deleteMaterialOutbound(object)){
|
|
return Result.seccess();
|
|
}else {
|
throw new ServiceException(Constants.Code_500,"删除失败");
|
|
}
|
}
|
|
|
|
|
}
|