Explorar el Código

2023年12月11日17:29:40

纪新园 hace 2 años
padre
commit
2d847f7672
Se han modificado 34 ficheros con 2541 adiciones y 45 borrados
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/edi/dto/EdiTypesDTO.java
  2. 156 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/edi/entity/EdiTypes.java
  3. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/edi/vo/EdiTypesVO.java
  4. 1 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/FinAccBills.java
  5. 1 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/ListAccBillVO.java
  6. 7 11
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/stl/entity/FinStlBills.java
  7. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/dto/FinVouchersDTO.java
  8. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/dto/FinVouchersItemsDTO.java
  9. 272 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/entity/FinVouchers.java
  10. 409 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/entity/FinVouchersItems.java
  11. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/vo/FinVouchersItemsVO.java
  12. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/vo/FinVouchersVO.java
  13. 19 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescExportExcel.java
  14. 18 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/CorpsDescVO.java
  15. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml
  16. 51 0
      blade-service/blade-los/src/main/java/org/springblade/los/edi/api/EDISender.java
  17. 135 0
      blade-service/blade-los/src/main/java/org/springblade/los/edi/controller/EdiTypesController.java
  18. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/edi/mapper/EdiTypesMapper.java
  19. 34 0
      blade-service/blade-los/src/main/java/org/springblade/los/edi/mapper/EdiTypesMapper.xml
  20. 50 0
      blade-service/blade-los/src/main/java/org/springblade/los/edi/service/IEdiTypesService.java
  21. 83 0
      blade-service/blade-los/src/main/java/org/springblade/los/edi/service/impl/EdiTypesServiceImpl.java
  22. 147 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/controller/FinVouchersController.java
  23. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/controller/FinVouchersItemsController.java
  24. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersItemsMapper.java
  25. 83 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersItemsMapper.xml
  26. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersMapper.java
  27. 52 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersMapper.xml
  28. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/IFinVouchersItemsService.java
  29. 69 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/IFinVouchersService.java
  30. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/impl/FinVouchersItemsServiceImpl.java
  31. 326 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/impl/FinVouchersServiceImpl.java
  32. 1 0
      blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/controller/PriceBankController.java
  33. 69 24
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsDescController.java
  34. 11 9
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/edi/dto/EdiTypesDTO.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.edi.dto;
+
+import org.springblade.los.edi.entity.EdiTypes;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 基础资料-EDI 类型表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class EdiTypesDTO extends EdiTypes {
+	private static final long serialVersionUID = 1L;
+
+}

+ 156 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/edi/entity/EdiTypes.java

@@ -0,0 +1,156 @@
+/*
+ *      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.edi.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.util.Date;
+
+/**
+ * 基础资料-EDI 类型表实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@TableName("los_b_edi_types")
+@ApiModel(value = "EdiTypes对象", description = "基础资料-EDI 类型表")
+public class EdiTypes implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	private Long id;
+	/**
+	 * 创建人 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;
+	/**
+	 * edi 编码,唯一
+	 */
+	@ApiModelProperty(value = "edi 编码,唯一")
+	private String code;
+	/**
+	 * edi 中文名称
+	 */
+	@ApiModelProperty(value = "edi 中文名称")
+	private String cnName;
+	/**
+	 * edi 英文名称
+	 */
+	@ApiModelProperty(value = "edi 英文名称")
+	private String enName;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * JSON 对象数组,发送 ftp 或 邮件地址
+	 */
+	@ApiModelProperty(value = "JSON 对象数组,发送 ftp 或 邮件地址")
+	private String address;
+	/**
+	 * JSON 对象数组,权限用户
+	 */
+	@ApiModelProperty(value = "JSON 对象数组,权限用户")
+	private String userlist;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@TableLogic(value = "0",delval = "1")
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/edi/vo/EdiTypesVO.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.edi.vo;
+
+import org.springblade.los.edi.entity.EdiTypes;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 基础资料-EDI 类型表视图实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "EdiTypesVO对象", description = "基础资料-EDI 类型表")
+public class EdiTypesVO extends EdiTypes {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/FinAccBills.java

@@ -501,6 +501,7 @@ public class FinAccBills implements Serializable {
 	@ApiModelProperty(value = "凭证日期")
 	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date voucherDate;
 	/**
 	 * 凭证日期

+ 1 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/ListAccBillVO.java

@@ -148,7 +148,7 @@ public class ListAccBillVO extends FinAccBills {
 	private String bookingNo;
 
 	/**
-	 * 业务类型,1=对账单 2=结算单 3=发票
+	 * 业务类型,1=对账单 2=结算单 3=发票 5=凭证
 	 */
 	private String type;
 

+ 7 - 11
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/stl/entity/FinStlBills.java

@@ -16,25 +16,21 @@
  */
 package org.springblade.los.finance.stl.entity;
 
-import java.math.BigDecimal;
-
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
 import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
 /**
  * 业务-财务对账单和结算实体类
  *
@@ -256,7 +252,7 @@ public class FinStlBills implements Serializable {
 	 * 审核开始日期
 	 */
 	@ApiModelProperty(value = "审核开始日期")
-	private LocalDateTime auditDateFrom;
+	private Date auditDateFrom;
 	/**
 	 * 审核结束日期
 	 */

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/dto/FinVouchersDTO.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.vouchers.dto;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchers;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 业务-财务凭证数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FinVouchersDTO extends FinVouchers {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/dto/FinVouchersItemsDTO.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.vouchers.dto;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchersItems;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 业务-财务凭证分录数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FinVouchersItemsDTO extends FinVouchersItems {
+	private static final long serialVersionUID = 1L;
+
+}

+ 272 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/entity/FinVouchers.java

@@ -0,0 +1,272 @@
+/*
+ *      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.vouchers.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 业务-财务凭证实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@TableName("los_fin_vouchers")
+@ApiModel(value = "FinVouchers对象", description = "业务-财务凭证")
+public class FinVouchers 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;
+	/**
+	 * 凭证来源, SYSTEM = 自动凭证
+	 */
+	@ApiModelProperty(value = "凭证来源, SYSTEM = 自动凭证")
+	private String voucherSource;
+	/**
+	 * 凭证类型,记 转
+	 */
+	@ApiModelProperty(value = "凭证类型,记 转")
+	private String voucherType;
+	/**
+	 * 凭证号
+	 */
+	@ApiModelProperty(value = "凭证号")
+	private String voucherNo;
+	/**
+	 * 凭证日期
+	 */
+	@ApiModelProperty(value = "凭证日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date voucherDate;
+	/**
+	 * 财务年
+	 */
+	@ApiModelProperty(value = "财务年")
+	private Integer accountYear;
+	/**
+	 * 财务月
+	 */
+	@ApiModelProperty(value = "财务月")
+	private Integer accountMonth;
+	/**
+	 * 财务日
+	 */
+	@ApiModelProperty(value = "财务日")
+	private Integer accountDay;
+	/**
+	 * 分录摘要
+	 */
+	@ApiModelProperty(value = "分录摘要")
+	private String descr;
+	/**
+	 * 借方金额(CNY)
+	 */
+	@ApiModelProperty(value = "借方金额(CNY)")
+	private BigDecimal amountDr;
+	/**
+	 * 贷方金额(CNY)
+	 */
+	@ApiModelProperty(value = "贷方金额(CNY)")
+	private BigDecimal amountCr;
+	/**
+	 * 综合 USD 借方金额(USD) - 非 USD 外币转换为 USD
+	 */
+	@ApiModelProperty(value = "综合 USD 借方金额(USD) - 非 USD 外币转换为 USD")
+	private BigDecimal amountDrUsd;
+	/**
+	 * 综合 USD 贷方金额(USD) - 非 USD 外币转换为 USD
+	 */
+	@ApiModelProperty(value = "综合 USD 贷方金额(USD) - 非 USD 外币转换为 USD")
+	private BigDecimal amountCrUsd;
+	/**
+	 * 合计本位币借方金额(CNY )
+	 */
+	@ApiModelProperty(value = "合计本位币借方金额(CNY )")
+	private BigDecimal amountDrLoc;
+	/**
+	 * 合计本位币贷方金额(CNY)
+	 */
+	@ApiModelProperty(value = "合计本位币贷方金额(CNY)")
+	private BigDecimal amountCrLoc;
+	/**
+	 * 是否外币凭证(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否外币凭证(0 否 1 是)")
+	private Integer isForeign;
+	/**
+	 * 是否数量凭证(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否数量凭证(0 否 1 是)")
+	private Integer isQuantity;
+	/**
+	 * 复核人 Id
+	 */
+	@ApiModelProperty(value = "复核人 Id")
+	private Long checkUserId;
+	/**
+	 * 复核人
+	 */
+	@ApiModelProperty(value = "复核人")
+	private String checkUserName;
+	/**
+	 * 复核时间
+	 */
+	@ApiModelProperty(value = "复核时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date checkTime;
+	/**
+	 * 记账人 Id
+	 */
+	@ApiModelProperty(value = "记账人 Id")
+	private Long postUserId;
+	/**
+	 * 记账人
+	 */
+	@ApiModelProperty(value = "记账人")
+	private String postUserName;
+	/**
+	 * 记账时间
+	 */
+	@ApiModelProperty(value = "记账时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date postTime;
+	/**
+	 * 凭证状态(0 新建 1 记账)
+	 */
+	@ApiModelProperty(value = "凭证状态(0 新建 1 记账)")
+	private Integer voucherStatus;
+	/**
+	 * 版本
+	 */
+	@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;
+
+	/**
+	 * 业务-财务凭证分录
+	 */
+	private List<FinVouchersItems> finVouchersItemsList;
+
+	/**
+	 * 编码生成code
+	 */
+	@TableField(exist = false)
+	private String billNoFormat;
+
+	/**
+	 * 业务类型表 code
+	 */
+	@TableField(exist = false)
+	private String businessTypeCode;
+
+
+}

+ 409 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/entity/FinVouchersItems.java

@@ -0,0 +1,409 @@
+/*
+ *      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.vouchers.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 业务-财务凭证分录实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@TableName("los_fin_vouchers_items")
+@ApiModel(value = "FinVouchersItems对象", description = "业务-财务凭证分录")
+public class FinVouchersItems 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 billNo;
+	/**
+	 * 凭证来源, SYSTEM = 自动凭证
+	 */
+	@ApiModelProperty(value = "凭证来源, SYSTEM = 自动凭证")
+	private String voucherSource;
+	/**
+	 * 凭证类型,记 转
+	 */
+	@ApiModelProperty(value = "凭证类型,记 转")
+	private String voucherType;
+	/**
+	 * 凭证号
+	 */
+	@ApiModelProperty(value = "凭证号")
+	private String voucherNo;
+	/**
+	 * 凭证日期
+	 */
+	@ApiModelProperty(value = "凭证日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date voucherDate;
+	/**
+	 * 财务年
+	 */
+	@ApiModelProperty(value = "财务年")
+	private Integer accountYear;
+	/**
+	 * 财务月
+	 */
+	@ApiModelProperty(value = "财务月")
+	private Integer accountMonth;
+	/**
+	 * 财务日
+	 */
+	@ApiModelProperty(value = "财务日")
+	private Integer accountDay;
+	/**
+	 * 科目代码 id
+	 */
+	@ApiModelProperty(value = "科目代码 id")
+	private Long accountId;
+	/**
+	 * 科目代码
+	 */
+	@ApiModelProperty(value = "科目代码")
+	private String accountCode;
+	/**
+	 * 科目代码中文名称
+	 */
+	@ApiModelProperty(value = "科目代码中文名称")
+	private String accountCnName;
+	/**
+	 * 科目代码英文名称
+	 */
+	@ApiModelProperty(value = "科目代码英文名称")
+	private String accountEnName;
+	/**
+	 * 科目代码中文全称
+	 */
+	@ApiModelProperty(value = "科目代码中文全称")
+	private String accountFullName;
+	/**
+	 * 科目属性,资产、负债、权益等
+	 */
+	@ApiModelProperty(value = "科目属性,资产、负债、权益等")
+	private Integer accountProperty;
+	/**
+	 * 科目级次
+	 */
+	@ApiModelProperty(value = "科目级次")
+	private Integer accountLevel;
+	/**
+	 * 科目代码方向 D=借方, C=贷方
+	 */
+	@ApiModelProperty(value = "科目代码方向 D=借方, C=贷方")
+	private String dc;
+	/**
+	 * 是否外币科目(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否外币科目(0 否 1 是)")
+	private Integer isForeign;
+	/**
+	 * 是否数量科目(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否数量科目(0 否 1 是)")
+	private Integer isQuantity;
+	/**
+	 * 是否核算客户(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否核算客户(0 否 1 是)")
+	private Integer isCorp;
+	/**
+	 * 是否核算部门(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否核算部门(0 否 1 是)")
+	private Integer isDept;
+	/**
+	 * 是否核算职员(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否核算职员(0 否 1 是)")
+	private Integer isEmpl;
+	/**
+	 * 是否核算项目(0 否 1 是)
+	 */
+	@ApiModelProperty(value = "是否核算项目(0 否 1 是)")
+	private Integer isItem;
+	/**
+	 * 分录摘要
+	 */
+	@ApiModelProperty(value = "分录摘要")
+	private String descr;
+	/**
+	 * 核算客户 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 emplId;
+	/**
+	 * 核算职员
+	 */
+	@ApiModelProperty(value = "核算职员")
+	private String emplName;
+	/**
+	 * 核算项目类别 Id
+	 */
+	@ApiModelProperty(value = "核算项目类别 Id")
+	private Long itemClassifyId;
+	/**
+	 * 核算项目类别
+	 */
+	@ApiModelProperty(value = "核算项目类别")
+	private String itemClassify;
+	/**
+	 * 核算项目 Id
+	 */
+	@ApiModelProperty(value = "核算项目 Id")
+	private Long itemId;
+	/**
+	 * 核算项目
+	 */
+	@ApiModelProperty(value = "核算项目")
+	private String itemName;
+	/**
+	 * 币种
+	 */
+	@ApiModelProperty(value = "币种")
+	private String curCode;
+	/**
+	 * 汇率,外币转为本币的汇率
+	 */
+	@ApiModelProperty(value = "汇率,外币转为本币的汇率")
+	private BigDecimal exrate;
+	/**
+	 * 借方数量
+	 */
+	@ApiModelProperty(value = "借方数量")
+	private BigDecimal quantityDr;
+	/**
+	 * 贷方数量
+	 */
+	@ApiModelProperty(value = "贷方数量")
+	private BigDecimal quantityCr;
+	/**
+	 * 单位
+	 */
+	@ApiModelProperty(value = "单位")
+	private String unitNo;
+	/**
+	 * 单价
+	 */
+	@ApiModelProperty(value = "单价")
+	private BigDecimal price;
+	/**
+	 * 借方金额(CNY)
+	 */
+	@ApiModelProperty(value = "借方金额(CNY)")
+	private BigDecimal amountDr;
+	/**
+	 * 贷方金额(CNY)
+	 */
+	@ApiModelProperty(value = "贷方金额(CNY)")
+	private BigDecimal amountCr;
+	/**
+	 * 借方金额(USD)
+	 */
+	@ApiModelProperty(value = "借方金额(USD)")
+	private BigDecimal amountDrUsd;
+	/**
+	 * 贷方金额(USD)
+	 */
+	@ApiModelProperty(value = "贷方金额(USD)")
+	private BigDecimal amountCrUsd;
+	/**
+	 * 合计本位币借方金额(CNY)
+	 */
+	@ApiModelProperty(value = "合计本位币借方金额(CNY)")
+	private BigDecimal amountDrLoc;
+	/**
+	 * 合计本位币贷方金额(CNY)
+	 */
+	@ApiModelProperty(value = "合计本位币贷方金额(CNY)")
+	private BigDecimal amountCrLoc;
+	/**
+	 * 复核人 Id
+	 */
+	@ApiModelProperty(value = "复核人 Id")
+	private Long checkUserId;
+	/**
+	 * 复核人
+	 */
+	@ApiModelProperty(value = "复核人")
+	private String checkUserName;
+	/**
+	 * 复核时间
+	 */
+	@ApiModelProperty(value = "复核时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date checkTime;
+	/**
+	 * 记账人 Id
+	 */
+	@ApiModelProperty(value = "记账人 Id")
+	private Long postUserId;
+	/**
+	 * 记账人
+	 */
+	@ApiModelProperty(value = "记账人")
+	private String postUserName;
+	/**
+	 * 记账时间
+	 */
+	@ApiModelProperty(value = "记账时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date postTime;
+	/**
+	 * 凭证分录状态,等于凭证状态
+	 */
+	@ApiModelProperty(value = "凭证分录状态,等于凭证状态")
+	private Integer voucherStatus;
+	/**
+	 * 版本
+	 */
+	@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/vouchers/vo/FinVouchersItemsVO.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.vouchers.vo;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchersItems;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 业务-财务凭证分录视图实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "FinVouchersItemsVO对象", description = "业务-财务凭证分录")
+public class FinVouchersItemsVO extends FinVouchersItems {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/vouchers/vo/FinVouchersVO.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.vouchers.vo;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchers;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 业务-财务凭证视图实体类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "FinVouchersVO对象", description = "业务-财务凭证")
+public class FinVouchersVO extends FinVouchers {
+	private static final long serialVersionUID = 1L;
+
+}

+ 19 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescExportExcel.java

@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -51,6 +52,24 @@ public class CorpsDescExportExcel implements Serializable {
 	private String salesmanName;
 
 	/**
+	 * 联系人
+	 */
+	@ExcelProperty(value = "联系人")
+	private String contacts;
+
+	/**
+	 * 电话
+	 */
+	@ExcelProperty(value = "电话")
+	private String contactsPhone;
+
+	/**
+	 * 地址
+	 */
+	@ExcelProperty(value = "地址")
+	private String address;
+
+	/**
 	 * 账期
 	 */
 	@ExcelProperty(value = "账期")

+ 18 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/CorpsDescVO.java

@@ -49,4 +49,22 @@ public class CorpsDescVO extends PjCorpsDesc {
 	@TableField(exist = false)
 	private List<String> strTenantId;
 
+	/**
+	 * 联系人
+	 */
+	@TableField(exist = false)
+	private String contacts;
+
+	/**
+	 * 电话
+	 */
+	@TableField(exist = false)
+	private String contactsPhone;
+
+	/**
+	 * 地址
+	 */
+	@TableField(exist = false)
+	private String address;
+
 }

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml

@@ -333,6 +333,9 @@
         <if test='acc.type != null and acc.type != "" and acc.type == "4"'>
             and fee.amount != fee.invoice_amount_loc
         </if>
+         <if test='acc.type != null and acc.type != "" and acc.type == "5"'>
+            and fee.voucher_status = '0'
+        </if>
         <if test="acc.dc != null and acc.dc != ''">
             and fee.dc = #{acc.dc}
         </if>

+ 51 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/api/EDISender.java

@@ -0,0 +1,51 @@
+package org.springblade.los.edi.api;
+
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.los.business.files.entity.FilesCenter;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ * @author :jixinyuan
+ * @date : 2023/12/11
+ */
+public class EDISender {
+
+
+	public static FilesCenter sending(String content) {
+		try {
+			//生成edi文件
+			File file = new File("/home/minio/file/" + AuthUtil.getTenantId() + "-bladex/upload", "edi.text");
+//			File file = new File("D:/home/minio/file/" + AuthUtil.getTenantId() + "-bladex/upload", "edi.text");
+			file.createNewFile();
+			// 打开文件输出流进行写入操作
+			BufferedWriter writer = new BufferedWriter(new FileWriter(file));
+			// 向文件写入数据
+			writer.write(content);
+			// 关闭文件输出流
+			writer.close();
+			//文件地址
+			String url = file.getAbsolutePath();
+			//替换地址
+			url = url.replace("/home/minio", "http://121.37.83.47");
+			FilesCenter filesCenter = new FilesCenter();
+			filesCenter.setUrl(url);
+			filesCenter.setFileName(file.getName());
+			// 查找最后一个点号的索引位置
+			int dotIndex = file.getName().lastIndexOf('.');
+			// 确保点号不是第一个字符且不是最后一个字符
+			if (dotIndex > -1 && dotIndex < file.getName().length() - 1) {
+				// 提取从点号开始到结尾之间的部分作为扩展名
+				filesCenter.setFileExt(file.getName().substring(dotIndex + 1));
+			}
+			filesCenter.setReceivedData(new Date());
+			return filesCenter;
+		} catch (IOException e) {
+			throw new SecurityException("生成edi文件失败");
+		}
+	}
+}

+ 135 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/controller/EdiTypesController.java

@@ -0,0 +1,135 @@
+/*
+ *      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.edi.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.edi.entity.EdiTypes;
+import org.springblade.los.edi.vo.EdiTypesVO;
+import org.springblade.los.edi.service.IEdiTypesService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 基础资料-EDI 类型表 控制器
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/editypes")
+@Api(value = "基础资料-EDI 类型表", tags = "基础资料-EDI 类型表接口")
+public class EdiTypesController extends BladeController {
+
+	private final IEdiTypesService ediTypesService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入ediTypes")
+	public R<EdiTypes> detail(EdiTypes ediTypes) {
+		EdiTypes detail = ediTypesService.getOne(Condition.getQueryWrapper(ediTypes));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 基础资料-EDI 类型表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入ediTypes")
+	public R<IPage<EdiTypes>> list(EdiTypes ediTypes, Query query) {
+		IPage<EdiTypes> pages = ediTypesService.page(Condition.getPage(query), Condition.getQueryWrapper(ediTypes));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 基础资料-EDI 类型表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入ediTypes")
+	public R<IPage<EdiTypesVO>> page(EdiTypesVO ediTypes, Query query) {
+		IPage<EdiTypesVO> pages = ediTypesService.selectEdiTypesPage(Condition.getPage(query), ediTypes);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 基础资料-EDI 类型表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ediTypes")
+	public R save(@Valid @RequestBody EdiTypes ediTypes) {
+		return R.status(ediTypesService.save(ediTypes));
+	}
+
+	/**
+	 * 修改 基础资料-EDI 类型表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ediTypes")
+	public R update(@Valid @RequestBody EdiTypes ediTypes) {
+		return R.status(ediTypesService.updateById(ediTypes));
+	}
+
+	/**
+	 * 新增或修改 基础资料-EDI 类型表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入ediTypes")
+	public R submit(@Valid @RequestBody EdiTypes ediTypes) {
+		return ediTypesService.submit(ediTypes);
+	}
+
+
+	/**
+	 * 删除 基础资料-EDI 类型表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(ediTypesService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+	/**
+	 * edi发送测试
+	 */
+	@GetMapping("/testEDI")
+	public R testEDI() {
+		return ediTypesService.testEDI();
+	}
+
+
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/mapper/EdiTypesMapper.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.edi.mapper;
+
+import org.springblade.los.edi.entity.EdiTypes;
+import org.springblade.los.edi.vo.EdiTypesVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 基础资料-EDI 类型表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+public interface EdiTypesMapper extends BaseMapper<EdiTypes> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ediTypes
+	 * @return
+	 */
+	List<EdiTypesVO> selectEdiTypesPage(IPage page, EdiTypesVO ediTypes);
+
+}

+ 34 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/mapper/EdiTypesMapper.xml

@@ -0,0 +1,34 @@
+<?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.edi.mapper.EdiTypesMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ediTypesResultMap" type="org.springblade.los.edi.entity.EdiTypes">
+        <id column="id" property="id"/>
+        <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="code" property="code"/>
+        <result column="cn_name" property="cnName"/>
+        <result column="en_name" property="enName"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+        <result column="address" property="address"/>
+        <result column="userlist" property="userlist"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="remarks" property="remarks"/>
+    </resultMap>
+
+
+    <select id="selectEdiTypesPage" resultMap="ediTypesResultMap">
+        select * from los_b_edi_types where is_deleted = 0
+    </select>
+
+</mapper>

+ 50 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/service/IEdiTypesService.java

@@ -0,0 +1,50 @@
+/*
+ *      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.edi.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.edi.entity.EdiTypes;
+import org.springblade.los.edi.vo.EdiTypesVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 基础资料-EDI 类型表 服务类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+public interface IEdiTypesService extends IService<EdiTypes> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ediTypes
+	 * @return
+	 */
+	IPage<EdiTypesVO> selectEdiTypesPage(IPage<EdiTypesVO> page, EdiTypesVO ediTypes);
+
+	/**
+	 *
+	 * @param ediTypes
+	 * @return
+	 */
+	R submit(EdiTypes ediTypes);
+
+	R testEDI();
+}

+ 83 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/service/impl/EdiTypesServiceImpl.java

@@ -0,0 +1,83 @@
+/*
+ *      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.edi.service.impl;
+
+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.business.files.entity.FilesCenter;
+import org.springblade.los.edi.api.EDISender;
+import org.springblade.los.edi.entity.EdiTypes;
+import org.springblade.los.edi.mapper.EdiTypesMapper;
+import org.springblade.los.edi.service.IEdiTypesService;
+import org.springblade.los.edi.vo.EdiTypesVO;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 基础资料-EDI 类型表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Service
+@AllArgsConstructor
+public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> implements IEdiTypesService {
+
+	private final ISysClient sysClient;
+
+	@Override
+	public IPage<EdiTypesVO> selectEdiTypesPage(IPage<EdiTypesVO> page, EdiTypesVO ediTypes) {
+		return page.setRecords(baseMapper.selectEdiTypesPage(page, ediTypes));
+	}
+
+	@Override
+	public R submit(EdiTypes ediTypes) {
+		if (ediTypes.getId() == null) {
+			ediTypes.setCreateTime(new Date());
+			ediTypes.setCreateUser(AuthUtil.getUserId());
+			ediTypes.setCreateUserName(AuthUtil.getUserName());
+			//获取部门ids对应中文名
+			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+				ediTypes.setCreateDept(AuthUtil.getDeptId());
+				R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
+				if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+					ediTypes.setCreateDeptName(String.join(",", res.getData()));
+				}
+			}
+		} else {
+			ediTypes.setUpdateUser(AuthUtil.getUserId());
+			ediTypes.setUpdateTime(new Date());
+			ediTypes.setUpdateUserName(AuthUtil.getUserName());
+		}
+		this.saveOrUpdate(ediTypes);
+		return R.data(ediTypes);
+	}
+
+	@Override
+	public R testEDI() {
+		FilesCenter filesCenter = EDISender.sending("这里是edi写入数据");
+		return R.data(filesCenter);
+	}
+
+}

+ 147 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/controller/FinVouchersController.java

@@ -0,0 +1,147 @@
+/*
+ *      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.vouchers.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.springblade.los.finance.stl.entity.FinStlBills;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.finance.vouchers.entity.FinVouchers;
+import org.springblade.los.finance.vouchers.vo.FinVouchersVO;
+import org.springblade.los.finance.vouchers.service.IFinVouchersService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务-财务凭证 控制器
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/finvouchers")
+@Api(value = "业务-财务凭证", tags = "业务-财务凭证接口")
+public class FinVouchersController extends BladeController {
+
+	private final IFinVouchersService finVouchersService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入finVouchers")
+	public R<FinVouchers> detail(FinVouchers finVouchers) {
+		FinVouchers detail = finVouchersService.detail(finVouchers);
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务-财务凭证
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入finVouchers")
+	public R<IPage<FinVouchers>> list(FinVouchers finVouchers, Query query) {
+		IPage<FinVouchers> pages = finVouchersService.page(Condition.getPage(query), Condition.getQueryWrapper(finVouchers));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务-财务凭证
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入finVouchers")
+	public R<IPage<FinVouchersVO>> page(FinVouchersVO finVouchers, Query query) {
+		IPage<FinVouchersVO> pages = finVouchersService.selectFinVouchersPage(Condition.getPage(query), finVouchers);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务-财务凭证
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入finVouchers")
+	public R save(@Valid @RequestBody FinVouchers finVouchers) {
+		return R.status(finVouchersService.save(finVouchers));
+	}
+
+	/**
+	 * 修改 业务-财务凭证
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入finVouchers")
+	public R update(@Valid @RequestBody FinVouchers finVouchers) {
+		return R.status(finVouchersService.updateById(finVouchers));
+	}
+
+	/**
+	 * 新增或修改 业务-财务凭证
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入finVouchers")
+	public R submit(@Valid @RequestBody FinVouchers finVouchers) {
+		return finVouchersService.submit(finVouchers);
+	}
+
+
+	/**
+	 * 删除 业务-财务凭证
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(finVouchersService.removeByIds(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 财务凭证 确认
+	 */
+	@PostMapping("/confirmFinVouchers")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "确认", notes = "传入finStlBills")
+	public R confirmFinVouchers(@Valid @RequestBody FinVouchers finVouchers) {
+		return finVouchersService.confirmFinVouchers(finVouchers);
+	}
+
+	/**
+	 * 财务凭证 撤销
+	 */
+	@PostMapping("/revokeFinVouchers")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "撤销", notes = "传入finStlBills")
+	public R revokeFinVouchers(@Valid @RequestBody FinVouchers finVouchers) {
+		return finVouchersService.revokeFinVouchers(finVouchers);
+	}
+
+
+}

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/controller/FinVouchersItemsController.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.vouchers.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.vouchers.entity.FinVouchersItems;
+import org.springblade.los.finance.vouchers.vo.FinVouchersItemsVO;
+import org.springblade.los.finance.vouchers.service.IFinVouchersItemsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务-财务凭证分录 控制器
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/finvouchersitems")
+@Api(value = "业务-财务凭证分录", tags = "业务-财务凭证分录接口")
+public class FinVouchersItemsController extends BladeController {
+
+	private final IFinVouchersItemsService finVouchersItemsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入finVouchersItems")
+	public R<FinVouchersItems> detail(FinVouchersItems finVouchersItems) {
+		FinVouchersItems detail = finVouchersItemsService.getOne(Condition.getQueryWrapper(finVouchersItems));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务-财务凭证分录
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入finVouchersItems")
+	public R<IPage<FinVouchersItems>> list(FinVouchersItems finVouchersItems, Query query) {
+		IPage<FinVouchersItems> pages = finVouchersItemsService.page(Condition.getPage(query), Condition.getQueryWrapper(finVouchersItems));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务-财务凭证分录
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入finVouchersItems")
+	public R<IPage<FinVouchersItemsVO>> page(FinVouchersItemsVO finVouchersItems, Query query) {
+		IPage<FinVouchersItemsVO> pages = finVouchersItemsService.selectFinVouchersItemsPage(Condition.getPage(query), finVouchersItems);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务-财务凭证分录
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入finVouchersItems")
+	public R save(@Valid @RequestBody FinVouchersItems finVouchersItems) {
+		return R.status(finVouchersItemsService.save(finVouchersItems));
+	}
+
+	/**
+	 * 修改 业务-财务凭证分录
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入finVouchersItems")
+	public R update(@Valid @RequestBody FinVouchersItems finVouchersItems) {
+		return R.status(finVouchersItemsService.updateById(finVouchersItems));
+	}
+
+	/**
+	 * 新增或修改 业务-财务凭证分录
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入finVouchersItems")
+	public R submit(@Valid @RequestBody FinVouchersItems finVouchersItems) {
+		return R.status(finVouchersItemsService.saveOrUpdate(finVouchersItems));
+	}
+
+
+	/**
+	 * 删除 业务-财务凭证分录
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(finVouchersItemsService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersItemsMapper.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.vouchers.mapper;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchersItems;
+import org.springblade.los.finance.vouchers.vo.FinVouchersItemsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务-财务凭证分录 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+public interface FinVouchersItemsMapper extends BaseMapper<FinVouchersItems> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finVouchersItems
+	 * @return
+	 */
+	List<FinVouchersItemsVO> selectFinVouchersItemsPage(IPage page, FinVouchersItemsVO finVouchersItems);
+
+}

+ 83 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersItemsMapper.xml

@@ -0,0 +1,83 @@
+<?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.vouchers.mapper.FinVouchersItemsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="finVouchersItemsResultMap" type="org.springblade.los.finance.vouchers.entity.FinVouchersItems">
+        <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="bill_no" property="billNo"/>
+        <result column="voucher_source" property="voucherSource"/>
+        <result column="voucher_type" property="voucherType"/>
+        <result column="voucher_no" property="voucherNo"/>
+        <result column="voucher_date" property="voucherDate"/>
+        <result column="account_year" property="accountYear"/>
+        <result column="account_month" property="accountMonth"/>
+        <result column="account_day" property="accountDay"/>
+        <result column="account_id" property="accountId"/>
+        <result column="account_code" property="accountCode"/>
+        <result column="account_cn_name" property="accountCnName"/>
+        <result column="account_en_name" property="accountEnName"/>
+        <result column="account_full_name" property="accountFullName"/>
+        <result column="account_property" property="accountProperty"/>
+        <result column="account_level" property="accountLevel"/>
+        <result column="dc" property="dc"/>
+        <result column="is_foreign" property="isForeign"/>
+        <result column="is_quantity" property="isQuantity"/>
+        <result column="is_corp" property="isCorp"/>
+        <result column="is_dept" property="isDept"/>
+        <result column="is_empl" property="isEmpl"/>
+        <result column="is_item" property="isItem"/>
+        <result column="descr" property="descr"/>
+        <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="empl_id" property="emplId"/>
+        <result column="empl_name" property="emplName"/>
+        <result column="item_classify_id" property="itemClassifyId"/>
+        <result column="item_classify" property="itemClassify"/>
+        <result column="item_id" property="itemId"/>
+        <result column="item_name" property="itemName"/>
+        <result column="cur_code" property="curCode"/>
+        <result column="exrate" property="exrate"/>
+        <result column="quantity_dr" property="quantityDr"/>
+        <result column="quantity_cr" property="quantityCr"/>
+        <result column="unit_no" property="unitNo"/>
+        <result column="price" property="price"/>
+        <result column="amount_dr" property="amountDr"/>
+        <result column="amount_cr" property="amountCr"/>
+        <result column="amount_dr_usd" property="amountDrUsd"/>
+        <result column="amount_cr_usd" property="amountCrUsd"/>
+        <result column="amount_dr_loc" property="amountDrLoc"/>
+        <result column="amount_cr_loc" property="amountCrLoc"/>
+        <result column="check_user_id" property="checkUserId"/>
+        <result column="check_user_name" property="checkUserName"/>
+        <result column="check_time" property="checkTime"/>
+        <result column="post_user_id" property="postUserId"/>
+        <result column="post_user_name" property="postUserName"/>
+        <result column="post_time" property="postTime"/>
+        <result column="voucher_status" property="voucherStatus"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+    </resultMap>
+
+
+    <select id="selectFinVouchersItemsPage" resultMap="finVouchersItemsResultMap">
+        select * from los_fin_vouchers_items where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersMapper.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.vouchers.mapper;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchers;
+import org.springblade.los.finance.vouchers.vo.FinVouchersVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务-财务凭证 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+public interface FinVouchersMapper extends BaseMapper<FinVouchers> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finVouchers
+	 * @return
+	 */
+	List<FinVouchersVO> selectFinVouchersPage(IPage page, FinVouchersVO finVouchers);
+
+}

+ 52 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/mapper/FinVouchersMapper.xml

@@ -0,0 +1,52 @@
+<?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.vouchers.mapper.FinVouchersMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="finVouchersResultMap" type="org.springblade.los.finance.vouchers.entity.FinVouchers">
+        <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="voucher_source" property="voucherSource"/>
+        <result column="voucher_type" property="voucherType"/>
+        <result column="voucher_no" property="voucherNo"/>
+        <result column="voucher_date" property="voucherDate"/>
+        <result column="account_year" property="accountYear"/>
+        <result column="account_month" property="accountMonth"/>
+        <result column="account_day" property="accountDay"/>
+        <result column="descr" property="descr"/>
+        <result column="amount_dr" property="amountDr"/>
+        <result column="amount_cr" property="amountCr"/>
+        <result column="amount_dr_usd" property="amountDrUsd"/>
+        <result column="amount_cr_usd" property="amountCrUsd"/>
+        <result column="amount_dr_loc" property="amountDrLoc"/>
+        <result column="amount_cr_loc" property="amountCrLoc"/>
+        <result column="is_foreign" property="isForeign"/>
+        <result column="is_quantity" property="isQuantity"/>
+        <result column="check_user_id" property="checkUserId"/>
+        <result column="check_user_name" property="checkUserName"/>
+        <result column="check_time" property="checkTime"/>
+        <result column="post_user_id" property="postUserId"/>
+        <result column="post_user_name" property="postUserName"/>
+        <result column="post_time" property="postTime"/>
+        <result column="voucher_status" property="voucherStatus"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+    </resultMap>
+
+
+    <select id="selectFinVouchersPage" resultMap="finVouchersResultMap">
+        select * from los_fin_vouchers where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/IFinVouchersItemsService.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.vouchers.service;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchersItems;
+import org.springblade.los.finance.vouchers.vo.FinVouchersItemsVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-财务凭证分录 服务类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+public interface IFinVouchersItemsService extends IService<FinVouchersItems> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finVouchersItems
+	 * @return
+	 */
+	IPage<FinVouchersItemsVO> selectFinVouchersItemsPage(IPage<FinVouchersItemsVO> page, FinVouchersItemsVO finVouchersItems);
+
+}

+ 69 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/IFinVouchersService.java

@@ -0,0 +1,69 @@
+/*
+ *      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.vouchers.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.finance.vouchers.entity.FinVouchers;
+import org.springblade.los.finance.vouchers.vo.FinVouchersVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-财务凭证 服务类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+public interface IFinVouchersService extends IService<FinVouchers> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param finVouchers
+	 * @return
+	 */
+	IPage<FinVouchersVO> selectFinVouchersPage(IPage<FinVouchersVO> page, FinVouchersVO finVouchers);
+
+	/**
+	 * 详情
+	 * @param finVouchers
+	 * @return
+	 */
+    FinVouchers detail(FinVouchers finVouchers);
+
+	/**
+	 * 新增或修改 业务-财务凭证
+	 * @param finVouchers
+	 * @return
+	 */
+	R submit(FinVouchers finVouchers);
+
+	/**
+	 * 财务凭证 确认
+	 * @param finVouchers
+	 * @return
+	 */
+	R confirmFinVouchers(FinVouchers finVouchers);
+
+	/**
+	 * 财务凭证 撤销
+	 * @param finVouchers
+	 * @return
+	 */
+	R revokeFinVouchers(FinVouchers finVouchers);
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/impl/FinVouchersItemsServiceImpl.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.vouchers.service.impl;
+
+import org.springblade.los.finance.vouchers.entity.FinVouchersItems;
+import org.springblade.los.finance.vouchers.vo.FinVouchersItemsVO;
+import org.springblade.los.finance.vouchers.mapper.FinVouchersItemsMapper;
+import org.springblade.los.finance.vouchers.service.IFinVouchersItemsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-财务凭证分录 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Service
+public class FinVouchersItemsServiceImpl extends ServiceImpl<FinVouchersItemsMapper, FinVouchersItems> implements IFinVouchersItemsService {
+
+	@Override
+	public IPage<FinVouchersItemsVO> selectFinVouchersItemsPage(IPage<FinVouchersItemsVO> page, FinVouchersItemsVO finVouchersItems) {
+		return page.setRecords(baseMapper.selectFinVouchersItemsPage(page, finVouchersItems));
+	}
+
+}

+ 326 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/vouchers/service/impl/FinVouchersServiceImpl.java

@@ -0,0 +1,326 @@
+/*
+ *      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.vouchers.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.basic.cur.service.IBCurrencyService;
+import org.springblade.los.billno.entity.BusinessBillNo;
+import org.springblade.los.billno.service.IBusinessBillNoService;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.finance.fee.entity.FeeCenter;
+import org.springblade.los.finance.fee.entity.FinAccBills;
+import org.springblade.los.finance.fee.service.IFeeCenterService;
+import org.springblade.los.finance.fee.service.IFinAccBillsService;
+import org.springblade.los.finance.stl.entity.FinStlBills;
+import org.springblade.los.finance.stl.entity.FinStlBillsItems;
+import org.springblade.los.finance.vouchers.entity.FinVouchers;
+import org.springblade.los.finance.vouchers.entity.FinVouchersItems;
+import org.springblade.los.finance.vouchers.mapper.FinVouchersMapper;
+import org.springblade.los.finance.vouchers.service.IFinVouchersItemsService;
+import org.springblade.los.finance.vouchers.service.IFinVouchersService;
+import org.springblade.los.finance.vouchers.vo.FinVouchersVO;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 业务-财务凭证 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-12-11
+ */
+@Service
+@AllArgsConstructor
+public class FinVouchersServiceImpl extends ServiceImpl<FinVouchersMapper, FinVouchers> implements IFinVouchersService {
+
+	private final ISysClient sysClient;
+
+	private final IFinVouchersItemsService finVouchersItemsService;
+
+	private final IBCurrencyService bCurrencyService;
+
+	private final IBusinessTypeService bBusinessTypeService;
+
+	private final IBusinessBillNoService businessBillNoService;
+
+	private final IFinAccBillsService finAccBillsService;
+
+	private final IFeeCenterService feeCenterService;
+
+	@Override
+	public IPage<FinVouchersVO> selectFinVouchersPage(IPage<FinVouchersVO> page, FinVouchersVO finVouchers) {
+		return page.setRecords(baseMapper.selectFinVouchersPage(page, finVouchers));
+	}
+
+	@Override
+	public FinVouchers detail(FinVouchers finVouchers) {
+		if (finVouchers.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		FinVouchers detail = baseMapper.selectById(finVouchers.getId());
+		detail.setFinVouchersItemsList(finVouchersItemsService.list(new LambdaQueryWrapper<FinVouchersItems>()
+			.eq(FinVouchersItems::getIsDeleted, 0)
+			.eq(FinVouchersItems::getTenantId, AuthUtil.getTenantId())
+			.eq(FinVouchersItems::getPid, detail.getId())
+		));
+		return detail;
+	}
+
+	@Override
+	public R submit(FinVouchers finVouchers) {
+		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 (finVouchers.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, finVouchers.getBusinessTypeCode()));
+			if (businessType == null) {
+				throw new RuntimeException("未找到可用业务类型");
+			}
+			BusinessBillNo businessBillNo = new BusinessBillNo();
+			businessBillNo.setBusinessTypeId(businessType.getId());
+			businessBillNo.setCode(finVouchers.getBillNoFormat());
+			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+			if (!clientBillNo.isSuccess()) {
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				return R.fail(500, "生成订单编号失败");
+			}
+			finVouchers.setBillNo((String) clientBillNo.getData());
+			finVouchers.setCreateTime(new Date());
+			finVouchers.setCreateUser(AuthUtil.getUserId());
+			finVouchers.setCreateUserName(AuthUtil.getUserName());
+			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+				finVouchers.setCreateDept(deptId);
+				finVouchers.setBranchId(deptId);
+				finVouchers.setCreateDeptName(deptName);
+			}
+		} else {
+			finVouchers.setUpdateUser(AuthUtil.getUserId());
+			finVouchers.setUpdateTime(new Date());
+			finVouchers.setUpdateUserName(AuthUtil.getUserName());
+		}
+		this.saveOrUpdate(finVouchers);
+		if (ObjectUtils.isNotNull(finVouchers.getFinVouchersItemsList())) {
+			for (FinVouchersItems item : finVouchers.getFinVouchersItemsList()) {
+				//计算字段null值处理
+				item.setQuantityCr(ObjectUtils.isNotNull(item.getQuantityCr()) ? item.getQuantityCr() : new BigDecimal("0.00"));
+				item.setQuantityDr(ObjectUtils.isNotNull(item.getQuantityDr()) ? item.getQuantityDr() : new BigDecimal("0.00"));
+				item.setPrice(ObjectUtils.isNotNull(item.getPrice()) ? item.getPrice() : new BigDecimal("0.00"));
+				item.setPid(finVouchers.getId());
+				//判断是否是本位币
+				if ("CNY".equals(item.getCurCode())) {
+					if ("D".equals(item.getDc())){
+						item.setAmountDr(item.getQuantityDr().multiply(item.getPrice()));
+					}else{
+						item.setAmountCr(item.getQuantityCr().multiply(item.getPrice()));
+					}
+				} else {
+					if ("D".equals(item.getDc())){
+						item.setAmountDrUsd(item.getQuantityDr().multiply(item.getPrice()));
+					}else{
+						item.setAmountCrUsd(item.getQuantityCr().multiply(item.getPrice()));
+					}
+				}
+				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());
+				}
+			}
+			finVouchersItemsService.saveOrUpdateBatch(finVouchers.getFinVouchersItemsList());
+			BigDecimal amountDrCNY = new BigDecimal("0.00");
+			BigDecimal amountCrCNY = new BigDecimal("0.00");
+			BigDecimal amountDrUSD = new BigDecimal("0.00");
+			BigDecimal amountCrUSD = new BigDecimal("0.00");
+			amountDrCNY = amountDrCNY.add(finVouchers.getFinVouchersItemsList().stream()
+				.filter(e -> "CNY".equals(e.getCurCode()) && "D".equals(e.getDc())).map(FinVouchersItems::getAmountDr)
+				.filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			finVouchers.setAmountDr(amountDrCNY);
+			amountCrCNY = amountCrCNY.add(finVouchers.getFinVouchersItemsList().stream()
+				.filter(e -> "CNY".equals(e.getCurCode()) && "C".equals(e.getDc())).map(FinVouchersItems::getAmountCr)
+				.filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			finVouchers.setAmountCr(amountCrCNY);
+			amountDrUSD = amountDrUSD.add(finVouchers.getFinVouchersItemsList().stream()
+				.filter(e -> "USD".equals(e.getCurCode()) && "D".equals(e.getDc())).map(FinVouchersItems::getAmountDrUsd)
+				.filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			finVouchers.setAmountDrUsd(amountDrUSD);
+			amountCrUSD = amountCrUSD.add(finVouchers.getFinVouchersItemsList().stream()
+				.filter(e -> "USD".equals(e.getCurCode()) && "C".equals(e.getDc())).map(FinVouchersItems::getAmountCrUsd)
+				.filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+			finVouchers.setAmountCrUsd(amountCrUSD);
+			finVouchers.setAmountDrLoc(amountDrCNY.add(bCurrencyService.converterCny("USD", amountDrUSD)));
+			finVouchers.setAmountCrLoc(amountCrCNY.add(bCurrencyService.converterCny("USD", amountCrUSD)));
+		}
+		this.saveOrUpdate(finVouchers);
+		return R.data(finVouchers);
+	}
+
+	@Override
+	public R confirmFinVouchers(FinVouchers finVouchers) {
+		if (finVouchers.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		FinVouchers detail = baseMapper.selectById(finVouchers.getId());
+		if (ObjectUtils.isNotNull(finVouchers.getFinVouchersItemsList())) {
+			//对账明细状态修改  已对账
+			for (FinVouchersItems item : finVouchers.getFinVouchersItemsList()) {
+				item.setStatus(1);
+				item.setVoucherDate(finVouchers.getVoucherDate());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUserName(AuthUtil.getUserName());
+			}
+			finVouchersItemsService.saveOrUpdateBatch(finVouchers.getFinVouchersItemsList());
+			//通过对账明细里账单id查询具体账单数据
+			List<String> billNos = finVouchers.getFinVouchersItemsList().stream().map(FinVouchersItems::getBillNo)
+				.filter(Objects::nonNull).collect(Collectors.toList());
+			List<FinAccBills> finAccBillsList = finAccBillsService.list(new LambdaQueryWrapper<FinAccBills>()
+				.eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
+				.eq(FinAccBills::getIsDeleted, 0)
+				.in(FinAccBills::getBillNo, billNos));
+			//修改账单中对账状态
+			for (FinAccBills item : finAccBillsList) {
+				item.setVoucherBillId(detail.getId());
+				item.setVoucherBillNo(detail.getBillNo());
+				item.setVoucherNo(detail.getVoucherNo());
+				item.setVoucherDate(detail.getVoucherDate());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUserName(AuthUtil.getUserName());
+			}
+			//通过账单id查询具体费用中心数据
+			List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+				.in(FeeCenter::getAccBillNo, billNos)
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0));
+			List<FeeCenter> feeCenterListNew = reconciliationFeeCenter(detail, feeCenterList, 1);
+			feeCenterService.saveOrUpdateBatch(feeCenterListNew);
+			finAccBillsService.saveOrUpdateBatch(finAccBillsList);
+		}
+		detail.setStatus(3);
+		detail.setVoucherStatus(1);
+		baseMapper.updateById(detail);
+		return R.data(detail);
+	}
+
+	private List<FeeCenter> reconciliationFeeCenter(FinVouchers detail, List<FeeCenter> feeCenterList, int count) {
+		for (FeeCenter item : feeCenterList) {
+			if (count == 1) {
+				item.setVoucherBillId(detail.getId());
+				item.setVoucherBillNo(detail.getBillNo());
+				item.setVoucherNo(detail.getVoucherNo());
+				item.setVoucherDate(detail.getVoucherDate());
+				item.setVoucherStatus(1);
+				item.setVoucherById(detail.getCreateUser());
+				item.setVoucherByName(detail.getCreateUserName());
+			} else {
+				item.setVoucherBillId(0L);
+				item.setVoucherBillNo("");
+				item.setVoucherNo("");
+				item.setVoucherDate(null);
+				item.setVoucherStatus(0);
+				item.setVoucherById(0L);
+				item.setVoucherByName("");
+			}
+		}
+		return feeCenterList;
+	}
+
+	@Override
+	public R revokeFinVouchers(FinVouchers finVouchers) {
+		if (finVouchers.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		FinVouchers detail = baseMapper.selectById(finVouchers.getId());
+		if (ObjectUtils.isNotNull(finVouchers.getFinVouchersItemsList())) {
+			//对账明细状态修改  已对账
+			for (FinVouchersItems item : finVouchers.getFinVouchersItemsList()) {
+				item.setStatus(0);
+				item.setVoucherDate(finVouchers.getVoucherDate());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUserName(AuthUtil.getUserName());
+			}
+			finVouchersItemsService.saveOrUpdateBatch(finVouchers.getFinVouchersItemsList());
+			//通过对账明细里账单id查询具体账单数据
+			List<String> billNos = finVouchers.getFinVouchersItemsList().stream().map(FinVouchersItems::getBillNo)
+				.filter(Objects::nonNull).collect(Collectors.toList());
+			List<FinAccBills> finAccBillsList = finAccBillsService.list(new LambdaQueryWrapper<FinAccBills>()
+				.eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
+				.eq(FinAccBills::getIsDeleted, 0)
+				.in(FinAccBills::getBillNo, billNos));
+			//修改账单中对账状态
+			for (FinAccBills item : finAccBillsList) {
+				item.setVoucherBillId(0L);
+				item.setVoucherBillNo("");
+				item.setVoucherNo("");
+				item.setVoucherDate(null);
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUserName(AuthUtil.getUserName());
+			}
+			//通过账单id查询具体费用中心数据
+			List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+				.in(FeeCenter::getAccBillNo, billNos)
+				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted, 0));
+			List<FeeCenter> feeCenterListNew = reconciliationFeeCenter(detail, feeCenterList, 2);
+			feeCenterService.saveOrUpdateBatch(feeCenterListNew);
+			finAccBillsService.saveOrUpdateBatch(finAccBillsList);
+		}
+		detail.setStatus(0);
+		detail.setVoucherStatus(0);
+		baseMapper.updateById(detail);
+		return R.data(detail);
+	}
+
+}

+ 1 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/controller/PriceBankController.java

@@ -222,6 +222,7 @@ public class PriceBankController extends BladeController {
 		lambdaQueryWrapper.eq(PriceBank::getStatus, 0);
 		lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
 		lambdaQueryWrapper.eq(PriceBank::getTradeType, "CK");
+		lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getItemId()), PriceBank::getItemId, priceBank.getItemId());
 		lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()), PriceBank::getCname, priceBank.getCname());
 		lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()), PriceBank::getCode, priceBank.getCode());
 		lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()), PriceBank::getCorpId, priceBank.getCorpId());

+ 69 - 24
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsDescController.java

@@ -27,6 +27,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.client.entity.CorpsAddr;
 import org.springblade.client.entity.CorpsDesc;
 import org.springblade.client.entity.StorageDesc;
 import org.springblade.core.boot.ctrl.BladeController;
@@ -38,10 +39,7 @@ import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.*;
 import org.springblade.purchase.sales.entity.Order;
-import org.springblade.salesPart.corps.service.ICorpsAttnService;
-import org.springblade.salesPart.corps.service.ICorpsDescService;
-import org.springblade.salesPart.corps.service.ICorpsTypeDescService;
-import org.springblade.salesPart.corps.service.ICorpsTypeService;
+import org.springblade.salesPart.corps.service.*;
 import org.springblade.salesPart.entity.*;
 import org.springblade.salesPart.excel.CorpsDescExportExcel;
 import org.springblade.salesPart.excel.CorpsDescImportExcel;
@@ -75,6 +73,7 @@ public class CorpsDescController extends BladeController {
 	private final ICorpsTypeDescService corpsTypeDescService;
 	private final ICorpsTypeService corpsTypeService;
 	private final ICorpsAttnService corpsAttnService;
+	private final ICorpsAddrService corpsAddrService;
 	private final IStorageDescService storageDescService;
 	private final IOrderService orderService;
 
@@ -103,26 +102,41 @@ public class CorpsDescController extends BladeController {
 
 		if (CollectionUtils.isNotEmpty(pages.getRecords())) {
 			List<Long> ids = new ArrayList<>();
+			List<Long> corpsIds = new ArrayList<>();
 			for (CorpsDescVO item : pages.getRecords()) {
 				ids.add(item.getDeliveryWarehouseId());
+				corpsIds.add(item.getId());
+			}
+			List<PjCorpsTypeDesc> pjCorpsTypeDescList = corpsTypeDescService.list(new LambdaQueryWrapper<PjCorpsTypeDesc>()
+				.in(PjCorpsTypeDesc::getCorpId, corpsIds));
+			List<PjCorpsType> pjCorpsTypeList = new ArrayList<>();
+			if (pjCorpsTypeDescList.size() > 0) {
+				List<Long> typeIdList = pjCorpsTypeDescList.stream().map(PjCorpsTypeDesc::getCorpTypeId).collect(Collectors.toList());
+				if (typeIdList.size() > 0) {
+					pjCorpsTypeList = corpsTypeService.list(new LambdaQueryWrapper<PjCorpsType>()
+						.in(PjCorpsType::getId, typeIdList)
+						.eq(PjCorpsType::getIsDeleted, 0));
+				}
 			}
 			List<PjStorageDesc> storageDescList = new ArrayList<>();
 			if (ids.size() > 0) {
 				storageDescList = storageDescService.list(new LambdaQueryWrapper<PjStorageDesc>().in(PjStorageDesc::getId, ids));
 			}
 			for (CorpsDescVO item : pages.getRecords()) {
-				List<Long> typeIdList = corpsTypeDescService.list(new LambdaQueryWrapper<PjCorpsTypeDesc>().eq(PjCorpsTypeDesc::getCorpId, item.getId()))
-					.stream().map(PjCorpsTypeDesc::getCorpTypeId).collect(Collectors.toList());
 				if (ObjectUtils.isNotNull(item.getDeliveryWarehouseId())) {
 					item.setDeliveryWarehouseName(storageDescList.stream().filter(e -> item.getDeliveryWarehouseId().equals(e.getId())).findFirst().orElse(new PjStorageDesc()).getCname());
 				}
-				if (CollectionUtil.isNotEmpty(typeIdList)) {
-					String typeName = corpsTypeService.list(new LambdaQueryWrapper<PjCorpsType>()
-						.in(PjCorpsType::getId, typeIdList)
-						.eq(PjCorpsType::getCorpType, item.getCorpType())
-						.eq(PjCorpsType::getIsDeleted, 0)
-					).stream().map(PjCorpsType::getCname).collect(Collectors.joining(","));
-					item.setCorpsTypeName(typeName);
+				if (pjCorpsTypeList.size() > 0) {
+					List<Long> typeIds = pjCorpsTypeDescList.stream()
+						.filter(e -> e.getCorpId().equals(item.getId())).map(PjCorpsTypeDesc::getCorpTypeId)
+						.collect(Collectors.toList());
+					List<PjCorpsType> pjCorpsTypes = pjCorpsTypeList.stream()
+						.filter(e -> e.getCorpType().equals(item.getCorpType()) && typeIds.contains(e.getId()))
+						.collect(Collectors.toList());
+					if (pjCorpsTypes.size() > 0) {
+						String typeName = pjCorpsTypes.stream().map(PjCorpsType::getCname).collect(Collectors.joining(","));
+						item.setCorpsTypeName(typeName);
+					}
 				}
 			}
 		}
@@ -231,19 +245,50 @@ public class CorpsDescController extends BladeController {
 		corpsDesc.setTenantId(SecureUtil.getTenantId());
 		corpsDesc.setSalesCompanyId(Long.valueOf(AuthUtil.getDeptId()));
 		List<CorpsDescVO> list = corpsDescService.selectCorpsDescAll(corpsDesc);
-
+		List<Long> addId = list.stream().map(CorpsDescVO::getId).collect(Collectors.toList());
+		List<PjCorpsAddr> pjCorpsAddrList = new ArrayList<>();
+		if (addId.size() > 0) {
+			pjCorpsAddrList = corpsAddrService.list(new LambdaQueryWrapper<PjCorpsAddr>()
+				.eq(PjCorpsAddr::getTenantId, AuthUtil.getTenantId())
+				.eq(PjCorpsAddr::getIsDeleted, 0)
+				.in(PjCorpsAddr::getPid, addId));
+		}
+		List<Long> corpsIds = new ArrayList<>();
+		for (CorpsDescVO item : list) {
+			corpsIds.add(item.getId());
+		}
+		List<PjCorpsTypeDesc> pjCorpsTypeDescList = corpsTypeDescService.list(new LambdaQueryWrapper<PjCorpsTypeDesc>()
+			.in(PjCorpsTypeDesc::getCorpId, corpsIds));
+		List<PjCorpsType> pjCorpsTypeList = new ArrayList<>();
+		if (pjCorpsTypeDescList.size() > 0) {
+			List<Long> typeIdList = pjCorpsTypeDescList.stream().map(PjCorpsTypeDesc::getCorpTypeId).collect(Collectors.toList());
+			if (typeIdList.size() > 0) {
+				pjCorpsTypeList = corpsTypeService.list(new LambdaQueryWrapper<PjCorpsType>()
+					.in(PjCorpsType::getId, typeIdList)
+					.eq(PjCorpsType::getIsDeleted, 0));
+			}
+		}
 		if (CollectionUtils.isNotEmpty(list)) {
+			List<PjCorpsAddr> finalPjCorpsAddrList = pjCorpsAddrList;
+			List<PjCorpsType> finalPjCorpsTypeList = pjCorpsTypeList;
 			list.forEach(item -> {
-				List<Long> typeIdList = corpsTypeDescService.list(new LambdaQueryWrapper<PjCorpsTypeDesc>().eq(PjCorpsTypeDesc::getCorpId, item.getId()))
-					.stream().map(PjCorpsTypeDesc::getCorpTypeId).collect(Collectors.toList());
-
-				if (CollectionUtil.isNotEmpty(typeIdList)) {
-					String typeName = corpsTypeService.list(new LambdaQueryWrapper<PjCorpsType>()
-						.in(PjCorpsType::getId, typeIdList)
-						.eq(PjCorpsType::getCorpType, item.getCorpType())
-						.eq(PjCorpsType::getIsDeleted, 0)
-					).stream().map(PjCorpsType::getCname).collect(Collectors.joining(","));
-					item.setCorpsTypeName(typeName);
+				if (finalPjCorpsTypeList.size() > 0) {
+					List<Long> typeIds = pjCorpsTypeDescList.stream()
+						.filter(e -> e.getCorpId().equals(item.getId())).map(PjCorpsTypeDesc::getCorpTypeId)
+						.collect(Collectors.toList());
+					List<PjCorpsType> pjCorpsTypes = finalPjCorpsTypeList.stream()
+						.filter(e -> e.getCorpType().equals(item.getCorpType()) && typeIds.contains(e.getId()))
+						.collect(Collectors.toList());
+					if (pjCorpsTypes.size() > 0) {
+						String typeName = pjCorpsTypes.stream().map(PjCorpsType::getCname).collect(Collectors.joining(","));
+						item.setCorpsTypeName(typeName);
+					}
+				}
+				List<PjCorpsAddr> pjCorpsAddr = finalPjCorpsAddrList.stream().filter(e -> e.getPid().equals(item.getId())).collect(Collectors.toList());
+				if (pjCorpsAddr.size() > 0) {
+					item.setContacts(pjCorpsAddr.stream().map(PjCorpsAddr::getContacts).collect(Collectors.joining(",")));
+					item.setContactsPhone(pjCorpsAddr.stream().map(PjCorpsAddr::getTel).collect(Collectors.joining(",")));
+					item.setAddress(pjCorpsAddr.stream().map(PjCorpsAddr::getDetailedAddress).collect(Collectors.joining(",")));
 				}
 			});
 		}

+ 11 - 9
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

@@ -627,6 +627,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			List<Long> goodsIds = list.stream().map(PjOrderItems::getGoodsId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 			List<PjGoodsDesc> pjGoodsDescList = new ArrayList<>();
 			List<PjStockDesc> pjStockDescList = new ArrayList<>();
+			List<PjStockDesc> pjStockDescListAll = new ArrayList<>();
 			if (goodsIds.size() > 0) {
 				pjGoodsDescList = goodsDescMapper.selectList(new LambdaQueryWrapper<PjGoodsDesc>()
 					.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
@@ -638,13 +639,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 					.eq(PjStockDesc::getSalesCompanyId, gdShip.getSalesCompanyId())
 					.in(PjStockDesc::getGoodsId, goodsIds)
 					.eq(PjStockDesc::getStorageId, gdShip.getStorageId()));
+				pjStockDescListAll = stockDescService.list(new LambdaQueryWrapper<PjStockDesc>()
+					.eq(PjStockDesc::getTenantId, AuthUtil.getTenantId())
+					.eq(PjStockDesc::getIsDeleted, 0)
+					.eq(PjStockDesc::getSalesCompanyId, gdShip.getSalesCompanyId())
+					.in(PjStockDesc::getGoodsId, goodsIds));
 				//查询所有上架商品
-				LambdaQueryWrapper<PjProductLaunch> productLaunchQueryWrapper = new LambdaQueryWrapper<>();
-				productLaunchQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
-					.eq(PjProductLaunch::getIsDeleted, 0)
-					.isNull(PjProductLaunch::getSourceId)
-					.eq(PjProductLaunch::getSalesCompanyId, gdShip.getSalesCompanyId())
-					.in(PjProductLaunch::getGoodsId, goodsIds);
 				pjProductLaunch = productLaunchService.list(new LambdaQueryWrapper<PjProductLaunch>()
 					.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
 					.eq(PjProductLaunch::getIsDeleted, 0)
@@ -656,6 +656,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			List<PjGoodsDesc> finalPjGoodsDescList = pjGoodsDescList;
 			List<PjStockDesc> finalPjStockDescList = pjStockDescList;
 			List<PjProductLaunch> finalPjProductLaunch = pjProductLaunch;
+			List<PjStockDesc> finalPjStockDescListAll = pjStockDescListAll;
 			list.forEach(e -> {
 				//获得商品
 				PjGoodsDesc goodsDesc = finalPjGoodsDescList.stream().filter(i -> i.getId().equals(e.getGoodsId())).findFirst().orElse(null);
@@ -749,9 +750,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				}
 				/** ----------------------修改上架库存---------------------- */
 				BigDecimal balanceQuantity = new BigDecimal("0.00");
-				if (finalPjStockDescList.size() > 0) {
+				if (finalPjStockDescListAll.size() > 0) {
 					//查询所有该商品的库存
-					List<PjStockDesc> stockDescList = finalPjStockDescList.stream().filter(i -> goodsIds.contains(i.getGoodsId())).collect(Collectors.toList());
+					List<PjStockDesc> stockDescList = finalPjStockDescListAll.stream().filter(i -> i.getGoodsId().equals(e.getGoodsId())).collect(Collectors.toList());
 					if (stockDescList.size() > 0) {
 						balanceQuantity = stockDescList.stream().map(PjStockDesc::getBalanceQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 					}
@@ -760,7 +761,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				//库存总数量
 				balanceQuantity = balanceQuantity.add(e.getGoodsNum());
 				//查询所有上架商品
-				List<PjProductLaunch> productLaunch = finalPjProductLaunch.stream().filter(i -> i.getGoodsId().equals(e.getGoodsId())).collect(Collectors.toList());
+				List<PjProductLaunch> productLaunch = finalPjProductLaunch.stream()
+					.filter(i -> i.getGoodsId().equals(e.getGoodsId())).collect(Collectors.toList());
 				//修改上架数量
 				if (ObjectUtil.isNotEmpty(productLaunch)) {
 					BigDecimal finalBalanceQuantity = balanceQuantity;