Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update product barcode type and export logic business code #250

Merged
merged 4 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ProductController(ProductService productService, ProductStockKeepUnitServ
}

@GetMapping("getProductCode")
public Response<Long> getProductCode() {
public Response<String> getProductCode() {
return extendPriceService.getProductCode();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Response<IPage<ProductStockKeepUnitVO>> getProductExtendPrice(@RequestBod
}

@GetMapping("getProduct/{barCode}/{warehouseId}")
public Response<ProductStockKeepUnitVO> getProductByBarCode(@PathVariable("barCode") Long barCode, @PathVariable("warehouseId")Long warehouseId) {
public Response<ProductStockKeepUnitVO> getProductByBarCode(@PathVariable("barCode") String barCode, @PathVariable("warehouseId")Long warehouseId) {
return productStockService.getProductByBarCode(barCode, warehouseId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public interface ProductStockMapper extends BaseMapper<ProductStock> {

IPage<ProductStockKeepUnitVO> getProductSkuList(IPage<QueryProductStockKeepUnitDTO> pageObject, QueryProductStockKeepUnitDTO queryProductStockKeepUnitDTO);

ProductStockKeepUnitVO getProductSkuByBarCode(Long barCode, Long warehouseId);
ProductStockKeepUnitVO getProductSkuByBarCode(String barCode, Long warehouseId);

ProductStockKeepUnitVO getProductSkuDetail(Long productId, Long warehouseId, Long barCode);
ProductStockKeepUnitVO getProductSkuDetail(Long productId, Long warehouseId, String barCode);

Page<ProductStockVO> getProductStock(IPage<QueryProductStockDTO> pageObject, QueryProductStockDTO queryProductStockDTO);

Expand Down
3 changes: 1 addition & 2 deletions core/domain/src/main/java/com/wansenai/bo/AllotStockBO.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class AllotStockBO {

private String otherWarehouseName;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long barCode;
private String barCode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;
Expand Down
16 changes: 14 additions & 2 deletions core/domain/src/main/java/com/wansenai/bo/AssembleStockBO.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.utils.excel.ExcelExport;
import lombok.Builder;
import lombok.Data;

Expand All @@ -26,36 +27,47 @@ public class AssembleStockBO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@ExcelExport("商品类型")
private String type;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long warehouseId;

@ExcelExport("仓库")
private String warehouseName;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long barCode;
@ExcelExport("条码")
private String barCode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;

@ExcelExport("商品名称")
private String productName;

@ExcelExport("商品型号")
private String productModel;

@ExcelExport("单位")
private String productUnit;

@ExcelExport("商品规格")
private String productStandard;

@ExcelExport("库存")
private Integer stock;

@ExcelExport("商品数量")
private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport("单价")
private BigDecimal unitPrice;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport("金额")
private BigDecimal amount;

@ExcelExport("备注")
private String remark;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public class PurchaseDataBO {

private String warehouseName;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long barCode;
private String barCode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;
Expand Down
3 changes: 1 addition & 2 deletions core/domain/src/main/java/com/wansenai/bo/SalesDataBO.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public class SalesDataBO {

private String warehouseName;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long barCode;
private String barCode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public class ShipmentsDataBO {

private String productCode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long barCode;
private String barCode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ public class StorageShipmentStockBO {
private Long warehouseId;

private String warehouseName;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long barCode;

private String barCode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ProductStockKeepUnitDTO {

private Integer productCode;

private Long barCode;
private String barCode;

private String productUnit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class QueryStockFlowDTO {

private Long warehouseId;

private Long productBarcode;
private String productBarcode;

private String receiptNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ public class QueryDisassembleReceiptDTO {
private Long page;

private Long pageSize;

private Boolean isExportDetail;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class ProductStockKeepUnit implements Serializable {
/**
* 商品条码
*/
private Long productBarCode;
private String productBarCode;

/**
* 商品单位
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ReceiptPurchaseSub implements Serializable {

private Long warehouseId;

private Long productBarcode;
private String productBarcode;

private Integer productNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ReceiptRetailSub implements Serializable {

private Long warehouseId;

private Long productBarcode;
private String productBarcode;

private Integer productNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ReceiptSaleSub implements Serializable {

private Long warehouseId;

private Long productBarcode;
private String productBarcode;

private Integer productNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class WarehouseReceiptSub {
/**
* 商品条码
*/
private Long productBarcode;
private String productBarcode;

/**
* 商品数量
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public class ExportProductVO {

private String productUnit;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String multiAttribute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public class ProductPriceVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productPriceId;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long barCode;
private String barCode;

private String productUnit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public class ProductVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productUnitId;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ReceiptDetailVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long warehouseId;

private Long productBarcode;
private String productBarcode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public class ReceiptRetailDetailVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public class ProductStockVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long warehouseId;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String warehouseName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
@Builder
public class PurchaseReportVO {

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
@Builder
public class RetailReportVO {

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
@Builder
public class SalesReportVO {

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public class ShipmentsDetailVO {

private String receiptNumber;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
@Builder
public class ShipmentsSummaryVO {

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public class StockFlowVO {

private String type;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public class StorageDetailVO {

private String receiptNumber;

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
@Builder
public class StorageSummaryVO {

@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productBarcode;
private String productBarcode;

private String productName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private boolean readProductFromExcel(MultipartFile file) throws IOException {
var productPrice = ProductStockKeepUnit.builder()
.id(SnowflakeIdUtil.nextId())
.productId(productId)
.productBarCode(Long.valueOf(productCode))
.productBarCode(productCode)
.multiAttribute(getCellValue(row.getCell(11), dataFormatter))
.purchasePrice(getNumericCellValue(row.getCell(12)))
.retailPrice(getNumericCellValue(row.getCell(13)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public interface ProductStockKeepUnitService extends IService<ProductStockKeepUnit> {

Response<Long> getProductCode();
Response<String> getProductCode();

Boolean checkProductCode(List<String> barCodes);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface ProductStockService extends IService<ProductStock> {

IPage<ProductStockKeepUnitVO> getProductExtendPriceInfo(QueryProductStockKeepUnitDTO priceDTO);

Response<ProductStockKeepUnitVO> getProductByBarCode(Long barCode, Long warehouseId);
Response<ProductStockKeepUnitVO> getProductByBarCode(String barCode, Long warehouseId);

List<ProductStockVO> getProductStockList(Long productSukId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public Response<String> addOrUpdateProduct(AddOrUpdateProductDTO productDTO) {
ProductStockKeepUnit price = ProductStockKeepUnit.builder()
.id(productSkuId)
.productId(productId)
.productBarCode(getNumberValue(priceDTO.getBarCode()))
.productBarCode(priceDTO.getBarCode())
.productUnit(getStringValue(priceDTO.getProductUnit()))
.multiAttribute(getStringValue(priceDTO.getMultiAttribute()))
.purchasePrice(getBigDecimalValue(priceDTO.getPurchasePrice()))
Expand Down
Loading