gongchunyi
2 天以前 f05fd2a067d751333f00a81dad095a7650900c95
src/main/java/com/ruoyi/productionPlan/controller/ProductionPlanController.java
@@ -16,6 +16,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -53,6 +54,13 @@
    @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));
    }
@@ -63,6 +71,20 @@
        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)