|
|
|
|
@ -80,7 +80,16 @@ public class ErpProductController {
|
|
|
|
|
public CommonResult<PageResult<ErpProductRespVO>> getProductPage(@Valid ErpProductPageReqVO pageReqVO) {
|
|
|
|
|
return success(productService.getProductVOPage(pageReqVO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/simple-list-all")
|
|
|
|
|
@Operation(summary = "获得所有精简列表", description = "只包含被开启的产品,主要用于前端的下拉选项")
|
|
|
|
|
public CommonResult<List<ErpProductRespVO>> getAllSimpleList() {
|
|
|
|
|
List<ErpProductRespVO> list = productService.getProductVOListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
|
|
|
|
return success(convertList(list, product -> new ErpProductRespVO().setId(product.getId())
|
|
|
|
|
.setName(product.getName()).setBarCode(product.getBarCode())
|
|
|
|
|
.setCategoryId(product.getCategoryId()).setCategoryName(product.getCategoryName())
|
|
|
|
|
.setUnitId(product.getUnitId()).setUnitName(product.getUnitName())
|
|
|
|
|
.setPurchasePrice(product.getPurchasePrice()).setSalePrice(product.getSalePrice()).setMinPrice(product.getMinPrice())));
|
|
|
|
|
}
|
|
|
|
|
@GetMapping("/simple-list-product")
|
|
|
|
|
@Operation(summary = "获得产品精简列表", description = "只包含被开启的产品,主要用于前端的下拉选项")
|
|
|
|
|
public CommonResult<List<ErpProductRespVO>> getProductSimpleList() {
|
|
|
|
|
@ -107,10 +116,14 @@ public class ErpProductController {
|
|
|
|
|
List<ErpProductRespVO> list1 = productService.getProductVOListByCategory(ProductTypeEnum.ITEM.getTypeId());
|
|
|
|
|
List<ErpProductRespVO> list2 = productService.getProductVOListByCategory(ProductTypeEnum.TOOL.getTypeId());
|
|
|
|
|
List<ErpProductRespVO> list3 = productService.getProductVOListByCategory(ProductTypeEnum.HAOCAI.getTypeId());
|
|
|
|
|
List<ErpProductRespVO> list4 = productService.getProductVOListByCategory(ProductTypeEnum.GUANJJ.getTypeId());
|
|
|
|
|
|
|
|
|
|
List<ErpProductRespVO> list = new ArrayList<>();
|
|
|
|
|
list.addAll(list3);
|
|
|
|
|
list.addAll(list1);
|
|
|
|
|
list.addAll(list2);
|
|
|
|
|
list.addAll(list4);
|
|
|
|
|
|
|
|
|
|
return success(convertList(list, product -> new ErpProductRespVO().setId(product.getId())
|
|
|
|
|
.setName(product.getName()).setBarCode(product.getBarCode())
|
|
|
|
|
.setCategoryId(product.getCategoryId()).setCategoryName(product.getCategoryName())
|
|
|
|
|
|