| | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.dto.mm.FinishedOperateLogDTO; |
| | | import com.example.erp.entity.mm.*; |
| | | import com.example.erp.entity.pp.OptimizeUse; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.mm.MaterialInventoryService; |
| | | import com.example.erp.service.mm.MaterialStoreService; |
| | | import com.example.erp.tools.DownExcel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @SaCheckPermission("selectIngredientsStock.add") |
| | | @PostMapping("/saveMaterialInventory") |
| | | public Result saveMaterialInventory( @RequestBody Map<String,Object> object){ |
| | | if(materialInventoryService.saveMaterialInventory(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | | |
| | | } |
| | | return Result.seccess(materialInventoryService.saveMaterialInventory(object)); |
| | | } |
| | | |
| | | @ApiOperation("物料库存加时间查询接口") |
| | |
| | | return Result.seccess(materialInventoryService.getSelectReturningWarehouse(pageNum,pageSize,returningWarehouseDetail)); |
| | | } |
| | | |
| | | @ApiOperation("物料返库删除接口") |
| | | @SaCheckPermission("returnToStorageCreate.delete") |
| | | @PostMapping("/deleteReturnToStorage") |
| | | public Result deleteReturnToStorage( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(materialInventoryService.deleteReturnToStorage(object)); |
| | | } |
| | | |
| | | @ApiOperation("物料返库审核接口") |
| | | @SaCheckPermission("returnToStorageCreate.review") |
| | | @PostMapping("/updateReturningWarehouseToExamine") |
| | |
| | | return Result.seccess(materialInventoryService.printCreateOutbound(materialOutboundId)); |
| | | } |
| | | |
| | | @ApiOperation("物料库存记录查询接口") |
| | | @SaCheckPermission("warehouseReport.search") |
| | | @PostMapping("/getMaterialLogReport/{type}/{pageNum}/{pageSize}/{selectDate}") |
| | | public Result getMaterialLogReport(@PathVariable String type,@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody MaterialLog materialLog){ |
| | | return Result.seccess(materialInventoryService.getMaterialLogReport(type,pageNum,pageSize,selectDate,materialLog)); |
| | | } |
| | | |
| | | @ApiOperation("物料库存删除") |
| | | @SaCheckPermission("createOutbound.search") |
| | | @PostMapping("/deleteMaterialInventory") |
| | | public Result deleteMaterialInventory(@RequestBody Map<String,Object> object){ |
| | | return Result.seccess(materialInventoryService.deleteMaterialInventory(object)); |
| | | } |
| | | |
| | | @ApiOperation("物料报表导出") |
| | | @PostMapping("/exportMaterialLogReport/{type}") |
| | | public void exportMaterialLogReport(@PathVariable String type, HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, MaterialLog.class, materialInventoryService.exportMaterialLogReport(dates,type),"orderReport"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("mes切割报工") |
| | | @PostMapping ("/mesMaterialOutbound") |
| | | public Result mesMaterialOutbound(@RequestBody Map<String,Object> reportingWork) { |
| | | return Result.seccess(materialInventoryService.mesMaterialOutbound(reportingWork)); |
| | | } |
| | | |
| | | @ApiOperation("物料新增返回接口") |
| | | @PostMapping("/cancelMaterialAdditionRecord") |
| | | public Result cancelMaterialAdditionRecord( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(materialInventoryService.cancelMaterialAdditionRecord(object)); |
| | | } |
| | | |
| | | @ApiOperation("优化物料库存记录查询接口") |
| | | @SaCheckPermission("warehouseReport.search") |
| | | @PostMapping("/getOptimizeOutboundReport/{type}/{pageNum}/{pageSize}/{selectDate}") |
| | | public Result getOptimizeOutboundReport(@PathVariable String type,@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody MaterialLog materialLog){ |
| | | return Result.seccess(materialInventoryService.getOptimizeOutboundReport(type,pageNum,pageSize,selectDate,materialLog)); |
| | | } |
| | | |
| | | |
| | | } |