add device component

plp
chenshuichuan 2 years ago
parent 16a12628eb
commit 8bf81f1416

@ -124,10 +124,6 @@ public class ErpProductController {
categorys.add(caDO.getId().intValue());
}
}
// categorys.add(ProductTypeEnum.ITEM.getTypeId());
// categorys.add(ProductTypeEnum.TOOL.getTypeId());
// categorys.add(ProductTypeEnum.HAOCAI.getTypeId());
// categorys.add(ProductTypeEnum.GUANJJ.getTypeId());
List<ErpProductDO> productDOList = productService.selectByCategorys(categorys);
List<ErpProductRespVO> list = productService.buildProductVOList(productDOList);
@ -137,9 +133,18 @@ public class ErpProductController {
.setUnitId(product.getUnitId()).setUnitName(product.getUnitName())
.setPurchasePrice(product.getPurchasePrice()).setSalePrice(product.getSalePrice()).setMinPrice(product.getMinPrice())));
}
@GetMapping("/simple-list-component")
@Operation(summary = "获得备件精简列表", description = "用于前端的下拉选项")
public CommonResult<List<ErpProductRespVO>> getComponentSimpleList() {
List<ErpProductRespVO> list = productService.getProductVOListByCategory(ProductTypeEnum.BEIJIAN.getTypeId());
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("/export-excel")
@Operation(summary = "导出产品 Excel")
//@PreAuthorize("@ss.hasPermission('erp:product:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProductExcel(@Valid ErpProductPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {

@ -73,4 +73,7 @@ public class ErpProductRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "预警库存", example = "161.87")
@ExcelProperty("预警库存")
private BigDecimal safetyNumber;
}

@ -55,4 +55,6 @@ public class ProductSaveReqVO {
@Schema(description = "最低价格,单位:元", example = "161.87")
private BigDecimal minPrice;
@Schema(description = "预警库存", example = "161.87")
private BigDecimal safetyNumber;
}

@ -126,7 +126,7 @@ public class ErpStockInController {
list.add(StockInTypeEnum..getValue());
list.add(StockInTypeEnum..getValue());
list.add(StockInTypeEnum..getValue());
list.add(StockInTypeEnum..getValue());
list.add(StockInTypeEnum..getValue());
pageReqVO.setInTypeList(list);
}
PageResult<ErpStockInDO> pageResult = stockInService.getStockInPage(pageReqVO);
@ -186,5 +186,12 @@ public class ErpStockInController {
PageResult<ErpStockInDO> pageResult = stockInService.getStockInPage(pageReqVO);
return success(buildStockInVOPageResult(pageResult));
}
@GetMapping("/pageComponent")
@Operation(summary = "获得备件入库单分页")
public CommonResult<PageResult<ErpStockInRespVO>> pageComponent(@Valid ErpStockInPageReqVO pageReqVO) {
pageReqVO.setInType(StockInTypeEnum..getValue());
PageResult<ErpStockInDO> pageResult = stockInService.getStockInPage(pageReqVO);
return success(buildStockInVOPageResult(pageResult));
}
}

@ -8,7 +8,7 @@ import lombok.Getter;
public enum StockInTypeEnum {
("其他入库"),
("关键件入库"),
("备件入库"),
("原料入库"),
("产品入库"),
("生产入库");

@ -83,4 +83,8 @@ public class ErpProductDO extends BaseDO {
*/
private BigDecimal minPrice;
/**
*
*/
private BigDecimal safetyNumber;
}

@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.erp.framework.bean;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -15,7 +14,7 @@ public enum ProductTypeEnum implements IntArrayValuable {
PRODUCT(2, "产品"),
TOOL(3, "工具"),
HAOCAI(4, "耗材"),
GUANJJ(5, "关键件");
BEIJIAN(5, "备件");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductTypeEnum::getTypeId).toArray();
/**

@ -10,7 +10,8 @@ public enum MachineTypeEnum {
线(1),
(2),
(3);
(3),
(4);
private final Integer value;

Loading…
Cancel
Save