Browse Source

2023年11月24日17:37:34

纪新园 2 years ago
parent
commit
2be11869ea
20 changed files with 2039 additions and 24 deletions
  1. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  2. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/dto/FinInvoicesDTO.java
  3. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/dto/FinInvoicesItemsDTO.java
  4. 487 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/entity/FinInvoices.java
  5. 536 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/entity/FinInvoicesItems.java
  6. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/vo/FinInvoicesItemsVO.java
  7. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/vo/FinInvoicesVO.java
  8. 20 18
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  9. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/controller/FinInvoicesController.java
  10. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/controller/FinInvoicesItemsController.java
  11. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesItemsMapper.java
  12. 111 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesItemsMapper.xml
  13. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesMapper.java
  14. 97 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesMapper.xml
  15. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/IFinInvoicesItemsService.java
  16. 55 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/IFinInvoicesService.java
  17. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesItemsServiceImpl.java
  18. 148 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java
  19. 9 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java
  20. 12 5
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java

+ 6 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java

@@ -1453,6 +1453,12 @@ public class Bills implements Serializable {
 	private List<FeeCenter> feeCenterListD;
 
 	/**
+	 * 物流-费用中心(总)
+	 */
+	@TableField(exist = false)
+	private List<FeeCenter> feeCenterList;
+
+	/**
 	 * 文件
 	 */
 	@TableField(exist = false)

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/dto/FinInvoicesDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.dto;
+
+import org.springblade.los.finance.invoices.entity.FinInvoices;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 业务-发票主表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FinInvoicesDTO extends FinInvoices {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/dto/FinInvoicesItemsDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.dto;
+
+import org.springblade.los.finance.invoices.entity.FinInvoicesItems;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 业务-发票明细数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FinInvoicesItemsDTO extends FinInvoicesItems {
+	private static final long serialVersionUID = 1L;
+
+}

+ 487 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/entity/FinInvoices.java

@@ -0,0 +1,487 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 业务-发票主表实体类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Data
+@TableName("los_fin_invoices")
+@ApiModel(value = "FinInvoices对象", description = "业务-发票主表")
+public class FinInvoices implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	private Long id;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建部门 Id
+	 */
+	@ApiModelProperty(value = "创建部门 Id")
+	private String createDept;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private String createDeptName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * 单据日期
+	 */
+	@ApiModelProperty(value = "单据日期")
+	private Date billDate;
+	/**
+	 * 发票号码
+	 */
+	@ApiModelProperty(value = "发票号码")
+	private String invoiceNo;
+	/**
+	 * 开票日期
+	 */
+	@ApiModelProperty(value = "开票日期")
+	private Date invoiceDate;
+	/**
+	 * 原发票号码
+	 */
+	@ApiModelProperty(value = "原发票号码")
+	private String origInvoiceNo;
+	/**
+	 * 税务发票号码
+	 */
+	@ApiModelProperty(value = "税务发票号码")
+	private String taxInvoiceNo;
+	/**
+	 * 发票类型:全电
+	 */
+	@ApiModelProperty(value = "发票类型:全电")
+	private String invType;
+	/**
+	 * 所属税种: 普通发票 专用发票
+	 */
+	@ApiModelProperty(value = "所属税种: 普通发票 专用发票")
+	private String taxType;
+	/**
+	 * 税率 %
+	 */
+	@ApiModelProperty(value = "税率 %")
+	private BigDecimal taxRate;
+	/**
+	 * 结算方式(0 票结 1月结)
+	 */
+	@ApiModelProperty(value = "结算方式(0 票结 1月结)")
+	private Integer stlMode;
+	/**
+	 * 发票币种
+	 */
+	@ApiModelProperty(value = "发票币种")
+	private String invCurCode;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称,显示不修改
+	 */
+	@ApiModelProperty(value = "客户中文名称,显示不修改")
+	private String corpCnName;
+	/**
+	 * 客户英文名称,显示不修改
+	 */
+	@ApiModelProperty(value = "客户英文名称,显示不修改")
+	private String corpEnName;
+	/**
+	 * 客户开票单位名称,可修改
+	 */
+	@ApiModelProperty(value = "客户开票单位名称,可修改")
+	private String corpInvoiceHeader;
+	/**
+	 * 开票单位 id
+	 */
+	@ApiModelProperty(value = "开票单位 id")
+	private Long invCorpId;
+	/**
+	 * 开票单位中文名称
+	 */
+	@ApiModelProperty(value = "开票单位中文名称")
+	private String invCorpCnName;
+	/**
+	 * 开票单位英文名称
+	 */
+	@ApiModelProperty(value = "开票单位英文名称")
+	private String invCorpEnName;
+	/**
+	 * 开票单位税号
+	 */
+	@ApiModelProperty(value = "开票单位税号")
+	private String invCorpTaxNo;
+	/**
+	 * 开票单位 CNY 开户银行
+	 */
+	@ApiModelProperty(value = "开票单位 CNY 开户银行")
+	private String invCorpAccountBankCny;
+	/**
+	 * 开票单位 CNY 银行账号
+	 */
+	@ApiModelProperty(value = "开票单位 CNY 银行账号")
+	private String invCorpAccountNoCny;
+	/**
+	 * 开票单位 Usd 开户银行
+	 */
+	@ApiModelProperty(value = "开票单位 CNY 开户银行")
+	private String invCorpAccountBankUsd;
+	/**
+	 * 开票单位 Usd 银行账号
+	 */
+	@ApiModelProperty(value = "开票单位 CNY 银行账号")
+	private String invCorpAccountNoUsd;
+	/**
+	 * 船名、航次
+	 */
+	@ApiModelProperty(value = "船名、航次")
+	private String vesselVoyno;
+	/**
+	 * 开船日
+	 */
+	@ApiModelProperty(value = "开船日")
+	private Date etd;
+	/**
+	 * 装货港
+	 */
+	@ApiModelProperty(value = "装货港")
+	private String pol;
+	/**
+	 * 卸货港
+	 */
+	@ApiModelProperty(value = "卸货港")
+	private String pod;
+	/**
+	 * 目的地
+	 */
+	@ApiModelProperty(value = "目的地")
+	private String destination;
+	/**
+	 * 箱型、箱量
+	 */
+	@ApiModelProperty(value = "箱型、箱量")
+	private String containers;
+	/**
+	 * 币种,用于检索费用,空字符串表示所有币种
+	 */
+	@ApiModelProperty(value = "币种,用于检索费用,空字符串表示所有币种")
+	private String curCode;
+	/**
+	 * 原汇率,外币转为本币的汇率
+	 */
+	@ApiModelProperty(value = "原汇率,外币转为本币的汇率")
+	private BigDecimal exrate;
+	/**
+	 * 是否转换为人民币(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否转换为人民币(0 否 1是)")
+	private Integer isExchangeToCny;
+	/**
+	 * 业务类型,用于检索费用
+	 */
+	@ApiModelProperty(value = "业务类型,用于检索费用")
+	private String businessTypes;
+	/**
+	 * 业务单据编号,用于检索费用
+	 */
+	@ApiModelProperty(value = "业务单据编号,用于检索费用")
+	private String businessNo;
+	/**
+	 * 对账单编号,用于检索费用
+	 */
+	@ApiModelProperty(value = "对账单编号,用于检索费用")
+	private String checkNo;
+	/**
+	 * MBL NO,用于检索费用
+	 */
+	@ApiModelProperty(value = "MBL NO,用于检索费用")
+	private String mblno;
+	/**
+	 * HBL NO,用于检索费用
+	 */
+	@ApiModelProperty(value = "HBL NO,用于检索费用")
+	private String hblno;
+	/**
+	 * 订舱,用于检索费用
+	 */
+	@ApiModelProperty(value = "订舱,用于检索费用")
+	private String bookingNo;
+	/**
+	 * 船名 id
+	 */
+	@ApiModelProperty(value = "船名 id")
+	private Long vesselId;
+	/**
+	 * 中文船名
+	 */
+	@ApiModelProperty(value = "中文船名")
+	private String vesselCnName;
+	/**
+	 * 英文船名
+	 */
+	@ApiModelProperty(value = "英文船名")
+	private String vesselEnName;
+	/**
+	 * 航次
+	 */
+	@ApiModelProperty(value = "航次")
+	private String voyageNo;
+	/**
+	 * 财务开始日期
+	 */
+	@ApiModelProperty(value = "财务开始日期")
+	private Date accountDateFrom;
+	/**
+	 * 财务结束日期
+	 */
+	@ApiModelProperty(value = "财务结束日期")
+	private Date accountDateTo;
+	/**
+	 * 申请人 Id
+	 */
+	@ApiModelProperty(value = "申请人 Id")
+	private Long applicantId;
+	/**
+	 * 申请人
+	 */
+	@ApiModelProperty(value = "申请人")
+	private String applicantName;
+	/**
+	 * 审核人 Id
+	 */
+	@ApiModelProperty(value = "审核人 Id")
+	private Long approverId;
+	/**
+	 * 审核人
+	 */
+	@ApiModelProperty(value = "审核人")
+	private String approverName;
+	/**
+	 * 是否代理发票, 0 否, 1 是
+	 */
+	@ApiModelProperty(value = "是否代理发票, 0 否, 1 是")
+	private Integer isAgent;
+	/**
+	 * 是否 DK, 0 否, 1 是
+	 */
+	@ApiModelProperty(value = "是否 DK, 0 否, 1 是")
+	private Integer isDk;
+	/**
+	 * 是否 RP, 0 否, 1 是
+	 */
+	@ApiModelProperty(value = "是否 RP, 0 否, 1 是")
+	private Integer isRp;
+	/**
+	 * RP 名称
+	 */
+	@ApiModelProperty(value = "RP 名称")
+	private String rpName;
+	/**
+	 * 导出日期
+	 */
+	@ApiModelProperty(value = "导出日期")
+	private Date exportDate;
+	/**
+	 * 导出人 Id
+	 */
+	@ApiModelProperty(value = "导出人 Id")
+	private Long exportId;
+	/**
+	 * 导出人
+	 */
+	@ApiModelProperty(value = "导出人")
+	private String exportName;
+	/**
+	 * 是否导出船名航次(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否导出船名航次(0 否 1是)")
+	private Integer isExportVslvoy;
+	/**
+	 * 是否导出主单号(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否导出主单号(0 否 1是)")
+	private Integer isExportMblno;
+	/**
+	 * 是否导出分单号(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否导出分单号(0 否 1是)")
+	private Integer isExportHblno;
+	/**
+	 * 发票本位币(CNY)
+	 */
+	@ApiModelProperty(value = "发票本位币(CNY)")
+	private BigDecimal amountCny;
+	/**
+	 * 发票 USD
+	 */
+	@ApiModelProperty(value = "发票 USD")
+	private BigDecimal amountUsd;
+	/**
+	 * 税额(CNY)
+	 */
+	@ApiModelProperty(value = "税额(CNY)")
+	private BigDecimal amountTax;
+	/**
+	 * 合计本位币(CNY )
+	 */
+	@ApiModelProperty(value = "合计本位币(CNY )")
+	private BigDecimal amountLoc;
+	/**
+	 * 全电发票备注
+	 */
+	@ApiModelProperty(value = "全电发票备注")
+	private String elecRemarks;
+	/**
+	 * 银行进账单出票人名称
+	 */
+	@ApiModelProperty(value = "银行进账单出票人名称")
+	private String bankReceiptCorpName;
+	/**
+	 * 银行进账单出票银行
+	 */
+	@ApiModelProperty(value = "银行进账单出票银行")
+	private String bankReceiptBankName;
+	/**
+	 * 银行进账单出票银行账号
+	 */
+	@ApiModelProperty(value = "银行进账单出票银行账号")
+	private String bankReceiptAccountNo;
+	/**
+	 * 银行进账单票据种类,支票 汇票 承兑汇票
+	 */
+	@ApiModelProperty(value = "银行进账单票据种类,支票 汇票 承兑汇票")
+	private String bankReceiptBillType;
+	/**
+	 * 银行进账单票据张数
+	 */
+	@ApiModelProperty(value = "银行进账单票据张数")
+	private Integer bankReceiptBillCount;
+	/**
+	 * 银行进账单是否已进账(收款)
+	 */
+	@ApiModelProperty(value = "银行进账单是否已进账(收款)")
+	@TableField("bank_receipt_is_Income")
+	private Integer bankReceiptIsIncome;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	@TableLogic(value = "0", delval = "1")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+	/**
+	 * 业务-发票明细
+	 */
+	@ApiModelProperty(value = "租户")
+	private List<FinInvoicesItems> finInvoicesItemsList;
+
+	/**
+	 * 编码生成code
+	 */
+	@TableField(exist = false)
+	private String billNoFormat;
+
+	/**
+	 * 业务类型表 code
+	 */
+	@TableField(exist = false)
+	private String businessTypeCode;
+
+
+}

+ 536 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/entity/FinInvoicesItems.java

@@ -0,0 +1,536 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.entity;
+
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 业务-发票明细实体类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Data
+@TableName("los_fin_invoices_items")
+@ApiModel(value = "FinInvoicesItems对象", description = "业务-发票明细")
+public class FinInvoicesItems implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	private Long id;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建部门 Id
+	 */
+	@ApiModelProperty(value = "创建部门 Id")
+	private String createDept;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private String createDeptName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 发票主表id
+	 */
+	@ApiModelProperty(value = "发票主表id")
+	private Long pid;
+	/**
+	 * 行号 基于pid 1...
+	 */
+	@ApiModelProperty(value = "行号 基于pid 1...")
+	private Integer lineNo;
+	/**
+	 * 业务类型
+	 */
+	@ApiModelProperty(value = "业务类型")
+	private String businessType;
+	/**
+	 * 单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单
+	 */
+	@ApiModelProperty(value = "单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单")
+	private String billType;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * 对账/结算日期
+	 */
+	@ApiModelProperty(value = "对账/结算日期")
+	private Date billDate;
+	/**
+	 * 业务财务日期
+	 */
+	@ApiModelProperty(value = "业务财务日期")
+	private Date accountDate;
+	/**
+	 * 财务年
+	 */
+	@ApiModelProperty(value = "财务年")
+	private Integer accountYear;
+	/**
+	 * 财务月
+	 */
+	@ApiModelProperty(value = "财务月")
+	private Integer accountMonth;
+	/**
+	 * 财务日
+	 */
+	@ApiModelProperty(value = "财务日")
+	private Integer accountDay;
+	/**
+	 * 费用中心 id
+	 */
+	@ApiModelProperty(value = "费用中心 id")
+	private Long sourceId;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * 业务所在部门 Id,用于检索费用
+	 */
+	@ApiModelProperty(value = "业务所在部门 Id,用于检索费用")
+	private Long deptId;
+	/**
+	 * 业务所在部门
+	 */
+	@ApiModelProperty(value = "业务所在部门")
+	private String deptName;
+	/**
+	 * 业务操作 Id,用于检索费用
+	 */
+	@ApiModelProperty(value = "业务操作 Id,用于检索费用")
+	private Long operatorId;
+	/**
+	 * 业务操作
+	 */
+	@ApiModelProperty(value = "业务操作")
+	private String operatorName;
+	/**
+	 * 业务来源
+	 */
+	@ApiModelProperty(value = "业务来源")
+	private String srcType;
+	/**
+	 * 来源 id
+	 */
+	@ApiModelProperty(value = "来源 id")
+	private Long srcId;
+	/**
+	 * 来源中文
+	 */
+	@ApiModelProperty(value = "来源中文")
+	private String srcCnName;
+	/**
+	 * 来源英文
+	 */
+	@ApiModelProperty(value = "来源英文")
+	private String srcEnName;
+	/**
+	 * 航线 id
+	 */
+	@ApiModelProperty(value = "航线 id")
+	private Long lineId;
+	/**
+	 * 航线中文名称
+	 */
+	@ApiModelProperty(value = "航线中文名称")
+	private String lineCnName;
+	/**
+	 * 航线英文名称
+	 */
+	@ApiModelProperty(value = "航线英文名称")
+	private String lineEnName;
+	/**
+	 * 船名 id
+	 */
+	@ApiModelProperty(value = "船名 id")
+	private Long vesselId;
+	/**
+	 * 中文船名
+	 */
+	@ApiModelProperty(value = "中文船名")
+	private String vesselCnName;
+	/**
+	 * 英文船名
+	 */
+	@ApiModelProperty(value = "英文船名")
+	private String vesselEnName;
+	/**
+	 * 航次
+	 */
+	@ApiModelProperty(value = "航次")
+	private String voyageNo;
+	/**
+	 * MB/L NO
+	 */
+	@ApiModelProperty(value = "MB/L NO")
+	private String mblno;
+	/**
+	 * HB/L NO
+	 */
+	@ApiModelProperty(value = "HB/L NO")
+	private String hblno;
+	/**
+	 * 检验检疫 NO
+	 */
+	@ApiModelProperty(value = "检验检疫 NO")
+	private String iqNo;
+	/**
+	 * 开船日期
+	 */
+	@ApiModelProperty(value = "开船日期")
+	private Date etd;
+	/**
+	 * 到港日期
+	 */
+	@ApiModelProperty(value = "到港日期")
+	private Date eta;
+	/**
+	 * 装货港 id
+	 */
+	@ApiModelProperty(value = "装货港 id")
+	private Long polId;
+	/**
+	 * 装货港代码
+	 */
+	@ApiModelProperty(value = "装货港代码")
+	private String polCode;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polCnName;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polEnName;
+	/**
+	 * 卸货港 id
+	 */
+	@ApiModelProperty(value = "卸货港 id")
+	private Long podId;
+	/**
+	 * 卸货港代码
+	 */
+	@ApiModelProperty(value = "卸货港代码")
+	private String podCode;
+	/**
+	 * 卸货港中文名称
+	 */
+	@ApiModelProperty(value = "卸货港中文名称")
+	private String podCnName;
+	/**
+	 * 卸货港英文名称
+	 */
+	@ApiModelProperty(value = "卸货港英文名称")
+	private String podEnName;
+	/**
+	 * 箱号
+	 */
+	@ApiModelProperty(value = "箱号")
+	private String cntrNo;
+	/**
+	 * 商品包装件数英文,
+	 */
+	@ApiModelProperty(value = "商品包装件数英文, ")
+	private String quantityPackingDescr;
+	/**
+	 * 集装箱箱型箱数英文, 1*20GP,2*40HC
+	 */
+	@ApiModelProperty(value = "集装箱箱型箱数英文, 1*20GP,2*40HC")
+	private String quantityCntrTypesDescr;
+	/**
+	 * 费用 Id
+	 */
+	@ApiModelProperty(value = "费用 Id")
+	private Long feeId;
+	/**
+	 * 费用中文名称
+	 */
+	@ApiModelProperty(value = "费用中文名称")
+	private String feeCode;
+	/**
+	 * 费用中文名称
+	 */
+	@ApiModelProperty(value = "费用中文名称")
+	private String feeCnName;
+	/**
+	 * 费用英文名称
+	 */
+	@ApiModelProperty(value = "费用英文名称")
+	private String feeEnName;
+	/**
+	 * 付款方式
+	 */
+	@ApiModelProperty(value = "付款方式")
+	private String paymode;
+	/**
+	 * 账单 Id
+	 */
+	@ApiModelProperty(value = "账单 Id")
+	private Long accBillId;
+	/**
+	 * 账单编号
+	 */
+	@ApiModelProperty(value = "账单编号")
+	private String accBillNo;
+	/**
+	 * 账单日期
+	 */
+	@ApiModelProperty(value = "账单日期")
+	private Date accDate;
+	/**
+	 * 费用收付 D-Debit C=Credit
+	 */
+	@ApiModelProperty(value = "费用收付 D-Debit C=Credit")
+	private String dc;
+	/**
+	 * 数量
+	 */
+	@ApiModelProperty(value = "数量")
+	private BigDecimal quantity;
+	/**
+	 * 单位
+	 */
+	@ApiModelProperty(value = "单位")
+	private String unitNo;
+	/**
+	 * 单价
+	 */
+	@ApiModelProperty(value = "单价")
+	private BigDecimal price;
+	/**
+	 * 原币种
+	 */
+	@ApiModelProperty(value = "原币种")
+	private String curCode;
+	/**
+	 * 原汇率,外币转为本币的汇率
+	 */
+	@ApiModelProperty(value = "原汇率,外币转为本币的汇率")
+	private BigDecimal exrate;
+	/**
+	 * 是否含税(0 不含税 1 含税)
+	 */
+	@ApiModelProperty(value = "是否含税(0 不含税 1 含税)")
+	private Integer isTax;
+	/**
+	 * 税种
+	 */
+	@ApiModelProperty(value = "税种")
+	private String taxType;
+	/**
+	 * 税率 %,即 3% 的税率,值为 3.00
+	 */
+	@ApiModelProperty(value = "税率 %,即 3% 的税率,值为 3.00")
+	private BigDecimal taxRate;
+	/**
+	 * 附加税率 %,即 3% 的税率,值为 3.00
+	 */
+	@ApiModelProperty(value = "附加税率 %,即 3% 的税率,值为 3.00")
+	private BigDecimal surchargeRate;
+	/**
+	 * 折扣金额
+	 */
+	@ApiModelProperty(value = "折扣金额")
+	private BigDecimal amountDiscount;
+	/**
+	 * 税额
+	 */
+	@ApiModelProperty(value = "税额")
+	private BigDecimal amountTax;
+	/**
+	 * 去税金额
+	 */
+	@ApiModelProperty(value = "去税金额")
+	private BigDecimal amountNet;
+	/**
+	 * 金额,amount_tax + amount_net - amount_discount
+	 */
+	@ApiModelProperty(value = "金额,amount_tax + amount_net - amount_discount")
+	private BigDecimal amount;
+	/**
+	 * 本币税额
+	 */
+	@ApiModelProperty(value = "本币税额")
+	private BigDecimal amountTaxLoc;
+	/**
+	 * 本币去税金额
+	 */
+	@ApiModelProperty(value = "本币去税金额")
+	private BigDecimal amountNetLoc;
+	/**
+	 * 本币折扣金额
+	 */
+	@ApiModelProperty(value = "本币折扣金额")
+	private BigDecimal amountDiscountLoc;
+	/**
+	 * 本币金额,外币转为本币的金额
+	 */
+	@ApiModelProperty(value = "本币金额,外币转为本币的金额")
+	private BigDecimal amountLoc;
+	/**
+	 * 收费内容(货物名称,数量,单价),默认=fee_cn_name
+	 */
+	@ApiModelProperty(value = "收费内容(货物名称,数量,单价),默认=fee_cn_name")
+	private String description;
+	/**
+	 * 合并收费内容,默认空字符串
+	 */
+	@ApiModelProperty(value = "合并收费内容,默认空字符串")
+	private String descriptionMerge;
+	/**
+	 * 本次发票币种
+	 */
+	@ApiModelProperty(value = "本次发票币种")
+	private String currentCurCode;
+	/**
+	 * 本次发票汇率,外币转为本币的汇率
+	 */
+	@ApiModelProperty(value = "本次发票汇率,外币转为本币的汇率")
+	private BigDecimal currentExrate;
+	/**
+	 * 本次发票税率 %,即 3% 的税率,值为 3.00
+	 */
+	@ApiModelProperty(value = "本次发票税率 %,即 3% 的税率,值为 3.00")
+	private BigDecimal currentTaxRate;
+	/**
+	 * 本次发票附加税率 %,即 3% 的税率,值为 3.00
+	 */
+	@ApiModelProperty(value = "本次发票附加税率 %,即 3% 的税率,值为 3.00")
+	private BigDecimal currentSurRate;
+	/**
+	 * 税额
+	 */
+	@ApiModelProperty(value = "税额")
+	private BigDecimal currentAmountTax;
+	/**
+	 * 去税金额
+	 */
+	@ApiModelProperty(value = "去税金额")
+	private BigDecimal currentAmountNet;
+	/**
+	 * 本次发票金额
+	 */
+	@ApiModelProperty(value = "本次发票金额")
+	private BigDecimal currentAmount;
+	/**
+	 * 本次发票本币金额
+	 */
+	@ApiModelProperty(value = "本次发票本币金额")
+	private BigDecimal currentAmountLoc;
+	/**
+	 * 支票是否签收, 0 否, 1 是
+	 */
+	@ApiModelProperty(value = "支票是否签收, 0 否, 1 是")
+	private Integer isChequeSigned;
+	/**
+	 * 发票是否签收, 0 否, 1 是
+	 */
+	@ApiModelProperty(value = "发票是否签收, 0 否, 1 是")
+	private Integer isInvoiceSigned;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	@TableLogic(value = "0", delval = "1")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/vo/FinInvoicesItemsVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.vo;
+
+import org.springblade.los.finance.invoices.entity.FinInvoicesItems;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 业务-发票明细视图实体类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "FinInvoicesItemsVO对象", description = "业务-发票明细")
+public class FinInvoicesItemsVO extends FinInvoicesItems {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/invoices/vo/FinInvoicesVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.vo;
+
+import org.springblade.los.finance.invoices.entity.FinInvoices;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 业务-发票主表视图实体类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "FinInvoicesVO对象", description = "业务-发票主表")
+public class FinInvoicesVO extends FinInvoices {
+	private static final long serialVersionUID = 1L;
+
+}

+ 20 - 18
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -108,18 +108,6 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				} else {
 					bills.setGrossMargin(new BigDecimal("0.00"));
 				}
-				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
-					.eq(FeeCenter::getPid, bills.getId())
-					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-					.eq(FeeCenter::getIsDeleted, 0));
-				if (feeCenterList.size() > 0) {
-					bills.setFeeCenterListC(feeCenterList.stream()
-						.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()))
-						.collect(Collectors.toList()));
-					bills.setFeeCenterListD(feeCenterList.stream()
-						.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()))
-						.collect(Collectors.toList()));
-				}
 				if (!"DD".equals(bills.getBillType())) {
 					List<Bills> billsList = billsService.list(new LambdaQueryWrapper<Bills>()
 						.eq(Bills::getMasterId, bills.getId())
@@ -134,18 +122,32 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								.eq(FeeCenter::getIsDeleted, 0)
 								.eq(FeeCenter::getDc, "C"));
 							for (Bills item : billsList) {
-								item.setFeeCenterListC(feeCenterListMh.stream()
-									.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(item.getId()))
-									.collect(Collectors.toList()));
-								item.setFeeCenterListD(feeCenterListMh.stream()
+								item.setFeeCenterList(feeCenterListMh.stream()
 									.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(item.getId()))
 									.collect(Collectors.toList()));
+								list.add(item);
+								item.setFeeCenterList(feeCenterListMh.stream()
+									.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(item.getId()))
+									.collect(Collectors.toList()));
+								list.add(item);
 							}
 						}
-						list.addAll(billsList);
 					}
 				}
-				list.add(0, bills);
+				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getPid, bills.getId())
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0));
+				if (feeCenterList.size() > 0) {
+					bills.setFeeCenterList(feeCenterList.stream()
+						.filter(e -> "C".equals(e.getDc()) && e.getPid().equals(bills.getId()))
+						.collect(Collectors.toList()));
+					list.add(0,bills);
+					bills.setFeeCenterList(feeCenterList.stream()
+						.filter(e -> "D".equals(e.getDc()) && e.getPid().equals(bills.getId()))
+						.collect(Collectors.toList()));
+					list.add(0,bills);
+				}
 			}
 		}
 		map.put("data", list);

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/controller/FinInvoicesController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.finance.invoices.entity.FinInvoices;
+import org.springblade.los.finance.invoices.vo.FinInvoicesVO;
+import org.springblade.los.finance.invoices.service.IFinInvoicesService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务-发票主表 控制器
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/fininvoices")
+@Api(value = "业务-发票主表", tags = "业务-发票主表接口")
+public class FinInvoicesController extends BladeController {
+
+	private final IFinInvoicesService finInvoicesService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入finInvoices")
+	public R<FinInvoices> detail(FinInvoices finInvoices) {
+		FinInvoices detail = finInvoicesService.detail(finInvoices);
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务-发票主表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入finInvoices")
+	public R<IPage<FinInvoices>> list(FinInvoices finInvoices, Query query) {
+		IPage<FinInvoices> pages = finInvoicesService.page(Condition.getPage(query), Condition.getQueryWrapper(finInvoices));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务-发票主表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入finInvoices")
+	public R<IPage<FinInvoicesVO>> page(FinInvoicesVO finInvoices, Query query) {
+		IPage<FinInvoicesVO> pages = finInvoicesService.selectFinInvoicesPage(Condition.getPage(query), finInvoices);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务-发票主表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入finInvoices")
+	public R save(@Valid @RequestBody FinInvoices finInvoices) {
+		return R.status(finInvoicesService.save(finInvoices));
+	}
+
+	/**
+	 * 修改 业务-发票主表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入finInvoices")
+	public R update(@Valid @RequestBody FinInvoices finInvoices) {
+		return R.status(finInvoicesService.updateById(finInvoices));
+	}
+
+	/**
+	 * 新增或修改 业务-发票主表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入finInvoices")
+	public R submit(@Valid @RequestBody FinInvoices finInvoices) {
+		return finInvoicesService.submit(finInvoices);
+	}
+
+
+	/**
+	 * 删除 业务-发票主表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(finInvoicesService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/controller/FinInvoicesItemsController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.finance.invoices.entity.FinInvoicesItems;
+import org.springblade.los.finance.invoices.vo.FinInvoicesItemsVO;
+import org.springblade.los.finance.invoices.service.IFinInvoicesItemsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务-发票明细 控制器
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/fininvoicesitems")
+@Api(value = "业务-发票明细", tags = "业务-发票明细接口")
+public class FinInvoicesItemsController extends BladeController {
+
+	private final IFinInvoicesItemsService finInvoicesItemsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入finInvoicesItems")
+	public R<FinInvoicesItems> detail(FinInvoicesItems finInvoicesItems) {
+		FinInvoicesItems detail = finInvoicesItemsService.getOne(Condition.getQueryWrapper(finInvoicesItems));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务-发票明细
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入finInvoicesItems")
+	public R<IPage<FinInvoicesItems>> list(FinInvoicesItems finInvoicesItems, Query query) {
+		IPage<FinInvoicesItems> pages = finInvoicesItemsService.page(Condition.getPage(query), Condition.getQueryWrapper(finInvoicesItems));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务-发票明细
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入finInvoicesItems")
+	public R<IPage<FinInvoicesItemsVO>> page(FinInvoicesItemsVO finInvoicesItems, Query query) {
+		IPage<FinInvoicesItemsVO> pages = finInvoicesItemsService.selectFinInvoicesItemsPage(Condition.getPage(query), finInvoicesItems);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务-发票明细
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入finInvoicesItems")
+	public R save(@Valid @RequestBody FinInvoicesItems finInvoicesItems) {
+		return R.status(finInvoicesItemsService.save(finInvoicesItems));
+	}
+
+	/**
+	 * 修改 业务-发票明细
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入finInvoicesItems")
+	public R update(@Valid @RequestBody FinInvoicesItems finInvoicesItems) {
+		return R.status(finInvoicesItemsService.updateById(finInvoicesItems));
+	}
+
+	/**
+	 * 新增或修改 业务-发票明细
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入finInvoicesItems")
+	public R submit(@Valid @RequestBody FinInvoicesItems finInvoicesItems) {
+		return R.status(finInvoicesItemsService.saveOrUpdate(finInvoicesItems));
+	}
+
+
+	/**
+	 * 删除 业务-发票明细
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(finInvoicesItemsService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesItemsMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.mapper;
+
+import org.springblade.los.finance.invoices.entity.FinInvoicesItems;
+import org.springblade.los.finance.invoices.vo.FinInvoicesItemsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务-发票明细 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+public interface FinInvoicesItemsMapper extends BaseMapper<FinInvoicesItems> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finInvoicesItems
+	 * @return
+	 */
+	List<FinInvoicesItemsVO> selectFinInvoicesItemsPage(IPage page, FinInvoicesItemsVO finInvoicesItems);
+
+}

+ 111 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesItemsMapper.xml

@@ -0,0 +1,111 @@
+<?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="org.springblade.los.finance.invoices.mapper.FinInvoicesItemsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="finInvoicesItemsResultMap" type="org.springblade.los.finance.invoices.entity.FinInvoicesItems">
+        <id column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_dept_name" property="createDeptName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="pid" property="pid"/>
+        <result column="line_no" property="lineNo"/>
+        <result column="business_type" property="businessType"/>
+        <result column="bill_type" property="billType"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="bill_date" property="billDate"/>
+        <result column="account_date" property="accountDate"/>
+        <result column="account_year" property="accountYear"/>
+        <result column="account_month" property="accountMonth"/>
+        <result column="account_day" property="accountDay"/>
+        <result column="source_id" property="sourceId"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="operator_id" property="operatorId"/>
+        <result column="operator_name" property="operatorName"/>
+        <result column="src_type" property="srcType"/>
+        <result column="src_id" property="srcId"/>
+        <result column="src_cn_name" property="srcCnName"/>
+        <result column="src_en_name" property="srcEnName"/>
+        <result column="line_id" property="lineId"/>
+        <result column="line_cn_name" property="lineCnName"/>
+        <result column="line_en_name" property="lineEnName"/>
+        <result column="vessel_id" property="vesselId"/>
+        <result column="vessel_cn_name" property="vesselCnName"/>
+        <result column="vessel_en_name" property="vesselEnName"/>
+        <result column="voyage_no" property="voyageNo"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="iq_no" property="iqNo"/>
+        <result column="etd" property="etd"/>
+        <result column="eta" property="eta"/>
+        <result column="pol_id" property="polId"/>
+        <result column="pol_code" property="polCode"/>
+        <result column="pol_cn_name" property="polCnName"/>
+        <result column="pol_en_name" property="polEnName"/>
+        <result column="pod_id" property="podId"/>
+        <result column="pod_code" property="podCode"/>
+        <result column="pod_cn_name" property="podCnName"/>
+        <result column="pod_en_name" property="podEnName"/>
+        <result column="cntr_no" property="cntrNo"/>
+        <result column="quantity_packing_descr" property="quantityPackingDescr"/>
+        <result column="quantity_cntr_types_descr" property="quantityCntrTypesDescr"/>
+        <result column="fee_id" property="feeId"/>
+        <result column="fee_code" property="feeCode"/>
+        <result column="fee_cn_name" property="feeCnName"/>
+        <result column="fee_en_name" property="feeEnName"/>
+        <result column="paymode" property="paymode"/>
+        <result column="acc_bill_id" property="accBillId"/>
+        <result column="acc_bill_no" property="accBillNo"/>
+        <result column="acc_date" property="accDate"/>
+        <result column="dc" property="dc"/>
+        <result column="quantity" property="quantity"/>
+        <result column="unit_no" property="unitNo"/>
+        <result column="price" property="price"/>
+        <result column="cur_code" property="curCode"/>
+        <result column="exrate" property="exrate"/>
+        <result column="is_tax" property="isTax"/>
+        <result column="tax_type" property="taxType"/>
+        <result column="tax_rate" property="taxRate"/>
+        <result column="surcharge_rate" property="surchargeRate"/>
+        <result column="amount_discount" property="amountDiscount"/>
+        <result column="amount_tax" property="amountTax"/>
+        <result column="amount_net" property="amountNet"/>
+        <result column="amount" property="amount"/>
+        <result column="amount_tax_loc" property="amountTaxLoc"/>
+        <result column="amount_net_loc" property="amountNetLoc"/>
+        <result column="amount_discount_loc" property="amountDiscountLoc"/>
+        <result column="amount_loc" property="amountLoc"/>
+        <result column="description" property="description"/>
+        <result column="description_merge" property="descriptionMerge"/>
+        <result column="current_cur_code" property="currentCurCode"/>
+        <result column="current_exrate" property="currentExrate"/>
+        <result column="current_tax_rate" property="currentTaxRate"/>
+        <result column="current_sur_rate" property="currentSurRate"/>
+        <result column="current_amount_tax" property="currentAmountTax"/>
+        <result column="current_amount_net" property="currentAmountNet"/>
+        <result column="current_amount" property="currentAmount"/>
+        <result column="current_amount_loc" property="currentAmountLoc"/>
+        <result column="is_cheque_signed" property="isChequeSigned"/>
+        <result column="is_invoice_signed" property="isInvoiceSigned"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+    </resultMap>
+
+
+    <select id="selectFinInvoicesItemsPage" resultMap="finInvoicesItemsResultMap">
+        select * from los_fin_invoices_items where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.mapper;
+
+import org.springblade.los.finance.invoices.entity.FinInvoices;
+import org.springblade.los.finance.invoices.vo.FinInvoicesVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务-发票主表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+public interface FinInvoicesMapper extends BaseMapper<FinInvoices> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finInvoices
+	 * @return
+	 */
+	List<FinInvoicesVO> selectFinInvoicesPage(IPage page, FinInvoicesVO finInvoices);
+
+}

+ 97 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/mapper/FinInvoicesMapper.xml

@@ -0,0 +1,97 @@
+<?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="org.springblade.los.finance.invoices.mapper.FinInvoicesMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="finInvoicesResultMap" type="org.springblade.los.finance.invoices.entity.FinInvoices">
+        <id column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_dept_name" property="createDeptName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="bill_date" property="billDate"/>
+        <result column="invoice_no" property="invoiceNo"/>
+        <result column="invoice_date" property="invoiceDate"/>
+        <result column="orig_invoice_no" property="origInvoiceNo"/>
+        <result column="tax_invoice_no" property="taxInvoiceNo"/>
+        <result column="inv_type" property="invType"/>
+        <result column="tax_type" property="taxType"/>
+        <result column="tax_rate" property="taxRate"/>
+        <result column="stl_mode" property="stlMode"/>
+        <result column="inv_cur_code" property="invCurCode"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+        <result column="corp_invoice_header" property="corpInvoiceHeader"/>
+        <result column="inv_corp_id" property="invCorpId"/>
+        <result column="inv_corp_cn_name" property="invCorpCnName"/>
+        <result column="inv_corp_en_name" property="invCorpEnName"/>
+        <result column="inv_corp_tax_no" property="invCorpTaxNo"/>
+        <result column="inv_corp_account_bank_cny" property="invCorpAccountBankCny"/>
+        <result column="inv_corp_account_no_cny" property="invCorpAccountNoCny"/>
+        <result column="inv_corp_account_bank_usd" property="invCorpAccountBankUsd"/>
+        <result column="inv_corp_account_no_usd" property="invCorpAccountNoUsd"/>
+        <result column="vessel_voyno" property="vesselVoyno"/>
+        <result column="etd" property="etd"/>
+        <result column="pol" property="pol"/>
+        <result column="pod" property="pod"/>
+        <result column="destination" property="destination"/>
+        <result column="containers" property="containers"/>
+        <result column="cur_code" property="curCode"/>
+        <result column="exrate" property="exrate"/>
+        <result column="is_exchange_to_cny" property="isExchangeToCny"/>
+        <result column="business_types" property="businessTypes"/>
+        <result column="business_no" property="businessNo"/>
+        <result column="check_no" property="checkNo"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="booking_no" property="bookingNo"/>
+        <result column="vessel_id" property="vesselId"/>
+        <result column="vessel_cn_name" property="vesselCnName"/>
+        <result column="vessel_en_name" property="vesselEnName"/>
+        <result column="voyage_no" property="voyageNo"/>
+        <result column="account_date_from" property="accountDateFrom"/>
+        <result column="account_date_to" property="accountDateTo"/>
+        <result column="applicant_id" property="applicantId"/>
+        <result column="applicant_name" property="applicantName"/>
+        <result column="approver_id" property="approverId"/>
+        <result column="approver_name" property="approverName"/>
+        <result column="is_agent" property="isAgent"/>
+        <result column="is_dk" property="isDk"/>
+        <result column="is_rp" property="isRp"/>
+        <result column="rp_name" property="rpName"/>
+        <result column="export_date" property="exportDate"/>
+        <result column="export_id" property="exportId"/>
+        <result column="export_name" property="exportName"/>
+        <result column="is_export_vslvoy" property="isExportVslvoy"/>
+        <result column="is_export_mblno" property="isExportMblno"/>
+        <result column="is_export_hblno" property="isExportHblno"/>
+        <result column="amount_cny" property="amountCny"/>
+        <result column="amount_usd" property="amountUsd"/>
+        <result column="amount_tax" property="amountTax"/>
+        <result column="amount_loc" property="amountLoc"/>
+        <result column="elec_remarks" property="elecRemarks"/>
+        <result column="bank_receipt_corp_name" property="bankReceiptCorpName"/>
+        <result column="bank_receipt_bank_name" property="bankReceiptBankName"/>
+        <result column="bank_receipt_account_no" property="bankReceiptAccountNo"/>
+        <result column="bank_receipt_bill_type" property="bankReceiptBillType"/>
+        <result column="bank_receipt_bill_count" property="bankReceiptBillCount"/>
+        <result column="bank_receipt_is_Income" property="bankReceiptIsIncome"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+    </resultMap>
+
+
+    <select id="selectFinInvoicesPage" resultMap="finInvoicesResultMap">
+        select * from los_fin_invoices where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/IFinInvoicesItemsService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.service;
+
+import org.springblade.los.finance.invoices.entity.FinInvoicesItems;
+import org.springblade.los.finance.invoices.vo.FinInvoicesItemsVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-发票明细 服务类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+public interface IFinInvoicesItemsService extends IService<FinInvoicesItems> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finInvoicesItems
+	 * @return
+	 */
+	IPage<FinInvoicesItemsVO> selectFinInvoicesItemsPage(IPage<FinInvoicesItemsVO> page, FinInvoicesItemsVO finInvoicesItems);
+
+}

+ 55 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/IFinInvoicesService.java

@@ -0,0 +1,55 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.finance.invoices.entity.FinInvoices;
+import org.springblade.los.finance.invoices.vo.FinInvoicesVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-发票主表 服务类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+public interface IFinInvoicesService extends IService<FinInvoices> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finInvoices
+	 * @return
+	 */
+	IPage<FinInvoicesVO> selectFinInvoicesPage(IPage<FinInvoicesVO> page, FinInvoicesVO finInvoices);
+
+	/**
+	 * 新增或修改 业务-发票主表
+	 * @param finInvoices
+	 * @return
+	 */
+	R submit(FinInvoices finInvoices);
+
+	/**
+	 * 详情
+	 * @param finInvoices
+	 * @return
+	 */
+	FinInvoices detail(FinInvoices finInvoices);
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesItemsServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.service.impl;
+
+import org.springblade.los.finance.invoices.entity.FinInvoicesItems;
+import org.springblade.los.finance.invoices.vo.FinInvoicesItemsVO;
+import org.springblade.los.finance.invoices.mapper.FinInvoicesItemsMapper;
+import org.springblade.los.finance.invoices.service.IFinInvoicesItemsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-发票明细 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Service
+public class FinInvoicesItemsServiceImpl extends ServiceImpl<FinInvoicesItemsMapper, FinInvoicesItems> implements IFinInvoicesItemsService {
+
+	@Override
+	public IPage<FinInvoicesItemsVO> selectFinInvoicesItemsPage(IPage<FinInvoicesItemsVO> page, FinInvoicesItemsVO finInvoicesItems) {
+		return page.setRecords(baseMapper.selectFinInvoicesItemsPage(page, finInvoicesItems));
+	}
+
+}

+ 148 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java

@@ -0,0 +1,148 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.finance.invoices.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.basic.business.entity.BusinessType;
+import org.springblade.los.basic.business.service.IBusinessTypeService;
+import org.springblade.los.billno.entity.BusinessBillNo;
+import org.springblade.los.billno.service.IBusinessBillNoService;
+import org.springblade.los.finance.invoices.entity.FinInvoices;
+import org.springblade.los.finance.invoices.entity.FinInvoicesItems;
+import org.springblade.los.finance.invoices.mapper.FinInvoicesMapper;
+import org.springblade.los.finance.invoices.service.IFinInvoicesItemsService;
+import org.springblade.los.finance.invoices.service.IFinInvoicesService;
+import org.springblade.los.finance.invoices.vo.FinInvoicesVO;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 业务-发票主表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-11-24
+ */
+@Service
+@AllArgsConstructor
+public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinInvoices> implements IFinInvoicesService {
+
+	private final ISysClient sysClient;
+
+	private final IFinInvoicesItemsService finInvoicesItemsService;
+
+	private final IBusinessBillNoService businessBillNoService;
+
+	private final IBusinessTypeService bBusinessTypeService;
+
+	@Override
+	public IPage<FinInvoicesVO> selectFinInvoicesPage(IPage<FinInvoicesVO> page, FinInvoicesVO finInvoices) {
+		return page.setRecords(baseMapper.selectFinInvoicesPage(page, finInvoices));
+	}
+
+	@Override
+	public R submit(FinInvoices finInvoices) {
+		String deptId = "";
+		String deptName = "";
+		//获取部门ids对应中文名
+		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+			deptId = AuthUtil.getDeptId();
+			R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				deptName = String.join(",", res.getData());
+			}
+		}
+		if (finInvoices.getId() == null) {
+			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
+				.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
+				.eq(BusinessType::getIsDeleted, 0)
+				.eq(BusinessType::getStatus, 0)
+				.eq(BusinessType::getCode, finInvoices.getBusinessTypeCode()));
+			if (businessType == null) {
+				throw new RuntimeException("未找到可用业务类型");
+			}
+			BusinessBillNo businessBillNo = new BusinessBillNo();
+			businessBillNo.setBusinessTypeId(businessType.getId());
+			businessBillNo.setCode(finInvoices.getBillNoFormat());
+			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+			if (!clientBillNo.isSuccess()) {
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				return R.fail(500, "生成订单编号失败");
+			}
+			finInvoices.setBillNo((String) clientBillNo.getData());
+			finInvoices.setCreateTime(new Date());
+			finInvoices.setCreateUser(AuthUtil.getUserId());
+			finInvoices.setCreateUserName(AuthUtil.getUserName());
+			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+				finInvoices.setCreateDept(deptId);
+				finInvoices.setBranchId(deptId);
+				finInvoices.setCreateDeptName(deptName);
+			}
+		} else {
+			finInvoices.setUpdateUser(AuthUtil.getUserId());
+			finInvoices.setUpdateTime(new Date());
+			finInvoices.setUpdateUserName(AuthUtil.getUserName());
+		}
+		this.saveOrUpdate(finInvoices);
+		if (ObjectUtils.isNotNull(finInvoices.getFinInvoicesItemsList())) {
+			for (FinInvoicesItems item : finInvoices.getFinInvoicesItemsList()) {
+				item.setPid(finInvoices.getId());
+				if (item.getId() == null) {
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+						item.setCreateDept(deptId);
+						item.setBranchId(deptId);
+						item.setCreateDeptName(deptName);
+					}
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+				}
+			}
+			finInvoicesItemsService.saveOrUpdateBatch(finInvoices.getFinInvoicesItemsList());
+		}
+
+		return R.data(finInvoices);
+	}
+
+	@Override
+	public FinInvoices detail(FinInvoices finInvoices) {
+		if (finInvoices.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		FinInvoices detail = baseMapper.selectById(finInvoices.getId());
+		detail.setFinInvoicesItemsList(finInvoicesItemsService.list(new LambdaQueryWrapper<FinInvoicesItems>()
+			.eq(FinInvoicesItems::getIsDeleted, 0)
+			.eq(FinInvoicesItems::getTenantId, AuthUtil.getTenantId())
+			.eq(FinInvoicesItems::getPid, detail.getId())
+		));
+		return detail;
+	}
+
+}

+ 9 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java

@@ -750,7 +750,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 					.eq(PjCorpsAddr::getPid, pjCorpsDesc.getId()));
 				if (count > 1) {
 					corpsAddr1.setDefaultAddres("0");
-				}else{
+				} else {
 					corpsAddr1.setDefaultAddres("1");
 				}
 				corpsAddrService.save(corpsAddr1);
@@ -776,6 +776,14 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 				}
 				User user = userClient.loginByAccount("", corpsDesc.getTel(), "4", AuthUtil.getTenantId(), resDept.getData().getAppletsId());
 				if (ObjectUtils.isNotNull(user)) {
+					long count = corpsAttnService.count(new LambdaQueryWrapper<PjCorpsAttn>()
+						.eq(PjCorpsAttn::getUserId, user.getId())
+						.eq(PjCorpsAttn::getTel, corpsDesc.getTel())
+						.eq(PjCorpsAttn::getTenantId, AuthUtil.getTenantId())
+						.eq(PjCorpsAttn::getIsDeleted, 0));
+					if (count > 0) {
+						throw new RuntimeException("手机号已存在,提交失败");
+					}
 					corpsAttn.setUserId(user.getId());
 				}
 				corpsAttn.setCname(corpsDesc.getAttn());

+ 12 - 5
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java

@@ -62,10 +62,13 @@ public class StatisticsServiceImpl implements IStatisticsService {
 		BigDecimal stlAmountM = new BigDecimal("0.00");
 		BigDecimal profitD = new BigDecimal("0.00");
 		BigDecimal profitM = new BigDecimal("0.00");
+		//成本
+		BigDecimal cost = new BigDecimal("0.00");
 		List<PjOrder> pjOrderListD = orderService.list(new LambdaQueryWrapper<PjOrder>()
 			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
 			.eq(PjOrder::getIsDeleted, 0)
 			.eq(PjOrder::getBsType, "XS")
+			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
 			.apply("status = '已发货' and busines_date = CURDATE()"));
 		if (pjOrderListD.size() > 0) {
 			List<Long> orderIdsD = pjOrderListD.stream().map(PjOrder::getId).collect(Collectors.toList());
@@ -79,16 +82,18 @@ public class StatisticsServiceImpl implements IStatisticsService {
 				}
 			}
 			dealAmountD = pjOrderListD.stream().map(PjOrder::getTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			cost = pjOrderListD.stream().map(PjOrder::getCost).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 			stlAmountD = pjOrderListD.stream().filter(e -> ObjectUtils.isNotNull(e.getOldTrxId())).map(PjOrder::getTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-			profitD = pjOrderListD.stream().map(PjOrder::getGrossProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			profitD = dealAmountD.subtract(cost);
 		}
 		List<PjOrder> pjOrderListM = orderService.list(new LambdaQueryWrapper<PjOrder>()
 			.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
 			.eq(PjOrder::getIsDeleted, 0)
 			.eq(PjOrder::getBsType, "XS")
+			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
 			.apply("status = '已发货' and DATE_FORMAT(busines_date, '%Y-%m') = DATE_FORMAT(CURRENT_DATE(), '%Y-%m')"));
 		if (pjOrderListM.size() > 0) {
-			List<Long> orderIdsM = pjOrderListD.stream().map(PjOrder::getId).collect(Collectors.toList());
+			List<Long> orderIdsM = pjOrderListM.stream().map(PjOrder::getId).collect(Collectors.toList());
 			if (orderIdsM.size() > 0) {
 				List<PjOrderItems> pjOrderItemsListM = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
 					.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
@@ -99,8 +104,9 @@ public class StatisticsServiceImpl implements IStatisticsService {
 				}
 			}
 			dealAmountM = pjOrderListM.stream().map(PjOrder::getTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			cost = pjOrderListM.stream().map(PjOrder::getCost).filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 			stlAmountM = pjOrderListM.stream().filter(e -> ObjectUtils.isNotNull(e.getOldTrxId())).map(PjOrder::getTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-			profitM = pjOrderListM.stream().map(PjOrder::getGrossProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+			profitM = dealAmountM.subtract(cost);
 		}
 		map.put("dealAmountD", dealAmountD);
 		map.put("dealAmountM", dealAmountM);
@@ -124,6 +130,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 			.eq(PjOrder::getIsDeleted, 0)
 			.eq(PjOrder::getBsType, "XS")
 			.apply("find_in_set(status,'录入,待确认')")
+			.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
 			.gt(quer.getDateList().size() > 0, PjOrder::getBusinesDate, quer.getDateList().get(0))
 			.lt(quer.getDateList().size() > 0, PjOrder::getBusinesDate, quer.getDateList().get(1)));
 		for (PjOrder item : pjOrderList) {
@@ -182,7 +189,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 		}
 		for (PjShip item : pjShipListRW) {
 			StayDoOrder stayDoOrder = new StayDoOrder();
-			stayDoOrder.setOrderNo(item.getOrdNo());
+			stayDoOrder.setOrderNo(item.getBillno());
 			stayDoOrder.setId(item.getId());
 			stayDoOrder.setCorpName(item.getCustomerName());
 			stayDoOrder.setDate(item.getBusinesDate());
@@ -207,7 +214,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 		}
 		for (PjShip item : pjShipListGD) {
 			StayDoOrder stayDoOrder = new StayDoOrder();
-			stayDoOrder.setOrderNo(item.getOrdNo());
+			stayDoOrder.setOrderNo(item.getBillno());
 			stayDoOrder.setId(item.getId());
 			stayDoOrder.setCorpName(item.getCustomerName());
 			stayDoOrder.setDate(item.getBusinesDate());