Skip to content

Commit

Permalink
Merge pull request #156 from Jzow/master
Browse files Browse the repository at this point in the history
Add retail returns and sales procurement related pages
  • Loading branch information
Jzow committed Nov 4, 2023
2 parents ad50426 + 782cea9 commit 925fed3
Show file tree
Hide file tree
Showing 27 changed files with 1,710 additions and 20 deletions.
14 changes: 14 additions & 0 deletions core/api/src/main/java/com/wansenai/api/RetailController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
package com.wansenai.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wansenai.dto.receipt.QueryRetailRefundDTO;
import com.wansenai.dto.receipt.QueryShipmentsDTO;
import com.wansenai.dto.receipt.RetailRefundDTO;
import com.wansenai.dto.receipt.RetailShipmentsDTO;
import com.wansenai.service.receipt.ReceiptService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.receipt.RetailRefundVO;
import com.wansenai.vo.receipt.RetailShipmentsDetailVO;
import com.wansenai.vo.receipt.RetailShipmentsVO;
import org.springframework.web.bind.annotation.*;
Expand Down Expand Up @@ -57,4 +60,15 @@ public Response<String> updateStatus(@RequestParam("ids") List<Long> ids, @Reque
public Response<RetailShipmentsDetailVO> detail(@PathVariable("id") Long id) {
return receiptService.getRetailShipmentsDetail(id);
}

@PostMapping("/refund/pageList")
public Response<Page<RetailRefundVO>> refundPageList(@RequestBody QueryRetailRefundDTO refundDTO) {
return receiptService.getRetailRefund(refundDTO);
}

@PostMapping("/refund/addOrUpdate")
public Response<String> refundAddOrUpdate(@RequestBody RetailRefundDTO refundDTO) {
return receiptService.addOrUpdateRetailRefund(refundDTO);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ public class ShipmentsDataBO {

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal amount;

private String remark;
}
Original file line number Diff line number Diff line change
@@ -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.receipt;

import lombok.Data;

@Data
public class QueryRetailRefundDTO {

private String receiptNumber;

private String productInfo;

private Long memberId;

private Long warehouseId;

private Long accountId;

private Long operatorId;

private Integer status;

private String remark;

private String startDate;

private String endDate;

private Long page;

private Long pageSize;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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.receipt;

import com.wansenai.bo.FileDataBO;
import com.wansenai.bo.ShipmentsDataBO;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
@Builder
public class RetailRefundDTO {

private Long id;

private Long memberId;

private Long accountId;

private String receiptDate;

private String receiptNumber;

private String otherReceipt;

private BigDecimal paymentAmount;

private BigDecimal receiptAmount;

private BigDecimal backAmount;

private String remark;

private Integer status;

private List<ShipmentsDataBO> tableData;

private List<FileDataBO> files;
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class ReceiptMain implements Serializable {

private Integer source;

private String orderNumber;
private String otherReceipt;

/**
* 创建时间
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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.receipt;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import com.wansenai.bo.FileDataBO;
import com.wansenai.bo.ShipmentsDataBO;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
public class RetailRefundDetailVO {

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

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

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime receiptDate;

private String receiptNumber;

private String otherReceipt;

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal paymentAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal receiptAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal backAmount;

private String remark;

private List<ShipmentsDataBO> tableData;

private List<FileDataBO> files;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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.receipt;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RetailRefundVO {

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

private String memberName;

private String receiptNumber;

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime receiptDate;

private String productInfo;

private String operator;

private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal totalPrice;

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal paymentAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal backAmount;

private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
package com.wansenai.service.receipt;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wansenai.dto.receipt.QueryRetailRefundDTO;
import com.wansenai.dto.receipt.QueryShipmentsDTO;
import com.wansenai.dto.receipt.RetailRefundDTO;
import com.wansenai.dto.receipt.RetailShipmentsDTO;
import com.wansenai.vo.receipt.RetailRefundVO;
import com.wansenai.vo.receipt.RetailShipmentsDetailVO;
import com.wansenai.entities.receipt.ReceiptMain;
import com.wansenai.utils.response.Response;
Expand Down Expand Up @@ -94,4 +97,27 @@ public interface ReceiptService extends IService<ReceiptMain> {
* 返回首页数据汇总
*/
Response<RetailStatisticalDataVO> getRetailStatistics();


/**
* Query retail refund orders with pagination.
* 分页查询零售退货单
*
* @param refundDTO Query common conditions
* 查询公共条件
* @return Returns paginated data
* 返回分页数据
*/
Response<Page<RetailRefundVO>> getRetailRefund(QueryRetailRefundDTO refundDTO);

/**
* Add/modify retail shipment orders.
* 新增/修改 零售退货单
*
* @param refundDTO Retail shipment order data
* 零售退货单数据
* @return Returns the result of the addition
* 返回新增结果
*/
Response<String> addOrUpdateRetailRefund(RetailRefundDTO refundDTO);
}
Loading

0 comments on commit 925fed3

Please sign in to comment.