Skip to content

Commit

Permalink
Merge pull request #224 from Jzow/master
Browse files Browse the repository at this point in the history
Add collection receipt views and api
  • Loading branch information
wansenai-bot authored Nov 22, 2023
2 parents 1240df2 + 1b183e3 commit 746e665
Show file tree
Hide file tree
Showing 18 changed files with 1,213 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,56 @@
*/
package com.wansenai.api.financial;

import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wansenai.dto.financial.AddOrUpdateCollectionDTO;
import com.wansenai.dto.financial.QueryCollectionDTO;
import com.wansenai.service.financial.CollectionReceiptService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.financial.CollectionDetailVO;
import com.wansenai.vo.financial.CollectionVO;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@RestController
@RequestMapping("/financial/collection")
public class CollectionReceiptController {

private final CollectionReceiptService collectionReceiptService;

public CollectionReceiptController(CollectionReceiptService collectionReceiptService) {
this.collectionReceiptService = collectionReceiptService;
}

@PostMapping("addOrUpdate")
public Response<String> addOrUpdateCollectionReceipt(@RequestBody AddOrUpdateCollectionDTO addOrUpdateCollectionDTO) {
return collectionReceiptService.addOrUpdateCollectionReceipt(addOrUpdateCollectionDTO);
}

@PostMapping("pageList")
public Response<Page<CollectionVO>> getCollectionReceiptPageList(@RequestBody QueryCollectionDTO queryCollectionDTO) {
return collectionReceiptService.getCollectionReceiptPageList(queryCollectionDTO);
}

@GetMapping("getDetailById/{id}")
public Response<CollectionDetailVO> getCollectionReceiptDetailById(@PathVariable("id") Long id) {
return collectionReceiptService.getCollectionReceiptDetail(id);
}

@PutMapping("deleteByIds")
public Response<String> deleteCollectionReceiptByIds(@RequestParam("ids") List<Long> ids) {
return collectionReceiptService.deleteBatchCollectionReceipt(ids);
}

@PutMapping("updateStatusByIds")
public Response<String> updateCollectionReceiptStatusByIds(@RequestParam("ids") List<Long> ids, @RequestParam("status") Integer status) {
return collectionReceiptService.updateCollectionReceiptStatus(ids, status);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
import com.wansenai.service.financial.IFinancialAccountService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.financial.AccountVO;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
@Data
public class AddOrUpdateCollectionDTO {

private Long id;

private Long customerId;

private String receiptNumber;

private LocalDateTime receiptDate;
private String receiptDate;

private Long financialPersonId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
@Data
public class AddOrUpdatePaymentDTO {

private Long id;

private Long supplierId;

private String receiptNumber;

private LocalDateTime receiptDate;
private String receiptDate;

private Long financialPersonId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ public class FinancialSub implements Serializable {
private Long incomeExpenseId;

/**
* 单据id
* 其他单据
*/
private Long receiptId;
private String otherReceipt;

/**
* 应收欠款
* 应收/付 欠款
*/
private BigDecimal accountsReceivable;
private BigDecimal ReceivablePaymentArrears;

/**
* 已收欠款
* 已收/付 欠款
*/
private BigDecimal accountsReceived;
private BigDecimal ReceivedPrepaidArrears;

/**
* 单项金额
Expand Down
Loading

0 comments on commit 746e665

Please sign in to comment.