| | |
| | | return AjaxResult.success(productionPlanService.add(productionPlanDto)); |
| | | } |
| | | |
| | | @PutMapping("") |
| | | @Log(title = "更新生产计划", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("更新生产计划") |
| | | public AjaxResult update(@RequestBody ProductionPlanDto productionPlanDto) { |
| | | return AjaxResult.success(productionPlanService.updateById(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) |
| | |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 判断下发数量是否大于等于方数 |
| | | if (productionPlanDto.getTotalAssignedQuantity().compareTo(totalVolume) > 0) { |
| | | log.warn("合并失败,下发数量不能大于方数"); |
| | | log.warn("操作失败,下发数量不能大于方数"); |
| | | return false; |
| | | } |
| | | |
| | |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="listPage" resultMap="ProductionPlanResultMap"> |
| | | <select id="listPage" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto"> |
| | | SELECT * |
| | | FROM production_plan |
| | | FROM production_plan pp |
| | | WHERE 1 = 1 |
| | | <if test="c.customerName != null and c.customerName != '' "> |
| | | AND pp.customer_name LIKE CONCAT('%',#{c.customerName},'%') |
| | | </if> |
| | | <if test="c.productName != null and c.productName != '' "> |
| | | AND pp.product_name LIKE CONCAT('%',#{c.productName},'%') |
| | | </if> |
| | | <if test="c.productSpec != null and c.productSpec != '' "> |
| | | AND pp.product_spec LIKE CONCAT('%',#{c.productSpec},'%') |
| | | </if> |
| | | <if test="c.materialCode != null and c.materialCode != '' "> |
| | | AND pp.material_code LIKE CONCAT('%',#{c.materialCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto"> |