| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.pojo.ProductMaterial; |
| | | import com.ruoyi.production.service.ProductMaterialService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation("物料数据") |
| | | @Log(title = "物料数据", businessType = BusinessType.OTHER) |
| | | public AjaxResult productMaterialList(String materialName) { |
| | | Map<String, List<ProductMaterial>> productMaterialMap = productMaterialService.ProductMaterialList(materialName); |
| | | return AjaxResult.success(productMaterialMap); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增物料") |
| | | @Log(title = "新增物料", businessType = BusinessType.INSERT) |
| | | public AjaxResult addProductMaterial(@RequestBody ProductMaterial productMaterial) { |
| | | productMaterialService.addProductMaterial(productMaterial); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @ApiOperation("修改物料") |
| | | @Log(title = "修改物料", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateProductMaterial(@RequestBody ProductMaterial productMaterial) { |
| | | productMaterialService.updateProductMaterial(productMaterial); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除物料") |
| | | @Log(title = "删除物料", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteProductMaterial(@RequestBody List<Long> ids) { |
| | | productMaterialService.deleteProductMaterial(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |