| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Log(title = "合并生产计划", businessType = BusinessType.INSERT) |
| | | @ApiOperation("合并生产计划") |
| | | public AjaxResult combine(@RequestBody ProductionPlanDto productionPlanDto) { |
| | | if (productionPlanDto.getIds() == null || productionPlanDto.getIds().isEmpty()) { |
| | | return AjaxResult.error("请选择要下发的生产计划"); |
| | | } |
| | | |
| | | if (productionPlanDto.getTotalAssignedQuantity() == null || productionPlanDto.getTotalAssignedQuantity().compareTo(BigDecimal.ZERO) <= 0) { |
| | | return AjaxResult.error("请输入下发数量"); |
| | | } |
| | | return AjaxResult.success(productionPlanService.combine(productionPlanDto)); |
| | | } |
| | | |
| | |
| | | return AjaxResult.success(productionPlanService.add(productionPlanDto)); |
| | | } |
| | | |
| | | @PutMapping("") |
| | | @Log(title = "更新生产计划", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("更新生产计划") |
| | | public AjaxResult update(@RequestBody ProductionPlanDto productionPlanDto) { |
| | | return AjaxResult.success(productionPlanService.update(productionPlanDto)); |
| | | } |
| | | |
| | | @DeleteMapping("") |
| | | @Log(title = "删除生产计划", businessType = BusinessType.DELETE) |
| | | @ApiOperation("删除生产计划") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(productionPlanService.removeByIds(ids)); |
| | | } |
| | | |
| | | @GetMapping("/summaryByProductType") |
| | | @ApiOperation("按照产品类别汇总统计需求量") |
| | | @Log(title = "按照产品类别汇总统计需求量", businessType = BusinessType.OTHER) |
| | |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/downloadTemplate") |
| | | @PostMapping("/downloadTemplate") |
| | | @Log(title = "下载主生产计划导入模板", businessType = BusinessType.EXPORT) |
| | | @ApiOperation("下载主生产计划导入模板") |
| | | public void importTemplate(HttpServletResponse response) { |