Skip to content

Commit

Permalink
Merge pull request #221 from Jzow/master
Browse files Browse the repository at this point in the history
Add transfer account receipt data object and init service code
  • Loading branch information
Jzow authored Nov 22, 2023
2 parents 7e27781 + 49956d0 commit 75b285b
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 0 deletions.
35 changes: 35 additions & 0 deletions core/domain/src/main/java/com/wansenai/bo/TransferAccountBO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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 TransferAccountBO {

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

private String accountName;

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

private String remark;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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.financial;

import com.wansenai.bo.FileDataBO;
import com.wansenai.bo.TransferAccountBO;
import lombok.Data;

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

@Data
public class AddOrUpdateTransferDTO {

private Long id;

private String receiptDate;

private String receiptNumber;

private Long financialPersonId;

private Long paymentAccountId;

private BigDecimal paymentAmount;

private String remark;

private Integer status;

private List<TransferAccountBO> tableData;

private List<FileDataBO> files;
}
Original file line number Diff line number Diff line change
@@ -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.financial;

import lombok.Data;

@Data
public class QueryTransferDTO {

private String receiptNumber;

private Long accountId;

private Long financialPersonId;

private Integer status;

private String remark;

private String startDate;

private String endDate;

private Integer page;

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

import com.fasterxml.jackson.annotation.JsonInclude;
import com.wansenai.bo.FileDataBO;
import com.wansenai.bo.TransferAccountBO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TransferDetailVO {

private String receiptDate;

private String receiptNumber;

private Long financialPersonId;

private String financialPersonName;

private Long paymentAccountId;

private String paymentAccountName;

private BigDecimal paymentAmount;

private String remark;

private Integer status;

private List<TransferAccountBO> tableData;

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

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 TransferVO {

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

private String receiptNumber;

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

private String financialPerson;

private String paymentAccountName;

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

private String remark;

private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,26 @@
*/
package com.wansenai.service.financial;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wansenai.dto.financial.AddOrUpdateTransferDTO;
import com.wansenai.dto.financial.QueryTransferDTO;
import com.wansenai.entities.financial.FinancialMain;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.financial.TransferDetailVO;
import com.wansenai.vo.financial.TransferVO;

import java.util.List;

public interface TransferReceiptService extends IService<FinancialMain> {

Response<Page<TransferVO>> getTransferReceiptPageList(QueryTransferDTO queryTransferDTO);

Response<TransferDetailVO> getTransferReceiptDetail(Long id);

Response<String> addOrUpdateTransferReceipt(AddOrUpdateTransferDTO addOrUpdateTransferDTO);

Response<String> deleteBatchTransferReceipt(List<Long> ids);

Response<String> updateTransferReceiptStatus(List<Long> ids, Integer status);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,69 @@
*/
package com.wansenai.service.financial.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wansenai.dto.financial.AddOrUpdateTransferDTO;
import com.wansenai.dto.financial.QueryTransferDTO;
import com.wansenai.entities.financial.FinancialMain;
import com.wansenai.mappers.financial.FinancialMainMapper;
import com.wansenai.mappers.system.SysFileMapper;
import com.wansenai.service.common.CommonService;
import com.wansenai.service.financial.FinancialSubService;
import com.wansenai.service.financial.IFinancialAccountService;
import com.wansenai.service.financial.TransferReceiptService;
import com.wansenai.service.user.ISysUserService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.financial.TransferDetailVO;
import com.wansenai.vo.financial.TransferVO;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TransferReceiptServiceImpl extends ServiceImpl<FinancialMainMapper, FinancialMain> implements TransferReceiptService {

private final FinancialSubService financialSubService;

private final CommonService commonService;

private final ISysUserService userService;

private final SysFileMapper fileMapper;

private final IFinancialAccountService accountService;

public TransferReceiptServiceImpl(FinancialSubService financialSubService, CommonService commonService, ISysUserService userService, SysFileMapper fileMapper, IFinancialAccountService accountService) {
this.financialSubService = financialSubService;
this.commonService = commonService;
this.userService = userService;
this.fileMapper = fileMapper;
this.accountService = accountService;
}


@Override
public Response<Page<TransferVO>> getTransferReceiptPageList(QueryTransferDTO queryTransferDTO) {
return null;
}

@Override
public Response<TransferDetailVO> getTransferReceiptDetail(Long id) {
return null;
}

@Override
public Response<String> addOrUpdateTransferReceipt(AddOrUpdateTransferDTO addOrUpdateTransferDTO) {
return null;
}

@Override
public Response<String> deleteBatchTransferReceipt(List<Long> ids) {
return null;
}

@Override
public Response<String> updateTransferReceiptStatus(List<Long> ids, Integer status) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -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.utils.enums;

import lombok.Getter;

@Getter
public enum TransferAccountCodeEnum {

ADD_TRANSFER_ACCOUNT_RECEIPT_SUCCESS("T0001", "添加转账单成功"),

ADD_TRANSFER_ACCOUNT_RECEIPT_ERROR("T0502", "添加转账单失败"),

UPDATE_TRANSFER_ACCOUNT_RECEIPT_SUCCESS("T0002", "修改转账单成功"),

UPDATE_TRANSFER_ACCOUNT_RECEIPT_ERROR("T0503", "修改转账单失败"),

DELETE_TRANSFER_ACCOUNT_RECEIPT_SUCCESS("T0003", "删除转账单成功"),

DELETE_TRANSFER_ACCOUNT_RECEIPT_ERROR("T0504", "删除转账单失败");

/**
* 响应状态码
*/
private final String code;

/**
* 响应提示
*/
private final String msg;

TransferAccountCodeEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ public static <T> Response<T> responseMsg(IncomeExpenseCodeEnum incomeExpenseCod
return baseResponse;
}

public static <T> Response<T> responseMsg(TransferAccountCodeEnum transferAccountCodeEnum) {
Response<T> baseResponse = new Response<T>();
baseResponse.setCode(transferAccountCodeEnum.getCode());
baseResponse.setMsg(transferAccountCodeEnum.getMsg());
return baseResponse;
}

public static <T> Response<T> responseData(T data) {
Response<T> baseResponse = new Response<T>();
baseResponse.setCode(BaseCodeEnum.SUCCESS.getCode());
Expand Down

0 comments on commit 75b285b

Please sign in to comment.