Przeglądaj źródła

2024年1月19日17:38:30

纪新园 2 lat temu
rodzic
commit
dfdac1ab8c
14 zmienionych plików z 2715 dodań i 346 usunięć
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/dto/AeaBillsDTO.java
  2. 1135 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/entity/AeaBills.java
  3. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/vo/AeaBillsVO.java
  4. 212 186
      blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/controller/TradingBoxItemController.java
  5. 1 1
      blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/service/impl/ArchivesServiceImpl.java
  6. 2 1
      blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java
  7. 245 147
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  8. 237 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/controller/AeaBillsController.java
  9. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.java
  10. 211 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.xml
  11. 50 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/IAeaBillsService.java
  12. 510 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java
  13. 0 10
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java
  14. 0 1
      blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/controller/FinStlBillsController.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/dto/AeaBillsDTO.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.business.aea.dto;
+
+import org.springblade.los.business.aea.entity.AeaBills;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 业务-空运进出口数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-01-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AeaBillsDTO extends AeaBills {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1135 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/entity/AeaBills.java

@@ -0,0 +1,1135 @@
+/*
+ *      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.business.aea.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.springblade.los.business.files.entity.FilesCenter;
+import org.springblade.los.finance.fee.entity.FeeCenter;
+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 2024-01-19
+ */
+@Data
+@TableName("los_aea_bills")
+@ApiModel(value = "AeaBills对象", description = "业务-空运进出口")
+public class AeaBills 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;
+	/**
+	 * 业务类型(单据), AE=空运出口 AI=空运进口
+	 */
+	@ApiModelProperty(value = "业务类型(单据), AE=空运出口 AI=空运进口")
+	private String businessType;
+	/**
+	 * 业务类型
+	 */
+	@ApiModelProperty(value = "业务类型")
+	private String seaType;
+	/**
+	 * 单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单
+	 */
+	@ApiModelProperty(value = "单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单")
+	private String billType;
+	/**
+	 * 主运单类型
+	 */
+	@ApiModelProperty(value = "主运单类型")
+	private String waybillType;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long waybillId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String waybillCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String waybillEnName;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * 主单 Id
+	 */
+	@ApiModelProperty(value = "主单 Id")
+	private Long masterId;
+	/**
+	 * 主单单据编号
+	 */
+	@ApiModelProperty(value = "主单单据编号")
+	private String masterBillNo;
+	/**
+	 * 单据日期
+	 */
+	@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 billDate;
+	/**
+	 * 入货时间
+	 */
+	@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 incomingGoodsDate;
+	/**
+	 * 提单确认日期
+	 */
+	@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 billConfirmDate;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * 客户联系人 id
+	 */
+	@ApiModelProperty(value = "客户联系人 id")
+	private Long corpAttnId;
+	/**
+	 * 客户联系人姓名
+	 */
+	@ApiModelProperty(value = "客户联系人姓名")
+	private String corpAttnName;
+	/**
+	 * 客户联系人电话
+	 */
+	@ApiModelProperty(value = "客户联系人电话")
+	private String corpAttnTel;
+	/**
+	 * 客户联系人邮箱
+	 */
+	@ApiModelProperty(value = "客户联系人邮箱")
+	private String corpAttnEmail;
+	/**
+	 * 操作 Id
+	 */
+	@ApiModelProperty(value = "操作 Id")
+	private Long operatorId;
+	/**
+	 * 操作
+	 */
+	@ApiModelProperty(value = "操作")
+	private String operatorName;
+	/**
+	 * 业务来源
+	 */
+	@ApiModelProperty(value = "业务来源")
+	private String srcType;
+	/**
+	 * 来源 id
+	 */
+	@ApiModelProperty(value = "来源 id")
+	private Long srcId;
+	/**
+	 * 来源中文
+	 */
+	@ApiModelProperty(value = "来源中文")
+	private String srcCnName;
+	/**
+	 * 来源英文
+	 */
+	@ApiModelProperty(value = "来源英文")
+	private String srcEnName;
+	/**
+	 * 航空公司 id
+	 */
+	@ApiModelProperty(value = "航空公司 id")
+	private Long carrierId;
+	/**
+	 * 航空公司中文名称
+	 */
+	@ApiModelProperty(value = "航空公司中文名称")
+	private String carrierCnName;
+	/**
+	 * 航空公司英文名称
+	 */
+	@ApiModelProperty(value = "航空公司英文名称")
+	private String carrierEnName;
+	/**
+	 * 订舱日期
+	 */
+	@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 bookingDate;
+	/**
+	 * 订舱备注
+	 */
+	@ApiModelProperty(value = "订舱备注")
+	private String bookingRemarks;
+	/**
+	 * 航班号
+	 */
+	@ApiModelProperty(value = "航班号")
+	private String voyageNo;
+	/**
+	 * MB/L NO
+	 */
+	@ApiModelProperty(value = "MB/L NO")
+	private String mblno;
+	/**
+	 * HB/L NO
+	 */
+	@ApiModelProperty(value = "HB/L NO")
+	private String hblno;
+	/**
+	 * Reference NO
+	 */
+	@ApiModelProperty(value = "Reference NO")
+	private String refno;
+	/**
+	 * 航班日期
+	 */
+	@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 etd;
+
+	/**
+	 * 航班日期
+	 */
+	@TableField(exist = false)
+	private List<String> etdList;
+	/**
+	 * 发运日期
+	 */
+	@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 realityEtd;
+	/**
+	 * eta日期
+	 */
+	@ApiModelProperty(value = "eta日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date eta;
+	/**
+	 * eta日期
+	 */
+	@TableField(exist = false)
+	private List<String> etaList;
+	/**
+	 * 目的地 id
+	 */
+	@ApiModelProperty(value = "目的地 id")
+	private Long destinationId;
+	/**
+	 * 目的地代码
+	 */
+	@ApiModelProperty(value = "目的地代码")
+	private String destinationCode;
+	/**
+	 * 目的地英文名称
+	 */
+	@ApiModelProperty(value = "目的地英文名称")
+	private String destinationName;
+	/**
+	 * 目的港 id
+	 */
+	@ApiModelProperty(value = "目的港 id")
+	private Long finalDestinationId;
+	/**
+	 * 目的港代码
+	 */
+	@ApiModelProperty(value = "目的港代码")
+	private String finalDestinationCode;
+	/**
+	 * 目的港英文名称
+	 */
+	@ApiModelProperty(value = "目的港英文名称")
+	private String finalDestinationName;
+	/**
+	 * 中转港 id
+	 */
+	@ApiModelProperty(value = "中转港 id")
+	private Long potId;
+	/**
+	 * 中转港代码
+	 */
+	@ApiModelProperty(value = "中转港代码")
+	private String potCode;
+	/**
+	 * 中转港英文名称
+	 */
+	@ApiModelProperty(value = "中转港英文名称")
+	private String potCnName;
+	/**
+	 * 中转港英文名称
+	 */
+	@ApiModelProperty(value = "中转港英文名称")
+	private String potEnName;
+	/**
+	 * 中转航班
+	 */
+	@ApiModelProperty(value = "中转航班")
+	private String potVoyageNo;
+	/**
+	 * 中转etd日期
+	 */
+	@ApiModelProperty(value = "中转etd日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date potEtd;
+	/**
+	 * 中转eta日期
+	 */
+	@ApiModelProperty(value = "中转eta日期")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date potEta;
+	/**
+	 * 起运港 id
+	 */
+	@ApiModelProperty(value = "起运港 id")
+	private Long departureId;
+	/**
+	 * 起运港代码
+	 */
+	@ApiModelProperty(value = "起运港代码")
+	private String departureCode;
+	/**
+	 * 起运港英文名称
+	 */
+	@ApiModelProperty(value = "起运港英文名称")
+	private String departureCnName;
+	/**
+	 * 起运港英文名称
+	 */
+	@ApiModelProperty(value = "起运港英文名称")
+	private String departureEnName;
+	/**
+	 * 起运地 id
+	 */
+	@ApiModelProperty(value = "起运地 id")
+	private Long departureAddrId;
+	/**
+	 * 起运地代码
+	 */
+	@ApiModelProperty(value = "起运地代码")
+	private String departureAddrCode;
+	/**
+	 * 起运地中文名称
+	 */
+	@ApiModelProperty(value = "起运地中文名称")
+	private String departureAddrCnName;
+	/**
+	 * 起运地英文名称
+	 */
+	@ApiModelProperty(value = "起运地英文名称")
+	private String departureAddrEnName;
+	/**
+	 * 签发日期
+	 */
+	@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 issueDate;
+	/**
+	 * 签发地点
+	 */
+	@ApiModelProperty(value = "签发地点")
+	private String issueAt;
+	/**
+	 * 签发地点id
+	 */
+	@ApiModelProperty(value = "签发地点id")
+	private Long issueAtId;
+	/**
+	 * 运输条款
+	 */
+	@ApiModelProperty(value = "运输条款")
+	private String serviceTerms;
+	/**
+	 * 运输类型
+	 */
+	@ApiModelProperty(value = "运输类型")
+	private String transportType;
+	/**
+	 * HB/L 付款方式 PP=预付, CC=到付, FPA, Other
+	 */
+	@ApiModelProperty(value = "HB/L 付款方式 PP=预付, CC=到付, FPA, Other")
+	private String hPaymode;
+	/**
+	 * HB/L 付款地点
+	 */
+	@ApiModelProperty(value = "HB/L 付款地点")
+	private String hPayplace;
+	/**
+	 * HB/L 发货人 id
+	 */
+	@ApiModelProperty(value = "HB/L 发货人 id")
+	private Long hShipperId;
+	/**
+	 * HB/L 发货人代码
+	 */
+	@ApiModelProperty(value = "HB/L 发货人代码")
+	private String hShipperCode;
+	/**
+	 * HB/L 发货人中文名称
+	 */
+	@ApiModelProperty(value = "HB/L 发货人中文名称")
+	private String hShipperCnName;
+	/**
+	 * HB/L 发货人英文名称
+	 */
+	@ApiModelProperty(value = "HB/L 发货人英文名称")
+	private String hShipperEnName;
+	/**
+	 * HB/L 发货人提单描述
+	 */
+	@ApiModelProperty(value = "HB/L 发货人提单描述")
+	private String hShipperDetails;
+	/**
+	 * HB/L 收货人 id
+	 */
+	@ApiModelProperty(value = "HB/L 收货人 id")
+	@TableField("h_Consignee_id")
+	private Long hConsigneeId;
+	/**
+	 * HB/L 收货人代码
+	 */
+	@ApiModelProperty(value = "HB/L 收货人代码")
+	@TableField("h_Consignee_code")
+	private String hConsigneeCode;
+	/**
+	 * HB/L 收货人中文名称
+	 */
+	@ApiModelProperty(value = "HB/L 收货人中文名称")
+	@TableField("h_Consignee_cn_name")
+	private String hConsigneeCnName;
+	/**
+	 * HB/L 收货人英文名称
+	 */
+	@ApiModelProperty(value = "HB/L 收货人英文名称")
+	@TableField("h_Consignee_en_name")
+	private String hConsigneeEnName;
+	/**
+	 * HB/L 收货人提单描述
+	 */
+	@ApiModelProperty(value = "HB/L 收货人提单描述")
+	@TableField("h_Consignee_details")
+	private String hConsigneeDetails;
+	/**
+	 * HB/L 通知人 id
+	 */
+	@ApiModelProperty(value = "HB/L 通知人 id")
+	private Long hNotifyId;
+	/**
+	 * HB/L 通知人代码
+	 */
+	@ApiModelProperty(value = "HB/L 通知人代码")
+	private String hNotifyCode;
+	/**
+	 * HB/L 通知人中文名称
+	 */
+	@ApiModelProperty(value = "HB/L 通知人中文名称")
+	private String hNotifyCnName;
+	/**
+	 * HB/L 通知人英文名称
+	 */
+	@ApiModelProperty(value = "HB/L 通知人英文名称")
+	private String hNotifyEnName;
+	/**
+	 * HB/L 通知人提单描述
+	 */
+	@ApiModelProperty(value = "HB/L 通知人提单描述")
+	private String hNotifyDetails;
+	/**
+	 * MB/L 付款方式 PP=预付, CC=到付, FPA, Other
+	 */
+	@ApiModelProperty(value = "MB/L 付款方式 PP=预付, CC=到付, FPA, Other")
+	private String mPaymode;
+	/**
+	 * MB/L 付款地点
+	 */
+	@ApiModelProperty(value = "MB/L 付款地点")
+	private String mPayplace;
+	/**
+	 * MB/L 发货人 id
+	 */
+	@ApiModelProperty(value = "MB/L 发货人 id")
+	private Long mShipperId;
+	/**
+	 * MB/L 发货人代码
+	 */
+	@ApiModelProperty(value = "MB/L 发货人代码")
+	private String mShipperCode;
+	/**
+	 * MB/L 发货人中文名称
+	 */
+	@ApiModelProperty(value = "MB/L 发货人中文名称")
+	private String mShipperCnName;
+	/**
+	 * MB/L 发货人英文名称
+	 */
+	@ApiModelProperty(value = "MB/L 发货人英文名称")
+	private String mShipperEnName;
+	/**
+	 * MB/L 发货人提单描述
+	 */
+	@ApiModelProperty(value = "MB/L 发货人提单描述")
+	private String mShipperDetails;
+	/**
+	 * MB/L 收货人 id
+	 */
+	@ApiModelProperty(value = "MB/L 收货人 id")
+	@TableField("m_Consignee_id")
+	private Long mConsigneeId;
+	/**
+	 * MB/L 收货人代码
+	 */
+	@ApiModelProperty(value = "MB/L 收货人代码")
+	@TableField("m_Consignee_code")
+	private String mConsigneeCode;
+	/**
+	 * MB/L 收货人中文名称
+	 */
+	@ApiModelProperty(value = "MB/L 收货人中文名称")
+	@TableField("m_Consignee_cn_name")
+	private String mConsigneeCnName;
+	/**
+	 * MB/L 收货人英文名称
+	 */
+	@ApiModelProperty(value = "MB/L 收货人英文名称")
+	@TableField("m_Consignee_en_name")
+	private String mConsigneeEnName;
+	/**
+	 * MB/L 收货人提单描述
+	 */
+	@ApiModelProperty(value = "MB/L 收货人提单描述")
+	@TableField("m_Consignee_details")
+	private String mConsigneeDetails;
+	/**
+	 * MB/L 通知人 id
+	 */
+	@ApiModelProperty(value = "MB/L 通知人 id")
+	private Long mNotifyId;
+	/**
+	 * MB/L 通知人代码
+	 */
+	@ApiModelProperty(value = "MB/L 通知人代码")
+	private String mNotifyCode;
+	/**
+	 * MB/L 通知人中文名称
+	 */
+	@ApiModelProperty(value = "MB/L 通知人中文名称")
+	private String mNotifyCnName;
+	/**
+	 * MB/L 通知人英文名称
+	 */
+	@ApiModelProperty(value = "MB/L 通知人英文名称")
+	private String mNotifyEnName;
+	/**
+	 * MB/L 通知人提单描述
+	 */
+	@ApiModelProperty(value = "MB/L 通知人提单描述")
+	private String mNotifyDetails;
+	/**
+	 * MB/L Forwarder 描述
+	 */
+	@ApiModelProperty(value = "MB/L Forwarder 描述")
+	private String mForwarderDetails;
+	/**
+	 * 商品 HS-CODE
+	 */
+	@ApiModelProperty(value = "商品 HS-CODE")
+	private String hscode;
+	/**
+	 * 商品简称
+	 */
+	@ApiModelProperty(value = "商品简称")
+	private String commodityShName;
+	/**
+	 * 商品中文名称
+	 */
+	@ApiModelProperty(value = "商品中文名称")
+	private String commodityCnName;
+	/**
+	 * 商品英文名称
+	 */
+	@ApiModelProperty(value = "商品英文名称")
+	private String commodityEnName;
+	/**
+	 * 提单上货物描述
+	 */
+	@ApiModelProperty(value = "提单上货物描述")
+	private String commodityDescr;
+	/**
+	 * 唛头
+	 */
+	@ApiModelProperty(value = "唛头")
+	private String marks;
+	/**
+	 * 包装单位 Id
+	 */
+	@ApiModelProperty(value = "包装单位 Id")
+	private Long packingUnitId;
+	/**
+	 * 包装单位
+	 */
+	@ApiModelProperty(value = "包装单位")
+	private String packingUnit;
+	/**
+	 * 件数
+	 */
+	@ApiModelProperty(value = "件数")
+	private BigDecimal quantity;
+	/**
+	 * 件数描述
+	 */
+	@ApiModelProperty(value = "件数描述")
+	private String quantityDescribe;
+	/**
+	 * 毛重 (KGM)
+	 */
+	@ApiModelProperty(value = "毛重 (KGM)")
+	private BigDecimal grossWeight;
+	/**
+	 * 体积 (CBM)
+	 */
+	@ApiModelProperty(value = "体积 (CBM)")
+	private BigDecimal measurement;
+	/**
+	 * 长度
+	 */
+	@ApiModelProperty(value = "长度")
+	private BigDecimal length;
+	/**
+	 * 宽度
+	 */
+	@ApiModelProperty(value = "宽度")
+	private BigDecimal width;
+	/**
+	 * 高度
+	 */
+	@ApiModelProperty(value = "高度")
+	private BigDecimal height;
+	/**
+	 * 货物价值
+	 */
+	@ApiModelProperty(value = "货物价值")
+	private BigDecimal goodsValue;
+	/**
+	 * 计费重里
+	 */
+	@ApiModelProperty(value = "计费重里")
+	private BigDecimal billingWeight;
+	/**
+	 * 计量单位
+	 */
+	@ApiModelProperty(value = "计量单位")
+	private String unit;
+	/**
+	 * 币别
+	 */
+	@ApiModelProperty(value = "币别")
+	private String curCode;
+	/**
+	 * 宽度
+	 */
+	@ApiModelProperty(value = "宽度")
+	private BigDecimal currency;
+	/**
+	 * 运价等级
+	 */
+	@ApiModelProperty(value = "运价等级")
+	private String freightRateGrade;
+	/**
+	 * 是否危险品
+	 */
+	@ApiModelProperty(value = "是否危险品")
+	private String cargoType;
+	/**
+	 * 危险品分类代码(IMDG CODE)
+	 */
+	@ApiModelProperty(value = "危险品分类代码(IMDG CODE)")
+	private String dgImdgCode;
+	/**
+	 * 危险品国际代码
+	 */
+	@ApiModelProperty(value = "危险品国际代码")
+	private String dgUnCode;
+	/**
+	 * 危险品包装等级
+	 */
+	@ApiModelProperty(value = "危险品包装等级")
+	private String dgPackingLevel;
+	/**
+	 * 易燃易爆品闪点
+	 */
+	@ApiModelProperty(value = "易燃易爆品闪点")
+	private Integer dgFlashPoint;
+	/**
+	 * 易燃易爆品闪点单位
+	 */
+	@ApiModelProperty(value = "易燃易爆品闪点单位")
+	private String dgFlashPointUnit;
+	/**
+	 * 危险品联系人
+	 */
+	@ApiModelProperty(value = "危险品联系人")
+	private String dgContacts;
+	/**
+	 * 危险品联系人电话
+	 */
+	@ApiModelProperty(value = "危险品联系人电话")
+	private String dgTel;
+	/**
+	 * 航站 id
+	 */
+	@ApiModelProperty(value = "航站 id")
+	private Long cyId;
+	/**
+	 * 航站代码
+	 */
+	@ApiModelProperty(value = "航站代码")
+	private String cyCode;
+	/**
+	 * 航站中文名称
+	 */
+	@ApiModelProperty(value = "航站中文名称")
+	private String cyCnName;
+	/**
+	 * 航站英文名称
+	 */
+	@ApiModelProperty(value = "航站英文名称")
+	private String cyEnName;
+	/**
+	 * 航站地址
+	 */
+	@ApiModelProperty(value = "航站地址")
+	private String cyAddress;
+	/**
+	 * 航站联系人
+	 */
+	@ApiModelProperty(value = "航站联系人")
+	private String cyContacts;
+	/**
+	 * 航站联系人电话
+	 */
+	@ApiModelProperty(value = "航站联系人电话")
+	private String cyTel;
+	/**
+	 * 航站备注
+	 */
+	@ApiModelProperty(value = "航站备注")
+	private String cyRemarks;
+	/**
+	 * 本位币应收(CNY)
+	 */
+	@ApiModelProperty(value = "本位币应收(CNY)")
+	private BigDecimal amountDr;
+	/**
+	 * 本位币应付(CNY)
+	 */
+	@ApiModelProperty(value = "本位币应付(CNY)")
+	private BigDecimal amountCr;
+	/**
+	 * 本位币利润(CNY)
+	 */
+	@ApiModelProperty(value = "本位币利润(CNY)")
+	private BigDecimal amountProfit;
+	/**
+	 * 综合 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;
+	/**
+	 * 综合 USD 利润(USD) - 非 USD 外币转换为 USD
+	 */
+	@ApiModelProperty(value = "综合 USD 利润(USD) - 非 USD 外币转换为 USD")
+	private BigDecimal amountProfitUsd;
+	/**
+	 * 合计本位币应收(CNY )
+	 */
+	@ApiModelProperty(value = "合计本位币应收(CNY )")
+	private BigDecimal amountDrLoc;
+	/**
+	 * 合计本位币应付(CNY)
+	 */
+	@ApiModelProperty(value = "合计本位币应付(CNY)")
+	private BigDecimal amountCrLoc;
+	/**
+	 * 合计本位币利润(CNY)
+	 */
+	@ApiModelProperty(value = "合计本位币利润(CNY)")
+	private BigDecimal amountProfitLoc;
+	/**
+	 * 应收对账状态 Id(0  未对账 3 部分对账 9 已对账)
+	 */
+	@ApiModelProperty(value = "应收对账状态 Id(0  未对账 3 部分对账 9 已对账)")
+	private Integer checkDrStatus;
+	/**
+	 * 应收对账状态描述(0  未对账 3 部分对账 9 已对账)
+	 */
+	@ApiModelProperty(value = "应收对账状态描述(0  未对账 3 部分对账 9 已对账)")
+	private String checkDrStatusDescr;
+	/**
+	 * 应收付账状态 Id(0  未对账 3 部分对账 9 已对账)
+	 */
+	@ApiModelProperty(value = "应收付账状态 Id(0  未对账 3 部分对账 9 已对账)")
+	private Integer checkCrStatus;
+	/**
+	 * 应付对账状态描述(0  未对账 3 部分对账 9 已对账)
+	 */
+	@ApiModelProperty(value = "应付对账状态描述(0  未对账 3 部分对账 9 已对账)")
+	private String checkCrStatusDescr;
+	/**
+	 * 应收结算状态 Id(0  未结 3 部分 9 结清)
+	 */
+	@ApiModelProperty(value = "应收结算状态 Id(0  未结 3 部分 9 结清)")
+	private Integer stlDrStatus;
+	/**
+	 * 应收结算状态描述(0  未结 3 部分 9 结清)
+	 */
+	@ApiModelProperty(value = "应收结算状态描述(0  未结 3 部分 9 结清)")
+	private String stlDrStatusDescr;
+	/**
+	 * 应付结算状态 Id(0  未结 3 部分 9 结清)
+	 */
+	@ApiModelProperty(value = "应付结算状态 Id(0  未结 3 部分 9 结清)")
+	private Integer stlCrStatus;
+	/**
+	 * 应付结算状态描述(0  未结 3 部分 9 结清)
+	 */
+	@ApiModelProperty(value = "应付结算状态描述(0  未结 3 部分 9 结清)")
+	private String stlCrStatusDescr;
+	/**
+	 * 销项发票开具状态 Id(0  未开 3 部分 9 全开)
+	 */
+	@ApiModelProperty(value = "销项发票开具状态 Id(0  未开 3 部分 9 全开)")
+	private Integer invoiceDrStatus;
+	/**
+	 * 销项发票开具状态描述(0  未开 3 部分 9 全开)
+	 */
+	@ApiModelProperty(value = "销项发票开具状态描述(0  未开 3 部分 9 全开)")
+	private String invoiceDrStatusDescr;
+	/**
+	 * 进项发票开具状态 Id(0  未开 3 部分 9 全开)
+	 */
+	@ApiModelProperty(value = "进项发票开具状态 Id(0  未开 3 部分 9 全开)")
+	private Integer invoiceCrStatus;
+	/**
+	 * 进项发票开具状态描述(0  未开 3 部分 9 全开)
+	 */
+	@ApiModelProperty(value = "进项发票开具状态描述(0  未开 3 部分 9 全开)")
+	private String invoiceCrStatusDescr;
+	/**
+	 * 状态(业务参数配置)
+	 */
+	@ApiModelProperty(value = "状态(业务参数配置)")
+	private Integer billStatus;
+	/**
+	 * 财务状态(业务参数配置)
+	 */
+	@ApiModelProperty(value = "财务状态(业务参数配置)")
+	private Integer accountStatus;
+	/**
+	 * JSON 对象数组,用于不查询的扩展数据
+	 */
+	@ApiModelProperty(value = "JSON 对象数组,用于不查询的扩展数据")
+	private String extendedData;
+	/**
+	 * 版本
+	 */
+	@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;
+	/**
+	 * SI 备注
+	 */
+	@ApiModelProperty(value = "SI 备注")
+	private String siRemarks;
+	/**
+	 * 订舱代理 id
+	 */
+	@ApiModelProperty(value = "订舱代理 id")
+	private Long bookingAgentId;
+	/**
+	 * 订舱代理中文名称
+	 */
+	@ApiModelProperty(value = "订舱代理中文名称")
+	private String bookingAgentCnName;
+	/**
+	 * 订舱代理英文名称
+	 */
+	@ApiModelProperty(value = "订舱代理英文名称")
+	private String bookingAgentEnName;
+	/**
+	 * 是否修改数据状态  0是  不等于0否
+	 */
+	@ApiModelProperty(value = "是否修改数据状态  0是  不等于0否")
+	private Integer billingStatus;
+	/**
+	 * 三检单号
+	 */
+	@ApiModelProperty(value = "三检单号")
+	private String iqNo;
+	/**
+	 * 审核日期
+	 */
+	@ApiModelProperty(value = "审核日期")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date approvedDate;
+	/**
+	 * 危险品净重
+	 */
+	@ApiModelProperty(value = "危险品净重")
+	private BigDecimal dgNetWeight;
+	/**
+	 * 危险品外包装
+	 */
+	@ApiModelProperty(value = "危险品外包装")
+	private String dgPackage;
+	/**
+	 * 危险品邮箱
+	 */
+	@ApiModelProperty(value = "危险品邮箱")
+	private String dgMailbox;
+	/**
+	 * 危险品备注
+	 */
+	@ApiModelProperty(value = "危险品备注")
+	private String dgRemarks;
+	/**
+	 * 承运人的申报价值
+	 */
+	@ApiModelProperty(value = "承运人的申报价值")
+	private String declaredCarrier;
+	/**
+	 * 海关申报价值
+	 */
+	@ApiModelProperty(value = "海关申报价值")
+	private String declsredCustoms;
+	/**
+	 * 保险金额
+	 */
+	@ApiModelProperty(value = "保险金额")
+	private BigDecimal amountOfInsursnee;
+	/**
+	 * HAKDLTHG IFORMATION
+	 */
+	@ApiModelProperty(value = "HAKDLTHG IFORMATION")
+	private String hakdlthgIformation;
+	/**
+	 * Chgs代码
+	 */
+	@ApiModelProperty(value = "Chgs代码")
+	private String chgsCode;
+	/**
+	 * 需陆运(0 否 1是)
+	 */
+	@ApiModelProperty(value = "需陆运(0 否 1是)")
+	private Integer isNeedLand;
+	/**
+	 * 需报关(0 否 1是)
+	 */
+	@ApiModelProperty(value = "需报关(0 否 1是)")
+	private Integer isNeedDeclare;
+	/**
+	 * 需三检(检疫检验, Inspection and Quarantine)(0 否 1是)
+	 */
+	@ApiModelProperty(value = "需三检(检疫检验, Inspection and Quarantine)(0 否 1是)")
+	private Integer isNeedIq;
+	/**
+	 * 需仓储(0 否 1是)
+	 */
+	@ApiModelProperty(value = "需仓储(0 否 1是)")
+	private Integer isStorage;
+	/**
+	 * 需货物跟踪(0 否 1是)
+	 */
+	@ApiModelProperty(value = "需货物跟踪(0 否 1是)")
+	private Integer isGoodsTracking;
+	/**
+	 * 综合(是否随机,合同,发票,装箱单,配额证,许可证,产地证,手册,核销单)
+	 */
+	@ApiModelProperty(value = "综合(是否随机,合同,发票,装箱单,配额证,许可证,产地证,手册,核销单)")
+	private Integer comprehensive;
+	/**
+	 * 综合其他
+	 */
+	@ApiModelProperty(value = "综合其他")
+	private Integer comprehensiveOther;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+	/**
+	 * 物流-费用中心(付)
+	 */
+	@TableField(exist = false)
+	private List<FeeCenter> feeCenterListC;
+
+	/**
+	 * 物流-费用中心(收)
+	 */
+	@TableField(exist = false)
+	private List<FeeCenter> feeCenterListD;
+
+	//跳转对应页面的路由
+	@TableField(exist = false)
+	private String url;
+	//页面枚举
+	@TableField(exist = false)
+	private String pageStatus;
+	//页面名字
+	@TableField(exist = false)
+	private String pageLabel;
+
+	/**
+	 * 编码生成code
+	 */
+	@TableField(exist = false)
+	private String billNoFormat;
+
+	/**
+	 * 业务类型表 code
+	 */
+	@TableField(exist = false)
+	private String businessTypeCode;
+
+	/**
+	 * 文件
+	 */
+	@TableField(exist = false)
+	private List<FilesCenter> filesList;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/vo/AeaBillsVO.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.business.aea.vo;
+
+import org.springblade.los.business.aea.entity.AeaBills;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 业务-空运进出口视图实体类
+ *
+ * @author BladeX
+ * @since 2024-01-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AeaBillsVO对象", description = "业务-空运进出口")
+public class AeaBillsVO extends AeaBills {
+	private static final long serialVersionUID = 1L;
+
+}

+ 212 - 186
blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/controller/TradingBoxItemController.java

@@ -209,110 +209,137 @@ public class TradingBoxItemController extends BladeController {
 				tradingBoxItem.setPid(tradingBox.getId());
 				tradingBoxItem.setStackingStatus("未堆存");
 				tradingBoxItemService.save(tradingBoxItem);
-				String updateChar = tradingBoxItem.getCode() + tradingBoxItem.getBoxType() + tradingBoxItem.getAddress() + tradingBoxItem.getNewDate() + tradingBoxItem.getStatus();
-				if (ObjectUtils.isNull(tradingBoxItem.getUpdateChar()) || !updateChar.equals(tradingBoxItem.getUpdateChar())) {
-					tradingBoxItem.setUpdateChar(updateChar);
-					tradingBoxItemService.updateById(tradingBoxItem);
-					if (ObjectUtils.isNotNull(tradingBoxItem.getCode())) {
-						//更新箱档案信息
-						Archives archivesR = archivesService.getOne(new LambdaQueryWrapper<Archives>().eq(Archives::getIsDeleted, 0)
-							.eq(Archives::getTenantId, AuthUtil.getTenantId())
-							.eq(Archives::getCode, tradingBoxItem.getCode()));
-						Archives archives = new Archives();
-						if ("卖出".equals(tradingBoxItem.getStatus())) {
-							if (ObjectUtils.isNotNull(archivesR)) {
-								if (!"待使用".equals(archivesR.getStatus())) {
-									throw new RuntimeException("集装箱" + archivesR.getCode() + "状态不等于待使用");
-								}
-							} else {
-								throw new RuntimeException("未查到集装箱" + archivesR.getCode() + "信息");
-							}
-						}
-						if (ObjectUtils.isNotNull(archivesR)) {
-							BeanUtil.copy(archivesR, archives);
-						} else {
-							archives.setCode(tradingBoxItem.getCode());
-							archives.setName(tradingBoxItem.getBoxType());
-							archives.setVolume(tradingBoxItem.getVolume());
-							archives.setGorssWeight(tradingBoxItem.getGrossWeight());
-							archives.setTypeId(tradingBoxItem.getBoxTypeId());
-							archives.setAddressId(tradingBoxItem.getAddressId());
-							archives.setAddress(tradingBoxItem.getAddress());
-							archives.setNewDate(tradingBoxItem.getNewDate());
-							archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
-							archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
-							archives.setBoxSource(tradingBoxItem.getBoxSource());
-							archives.setBoxStatus(tradingBoxItem.getBoxStatus());
-							archives.setEmptyWeight(tradingBoxItem.getEmptyWeight());
-							archives.setTare(tradingBoxItem.getTare());
-							archives.setLoadingWeight(tradingBoxItem.getLoadingWeight());
-							archives.setBoxMakingCompany(tradingBoxItem.getBoxMakingCompany());
-							archives.setBoxMakingCompanyId(tradingBoxItem.getBoxMakingCompanyId());
-							archives.setBoxMakingDate(tradingBoxItem.getBoxMakingDate());
-							archives.setLeaseCommencementDate(tradingBoxItem.getLeaseCommencementDate());
-							archives.setBoxAge(tradingBoxItem.getBoxAge());
-							archives.setPurchaseDate(tradingBox.getPurchaseDate());
-							archives.setContractNo(tradingBox.getContractNo());
-							archives.setBoxAccessStatus("");
-						}
-						archives.setStatus(tradingBoxItem.getStatus());
-						if (ObjectUtils.isNotNull(archivesR)) {
-							if ("BUY".equals(tradingBox.getType())) {
-								if (!"退租".equals(archivesR.getStatus()) && !"卖出".equals(archivesR.getStatus())) {
-									throw new RuntimeException("箱号:" + archivesR.getCode() + "已存在");
-								}
-							}
-							archives.setUpdateTime(new Date());
-							archives.setUpdateUserName(AuthUtil.getUserName());
-							archives.setUpdateUser(AuthUtil.getUserId());
-							archivesService.updateById(archives);
-						} else {
-							archives.setCreateUser(AuthUtil.getUserId());
-							archives.setCreateTime(new Date());
-							archives.setCreateUserName(AuthUtil.getUserName());
-							archives.setTenantId(AuthUtil.getTenantId());
-							archivesService.save(archives);
-							List<ArchivesFiles> archivesFilesList = BeanUtil.copy(tradingBoxItem.getTradingBoxFilesList(), ArchivesFiles.class);
-							for (ArchivesFiles archivesFiles : archivesFilesList) {
-								archivesFiles.setId(null);
-								archivesFiles.setPid(archives.getId());
-								archivesFiles.setFileName(archivesFiles.getLabel());
-								archivesFiles.setUrl(archivesFiles.getValue());
-								archivesFiles.setCreateUser(AuthUtil.getUserId());
-								archivesFiles.setCreateTime(new Date());
-								archivesFilesService.save(archivesFiles);
-							}
-						}
-						//记录箱轨迹信息
-						ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
-						if ("BUY".equals(tradingBox.getType())) {
-							archivesTrajectory.setStatus("买箱");
-						} else if ("SELL".equals(tradingBox.getType())) {
-							archivesTrajectory.setStatus("卖箱");
-						}
-						archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
-						archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
-						archivesTrajectory.setContractNo(tradingBox.getContractNo());
-						archivesTrajectory.setBillType(tradingBox.getType());
-						archivesTrajectory.setCode(tradingBoxItem.getCode());
-						archivesTrajectory.setAddress(tradingBoxItem.getAddress());
-						archivesTrajectory.setNewDate(tradingBoxItem.getNewDate());
-						archivesTrajectory.setCreateTime(new Date());
-						archivesTrajectory.setCreateUser(AuthUtil.getUserId());
-						archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
-						archivesTrajectory.setTenantId(AuthUtil.getTenantId());
-						archivesTrajectory.setSrcId(tradingBox.getId());
-						archivesTrajectoryService.save(archivesTrajectory);
-					} else {
-						throw new RuntimeException("箱号不能为空");
-					}
-				}
 			}
 		} else {
 			tradingBoxItem.setUpdateTime(new Date());
 			tradingBoxItem.setUpdateUser(AuthUtil.getUserId());
 			tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
 		}
+		String updateChar = tradingBoxItem.getCode() + tradingBoxItem.getBoxType() + tradingBoxItem.getAddress() + tradingBoxItem.getNewDate() + tradingBoxItem.getStatus();
+		if (ObjectUtils.isNull(tradingBoxItem.getUpdateChar()) || !updateChar.equals(tradingBoxItem.getUpdateChar())) {
+			tradingBoxItem.setUpdateChar(updateChar);
+			tradingBoxItemService.updateById(tradingBoxItem);
+			if (ObjectUtils.isNotNull(tradingBoxItem.getCode())) {
+				//更新箱档案信息
+				Archives archivesR = archivesService.getOne(new LambdaQueryWrapper<Archives>().eq(Archives::getIsDeleted, 0)
+					.eq(Archives::getTenantId, AuthUtil.getTenantId())
+					.eq(Archives::getCode, tradingBoxItem.getCode()));
+				Archives archives = new Archives();
+				if ("卖出".equals(tradingBoxItem.getStatus())) {
+					if (ObjectUtils.isNotNull(archivesR)) {
+						if (!"待使用".equals(archivesR.getStatus())) {
+							throw new RuntimeException("集装箱" + archivesR.getCode() + "状态不等于待使用");
+						}
+					} else {
+						throw new RuntimeException("未查到集装箱" + archivesR.getCode() + "信息");
+					}
+				}
+				archives.setCode(tradingBoxItem.getCode());
+				archives.setName(tradingBoxItem.getBoxType());
+				archives.setVolume(tradingBoxItem.getVolume());
+				archives.setGorssWeight(tradingBoxItem.getGrossWeight());
+				archives.setTypeId(tradingBoxItem.getBoxTypeId());
+				archives.setAddressId(tradingBoxItem.getAddressId());
+				archives.setAddress(tradingBoxItem.getAddress());
+				archives.setNewDate(tradingBoxItem.getNewDate());
+				archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
+				archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
+				archives.setBoxSource(tradingBoxItem.getBoxSource());
+				archives.setBoxStatus(tradingBoxItem.getBoxStatus());
+				archives.setEmptyWeight(tradingBoxItem.getEmptyWeight());
+				archives.setTare(tradingBoxItem.getTare());
+				archives.setLoadingWeight(tradingBoxItem.getLoadingWeight());
+				archives.setBoxMakingCompany(tradingBoxItem.getBoxMakingCompany());
+				archives.setBoxMakingCompanyId(tradingBoxItem.getBoxMakingCompanyId());
+				archives.setBoxMakingDate(tradingBoxItem.getBoxMakingDate());
+				archives.setLeaseCommencementDate(tradingBoxItem.getLeaseCommencementDate());
+				archives.setBoxAge(tradingBoxItem.getBoxAge());
+				archives.setPurchaseDate(tradingBox.getPurchaseDate());
+				archives.setContractNo(tradingBox.getContractNo());
+				archives.setBoxAccessStatus("");
+				/*if (ObjectUtils.isNotNull(archivesR)) {
+					BeanUtil.copy(archivesR, archives);
+					archives.setAddressId(tradingBoxItem.getAddressId());
+					archives.setAddress(tradingBoxItem.getAddress());
+					archives.setNewDate(tradingBoxItem.getNewDate());
+				} else {
+					archives.setCode(tradingBoxItem.getCode());
+					archives.setName(tradingBoxItem.getBoxType());
+					archives.setVolume(tradingBoxItem.getVolume());
+					archives.setGorssWeight(tradingBoxItem.getGrossWeight());
+					archives.setTypeId(tradingBoxItem.getBoxTypeId());
+					archives.setAddressId(tradingBoxItem.getAddressId());
+					archives.setAddress(tradingBoxItem.getAddress());
+					archives.setNewDate(tradingBoxItem.getNewDate());
+					archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
+					archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
+					archives.setBoxSource(tradingBoxItem.getBoxSource());
+					archives.setBoxStatus(tradingBoxItem.getBoxStatus());
+					archives.setEmptyWeight(tradingBoxItem.getEmptyWeight());
+					archives.setTare(tradingBoxItem.getTare());
+					archives.setLoadingWeight(tradingBoxItem.getLoadingWeight());
+					archives.setBoxMakingCompany(tradingBoxItem.getBoxMakingCompany());
+					archives.setBoxMakingCompanyId(tradingBoxItem.getBoxMakingCompanyId());
+					archives.setBoxMakingDate(tradingBoxItem.getBoxMakingDate());
+					archives.setLeaseCommencementDate(tradingBoxItem.getLeaseCommencementDate());
+					archives.setBoxAge(tradingBoxItem.getBoxAge());
+					archives.setPurchaseDate(tradingBox.getPurchaseDate());
+					archives.setContractNo(tradingBox.getContractNo());
+					archives.setBoxAccessStatus("");
+				}*/
+				archives.setStatus(tradingBoxItem.getStatus());
+				if (ObjectUtils.isNotNull(archivesR)) {
+					archives.setId(archivesR.getId());
+					if ("BUY".equals(tradingBox.getType())) {
+						if (!"退租".equals(archivesR.getStatus()) && !"卖出".equals(archivesR.getStatus())) {
+							throw new RuntimeException("箱号:" + archivesR.getCode() + "已存在");
+						}
+					}
+					archives.setUpdateTime(new Date());
+					archives.setUpdateUserName(AuthUtil.getUserName());
+					archives.setUpdateUser(AuthUtil.getUserId());
+					archivesService.updateById(archives);
+				} else {
+					archives.setCreateUser(AuthUtil.getUserId());
+					archives.setCreateTime(new Date());
+					archives.setCreateUserName(AuthUtil.getUserName());
+					archives.setTenantId(AuthUtil.getTenantId());
+					archivesService.save(archives);
+					List<ArchivesFiles> archivesFilesList = BeanUtil.copy(tradingBoxItem.getTradingBoxFilesList(), ArchivesFiles.class);
+					for (ArchivesFiles archivesFiles : archivesFilesList) {
+						archivesFiles.setId(null);
+						archivesFiles.setPid(archives.getId());
+						archivesFiles.setFileName(archivesFiles.getLabel());
+						archivesFiles.setUrl(archivesFiles.getValue());
+						archivesFiles.setCreateUser(AuthUtil.getUserId());
+						archivesFiles.setCreateTime(new Date());
+						archivesFilesService.save(archivesFiles);
+					}
+				}
+				//记录箱轨迹信息
+				ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
+				if ("BUY".equals(tradingBox.getType())) {
+					archivesTrajectory.setStatus("买箱");
+				} else if ("SELL".equals(tradingBox.getType())) {
+					archivesTrajectory.setStatus("卖箱");
+				}
+				archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
+				archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
+				archivesTrajectory.setContractNo(tradingBox.getContractNo());
+				archivesTrajectory.setBillType(tradingBox.getType());
+				archivesTrajectory.setCode(tradingBoxItem.getCode());
+				archivesTrajectory.setAddress(tradingBoxItem.getAddress());
+				archivesTrajectory.setNewDate(tradingBoxItem.getNewDate());
+				archivesTrajectory.setCreateTime(new Date());
+				archivesTrajectory.setCreateUser(AuthUtil.getUserId());
+				archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
+				archivesTrajectory.setTenantId(AuthUtil.getTenantId());
+				archivesTrajectory.setSrcId(tradingBox.getId());
+				archivesTrajectoryService.save(archivesTrajectory);
+			} else {
+				throw new RuntimeException("箱号不能为空");
+			}
+		}
 		//明细图片
 		List<TradingBoxFiles> tradingBoxItemFilesList = tradingBoxItem.getTradingBoxFilesList();
 		if (ObjectUtils.isNotNull(tradingBoxItemFilesList) && tradingBoxItemFilesList.size() > 0) {
@@ -443,101 +470,100 @@ public class TradingBoxItemController extends BladeController {
 					}
 					tradingBoxItem.setTradingBoxFilesList(tradingBoxItemFilesList);
 				}
-				String updateChar = tradingBoxItem.getCode() + tradingBoxItem.getBoxType() + tradingBoxItem.getAddress() + tradingBoxItem.getNewDate() + tradingBoxItem.getStatus();
-				if (ObjectUtils.isNull(tradingBoxItem.getUpdateChar()) || !updateChar.equals(tradingBoxItem.getUpdateChar())) {
-					tradingBoxItem.setUpdateChar(updateChar);
-					tradingBoxItemService.updateById(tradingBoxItem);
-					if (ObjectUtils.isNotNull(tradingBoxItem.getCode())) {
-						//更新箱档案信息
-						Archives archivesR = archivesService.getOne(new LambdaQueryWrapper<Archives>().eq(Archives::getIsDeleted, 0)
-							.eq(Archives::getTenantId, AuthUtil.getTenantId()).eq(Archives::getCode, tradingBoxItem.getCode()));
-						Archives archives = new Archives();
-						if (ObjectUtils.isNotNull(archivesR)) {
-							BeanUtil.copy(archivesR, archives);
-						}
-						archives.setCode(tradingBoxItem.getCode());
-						archives.setName(tradingBoxItem.getBoxType());
-						archives.setVolume(tradingBoxItem.getVolume());
-						archives.setGorssWeight(tradingBoxItem.getGrossWeight());
-						archives.setStatus(tradingBoxItem.getStatus());
-						archives.setTypeId(tradingBoxItem.getBoxTypeId());
-						archives.setAddressId(tradingBoxItem.getAddressId());
-						archives.setAddress(tradingBoxItem.getAddress());
-						archives.setNewDate(tradingBoxItem.getNewDate());
-						archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
-						archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
-						archives.setBoxSource(tradingBoxItem.getBoxSource());
-						archives.setBoxStatus(tradingBoxItem.getBoxStatus());
-						archives.setEmptyWeight(tradingBoxItem.getEmptyWeight());
-						archives.setTare(tradingBoxItem.getTare());
-						archives.setLoadingWeight(tradingBoxItem.getLoadingWeight());
-						archives.setBoxMakingCompany(tradingBoxItem.getBoxMakingCompany());
-						archives.setBoxMakingCompanyId(tradingBoxItem.getBoxMakingCompanyId());
-						archives.setBoxMakingDate(tradingBoxItem.getBoxMakingDate());
-						archives.setLeaseCommencementDate(tradingBoxItem.getLeaseCommencementDate());
-						archives.setBoxAge(tradingBoxItem.getBoxAge());
-						archives.setPurchaseDate(tradingBoxItem.getLeaseCommencementDate());
-						archives.setContractNo(tradingBox.getContractNo());
-						archives.setBoxAccessStatus("");
-						if (ObjectUtils.isNotNull(archivesR)) {
-							if ("ZR".equals(tradingBox.getType())) {
-								if (!"退租".equals(archivesR.getStatus()) && !"卖出".equals(archivesR.getStatus())) {
-									throw new RuntimeException("箱号:" + archivesR.getCode() + "已存在");
-								}
-							}
-							archives.setUpdateTime(new Date());
-							archives.setUpdateUserName(AuthUtil.getUserName());
-							archives.setUpdateUser(AuthUtil.getUserId());
-							archivesService.updateById(archives);
-
-						} else {
-							archives.setCreateUser(AuthUtil.getUserId());
-							archives.setCreateTime(new Date());
-							archives.setCreateUserName(AuthUtil.getUserName());
-							archives.setTenantId(AuthUtil.getTenantId());
-							archivesService.save(archives);
-							List<ArchivesFiles> archivesFilesList = BeanUtil.copy(tradingBoxItem.getTradingBoxFilesList(), ArchivesFiles.class);
-							for (ArchivesFiles archivesFiles : archivesFilesList) {
-								archivesFiles.setId(null);
-								archivesFiles.setPid(archives.getId());
-								archivesFiles.setFileName(archivesFiles.getLabel());
-								archivesFiles.setUrl(archivesFiles.getValue());
-								archivesFiles.setCreateUser(AuthUtil.getUserId());
-								archivesFiles.setCreateTime(new Date());
-								archivesFilesService.save(archivesFiles);
-							}
-						}
 
-						//记录箱轨迹信息
-						ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
-						if ("ZR".equals(tradingBox.getType())) {
-							archivesTrajectory.setStatus("租入");
-						} else if ("ZC".equals(tradingBox.getType())) {
-							archivesTrajectory.setStatus("租出");
-						}
-						archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
-						archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
-						archivesTrajectory.setContractNo(tradingBox.getContractNo());
-						archivesTrajectory.setBillType(tradingBox.getType());
-						archivesTrajectory.setCode(tradingBoxItem.getCode());
-						archivesTrajectory.setAddress(tradingBoxItem.getAddress());
-						archivesTrajectory.setNewDate(tradingBoxItem.getNewDate());
-						archivesTrajectory.setCreateTime(new Date());
-						archivesTrajectory.setCreateUser(AuthUtil.getUserId());
-						archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
-						archivesTrajectory.setTenantId(AuthUtil.getTenantId());
-						archivesTrajectory.setSrcId(tradingBox.getId());
-						archivesTrajectoryService.save(archivesTrajectory);
-					} else {
-						throw new RuntimeException("箱号不能为空");
-					}
-				}
 			}
 		} else {
 			tradingBoxItem.setUpdateTime(new Date());
 			tradingBoxItem.setUpdateUser(AuthUtil.getUserId());
 			tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
 		}
+		String updateChar = tradingBoxItem.getCode() + tradingBoxItem.getBoxType() + tradingBoxItem.getAddress() + tradingBoxItem.getNewDate() + tradingBoxItem.getStatus();
+		if (ObjectUtils.isNull(tradingBoxItem.getUpdateChar()) || !updateChar.equals(tradingBoxItem.getUpdateChar())) {
+			tradingBoxItem.setUpdateChar(updateChar);
+			tradingBoxItemService.updateById(tradingBoxItem);
+			if (ObjectUtils.isNotNull(tradingBoxItem.getCode())) {
+				//更新箱档案信息
+				Archives archivesR = archivesService.getOne(new LambdaQueryWrapper<Archives>().eq(Archives::getIsDeleted, 0)
+					.eq(Archives::getTenantId, AuthUtil.getTenantId()).eq(Archives::getCode, tradingBoxItem.getCode()));
+				Archives archives = new Archives();
+				archives.setCode(tradingBoxItem.getCode());
+				archives.setName(tradingBoxItem.getBoxType());
+				archives.setVolume(tradingBoxItem.getVolume());
+				archives.setGorssWeight(tradingBoxItem.getGrossWeight());
+				archives.setStatus(tradingBoxItem.getStatus());
+				archives.setTypeId(tradingBoxItem.getBoxTypeId());
+				archives.setAddressId(tradingBoxItem.getAddressId());
+				archives.setAddress(tradingBoxItem.getAddress());
+				archives.setNewDate(tradingBoxItem.getNewDate());
+				archives.setLeasingCompanyId(tradingBox.getPurchaseCompanyId());
+				archives.setLeasingCompany(tradingBox.getPurchaseCompanyName());
+				archives.setBoxSource(tradingBoxItem.getBoxSource());
+				archives.setBoxStatus(tradingBoxItem.getBoxStatus());
+				archives.setEmptyWeight(tradingBoxItem.getEmptyWeight());
+				archives.setTare(tradingBoxItem.getTare());
+				archives.setLoadingWeight(tradingBoxItem.getLoadingWeight());
+				archives.setBoxMakingCompany(tradingBoxItem.getBoxMakingCompany());
+				archives.setBoxMakingCompanyId(tradingBoxItem.getBoxMakingCompanyId());
+				archives.setBoxMakingDate(tradingBoxItem.getBoxMakingDate());
+				archives.setLeaseCommencementDate(tradingBoxItem.getLeaseCommencementDate());
+				archives.setBoxAge(tradingBoxItem.getBoxAge());
+				archives.setPurchaseDate(tradingBoxItem.getLeaseCommencementDate());
+				archives.setContractNo(tradingBox.getContractNo());
+				archives.setBoxAccessStatus("");
+				if (ObjectUtils.isNotNull(archivesR)) {
+					archives.setId(archivesR.getId());
+					if ("ZR".equals(tradingBox.getType())) {
+						if (!"退租".equals(archivesR.getStatus()) && !"卖出".equals(archivesR.getStatus())) {
+							throw new RuntimeException("箱号:" + archivesR.getCode() + "已存在");
+						}
+					}
+					archives.setUpdateTime(new Date());
+					archives.setUpdateUserName(AuthUtil.getUserName());
+					archives.setUpdateUser(AuthUtil.getUserId());
+					archivesService.updateById(archives);
+
+				} else {
+					archives.setCreateUser(AuthUtil.getUserId());
+					archives.setCreateTime(new Date());
+					archives.setCreateUserName(AuthUtil.getUserName());
+					archives.setTenantId(AuthUtil.getTenantId());
+					archivesService.save(archives);
+					List<ArchivesFiles> archivesFilesList = BeanUtil.copy(tradingBoxItem.getTradingBoxFilesList(), ArchivesFiles.class);
+					for (ArchivesFiles archivesFiles : archivesFilesList) {
+						archivesFiles.setId(null);
+						archivesFiles.setPid(archives.getId());
+						archivesFiles.setFileName(archivesFiles.getLabel());
+						archivesFiles.setUrl(archivesFiles.getValue());
+						archivesFiles.setCreateUser(AuthUtil.getUserId());
+						archivesFiles.setCreateTime(new Date());
+						archivesFilesService.save(archivesFiles);
+					}
+				}
+
+				//记录箱轨迹信息
+				ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
+				if ("ZR".equals(tradingBox.getType())) {
+					archivesTrajectory.setStatus("租入");
+				} else if ("ZC".equals(tradingBox.getType())) {
+					archivesTrajectory.setStatus("租出");
+				}
+				archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
+				archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
+				archivesTrajectory.setContractNo(tradingBox.getContractNo());
+				archivesTrajectory.setBillType(tradingBox.getType());
+				archivesTrajectory.setCode(tradingBoxItem.getCode());
+				archivesTrajectory.setAddress(tradingBoxItem.getAddress());
+				archivesTrajectory.setNewDate(tradingBoxItem.getNewDate());
+				archivesTrajectory.setCreateTime(new Date());
+				archivesTrajectory.setCreateUser(AuthUtil.getUserId());
+				archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
+				archivesTrajectory.setTenantId(AuthUtil.getTenantId());
+				archivesTrajectory.setSrcId(tradingBox.getId());
+				archivesTrajectoryService.save(archivesTrajectory);
+			} else {
+				throw new RuntimeException("箱号不能为空");
+			}
+		}
 		//明细图片
 		List<TradingBoxFiles> tradingBoxItemFilesList = tradingBoxItem.getTradingBoxFilesList();
 		if (ObjectUtils.isNotNull(tradingBoxItemFilesList) && tradingBoxItemFilesList.size() > 0) {

+ 1 - 1
blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/service/impl/ArchivesServiceImpl.java

@@ -215,7 +215,7 @@ public class ArchivesServiceImpl extends ServiceImpl<ArchivesMapper, Archives> i
 				LambdaQueryWrapper<Archives> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 				lambdaQueryWrapper.eq(Archives::getTenantId, AuthUtil.getTenantId())
 					.eq(Archives::getIsDeleted, 0)
-					.ne(Archives::getStatus, "退租")
+//					.ne(Archives::getStatus, "退租")
 					.eq(ObjectUtils.isNotNull(portDesc.getName()), Archives::getAddress, portDesc.getName());//状态
 				int count = baseMapper.selectCount(lambdaQueryWrapper);
 				addressOld.add(portDesc.getName());

+ 2 - 1
blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java

@@ -29,7 +29,8 @@ public class MagicValues {
 	public static final String D = "D";
 	public static final String C = "C";
 	public static final String ONE = "1";
-	public static final String ZERO = "0.00";
+	public static final String TWO = "2";
+	public static final String ZERO = "0";
 	public static final String MH = "MH";
 	public static final String MM = "MM";
 	public static final String DD = "DD";

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

@@ -60,6 +60,7 @@ import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Function;
@@ -1192,47 +1193,6 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 						bills.setRate(new BigDecimal(MagicValues.ZERO));
 					}
 					if (MagicValues.MM.equals(bills.getBillType()) || MagicValues.DD.equals(bills.getBillType())) {
-						BigDecimal amountDr = new BigDecimal(MagicValues.ZERO);
-						BigDecimal amountCr = new BigDecimal(MagicValues.ZERO);
-						BigDecimal amountDrUsd = new BigDecimal(MagicValues.ZERO);
-						BigDecimal amountCrUsd = new BigDecimal(MagicValues.ZERO);
-						if (amendFeeCenterList.size() > 0) {
-							amountDr = amendFeeCenterList.stream().filter(e -> MagicValues.D.equals(e.getDc()) && MagicValues.CNY.equals(e.getCurCode()))
-								.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-							amountCr = amendFeeCenterList.stream().filter(e -> MagicValues.C.equals(e.getDc()) && MagicValues.CNY.equals(e.getCurCode()))
-								.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-							amountDrUsd = amendFeeCenterList.stream().filter(e -> MagicValues.D.equals(e.getDc()) && MagicValues.USD.equals(e.getCurCode()))
-								.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-							amountCrUsd = amendFeeCenterList.stream().filter(e -> MagicValues.C.equals(e.getDc()) && MagicValues.USD.equals(e.getCurCode()))
-								.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-						}
-						bills.setAmountProfitUpdate(bills.getAmountProfit().add(amountDr.subtract(amountCr)));
-						bills.setAmountProfitUsdUpdate(bills.getAmountProfitUsd().add(amountDrUsd.subtract(amountCrUsd)));
-						BigDecimal amountDrCny = ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D);
-						BigDecimal amountCrCny = ibCurrencyService.converterCny(MagicValues.USD, amountCrUsd, MagicValues.C);
-						bills.setAmountProfitLocUpdate(bills.getAmountProfitLoc().add(amountDr.subtract(amountCr)).add(amountDrCny.subtract(amountCrCny)));
-						bills.setResponsibleParty(amends.getResponsibleParty());
-						bills.setAmountDrLoc(bills.getAmountDrLoc().add(amountDr).add(ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D)));
-						if (ObjectUtils.isNotNull(bills.getAmountProfitLocUpdate()) && ObjectUtils.isNotNull(bills.getAmountDrLoc())) {
-							if (bills.getAmountProfitLocUpdate().compareTo(new BigDecimal(MagicValues.ZERO)) == 0 ||
-								bills.getAmountDrLoc().compareTo(new BigDecimal(MagicValues.ZERO)) == 0) {
-								bills.setGrossMargin(new BigDecimal(MagicValues.ZERO));
-							} else {
-								bills.setGrossMargin(bills.getAmountProfitLocUpdate().divide(bills.getAmountDrLoc(), 4, BigDecimal.ROUND_HALF_UP));
-							}
-						} else {
-							bills.setGrossMargin(new BigDecimal(MagicValues.ZERO));
-						}
-						if (ObjectUtils.isNotNull(profitMargin)) {
-							BigDecimal margin = new BigDecimal(profitMargin).divide(new BigDecimal(MagicValues.HUNDRED), 2);
-							if (margin.compareTo(bills.getGrossMargin()) > 0) {
-								bills.setProfitMargin("Profit was low!");
-							} else {
-								bills.setProfitMargin("");
-							}
-						} else {
-							bills.setProfitMargin("");
-						}
 						List<Bills> billsList = billsService.list(new LambdaQueryWrapper<Bills>()
 							.eq(Bills::getMasterId, bills.getId())
 							.eq(Bills::getTenantId, AuthUtil.getTenantId())
@@ -1246,18 +1206,14 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									.eq(FeeCenter::getIsDeleted, 0));
 								feeCenterListMh.stream().filter(e -> ObjectUtils.isNull(e.getReportType())).forEach(e -> e.setReportType("0"));
 								for (Bills item : billsList) {
-									if (ids.contains(amends.getOrigId())) {
-										List<FeeCenter> amendFeeCenterMm = amendFeeCenterList.stream().filter(e -> e.getPid().equals(amends.getId())).collect(Collectors.toList());
-										for (FeeCenter feeCenter : amendFeeCenterMm) {
+									for (FeeCenter feeCenter : amendFeeCenterList) {
+										if (feeCenter.getPid().equals(amends.getId())) {
 											feeCenter.setReportType(MagicValues.ONE);
+										} else {
+											feeCenter.setReportType(MagicValues.TWO);
 										}
-										feeCenterListMh.addAll(amendFeeCenterMm);
-									} else {
-										List<Amends> amend = amendsList.stream().filter(e -> e.getOrigId().equals(item.getId())).collect(Collectors.toList());
-										List<Long> amendIds = amend.stream().map(Amends::getId).collect(Collectors.toList());
-										List<FeeCenter> amendFeeCenterMh = amendFeeCenterList.stream().filter(e -> amendIds.contains(e.getPid())).collect(Collectors.toList());
-										feeCenterListMh.addAll(amendFeeCenterMh);
 									}
+									feeCenterListMh.addAll(amendFeeCenterList);
 									List<FeeCenter> feeCenterList = feeCenterListMh.stream()
 										.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
 											Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode() + f.getReportType()))), ArrayList::new));
@@ -1292,6 +1248,27 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 													e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 													e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
 												.collect(Collectors.toList());
+										} else if (MagicValues.TWO.equals(fee.getReportType())) {
+											feeCenterListD = feeCenterList.stream()
+												.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+													e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+													e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+												.collect(Collectors.toList());
+											feeCenterListUsdD = feeCenterList.stream()
+												.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+													e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+													e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+												.collect(Collectors.toList());
+											feeCenterListC = feeCenterList.stream()
+												.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+													e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+													e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+												.collect(Collectors.toList());
+											feeCenterListUsdC = feeCenterList.stream()
+												.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+													e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+													e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+												.collect(Collectors.toList());
 										} else {
 											feeCenterListD = feeCenterListMh.stream()
 												.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(item.getId()) &&
@@ -1377,18 +1354,14 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							.eq(FeeCenter::getPid, bills.getId())
 							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 							.eq(FeeCenter::getIsDeleted, 0));
-						if (bills.getId().equals(amends.getOrigId())) {
-							List<FeeCenter> amendFeeCenterMm = amendFeeCenterList.stream().filter(e -> e.getPid().equals(amends.getId())).collect(Collectors.toList());
-							for (FeeCenter feeCenter : amendFeeCenterMm) {
+						for (FeeCenter feeCenter : amendFeeCenterList) {
+							if (feeCenter.getPid().equals(amends.getId())) {
 								feeCenter.setReportType(MagicValues.ONE);
+							} else {
+								feeCenter.setReportType(MagicValues.TWO);
 							}
-							feeCenterList.addAll(amendFeeCenterMm);
-						} else {
-							List<Amends> amend = amendsList.stream().filter(e -> e.getOrigId().equals(bills.getId())).collect(Collectors.toList());
-							List<Long> amendIds = amend.stream().map(Amends::getId).collect(Collectors.toList());
-							List<FeeCenter> amendFeeCenterMh = amendFeeCenterList.stream().filter(e -> amendIds.contains(e.getPid())).collect(Collectors.toList());
-							feeCenterList.addAll(amendFeeCenterMh);
 						}
+						feeCenterList.addAll(amendFeeCenterList);
 						if (feeCenterList.size() > 0) {
 							feeCenterList.stream().filter(e -> ObjectUtils.isNull(e.getReportType())).forEach(e -> e.setReportType("0"));
 							List<FeeCenter> feeCenters = feeCenterList.stream()
@@ -1399,7 +1372,6 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								FeeCenterReports feeCenterReports = new FeeCenterReports();
 								feeCenterReports.setPid(bills.getId());
 								feeCenterReports.setFeeCnName(fee.getFeeCnName());
-								feeCenterReports.setDc(fee.getDc());
 								feeCenterReports.setReportType(fee.getReportType());
 								List<FeeCenter> feeCenterListD;
 								List<FeeCenter> feeCenterListUsdD;
@@ -1426,6 +1398,27 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 											e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
 										.collect(Collectors.toList());
+								} else if (MagicValues.TWO.equals(fee.getReportType())) {
+									feeCenterListD = feeCenterList.stream()
+										.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
+									feeCenterListUsdD = feeCenterList.stream()
+										.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
+									feeCenterListC = feeCenterList.stream()
+										.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
+									feeCenterListUsdC = feeCenterList.stream()
+										.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
 								} else {
 									feeCenterListD = feeCenterList.stream()
 										.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
@@ -1448,6 +1441,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
 										.collect(Collectors.toList());
 								}
+								feeCenterReports.setDc(fee.getDc());
+
 								if (feeCenterListD.size() > 0) {
 									BCorps bCorps = bCorpsList.stream().filter(e -> e.getId().equals(fee.getCorpId())).findFirst().orElse(null);
 									if (bCorps != null && ObjectUtils.isNotNull(bCorps.getShortName())) {
@@ -1507,63 +1502,18 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							.eq(Bills::getTenantId, AuthUtil.getTenantId())
 							.eq(Bills::getIsDeleted, 0));
 						if (details != null) {
-							BigDecimal amountDr = new BigDecimal(MagicValues.ZERO);
-							BigDecimal amountCr = new BigDecimal(MagicValues.ZERO);
-							BigDecimal amountDrUsd = new BigDecimal(MagicValues.ZERO);
-							BigDecimal amountCrUsd = new BigDecimal(MagicValues.ZERO);
-							if (amendFeeCenterList.size() > 0) {
-								amountDr = amendFeeCenterList.stream().filter(e -> MagicValues.D.equals(e.getDc()) && MagicValues.CNY.equals(e.getCurCode()))
-									.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-								amountCr = amendFeeCenterList.stream().filter(e -> MagicValues.C.equals(e.getDc()) && MagicValues.CNY.equals(e.getCurCode()))
-									.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-								amountDrUsd = amendFeeCenterList.stream().filter(e -> MagicValues.D.equals(e.getDc()) && MagicValues.USD.equals(e.getCurCode()))
-									.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-								amountCrUsd = amendFeeCenterList.stream().filter(e -> MagicValues.C.equals(e.getDc()) && MagicValues.USD.equals(e.getCurCode()))
-									.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-							}
-							details.setAmountProfitUpdate(details.getAmountProfit().add(amountDr.subtract(amountCr)));
-							details.setAmountProfitUsdUpdate(details.getAmountProfitUsd().add(amountDrUsd.subtract(amountCrUsd)));
-							BigDecimal amountDrCny = ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D);
-							BigDecimal amountCrCny = ibCurrencyService.converterCny(MagicValues.USD, amountCrUsd, MagicValues.C);
-							details.setAmountProfitLocUpdate(details.getAmountProfitLoc().add(amountDr.subtract(amountCr)).add(amountDrCny.subtract(amountCrCny)));
-							details.setResponsibleParty(amends.getResponsibleParty());
-							details.setAmountDrLoc(details.getAmountDrLoc().add(amountDr).add(ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D)));
-							if (ObjectUtils.isNotNull(details.getAmountProfitLocUpdate()) && ObjectUtils.isNotNull(details.getAmountDrLoc())) {
-								if (details.getAmountProfitLocUpdate().compareTo(new BigDecimal(MagicValues.ZERO)) == 0 ||
-									details.getAmountDrLoc().compareTo(new BigDecimal(MagicValues.ZERO)) == 0) {
-									details.setGrossMargin(new BigDecimal(MagicValues.ZERO));
-								} else {
-									details.setGrossMargin(details.getAmountProfitLocUpdate().divide(details.getAmountDrLoc(), 4, BigDecimal.ROUND_HALF_UP));
-								}
-							} else {
-								details.setGrossMargin(new BigDecimal(MagicValues.ZERO));
-							}
-							if (ObjectUtils.isNotNull(profitMargin)) {
-								BigDecimal margin = new BigDecimal(profitMargin).divide(new BigDecimal(MagicValues.HUNDRED), 2);
-								if (margin.compareTo(details.getGrossMargin()) > 0) {
-									details.setProfitMargin("Profit was low!");
-								} else {
-									details.setProfitMargin("");
-								}
-							} else {
-								details.setProfitMargin("");
-							}
 							List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 								.eq(FeeCenter::getPid, bills.getId())
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 								.eq(FeeCenter::getIsDeleted, 0));
-							if (bills.getId().equals(amends.getOrigId())) {
-								List<FeeCenter> amendFeeCenterMm = amendFeeCenterList.stream().filter(e -> e.getPid().equals(amends.getId())).collect(Collectors.toList());
-								for (FeeCenter feeCenter : amendFeeCenterMm) {
+							for (FeeCenter feeCenter : amendFeeCenterList) {
+								if (feeCenter.getPid().equals(amends.getId())) {
 									feeCenter.setReportType(MagicValues.ONE);
+								} else {
+									feeCenter.setReportType(MagicValues.TWO);
 								}
-								feeCenterList.addAll(amendFeeCenterMm);
-							} else {
-								List<Amends> amend = amendsList.stream().filter(e -> e.getOrigId().equals(bills.getId())).collect(Collectors.toList());
-								List<Long> amendIds = amend.stream().map(Amends::getId).collect(Collectors.toList());
-								List<FeeCenter> amendFeeCenterMh = amendFeeCenterList.stream().filter(e -> amendIds.contains(e.getPid())).collect(Collectors.toList());
-								feeCenterList.addAll(amendFeeCenterMh);
 							}
+							feeCenterList.addAll(amendFeeCenterList);
 							if (feeCenterList.size() > 0) {
 								feeCenterList.stream().filter(e -> ObjectUtils.isNull(e.getReportType())).forEach(e -> e.setReportType("0"));
 								List<FeeCenter> feeCenters = feeCenterList.stream()
@@ -1601,6 +1551,27 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 												e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 												e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
 											.collect(Collectors.toList());
+									} else if (MagicValues.TWO.equals(fee.getReportType())) {
+										feeCenterListD = feeCenterList.stream()
+											.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+												e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+												e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+											.collect(Collectors.toList());
+										feeCenterListUsdD = feeCenterList.stream()
+											.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+												e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+												e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+											.collect(Collectors.toList());
+										feeCenterListC = feeCenterList.stream()
+											.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+												e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+												e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+											.collect(Collectors.toList());
+										feeCenterListUsdC = feeCenterList.stream()
+											.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(bills.getId()) &&
+												e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+												e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+											.collect(Collectors.toList());
 									} else {
 										feeCenterListD = feeCenterList.stream()
 											.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(bills.getId()) &&
@@ -1685,18 +1656,14 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 								.eq(FeeCenter::getIsDeleted, 0));
 							feeCenterListMh.stream().filter(e -> ObjectUtils.isNull(e.getReportType())).forEach(e -> e.setReportType("0"));
-							if (details.getId().equals(amends.getOrigId())) {
-								List<FeeCenter> amendFeeCenterMm = amendFeeCenterList.stream().filter(e -> e.getPid().equals(amends.getId())).collect(Collectors.toList());
-								for (FeeCenter feeCenter : amendFeeCenterMm) {
+							for (FeeCenter feeCenter : amendFeeCenterList) {
+								if (feeCenter.getPid().equals(amends.getId())) {
 									feeCenter.setReportType(MagicValues.ONE);
+								} else {
+									feeCenter.setReportType(MagicValues.TWO);
 								}
-								feeCenterListMh.addAll(amendFeeCenterMm);
-							} else {
-								List<Amends> amend = amendsList.stream().filter(e -> e.getOrigId().equals(details.getId())).collect(Collectors.toList());
-								List<Long> amendIds = amend.stream().map(Amends::getId).collect(Collectors.toList());
-								List<FeeCenter> amendFeeCenterMh = amendFeeCenterList.stream().filter(e -> amendIds.contains(e.getPid())).collect(Collectors.toList());
-								feeCenterListMh.addAll(amendFeeCenterMh);
 							}
+							feeCenterListMh.addAll(amendFeeCenterList);
 							List<FeeCenter> feeCenterList1 = feeCenterListMh.stream()
 								.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
 									Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode() + f.getReportType()))), ArrayList::new));
@@ -1732,6 +1699,27 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 											e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
 											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
 										.collect(Collectors.toList());
+								} else if (MagicValues.TWO.equals(fee.getReportType())) {
+									feeCenterListD = feeCenterList.stream()
+										.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(details.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
+									feeCenterListUsdD = feeCenterList.stream()
+										.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(details.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
+									feeCenterListC = feeCenterList.stream()
+										.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(details.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.CNY.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
+									feeCenterListUsdC = feeCenterList.stream()
+										.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(details.getId()) &&
+											e.getFeeId().equals(fee.getFeeId()) && MagicValues.USD.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+											e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+										.collect(Collectors.toList());
 								} else {
 									feeCenterListD = feeCenterListMh.stream()
 										.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(details.getId()) &&
@@ -1815,17 +1803,29 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					if (list.size() > 0) {
 						for (Bills item : list) {
 							List<FeeCenterReports> feeCenterReports = new ArrayList<>();
-							List<FeeCenterReports> feeCenterReportsList = item.getFeeCenterList().stream().filter(e -> !MagicValues.ONE.equals(e.getReportType())).collect(Collectors.toList());
+							List<FeeCenterReports> feeCenterReportsList = item.getFeeCenterList().stream().filter(e -> !MagicValues.ONE.equals(e.getReportType()) && !MagicValues.TWO.equals(e.getReportType())).collect(Collectors.toList());
 							List<FeeCenterReports> feeCenterReportsList1 = item.getFeeCenterList().stream().filter(e -> MagicValues.ONE.equals(e.getReportType())).collect(Collectors.toList());
+							List<FeeCenterReports> feeCenterReportsList2 = item.getFeeCenterList().stream().filter(e -> MagicValues.TWO.equals(e.getReportType())).collect(Collectors.toList());
 							List<FeeCenterReports> feeCenters = feeCenterReportsList.stream()
 								.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
 									Comparator.comparing(FeeCenterReports::getFeeCnName))), ArrayList::new));
+							List<FeeCenterReports> feeCenters1 = feeCenterReportsList1.stream()
+								.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+									Comparator.comparing(FeeCenterReports::getFeeCnName))), ArrayList::new));
+							List<FeeCenterReports> feeCenters2 = feeCenterReportsList2.stream()
+								.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+									Comparator.comparing(FeeCenterReports::getFeeCnName))), ArrayList::new));
+							BigDecimal amountDr = new BigDecimal("0.00");
+							BigDecimal amountCr = new BigDecimal("0.00");
+							BigDecimal amountDrUsd = new BigDecimal("0.00");
+							BigDecimal amountCrUsd = new BigDecimal("0.00");
+							BigDecimal amountDrUpdate = new BigDecimal("0.00");
+							BigDecimal amountCrUpdate = new BigDecimal("0.00");
+							BigDecimal amountDrUsdUpdate = new BigDecimal("0.00");
+							BigDecimal amountCrUsdUpdate = new BigDecimal("0.00");
 							for (FeeCenterReports fee : feeCenters) {
-								FeeCenterReports feeCenterReportsD = item.getFeeCenterList().stream()
-									.filter(e -> e.getFeeCnName().equals(fee.getFeeCnName()) && MagicValues.D.equals(e.getDc()))
-									.findFirst().orElse(null);
-								FeeCenterReports feeCenterReportsC = item.getFeeCenterList().stream()
-									.filter(e -> e.getFeeCnName().equals(fee.getFeeCnName()) && MagicValues.C.equals(e.getDc()))
+								FeeCenterReports feeReports = item.getFeeCenterList().stream()
+									.filter(e -> e.getFeeCnName().equals(fee.getFeeCnName()))
 									.findFirst().orElse(null);
 								FeeCenterReports feeCenterReports1 = new FeeCenterReports();
 								feeCenterReports1.setFeeCnName(fee.getFeeCnName());
@@ -1833,41 +1833,139 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								feeCenterReports1.setPid(fee.getPid());
 								feeCenterReports1.setReportType(fee.getReportType());
 								feeCenterReports1.setDc(fee.getDc());
-								if (feeCenterReportsD != null) {
-									feeCenterReports1.setBillCorpCnName(feeCenterReportsD.getBillCorpCnName());
-									feeCenterReports1.setAmountD(feeCenterReportsD.getAmountD());
-									feeCenterReports1.setAmountLocD(feeCenterReportsD.getAmountLocD());
-									feeCenterReports1.setAmountUsdD(feeCenterReportsD.getAmountUsdD());
-								}
-								if (feeCenterReportsC != null) {
-									feeCenterReports1.setCorpCnName(feeCenterReportsC.getCorpCnName());
-									feeCenterReports1.setAmountC(feeCenterReportsC.getAmountC());
-									feeCenterReports1.setAmountLocC(feeCenterReportsC.getAmountLocC());
-									feeCenterReports1.setAmountUsdC(feeCenterReportsC.getAmountUsdC());
+								if (feeReports != null) {
+									if ((ObjectUtils.isNotNull(feeReports.getAmountD()) && feeReports.getAmountD().compareTo(new BigDecimal("0.00")) != 0)
+										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdD()) && feeReports.getAmountUsdD().compareTo(new BigDecimal("0.00")) != 0)
+									) {
+										feeCenterReports1.setBillCorpCnName(feeReports.getBillCorpCnName());
+										feeCenterReports1.setAmountD(feeReports.getAmountD());
+										feeCenterReports1.setAmountLocD(feeReports.getAmountLocD());
+										feeCenterReports1.setAmountUsdD(feeReports.getAmountUsdD());
+										amountDr = amountDr.add(ObjectUtils.isNotNull(feeReports.getAmountD()) ? feeReports.getAmountD() : new BigDecimal("0.00"));
+										amountDrUsd = amountDrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdD()) ? feeReports.getAmountUsdD() : new BigDecimal("0.00"));
+									}
+									if ((ObjectUtils.isNotNull(feeReports.getAmountC()) && feeReports.getAmountC().compareTo(new BigDecimal("0.00")) != 0)
+										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdC()) && feeReports.getAmountUsdC().compareTo(new BigDecimal("0.00")) != 0)
+									) {
+										feeCenterReports1.setCorpCnName(feeReports.getCorpCnName());
+										feeCenterReports1.setAmountC(feeReports.getAmountC());
+										feeCenterReports1.setAmountLocC(feeReports.getAmountLocC());
+										feeCenterReports1.setAmountUsdC(feeReports.getAmountUsdC());
+										amountCr = amountCr.add(ObjectUtils.isNotNull(feeReports.getAmountC()) ? feeReports.getAmountC() : new BigDecimal("0.00"));
+										amountCrUsd = amountCrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdC()) ? feeReports.getAmountUsdC() : new BigDecimal("0.00"));
+									}
 								}
 								feeCenterReports.add(feeCenterReports1);
 							}
-							for (FeeCenterReports fee : feeCenterReportsList1) {
+							for (FeeCenterReports fee : feeCenters2) {
+								FeeCenterReports feeReports = feeCenterReportsList2.stream()
+									.filter(e -> e.getFeeCnName().equals(fee.getFeeCnName()))
+									.findFirst().orElse(null);
 								FeeCenterReports feeCenterReports1 = new FeeCenterReports();
 								feeCenterReports1.setFeeCnName(fee.getFeeCnName());
 								feeCenterReports1.setHblno(fee.getHblno());
 								feeCenterReports1.setPid(fee.getPid());
 								feeCenterReports1.setReportType(fee.getReportType());
 								feeCenterReports1.setDc(fee.getDc());
-								if (MagicValues.D.equals(fee.getDc())) {
-									feeCenterReports1.setBillCorpCnName(fee.getBillCorpCnName());
-									feeCenterReports1.setAmountD(fee.getAmountD());
-									feeCenterReports1.setAmountLocD(fee.getAmountLocD());
-									feeCenterReports1.setAmountUsdD(fee.getAmountUsdD());
+								if (feeReports != null) {
+									if ((ObjectUtils.isNotNull(feeReports.getAmountD()) && feeReports.getAmountD().compareTo(new BigDecimal("0.00")) != 0)
+										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdD()) && feeReports.getAmountUsdD().compareTo(new BigDecimal("0.00")) != 0)
+									) {
+										feeCenterReports1.setBillCorpCnName(feeReports.getBillCorpCnName());
+										feeCenterReports1.setAmountD(feeReports.getAmountD());
+										feeCenterReports1.setAmountLocD(feeReports.getAmountLocD());
+										feeCenterReports1.setAmountUsdD(feeReports.getAmountUsdD());
+										amountDr = amountDr.add(ObjectUtils.isNotNull(feeReports.getAmountD()) ? feeReports.getAmountD() : new BigDecimal("0.00"));
+										amountDrUsd = amountDrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdD()) ? feeReports.getAmountUsdD() : new BigDecimal("0.00"));
+									}
+									if ((ObjectUtils.isNotNull(feeReports.getAmountC()) && feeReports.getAmountC().compareTo(new BigDecimal("0.00")) != 0)
+										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdC()) && feeReports.getAmountUsdC().compareTo(new BigDecimal("0.00")) != 0)
+									) {
+										feeCenterReports1.setCorpCnName(feeReports.getCorpCnName());
+										feeCenterReports1.setAmountC(feeReports.getAmountC());
+										feeCenterReports1.setAmountLocC(feeReports.getAmountLocC());
+										feeCenterReports1.setAmountUsdC(feeReports.getAmountUsdC());
+										amountCr = amountCr.add(ObjectUtils.isNotNull(feeReports.getAmountC()) ? feeReports.getAmountC() : new BigDecimal("0.00"));
+										amountCrUsd = amountCrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdC()) ? feeReports.getAmountUsdC() : new BigDecimal("0.00"));
+									}
 								}
-								if (MagicValues.C.equals(fee.getDc())) {
-									feeCenterReports1.setCorpCnName(fee.getCorpCnName());
-									feeCenterReports1.setAmountC(fee.getAmountC());
-									feeCenterReports1.setAmountLocC(fee.getAmountLocC());
-									feeCenterReports1.setAmountUsdC(fee.getAmountUsdC());
+								feeCenterReports.add(feeCenterReports1);
+							}
+							item.setAmountProfit(amountDr.subtract(amountCr));
+							item.setAmountProfitUsd(amountDrUsd.subtract(amountCrUsd));
+							BigDecimal amountDrCny = ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D);
+							BigDecimal amountCrCny = ibCurrencyService.converterCny(MagicValues.USD, amountCrUsd, MagicValues.C);
+							item.setAmountProfitLoc(amountDr.subtract(amountCr).add(amountDrCny.subtract(amountCrCny)));
+							for (FeeCenterReports fee : feeCenters1) {
+								FeeCenterReports feeReports = feeCenterReportsList1.stream()
+									.filter(e -> e.getFeeCnName().equals(fee.getFeeCnName()))
+									.findFirst().orElse(null);
+								FeeCenterReports feeCenterReports1 = new FeeCenterReports();
+								feeCenterReports1.setFeeCnName(fee.getFeeCnName());
+								feeCenterReports1.setHblno(fee.getHblno());
+								feeCenterReports1.setPid(fee.getPid());
+								feeCenterReports1.setReportType(fee.getReportType());
+								feeCenterReports1.setDc(fee.getDc());
+								if (feeReports != null) {
+									if ((ObjectUtils.isNotNull(feeReports.getAmountD()) && feeReports.getAmountD().compareTo(new BigDecimal("0.00")) != 0)
+										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdD()) && feeReports.getAmountUsdD().compareTo(new BigDecimal("0.00")) != 0)
+									) {
+										feeCenterReports1.setBillCorpCnName(feeReports.getBillCorpCnName());
+										feeCenterReports1.setAmountD(feeReports.getAmountD());
+										feeCenterReports1.setAmountLocD(feeReports.getAmountLocD());
+										feeCenterReports1.setAmountUsdD(feeReports.getAmountUsdD());
+										amountDr = amountDr.add(ObjectUtils.isNotNull(feeReports.getAmountD()) ? feeReports.getAmountD() : new BigDecimal("0.00"));
+										amountDrUsd = amountDrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdD()) ? feeReports.getAmountUsdD() : new BigDecimal("0.00"));
+									}
+
+									if ((ObjectUtils.isNotNull(feeReports.getAmountC()) && feeReports.getAmountC().compareTo(new BigDecimal("0.00")) != 0)
+										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdC()) && feeReports.getAmountUsdC().compareTo(new BigDecimal("0.00")) != 0)
+									) {
+										feeCenterReports1.setCorpCnName(feeReports.getCorpCnName());
+										feeCenterReports1.setAmountC(feeReports.getAmountC());
+										feeCenterReports1.setAmountLocC(feeReports.getAmountLocC());
+										feeCenterReports1.setAmountUsdC(feeReports.getAmountUsdC());
+										amountCr = amountCr.add(ObjectUtils.isNotNull(feeReports.getAmountC()) ? feeReports.getAmountC() : new BigDecimal("0.00"));
+										amountCrUsd = amountCrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdC()) ? feeReports.getAmountUsdC() : new BigDecimal("0.00"));
+									}
 								}
 								feeCenterReports.add(feeCenterReports1);
 							}
+
+							item.setAmountDr(amountDr);
+							item.setAmountCr(amountCr);
+							item.setAmountDrUsd(amountDrUsd);
+							item.setAmountDrUsd(amountCrUsd);
+							item.setAmountDrLoc(amountDr.add(ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D)));
+							item.setAmountCrLoc(amountCr.add(ibCurrencyService.converterCny(MagicValues.USD, amountCrUsd, MagicValues.C)));
+							item.setAmountProfitUpdate(amountDr.subtract(amountCr));
+							item.setAmountProfitUsdUpdate(amountDrUsd.subtract(amountCrUsd));
+							BigDecimal amountDrCnyUpdate = ibCurrencyService.converterCny(MagicValues.USD, amountDrUsd, MagicValues.D);
+							BigDecimal amountCrCnyUpdate = ibCurrencyService.converterCny(MagicValues.USD, amountCrUsd, MagicValues.C);
+							item.setAmountProfitLocUpdate(amountDr.subtract(amountCr).add(amountDrCnyUpdate.subtract(amountCrCnyUpdate)));
+							item.setAmountProfitLocUpdate(item.getAmountProfitLocUpdate().setScale(2,BigDecimal.ROUND_HALF_UP));
+							item.setAmountProfitLoc(item.getAmountProfitLoc().setScale(2,BigDecimal.ROUND_HALF_UP));
+							item.setResponsibleParty(amends.getResponsibleParty());
+							if (ObjectUtils.isNotNull(item.getAmountProfitLocUpdate()) && ObjectUtils.isNotNull(item.getAmountDrLoc())) {
+								if (item.getAmountProfitLocUpdate().compareTo(new BigDecimal(MagicValues.ZERO)) == 0 ||
+									item.getAmountDrLoc().compareTo(new BigDecimal(MagicValues.ZERO)) == 0) {
+									item.setGrossMargin(new BigDecimal(MagicValues.ZERO));
+								} else {
+									item.setGrossMargin(item.getAmountProfitLocUpdate().divide(item.getAmountDrLoc(), 4, BigDecimal.ROUND_HALF_UP));
+								}
+							} else {
+								item.setGrossMargin(new BigDecimal(MagicValues.ZERO));
+							}
+							if (ObjectUtils.isNotNull(profitMargin)) {
+								BigDecimal margin = new BigDecimal(profitMargin).divide(new BigDecimal(MagicValues.HUNDRED), 2, RoundingMode.HALF_UP);
+								if (margin.compareTo(item.getGrossMargin()) > 0) {
+									item.setProfitMargin("Profit was low!");
+								} else {
+									item.setProfitMargin("");
+								}
+							} else {
+								item.setProfitMargin("");
+							}
 							item.setFeeCenterList(feeCenterReports);
 						}
 					}

+ 237 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/controller/AeaBillsController.java

@@ -0,0 +1,237 @@
+/*
+ *      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.business.aea.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+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.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.business.aea.entity.AeaBills;
+import org.springblade.los.business.aea.vo.AeaBillsVO;
+import org.springblade.los.business.aea.service.IAeaBillsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ * 业务-空运进出口 控制器
+ *
+ * @author BladeX
+ * @since 2024-01-19
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/aeabills")
+@Api(value = "业务-空运进出口", tags = "业务-空运进出口接口")
+public class AeaBillsController extends BladeController {
+
+	private final IAeaBillsService aeaBillsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入aeaBills")
+	public R<AeaBills> detail(AeaBills aeaBills) {
+		AeaBills detail = aeaBillsService.detail(aeaBills);
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务-空运进出口
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入aeaBills")
+	public R<IPage<AeaBills>> list(AeaBills aeaBills, Query query) {
+		LambdaQueryWrapper<AeaBills> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.select(AeaBills::getId, AeaBills::getBillNo, AeaBills::getBillType, AeaBills::getMasterBillNo,
+			AeaBills::getCorpCnName, AeaBills::getCorpId, AeaBills::getCorpEnName, AeaBills::getCarrierCnName,
+			AeaBills::getCarrierId, AeaBills::getVoyageNo, AeaBills::getMblno, AeaBills::getHblno, AeaBills::getEta, AeaBills::getEtd,
+			AeaBills::getDepartureId, AeaBills::getDepartureCnName, AeaBills::getDestinationId, AeaBills::getDestinationName,
+			AeaBills::getCargoType, AeaBills::getMarks, AeaBills::getQuantity, AeaBills::getGrossWeight,
+			AeaBills::getMeasurement, AeaBills::getIsNeedLand, AeaBills::getIsNeedDeclare, AeaBills::getIsNeedIq, AeaBills::getAmountDr,
+			AeaBills::getAmountCr, AeaBills::getAmountProfit, AeaBills::getAmountDrUsd, AeaBills::getAmountCrUsd, AeaBills::getAmountProfitUsd,
+			AeaBills::getAmountDrLoc, AeaBills::getAmountCrLoc, AeaBills::getAmountProfitLoc, AeaBills::getCheckCrStatusDescr, AeaBills::getCheckDrStatusDescr,
+			AeaBills::getStlCrStatusDescr, AeaBills::getStlDrStatusDescr, AeaBills::getInvoiceCrStatusDescr, AeaBills::getInvoiceDrStatusDescr, AeaBills::getCreateUserName,
+			AeaBills::getCreateTime, AeaBills::getUpdateUserName, AeaBills::getUpdateTime, AeaBills::getStatus, AeaBills::getBillStatus,
+			AeaBills::getAccountStatus, AeaBills::getRemarks, AeaBills::getPackingUnit, AeaBills::getBillDate);
+		lambdaQueryWrapper.eq(AeaBills::getIsDeleted, 0)
+			.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
+			.and(i -> i.isNull(AeaBills::getMasterId).or()
+				.eq(AeaBills::getMasterId, 0))
+			.like(ObjectUtils.isNotNull(aeaBills.getBillNo()), AeaBills::getBillNo, aeaBills.getBillNo())
+			.like(ObjectUtils.isNotNull(aeaBills.getMblno()), AeaBills::getMblno, aeaBills.getMblno())
+			.like(ObjectUtils.isNotNull(aeaBills.getHblno()), AeaBills::getHblno, aeaBills.getHblno())
+			.like(ObjectUtils.isNotNull(aeaBills.getVoyageNo()), AeaBills::getVoyageNo, aeaBills.getVoyageNo())
+			.and(ObjectUtils.isNotNull(aeaBills.getCorpCnName()), i -> i.like(AeaBills::getCorpCnName, aeaBills.getCorpCnName()).or()
+				.like(AeaBills::getCorpEnName, aeaBills.getCorpCnName()))
+			.and(ObjectUtils.isNotNull(aeaBills.getCarrierCnName()), i -> i.like(AeaBills::getCarrierCnName, aeaBills.getCarrierCnName()).or()
+				.like(AeaBills::getCarrierEnName, aeaBills.getCarrierCnName()))
+			.and(ObjectUtils.isNotNull(aeaBills.getCyCode()), i -> i.like(AeaBills::getCyCode, aeaBills.getCyCode()).or()
+				.like(AeaBills::getCyCnName, aeaBills.getCyCode()).or().like(AeaBills::getCyEnName, aeaBills.getCyCode()))
+			.eq(ObjectUtils.isNotNull(aeaBills.getSrcType()), AeaBills::getSrcType, aeaBills.getSrcType())
+			.and(ObjectUtils.isNotNull(aeaBills.getSrcCnName()), i -> i.like(AeaBills::getSrcCnName, aeaBills.getSrcCnName()).or()
+				.like(AeaBills::getSrcEnName, aeaBills.getSrcCnName()))
+			.apply(ObjectUtils.isNotNull(aeaBills.getCreateDeptName()), "find_in_set('" + aeaBills.getCreateDeptName() + "',create_dept_name)");
+		if (ObjectUtils.isNotNull(aeaBills.getEtdList()) && aeaBills.getEtdList().size() > 0) {
+			lambdaQueryWrapper.ge(AeaBills::getEtd, aeaBills.getEtdList().get(0));
+			lambdaQueryWrapper.le(AeaBills::getEtd, aeaBills.getEtdList().get(1));
+		}
+		if (ObjectUtils.isNotNull(aeaBills.getEtaList()) && aeaBills.getEtaList().size() > 0) {
+			lambdaQueryWrapper.ge(AeaBills::getEta, aeaBills.getEtaList().get(0));
+			lambdaQueryWrapper.le(AeaBills::getEta, aeaBills.getEtaList().get(1));
+		}
+		lambdaQueryWrapper.and(ObjectUtils.isNotNull(aeaBills.getBookingAgentCnName()), i -> i.like(AeaBills::getBookingAgentCnName, aeaBills.getBookingAgentCnName()).or()
+			.like(AeaBills::getBookingAgentEnName, aeaBills.getBookingAgentCnName()))
+			.eq(ObjectUtils.isNotNull(aeaBills.getBillType()), AeaBills::getBillType, aeaBills.getBillType())
+			.eq(ObjectUtils.isNotNull(aeaBills.getBusinessType()), AeaBills::getBusinessType, aeaBills.getBusinessType())
+			.eq(ObjectUtils.isNotNull(aeaBills.getSeaType()), AeaBills::getSeaType, aeaBills.getSeaType())
+			.eq(ObjectUtils.isNotNull(aeaBills.getBillStatus()), AeaBills::getBillStatus, aeaBills.getBillStatus())
+			.eq(ObjectUtils.isNotNull(aeaBills.getStatus()), AeaBills::getStatus, aeaBills.getStatus())
+			.orderByDesc(AeaBills::getCreateTime);
+		IPage<AeaBills> pages = aeaBillsService.page(Condition.getPage(query), lambdaQueryWrapper);
+		return R.data(pages);
+	}
+
+	/**
+	 * 分页 业务-空运进出口
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入aeaBills")
+	public R<List<AeaBills>> list(AeaBills aeaBills) {
+		LambdaQueryWrapper<AeaBills> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.select(AeaBills::getId, AeaBills::getBillNo, AeaBills::getBillType, AeaBills::getMasterBillNo,
+			AeaBills::getCorpCnName, AeaBills::getCorpId, AeaBills::getCorpEnName, AeaBills::getCarrierCnName,
+			AeaBills::getCarrierId, AeaBills::getVoyageNo, AeaBills::getMblno, AeaBills::getHblno, AeaBills::getEta, AeaBills::getEtd,
+			AeaBills::getDepartureId, AeaBills::getDepartureCnName, AeaBills::getDestinationId, AeaBills::getDestinationName,
+			AeaBills::getCargoType, AeaBills::getMarks, AeaBills::getQuantity, AeaBills::getGrossWeight,
+			AeaBills::getMeasurement, AeaBills::getIsNeedLand, AeaBills::getIsNeedDeclare, AeaBills::getIsNeedIq, AeaBills::getAmountDr,
+			AeaBills::getAmountCr, AeaBills::getAmountProfit, AeaBills::getAmountDrUsd, AeaBills::getAmountCrUsd, AeaBills::getAmountProfitUsd,
+			AeaBills::getAmountDrLoc, AeaBills::getAmountCrLoc, AeaBills::getAmountProfitLoc, AeaBills::getCheckCrStatusDescr, AeaBills::getCheckDrStatusDescr,
+			AeaBills::getStlCrStatusDescr, AeaBills::getStlDrStatusDescr, AeaBills::getInvoiceCrStatusDescr, AeaBills::getInvoiceDrStatusDescr, AeaBills::getCreateUserName,
+			AeaBills::getCreateTime, AeaBills::getUpdateUserName, AeaBills::getUpdateTime, AeaBills::getStatus, AeaBills::getBillStatus,
+			AeaBills::getAccountStatus, AeaBills::getRemarks, AeaBills::getPackingUnit, AeaBills::getBillDate);
+		lambdaQueryWrapper.eq(AeaBills::getIsDeleted, 0)
+			.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
+			.and(i -> i.isNull(AeaBills::getMasterId).or()
+				.eq(AeaBills::getMasterId, 0))
+			.like(ObjectUtils.isNotNull(aeaBills.getBillNo()), AeaBills::getBillNo, aeaBills.getBillNo())
+			.like(ObjectUtils.isNotNull(aeaBills.getMblno()), AeaBills::getMblno, aeaBills.getMblno())
+			.like(ObjectUtils.isNotNull(aeaBills.getHblno()), AeaBills::getHblno, aeaBills.getHblno())
+			.like(ObjectUtils.isNotNull(aeaBills.getVoyageNo()), AeaBills::getVoyageNo, aeaBills.getVoyageNo())
+			.and(ObjectUtils.isNotNull(aeaBills.getCorpCnName()), i -> i.like(AeaBills::getCorpCnName, aeaBills.getCorpCnName()).or()
+				.like(AeaBills::getCorpEnName, aeaBills.getCorpCnName()))
+			.and(ObjectUtils.isNotNull(aeaBills.getCarrierCnName()), i -> i.like(AeaBills::getCarrierCnName, aeaBills.getCarrierCnName()).or()
+				.like(AeaBills::getCarrierEnName, aeaBills.getCarrierCnName()))
+			.and(ObjectUtils.isNotNull(aeaBills.getCyCode()), i -> i.like(AeaBills::getCyCode, aeaBills.getCyCode()).or()
+				.like(AeaBills::getCyCnName, aeaBills.getCyCode()).or().like(AeaBills::getCyEnName, aeaBills.getCyCode()))
+			.eq(ObjectUtils.isNotNull(aeaBills.getSrcType()), AeaBills::getSrcType, aeaBills.getSrcType())
+			.and(ObjectUtils.isNotNull(aeaBills.getSrcCnName()), i -> i.like(AeaBills::getSrcCnName, aeaBills.getSrcCnName()).or()
+				.like(AeaBills::getSrcEnName, aeaBills.getSrcCnName()))
+			.apply(ObjectUtils.isNotNull(aeaBills.getCreateDeptName()), "find_in_set('" + aeaBills.getCreateDeptName() + "',create_dept_name)");
+		if (ObjectUtils.isNotNull(aeaBills.getEtdList()) && aeaBills.getEtdList().size() > 0) {
+			lambdaQueryWrapper.ge(AeaBills::getEtd, aeaBills.getEtdList().get(0));
+			lambdaQueryWrapper.le(AeaBills::getEtd, aeaBills.getEtdList().get(1));
+		}
+		if (ObjectUtils.isNotNull(aeaBills.getEtaList()) && aeaBills.getEtaList().size() > 0) {
+			lambdaQueryWrapper.ge(AeaBills::getEta, aeaBills.getEtaList().get(0));
+			lambdaQueryWrapper.le(AeaBills::getEta, aeaBills.getEtaList().get(1));
+		}
+		lambdaQueryWrapper.and(ObjectUtils.isNotNull(aeaBills.getBookingAgentCnName()), i -> i.like(AeaBills::getBookingAgentCnName, aeaBills.getBookingAgentCnName()).or()
+			.like(AeaBills::getBookingAgentEnName, aeaBills.getBookingAgentCnName()))
+			.eq(ObjectUtils.isNotNull(aeaBills.getBillType()), AeaBills::getBillType, aeaBills.getBillType())
+			.eq(ObjectUtils.isNotNull(aeaBills.getBusinessType()), AeaBills::getBusinessType, aeaBills.getBusinessType())
+			.eq(ObjectUtils.isNotNull(aeaBills.getSeaType()), AeaBills::getSeaType, aeaBills.getSeaType())
+			.eq(ObjectUtils.isNotNull(aeaBills.getBillStatus()), AeaBills::getBillStatus, aeaBills.getBillStatus())
+			.eq(ObjectUtils.isNotNull(aeaBills.getStatus()), AeaBills::getStatus, aeaBills.getStatus())
+			.orderByDesc(AeaBills::getCreateTime);
+		List<AeaBills> pages = aeaBillsService.list(lambdaQueryWrapper);
+		return R.data(pages);
+	}
+
+
+	/**
+	 * 自定义分页 业务-空运进出口
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入aeaBills")
+	public R<IPage<AeaBillsVO>> page(AeaBillsVO aeaBills, Query query) {
+		IPage<AeaBillsVO> pages = aeaBillsService.selectAeaBillsPage(Condition.getPage(query), aeaBills);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务-空运进出口
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入aeaBills")
+	public R save(@Valid @RequestBody AeaBills aeaBills) {
+		return R.status(aeaBillsService.save(aeaBills));
+	}
+
+	/**
+	 * 修改 业务-空运进出口
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入aeaBills")
+	public R update(@Valid @RequestBody AeaBills aeaBills) {
+		return R.status(aeaBillsService.updateById(aeaBills));
+	}
+
+	/**
+	 * 新增或修改 业务-空运进出口
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入aeaBills")
+	public R submit(@Valid @RequestBody AeaBills aeaBills) {
+		return aeaBillsService.submit(aeaBills);
+	}
+
+
+	/**
+	 * 删除 业务-空运进出口
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(aeaBillsService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.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.business.aea.mapper;
+
+import org.springblade.los.business.aea.entity.AeaBills;
+import org.springblade.los.business.aea.vo.AeaBillsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务-空运进出口 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-01-19
+ */
+public interface AeaBillsMapper extends BaseMapper<AeaBills> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param aeaBills
+	 * @return
+	 */
+	List<AeaBillsVO> selectAeaBillsPage(IPage page, AeaBillsVO aeaBills);
+
+}

+ 211 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.xml

@@ -0,0 +1,211 @@
+<?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.business.aea.mapper.AeaBillsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="aeaBillsResultMap" type="org.springblade.los.business.aea.entity.AeaBills">
+        <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="business_type" property="businessType"/>
+        <result column="sea_type" property="seaType"/>
+        <result column="bill_type" property="billType"/>
+        <result column="waybill_type" property="waybillType"/>
+        <result column="waybill_id" property="waybillId"/>
+        <result column="waybill_cn_name" property="waybillCnName"/>
+        <result column="waybill_en_name" property="waybillEnName"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="master_id" property="masterId"/>
+        <result column="master_bill_no" property="masterBillNo"/>
+        <result column="bill_date" property="billDate"/>
+        <result column="incoming_goods_date" property="incomingGoodsDate"/>
+        <result column="bill_confirm_date" property="billConfirmDate"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+        <result column="corp_attn_id" property="corpAttnId"/>
+        <result column="corp_attn_name" property="corpAttnName"/>
+        <result column="corp_attn_tel" property="corpAttnTel"/>
+        <result column="corp_attn_email" property="corpAttnEmail"/>
+        <result column="operator_id" property="operatorId"/>
+        <result column="operator_name" property="operatorName"/>
+        <result column="src_type" property="srcType"/>
+        <result column="src_id" property="srcId"/>
+        <result column="src_cn_name" property="srcCnName"/>
+        <result column="src_en_name" property="srcEnName"/>
+        <result column="carrier_id" property="carrierId"/>
+        <result column="carrier_cn_name" property="carrierCnName"/>
+        <result column="carrier_en_name" property="carrierEnName"/>
+        <result column="booking_date" property="bookingDate"/>
+        <result column="booking_remarks" property="bookingRemarks"/>
+        <result column="voyage_no" property="voyageNo"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="refno" property="refno"/>
+        <result column="etd" property="etd"/>
+        <result column="reality_etd" property="realityEtd"/>
+        <result column="eta" property="eta"/>
+        <result column="destination_id" property="destinationId"/>
+        <result column="destination_code" property="destinationCode"/>
+        <result column="destination_name" property="destinationName"/>
+        <result column="final_destination_id" property="finalDestinationId"/>
+        <result column="final_destination_code" property="finalDestinationCode"/>
+        <result column="final_destination_name" property="finalDestinationName"/>
+        <result column="pot_id" property="potId"/>
+        <result column="pot_code" property="potCode"/>
+        <result column="pot_cn_name" property="potCnName"/>
+        <result column="pot_en_name" property="potEnName"/>
+        <result column="pot_voyage_no" property="potVoyageNo"/>
+        <result column="pot_etd" property="potEtd"/>
+        <result column="pot_eta" property="potEta"/>
+        <result column="departure_id" property="departureId"/>
+        <result column="departure_code" property="departureCode"/>
+        <result column="departure_cn_name" property="departureCnName"/>
+        <result column="departure_en_name" property="departureEnName"/>
+        <result column="departure_addr_id" property="departureAddrId"/>
+        <result column="departure_addr_code" property="departureAddrCode"/>
+        <result column="departure_addr_cn_name" property="departureAddrCnName"/>
+        <result column="departure_addr_en_name" property="departureAddrEnName"/>
+        <result column="issue_date" property="issueDate"/>
+        <result column="issue_at" property="issueAt"/>
+        <result column="issue_at_id" property="issueAtId"/>
+        <result column="service_terms" property="serviceTerms"/>
+        <result column="transport_type" property="transportType"/>
+        <result column="h_paymode" property="hPaymode"/>
+        <result column="h_payplace" property="hPayplace"/>
+        <result column="h_shipper_id" property="hShipperId"/>
+        <result column="h_shipper_code" property="hShipperCode"/>
+        <result column="h_shipper_cn_name" property="hShipperCnName"/>
+        <result column="h_shipper_en_name" property="hShipperEnName"/>
+        <result column="h_shipper_details" property="hShipperDetails"/>
+        <result column="h_Consignee_id" property="hConsigneeId"/>
+        <result column="h_Consignee_code" property="hConsigneeCode"/>
+        <result column="h_Consignee_cn_name" property="hConsigneeCnName"/>
+        <result column="h_Consignee_en_name" property="hConsigneeEnName"/>
+        <result column="h_Consignee_details" property="hConsigneeDetails"/>
+        <result column="h_notify_id" property="hNotifyId"/>
+        <result column="h_notify_code" property="hNotifyCode"/>
+        <result column="h_notify_cn_name" property="hNotifyCnName"/>
+        <result column="h_notify_en_name" property="hNotifyEnName"/>
+        <result column="h_notify_details" property="hNotifyDetails"/>
+        <result column="m_paymode" property="mPaymode"/>
+        <result column="m_payplace" property="mPayplace"/>
+        <result column="m_shipper_id" property="mShipperId"/>
+        <result column="m_shipper_code" property="mShipperCode"/>
+        <result column="m_shipper_cn_name" property="mShipperCnName"/>
+        <result column="m_shipper_en_name" property="mShipperEnName"/>
+        <result column="m_shipper_details" property="mShipperDetails"/>
+        <result column="m_Consignee_id" property="mConsigneeId"/>
+        <result column="m_Consignee_code" property="mConsigneeCode"/>
+        <result column="m_Consignee_cn_name" property="mConsigneeCnName"/>
+        <result column="m_Consignee_en_name" property="mConsigneeEnName"/>
+        <result column="m_Consignee_details" property="mConsigneeDetails"/>
+        <result column="m_notify_id" property="mNotifyId"/>
+        <result column="m_notify_code" property="mNotifyCode"/>
+        <result column="m_notify_cn_name" property="mNotifyCnName"/>
+        <result column="m_notify_en_name" property="mNotifyEnName"/>
+        <result column="m_notify_details" property="mNotifyDetails"/>
+        <result column="m_forwarder_details" property="mForwarderDetails"/>
+        <result column="hscode" property="hscode"/>
+        <result column="commodity_sh_name" property="commodityShName"/>
+        <result column="commodity_cn_name" property="commodityCnName"/>
+        <result column="commodity_en_name" property="commodityEnName"/>
+        <result column="commodity_descr" property="commodityDescr"/>
+        <result column="marks" property="marks"/>
+        <result column="packing_unit_id" property="packingUnitId"/>
+        <result column="packing_unit" property="packingUnit"/>
+        <result column="quantity" property="quantity"/>
+        <result column="quantity_describe" property="quantityDescribe"/>
+        <result column="gross_weight" property="grossWeight"/>
+        <result column="measurement" property="measurement"/>
+        <result column="length" property="length"/>
+        <result column="width" property="width"/>
+        <result column="height" property="height"/>
+        <result column="goods_value" property="goodsValue"/>
+        <result column="billing_weight" property="billingWeight"/>
+        <result column="unit" property="unit"/>
+        <result column="cur_code" property="curCode"/>
+        <result column="currency" property="currency"/>
+        <result column="freight_rate_grade" property="freightRateGrade"/>
+        <result column="cargo_type" property="cargoType"/>
+        <result column="dg_imdg_code" property="dgImdgCode"/>
+        <result column="dg_un_code" property="dgUnCode"/>
+        <result column="dg_packing_level" property="dgPackingLevel"/>
+        <result column="dg_flash_point" property="dgFlashPoint"/>
+        <result column="dg_flash_point_unit" property="dgFlashPointUnit"/>
+        <result column="dg_contacts" property="dgContacts"/>
+        <result column="dg_tel" property="dgTel"/>
+        <result column="cy_id" property="cyId"/>
+        <result column="cy_code" property="cyCode"/>
+        <result column="cy_cn_name" property="cyCnName"/>
+        <result column="cy_en_name" property="cyEnName"/>
+        <result column="cy_address" property="cyAddress"/>
+        <result column="cy_contacts" property="cyContacts"/>
+        <result column="cy_tel" property="cyTel"/>
+        <result column="cy_remarks" property="cyRemarks"/>
+        <result column="amount_dr" property="amountDr"/>
+        <result column="amount_cr" property="amountCr"/>
+        <result column="amount_profit" property="amountProfit"/>
+        <result column="amount_dr_usd" property="amountDrUsd"/>
+        <result column="amount_cr_usd" property="amountCrUsd"/>
+        <result column="amount_profit_usd" property="amountProfitUsd"/>
+        <result column="amount_dr_loc" property="amountDrLoc"/>
+        <result column="amount_cr_loc" property="amountCrLoc"/>
+        <result column="amount_profit_loc" property="amountProfitLoc"/>
+        <result column="check_dr_status" property="checkDrStatus"/>
+        <result column="check_dr_status_descr" property="checkDrStatusDescr"/>
+        <result column="check_cr_status" property="checkCrStatus"/>
+        <result column="check_cr_status_descr" property="checkCrStatusDescr"/>
+        <result column="stl_dr_status" property="stlDrStatus"/>
+        <result column="stl_dr_status_descr" property="stlDrStatusDescr"/>
+        <result column="stl_cr_status" property="stlCrStatus"/>
+        <result column="stl_cr_status_descr" property="stlCrStatusDescr"/>
+        <result column="invoice_dr_status" property="invoiceDrStatus"/>
+        <result column="invoice_dr_status_descr" property="invoiceDrStatusDescr"/>
+        <result column="invoice_cr_status" property="invoiceCrStatus"/>
+        <result column="invoice_cr_status_descr" property="invoiceCrStatusDescr"/>
+        <result column="bill_status" property="billStatus"/>
+        <result column="account_status" property="accountStatus"/>
+        <result column="extended_data" property="extendedData"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="si_remarks" property="siRemarks"/>
+        <result column="booking_agent_id" property="bookingAgentId"/>
+        <result column="booking_agent_cn_name" property="bookingAgentCnName"/>
+        <result column="booking_agent_en_name" property="bookingAgentEnName"/>
+        <result column="billing_status" property="billingStatus"/>
+        <result column="iq_no" property="iqNo"/>
+        <result column="approved_date" property="approvedDate"/>
+        <result column="dg_net_weight" property="dgNetWeight"/>
+        <result column="dg_package" property="dgPackage"/>
+        <result column="dg_mailbox" property="dgMailbox"/>
+        <result column="dg_remarks" property="dgRemarks"/>
+        <result column="declared_carrier" property="declaredCarrier"/>
+        <result column="declsred_customs" property="declsredCustoms"/>
+        <result column="amount_of_insursnee" property="amountOfInsursnee"/>
+        <result column="hakdlthg_iformation" property="hakdlthgIformation"/>
+        <result column="chgs_code" property="chgsCode"/>
+        <result column="is_need_land" property="isNeedLand"/>
+        <result column="is_need_declare" property="isNeedDeclare"/>
+        <result column="is_need_iq" property="isNeedIq"/>
+        <result column="is_storage" property="isStorage"/>
+        <result column="is_goods_tracking" property="isGoodsTracking"/>
+        <result column="comprehensive" property="comprehensive"/>
+        <result column="comprehensive_other" property="comprehensiveOther"/>
+    </resultMap>
+
+
+    <select id="selectAeaBillsPage" resultMap="aeaBillsResultMap">
+        select * from los_aea_bills where is_deleted = 0
+    </select>
+
+</mapper>

+ 50 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/IAeaBillsService.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.business.aea.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.aea.entity.AeaBills;
+import org.springblade.los.business.aea.vo.AeaBillsVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-空运进出口 服务类
+ *
+ * @author BladeX
+ * @since 2024-01-19
+ */
+public interface IAeaBillsService extends IService<AeaBills> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param aeaBills
+	 * @return
+	 */
+	IPage<AeaBillsVO> selectAeaBillsPage(IPage<AeaBillsVO> page, AeaBillsVO aeaBills);
+
+	/**
+	 * 新增或修改 业务-空运进出口
+	 * @param aeaBills
+	 * @return
+	 */
+	R submit(AeaBills aeaBills);
+
+	AeaBills detail(AeaBills aeaBills);
+}

+ 510 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java

@@ -0,0 +1,510 @@
+/*
+ *      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.business.aea.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.core.tool.utils.BeanUtil;
+import org.springblade.los.Util.IDeptUtils;
+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.aea.entity.AeaBills;
+import org.springblade.los.business.aea.mapper.AeaBillsMapper;
+import org.springblade.los.business.aea.service.IAeaBillsService;
+import org.springblade.los.business.aea.vo.AeaBillsVO;
+import org.springblade.los.business.files.entity.FilesCenter;
+import org.springblade.los.business.files.service.IFilesCenterService;
+import org.springblade.los.business.sea.dto.WaitingBox;
+import org.springblade.los.business.sea.entity.*;
+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.system.entity.Dept;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 业务-空运进出口 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-01-19
+ */
+@Service
+@AllArgsConstructor
+public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> implements IAeaBillsService {
+
+	private final ISysClient sysClient;
+
+	private final IDeptUtils deptUtils;
+
+	private final IFeeCenterService feeCenterService;
+
+	private final IBusinessTypeService bBusinessTypeService;
+
+	private final IBusinessBillNoService businessBillNoService;
+
+	private final IFinAccBillsService finAccBillsService;
+
+	private final IBCurrencyService bCurrencyService;
+
+	private final IFilesCenterService filesCenterService;
+
+	@Override
+	public IPage<AeaBillsVO> selectAeaBillsPage(IPage<AeaBillsVO> page, AeaBillsVO aeaBills) {
+		return page.setRecords(baseMapper.selectAeaBillsPage(page, aeaBills));
+	}
+
+	@Override
+	public R submit(AeaBills aeaBills) {
+		String deptId = "";
+		String deptName = "";
+		String branchId = "";
+		//获取部门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());
+			}
+			Dept dept = deptUtils.getDept(AuthUtil.getDeptId());
+			if (dept != null) {
+				branchId = dept.getId() + "";
+			} else {
+				branchId = deptId;
+			}
+		}
+		if (ObjectUtils.isNotNull(aeaBills.getMblno())) {
+			aeaBills.setMblno(aeaBills.getMblno().replaceAll(" ", ""));
+		}
+		List<AeaBills> count = baseMapper.selectList(new LambdaQueryWrapper<AeaBills>()
+			.eq(AeaBills::getCreateDept, AuthUtil.getDeptId())
+			.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
+			.eq(AeaBills::getIsDeleted, 0)
+			.eq(AeaBills::getMblno, aeaBills.getMblno()
+			));
+		if ("SE".equals(aeaBills.getBusinessType())) {
+			aeaBills.setBillDate(aeaBills.getEtd());
+		} else {
+			aeaBills.setBillDate(aeaBills.getEta());
+		}
+		if (aeaBills.getId() == null) {
+			if ("MH".equals(aeaBills.getBillType())) {
+				if (count.size() > 0) {
+					throw new RuntimeException("提单号不允许重复");
+				}
+			}
+			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
+				.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
+				.eq(BusinessType::getIsDeleted, 0)
+				.eq(BusinessType::getStatus, 0)
+				.eq(BusinessType::getCode, aeaBills.getBusinessTypeCode()));
+			if (businessType == null) {
+				throw new RuntimeException("未找到可用业务类型");
+			}
+			BusinessBillNo businessBillNo = new BusinessBillNo();
+			businessBillNo.setBusinessTypeId(businessType.getId());
+			businessBillNo.setCode(aeaBills.getBillNoFormat());
+			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+			if (!clientBillNo.isSuccess()) {
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				return R.fail(500, "生成订单编号失败");
+			}
+			aeaBills.setBillNo((String) clientBillNo.getData());
+			aeaBills.setCreateTime(new Date());
+			aeaBills.setCreateUser(AuthUtil.getUserId());
+			aeaBills.setCreateUserName(AuthUtil.getUserName());
+			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+				aeaBills.setBranchId(branchId);
+				aeaBills.setCreateDept(deptId);
+				aeaBills.setCreateDeptName(deptName);
+			}
+		} else {
+			List<Long> ids = count.stream().map(AeaBills::getId).distinct().collect(Collectors.toList());
+			if ("MH".equals(aeaBills.getBillType())) {
+				if (count.size() > 0 && !ids.contains(aeaBills.getId())) {
+					throw new RuntimeException("提单号不允许重复");
+				}
+			}
+			aeaBills.setUpdateUser(AuthUtil.getUserId());
+			aeaBills.setUpdateTime(new Date());
+			aeaBills.setUpdateUserName(AuthUtil.getUserName());
+
+			//主单信息同步分单
+			if ("MM".equals(aeaBills.getBillType())) {
+				AeaBills details = baseMapper.selectById(aeaBills.getId());
+				if (!details.getVoyageNo().equals(aeaBills.getVoyageNo())) {
+					List<AeaBills> aeaBillsList = baseMapper.selectList(new LambdaQueryWrapper<AeaBills>()
+						.eq(AeaBills::getCreateDept, AuthUtil.getDeptId())
+						.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
+						.eq(AeaBills::getIsDeleted, 0)
+						.eq(AeaBills::getMblno, aeaBills.getMblno()));
+					if (aeaBillsList.size() > 0) {
+						for (AeaBills item : aeaBillsList) {
+							item.setEtd(aeaBills.getEtd());
+							item.setVoyageNo(aeaBills.getVoyageNo());
+							item.setDestinationId(aeaBills.getDestinationId());
+							item.setDestinationName(aeaBills.getDestinationName());
+							item.setDestinationCode(aeaBills.getDestinationCode());
+							item.setFinalDestinationId(aeaBills.getFinalDestinationId());
+							item.setFinalDestinationCode(aeaBills.getFinalDestinationCode());
+							item.setFinalDestinationName(aeaBills.getFinalDestinationName());
+							item.setCyId(aeaBills.getCyId());
+							item.setCyCode(aeaBills.getCyCode());
+							item.setCyCnName(aeaBills.getCyCnName());
+							item.setCyEnName(aeaBills.getCyEnName());
+							item.setCyAddress(aeaBills.getCyAddress());
+							item.setCyTel(aeaBills.getCyTel());
+							item.setCyRemarks(aeaBills.getCyRemarks());
+							item.setCarrierId(aeaBills.getCarrierId());
+							item.setCarrierCnName(aeaBills.getCarrierCnName());
+							item.setCarrierEnName(aeaBills.getCarrierEnName());
+							item.setBookingDate(aeaBills.getBookingDate());
+						}
+						if (aeaBillsList.size() > 0) {
+							this.updateBatchById(aeaBillsList);
+						}
+						List<Long> billIds = aeaBillsList.stream().map(AeaBills::getId).collect(Collectors.toList());
+						List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+							.eq(FeeCenter::getIsDeleted, 0)
+							.eq(FeeCenter::getPid, billIds));
+						for (FeeCenter item : feeCenterList) {
+							item.setVoyageNo(aeaBills.getVoyageNo());
+							item.setPolId(aeaBills.getDepartureId());
+							item.setPolCnName(aeaBills.getDepartureCnName());
+							item.setPolEnName(aeaBills.getDepartureEnName());
+							item.setPolCode(aeaBills.getDepartureCode());
+							item.setPodId(aeaBills.getFinalDestinationId());
+							item.setPodCnName(aeaBills.getFinalDestinationName());
+							item.setPodEnName(aeaBills.getFinalDestinationName());
+							item.setPodCode(aeaBills.getFinalDestinationCode());
+						}
+						feeCenterService.updateBatchById(feeCenterList);
+						List<FinAccBills> finAccBillsList = finAccBillsService.list(new LambdaQueryWrapper<FinAccBills>()
+							.eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
+							.eq(FinAccBills::getIsDeleted, 0)
+							.eq(FinAccBills::getBusinessBillDivideId, billIds));
+						for (FinAccBills item : finAccBillsList) {
+							item.setVoyageNo(aeaBills.getVoyageNo());
+							item.setPolId(aeaBills.getDepartureId());
+							item.setPolCnName(aeaBills.getDepartureCnName());
+							item.setPolEnName(aeaBills.getDepartureEnName());
+							item.setPolCode(aeaBills.getDepartureCode());
+							item.setPodId(aeaBills.getFinalDestinationId());
+							item.setPodCnName(aeaBills.getFinalDestinationName());
+							item.setPodEnName(aeaBills.getFinalDestinationName());
+							item.setPodCode(aeaBills.getFinalDestinationCode());
+						}
+						finAccBillsService.updateBatchById(finAccBillsList);
+						for (AeaBills item : aeaBillsList) {
+							item.setVoyageNo(aeaBills.getVoyageNo());
+							item.setDepartureId(aeaBills.getDepartureId());
+							item.setDepartureCnName(aeaBills.getDepartureCnName());
+							item.setDepartureEnName(aeaBills.getDepartureEnName());
+							item.setDepartureCode(aeaBills.getDepartureCode());
+							item.setDestinationId(aeaBills.getDestinationId());
+							item.setDestinationName(aeaBills.getDestinationName());
+							item.setDestinationCode(aeaBills.getDestinationCode());
+							item.setCyId(aeaBills.getCyId());
+							item.setCyCode(aeaBills.getCyCode());
+							item.setCyCnName(aeaBills.getCyCnName());
+							item.setCyEnName(aeaBills.getCyEnName());
+							item.setCyAddress(aeaBills.getCyAddress());
+							item.setCyTel(aeaBills.getCyTel());
+							item.setCyRemarks(aeaBills.getCyRemarks());
+							item.setCarrierId(aeaBills.getCarrierId());
+							item.setCarrierCnName(aeaBills.getCarrierCnName());
+							item.setCarrierEnName(aeaBills.getCarrierEnName());
+							item.setBookingDate(aeaBills.getBookingDate());
+						}
+						this.updateBatchById(aeaBillsList);
+					}
+				}
+			}
+		}
+		this.saveOrUpdate(aeaBills);
+		/**-------------费用计算---------*/
+		BigDecimal amountDr = new BigDecimal("0.00");
+		BigDecimal amountCr = new BigDecimal("0.00");
+		BigDecimal amountProfit = new BigDecimal("0.00");
+		BigDecimal amountDrUsd = new BigDecimal("0.00");
+		BigDecimal amountCrUsd = new BigDecimal("0.00");
+		BigDecimal amountProfitUsd = new BigDecimal("0.00");
+		BigDecimal amountDrLoc = new BigDecimal("0.00");
+		BigDecimal amountCrLoc = new BigDecimal("0.00");
+		BigDecimal amountProfitLoc = new BigDecimal("0.00");
+		//应付
+		if (ObjectUtils.isNotNull(aeaBills.getFeeCenterListC())) {
+			for (FeeCenter item : aeaBills.getFeeCenterListC()) {
+				item.setPid(aeaBills.getId());
+				item.setBillNo(aeaBills.getBillNo());
+				item.setBusinessType(aeaBills.getBusinessType());
+				item.setBillType(aeaBills.getBillType());
+				item.setBillDate(aeaBills.getBillDate());
+				item.setSrcType(aeaBills.getSrcType());
+				item.setSrcId(aeaBills.getSrcId());
+				item.setSrcCnName(aeaBills.getSrcCnName());
+				item.setSrcEnName(aeaBills.getSrcEnName());
+				item.setBillCorpId(aeaBills.getCorpId());
+				item.setBillCorpCnName(aeaBills.getCorpCnName());
+				item.setBillCorpEnName(aeaBills.getCorpEnName());
+				item.setVoyageNo(aeaBills.getVoyageNo());
+				item.setMblno(aeaBills.getMblno());
+				item.setHblno(aeaBills.getHblno());
+				item.setEtd(aeaBills.getEtd());
+				item.setEta(aeaBills.getEta());
+				item.setVoyageNo(aeaBills.getVoyageNo());
+				item.setPolId(aeaBills.getDepartureId());
+				item.setPolCnName(aeaBills.getDepartureCnName());
+				item.setPolEnName(aeaBills.getDepartureEnName());
+				item.setPolCode(aeaBills.getDepartureCode());
+				item.setPodId(aeaBills.getFinalDestinationId());
+				item.setPodCnName(aeaBills.getFinalDestinationName());
+				item.setPodEnName(aeaBills.getFinalDestinationName());
+				item.setPodCode(aeaBills.getFinalDestinationCode());
+				item.setPaymode(aeaBills.getMPaymode());
+				item.setPayplace(aeaBills.getMPayplace());
+				item.setRefno(aeaBills.getRefno());
+				if ("USD".equals(item.getCurCode())) {
+					amountCrUsd = amountCrUsd.add(item.getAmount());
+				} else if ("CNY".equals(item.getCurCode())) {
+					amountCr = amountCr.add(item.getAmount());
+				} else {
+					BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+					amountCrUsd = amountCrUsd.add(usd);
+				}
+			}
+			feeCenterService.submitList(aeaBills.getFeeCenterListC());
+		}
+		//应收
+		if (ObjectUtils.isNotNull(aeaBills.getFeeCenterListD())) {
+			for (FeeCenter item : aeaBills.getFeeCenterListD()) {
+				item.setPid(aeaBills.getId());
+				item.setBillNo(aeaBills.getBillNo());
+				item.setBusinessType(aeaBills.getBusinessType());
+				item.setBillType(aeaBills.getBillType());
+				item.setBillDate(aeaBills.getBillDate());
+				item.setSrcType(aeaBills.getSrcType());
+				item.setSrcId(aeaBills.getSrcId());
+				item.setSrcCnName(aeaBills.getSrcCnName());
+				item.setSrcEnName(aeaBills.getSrcEnName());
+				item.setBillCorpId(aeaBills.getCorpId());
+				item.setBillCorpCnName(aeaBills.getCorpCnName());
+				item.setBillCorpEnName(aeaBills.getCorpEnName());
+				item.setVoyageNo(aeaBills.getVoyageNo());
+				item.setMblno(aeaBills.getMblno());
+				item.setHblno(aeaBills.getHblno());
+				item.setEtd(aeaBills.getEtd());
+				item.setEta(aeaBills.getEta());
+				item.setVoyageNo(aeaBills.getVoyageNo());
+				item.setPolId(aeaBills.getDepartureId());
+				item.setPolCnName(aeaBills.getDepartureCnName());
+				item.setPolEnName(aeaBills.getDepartureEnName());
+				item.setPolCode(aeaBills.getDepartureCode());
+				item.setPodId(aeaBills.getFinalDestinationId());
+				item.setPodCnName(aeaBills.getFinalDestinationName());
+				item.setPodEnName(aeaBills.getFinalDestinationName());
+				item.setPodCode(aeaBills.getFinalDestinationCode());
+				item.setPaymode(aeaBills.getMPaymode());
+				item.setPayplace(aeaBills.getMPayplace());
+				item.setRefno(aeaBills.getRefno());
+				if ("USD".equals(item.getCurCode())) {
+					amountDrUsd = amountDrUsd.add(item.getAmount());
+				} else if ("CNY".equals(item.getCurCode())) {
+					amountDr = amountDr.add(item.getAmount());
+				} else {
+					BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+					amountDrUsd = amountDrUsd.add(usd);
+				}
+			}
+			feeCenterService.submitList(aeaBills.getFeeCenterListD());
+		}
+		BigDecimal quantity = aeaBills.getQuantity();
+		BigDecimal grossWeight = aeaBills.getGrossWeight();
+		BigDecimal measurement = aeaBills.getMeasurement();
+		//主单应加上分单费用
+		if ("MM".equals(aeaBills.getBillType()) && ObjectUtils.isNotNull(aeaBills.getId())) {
+			List<AeaBills> details = baseMapper.selectList(new LambdaQueryWrapper<AeaBills>()
+				.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
+				.eq(AeaBills::getIsDeleted, 0)
+				.eq(AeaBills::getMasterId, aeaBills.getId()));
+			if (details.size() > 0) {
+				amountDr = amountDr.add(details.stream().map(AeaBills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountCr = amountCr.add(details.stream().map(AeaBills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountDrUsd = amountDrUsd.add(details.stream().map(AeaBills::getAmountDrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountCrUsd = amountCrUsd.add(details.stream().map(AeaBills::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountDrLoc = amountDrLoc.add(details.stream().map(AeaBills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountCrLoc = amountCrLoc.add(details.stream().map(AeaBills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				quantity = quantity.add(details.stream().map(AeaBills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				grossWeight = grossWeight.add(details.stream().map(AeaBills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				measurement = measurement.add(details.stream().map(AeaBills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+
+			}
+		} else if ("MH".equals(aeaBills.getBillType()) && ObjectUtils.isNotNull(aeaBills.getId())) {
+			AeaBills details = baseMapper.selectById(aeaBills.getMasterId());
+			//重新计算主单合计
+			if (details != null) {
+				BigDecimal amountDrM = new BigDecimal("0.00");
+				BigDecimal amountCrM = new BigDecimal("0.00");
+				BigDecimal amountProfitM = new BigDecimal("0.00");
+				BigDecimal amountDrUsdM = new BigDecimal("0.00");
+				BigDecimal amountCrUsdM = new BigDecimal("0.00");
+				BigDecimal amountProfitUsdM = new BigDecimal("0.00");
+				BigDecimal amountDrLocM = new BigDecimal("0.00");
+				BigDecimal amountCrLocM = new BigDecimal("0.00");
+				BigDecimal amountProfitLocM = new BigDecimal("0.00");
+				BigDecimal quantityM = new BigDecimal("0.00");
+				BigDecimal grossWeightM = new BigDecimal("0.00");
+				BigDecimal measurementM = new BigDecimal("0.00");
+				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getPid, details.getId()));
+				for (FeeCenter item : feeCenterList) {
+					if ("C".equals(item.getDc())) {
+						if ("USD".equals(item.getCurCode())) {
+							amountCrUsdM = amountCrUsdM.add(item.getAmount());
+						} else if ("CNY".equals(item.getCurCode())) {
+							amountCrM = amountCrM.add(item.getAmount());
+						} else {
+							BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+							amountCrUsdM = amountCrUsdM.add(usd);
+						}
+					} else {
+						if ("USD".equals(item.getCurCode())) {
+							amountDrUsdM = amountDrUsdM.add(item.getAmount());
+						} else if ("CNY".equals(item.getCurCode())) {
+							amountDrM = amountDrM.add(item.getAmount());
+						} else {
+							BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc());
+							amountDrUsdM = amountDrUsdM.add(usd);
+						}
+					}
+				}
+				List<AeaBills> billsList = this.list(new LambdaQueryWrapper<AeaBills>()
+					.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
+					.eq(AeaBills::getIsDeleted, 0)
+					.eq(AeaBills::getMasterId, details.getId()));
+				List<AeaBills> billsLists = billsList.stream().filter(e -> !e.getId().equals(aeaBills.getId())).collect(Collectors.toList());
+				if (billsLists.size() > 0) {
+					amountDrM = amountDrM.add(billsLists.stream().map(AeaBills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					amountCrM = amountCrM.add(billsLists.stream().map(AeaBills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					amountDrUsdM = amountDrUsdM.add(billsLists.stream().map(AeaBills::getAmountDrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					amountCrUsdM = amountCrUsdM.add(billsLists.stream().map(AeaBills::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					amountDrLocM = amountDrLocM.add(billsLists.stream().map(AeaBills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					amountCrLocM = amountCrLocM.add(billsLists.stream().map(AeaBills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					quantityM = quantityM.add(billsLists.stream().map(AeaBills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					grossWeightM = grossWeightM.add(billsLists.stream().map(AeaBills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					measurementM = measurementM.add(billsLists.stream().map(AeaBills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				}
+				amountDrM = amountDrM.add(amountDr);
+				amountCrM = amountCrM.add(amountCr);
+				amountDrUsdM = amountDrUsdM.add(amountDrUsd);
+				amountCrUsdM = amountCrUsdM.add(amountCrUsd);
+				amountDrLocM = amountDrLocM.add(amountDrLoc);
+				amountCrLocM = amountCrLocM.add(amountCrLoc);
+				//利润 = 收 - 付
+				amountProfitM = amountDrM.subtract(amountCrM);
+				amountProfitUsdM = amountDrUsdM.subtract(amountCrUsdM);
+				amountDrLocM = amountDrLocM.add(bCurrencyService.converterCny("USD", amountDrUsdM, "D")).add(amountDrM);
+				amountCrLocM = amountCrLocM.add(bCurrencyService.converterCny("USD", amountCrUsdM, "C")).add(amountCrM);
+				amountProfitLocM = amountDrLocM.subtract(amountCrLocM);
+				details.setAmountDr(amountDrM);
+				details.setAmountCr(amountCrM);
+				details.setAmountProfit(amountProfitM);
+				details.setAmountDrUsd(amountDrUsdM);
+				details.setAmountCrUsd(amountCrUsdM);
+				details.setAmountProfitUsd(amountProfitUsdM);
+				details.setAmountDrLoc(amountDrLocM);
+				details.setAmountCrLoc(amountCrLocM);
+				details.setAmountProfitLoc(amountProfitLocM);
+				details.setQuantity(quantityM);
+				details.setGrossWeight(grossWeightM);
+				details.setMeasurement(measurementM);
+				baseMapper.updateById(details);
+			}
+		}
+		//利润 = 收 - 付
+		amountProfit = amountDr.subtract(amountCr);
+		amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
+		amountDrLoc = amountDrLoc.add(bCurrencyService.converterCny("USD", amountDrUsd, "D")).add(amountDr);
+		amountCrLoc = amountCrLoc.add(bCurrencyService.converterCny("USD", amountCrUsd, "C")).add(amountCr);
+		amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
+		aeaBills.setAmountDr(amountDr);
+		aeaBills.setAmountCr(amountCr);
+		aeaBills.setAmountProfit(amountProfit);
+		aeaBills.setAmountDrUsd(amountDrUsd);
+		aeaBills.setAmountCrUsd(amountCrUsd);
+		aeaBills.setAmountProfitUsd(amountProfitUsd);
+		aeaBills.setAmountDrLoc(amountDrLoc);
+		aeaBills.setAmountCrLoc(amountCrLoc);
+		aeaBills.setAmountProfitLoc(amountProfitLoc);
+		aeaBills.setQuantity(quantity);
+		aeaBills.setGrossWeight(grossWeight);
+		aeaBills.setMeasurement(measurement);
+		this.saveOrUpdate(aeaBills);
+		/**-------------费用计算---------*/
+		return R.data(aeaBills);
+	}
+
+	@Override
+	public AeaBills detail(AeaBills aeaBills) {
+		if (aeaBills.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		AeaBills detail = baseMapper.selectById(aeaBills.getId());
+		detail.setFilesList(filesCenterService.list(new LambdaQueryWrapper<FilesCenter>()
+			.eq(FilesCenter::getIsDeleted, 0)
+			.eq(FilesCenter::getTenantId, AuthUtil.getTenantId())
+			.eq(FilesCenter::getPid, detail.getId())));
+		detail.setFeeCenterListC(feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+			.eq(FeeCenter::getIsDeleted, 0)
+			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+			.eq(FeeCenter::getBillType, detail.getBillType())
+			.eq(FeeCenter::getPid, detail.getId())
+			.eq(FeeCenter::getDc, "C")
+			.eq(FeeCenter::getBillNo, detail.getBillNo())
+		));
+		detail.setFeeCenterListD(feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+			.eq(FeeCenter::getIsDeleted, 0)
+			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+			.eq(FeeCenter::getBillType, detail.getBillType())
+			.eq(FeeCenter::getPid, detail.getId())
+			.eq(FeeCenter::getDc, "D")
+			.eq(FeeCenter::getBillNo, detail.getBillNo())
+		));
+		return detail;
+	}
+
+}

+ 0 - 10
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java

@@ -121,16 +121,6 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 			.eq(Containers::getIsDeleted, 0)
 			.eq(Containers::getPid, preContainers.getPid()));
 		containersService.removeByPid(preContainers.getPid(), preContainers.getCntrTypeCode());
-		/*for (Containers item : removeContainersList) {
-			item.setQuantity(new BigDecimal("0.00"));
-			item.setMeasurement(new BigDecimal("0.00"));
-			item.setNetWeight(new BigDecimal("0.00"));
-			item.setGrossWeight(new BigDecimal("0.00"));
-			item.setUpdateUser(AuthUtil.getUserId());
-			item.setUpdateUserName(AuthUtil.getUserName());
-			item.setUpdateTime(new Date());
-		}
-		containersService.saveOrUpdateBatch(removeContainersList);*/
 		if (removeContainersList.size() > 0) {
 			List<Long> ids = removeContainersList.stream().map(Containers::getId).collect(Collectors.toList());
 			containersBillsService.removeByPid(ids);

+ 0 - 1
blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/controller/FinStlBillsController.java

@@ -209,7 +209,6 @@ public class FinStlBillsController extends BladeController {
 	public R confirmSettlement(@Valid @RequestBody FinStlBills finStlBills) {
 		return finStlBillsService.confirmSettlement(finStlBills);
 	}
-
 	/**
 	 * 财务结算 撤销
 	 */