From 7574c7af2c7a548499d8fc55405b52094ebaf680 Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:48:51 +0800 Subject: [PATCH 01/10] new: add allot receipt data object --- .../dto/warehouse/AllotReceiptDTO.java} | 34 ++++++++------ .../dto/warehouse/QueryAllotReceiptDTO.java} | 36 +++++++++------ .../vo/warehouse/AllotReceiptDetailVO.java | 37 +++++++++++++++ .../wansenai/vo/warehouse/AllotReceiptVO.java | 46 +++++++++++++++++++ 4 files changed, 125 insertions(+), 28 deletions(-) rename core/{api/src/main/java/com/wansenai/api/warehouse/WarehouseItemController.java => domain/src/main/java/com/wansenai/dto/warehouse/AllotReceiptDTO.java} (58%) rename core/{api/src/main/java/com/wansenai/api/warehouse/WarehouseHeadController.java => domain/src/main/java/com/wansenai/dto/warehouse/QueryAllotReceiptDTO.java} (59%) create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptDetailVO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptVO.java diff --git a/core/api/src/main/java/com/wansenai/api/warehouse/WarehouseItemController.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/AllotReceiptDTO.java similarity index 58% rename from core/api/src/main/java/com/wansenai/api/warehouse/WarehouseItemController.java rename to core/domain/src/main/java/com/wansenai/dto/warehouse/AllotReceiptDTO.java index 7ff8d3d8..b87a041f 100644 --- a/core/api/src/main/java/com/wansenai/api/warehouse/WarehouseItemController.java +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/AllotReceiptDTO.java @@ -10,22 +10,28 @@ * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ -package com.wansenai.api.warehouse; +package com.wansenai.dto.warehouse; -import org.springframework.web.bind.annotation.RequestMapping; +import com.wansenai.bo.AllotStockBO; +import com.wansenai.bo.FileDataBO; +import lombok.Data; -import org.springframework.web.bind.annotation.RestController; +import java.util.List; -/** - *

- * 单据子表 前端控制器 - *

- * - * @author James Zow - * @since 2023-09-05 - */ -@RestController -@RequestMapping("/warehouseItem") -public class WarehouseItemController { +@Data +public class AllotReceiptDTO { + + private Long id; + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + private List files; } diff --git a/core/api/src/main/java/com/wansenai/api/warehouse/WarehouseHeadController.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryAllotReceiptDTO.java similarity index 59% rename from core/api/src/main/java/com/wansenai/api/warehouse/WarehouseHeadController.java rename to core/domain/src/main/java/com/wansenai/dto/warehouse/QueryAllotReceiptDTO.java index 4be87bf0..779c3a90 100644 --- a/core/api/src/main/java/com/wansenai/api/warehouse/WarehouseHeadController.java +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryAllotReceiptDTO.java @@ -10,22 +10,30 @@ * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ -package com.wansenai.api.warehouse; +package com.wansenai.dto.warehouse; -import org.springframework.web.bind.annotation.RequestMapping; +import lombok.Data; -import org.springframework.web.bind.annotation.RestController; +@Data +public class QueryAllotReceiptDTO { -/** - *

- * 单据主表 前端控制器 - *

- * - * @author James Zow - * @since 2023-09-05 - */ -@RestController -@RequestMapping("/warehouseHead") -public class WarehouseHeadController { + private String receiptNumber; + + private String productInfo; + + private Long warehouseId; + + private Long operatorId; + + private Integer status; + + private String remark; + + private String startDate; + + private String endDate; + + private Long page; + private Long pageSize; } diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptDetailVO.java new file mode 100644 index 00000000..798edd5e --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptDetailVO.java @@ -0,0 +1,37 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.wansenai.bo.AllotStockBO; +import com.wansenai.bo.FileDataBO; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class AllotReceiptDetailVO { + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptVO.java new file mode 100644 index 00000000..9d619605 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/AllotReceiptVO.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.wansenai.bo.BigDecimalSerializerBO; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@Builder +public class AllotReceiptVO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + private String receiptNumber; + + private String productInfo; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime receiptDate; + + private String operator; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal totalAmount; + + private Integer status; +} From 1b1aa7fdfd958e39ffdfb7c9b87635e51a97b4de Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:48:58 +0800 Subject: [PATCH 02/10] new: add allot receipt data object --- .../java/com/wansenai/bo/AllotStockBO.java | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 core/domain/src/main/java/com/wansenai/bo/AllotStockBO.java diff --git a/core/domain/src/main/java/com/wansenai/bo/AllotStockBO.java b/core/domain/src/main/java/com/wansenai/bo/AllotStockBO.java new file mode 100644 index 00000000..31544e00 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/bo/AllotStockBO.java @@ -0,0 +1,64 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.bo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@Builder +public class AllotStockBO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long warehouseId; + + private String warehouseName; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long otherWarehouseId; + + private String otherWarehouseName; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long barCode; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long productId; + + private String productName; + + private String productModel; + + private String productUnit; + + private String productStandard; + + private Integer stock; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal unitPrice; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal amount; + + private String remark; +} From e1335ada00422196e1a35f25afe8c01f63929836 Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:49:21 +0800 Subject: [PATCH 03/10] new: add assemble receipt data object --- .../java/com/wansenai/bo/AssembleStockBO.java | 61 +++++++++++++++++++ .../dto/warehouse/AssembleReceiptDTO.java | 37 +++++++++++ .../warehouse/QueryAssembleReceiptDTO.java | 39 ++++++++++++ .../vo/warehouse/AssembleReceiptDetailVO.java | 37 +++++++++++ .../vo/warehouse/AssembleReceiptVO.java | 46 ++++++++++++++ 5 files changed, 220 insertions(+) create mode 100644 core/domain/src/main/java/com/wansenai/bo/AssembleStockBO.java create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/AssembleReceiptDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/QueryAssembleReceiptDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptDetailVO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptVO.java diff --git a/core/domain/src/main/java/com/wansenai/bo/AssembleStockBO.java b/core/domain/src/main/java/com/wansenai/bo/AssembleStockBO.java new file mode 100644 index 00000000..071966b2 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/bo/AssembleStockBO.java @@ -0,0 +1,61 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.bo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@Builder +public class AssembleStockBO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + private String type; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long warehouseId; + + private String warehouseName; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long barCode; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long productId; + + private String productName; + + private String productModel; + + private String productUnit; + + private String productStandard; + + private Integer stock; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal unitPrice; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal amount; + + private String remark; +} diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/AssembleReceiptDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/AssembleReceiptDTO.java new file mode 100644 index 00000000..cde87f6a --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/AssembleReceiptDTO.java @@ -0,0 +1,37 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import com.wansenai.bo.AssembleStockBO; +import com.wansenai.bo.FileDataBO; +import lombok.Data; + +import java.util.List; + +@Data +public class AssembleReceiptDTO { + + private Long id; + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryAssembleReceiptDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryAssembleReceiptDTO.java new file mode 100644 index 00000000..cfcc8ea4 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryAssembleReceiptDTO.java @@ -0,0 +1,39 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import lombok.Data; + +@Data +public class QueryAssembleReceiptDTO { + + private String receiptNumber; + + private String productInfo; + + private Long warehouseId; + + private Long operatorId; + + private Integer status; + + private String remark; + + private String startDate; + + private String endDate; + + private Long page; + + private Long pageSize; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptDetailVO.java new file mode 100644 index 00000000..a9a1e47f --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptDetailVO.java @@ -0,0 +1,37 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.wansenai.bo.AssembleStockBO; +import com.wansenai.bo.FileDataBO; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class AssembleReceiptDetailVO { + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptVO.java new file mode 100644 index 00000000..5d6c9470 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/AssembleReceiptVO.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.wansenai.bo.BigDecimalSerializerBO; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@Builder +public class AssembleReceiptVO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + private String receiptNumber; + + private String productInfo; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime receiptDate; + + private String operator; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal totalAmount; + + private Integer status; +} From 48d76c487b53003fbd2f12fb9763af25916ff7fd Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:49:36 +0800 Subject: [PATCH 04/10] new: add dis assemble receipt data object --- .../dto/warehouse/DisassembleReceiptDTO.java | 37 +++++++++++++++ .../warehouse/QueryDisassembleReceiptDTO.java | 39 ++++++++++++++++ .../warehouse/DisassembleReceiptDetailVO.java | 37 +++++++++++++++ .../vo/warehouse/DisassembleReceiptVO.java | 46 +++++++++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/DisassembleReceiptDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/QueryDisassembleReceiptDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptDetailVO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptVO.java diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/DisassembleReceiptDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/DisassembleReceiptDTO.java new file mode 100644 index 00000000..efc3beee --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/DisassembleReceiptDTO.java @@ -0,0 +1,37 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import com.wansenai.bo.AssembleStockBO; +import com.wansenai.bo.FileDataBO; +import lombok.Data; + +import java.util.List; + +@Data +public class DisassembleReceiptDTO { + + private Long id; + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryDisassembleReceiptDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryDisassembleReceiptDTO.java new file mode 100644 index 00000000..59895111 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryDisassembleReceiptDTO.java @@ -0,0 +1,39 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import lombok.Data; + +@Data +public class QueryDisassembleReceiptDTO { + + private String receiptNumber; + + private String productInfo; + + private Long warehouseId; + + private Long operatorId; + + private Integer status; + + private String remark; + + private String startDate; + + private String endDate; + + private Long page; + + private Long pageSize; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptDetailVO.java new file mode 100644 index 00000000..ff9b77e4 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptDetailVO.java @@ -0,0 +1,37 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.wansenai.bo.AssembleStockBO; +import com.wansenai.bo.FileDataBO; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class DisassembleReceiptDetailVO { + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptVO.java new file mode 100644 index 00000000..adcc0aaa --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/DisassembleReceiptVO.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.wansenai.bo.BigDecimalSerializerBO; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@Builder +public class DisassembleReceiptVO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + private String receiptNumber; + + private String productInfo; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime receiptDate; + + private String operator; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal totalAmount; + + private Integer status; +} From 75e7111c0b1a95d9d4b3488982d357dfa8eb21bf Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:49:54 +0800 Subject: [PATCH 05/10] new: add shipment receipt data object --- .../dto/warehouse/OtherShipmentDTO.java | 39 +++++++++++++++ .../dto/warehouse/QueryOtherShipmentDTO.java | 43 +++++++++++++++++ .../vo/warehouse/OtherShipmentDetailVO.java | 43 +++++++++++++++++ .../vo/warehouse/OtherShipmentVO.java | 48 +++++++++++++++++++ 4 files changed, 173 insertions(+) create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/OtherShipmentDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherShipmentDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentDetailVO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentVO.java diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/OtherShipmentDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/OtherShipmentDTO.java new file mode 100644 index 00000000..bf1386fd --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/OtherShipmentDTO.java @@ -0,0 +1,39 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import com.wansenai.bo.FileDataBO; +import com.wansenai.bo.StorageShipmentStockBO; +import lombok.Data; + +import java.util.List; + +@Data +public class OtherShipmentDTO { + + private Long id; + + private Long customerId; + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherShipmentDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherShipmentDTO.java new file mode 100644 index 00000000..d47711c8 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherShipmentDTO.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import lombok.Data; + +@Data +public class QueryOtherShipmentDTO { + + private String receiptNumber; + + private String productInfo; + + private Long customerId; + + private Long warehouseId; + + private Long operatorId; + + private String otherReceipt; + + private Integer status; + + private String remark; + + private String startDate; + + private String endDate; + + private Long page; + + private Long pageSize; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentDetailVO.java new file mode 100644 index 00000000..6f133102 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentDetailVO.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.wansenai.bo.FileDataBO; +import com.wansenai.bo.StorageShipmentStockBO; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class OtherShipmentDetailVO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long customerId; + + private String customerName; + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentVO.java new file mode 100644 index 00000000..8302c541 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherShipmentVO.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.wansenai.bo.BigDecimalSerializerBO; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@Builder +public class OtherShipmentVO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + private String customerName; + + private String receiptNumber; + + private String productInfo; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime receiptDate; + + private String operator; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal totalAmount; + + private Integer status; +} From 444bdffeba57af6ccf89335c8598a8638e5c2194 Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:50:03 +0800 Subject: [PATCH 06/10] new: add storage receipt data object --- .../dto/warehouse/OtherStorageDTO.java | 39 +++++++++++++++ .../dto/warehouse/QueryOtherStorageDTO.java | 43 +++++++++++++++++ .../vo/warehouse/OtherStorageDetailVO.java | 43 +++++++++++++++++ .../wansenai/vo/warehouse/OtherStorageVO.java | 48 +++++++++++++++++++ 4 files changed, 173 insertions(+) create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/OtherStorageDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherStorageDTO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageDetailVO.java create mode 100644 core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageVO.java diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/OtherStorageDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/OtherStorageDTO.java new file mode 100644 index 00000000..618a2630 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/OtherStorageDTO.java @@ -0,0 +1,39 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import com.wansenai.bo.FileDataBO; +import com.wansenai.bo.StorageShipmentStockBO; +import lombok.Data; + +import java.util.List; + +@Data +public class OtherStorageDTO { + + private Long id; + + private Long supplierId; + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherStorageDTO.java b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherStorageDTO.java new file mode 100644 index 00000000..993bcd8c --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/dto/warehouse/QueryOtherStorageDTO.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.dto.warehouse; + +import lombok.Data; + +@Data +public class QueryOtherStorageDTO { + + private String receiptNumber; + + private String productInfo; + + private Long supplierId; + + private Long warehouseId; + + private Long operatorId; + + private String otherReceipt; + + private Integer status; + + private String remark; + + private String startDate; + + private String endDate; + + private Long page; + + private Long pageSize; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageDetailVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageDetailVO.java new file mode 100644 index 00000000..dc923d9d --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageDetailVO.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.wansenai.bo.FileDataBO; +import com.wansenai.bo.StorageShipmentStockBO; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class OtherStorageDetailVO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long supplierId; + + private String supplierName; + + private String receiptNumber; + + private String receiptDate; + + private String remark; + + private Integer status; + + private List tableData; + + private List files; +} diff --git a/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageVO.java b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageVO.java new file mode 100644 index 00000000..168d14fc --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/vo/warehouse/OtherStorageVO.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.vo.warehouse; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.wansenai.bo.BigDecimalSerializerBO; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@Builder +public class OtherStorageVO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + private String supplierName; + + private String receiptNumber; + + private String productInfo; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime receiptDate; + + private String operator; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal totalAmount; + + private Integer status; +} From ec2e498e30555c58a4edd4f772fb082b17341409 Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:50:14 +0800 Subject: [PATCH 07/10] new: add warehouse receipt data object --- .../warehouse/WarehouseReceiptMain.java | 135 ++++++++++++++++++ .../warehouse/WarehouseReceiptSub.java | 117 +++++++++++++++ 2 files changed, 252 insertions(+) create mode 100644 core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptMain.java create mode 100644 core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptSub.java diff --git a/core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptMain.java b/core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptMain.java new file mode 100644 index 00000000..e56edb4b --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptMain.java @@ -0,0 +1,135 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.entities.warehouse; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serial; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("warehouse_receipt_main") +public class WarehouseReceiptMain { + + @Serial + private static final long serialVersionUID = 4554191615716239L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 关联人id(客户/供应商) + */ + private Long relatedPersonId; + + /** + * 类型(入库/出库/调拨/组装/拆卸) + */ + private String type; + + /** + * 初始化单据编号 + */ + private String initReceiptNumber; + + /** + * 单据编号 + */ + private String receiptNumber; + + /** + * 单据日期 + */ + private LocalDateTime receiptDate; + + /** + * 合计金额 + */ + private BigDecimal totalAmount; + + /** + * 商品总数量 + */ + private Integer totalProductNumber; + + /** + * 商品数量 + */ + private String productInfo; + + /** + * 备注 + */ + private String remark; + + /** + * 文件id 多个逗号分隔 + */ + private String fileId; + + /** + * 状态,0未审核、1已审核 默认0 + */ + private Integer status; + + /** + * 单据来源,0-pc,1-手机 + */ + private Integer source; + + /** + * 关联单据 + */ + private String otherReceipt; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Integer deleteFlag; +} diff --git a/core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptSub.java b/core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptSub.java new file mode 100644 index 00000000..1707c2ad --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/entities/warehouse/WarehouseReceiptSub.java @@ -0,0 +1,117 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.entities.warehouse; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.OrderBy; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serial; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("warehouse_receipt_sub") +public class WarehouseReceiptSub { + + @Serial + private static final long serialVersionUID = 89161616161329L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 仓库主表id + */ + private Long warehouseReceiptMainId; + + /** + * 产品id + */ + private Long productId; + + /** + * 仓库id + */ + private Long warehouseId; + + /** + * 商品条码 + */ + private Long productBarcode; + + /** + * 商品数量 + */ + private Integer productNumber; + + /** + * 类型(组合件/普通子件) + */ + private String type; + + /** + * 商品单据 + */ + private BigDecimal unitPrice; + + /** + * 商品总金额 + */ + private BigDecimal totalAmount; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 默认0 + */ + private Integer deleteFlag; + +} From bcfd32c43edcb31daf72dfd85a2a981b547cc3e8 Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:50:28 +0800 Subject: [PATCH 08/10] new: add storage shipments stock business object --- .../wansenai/bo/StorageShipmentStockBO.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 core/domain/src/main/java/com/wansenai/bo/StorageShipmentStockBO.java diff --git a/core/domain/src/main/java/com/wansenai/bo/StorageShipmentStockBO.java b/core/domain/src/main/java/com/wansenai/bo/StorageShipmentStockBO.java new file mode 100644 index 00000000..874c2cd4 --- /dev/null +++ b/core/domain/src/main/java/com/wansenai/bo/StorageShipmentStockBO.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://opensource.wansenai.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.wansenai.bo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import lombok.Builder; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@Builder +public class StorageShipmentStockBO { + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long id; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long warehouseId; + + private String warehouseName; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long barCode; + + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long productId; + + private String productName; + + private String productModel; + + private String productUnit; + + private String productStandard; + + private Integer stock; + + private Integer productNumber; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal unitPrice; + + @JsonSerialize(using = BigDecimalSerializerBO.class) + private BigDecimal amount; + + private String remark; +} From d4331c6e11fe4cf8b0a44b914286622ee2d6cd40 Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:51:01 +0800 Subject: [PATCH 09/10] fix: fix Barcode does not allow duplicates --- .../wansenai/service/product/impl/ProductServiceImpl.java | 8 ++++++++ .../main/java/com/wansenai/utils/response/Response.java | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/core/service/src/main/java/com/wansenai/service/product/impl/ProductServiceImpl.java b/core/service/src/main/java/com/wansenai/service/product/impl/ProductServiceImpl.java index abfa4932..4e87d3e2 100644 --- a/core/service/src/main/java/com/wansenai/service/product/impl/ProductServiceImpl.java +++ b/core/service/src/main/java/com/wansenai/service/product/impl/ProductServiceImpl.java @@ -108,6 +108,14 @@ public Response addOrUpdateProduct(AddOrUpdateProductDTO productDTO) { .in(ProductStockKeepUnit::getProductBarCode, barCodeList) .ne(productDTO.getProductId() != null, ProductStockKeepUnit::getProductId, productDTO.getProductId()) .exists(); + // 比较是否有相同的条码 如果有就返回错误信息 如果没有就继续执行 + boolean theSameBarCode = barCodeList.stream() + .distinct() + .count() != barCodeList.size(); + if (theSameBarCode) { + return Response.responseMsg(ProdcutCodeEnum.PRODUCT_BAR_CODE_EXIST.getCode(), "商品条码不能重复"); + } + if (existBarCode) { return Response.responseMsg(ProdcutCodeEnum.PRODUCT_BAR_CODE_EXIST); } diff --git a/core/utils/src/main/java/com/wansenai/utils/response/Response.java b/core/utils/src/main/java/com/wansenai/utils/response/Response.java index 35187cda..6512a442 100644 --- a/core/utils/src/main/java/com/wansenai/utils/response/Response.java +++ b/core/utils/src/main/java/com/wansenai/utils/response/Response.java @@ -166,6 +166,13 @@ public static Response responseMsg(CollectionPaymentCodeEnum collectionPa return baseResponse; } + public static Response responseMsg(String code, String msg) { + Response baseResponse = new Response(); + baseResponse.setCode(code); + baseResponse.setMsg(msg); + return baseResponse; + } + public static Response responseData(T data) { Response baseResponse = new Response(); baseResponse.setCode(BaseCodeEnum.SUCCESS.getCode()); From bd46f6af1edcfd171a151b5a7947fc8cd88db161 Mon Sep 17 00:00:00 2001 From: jameszow Date: Fri, 24 Nov 2023 14:51:36 +0800 Subject: [PATCH 10/10] update: update product name stand -> barcode unit --- web/src/views/product/info/components/ProductInfoModal.vue | 4 ++-- web/src/views/product/info/info.data.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/views/product/info/components/ProductInfoModal.vue b/web/src/views/product/info/components/ProductInfoModal.vue index f8c00d07..9b89926f 100644 --- a/web/src/views/product/info/components/ProductInfoModal.vue +++ b/web/src/views/product/info/components/ProductInfoModal.vue @@ -284,7 +284,7 @@ :scroll="{ x: '100%', y: 300 }">