Browse Source

2024年5月10日08:58:33

纪新园 1 year ago
parent
commit
7e71be51a9

+ 18 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/release/entity/SeaReleaseBill.java

@@ -434,5 +434,23 @@ public class SeaReleaseBill implements Serializable {
 	@TableField(exist = false)
 	private List<SeaReleaseBillItems> releaseBillList;
 
+	/**
+	 * 编码生成code
+	 */
+	@TableField(exist = false)
+	private String billNoFormat;
+
+	/**
+	 * 业务类型表 code
+	 */
+	@TableField(exist = false)
+	private String businessTypeCode;
+
+	/**
+	 * 签单状态,0=新建 1=提交 2=跑单中 3=操作确认 4=调度确认 5=放单 6=退回,或 (N,S,I,O,D,T,B)
+	 */
+	@ApiModelProperty(value = "签单状态,0=新建 1=提交 2=跑单中 3=操作确认 4=调度确认 5=放单 6=退回,或 (N,S,I,O,D,T,B)")
+	private String issueStatus;
+
 
 }

+ 502 - 502
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/release/entity/SeaReleaseBillItems.java

@@ -40,512 +40,512 @@ public class SeaReleaseBillItems implements Serializable {
 	private static final long serialVersionUID = 1L;
 
 	/**
-	* 主键
-	*/
-		@ApiModelProperty(value = "主键")
-		private Long id;
-	/**
-	* 分公司 Id
-	*/
-		@ApiModelProperty(value = "分公司 Id")
-		private String branchId;
-	/**
-	* 创建人 Id
-	*/
-		@ApiModelProperty(value = "创建人 Id")
-		private Long createUser;
-	/**
-	* 创建人
-	*/
-		@ApiModelProperty(value = "创建人")
-		private String createUserName;
-	/**
-	* 创建部门 Id
-	*/
-		@ApiModelProperty(value = "创建部门 Id")
-		private String createDept;
-	/**
-	* 创建部门
-	*/
-		@ApiModelProperty(value = "创建部门")
-		private String createDeptName;
-	/**
-	* 创建时间
-	*/
-		@ApiModelProperty(value = "创建时间")
-		private Date createTime;
-	/**
-	* 修改人 Id
-	*/
-		@ApiModelProperty(value = "修改人 Id")
-		private Long updateUser;
-	/**
-	* 修改人
-	*/
-		@ApiModelProperty(value = "修改人")
-		private String updateUserName;
-	/**
-	* 修改时间
-	*/
-		@ApiModelProperty(value = "修改时间")
-		private Date updateTime;
-	/**
-	* 海运放单申请主表 id
-	*/
-		@ApiModelProperty(value = "海运放单申请主表 id")
-		private Long pApplyId;
-	/**
-	* 海运调度主表 id
-	*/
-		@ApiModelProperty(value = "海运调度主表 id")
-		private Long pDispatchId;
-	/**
-	* 海运放单主表 id
-	*/
-		@ApiModelProperty(value = "海运放单主表 id")
-		private Long pReleaseId;
-	/**
-	* 海运进出口原业务主表id
-	*/
-		@ApiModelProperty(value = "海运进出口原业务主表id")
-		private Long billId;
-	/**
-	* 海运进出口原业务单据编号
-	*/
-		@ApiModelProperty(value = "海运进出口原业务单据编号")
-		private String billNo;
-	/**
-	* 海运进出口原业务进出口, E=出口 I=进口
-	*/
-		@ApiModelProperty(value = "海运进出口原业务进出口, E=出口 I=进口")
-		private String seaType;
-	/**
-	* 海运进出口原业务单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单
-	*/
-		@ApiModelProperty(value = "海运进出口原业务单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单")
-		private String billType;
-	/**
-	* 主单 Id
-	*/
-		@ApiModelProperty(value = "主单 Id")
-		private Long masterId;
-	/**
-	* 主单单据编号
-	*/
-		@ApiModelProperty(value = "主单单据编号")
-		private String masterBillNo;
-	/**
-	* 单据日期
-	*/
-		@ApiModelProperty(value = "单据日期")
-		private Date billDate;
-	/**
-	* 海运进出口原业务创建人 Id
-	*/
-		@ApiModelProperty(value = "海运进出口原业务创建人 Id")
-		private Long userId;
-	/**
-	* 海运进出口原业务创建人
-	*/
-		@ApiModelProperty(value = "海运进出口原业务创建人")
-		private String userName;
-	/**
-	* 海运进出口原业务部门 Id
-	*/
-		@ApiModelProperty(value = "海运进出口原业务部门 Id")
-		private Long deptId;
-	/**
-	* 海运进出口原业务部门
-	*/
-		@ApiModelProperty(value = "海运进出口原业务部门")
-		private String deptName;
-	/**
-	* 操作 Id
-	*/
-		@ApiModelProperty(value = "操作 Id")
-		private Long operatorId;
-	/**
-	* 操作
-	*/
-		@ApiModelProperty(value = "操作")
-		private String operatorName;
-	/**
-	* 业务来源
-	*/
-		@ApiModelProperty(value = "业务来源")
-		private String srcType;
-	/**
-	* 来源 id
-	*/
-		@ApiModelProperty(value = "来源 id")
-		private Long srcId;
-	/**
-	* 来源中文
-	*/
-		@ApiModelProperty(value = "来源中文")
-		private String srcCnName;
-	/**
-	* 来源英文
-	*/
-		@ApiModelProperty(value = "来源英文")
-		private String srcEnName;
-	/**
-	* 客户 id
-	*/
-		@ApiModelProperty(value = "客户 id")
-		private Long corpId;
-	/**
-	* 客户中文名称
-	*/
-		@ApiModelProperty(value = "客户中文名称")
-		private String corpCnName;
-	/**
-	* 客户英文名称
-	*/
-		@ApiModelProperty(value = "客户英文名称")
-		private String corpEnName;
-	/**
-	* 电话 关联 corp_id=los_b_corps.id
-	*/
-		@ApiModelProperty(value = "电话 关联 corp_id=los_b_corps.id")
-		private String corpTel;
-	/**
-	* 传真 关联 corp_id=los_b_corps.id
-	*/
-		@ApiModelProperty(value = "传真 关联 corp_id=los_b_corps.id")
-		private String corpFax;
-	/**
-	* 电子邮箱 关联 corp_id=los_b_corps.id
-	*/
-		@ApiModelProperty(value = "电子邮箱 关联 corp_id=los_b_corps.id")
-		private String corpEmail;
-	/**
-	* 联系人姓名 关联 corp_id=los_b_corps.id
-	*/
-		@ApiModelProperty(value = "联系人姓名 关联 corp_id=los_b_corps.id")
-		private String corpAttnName;
-	/**
-	* 联系人电话 关联 corp_id=los_b_corps.id
-	*/
-		@ApiModelProperty(value = "联系人电话 关联 corp_id=los_b_corps.id")
-		private String corpAttnTel;
-	/**
-	* 航线 id
-	*/
-		@ApiModelProperty(value = "航线 id")
-		private Long lineId;
-	/**
-	* 航线中文名称
-	*/
-		@ApiModelProperty(value = "航线中文名称")
-		private String lineCnName;
-	/**
-	* 航线英文名称
-	*/
-		@ApiModelProperty(value = "航线英文名称")
-		private String lineEnName;
-	/**
-	* 船公司 id
-	*/
-		@ApiModelProperty(value = "船公司 id")
-		private Long carrierId;
-	/**
-	* 船公司中文名称
-	*/
-		@ApiModelProperty(value = "船公司中文名称")
-		private String carrierCnName;
-	/**
-	* 船公司英文名称
-	*/
-		@ApiModelProperty(value = "船公司英文名称")
-		private String carrierEnName;
-	/**
-	* 船公司约号
-	*/
-		@ApiModelProperty(value = "船公司约号")
-		private String carrierArgreementNo;
-	/**
-	* 订舱号
-	*/
-		@ApiModelProperty(value = "订舱号")
-		private String bookingNo;
-	/**
-	* 船名 id
-	*/
-		@ApiModelProperty(value = "船名 id")
-		private Long vesselId;
-	/**
-	* 中文船名
-	*/
-		@ApiModelProperty(value = "中文船名")
-		private String vesselCnName;
-	/**
-	* 英文船名
-	*/
-		@ApiModelProperty(value = "英文船名")
-		private String vesselEnName;
-	/**
-	* 航次
-	*/
-		@ApiModelProperty(value = "航次")
-		private String voyageNo;
-	/**
-	* MB/L NO
-	*/
-		@ApiModelProperty(value = "MB/L NO")
-		private String mblno;
-	/**
-	* HB/L NO
-	*/
-		@ApiModelProperty(value = "HB/L NO")
-		private String hblno;
-	/**
-	* ETD
-	*/
-		@ApiModelProperty(value = "ETD")
-		@TableField("ETD")
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	private Long id;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建部门 Id
+	 */
+	@ApiModelProperty(value = "创建部门 Id")
+	private String createDept;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private String createDeptName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 海运放单申请主表 id
+	 */
+	@ApiModelProperty(value = "海运放单申请主表 id")
+	private Long pApplyId;
+	/**
+	 * 海运调度主表 id
+	 */
+	@ApiModelProperty(value = "海运调度主表 id")
+	private Long pDispatchId;
+	/**
+	 * 海运放单主表 id
+	 */
+	@ApiModelProperty(value = "海运放单主表 id")
+	private Long pReleaseId;
+	/**
+	 * 海运进出口原业务主表id
+	 */
+	@ApiModelProperty(value = "海运进出口原业务主表id")
+	private Long billId;
+	/**
+	 * 海运进出口原业务单据编号
+	 */
+	@ApiModelProperty(value = "海运进出口原业务单据编号")
+	private String billNo;
+	/**
+	 * 海运进出口原业务进出口, E=出口 I=进口
+	 */
+	@ApiModelProperty(value = "海运进出口原业务进出口, E=出口 I=进口")
+	private String seaType;
+	/**
+	 * 海运进出口原业务单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单
+	 */
+	@ApiModelProperty(value = "海运进出口原业务单据类型, DD=直单(默认) MM=主单 MH=主分单 HH=从分单")
+	private String billType;
+	/**
+	 * 主单 Id
+	 */
+	@ApiModelProperty(value = "主单 Id")
+	private Long masterId;
+	/**
+	 * 主单单据编号
+	 */
+	@ApiModelProperty(value = "主单单据编号")
+	private String masterBillNo;
+	/**
+	 * 单据日期
+	 */
+	@ApiModelProperty(value = "单据日期")
+	private Date billDate;
+	/**
+	 * 海运进出口原业务创建人 Id
+	 */
+	@ApiModelProperty(value = "海运进出口原业务创建人 Id")
+	private Long userId;
+	/**
+	 * 海运进出口原业务创建人
+	 */
+	@ApiModelProperty(value = "海运进出口原业务创建人")
+	private String userName;
+	/**
+	 * 海运进出口原业务部门 Id
+	 */
+	@ApiModelProperty(value = "海运进出口原业务部门 Id")
+	private Long deptId;
+	/**
+	 * 海运进出口原业务部门
+	 */
+	@ApiModelProperty(value = "海运进出口原业务部门")
+	private String deptName;
+	/**
+	 * 操作 Id
+	 */
+	@ApiModelProperty(value = "操作 Id")
+	private Long operatorId;
+	/**
+	 * 操作
+	 */
+	@ApiModelProperty(value = "操作")
+	private String operatorName;
+	/**
+	 * 业务来源
+	 */
+	@ApiModelProperty(value = "业务来源")
+	private String srcType;
+	/**
+	 * 来源 id
+	 */
+	@ApiModelProperty(value = "来源 id")
+	private Long srcId;
+	/**
+	 * 来源中文
+	 */
+	@ApiModelProperty(value = "来源中文")
+	private String srcCnName;
+	/**
+	 * 来源英文
+	 */
+	@ApiModelProperty(value = "来源英文")
+	private String srcEnName;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * 电话 关联 corp_id=los_b_corps.id
+	 */
+	@ApiModelProperty(value = "电话 关联 corp_id=los_b_corps.id")
+	private String corpTel;
+	/**
+	 * 传真 关联 corp_id=los_b_corps.id
+	 */
+	@ApiModelProperty(value = "传真 关联 corp_id=los_b_corps.id")
+	private String corpFax;
+	/**
+	 * 电子邮箱 关联 corp_id=los_b_corps.id
+	 */
+	@ApiModelProperty(value = "电子邮箱 关联 corp_id=los_b_corps.id")
+	private String corpEmail;
+	/**
+	 * 联系人姓名 关联 corp_id=los_b_corps.id
+	 */
+	@ApiModelProperty(value = "联系人姓名 关联 corp_id=los_b_corps.id")
+	private String corpAttnName;
+	/**
+	 * 联系人电话 关联 corp_id=los_b_corps.id
+	 */
+	@ApiModelProperty(value = "联系人电话 关联 corp_id=los_b_corps.id")
+	private String corpAttnTel;
+	/**
+	 * 航线 id
+	 */
+	@ApiModelProperty(value = "航线 id")
+	private Long lineId;
+	/**
+	 * 航线中文名称
+	 */
+	@ApiModelProperty(value = "航线中文名称")
+	private String lineCnName;
+	/**
+	 * 航线英文名称
+	 */
+	@ApiModelProperty(value = "航线英文名称")
+	private String lineEnName;
+	/**
+	 * 船公司 id
+	 */
+	@ApiModelProperty(value = "船公司 id")
+	private Long carrierId;
+	/**
+	 * 船公司中文名称
+	 */
+	@ApiModelProperty(value = "船公司中文名称")
+	private String carrierCnName;
+	/**
+	 * 船公司英文名称
+	 */
+	@ApiModelProperty(value = "船公司英文名称")
+	private String carrierEnName;
+	/**
+	 * 船公司约号
+	 */
+	@ApiModelProperty(value = "船公司约号")
+	private String carrierArgreementNo;
+	/**
+	 * 订舱号
+	 */
+	@ApiModelProperty(value = "订舱号")
+	private String bookingNo;
+	/**
+	 * 船名 id
+	 */
+	@ApiModelProperty(value = "船名 id")
+	private Long vesselId;
+	/**
+	 * 中文船名
+	 */
+	@ApiModelProperty(value = "中文船名")
+	private String vesselCnName;
+	/**
+	 * 英文船名
+	 */
+	@ApiModelProperty(value = "英文船名")
+	private String vesselEnName;
+	/**
+	 * 航次
+	 */
+	@ApiModelProperty(value = "航次")
+	private String voyageNo;
+	/**
+	 * MB/L NO
+	 */
+	@ApiModelProperty(value = "MB/L NO")
+	private String mblno;
+	/**
+	 * HB/L NO
+	 */
+	@ApiModelProperty(value = "HB/L NO")
+	private String hblno;
+	/**
+	 * ETD
+	 */
+	@ApiModelProperty(value = "ETD")
+	@TableField("ETD")
 	private Date etd;
 	/**
-	* ETA
-	*/
-		@ApiModelProperty(value = "ETA")
-		@TableField("ETA")
+	 * ETA
+	 */
+	@ApiModelProperty(value = "ETA")
+	@TableField("ETA")
 	private Date eta;
 	/**
-	* 装货港 id
-	*/
-		@ApiModelProperty(value = "装货港 id")
-		private Long polId;
-	/**
-	* 装货港代码
-	*/
-		@ApiModelProperty(value = "装货港代码")
-		private String polCode;
-	/**
-	* 装货港英文名称
-	*/
-		@ApiModelProperty(value = "装货港英文名称")
-		private String polCnName;
-	/**
-	* 装货港英文名称
-	*/
-		@ApiModelProperty(value = "装货港英文名称")
-		private String polEnName;
-	/**
-	* 装货港英文名称打印 默认等于pol_en_name 可以编辑
-	*/
-		@ApiModelProperty(value = "装货港英文名称打印 默认等于pol_en_name 可以编辑")
-		private String polNamePrint;
-	/**
-	* 卸货港 id
-	*/
-		@ApiModelProperty(value = "卸货港 id")
-		private Long podId;
-	/**
-	* 卸货港代码
-	*/
-		@ApiModelProperty(value = "卸货港代码")
-		private String podCode;
-	/**
-	* 卸货港中文名称
-	*/
-		@ApiModelProperty(value = "卸货港中文名称")
-		private String podCnName;
-	/**
-	* 卸货港英文名称
-	*/
-		@ApiModelProperty(value = "卸货港英文名称")
-		private String podEnName;
-	/**
-	* 卸货港英文名称打印 默认等于pol_en_name 可以编辑
-	*/
-		@ApiModelProperty(value = "卸货港英文名称打印 默认等于pol_en_name 可以编辑")
-		private String podNamePrint;
-	/**
-	* 正本提单份数, ONE,TWO.THREE...
-	*/
-		@ApiModelProperty(value = "正本提单份数, ONE,TWO.THREE...")
-		private String numberOfObl;
-	/**
-	* 副本提单份数, ONE,TWO.THREE...
-	*/
-		@ApiModelProperty(value = "副本提单份数, ONE,TWO.THREE...")
-		private String numberOfCopy;
-	/**
-	* 签单方式
-	*/
-		@ApiModelProperty(value = "签单方式")
-		private String issueType;
-	/**
-	* 签单日期
-	*/
-		@ApiModelProperty(value = "签单日期")
-		private Date issueDate;
-	/**
-	* 签单地点
-	*/
-		@ApiModelProperty(value = "签单地点")
-		private Date issueAt;
-	/**
-	* 放单类型,0=自取,1=送单,2=寄送
-	*/
-		@ApiModelProperty(value = "放单类型,0=自取,1=送单,2=寄送")
-		private Integer releaseType;
-	/**
-	* 结算方式(0 票结 1月结)
-	*/
-		@ApiModelProperty(value = "结算方式(0 票结 1月结)")
-		private Integer stlMode;
-	/**
-	* 跑单员 Id
-	*/
-		@ApiModelProperty(value = "跑单员 Id")
-		private Long runnerId;
-	/**
-	* 跑单员姓名
-	*/
-		@ApiModelProperty(value = "跑单员姓名")
-		private String runnerName;
-	/**
-	* 要求时间,yyyy-MM-dd HH:mm
-	*/
-		@ApiModelProperty(value = "要求时间,yyyy-MM-dd HH:mm")
-		private Date requireTime;
-	/**
-	* 提交时间,yyyy-MM-dd HH:mm
-	*/
-		@ApiModelProperty(value = "提交时间,yyyy-MM-dd HH:mm")
-		private Date applyTime;
-	/**
-	* 跑单时间,yyyy-MM-dd HH:mm
-	*/
-		@ApiModelProperty(value = "跑单时间,yyyy-MM-dd HH:mm")
-		private Date runTime;
-	/**
-	* 操作确认时间,yyyy-MM-dd HH:mm
-	*/
-		@ApiModelProperty(value = "操作确认时间,yyyy-MM-dd HH:mm")
-		private Date confirmTime;
-	/**
-	* 调度时间,yyyy-MM-dd HH:mm
-	*/
-		@ApiModelProperty(value = "调度时间,yyyy-MM-dd HH:mm")
-		private Date dispatchTime;
-	/**
-	* 放单时间,yyyy-MM-dd HH:mm
-	*/
-		@ApiModelProperty(value = "放单时间,yyyy-MM-dd HH:mm")
-		private Date releaseTime;
-	/**
-	* 退回时间,yyyy-MM-dd HH:mm
-	*/
-		@ApiModelProperty(value = "退回时间,yyyy-MM-dd HH:mm")
-		private Date returnTime;
-	/**
-	* 退回原因
-	*/
-		@ApiModelProperty(value = "退回原因")
-		private String returnReason;
-	/**
-	* 是否换签(0 否 1是)
-	*/
-		@ApiModelProperty(value = "是否换签(0 否 1是)")
-		private Integer isSwtich;
-	/**
-	* 换签次数
-	*/
-		@ApiModelProperty(value = "换签次数")
-		private Integer swtichCount;
-	/**
-	* 换签原因
-	*/
-		@ApiModelProperty(value = "换签原因")
-		private String swtichReason;
-	/**
-	* 是否已签单(0 否 1是)
-	*/
-		@ApiModelProperty(value = "是否已签单(0 否 1是)")
-		private Integer isIssued;
-	/**
-	* 行是否选择(0 否 1是)
-	*/
-		@ApiModelProperty(value = "行是否选择(0 否 1是)")
-		private Integer isSelected;
-	/**
-	* 行等级,0=普通,1=一级,2=二级,3=三级
-	*/
-		@ApiModelProperty(value = "行等级,0=普通,1=一级,2=二级,3=三级")
-		private Integer itemLevel;
-	/**
-	* 签单状态,0=新建 1=提交 2=跑单中 3=操作确认 4=调度确认 5=放单 6=退回,或 (N,S,I,O,D,T,B)
-	*/
-		@ApiModelProperty(value = "签单状态,0=新建 1=提交 2=跑单中 3=操作确认 4=调度确认 5=放单 6=退回,或 (N,S,I,O,D,T,B)")
-		private Integer issueStatus;
-	/**
-	* 是否已产生账单(0 否 1是)
-	*/
-		@ApiModelProperty(value = "是否已产生账单(0 否 1是)")
-		private Integer isAccbill;
-	/**
-	* 本票应收人民币协议金额
-	*/
-		@ApiModelProperty(value = "本票应收人民币协议金额")
-		private BigDecimal amountDrCny;
-	/**
-	* 本票应收美元协议金额
-	*/
-		@ApiModelProperty(value = "本票应收美元协议金额")
-		private BigDecimal amountDrUsd;
-	/**
-	* 本票应收合计人民币,本票应收美元协议金额 * 汇率 + 本票应收人民币协议金额
-	*/
-		@ApiModelProperty(value = "本票应收合计人民币,本票应收美元协议金额 * 汇率 + 本票应收人民币协议金额")
-		private BigDecimal amountDrTotal;
-	/**
-	* 本票人民币未收金额
-	*/
-		@ApiModelProperty(value = "本票人民币未收金额")
-		private BigDecimal unstlDrCny;
-	/**
-	* 本票美元未收金额
-	*/
-		@ApiModelProperty(value = "本票美元未收金额")
-		private BigDecimal unstlDrUsd;
-	/**
-	* 本票未收合计人民币,美元未收金额 * 汇率 + 人民币未收金额
-	*/
-		@ApiModelProperty(value = "本票未收合计人民币,美元未收金额 * 汇率 + 人民币未收金额")
-		private BigDecimal unstlDrTotal;
-	/**
-	* 是否超单票限额 主表.limit_amount_per_bill,如果超限额,提单号(MBLNO)显示在主表.over_limit_bills 中
-	*/
-		@ApiModelProperty(value = "是否超单票限额 主表.limit_amount_per_bill,如果超限额,提单号(MBLNO)显示在主表.over_limit_bills 中")
-		private Integer isOverLimit;
-	/**
-	* 应收超单票限额金额,人民币,amount_dr_total - 主表.limit_amount_per_bill
-	*/
-		@ApiModelProperty(value = "应收超单票限额金额,人民币,amount_dr_total - 主表.limit_amount_per_bill")
-		private BigDecimal overAmountDr;
-	/**
-	* 版本
-	*/
-		@ApiModelProperty(value = "版本")
-		private String version;
-	/**
-	* 状态(0 正常 1停用)
-	*/
-		@ApiModelProperty(value = "状态(0 正常 1停用)")
-		private Integer status;
-	/**
-	* 是否已删除(0 否 1是)
-	*/
-		@ApiModelProperty(value = "是否已删除(0 否 1是)")
-		private Integer isDeleted;
-	/**
-	* 备注
-	*/
-		@ApiModelProperty(value = "备注")
-		private String remarks;
+	 * 装货港 id
+	 */
+	@ApiModelProperty(value = "装货港 id")
+	private Long polId;
+	/**
+	 * 装货港代码
+	 */
+	@ApiModelProperty(value = "装货港代码")
+	private String polCode;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polCnName;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polEnName;
+	/**
+	 * 装货港英文名称打印 默认等于pol_en_name 可以编辑
+	 */
+	@ApiModelProperty(value = "装货港英文名称打印 默认等于pol_en_name 可以编辑")
+	private String polNamePrint;
+	/**
+	 * 卸货港 id
+	 */
+	@ApiModelProperty(value = "卸货港 id")
+	private Long podId;
+	/**
+	 * 卸货港代码
+	 */
+	@ApiModelProperty(value = "卸货港代码")
+	private String podCode;
+	/**
+	 * 卸货港中文名称
+	 */
+	@ApiModelProperty(value = "卸货港中文名称")
+	private String podCnName;
+	/**
+	 * 卸货港英文名称
+	 */
+	@ApiModelProperty(value = "卸货港英文名称")
+	private String podEnName;
+	/**
+	 * 卸货港英文名称打印 默认等于pol_en_name 可以编辑
+	 */
+	@ApiModelProperty(value = "卸货港英文名称打印 默认等于pol_en_name 可以编辑")
+	private String podNamePrint;
+	/**
+	 * 正本提单份数, ONE,TWO.THREE...
+	 */
+	@ApiModelProperty(value = "正本提单份数, ONE,TWO.THREE...")
+	private String numberOfObl;
+	/**
+	 * 副本提单份数, ONE,TWO.THREE...
+	 */
+	@ApiModelProperty(value = "副本提单份数, ONE,TWO.THREE...")
+	private String numberOfCopy;
+	/**
+	 * 签单方式
+	 */
+	@ApiModelProperty(value = "签单方式")
+	private String issueType;
+	/**
+	 * 签单日期
+	 */
+	@ApiModelProperty(value = "签单日期")
+	private Date issueDate;
+	/**
+	 * 签单地点
+	 */
+	@ApiModelProperty(value = "签单地点")
+	private Date issueAt;
+	/**
+	 * 放单类型,0=自取,1=送单,2=寄送
+	 */
+	@ApiModelProperty(value = "放单类型,0=自取,1=送单,2=寄送")
+	private Integer releaseType;
+	/**
+	 * 结算方式(0 票结 1月结)
+	 */
+	@ApiModelProperty(value = "结算方式(0 票结 1月结)")
+	private Integer stlMode;
+	/**
+	 * 跑单员 Id
+	 */
+	@ApiModelProperty(value = "跑单员 Id")
+	private Long runnerId;
+	/**
+	 * 跑单员姓名
+	 */
+	@ApiModelProperty(value = "跑单员姓名")
+	private String runnerName;
+	/**
+	 * 要求时间,yyyy-MM-dd HH:mm
+	 */
+	@ApiModelProperty(value = "要求时间,yyyy-MM-dd HH:mm")
+	private Date requireTime;
+	/**
+	 * 提交时间,yyyy-MM-dd HH:mm
+	 */
+	@ApiModelProperty(value = "提交时间,yyyy-MM-dd HH:mm")
+	private Date applyTime;
+	/**
+	 * 跑单时间,yyyy-MM-dd HH:mm
+	 */
+	@ApiModelProperty(value = "跑单时间,yyyy-MM-dd HH:mm")
+	private Date runTime;
+	/**
+	 * 操作确认时间,yyyy-MM-dd HH:mm
+	 */
+	@ApiModelProperty(value = "操作确认时间,yyyy-MM-dd HH:mm")
+	private Date confirmTime;
+	/**
+	 * 调度时间,yyyy-MM-dd HH:mm
+	 */
+	@ApiModelProperty(value = "调度时间,yyyy-MM-dd HH:mm")
+	private Date dispatchTime;
+	/**
+	 * 放单时间,yyyy-MM-dd HH:mm
+	 */
+	@ApiModelProperty(value = "放单时间,yyyy-MM-dd HH:mm")
+	private Date releaseTime;
+	/**
+	 * 退回时间,yyyy-MM-dd HH:mm
+	 */
+	@ApiModelProperty(value = "退回时间,yyyy-MM-dd HH:mm")
+	private Date returnTime;
+	/**
+	 * 退回原因
+	 */
+	@ApiModelProperty(value = "退回原因")
+	private String returnReason;
+	/**
+	 * 是否换签(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否换签(0 否 1是)")
+	private Integer isSwtich;
+	/**
+	 * 换签次数
+	 */
+	@ApiModelProperty(value = "换签次数")
+	private Integer swtichCount;
+	/**
+	 * 换签原因
+	 */
+	@ApiModelProperty(value = "换签原因")
+	private String swtichReason;
+	/**
+	 * 是否已签单(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已签单(0 否 1是)")
+	private Integer isIssued;
+	/**
+	 * 行是否选择(0 否 1是)
+	 */
+	@ApiModelProperty(value = "行是否选择(0 否 1是)")
+	private Integer isSelected;
+	/**
+	 * 行等级,0=普通,1=一级,2=二级,3=三级
+	 */
+	@ApiModelProperty(value = "行等级,0=普通,1=一级,2=二级,3=三级")
+	private Integer itemLevel;
+	/**
+	 * 签单状态,0=新建 1=提交 2=跑单中 3=操作确认 4=调度确认 5=放单 6=退回,或 (N,S,I,O,D,T,B)
+	 */
+	@ApiModelProperty(value = "签单状态,0=新建 1=提交 2=跑单中 3=操作确认 4=调度确认 5=放单 6=退回,或 (N,S,I,O,D,T,B)")
+	private String issueStatus;
+	/**
+	 * 是否已产生账单(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已产生账单(0 否 1是)")
+	private Integer isAccbill;
+	/**
+	 * 本票应收人民币协议金额
+	 */
+	@ApiModelProperty(value = "本票应收人民币协议金额")
+	private BigDecimal amountDrCny;
+	/**
+	 * 本票应收美元协议金额
+	 */
+	@ApiModelProperty(value = "本票应收美元协议金额")
+	private BigDecimal amountDrUsd;
+	/**
+	 * 本票应收合计人民币,本票应收美元协议金额 * 汇率 + 本票应收人民币协议金额
+	 */
+	@ApiModelProperty(value = "本票应收合计人民币,本票应收美元协议金额 * 汇率 + 本票应收人民币协议金额")
+	private BigDecimal amountDrTotal;
+	/**
+	 * 本票人民币未收金额
+	 */
+	@ApiModelProperty(value = "本票人民币未收金额")
+	private BigDecimal unstlDrCny;
+	/**
+	 * 本票美元未收金额
+	 */
+	@ApiModelProperty(value = "本票美元未收金额")
+	private BigDecimal unstlDrUsd;
+	/**
+	 * 本票未收合计人民币,美元未收金额 * 汇率 + 人民币未收金额
+	 */
+	@ApiModelProperty(value = "本票未收合计人民币,美元未收金额 * 汇率 + 人民币未收金额")
+	private BigDecimal unstlDrTotal;
+	/**
+	 * 是否超单票限额 主表.limit_amount_per_bill,如果超限额,提单号(MBLNO)显示在主表.over_limit_bills 中
+	 */
+	@ApiModelProperty(value = "是否超单票限额 主表.limit_amount_per_bill,如果超限额,提单号(MBLNO)显示在主表.over_limit_bills 中")
+	private Integer isOverLimit;
+	/**
+	 * 应收超单票限额金额,人民币,amount_dr_total - 主表.limit_amount_per_bill
+	 */
+	@ApiModelProperty(value = "应收超单票限额金额,人民币,amount_dr_total - 主表.limit_amount_per_bill")
+	private BigDecimal overAmountDr;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
 
 	/**
 	 * 租户

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

@@ -27,7 +27,6 @@ import lombok.Data;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.sea.dto.ContainersReports;
 import org.springblade.los.business.sea.dto.WaitingBox;
-import org.springblade.los.edi.entity.EdiTypes;
 import org.springblade.los.finance.fee.dto.FeeCenterReports;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.utils.LosSpecialHandle;
@@ -1742,4 +1741,15 @@ public class Bills implements Serializable {
 	@ApiModelProperty(value = "签单状态")
 	private String issueStatus;
 
+	@TableField(exist = false)
+	private BigDecimal unreceivedAmountDr;
+	@TableField(exist = false)
+	private BigDecimal unreceivedAmountDrUsd;
+	@TableField(exist = false)
+	private BigDecimal unreceivedAmountDrLoc;
+	@TableField(exist = false)
+	private BigDecimal signForCNY;
+	@TableField(exist = false)
+	private BigDecimal signForUSD;
+
 }

+ 72 - 2
blade-service/blade-los/src/main/java/org/springblade/los/business/release/controller/SeaReleaseBillController.java

@@ -115,8 +115,8 @@ public class SeaReleaseBillController extends BladeController {
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
-	public R submit(@Valid @RequestBody SeaReleaseBill seaReleaseBill) {
-		return R.status(seaReleaseBillService.saveOrUpdate(seaReleaseBill));
+	public R submit(@Valid @RequestBody SeaReleaseBill seaReleaseBill) throws Exception{
+		return seaReleaseBillService.submit(seaReleaseBill);
 	}
 
 
@@ -130,5 +130,75 @@ public class SeaReleaseBillController extends BladeController {
 		return R.status(seaReleaseBillService.removeByIds(Func.toLongList(ids)));
 	}
 
+	/**
+	 * 申请提交
+	 */
+	@PostMapping("/application")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
+	public R application(@Valid @RequestBody SeaReleaseBill seaReleaseBill){
+		return seaReleaseBillService.application(seaReleaseBill);
+	}
+
+	/**
+	 * 撤销申请提交
+	 */
+	@PostMapping("/revokeApplication")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
+	public R revokeApplication(@Valid @RequestBody SeaReleaseBill seaReleaseBill){
+		return seaReleaseBillService.revokeApplication(seaReleaseBill);
+	}
+
+	/**
+	 * 签单确认完成
+	 */
+	@PostMapping("/signcomplete")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
+	public R signcomplete(@Valid @RequestBody SeaReleaseBill seaReleaseBill){
+		return seaReleaseBillService.signcomplete(seaReleaseBill);
+	}
+
+	/**
+	 * 撤销签单确认完成
+	 */
+	@PostMapping("/revokeSigncomplete")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
+	public R revokeSigncomplete(@Valid @RequestBody SeaReleaseBill seaReleaseBill){
+		return seaReleaseBillService.revokeSigncomplete(seaReleaseBill);
+	}
+
+	/**
+	 * 生成调度单据主表信息
+	 */
+	@PostMapping("/generateDispatch")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
+	public R generateDispatch(@Valid @RequestBody SeaReleaseBill seaReleaseBill){
+		return seaReleaseBillService.generateDispatch(seaReleaseBill);
+	}
+
+	/**
+	 * 调度完成
+	 */
+	@PostMapping("/dispatchComplete")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
+	public R dispatchComplete(@Valid @RequestBody SeaReleaseBill seaReleaseBill){
+		return seaReleaseBillService.dispatchComplete(seaReleaseBill);
+	}
+
+	/**
+	 * 调度删除
+	 */
+	@PostMapping("/removeDispatch")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaReleaseBill")
+	public R removeDispatch(@Valid @RequestBody SeaReleaseBill seaReleaseBill){
+		return seaReleaseBillService.removeDispatch(seaReleaseBill);
+	}
+
 
 }

+ 16 - 3
blade-service/blade-los/src/main/java/org/springblade/los/business/release/controller/SeaReleaseBillItemsController.java

@@ -16,6 +16,8 @@
  */
 package org.springblade.los.business.release.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;
@@ -25,8 +27,10 @@ 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.release.entity.SeaReleaseBill;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.los.business.release.entity.SeaReleaseBillItems;
@@ -66,7 +70,16 @@ public class SeaReleaseBillItemsController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入seaReleaseBillItems")
 	public R<IPage<SeaReleaseBillItems>> list(SeaReleaseBillItems seaReleaseBillItems, Query query) {
-		IPage<SeaReleaseBillItems> pages = seaReleaseBillItemsService.page(Condition.getPage(query), Condition.getQueryWrapper(seaReleaseBillItems));
+		LambdaQueryWrapper<SeaReleaseBillItems> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(SeaReleaseBillItems::getTenantId, AuthUtil.getTenantId())
+			.eq(SeaReleaseBillItems::getIsDeleted, 0)
+			.like(ObjectUtils.isNotNull(seaReleaseBillItems.getBillNo()), SeaReleaseBillItems::getBillNo, seaReleaseBillItems.getBillNo())
+			.eq(ObjectUtils.isNotNull(seaReleaseBillItems.getPReleaseId()), SeaReleaseBillItems::getPReleaseId, seaReleaseBillItems.getPReleaseId())
+			.eq(ObjectUtils.isNotNull(seaReleaseBillItems.getPApplyId()), SeaReleaseBillItems::getPApplyId, seaReleaseBillItems.getPApplyId())
+			.eq(ObjectUtils.isNotNull(seaReleaseBillItems.getPDispatchId()), SeaReleaseBillItems::getPDispatchId, seaReleaseBillItems.getPDispatchId())
+			.eq(ObjectUtils.isNotNull(seaReleaseBillItems.getIssueStatus()), SeaReleaseBillItems::getIssueStatus, seaReleaseBillItems.getIssueStatus())
+			.orderByDesc(SeaReleaseBillItems::getBillDate);
+		IPage<SeaReleaseBillItems> pages = seaReleaseBillItemsService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);
 	}
 
@@ -111,7 +124,7 @@ public class SeaReleaseBillItemsController extends BladeController {
 		return R.status(seaReleaseBillItemsService.saveOrUpdate(seaReleaseBillItems));
 	}
 
-	
+
 	/**
 	 * 删除 业务-海运放单明细
 	 */
@@ -122,5 +135,5 @@ public class SeaReleaseBillItemsController extends BladeController {
 		return R.status(seaReleaseBillItemsService.removeByIds(Func.toLongList(ids)));
 	}
 
-	
+
 }

+ 17 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/release/service/ISeaReleaseBillService.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.los.business.release.service;
 
+import org.springblade.core.tool.api.R;
 import org.springblade.los.business.release.entity.SeaReleaseBill;
 import org.springblade.los.business.release.vo.SeaReleaseBillVO;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -39,4 +40,20 @@ public interface ISeaReleaseBillService extends IService<SeaReleaseBill> {
 	IPage<SeaReleaseBillVO> selectSeaReleaseBillPage(IPage<SeaReleaseBillVO> page, SeaReleaseBillVO seaReleaseBill);
 
     SeaReleaseBill detail(SeaReleaseBill seaReleaseBill);
+
+    R submit(SeaReleaseBill seaReleaseBill)throws Exception;
+
+	R application(SeaReleaseBill seaReleaseBill);
+
+	R revokeApplication(SeaReleaseBill seaReleaseBill);
+
+	R signcomplete(SeaReleaseBill seaReleaseBill);
+
+	R revokeSigncomplete(SeaReleaseBill seaReleaseBill);
+
+	R generateDispatch(SeaReleaseBill seaReleaseBill);
+
+	R dispatchComplete(SeaReleaseBill seaReleaseBill);
+
+	R removeDispatch(SeaReleaseBill seaReleaseBill);
 }

+ 419 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/release/service/impl/SeaReleaseBillServiceImpl.java

@@ -16,19 +16,37 @@
  */
 package org.springblade.los.business.release.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 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 io.seata.spring.annotation.GlobalTransactional;
 import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.Util.IDeptUtils;
+import org.springblade.los.Util.StringTools;
+import org.springblade.los.basic.business.entity.BusinessType;
+import org.springblade.los.basic.business.service.IBusinessTypeService;
+import org.springblade.los.billno.entity.BusinessBillNo;
+import org.springblade.los.billno.service.IBusinessBillNoService;
 import org.springblade.los.business.release.entity.SeaReleaseBill;
 import org.springblade.los.business.release.entity.SeaReleaseBillItems;
 import org.springblade.los.business.release.mapper.SeaReleaseBillMapper;
 import org.springblade.los.business.release.service.ISeaReleaseBillItemsService;
 import org.springblade.los.business.release.service.ISeaReleaseBillService;
 import org.springblade.los.business.release.vo.SeaReleaseBillVO;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.mapper.BillsMapper;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 业务-海运放单 服务实现类
@@ -45,6 +63,14 @@ public class SeaReleaseBillServiceImpl extends ServiceImpl<SeaReleaseBillMapper,
 
 	private final ISysClient sysClient;
 
+	private final IDeptUtils deptUtils;
+
+	private final IBusinessTypeService bBusinessTypeService;
+
+	private final IBusinessBillNoService businessBillNoService;
+
+	private final BillsMapper billsMapper;
+
 	@Override
 	public IPage<SeaReleaseBillVO> selectSeaReleaseBillPage(IPage<SeaReleaseBillVO> page, SeaReleaseBillVO seaReleaseBill) {
 		return page.setRecords(baseMapper.selectSeaReleaseBillPage(page, seaReleaseBill));
@@ -69,4 +95,397 @@ public class SeaReleaseBillServiceImpl extends ServiceImpl<SeaReleaseBillMapper,
 		return details;
 	}
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
+	public R submit(SeaReleaseBill seaReleaseBill) throws Exception {
+		Object object = StringTools.handle(seaReleaseBill, "SeaReleaseBill");
+		SeaReleaseBill releaseBill = JSONObject.parseObject(JSONObject.toJSONString(object), SeaReleaseBill.class);
+		String deptId = "";
+		String deptName = "";
+		String branchId = deptUtils.getDeptPid() + "";
+		//获取部门ids对应中文名
+		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+			deptId = AuthUtil.getDeptId();
+			R<List<String>> res = sysClient.getDeptNames(AuthUtil.getDeptId());
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				deptName = String.join(",", res.getData());
+			}
+		}
+		if (releaseBill.getId() == null) {
+			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
+				.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
+				.eq(BusinessType::getIsDeleted, 0)
+				.eq(BusinessType::getStatus, 0)
+				.eq(BusinessType::getCode, releaseBill.getBusinessTypeCode()));
+			if (businessType == null) {
+				throw new RuntimeException("未找到可用业务类型");
+			}
+			BusinessBillNo businessBillNo = new BusinessBillNo();
+			businessBillNo.setBusinessTypeId(businessType.getId());
+			businessBillNo.setCode(releaseBill.getBillNoFormat());
+			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+			if (!clientBillNo.isSuccess()) {
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				return R.fail(500, "生成订单编号失败");
+			}
+			releaseBill.setBillNo((String) clientBillNo.getData());
+			releaseBill.setBillDate(new Date());
+			releaseBill.setCreateTime(new Date());
+			releaseBill.setCreateUser(AuthUtil.getUserId());
+			releaseBill.setCreateUserName(AuthUtil.getUserName());
+			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+				releaseBill.setBranchId(branchId);
+				releaseBill.setCreateDept(deptId);
+				releaseBill.setCreateDeptName(deptName);
+			}
+		} else {
+			releaseBill.setUpdateUser(AuthUtil.getUserId());
+			releaseBill.setUpdateTime(new Date());
+			releaseBill.setUpdateUserName(AuthUtil.getUserName());
+		}
+		this.saveOrUpdate(releaseBill);
+		//放单明细
+		if (!releaseBill.getReleaseBillList().isEmpty()) {
+			for (SeaReleaseBillItems item : releaseBill.getReleaseBillList()) {
+				item.setPReleaseId(releaseBill.getId());
+				if (item.getId() == null) {
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+						item.setCreateDept(deptId);
+						item.setBranchId(branchId);
+						item.setCreateDeptName(deptName);
+					}
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+				}
+			}
+			seaReleaseBillItemsService.saveOrUpdateBatch(releaseBill.getReleaseBillList());
+		}
+		//申请明细
+		if (!releaseBill.getApplicationList().isEmpty()) {
+			for (SeaReleaseBillItems item : releaseBill.getApplicationList()) {
+				item.setPApplyId(releaseBill.getId());
+				if (item.getId() == null) {
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					item.setRunnerId(releaseBill.getRunnerId());
+					item.setRunnerName(releaseBill.getRunnerName());
+					item.setRequireTime(releaseBill.getRequireTime());
+					if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+						item.setCreateDept(deptId);
+						item.setBranchId(branchId);
+						item.setCreateDeptName(deptName);
+					}
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+				}
+			}
+			seaReleaseBillItemsService.saveOrUpdateBatch(releaseBill.getApplicationList());
+		}
+		//调度明细
+		if (!releaseBill.getDispatchList().isEmpty()) {
+			for (SeaReleaseBillItems item : releaseBill.getDispatchList()) {
+				item.setPDispatchId(releaseBill.getId());
+				if (item.getId() == null) {
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setCreateUserName(AuthUtil.getUserName());
+					if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+						item.setCreateDept(deptId);
+						item.setBranchId(branchId);
+						item.setCreateDeptName(deptName);
+					}
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					item.setUpdateUserName(AuthUtil.getUserName());
+				}
+			}
+			seaReleaseBillItemsService.saveOrUpdateBatch(releaseBill.getDispatchList());
+		}
+		return R.data(releaseBill);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
+	public R application(SeaReleaseBill seaReleaseBill) {
+		if (null == seaReleaseBill.getId()) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		Date date = new Date();
+		seaReleaseBill.setApplyTime(date);
+		seaReleaseBill.setIssueStatus("S");
+		seaReleaseBill.setUpdateUser(AuthUtil.getUserId());
+		seaReleaseBill.setUpdateTime(date);
+		baseMapper.updateById(seaReleaseBill);
+		//申请明细
+		if (!seaReleaseBill.getApplicationList().isEmpty()) {
+			for (SeaReleaseBillItems item : seaReleaseBill.getApplicationList()) {
+				item.setIssueStatus("S");
+				item.setApplyTime(date);
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(date);
+			}
+			seaReleaseBillItemsService.updateBatchById(seaReleaseBill.getApplicationList());
+			List<Long> ids = seaReleaseBill.getApplicationList().stream().map(SeaReleaseBillItems::getBillId).collect(Collectors.toList());
+			if (!ids.isEmpty()) {
+				List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getBranchId, deptUtils.getDeptPid())
+					.in(Bills::getId, ids));
+				for (Bills item : billsList) {
+					item.setIssueStatus("S");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(date);
+					billsMapper.updateById(item);
+				}
+			}
+		}
+		return R.data(seaReleaseBill);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
+	public R revokeApplication(SeaReleaseBill seaReleaseBill) {
+		if (null == seaReleaseBill.getId()) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		seaReleaseBill.setIssueStatus("N");
+		seaReleaseBill.setUpdateUser(AuthUtil.getUserId());
+		seaReleaseBill.setUpdateTime(new Date());
+		baseMapper.updateById(seaReleaseBill);
+		//申请明细
+		if (!seaReleaseBill.getApplicationList().isEmpty()) {
+			for (SeaReleaseBillItems item : seaReleaseBill.getApplicationList()) {
+				item.setIssueStatus("N");
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+			}
+			seaReleaseBillItemsService.updateBatchById(seaReleaseBill.getApplicationList());
+			List<Long> ids = seaReleaseBill.getApplicationList().stream().map(SeaReleaseBillItems::getBillId).collect(Collectors.toList());
+			if (!ids.isEmpty()) {
+				List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getBranchId, deptUtils.getDeptPid())
+					.in(Bills::getId, ids));
+				for (Bills item : billsList) {
+					item.setIssueStatus("F");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					billsMapper.updateById(item);
+				}
+			}
+		}
+		return R.data(seaReleaseBill);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
+	public R signcomplete(SeaReleaseBill seaReleaseBill) {
+		if (null == seaReleaseBill.getId()) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		seaReleaseBill.setIssueStatus("O");
+		seaReleaseBill.setUpdateUser(AuthUtil.getUserId());
+		seaReleaseBill.setUpdateTime(new Date());
+		baseMapper.updateById(seaReleaseBill);
+		//申请明细
+		if (!seaReleaseBill.getApplicationList().isEmpty()) {
+			for (SeaReleaseBillItems item : seaReleaseBill.getApplicationList()) {
+				item.setIssueStatus("O");
+				item.setIssueDate(new Date());
+				item.setRunnerId(seaReleaseBill.getRunnerId());
+				item.setRunnerName(seaReleaseBill.getRunnerName());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+			}
+			seaReleaseBillItemsService.updateBatchById(seaReleaseBill.getApplicationList());
+			List<Long> ids = seaReleaseBill.getApplicationList().stream().map(SeaReleaseBillItems::getBillId).collect(Collectors.toList());
+			if (!ids.isEmpty()) {
+				List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getBranchId, deptUtils.getDeptPid())
+					.in(Bills::getId, ids));
+				for (Bills item : billsList) {
+					item.setIssueStatus("O");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					billsMapper.updateById(item);
+				}
+			}
+		}
+		return R.data(seaReleaseBill);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
+	public R revokeSigncomplete(SeaReleaseBill seaReleaseBill) {
+		if (null == seaReleaseBill.getId()) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		Date date = new Date();
+		seaReleaseBill.setIssueStatus("S");
+		seaReleaseBill.setUpdateUser(AuthUtil.getUserId());
+		seaReleaseBill.setUpdateTime(date);
+		baseMapper.updateById(seaReleaseBill);
+		//申请明细
+		if (!seaReleaseBill.getApplicationList().isEmpty()) {
+			for (SeaReleaseBillItems item : seaReleaseBill.getApplicationList()) {
+				item.setIssueStatus("B");
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(date);
+			}
+			seaReleaseBillItemsService.updateBatchById(seaReleaseBill.getApplicationList());
+			List<Long> ids = seaReleaseBill.getApplicationList().stream().map(SeaReleaseBillItems::getBillId).collect(Collectors.toList());
+			if (!ids.isEmpty()) {
+				List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getBranchId, deptUtils.getDeptPid())
+					.in(Bills::getId, ids));
+				for (Bills item : billsList) {
+					item.setIssueStatus("F");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(date);
+					billsMapper.updateById(item);
+				}
+			}
+		}
+		return R.data(seaReleaseBill);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
+	public R generateDispatch(SeaReleaseBill releaseBill) {
+		String deptId = "";
+		String deptName = "";
+		String branchId = deptUtils.getDeptPid() + "";
+		//获取部门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());
+			}
+		}
+		releaseBill.setBillType("D");
+		BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
+			.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
+			.eq(BusinessType::getIsDeleted, 0)
+			.eq(BusinessType::getStatus, 0)
+			.eq(BusinessType::getCode, "FDDU"));
+		if (businessType == null) {
+			throw new RuntimeException("未找到可用业务类型");
+		}
+		BusinessBillNo businessBillNo = new BusinessBillNo();
+		businessBillNo.setBusinessTypeId(businessType.getId());
+		businessBillNo.setCode("FDDU");
+		R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+		if (!clientBillNo.isSuccess()) {
+			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+			return R.fail(500, "生成订单编号失败");
+		}
+		releaseBill.setBillNo((String) clientBillNo.getData());
+		releaseBill.setBillDate(new Date());
+		releaseBill.setCreateTime(new Date());
+		releaseBill.setCreateUser(AuthUtil.getUserId());
+		releaseBill.setCreateUserName(AuthUtil.getUserName());
+		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+			releaseBill.setBranchId(branchId);
+			releaseBill.setCreateDept(deptId);
+			releaseBill.setCreateDeptName(deptName);
+		}
+		baseMapper.insert(releaseBill);
+		//调度明细
+		if (!releaseBill.getDispatchList().isEmpty()) {
+			for (SeaReleaseBillItems item : releaseBill.getDispatchList()) {
+				item.setPDispatchId(releaseBill.getId());
+				item.setIssueStatus("D");
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUserName(AuthUtil.getUserName());
+			}
+			seaReleaseBillItemsService.saveOrUpdateBatch(releaseBill.getDispatchList());
+		}
+		return R.data(releaseBill);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
+	public R dispatchComplete(SeaReleaseBill seaReleaseBill) {
+		if (null == seaReleaseBill.getId()) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		seaReleaseBill.setIssueStatus("D");
+		seaReleaseBill.setUpdateUser(AuthUtil.getUserId());
+		seaReleaseBill.setUpdateTime(new Date());
+		baseMapper.updateById(seaReleaseBill);
+		//调度
+		if (!seaReleaseBill.getDispatchList().isEmpty()) {
+			for (SeaReleaseBillItems item : seaReleaseBill.getDispatchList()) {
+				item.setIssueStatus("I");
+				item.setIssueDate(new Date());
+				item.setRunnerId(seaReleaseBill.getRunnerId());
+				item.setRunnerName(seaReleaseBill.getRunnerName());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+			}
+			seaReleaseBillItemsService.updateBatchById(seaReleaseBill.getDispatchList());
+			List<Long> ids = seaReleaseBill.getDispatchList().stream().map(SeaReleaseBillItems::getBillId).collect(Collectors.toList());
+			if (!ids.isEmpty()) {
+				List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId, AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted, 0)
+					.eq(Bills::getBranchId, deptUtils.getDeptPid())
+					.in(Bills::getId, ids));
+				for (Bills item : billsList) {
+					item.setIssueStatus("D");
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+					billsMapper.updateById(item);
+				}
+			}
+		}
+		return R.data(seaReleaseBill);
+	}
+
+	@Override
+	public R removeDispatch(SeaReleaseBill seaReleaseBill) {
+		if (null == seaReleaseBill.getId()) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		seaReleaseBill.setIsDeleted(1);
+		seaReleaseBill.setUpdateUser(AuthUtil.getUserId());
+		seaReleaseBill.setUpdateTime(new Date());
+		baseMapper.updateById(seaReleaseBill);
+		//调度
+		if (!seaReleaseBill.getDispatchList().isEmpty()) {
+			for (SeaReleaseBillItems item : seaReleaseBill.getDispatchList()) {
+				item.setIssueStatus("O");
+				item.setPDispatchId(0L);
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateTime(new Date());
+			}
+			seaReleaseBillItemsService.updateBatchById(seaReleaseBill.getDispatchList());
+		}
+		return R.data(seaReleaseBill);
+	}
+
 }

+ 12 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java

@@ -401,5 +401,17 @@ public class BillsController extends BladeController {
 		return R.data(detail);
 	}
 
+
+	/**
+	 * 放单申请查询
+	 */
+	@GetMapping("/releaseApplication")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入bills")
+	public R<List<Bills>> releaseApplication(Bills bills) {
+		List<Bills> detail = billsService.releaseApplication(bills);
+		return R.data(detail);
+	}
+
 }
 

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java

@@ -141,4 +141,6 @@ public interface IBillsService extends IService<Bills> {
 	R revokeDisembarking(String ids);
 
 	List<Bills> getDetail(Bills bills);
+
+	List<Bills> releaseApplication(Bills bills);
 }

+ 94 - 23
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -35,7 +35,6 @@ import org.springblade.los.basic.business.service.IBusinessTypeService;
 import org.springblade.los.basic.corps.entity.BCorps;
 import org.springblade.los.basic.corps.service.IBCorpsService;
 import org.springblade.los.basic.cur.service.IBCurrencyService;
-import org.springblade.los.basic.vessels.entity.BVessels;
 import org.springblade.los.billno.entity.BusinessBillNo;
 import org.springblade.los.billno.service.IBusinessBillNoService;
 import org.springblade.los.business.files.entity.FilesCenter;
@@ -123,16 +122,16 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
-	public R submit(Bills billss) throws Exception{
-		Object object = StringTools.handle(billss,"Bills");
+	public R submit(Bills billss) throws Exception {
+		Object object = StringTools.handle(billss, "Bills");
 		Bills bills = JSONObject.parseObject(JSONObject.toJSONString(object), Bills.class);
 		String deptId = "";
 		String deptName = "";
 		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
-		if (ObjectUtils.isNotNull(deptUtils.getDeptPid()+"")) {
-			deptId = deptUtils.getDeptPid()+"";
-			R<List<String>> res = sysClient.getDeptNames(deptUtils.getDeptPid()+"");
+		if (ObjectUtils.isNotNull(deptUtils.getDeptPid() + "")) {
+			deptId = deptUtils.getDeptPid() + "";
+			R<List<String>> res = sysClient.getDeptNames(deptUtils.getDeptPid() + "");
 			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
 				deptName = String.join(",", res.getData());
 			}
@@ -142,7 +141,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		}
 		List<Bills> count = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
 			.select(Bills::getId)
-			.eq(Bills::getCreateDept, deptUtils.getDeptPid()+"")
+			.eq(Bills::getCreateDept, deptUtils.getDeptPid() + "")
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.eq(Bills::getIsDeleted, 0)
 			.eq(Bills::getMblno, bills.getMblno())
@@ -182,7 +181,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setCreateUser(AuthUtil.getUserId());
 			bills.setCreateUserName(AuthUtil.getUserName());
 			bills.setTenantId(AuthUtil.getTenantId());
-			if (ObjectUtils.isNotNull(deptUtils.getDeptPid()+"")) {
+			if (ObjectUtils.isNotNull(deptUtils.getDeptPid() + "")) {
 				bills.setBranchId(branchId);
 				bills.setCreateDept(deptId);
 				bills.setCreateDeptName(deptName);
@@ -203,7 +202,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			//主单信息同步分单
 			if ("MM".equals(bills.getBillType())) {
 				Bills details = baseMapper.selectOne(new LambdaQueryWrapper<Bills>()
-					.select(Bills::getId, Bills::getVesselId, Bills::getVoyageNo, Bills::getEtd,Bills::getEta)
+					.select(Bills::getId, Bills::getVesselId, Bills::getVoyageNo, Bills::getEtd, Bills::getEta)
 					.eq(Bills::getId, bills.getId()));
 				boolean status = false;
 				if ("SE".equals(bills.getBillType())) {
@@ -225,7 +224,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 							, Bills::getFinalDestinationNamePrint, Bills::getCyId, Bills::getCyCode, Bills::getCyCnName, Bills::getCyEnName, Bills::getCyAddress
 							, Bills::getCyTel, Bills::getCyRemarks, Bills::getCyTrailerTime, Bills::getCyReturnTime, Bills::getCarrierId, Bills::getCarrierCnName
 							, Bills::getCarrierEnName, Bills::getCarrierArgreementNo, Bills::getBookingDate)
-						.eq(Bills::getCreateDept, deptUtils.getDeptPid()+"")
+						.eq(Bills::getCreateDept, deptUtils.getDeptPid() + "")
 						.eq(Bills::getTenantId, AuthUtil.getTenantId())
 						.eq(Bills::getIsDeleted, 0)
 						.eq(Bills::getMblno, bills.getMblno()));
@@ -465,7 +464,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				} else if ("CNY".equals(item.getCurCode())) {
 					amountCr = amountCr.add(item.getAmount());
 				} else {
-					BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(),"1");
+					BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(), "1");
 					amountCrUsd = amountCrUsd.add(usd);
 				}
 			}
@@ -557,7 +556,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				} else if ("CNY".equals(item.getCurCode())) {
 					amountDr = amountDr.add(item.getAmount());
 				} else {
-					BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(),"1");
+					BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(), "1");
 					amountDrUsd = amountDrUsd.add(usd);
 				}
 			}
@@ -623,7 +622,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						} else if ("CNY".equals(item.getCurCode())) {
 							amountCrM = amountCrM.add(item.getAmount());
 						} else {
-							BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(),"1");
+							BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(), "1");
 							amountCrUsdM = amountCrUsdM.add(usd);
 						}
 					} else {
@@ -632,7 +631,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						} else if ("CNY".equals(item.getCurCode())) {
 							amountDrM = amountDrM.add(item.getAmount());
 						} else {
-							BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(),"1");
+							BigDecimal usd = bCurrencyService.converter(item.getCurCode(), item.getAmount(), item.getDc(), "1");
 							amountDrUsdM = amountDrUsdM.add(usd);
 						}
 					}
@@ -664,8 +663,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				//利润 = 收 - 付
 				amountProfitM = amountDrM.subtract(amountCrM);
 				amountProfitUsdM = amountDrUsdM.subtract(amountCrUsdM);
-				amountDrLocM = amountDrLocM.add(bCurrencyService.converterCny("USD", amountDrUsdM, "D","1")).add(amountDrM);
-				amountCrLocM = amountCrLocM.add(bCurrencyService.converterCny("USD", amountCrUsdM, "C","1")).add(amountCrM);
+				amountDrLocM = amountDrLocM.add(bCurrencyService.converterCny("USD", amountDrUsdM, "D", "1")).add(amountDrM);
+				amountCrLocM = amountCrLocM.add(bCurrencyService.converterCny("USD", amountCrUsdM, "C", "1")).add(amountCrM);
 				amountProfitLocM = amountDrLocM.subtract(amountCrLocM);
 				details.setAmountDr(amountDrM);
 				details.setAmountCr(amountCrM);
@@ -685,11 +684,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		//利润 = 收 - 付
 		amountProfit = amountDr.subtract(amountCr);
 		amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
-		if(amountDrUsd.compareTo(new BigDecimal("0.00")) != 0){
-			amountDrLoc = amountDrLoc.add(bCurrencyService.converterCny("USD", amountDrUsd, "D","1")).add(amountDr);
+		if (amountDrUsd.compareTo(new BigDecimal("0.00")) != 0) {
+			amountDrLoc = amountDrLoc.add(bCurrencyService.converterCny("USD", amountDrUsd, "D", "1")).add(amountDr);
 		}
-		if(amountCrUsd.compareTo(new BigDecimal("0.00")) != 0){
-			amountCrLoc = amountCrLoc.add(bCurrencyService.converterCny("USD", amountCrUsd, "C","1")).add(amountCr);
+		if (amountCrUsd.compareTo(new BigDecimal("0.00")) != 0) {
+			amountCrLoc = amountCrLoc.add(bCurrencyService.converterCny("USD", amountCrUsd, "C", "1")).add(amountCr);
 		}
 		amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
 		bills.setAmountDr(amountDr);
@@ -779,8 +778,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
-	public R add(Bills billss) throws Exception{
-		Object object = StringTools.handle(billss,"Bills");
+	public R add(Bills billss) throws Exception {
+		Object object = StringTools.handle(billss, "Bills");
 		Bills bills = JSONObject.parseObject(JSONObject.toJSONString(object), Bills.class);
 		if (bills.getId() == null) {
 			throw new RuntimeException("缺少必要参数");
@@ -1213,7 +1212,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 
 			auditProecessDTO.setGrossProfit(amountCnyD.subtract(amountCnyC));
 			auditProecessDTO.setGrossProfitUsd(amountUsdD.subtract(amountUsdC));
-			auditProecessDTO.setGrossProfitLoc(auditProecessDTO.getGrossProfit().add(bCurrencyService.converterCny("USD", auditProecessDTO.getGrossProfitUsd(), "","1")));
+			auditProecessDTO.setGrossProfitLoc(auditProecessDTO.getGrossProfit().add(bCurrencyService.converterCny("USD", auditProecessDTO.getGrossProfitUsd(), "", "1")));
 			auditProecessDTO.setSalesCompanyName(declare.getCreateDeptName());
 			R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);
 			if (!financeProcess.isSuccess()) {
@@ -1650,5 +1649,77 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		return billsList;
 	}
 
+	@Override
+	public List<Bills> releaseApplication(Bills bills) {
+		if (ObjectUtils.isNull(bills.getMblno()) &&
+			ObjectUtils.isNull(bills.getBookingNo()) &&
+			ObjectUtils.isNull(bills.getBusinessType()) &&
+			ObjectUtils.isNull(bills.getCarrierId()) &&
+			ObjectUtils.isNull(bills.getVesselId()) &&
+			ObjectUtils.isNull(bills.getVoyageNo()) &&
+			ObjectUtils.isNull(bills.getDestinationId()) &&
+			ObjectUtils.isNull(bills.getPolId()) &&
+			ObjectUtils.isNull(bills.getBusinessType()) &&
+			ObjectUtils.isNull(bills.getCorpId())
+		) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		LambdaQueryWrapper<Bills> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(ObjectUtils.isNotNull(bills.getBusinessType()), Bills::getBusinessType, bills.getBusinessType())
+			.like(ObjectUtils.isNotNull(bills.getMblno()), Bills::getMblno, bills.getMblno())
+			.like(ObjectUtils.isNotNull(bills.getBookingNo()), Bills::getBookingNo, bills.getBookingNo())
+			.eq(ObjectUtils.isNotNull(bills.getCarrierId()), Bills::getCarrierId, bills.getCarrierId())
+			.eq(ObjectUtils.isNotNull(bills.getVesselId()), Bills::getVesselId, bills.getVesselId())
+			.eq(ObjectUtils.isNotNull(bills.getVoyageNo()), Bills::getVoyageNo, bills.getVoyageNo())
+			.eq(ObjectUtils.isNotNull(bills.getDestinationId()), Bills::getDestinationId, bills.getDestinationId())
+			.eq(ObjectUtils.isNotNull(bills.getPolId()), Bills::getPolId, bills.getPolId())
+			.eq(ObjectUtils.isNotNull(bills.getCorpId()), Bills::getCorpId, bills.getCorpId())
+			.eq(ObjectUtils.isNotNull(bills.getIssueStatus()), Bills::getIssueStatus, bills.getIssueStatus())
+			.eq(Bills::getIsDeleted, 0)
+			.eq(Bills::getTenantId, AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
+			lambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
+		}
+		if (!AuthUtil.getUserRole().contains("admin")) {
+			lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
+		}
+		List<Bills> billsList = baseMapper.selectList(lambdaQueryWrapper);
+		if (billsList.isEmpty()) {
+			throw new RuntimeException("未查到单据信息");
+		}
+		for (Bills detail : billsList) {
+			List<FeeCenter> feeCenterList = 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::getAccStatus, 1)
+				.eq(FeeCenter::getBillNo, detail.getBillNo()
+				));
+			BigDecimal receivableCNY = feeCenterList.stream().filter(e -> "CNY".equals(e.getCurCode()))
+				.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+			BigDecimal receivableUSD = feeCenterList.stream().filter(e -> "USD".equals(e.getCurCode()))
+				.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+			BigDecimal unreceivedCNY = feeCenterList.stream().filter(e -> "CNY".equals(e.getCurCode()))
+				.map(FeeCenter::getUnsettledAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+			BigDecimal unreceivedUSD = feeCenterList.stream().filter(e -> "USD".equals(e.getCurCode()))
+				.map(FeeCenter::getUnsettledAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+			BigDecimal signForCNY = feeCenterList.stream().filter(e -> "CNY".equals(e.getCurCode()) && 1 == e.getIsSignfor())
+				.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+			BigDecimal signForUSD = feeCenterList.stream().filter(e -> "USD".equals(e.getCurCode()) && 1 == e.getIsSignfor())
+				.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+			detail.setAmountDr(receivableCNY);
+			detail.setAmountDrUsd(receivableUSD);
+			detail.setAmountDrLoc(receivableCNY.add(bCurrencyService.converterCny("USD", receivableUSD, "D", "1")));
+			detail.setUnreceivedAmountDr(unreceivedCNY);
+			detail.setUnreceivedAmountDrUsd(unreceivedUSD);
+			detail.setUnreceivedAmountDrLoc(unreceivedCNY.add(bCurrencyService.converterCny("USD", unreceivedUSD, "D", "1")));
+			detail.setSignForCNY(signForCNY);
+			detail.setSignForUSD(signForUSD);
+		}
+		return billsList;
+	}
+
 
 }