| | |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.service.IProductModelService; |
| | | import com.ruoyi.basic.service.IProductService; |
| | | import com.ruoyi.basic.vo.ProductModelVo; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | 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.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | |
| | | @Operation(summary = "分页查询所有产品型号") |
| | | @GetMapping("/pageModel") |
| | | public IPage<ProductModel> listPageProductModel(Page<ProductModel> page, ProductModel productModel) { |
| | | public IPage<ProductModelVo> listPageProductModel(Page<ProductModelVo> page, ProductModel productModel) { |
| | | return productService.listPageProductModel(page, productModel); |
| | | } |
| | | |
| | | /** |
| | | * 根据条码精确查询产品规格(采购/销售/库存扫码选商品) |
| | | */ |
| | | @Operation(summary = "根据条码查询产品规格") |
| | | @GetMapping("/model/byBarcode") |
| | | public AjaxResult selectByBarcode(@RequestParam String barcode) { |
| | | if (barcode == null || barcode.trim().isEmpty()) { |
| | | return AjaxResult.error("请传入条码"); |
| | | } |
| | | ProductModel productModel = productModelService.selectByBarcode(barcode); |
| | | if (productModel == null) { |
| | | return AjaxResult.error("条码 " + barcode + " 未匹配到产品规格"); |
| | | } |
| | | return AjaxResult.success(productModel); |
| | | } |
| | | |
| | | /** |
| | | * 导入产品 |
| | | */ |
| | | @PostMapping("/import") |