| | |
| | | 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.dto.ProductMaterialConfigDto; |
| | | import com.ruoyi.production.dto.ProductMaterialGroupDto; |
| | | import com.ruoyi.production.pojo.ProductMaterial; |
| | | import com.ruoyi.production.pojo.ProductMaterialConfig; |
| | | import com.ruoyi.production.service.ProductMaterialConfigService; |
| | | 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 org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | @Autowired |
| | | private ProductMaterialService productMaterialService; |
| | | |
| | | @Autowired |
| | | private ProductMaterialConfigService productMaterialConfigService; |
| | | |
| | | @GetMapping("/loadData") |
| | | @ApiOperation("拉取物料编码数据") |
| | | @Log(title = "拉取物料编码数据", businessType = BusinessType.INSERT) |
| | |
| | | @ApiOperation("物料数据") |
| | | @Log(title = "物料数据", businessType = BusinessType.OTHER) |
| | | public AjaxResult productMaterialList(String materialName) { |
| | | Map<String, List<ProductMaterial>> productMaterialMap = productMaterialService.ProductMaterialList(materialName); |
| | | List<ProductMaterialGroupDto> productMaterialMap = productMaterialService.ProductMaterialList(materialName); |
| | | return AjaxResult.success(productMaterialMap); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/materialTypeList") |
| | | @ApiOperation("物料类型数据集合") |
| | | @Log(title = "物料类型数据集合", businessType = BusinessType.OTHER) |
| | | public AjaxResult materialTypeList() { |
| | | List<ProductMaterialConfig> list = productMaterialConfigService.materialTypeList(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/inventoryCategoryList") |
| | | @ApiOperation("'存货类别数据集合") |
| | | @Log(title = "'存货类别数据集合", businessType = BusinessType.OTHER) |
| | | public AjaxResult inventoryCategoryList() { |
| | | List<ProductMaterialConfig> list = productMaterialConfigService.inventoryCategoryList(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @PostMapping("/config/add") |
| | | @ApiOperation("新增物料配置") |
| | | @Log(title = "新增物料配置", businessType = BusinessType.INSERT) |
| | | public AjaxResult addProductMaterialConfig(@RequestBody ProductMaterialConfigDto config) { |
| | | productMaterialConfigService.addProductMaterialConfig(config); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PutMapping("/config/update") |
| | | @ApiOperation("修改物料配置") |
| | | @Log(title = "修改物料配置", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateProductMaterialConfig(@RequestBody ProductMaterialConfigDto config) { |
| | | productMaterialConfigService.updateProductMaterialConfig(config); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @DeleteMapping("/config/delete") |
| | | @ApiOperation("删除物料配置") |
| | | @Log(title = "删除物料配置", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteProductMaterialConfig(@RequestBody List<Integer> ids) { |
| | | productMaterialConfigService.deleteProductMaterialConfig(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |