Commit 4e3d4ff2 authored by zhangfeng's avatar zhangfeng

feat(wealth): 财务新增功能

parent 9519e7aa
......@@ -470,4 +470,6 @@ public interface CustomerService extends IService<CustomerDO> {
void validateCustomerApproval(CustomerDO customerDO);
CustomerPaymentInfoVO getPaymentCustomerInfo(Long customerId);
}
......@@ -3923,4 +3923,16 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
throw exception(CUSTOMER_APPROVAL_IN_PROCESSING);
}
}
@Override
public CustomerPaymentInfoVO getPaymentCustomerInfo(Long customerId) {
CustomerDO customerDO = customerMapper.selectById(customerId);
if (customerDO != null) {
CustomerPaymentInfoVO infoVO = new CustomerPaymentInfoVO();
infoVO.setId(customerDO.getId());
infoVO.setDefaultBilling(customerDO.getDefaultBilling());
return infoVO;
}
return null;
}
}
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel("管理后台 - 付款客户信息 VO")
@Data
public class CustomerPaymentInfoVO {
private Long id;
@ApiModelProperty(value = "默认是否开票")
private Boolean defaultBilling;
}
......@@ -1205,4 +1205,9 @@ public class CustomerController {
return success(true);
}
@GetMapping("/payment-customer-info")
@ApiOperation("获取付款客户信息")
public CommonResult<CustomerPaymentInfoVO> getPaymentCustomerInfo(Long customerId) {
return success(customerService.getPaymentCustomerInfo(customerId));
}
}
package cn.iocoder.yudao.module.wealth.convert.receiptInvoice;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptInvoice.ReceiptInvoiceDO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoicePageBackVO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceCreateReqVO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceUpdateReqVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* 收款单开票信息 Convert
* @author 系统管理员
*/
@Mapper
public interface ReceiptInvoiceConvert {
/*****转换MapStruct*****/
ReceiptInvoiceConvert INSTANCE = Mappers.getMapper(ReceiptInvoiceConvert.class);
/***
* 创建VO转实体
* @param bean
* @return
*/
ReceiptInvoiceDO convert(ReceiptInvoiceCreateReqVO bean);
/***
* 修改VO转实体
* @param bean
* @return
*/
ReceiptInvoiceDO convert(ReceiptInvoiceUpdateReqVO bean);
/***
* 实体转返回VO
* @param bean
* @return
*/
ReceiptInvoicePageBackVO convert(ReceiptInvoiceDO bean);
/***
* 实体列表转返回VO列表
* @param list
* @return
*/
List<ReceiptInvoicePageBackVO> convertList(List<ReceiptInvoiceDO> list);
/***
* 实体分页转返回分页
* @param page
* @return
*/
PageResult<ReceiptInvoicePageBackVO> convertPage(PageResult<ReceiptInvoiceDO> page);
}
package cn.iocoder.yudao.module.wealth.dal.dataobject.receipt;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
@Data
@TableName("ecw_receipt_bank_writeoff_range")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ReceiptBankWriteoffRangeDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 核销比例下界(除以100)
*/
private Integer writeOffDown;
/**
* 核销比例上界(除以100)
*/
private Integer writeOffUp;
}
......@@ -76,55 +76,55 @@ public class ReceiptDO extends BaseDO {
*/
private java.math.BigDecimal feeRate;
/**
* 发票抬头
*/
private String invoice;
/**
* 纳税人识别号
*/
private String taxpayer;
/**
* 开户行
*/
private String accountBank;
/**
* 账号
*/
private String accountName;
/**
* 项目
*/
private String projectName;
/**
* 税率
*/
private java.math.BigDecimal taxRate;
/**
* 开票地址、电话
*/
private String addressPhone;
///**
// * 发票抬头
// */
//private String invoice;
///**
// * 纳税人识别号
// */
//private String taxpayer;
///**
// * 开户行
// */
//private String accountBank;
///**
// * 账号
// */
//private String accountName;
///**
// * 项目
// */
//private String projectName;
///**
// * 税率
// */
//private java.math.BigDecimal taxRate;
///**
// * 开票地址、电话
// */
//private String addressPhone;
/**
* 实收日期
*/
private Date payedAt;
/**
* 发票号码
*/
private String invoiceNumber;
/**
* 开票类型(字典表 invoicing_type)
*/
private Integer invoicingTypeId;
/**
* 开票类型名称
*/
private String invoicingType;
/**
* 开票备注
*/
private String invoicingRemark;
///**
// * 发票号码
// */
//private String invoiceNumber;
///**
// * 开票类型(字典表 invoicing_type)
// */
//private Integer invoicingTypeId;
///**
// * 开票类型名称
// */
//private String invoicingType;
///**
// * 开票备注
// */
//private String invoicingRemark;
/**
* 通知人id
*/
......@@ -149,14 +149,14 @@ public class ReceiptDO extends BaseDO {
* 核销人名称
*/
private String writeOffName;
/**
* 开票人id
*/
private Long issuerId;
/**
* 开票人名称
*/
private String issuerName;
///**
// * 开票人id
// */
//private Long issuerId;
///**
// * 开票人名称
// */
//private String issuerName;
/**
* 是否需要开票
......@@ -171,10 +171,10 @@ public class ReceiptDO extends BaseDO {
* 核销时间
*/
private Date writeOffAt;
/**
* 开票时间
*/
private Date invoicingAt;
///**
// * 开票时间
// */
//private Date invoicingAt;
/**
* 数据来源(pc端,mobile端)
*/
......@@ -209,13 +209,27 @@ public class ReceiptDO extends BaseDO {
*/
private String financeRemark;
/*
订单ID
/**
*订单ID
*/
private long orderId;
/*
订单编号
/**
*订单编号
*/
private String orderNo;
/**
* 明细状态
*/
private Integer detailStatus;
/**
* 开票状态
*/
private Integer invoicingStatus;
/**
* 开票明细状态
*/
private Integer invoiceDataStatus;
}
package cn.iocoder.yudao.module.wealth.dal.dataobject.receiptInvoice;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 收款单开票信息 DO
*
* @author 系统管理员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("ecw_receipt_invoice")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ReceiptInvoiceDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 开票编号
*/
private String invoiceNo;
/**
* 收款单id
*/
private Long receiptId;
/**
* 收款单号(例:SKD001)
*/
private String receiptNo;
/**
* 部门id
*/
private Long departmentId;
/**
* 部门名称
*/
private String departmentName;
/**
* 申请人id
*/
private Long applyUserId;
/**
* 备注
*/
private String remark;
/**
* 申请人姓名
*/
private String applyUserName;
/**
* 发票抬头
*/
private String invoiceHeader;
/**
* 纳税人识别号
*/
private String taxpayer;
/**
* 税率
*/
private java.math.BigDecimal taxRate;
/**
* 开票电话
*/
private String invoicePhone;
/**
* 开户行
*/
private String accountBank;
/**
* 开票地址
*/
private String invoiceAddress;
/**
* 开户账号
*/
private String accountName;
/**
* 发票号码
*/
private String invoiceNumber;
/**
* 开票项目
*/
private String invoiceItem;
/**
* 开票类型(字典表 invoicing_type)
*/
private Integer invoiceTypeId;
/**
* 发票信息最后修改时间
*/
private String invoiceInfoSaveTime;
/**
* 开发票人id
*/
private Long invoicerId;
/**
* 开票人名称
*/
private String invoicerName;
/**
* 开票时间
*/
private Date invoiceTime;
/**
* 订单id
*/
private Long orderId;
/**
* 订单号(NG2414248L)
*/
private String orderNo;
/**
* 提单号(CNG244432-26)
*/
private String tidanNo;
}
package cn.iocoder.yudao.module.wealth.dal.dataobject.receiptInvoiceLog;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
/**
* 收款单开票信息日志 DO
*
* @author 系统管理员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("ecw_receipt_invoice_log")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ReceiptInvoiceLogDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 开票环节
*/
private Integer invoicingLink;
/**
* 操作人
*/
private String operator;
/**
* 备注
*/
private String remark;
/**
* 审批流程
*/
private Integer bmpStatus;
}
package cn.iocoder.yudao.module.wealth.dal.dataobject.receiptLog;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
/**
* 收款单日志 DO
*
* @author 系统管理员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("ecw_receipt_log")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ReceiptLogDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 收款单环节
*/
private Integer receiptLink;
/**
* 操作人
*/
private String operator;
/**
* 备注
*/
private String remark;
/**
* 审批流程
*/
private Integer bmpStatus;
}
package cn.iocoder.yudao.module.wealth.dal.mysql.receipt;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptBankWriteoffRangeDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 银行收款明细自动核销比例设置 Mapper
*/
@Mapper
public interface ReceiptBankWriteoffRangeMapper extends AbstractMapper<ReceiptBankWriteoffRangeDO> {
}
\ No newline at end of file
......@@ -26,25 +26,25 @@ import java.util.List;
*/
@Mapper
public interface ReceiptMapper extends AbstractMapper<ReceiptDO> {
@Override
default PageResult<ReceiptDO> selectPage(PageVO page, Object object) {
if (object instanceof ReceiptQueryVO) {
ReceiptQueryVO vo = (ReceiptQueryVO) object;
return selectPage(page, new LambdaQuery<ReceiptDO>().eqIfPresent(ReceiptDO::getReceiptNo, vo.getReceiptNo()).eqIfPresent(ReceiptDO::getDepartmentId, vo.getDepartmentId()).likeIfPresent(ReceiptDO::getDepartmentName, vo.getDepartmentName()).eqIfPresent(ReceiptDO::getSalesmanId, vo.getSalesmanId()).likeIfPresent(ReceiptDO::getSalesmanName, vo.getSalesmanName()).eqIfPresent(ReceiptDO::getCustomerId, vo.getCustomerId()).likeIfPresent(ReceiptDO::getCustomerName, vo.getCustomerName()).eqIfPresent(ReceiptDO::getRemark, vo.getRemark()).eqIfPresent(ReceiptDO::getCurrencyId, vo.getCurrencyId()).eqIfPresent(ReceiptDO::getFeeRate, vo.getFeeRate()).eqIfPresent(ReceiptDO::getInvoice, vo.getInvoice()).eqIfPresent(ReceiptDO::getTaxpayer, vo.getTaxpayer()).eqIfPresent(ReceiptDO::getAccountBank, vo.getAccountBank()).likeIfPresent(ReceiptDO::getAccountName, vo.getAccountName()).likeIfPresent(ReceiptDO::getProjectName, vo.getProjectName()).eqIfPresent(ReceiptDO::getTaxRate, vo.getTaxRate()).eqIfPresent(ReceiptDO::getAddressPhone, vo.getAddressPhone()).eqIfPresent(ReceiptDO::getPayedAt, vo.getPayedAt()).eqIfPresent(ReceiptDO::getInvoiceNumber, vo.getInvoiceNumber()).eqIfPresent(ReceiptDO::getInvoicingTypeId, vo.getInvoicingTypeId()).eqIfPresent(ReceiptDO::getInvoicingType, vo.getInvoicingType()).eqIfPresent(ReceiptDO::getInvoicingRemark, vo.getInvoicingRemark()).eqIfPresent(ReceiptDO::getNoticeAdminId, vo.getNoticeAdminId()).likeIfPresent(ReceiptDO::getNoticeAdminName, vo.getNoticeAdminName()).eqIfPresent(ReceiptDO::getPayeeId, vo.getPayeeId()).likeIfPresent(ReceiptDO::getPayeeName, vo.getPayeeName()).eqIfPresent(ReceiptDO::getWriteOffId, vo.getWriteOffId()).likeIfPresent(ReceiptDO::getWriteOffName, vo.getWriteOffName()).eqIfPresent(ReceiptDO::getIssuerId, vo.getIssuerId()).likeIfPresent(ReceiptDO::getIssuerName, vo.getIssuerName()).eqIfPresent(ReceiptDO::getState, vo.getState()).eqIfPresent(ReceiptDO::getWriteOffAt, vo.getWriteOffAt()).eqIfPresent(ReceiptDO::getInvoicingAt, vo.getInvoicingAt()).eqIfPresent(ReceiptDO::getSource, vo.getSource()).betweenIfPresent(ReceiptDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime()).orderByDesc(ReceiptDO::getId));
}
//@Override
//default PageResult<ReceiptDO> selectPage(PageVO page, Object object) {
// if (object instanceof ReceiptQueryVO) {
// ReceiptQueryVO vo = (ReceiptQueryVO) object;
// return selectPage(page, new LambdaQuery<ReceiptDO>().eqIfPresent(ReceiptDO::getReceiptNo, vo.getReceiptNo()).eqIfPresent(ReceiptDO::getDepartmentId, vo.getDepartmentId()).likeIfPresent(ReceiptDO::getDepartmentName, vo.getDepartmentName()).eqIfPresent(ReceiptDO::getSalesmanId, vo.getSalesmanId()).likeIfPresent(ReceiptDO::getSalesmanName, vo.getSalesmanName()).eqIfPresent(ReceiptDO::getCustomerId, vo.getCustomerId()).likeIfPresent(ReceiptDO::getCustomerName, vo.getCustomerName()).eqIfPresent(ReceiptDO::getRemark, vo.getRemark()).eqIfPresent(ReceiptDO::getCurrencyId, vo.getCurrencyId()).eqIfPresent(ReceiptDO::getFeeRate, vo.getFeeRate()).eqIfPresent(ReceiptDO::getInvoice, vo.getInvoice()).eqIfPresent(ReceiptDO::getTaxpayer, vo.getTaxpayer()).eqIfPresent(ReceiptDO::getAccountBank, vo.getAccountBank()).likeIfPresent(ReceiptDO::getAccountName, vo.getAccountName()).likeIfPresent(ReceiptDO::getProjectName, vo.getProjectName()).eqIfPresent(ReceiptDO::getTaxRate, vo.getTaxRate()).eqIfPresent(ReceiptDO::getAddressPhone, vo.getAddressPhone()).eqIfPresent(ReceiptDO::getPayedAt, vo.getPayedAt()).eqIfPresent(ReceiptDO::getInvoiceNumber, vo.getInvoiceNumber()).eqIfPresent(ReceiptDO::getInvoicingTypeId, vo.getInvoicingTypeId()).eqIfPresent(ReceiptDO::getInvoicingType, vo.getInvoicingType()).eqIfPresent(ReceiptDO::getInvoicingRemark, vo.getInvoicingRemark()).eqIfPresent(ReceiptDO::getNoticeAdminId, vo.getNoticeAdminId()).likeIfPresent(ReceiptDO::getNoticeAdminName, vo.getNoticeAdminName()).eqIfPresent(ReceiptDO::getPayeeId, vo.getPayeeId()).likeIfPresent(ReceiptDO::getPayeeName, vo.getPayeeName()).eqIfPresent(ReceiptDO::getWriteOffId, vo.getWriteOffId()).likeIfPresent(ReceiptDO::getWriteOffName, vo.getWriteOffName()).eqIfPresent(ReceiptDO::getIssuerId, vo.getIssuerId()).likeIfPresent(ReceiptDO::getIssuerName, vo.getIssuerName()).eqIfPresent(ReceiptDO::getState, vo.getState()).eqIfPresent(ReceiptDO::getWriteOffAt, vo.getWriteOffAt()).eqIfPresent(ReceiptDO::getInvoicingAt, vo.getInvoicingAt()).eqIfPresent(ReceiptDO::getSource, vo.getSource()).betweenIfPresent(ReceiptDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime()).orderByDesc(ReceiptDO::getId));
// }
//
// return null;
//}
return null;
}
@Override
default List<ReceiptDO> selectList(Object object) {
if (object instanceof ReceiptQueryVO) {
ReceiptQueryVO vo = (ReceiptQueryVO) object;
return selectList(new LambdaQuery<ReceiptDO>().eqIfPresent(ReceiptDO::getReceiptNo, vo.getReceiptNo()).eqIfPresent(ReceiptDO::getDepartmentId, vo.getDepartmentId()).likeIfPresent(ReceiptDO::getDepartmentName, vo.getDepartmentName()).eqIfPresent(ReceiptDO::getSalesmanId, vo.getSalesmanId()).likeIfPresent(ReceiptDO::getSalesmanName, vo.getSalesmanName()).eqIfPresent(ReceiptDO::getCustomerId, vo.getCustomerId()).likeIfPresent(ReceiptDO::getCustomerName, vo.getCustomerName()).eqIfPresent(ReceiptDO::getRemark, vo.getRemark()).eqIfPresent(ReceiptDO::getCurrencyId, vo.getCurrencyId()).eqIfPresent(ReceiptDO::getFeeRate, vo.getFeeRate()).eqIfPresent(ReceiptDO::getInvoice, vo.getInvoice()).eqIfPresent(ReceiptDO::getTaxpayer, vo.getTaxpayer()).eqIfPresent(ReceiptDO::getAccountBank, vo.getAccountBank()).likeIfPresent(ReceiptDO::getAccountName, vo.getAccountName()).likeIfPresent(ReceiptDO::getProjectName, vo.getProjectName()).eqIfPresent(ReceiptDO::getTaxRate, vo.getTaxRate()).eqIfPresent(ReceiptDO::getAddressPhone, vo.getAddressPhone()).eqIfPresent(ReceiptDO::getPayedAt, vo.getPayedAt()).eqIfPresent(ReceiptDO::getInvoiceNumber, vo.getInvoiceNumber()).eqIfPresent(ReceiptDO::getInvoicingTypeId, vo.getInvoicingTypeId()).eqIfPresent(ReceiptDO::getInvoicingType, vo.getInvoicingType()).eqIfPresent(ReceiptDO::getInvoicingRemark, vo.getInvoicingRemark()).eqIfPresent(ReceiptDO::getNoticeAdminId, vo.getNoticeAdminId()).likeIfPresent(ReceiptDO::getNoticeAdminName, vo.getNoticeAdminName()).eqIfPresent(ReceiptDO::getPayeeId, vo.getPayeeId()).likeIfPresent(ReceiptDO::getPayeeName, vo.getPayeeName()).eqIfPresent(ReceiptDO::getWriteOffId, vo.getWriteOffId()).likeIfPresent(ReceiptDO::getWriteOffName, vo.getWriteOffName()).eqIfPresent(ReceiptDO::getIssuerId, vo.getIssuerId()).likeIfPresent(ReceiptDO::getIssuerName, vo.getIssuerName()).eqIfPresent(ReceiptDO::getState, vo.getState()).eqIfPresent(ReceiptDO::getWriteOffAt, vo.getWriteOffAt()).eqIfPresent(ReceiptDO::getInvoicingAt, vo.getInvoicingAt()).eqIfPresent(ReceiptDO::getSource, vo.getSource()).betweenIfPresent(ReceiptDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime()).orderByDesc(ReceiptDO::getId));
}
return null;
}
//@Override
//default List<ReceiptDO> selectList(Object object) {
// if (object instanceof ReceiptQueryVO) {
// ReceiptQueryVO vo = (ReceiptQueryVO) object;
// return selectList(new LambdaQuery<ReceiptDO>().eqIfPresent(ReceiptDO::getReceiptNo, vo.getReceiptNo()).eqIfPresent(ReceiptDO::getDepartmentId, vo.getDepartmentId()).likeIfPresent(ReceiptDO::getDepartmentName, vo.getDepartmentName()).eqIfPresent(ReceiptDO::getSalesmanId, vo.getSalesmanId()).likeIfPresent(ReceiptDO::getSalesmanName, vo.getSalesmanName()).eqIfPresent(ReceiptDO::getCustomerId, vo.getCustomerId()).likeIfPresent(ReceiptDO::getCustomerName, vo.getCustomerName()).eqIfPresent(ReceiptDO::getRemark, vo.getRemark()).eqIfPresent(ReceiptDO::getCurrencyId, vo.getCurrencyId()).eqIfPresent(ReceiptDO::getFeeRate, vo.getFeeRate()).eqIfPresent(ReceiptDO::getInvoice, vo.getInvoice()).eqIfPresent(ReceiptDO::getTaxpayer, vo.getTaxpayer()).eqIfPresent(ReceiptDO::getAccountBank, vo.getAccountBank()).likeIfPresent(ReceiptDO::getAccountName, vo.getAccountName()).likeIfPresent(ReceiptDO::getProjectName, vo.getProjectName()).eqIfPresent(ReceiptDO::getTaxRate, vo.getTaxRate()).eqIfPresent(ReceiptDO::getAddressPhone, vo.getAddressPhone()).eqIfPresent(ReceiptDO::getPayedAt, vo.getPayedAt()).eqIfPresent(ReceiptDO::getInvoiceNumber, vo.getInvoiceNumber()).eqIfPresent(ReceiptDO::getInvoicingTypeId, vo.getInvoicingTypeId()).eqIfPresent(ReceiptDO::getInvoicingType, vo.getInvoicingType()).eqIfPresent(ReceiptDO::getInvoicingRemark, vo.getInvoicingRemark()).eqIfPresent(ReceiptDO::getNoticeAdminId, vo.getNoticeAdminId()).likeIfPresent(ReceiptDO::getNoticeAdminName, vo.getNoticeAdminName()).eqIfPresent(ReceiptDO::getPayeeId, vo.getPayeeId()).likeIfPresent(ReceiptDO::getPayeeName, vo.getPayeeName()).eqIfPresent(ReceiptDO::getWriteOffId, vo.getWriteOffId()).likeIfPresent(ReceiptDO::getWriteOffName, vo.getWriteOffName()).eqIfPresent(ReceiptDO::getIssuerId, vo.getIssuerId()).likeIfPresent(ReceiptDO::getIssuerName, vo.getIssuerName()).eqIfPresent(ReceiptDO::getState, vo.getState()).eqIfPresent(ReceiptDO::getWriteOffAt, vo.getWriteOffAt()).eqIfPresent(ReceiptDO::getInvoicingAt, vo.getInvoicingAt()).eqIfPresent(ReceiptDO::getSource, vo.getSource()).betweenIfPresent(ReceiptDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime()).orderByDesc(ReceiptDO::getId));
// }
//
// return null;
//}
/**
......
package cn.iocoder.yudao.module.wealth.dal.mysql.receiptInvoice;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptInvoice.ReceiptInvoiceDO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceDetailVO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoicePageBackVO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceQueryVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 收款单开票信息 Mapper
*
* @author 系统管理员
*/
@Mapper
public interface ReceiptInvoiceMapper extends AbstractMapper<ReceiptInvoiceDO> {
void getReceiptInvoicePage(IPage<ReceiptInvoicePageBackVO> mpPage, @Param("query") ReceiptInvoiceQueryVO query);
ReceiptInvoiceDetailVO getReceiptInvoiceDetail(Long id);
String getCurrentMaxInvoiceCode();
}
package cn.iocoder.yudao.module.wealth.dal.mysql.receiptInvoiceLog;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptInvoiceLog.ReceiptInvoiceLogDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 收款单开票信息日志 Mapper
* @author 系统管理员
*/
@Mapper
public interface ReceiptInvoiceLogMapper extends AbstractMapper<ReceiptInvoiceLogDO> {
}
package cn.iocoder.yudao.module.wealth.dal.mysql.receiptLog;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptLog.ReceiptLogDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 收款单日志 Mapper
* @author 系统管理员
*/
@Mapper
public interface ReceiptLogMapper extends AbstractMapper<ReceiptLogDO> {
}
......@@ -5,9 +5,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableBackVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableOrderPayedFeeTypeVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableQueryVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;
......@@ -102,7 +100,9 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> {
"o.container_number as container_number, ",
"nor.name as consignor_name, ",
"nor.phone as consignor_phone, ",
"nor.customer_id as consignor_id, ",
"nee.name as consignee_name, ",
"nee.customer_id as consignee_id, ",
"nee.phone as consignee_phone",
"from ecw_receivable r ",
"left join ecw_order o on o.order_id = r.order_id",
......@@ -408,4 +408,12 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> {
"update ecw_receivable set `deleted` = 0 ,update_time = now() where `id` = #{receivableId}"
})
void revokeDeleteReceivableById(@Param("receivableId") Long receivableId);
IPage<CostDetailPageVO> getCostDetailPage(IPage<CostDetailPageVO> page, @Param("query") CostDetailPageQueryVO query);
List<WealthMoneyAmountVO> costDetailSearchAmount(@Param("query") CostDetailPageQueryVO query);
List<WealthMoneyAmountVO> costDetailAmount();
List<WealthMoneyAmountVO> receivablePageAmount(@Param("query") ReceivableQueryVO query);
}
package cn.iocoder.yudao.module.wealth.enums;
import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.util.json.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
@AllArgsConstructor
@Getter
public enum InvoiceDataStatusEnum implements IntArrayValuable {
/**
* 提交
*/
SUBMIT(0, "提交", "Submit"),
/**
* 驳回
*/
REJECT(1, "驳回", "Reject");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(InvoiceDataStatusEnum::getValue).toArray();
/**
* 状态
*/
private final Integer value;
/**
* 状态中文
*/
private final String nameZh;
/**
* 状态英语
*/
private final String nameEn;
public static InvoiceDataStatusEnum valueOf(Integer value) {
return ArrayUtil.firstMatch(orderStatus -> orderStatus.getValue().equals(value), InvoiceDataStatusEnum.values());
}
@Override
public int[] array() {
return ARRAYS;
}
}
package cn.iocoder.yudao.module.wealth.enums;
import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.util.json.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
@AllArgsConstructor
@Getter
public enum InvoicingStatusEnum implements IntArrayValuable {
/**
* 待开票
*/
WAIT(0, "待开票", "Wait"),
/**
* 已开票
*/
INVOICED(1, "已开票", "Invoiced"),
/**
* 已取消
*/
CANCELLED(4, "已作废", "Cancelled"),
/**
* 不开票
*/
NO_INVOICE(3, "不开票", "NoInvoice"),
/**
* 无申请记录
*/
NO_RECORD(5, "无申请记录", "NoRecord");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(InvoicingStatusEnum::getValue).toArray();
/**
* 状态
*/
private final Integer value;
/**
* 状态中文
*/
private final String nameZh;
/**
* 状态英语
*/
private final String nameEn;
public static InvoicingStatusEnum valueOf(Integer value) {
return ArrayUtil.firstMatch(orderStatus -> orderStatus.getValue().equals(value), InvoicingStatusEnum.values());
}
@Override
public int[] array() {
return ARRAYS;
}
}
package cn.iocoder.yudao.module.wealth.enums;
import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.util.json.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
@AllArgsConstructor
@Getter
public enum ReceiptDetailStatusEnum implements IntArrayValuable {
/**
* 未录入
*/
DRAFT(0, "未录入", "Draft"),
/**
* 未提交
*/
UN_SUBMITTED(1, "未提交", "Un Submitted"),
/**
* 部分提交
*/
PART_SUBMITTED(2, "部分提交", "Part Submitted"),
/**
* 未审批
*/
UN_APPROVED(3, "未审批", "Un Approved"),
/**
* 部分审批
*/
PART_APPROVED(4, "部分审批", "Part Approved"),
/**
* 全部审批
*/
ALL_APPROVED(5, "全部审批", "All Approved");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ReceiptDetailStatusEnum::getValue).toArray();
/**
* 状态
*/
private final Integer value;
/**
* 状态中文
*/
private final String nameZh;
/**
* 状态英语
*/
private final String nameEn;
public static ReceiptDetailStatusEnum valueOf(Integer value) {
return ArrayUtil.firstMatch(orderStatus -> orderStatus.getValue().equals(value), ReceiptDetailStatusEnum.values());
}
@Override
public int[] array() {
return ARRAYS;
}
}
......@@ -33,19 +33,19 @@ public interface ReceiptService extends IService<ReceiptDO> {
void updateReceipt(@Valid ReceiptUpdateReqVO updateReqVO);
/**
* 获取开票信息
*
* @param receiptId 付款单ID
*/
ReceiptBackVO getInvoicingInfo(Long receiptId);
/**
* 更新发票信息
*
* @param invoicingUpdateVO 更新信息
*/
void updateInvoicingInfo(@Valid InvoicingUpdateVO invoicingUpdateVO);
///**
// * 获取开票信息
// *
// * @param receiptId 付款单ID
// */
//ReceiptBackVO getInvoicingInfo(Long receiptId);
//
///**
// * 更新发票信息
// *
// * @param invoicingUpdateVO 更新信息
// */
//void updateInvoicingInfo(@Valid InvoicingUpdateVO invoicingUpdateVO);
/**
* 删除收款单
......@@ -156,4 +156,16 @@ public interface ReceiptService extends IService<ReceiptDO> {
void autoWriteOffReceipt(ReceiptDO receiptDO, String userId, String userName);
/**
* 获得收款单银行明细核销范围
* @return
*/
ReceiptBankWriteoffRangeVO getBankWriteoffRange();
/**
* 设置收款单银行明细核销范围
* @param range
* @return
*/
Boolean setBankWriteoffRange(ReceiptBankWriteoffRangeVO range);
}
package cn.iocoder.yudao.module.wealth.service.receiptInvoice;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptInvoice.ReceiptInvoiceDO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.*;
/**
* 收款单开票信息 Service 接口
*
* @author 系统管理员
*/
public interface ReceiptInvoiceService extends IService<ReceiptInvoiceDO> {
/**
* 创建收款单开票信息
* @param createReqVO 创建信息
* @return 编号
*/
Long createReceiptInvoice(@Valid ReceiptInvoiceCreateReqVO createReqVO);
/**
* 更新收款单开票信息
* @param updateReqVO 更新信息
*/
void updateReceiptInvoice(@Valid ReceiptInvoiceUpdateReqVO updateReqVO);
/**
* 删除收款单开票信息
* @param id 编号
*/
void deleteReceiptInvoice(Long id);
/**
* 获得收款单开票信息
*
* @param id 编号
* @return 收款单开票信息
*/
ReceiptInvoiceDetailVO getReceiptInvoiceDetail(Long id);
/**
* 获得收款单开票信息列表
* @param ids 编号
* @return 收款单开票信息列表
*/
List<ReceiptInvoiceDO> getReceiptInvoiceList(Collection<Long> ids);
/**
* 获得收款单开票信息分页
* @param page 分页查询
* @param query 查询
* @return 收款单开票信息分页
*/
PageResult<ReceiptInvoicePageBackVO> getReceiptInvoicePage(ReceiptInvoiceQueryVO query, PageVO page);
/**
* 获得收款单开票信息列表, 用于 Excel 导出
* @param query 查询
* @return 收款单开票信息列表
*/
List<ReceiptInvoiceDO> getReceiptInvoiceList(ReceiptInvoiceQueryVO query);
}
package cn.iocoder.yudao.module.wealth.service.receiptInvoice;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.wealth.convert.receiptInvoice.ReceiptInvoiceConvert;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receiptInvoice.ReceiptInvoiceDO;
import cn.iocoder.yudao.module.wealth.dal.mysql.receiptInvoice.ReceiptInvoiceMapper;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
/**
* 收款单开票信息 Service 实现类
*
* @author 系统管理员
*/
@Service
@Validated
public class ReceiptInvoiceServiceImpl extends AbstractService<ReceiptInvoiceMapper, ReceiptInvoiceDO> implements ReceiptInvoiceService {
@Resource
private ReceiptInvoiceMapper receiptInvoiceMapper;
@Override
public Long createReceiptInvoice(ReceiptInvoiceCreateReqVO createReqVO) {
// 插入
ReceiptInvoiceDO receiptInvoice = ReceiptInvoiceConvert.INSTANCE.convert(createReqVO);
receiptInvoiceMapper.insert(receiptInvoice);
// 返回
return receiptInvoice.getId();
}
@Override
public void updateReceiptInvoice(ReceiptInvoiceUpdateReqVO updateReqVO) {
// 校验存在
this.validateReceiptInvoiceExists(updateReqVO.getId());
// 更新
ReceiptInvoiceDO updateObj = ReceiptInvoiceConvert.INSTANCE.convert(updateReqVO);
receiptInvoiceMapper.updateById(updateObj);
}
@Override
public void deleteReceiptInvoice(Long id) {
// 校验存在
this.validateReceiptInvoiceExists(id);
// 删除
receiptInvoiceMapper.deleteById(id);
}
private void validateReceiptInvoiceExists(Long id) {
if (receiptInvoiceMapper.selectById(id) == null) {
//throw exception(RECEIPT_INVOICE_NOT_EXISTS);
}
}
@Override
public ReceiptInvoiceDetailVO getReceiptInvoiceDetail(Long id) {
return receiptInvoiceMapper.getReceiptInvoiceDetail(id);
}
@Override
public List<ReceiptInvoiceDO> getReceiptInvoiceList(Collection<Long> ids) {
return receiptInvoiceMapper.selectBatchIds(ids);
}
@Override
public PageResult<ReceiptInvoicePageBackVO> getReceiptInvoicePage(ReceiptInvoiceQueryVO query, PageVO page) {
IPage<ReceiptInvoicePageBackVO> mpPage = MyBatisUtils.buildPage(page);
receiptInvoiceMapper.getReceiptInvoicePage(mpPage, query);
return PageResult.of(mpPage);
}
@Override
public List<ReceiptInvoiceDO> getReceiptInvoiceList(ReceiptInvoiceQueryVO query) {
return receiptInvoiceMapper.selectList(query);
}
}
......@@ -4,9 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO;
import cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptExportDto;
import cn.iocoder.yudao.module.wealth.vo.receivable.*;
import org.checkerframework.checker.units.qual.C;
import javax.validation.Valid;
import java.util.Collection;
......@@ -134,6 +132,7 @@ public interface ReceivableService extends IService<ReceivableDO> {
* @return 应收款分页
*/
PageResult<ReceivableBackVO> receivablePage(ReceivableQueryVO query, PageVO page);
List<WealthMoneyAmountVO> receivablePageAmount(@Valid ReceivableQueryVO query);
/**
* 获得应收款分页
......@@ -250,4 +249,13 @@ public interface ReceivableService extends IService<ReceivableDO> {
* @param receivableId 应收id
*/
void revokeDeleteReceivableById(Long receivableId);
/**
* 应收款费用明细分页
*
* @param query
* @param page
* @return
*/
CostDetailBackVO getCostDetailPage(@Valid CostDetailPageQueryVO query, PageVO page);
}
......@@ -12,6 +12,8 @@ import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi;
import cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.wealth.convert.receivable.ReceivableConvert;
......@@ -24,6 +26,7 @@ import cn.iocoder.yudao.module.wealth.service.receivableDiscount.ReceivableDisco
import cn.iocoder.yudao.module.wealth.vo.receivable.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Lazy;
......@@ -33,6 +36,8 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.wealth.enums.ErrorCodeConstants.*;
......@@ -62,6 +67,9 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
@Autowired
private ApplicationContext applicationContext;
@Resource
private CurrencyApi currencyApi;
@Override
public Long createReceivable(ReceivableCreateReqVO createReqVO) {
LoginUser user = SecurityFrameworkUtils.getLoginUser();
......@@ -222,6 +230,17 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
return PageResult.of(mpPage);
}
@Override
public List<WealthMoneyAmountVO> receivablePageAmount(ReceivableQueryVO query) {
List<WealthMoneyAmountVO> voList = receivableMapper.receivablePageAmount(query);
Map<Integer, CurrencyRespDTO> allCurrency = currencyApi.getAllCurrency();
voList.forEach(vo -> {
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
vo.setCurrencyName(allCurrency.get(vo.getCurrencyId()).getTitleZh());
});
return voList;
}
@Override
public List<ReceivableBackVO> getReceivableByOrderId(Long orderId) {
return receivableMapper.getReceivableByOrderId(orderId);
......@@ -376,4 +395,59 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
public void revokeDeleteReceivableById(Long receivableId) {
receivableMapper.revokeDeleteReceivableById(receivableId);
}
@Override
public CostDetailBackVO getCostDetailPage(CostDetailPageQueryVO query, PageVO page) {
Map<Integer, CurrencyRespDTO> allCurrency = currencyApi.getAllCurrency();
CompletableFuture<IPage<CostDetailPageVO>> costDetailPageFuture = CompletableFuture.supplyAsync(() -> {
IPage<CostDetailPageVO> pageInfo = new Page<>(page.getPage(), page.getRows());
return receivableMapper.getCostDetailPage(pageInfo, query);
});
CompletableFuture<List<WealthMoneyAmountVO>> searchStatisticsFuture = CompletableFuture.supplyAsync(() -> receivableMapper.costDetailSearchAmount(query));
CompletableFuture<List<WealthMoneyAmountVO>> totalStatisticsFuture = CompletableFuture.supplyAsync(() -> receivableMapper.costDetailAmount());
try {
CompletableFuture<Void> allFutures = CompletableFuture.allOf(costDetailPageFuture, searchStatisticsFuture, totalStatisticsFuture);
allFutures.join();
IPage<CostDetailPageVO> costDetailPage = costDetailPageFuture.get();
List<WealthMoneyAmountVO> searchStatistics = searchStatisticsFuture.get();
List<WealthMoneyAmountVO> totalStatistics = totalStatisticsFuture.get();
if (CollectionUtil.isNotEmpty(searchStatistics)) {
searchStatistics.forEach(vo -> {
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
vo.setCurrencyName(allCurrency.get(vo.getCurrencyId()).getTitleZh());
vo.setNotWriteOffAmount(vo.getReceivableTotalAmount().subtract(vo.getWriteOffAmount()));
});
}
totalStatistics.forEach(vo -> {
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
vo.setCurrencyName(allCurrency.get(vo.getCurrencyId()).getTitleZh());
vo.setNotWriteOffAmount(vo.getReceivableTotalAmount().subtract(vo.getWriteOffAmount()));
});
CostDetailBackVO.CostDetailBackVOBuilder voBuilder = CostDetailBackVO.builder()
.searchStatistics(searchStatistics)
.totalStatistics(totalStatistics);
List<CostDetailPageVO> records = costDetailPage.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
records.forEach(vo -> {
vo.setCurrencySymbol(allCurrency.get(vo.getCurrencyId()).getFuhao());
});
return voBuilder
.list(records)
.total(costDetailPage.getTotal())
.rows(costDetailPage.getSize())
.page(costDetailPage.getCurrent())
.pages(costDetailPage.getPages())
.build();
}
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException("查询异常");
}
return null;
}
}
package cn.iocoder.yudao.module.wealth.util;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.module.wealth.dal.mysql.receiptInvoice.ReceiptInvoiceMapper;
import com.alibaba.excel.util.DateUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.GET_LOCK_FAILED;
/**
* 根据规则生成各种code
*/
@Component
public class InvoiceGenCodeUtils {
@Resource
private RedisHelper redisHelper;
@Resource
private RedissonClient redissonClient;
@Resource
private ReceiptInvoiceMapper receiptInvoiceMapper;
/**
* 生成发票编号
*/
public String generateInvoiceCode() {
// KP+年月日+4位流水号;例如:KP24061200001
String key = "invoice:max:number";
StringBuilder code = new StringBuilder();
code.append("KP");
code.append(DateUtils.format(new Date(), "yyMMdd"));
Long codeNum;
if (redisHelper.hasKey(key)) {
codeNum = redisHelper.incrBy(key, 1);
} else {
RLock lock = redissonClient.getLock("next:invoice:code:lock");
try {
boolean lockSuccess = lock.tryLock(2, 2, TimeUnit.SECONDS);
if (!lockSuccess) {
throw exception(GET_LOCK_FAILED);
}
String currentMaxInvoiceCode = receiptInvoiceMapper.getCurrentMaxInvoiceCode();
if (currentMaxInvoiceCode == null){
codeNum = 1L;
} else {
codeNum = Long.parseLong(currentMaxInvoiceCode.substring(7)) + 1;
}
redisHelper.set(key, String.valueOf(codeNum),10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
throw exception(GET_LOCK_FAILED);
} finally {
lock.unlock();
}
}
// 获得4位序列号,不足位前面补0
codeNum = codeNum % 10000;
code.append(String.format("%04d", codeNum));
return code.toString();
}
}
......@@ -196,57 +196,34 @@ public class ReceiptBackVO {
@ApiModelProperty(value = "财务备注")
private String financeRemark;
/*
*/
@ExcelProperty("明细状态")
@ApiModelProperty(value = "明细状态")
private String mxStatus;
/**
* 订单号
*
*/
@ApiModelProperty(value = "订单号")
private String orderNo;
/*
订单ID
*/
@ApiModelProperty(value = "订单ID")
private Long orderId;
/*
提单号
*/
@ApiModelProperty(value = "提单号")
private String tidanNo;
/*
应收金额
*/
@ApiModelProperty(value = "应收金额")
private String ysShow;
/*
实数金额
*/
@ApiModelProperty(value = "实数金额")
private String ssShow;
/*
核销比例
*/
@ApiModelProperty(value = "核销比例")
private String hxBiLi;
@ApiModelProperty(value = "明细状态(数据库)")
private Integer detailStatus;
@ApiModelProperty(value = "开票状态")
private Integer invoicingStatus;
/* @ApiModelProperty(value = "应收明细列表")
private List<ReceivableDetail> receivableDetailList;
@ApiModelProperty(value = "应收明细")
private String receivableDetail;
public void setReceivableDetail(String receivableDetail) {
this.receivableDetail = receivableDetail;
if (StringUtils.isNotBlank(receivableDetail)) {
this.receivableDetailList = JSONObject.parseArray(receivableDetail, ReceivableDetail.class);
}
}*/
@ApiModelProperty(value = "开票资料状态")
private Integer invoiceDataStatus;
}
package cn.iocoder.yudao.module.wealth.vo.receipt;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("管理后台 - 银行收款明细自动核销区间 VO")
public class ReceiptBankWriteoffRangeVO {
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ApiModelProperty(value = "核销比例下界(除以100)")
private Integer writeOffDown;
@ApiModelProperty(value = "核销比例上界(除以100)")
private Integer writeOffUp;
}
\ No newline at end of file
......@@ -63,26 +63,26 @@ public class ReceiptBaseVO {
@ApiModelProperty(value = "手续费")
private BigDecimal feeRate;
@ApiModelProperty(value = "发票抬头")
private String invoice;
//@ApiModelProperty(value = "发票抬头")
//private String invoice;
@ApiModelProperty(value = "纳税人识别号")
private String taxpayer;
//@ApiModelProperty(value = "纳税人识别号")
//private String taxpayer;
@ApiModelProperty(value = "开户行")
private String accountBank;
//@ApiModelProperty(value = "开户行")
//private String accountBank;
@ApiModelProperty(value = "账号")
private String accountName;
//@ApiModelProperty(value = "账号")
//private String accountName;
@ApiModelProperty(value = "项目")
private String projectName;
//@ApiModelProperty(value = "项目(目前原型叫开票品名)")
//private String projectName;
@ApiModelProperty(value = "税率")
private BigDecimal taxRate;
//@ApiModelProperty(value = "税率")
//private BigDecimal taxRate;
@ApiModelProperty(value = "开票地址、电话")
private String addressPhone;
//@ApiModelProperty(value = "开票地址、电话")
//private String addressPhone;
@ApiModelProperty(value = "实收日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
......@@ -151,15 +151,10 @@ public class ReceiptBaseVO {
@ApiModelProperty(value = "财务备注")
private String financeRemark;
/*
订单ID
*/
@ApiModelProperty(value = "订单ID")
private long orderId;
/*
订单编号
*/
@ApiModelProperty(value = "订单编号")
private String orderNo;
}
package cn.iocoder.yudao.module.wealth.vo.receipt;
import cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountCreateReqVO;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceCreateReqVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableUpdateReqVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -23,10 +24,11 @@ public class ReceiptCreateReqVO extends ReceiptBaseVO {
@ApiModelProperty(value = "应收项")
private List<ReceivableUpdateReqVO> receivableVOList;
@ApiModelProperty(value = "收款信息")
private List<ReceiptAccountCreateReqVO> receiptAccountList;
@ApiModelProperty(value = "开票资料")
private ReceiptInvoiceCreateReqVO receiptInvoice;
@ApiModelProperty(value = "抄送人")
private String[] copyUserList;
......
package cn.iocoder.yudao.module.wealth.vo.receipt;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
......@@ -140,4 +141,12 @@ public class ReceiptQueryVO {
@ApiModelProperty(value = "编号")
private String numberNo;
@ApiModelProperty(value = "明细状态")
private Integer detailStatus;
@ApiModelProperty(value = "开票状态")
private Integer invoicingStatus;
@ApiModelProperty(value = "开票资料状态")
private Integer invoiceDataStatus;
}
package cn.iocoder.yudao.module.wealth.vo.receiptInvoice;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 收款单开票信息 Base VO,提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class ReceiptInvoiceBaseVO {
@ApiModelProperty(value = "收款单id", required = true)
@NotNull(message = "收款单id不能为空")
private Long receiptId;
@ApiModelProperty(value = "收款单号(例:SKD001)", required = true)
@NotNull(message = "收款单号(例:SKD001)不能为空")
private String receiptNo;
@ApiModelProperty(value = "部门id")
private Long departmentId;
@ApiModelProperty(value = "部门名称")
private String departmentName;
@ApiModelProperty(value = "申请人id")
private Long salesmanId;
@ApiModelProperty(value = "申请人姓名")
private String salesmanName;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "发票抬头")
private String invoiceHeader;
@ApiModelProperty(value = "纳税人识别号")
private String taxpayer;
@ApiModelProperty(value = "税率")
private java.math.BigDecimal taxRate;
@ApiModelProperty(value = "开票电话")
private String invoicePhone;
@ApiModelProperty(value = "开票地址")
private String invoiceAddress;
@ApiModelProperty(value = "发票号码")
private String invoiceNumber;
@ApiModelProperty(value = "开票类型(字典表 invoicing_type)")
private Integer invoiceTypeId;
@ApiModelProperty(value = "开票类型名称")
private String invoiceType;
@ApiModelProperty(value = "开票备注")
private String invoiceRemark;
@ApiModelProperty(value = "开票人id")
private Long issuerId;
@ApiModelProperty(value = "开票人名称")
private String issuerName;
@ApiModelProperty(value = "开票时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date invoiceTime;
}
package cn.iocoder.yudao.module.wealth.vo.receiptInvoice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
@Data
@ToString(callSuper = true)
@ApiModel("管理后台 - 收款单开票信息创建 Request VO")
public class ReceiptInvoiceCreateReqVO {
@ApiModelProperty(value = "发票抬头")
private String invoiceHeader;
@ApiModelProperty(value = "纳税人识别号")
private String taxpayer;
@ApiModelProperty(value = "开户行")
private String accountBank;
@ApiModelProperty(value = "账号")
private String accountName;
@ApiModelProperty(value = "开票品名")
private String invoiceItem;
@ApiModelProperty(value = "税率")
private BigDecimal taxRate;
@ApiModelProperty(value = "开票电话")
private String invoicePhone;
@ApiModelProperty(value = "开票地址")
private String invoiceAddress;
@ApiModelProperty(value = "备注")
private String remark;
}
package cn.iocoder.yudao.module.wealth.vo.receiptInvoice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("管理后台 - 开票详情 VO")
public class ReceiptInvoiceDetailVO {
//订单信息/基础信息
@ApiModelProperty(value = "收款单id")
private Long receiptId;
@ApiModelProperty(value = "收款单号(例:SKD001)")
private String receiptNo;
@ApiModelProperty(value = "订单id")
private Long orderId;
@ApiModelProperty(value = "订单号(NG2414248L)")
private String orderNo;
@ApiModelProperty(value = "应收金额(多币种换行,应该从应收明细中取)")
private Integer receivableTotalAmount;
@ApiModelProperty(value = "开票状态")
private Integer invoicingStatus;
@ApiModelProperty(value = "开票编号")
private String invoiceNo;
@ApiModelProperty(value = "开票类型(字典表 invoicing_type)")
private Integer invoiceTypeId;
@ApiModelProperty(value = "开票类型名称")
private String invoiceType;
// 开票资料
@ApiModelProperty(value = "发票抬头")
private String invoiceHeader;
@ApiModelProperty(value = "纳税人识别号")
private String taxpayer;
@ApiModelProperty(value = "税率")
private java.math.BigDecimal taxRate;
@ApiModelProperty(value = "开票品名")
private String invoiceItem;
@ApiModelProperty(value = "开票电话")
private String invoicePhone;
@ApiModelProperty(value = "开票地址")
private String invoiceAddress;
@ApiModelProperty(value = "发票号码")
private String invoiceNumber;
@ApiModelProperty(value = "开票备注")
private String invoiceRemark;
@ApiModelProperty(value = "开票金额(暂时不知道从哪拿)")
// TODO 暂时不知道从哪拿
private java.math.BigDecimal invoiceMoney;
@ApiModelProperty(value = "开发票人id")
private Long invoicerId;
@ApiModelProperty(value = "开票人名称")
private String invoicerName;
@ApiModelProperty(value = "开票时间")
private Date invoiceTime;
// 应收信息
// 日志
}
package cn.iocoder.yudao.module.wealth.vo.receiptInvoice;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 收款单开票信息日志 Response VO
* @author 系统管理员
*/
@Data
@ApiModel("管理后台 - 收款单开票信息日志 Response VO")
public class ReceiptInvoiceLogBackVO {
@ExcelProperty("主键")
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ExcelProperty("开票环节")
@ApiModelProperty(value = "开票环节", required = true)
private Integer invoicingLink;
@ExcelProperty("操作人")
@ApiModelProperty(value = "操作人")
private String operator;
@ExcelProperty("备注")
@ApiModelProperty(value = "备注")
private String remark;
@ExcelProperty("审批流程")
@ApiModelProperty(value = "审批流程")
private Integer bmpStatus;
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
package cn.iocoder.yudao.module.wealth.vo.receiptInvoice;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("管理后台 - 收款单开票列表 Response VO")
public class ReceiptInvoicePageBackVO {
@ExcelProperty("主键")
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ExcelProperty("收款单id")
@ApiModelProperty(value = "收款单id", required = true)
private Long receiptId;
@ExcelProperty("收款单号(例:SKD001)")
@ApiModelProperty(value = "收款单号(例:SKD001)", required = true)
private String receiptNo;
@ApiModelProperty(value = "申请日期")
private String invoiceInfoSaveTime;
@ExcelProperty("开票状态")
@ApiModelProperty(value = "开票状态")
private Integer invoicingStatus;
@ExcelProperty("开票明细状态")
@ApiModelProperty(value = "开票明细状态")
private Integer invoicingDetailStatus;
@ExcelProperty("部门id")
@ApiModelProperty(value = "部门id")
private Long departmentId;
@ExcelProperty("部门名称")
@ApiModelProperty(value = "部门名称")
private String departmentName;
@ExcelProperty("申请人id")
@ApiModelProperty(value = "申请人id")
private Long applyUserId;
@ExcelProperty("申请人姓名")
@ApiModelProperty(value = "申请人姓名")
private String applyUserName;
@ApiModelProperty(value = "发票抬头")
private String invoiceHeader;
@ApiModelProperty(value = "开票金额(暂时不知道从哪拿)")
// TODO 暂时不知道从哪拿
private java.math.BigDecimal invoiceMoney;
@ApiModelProperty(value = "开票品名")
private String invoiceItem;
@ApiModelProperty(value = "税率")
private java.math.BigDecimal taxRate;
@ApiModelProperty(value = "订单号(NG2414248L)")
private String orderNo;
@ApiModelProperty(value = "提单号(CNG244432-26)")
private String tidanNo;
@ApiModelProperty(value = "收款状态")
private Integer receiptState;
@ApiModelProperty(value = "核销比例")
private java.math.BigDecimal writeOffProportion;
}
package cn.iocoder.yudao.module.wealth.vo.receiptInvoice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("管理后台 - 收款单开票信息查询 VO")
public class ReceiptInvoiceQueryVO {
@ApiModelProperty(value = "开票编号")
private String invoiceNo;
@ApiModelProperty(value = "收款单号(例:SKD001)")
private String receiptNo;
@ApiModelProperty(value = "订单号(NG2414248L)")
private String orderNo;
@ApiModelProperty(value = "提单号(CNG244432-26)")
private String tidanNo;
@ApiModelProperty(value = "开票状态")
private Integer invoicingStatus;
}
package cn.iocoder.yudao.module.wealth.vo.receiptInvoice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 收款单开票信息更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ReceiptInvoiceUpdateReqVO extends ReceiptInvoiceBaseVO {
@ApiModelProperty(value = "主键", required = true)
@NotNull(message = "主键不能为空")
private Long id;
}
package cn.iocoder.yudao.module.wealth.vo.receivable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("管理后台 - 费用明细 Response VO")
@Builder
public class CostDetailBackVO {
@ApiModelProperty(value = "按查询统计")
private List<WealthMoneyAmountVO> searchStatistics;
@ApiModelProperty(value = "所有明细统计")
private List<WealthMoneyAmountVO> totalStatistics;
@ApiModelProperty(value = "分页VO")
private List<CostDetailPageVO> list;
@ApiModelProperty(value = "总量")
private Long total;
@ApiModelProperty(value = "每页记录数")
private Long rows;
@ApiModelProperty(value = "当前页数")
private Long page;
@ApiModelProperty(value = "总页数")
private Long pages;
}
package cn.iocoder.yudao.module.wealth.vo.receivable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("管理后台 - 费用明细查询 Request VO")
public class CostDetailPageQueryVO {
@ApiModelProperty(value = "订单号")
private String orderNo;
@ApiModelProperty(value = "运输方式id")
private Integer transportId;
@ApiModelProperty(value = "出货渠道(多选)")
private List<Integer> shipmentChannel;
@ApiModelProperty(value = "始发仓id(多选)")
private List<Integer> departureWareHouseId;
@ApiModelProperty(value = "目的国(多选)")
private List<Integer> destCountry;
@ApiModelProperty(value = "目的城市(多选)")
private List<Integer> destCity;
@ApiModelProperty(value = "目的仓id(多选)")
private List<Integer> objectiveWareHouseId;
@ApiModelProperty(value = "品名")
private String title;
@ApiModelProperty(value = "费用来源:1 订单计算 2 费用申请 3 特需费用(多选)")
private List<Integer> feeSource;
@ApiModelProperty(value = "费用类型(字典 receivable_fee_type)(多选)")
private List<Integer> feeType;
@ApiModelProperty(value = "收款类型(字典 payment_type)(多选)")
private List<Integer> collectionType;
@ApiModelProperty(value = "收款状态(0未收款,1收款中,2已收款)(多选)")
private Integer state;
}
package cn.iocoder.yudao.module.wealth.vo.receivable;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel("管理后台 - 费用明细分页 Response VO")
public class CostDetailPageVO {
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ExcelProperty("收款单id")
@ApiModelProperty(value = "收款单id")
private Long receiptId;
@ExcelProperty("收款单号")
@ApiModelProperty(value = "收款单号")
private String receiptNo;
@ExcelProperty("订单id")
@ApiModelProperty(value = "订单id")
private Long orderId;
@ExcelProperty("订单号")
@ApiModelProperty(value = "订单号")
private String orderNo;
@ExcelProperty("订单项商品ID")
@ApiModelProperty(value = "订单项商品ID")
private Long orderItemId;
@ExcelProperty("中文标题")
@ApiModelProperty(value = "中文标题")
private String titleZh;
@ExcelProperty("英文标题")
@ApiModelProperty(value = "英文标题")
private String titleEn;
@ExcelProperty("数量")
@ApiModelProperty(value = "数量")
private Integer quantity;
@ExcelProperty("箱数")
@ApiModelProperty(value = "箱数")
private Integer num;
@ExcelProperty("重量")
@ApiModelProperty(value = "重量")
private BigDecimal weight;
@ExcelProperty("体积")
@ApiModelProperty(value = "体积")
private BigDecimal volume;
@ExcelProperty("收款类型(字典 payment_type)")
@ApiModelProperty(value = "收款类型(字典 payment_type)")
private Integer collectionType;
@ExcelProperty("费用类型(字典 receivable_fee_type)")
@ApiModelProperty(value = "费用类型(字典 receivable_fee_type)")
private Integer feeType;
@ExcelProperty("汇率")
@ApiModelProperty(value = "汇率")
private BigDecimal exchangeRate;
@ExcelProperty("货币id")
@ApiModelProperty(value = "货币id")
private Integer currencyId;
@ApiModelProperty(value = "币种符号")
private String currencySymbol;
@ExcelProperty("单价")
@ApiModelProperty(value = "单价")
private BigDecimal unitPrice;
@ExcelProperty("总金额")
@ApiModelProperty(value = "总金额")
private BigDecimal totalAmount;
@ApiModelProperty(value = "税点")
private BigDecimal taxPoint;
@ApiModelProperty(value = "含税金额")
private BigDecimal taxAmount;
@ExcelProperty("优惠金额")
@ApiModelProperty(value = "优惠金额")
private BigDecimal discountTotal;
@ExcelProperty("收款状态(0未收款,1收款中,2已收款)")
@ApiModelProperty(value = "收款状态(0未收款,1收款中,2已收款)")
private Integer state;
@ApiModelProperty(value = "订单状态详情见字典:order_status")
private Integer status;
@ExcelProperty("运输方式id")
@ApiModelProperty(value = "运输方式id")
private Integer transportId;
@ExcelProperty("出货渠道ID")
@ApiModelProperty(value = "出货渠道ID")
private Integer channelId;
@ExcelProperty("始发仓ID")
@ApiModelProperty(value = "始发仓ID")
private Integer departureWarehouseId;
@ExcelProperty("始发仓中文")
@ApiModelProperty(value = "始发仓中文")
private String departureWarehouseZh;
@ExcelProperty("始发仓英文")
@ApiModelProperty(value = "始发仓英文")
private String departureWarehouseEn;
@ExcelProperty("目的仓ID")
@ApiModelProperty(value = "目的仓ID")
private Integer objectiveWarehouseId;
@ExcelProperty("目的仓中文")
@ApiModelProperty(value = "目的仓中文")
private String objectiveWarehouseZh;
@ExcelProperty("目的仓英文")
@ApiModelProperty(value = "目的仓英文")
private String objectiveWarehouseEn;
@ApiModelProperty(value = "费用来源:1 订单计算 2 费用申请 3 特需费用")
private Integer feeSource;
@ApiModelProperty(value = "核销金额")
private BigDecimal writeOffAmount;
@ApiModelProperty(value = "核销比例")
private BigDecimal writeOffProportion;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "更新人")
private String updater;
}
......@@ -149,6 +149,9 @@ public class ReceivableBackVO {
@ApiModelProperty(value = "订单到仓状态(字典 order_to_warehouse_state)")
private Integer toWarehouseState;
@ApiModelProperty(value = "发货人id")
private String consignorId;
@ExcelProperty("发货人姓名")
@ApiModelProperty(value = "发货人姓名")
private String consignorName;
......@@ -157,6 +160,9 @@ public class ReceivableBackVO {
@ApiModelProperty(value = "发货人手机号")
private String consignorPhone;
@ApiModelProperty(value = "收货人id")
private String consigneeId;
@ExcelProperty("收货人姓名")
@ApiModelProperty(value = "收货人姓名")
private String consigneeName;
......
package cn.iocoder.yudao.module.wealth.vo.receivable;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel("管理后台 - 费用详细统计 VO")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WealthMoneyAmountVO {
@ApiModelProperty(value = "币种id")
private Integer currencyId;
@ApiModelProperty(value = "币种符号")
private String currencySymbol;
@ApiModelProperty(value = "币种名")
private String currencyName;
@ApiModelProperty(value = "总金额合计")
private BigDecimal totalAmount;
@ApiModelProperty(value = "不含税金额合计")
private BigDecimal notIncludedTaxAmount;
@ApiModelProperty(value = "含税金额合计")
private BigDecimal taxAmount;
@ApiModelProperty(value = "优惠合计")
private BigDecimal discountTotal;
@ApiModelProperty(value = "实际金额合计")
private BigDecimal receivableTotalAmount;
@ApiModelProperty(value = "核销合计")
private BigDecimal writeOffAmount;
@ApiModelProperty(value = "未核销合计")
private BigDecimal notWriteOffAmount;
}
......@@ -289,15 +289,15 @@ public class ReceiptController {
return success(ReceiptAccountConvert.INSTANCE.convertList(list));
}
@GetMapping("/invoicing/info/{id}")
@ApiOperation("获得收款单开票信息")
@ApiImplicitParam(name = "id", value = "收款单ID", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthorize("@ss.hasPermission('ecw:receipt:query')")
public CommonResult<ReceiptBackVO> getInvoicingInfo(@PathVariable("id") Long id) {
ReceiptBackVO receiptBackVO = receiptService.getInvoicingInfo(id);
return success(receiptBackVO);
}
// TODO 拆分到开票管理
//@GetMapping("/invoicing/info/{id}")
//@ApiOperation("获得收款单开票信息")
//@ApiImplicitParam(name = "id", value = "收款单ID", required = true, example = "1024", dataTypeClass = Long.class)
////@PreAuthorize("@ss.hasPermission('ecw:receipt:query')")
//public CommonResult<ReceiptBackVO> getInvoicingInfo(@PathVariable("id") Long id) {
// ReceiptBackVO receiptBackVO = receiptService.getInvoicingInfo(id);
// return success(receiptBackVO);
//}
/* @GetMapping("/getInvoicingItem")
@ApiOperation("根据收款单ID获取应收明细")
......@@ -308,13 +308,14 @@ public class ReceiptController {
return success(ReceivableConvert.INSTANCE.convertList(receivableService.list(lambdaQueryWrapper)));
}*/
@PutMapping("/invoicing/info")
@ApiOperation("更新收款单开票信息")
//@PreAuthorize("@ss.hasPermission('ecw:receipt:update')")
public CommonResult<Boolean> updateInvoicingInfo(@Valid @RequestBody InvoicingUpdateVO invoicingUpdateVO) {
receiptService.updateInvoicingInfo(invoicingUpdateVO);
return success(true);
}
// TODO 拆分到开票管理
//@PutMapping("/invoicing/info")
//@ApiOperation("更新收款单开票信息")
////@PreAuthorize("@ss.hasPermission('ecw:receipt:update')")
//public CommonResult<Boolean> updateInvoicingInfo(@Valid @RequestBody InvoicingUpdateVO invoicingUpdateVO) {
// receiptService.updateInvoicingInfo(invoicingUpdateVO);
// return success(true);
//}
@GetMapping("/list")
@ApiOperation("获得收款单列表")
......@@ -335,6 +336,18 @@ public class ReceiptController {
return success(ReceiptAccountConvert.INSTANCE.convertList(accountList));
}
@GetMapping("/bank-writeoff-range")
@ApiOperation("获得银行收款明细自动核销比例")
public CommonResult<ReceiptBankWriteoffRangeVO> getBankWriteoffRange() {
return success(receiptService.getBankWriteoffRange());
}
@PostMapping("/bank-writeoff-range")
@ApiOperation("设置银行收款明细自动核销比例")
public CommonResult<Boolean> getBankWriteoffRange(@RequestBody ReceiptBankWriteoffRangeVO range) {
return success(receiptService.setBankWriteoffRange(range));
}
@GetMapping("/export-excel")
@ApiOperation("导出收款单 Excel")
......
package cn.iocoder.yudao.module.wealth.controller.admin.receiptInvoice;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.wealth.service.receiptInvoice.ReceiptInvoiceService;
import cn.iocoder.yudao.module.wealth.vo.receiptInvoice.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "管理后台 - 收款单开票信息")
@RequestMapping("/ecw/receipt-invoice")
public class ReceiptInvoiceController {
@Resource
private ReceiptInvoiceService receiptInvoiceService;
@PostMapping("/create")
@ApiOperation("创建收款单开票信息")
public CommonResult<Long> createReceiptInvoice(@Valid @RequestBody ReceiptInvoiceCreateReqVO createReqVO) {
return success(receiptInvoiceService.createReceiptInvoice(createReqVO));
}
@PutMapping("/update")
@ApiOperation("更新收款单开票信息")
public CommonResult<Boolean> updateReceiptInvoice(@Valid @RequestBody ReceiptInvoiceUpdateReqVO updateReqVO) {
receiptInvoiceService.updateReceiptInvoice(updateReqVO);
return success(true);
}
@GetMapping("/get")
@ApiOperation("获得收款单开票信息")
public CommonResult<ReceiptInvoiceDetailVO> getReceiptInvoiceDetail(@RequestParam("id") Long id) {
ReceiptInvoiceDetailVO receiptInvoiceDetail = receiptInvoiceService.getReceiptInvoiceDetail(id);
return success(receiptInvoiceDetail);
}
@PostMapping("/page")
@ApiOperation("获得收款单开票信息分页")
public CommonResult<PageResult<ReceiptInvoicePageBackVO>> getReceiptInvoicePage(@RequestBody @Valid ReceiptInvoiceQueryVO query, PageVO page) {
PageResult<ReceiptInvoicePageBackVO> pageResult = receiptInvoiceService.getReceiptInvoicePage(query, page);
return success(pageResult);
}
//@GetMapping("/export-excel")
//@ApiOperation("导出收款单开票信息 Excel")
//@OperateLog(type = EXPORT)
//public void exportReceiptInvoiceExcel(@Valid ReceiptInvoiceQueryVO query,
// HttpServletResponse response) throws IOException {
// List<ReceiptInvoiceDO> list = receiptInvoiceService.getReceiptInvoiceList(query);
// // 导出 Excel
// List<ReceiptInvoicePageBackVO> datas = ReceiptInvoiceConvert.INSTANCE.convertList(list);
// ExcelUtils.write(response, "收款单开票信息.xls", "数据", ReceiptInvoicePageBackVO.class, datas);
//}
}
......@@ -7,9 +7,7 @@ import cn.iocoder.yudao.module.wealth.convert.receivableDiscount.ReceivableDisco
import cn.iocoder.yudao.module.wealth.dal.dataobject.receivableDiscount.ReceivableDiscountDO;
import cn.iocoder.yudao.module.wealth.dal.mysql.receivableDiscount.ReceivableDiscountMapper;
import cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableBackVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableQueryVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableUpdateReqVO;
import cn.iocoder.yudao.module.wealth.vo.receivable.*;
import cn.iocoder.yudao.module.wealth.vo.receivableDiscount.ReceivableDiscountBackVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
......@@ -45,6 +43,13 @@ public class ReceivableController {
return success(pageResult);
}
@GetMapping("/page/amount")
@ApiOperation("应收款分页条件总金额合计")
public CommonResult<List<WealthMoneyAmountVO>> getReceivablePage(@Valid ReceivableQueryVO query) {
List<WealthMoneyAmountVO> pageAmount = receivableService.receivablePageAmount(query);
return success(pageAmount);
}
@GetMapping("/getReceivableByOrderId")
@ApiOperation("根据订单ID获取所有未加入收款单的应收明细")
public CommonResult<List<ReceivableBackVO>> getReceivableByOrderId(@RequestParam("orderId") Long orderId) {
......@@ -93,6 +98,12 @@ public class ReceivableController {
return success(ReceivableDiscountConvert.INSTANCE.convert(receivableDiscountMapper.selectOne(lambdaQueryWrapper)));
}
@PostMapping("/page/costDetail")
@ApiOperation("财务-费用明细")
public CommonResult<CostDetailBackVO> getCostDetailPage(@Valid @RequestBody CostDetailPageQueryVO query, PageVO page) {
CostDetailBackVO pageResult = receivableService.getCostDetailPage(query, page);
return success(pageResult);
}
/*
@GetMapping("/list")
@ApiOperation("根据id集合获得应收款列表")
......
......@@ -4,12 +4,24 @@
<select id="getReceiptBackPage" resultType="cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptBackVO">
<!--添加关联订单和应收款表的关联-->
select er.*,rb.order_no as orderNo,o.tidan_no as tidanNo,
rb.order_id as orderId
from ecw_receipt er left join ecw_receivable rb
on rb.receipt_id=er.id and rb.deleted=0
left join ecw_order o on o.order_no=rb.order_no and o.deleted=0
where er.deleted = 0
SELECT
er.*,
rb.order_no AS orderNo,
o.tidan_no AS tidanNo,
rb.order_id AS orderId
FROM ecw_receipt er
LEFT JOIN ecw_receivable rb ON rb.receipt_id=er.id AND rb.deleted=0
LEFT JOIN ecw_order o ON o.order_no=rb.order_no AND o.deleted=0
WHERE er.deleted = 0
<if test="query.detailStatus != null">
AND er.`detail_status` = #{query.detailStatus}
</if>
<if test="query.invoicingStatus != null">
AND er.`invoicing_status` = #{query.invoicingStatus}
</if>
<if test="query.invoiceDataStatus != null">
AND er.`invoice_data_status` = #{query.invoiceDataStatus}
</if>
<if test="query.receiptNo != null">
AND er.`receipt_no` = #{query.receiptNo}
</if>
......@@ -23,16 +35,17 @@
AND er.`state` = #{query.state}
</if>
<if test="query.salesmanId != null">
AND (er.`salesman_id` = #{query.salesmanId} or er.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
AND (er.`salesman_id` = #{query.salesmanId} or er.`customer_id` in(select cus.id from ecw_customer cus where
cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ))
</if>
<if test="query.salesmanName != null">
AND er.`salesman_name` = #{query.salesmanName}
</if>
<if test = "query.beginCreateTime != null and query.endCreateTime != null ">
<if test="query.beginCreateTime != null and query.endCreateTime != null ">
AND er.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if>
<if test = "query.numberNo != null and query.numberNo != '' ">
and er.id in ( SELECT DISTINCT
<if test="query.numberNo != null and query.numberNo != '' ">
and er.id in ( SELECT DISTINCT
t.receipt_id
FROM
ecw_receivable t
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.wealth.dal.mysql.receiptInvoice.ReceiptInvoiceMapper">
<select id="getReceiptInvoicePage" resultType="cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoicePageBackVO">
SELECT
eri.*,
er.state AS receiptState,
er.write_off_proportion
FROM ecw_receipt_invoice eri
LEFT JOIN ecw_receipt er ON eri.receipt_id = er.id
WHERE eri.deleted = 0
<if test="query.receiptNo != null and query.receiptNo != '' ">
AND eri.`receipt_no` LIKE CONCAT('%',#{query.receiptNo},'%')
</if>
<if test="query.invoiceNo != null and query.invoiceNo != '' ">
AND eri.`invoice_no` LIKE CONCAT('%',#{query.invoiceNo},'%')
</if>
<if test="query.orderNo != null and query.orderNo != '' ">
AND eri.`order_no` = #{query.orderNo}
</if>
<if test="query.tidanNo != null and query.tidanNo != '' ">
AND eri.`tidan_no` = #{query.tidanNo}
</if>
<if test="query.invoicingStatus != null ">
AND eri.`invoicing_status` = #{query.invoicingStatus}
</if>
</select>
<select id="getReceiptInvoiceDetail"
resultType="cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceDetailVO">
SELECT
eri.*,
er.state AS receiptState,
er.write_off_proportion,
er.receipt_no,
er.order_no
FROM ecw_receipt_invoice eri
LEFT JOIN ecw_receipt er ON eri.receipt_id = er.id
</select>
<select id="getCurrentMaxInvoiceCode" resultType="java.lang.String">
SELECT invoice_no FROM ecw_receipt_invoice ORDER BY invoice_no DESC LIMIT 1
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment