Browse Source

Merge remote-tracking branch 'origin/dev' into dev

liyuan 6 months ago
parent
commit
29be77e89f
15 changed files with 1628 additions and 49 deletions
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/generalBill/dto/GeneralBillDTO.java
  2. 449 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/generalBill/entity/GeneralBill.java
  3. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/generalBill/vo/GeneralBillVO.java
  4. 149 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/controller/GeneralBillController.java
  5. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/mapper/GeneralBillMapper.java
  6. 76 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/mapper/GeneralBillMapper.xml
  7. 49 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/service/IGeneralBillService.java
  8. 445 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/service/impl/GeneralBillServiceImpl.java
  9. 16 9
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  10. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/check/controller/AuditProecessController.java
  11. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/check/service/IAuditProecessService.java
  12. 307 22
      blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java
  13. 6 6
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.java
  14. 8 6
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.xml
  15. 6 6
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/generalBill/dto/GeneralBillDTO.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.generalBill.dto;
+
+import org.springblade.los.business.generalBill.entity.GeneralBill;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 业务-海、空运舱单,快递业务,海运派车数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-06-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GeneralBillDTO extends GeneralBill {
+	private static final long serialVersionUID = 1L;
+
+}

+ 449 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/generalBill/entity/GeneralBill.java

@@ -0,0 +1,449 @@
+/*
+ *      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.generalBill.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.los.check.entity.LosAuditPathsLevels;
+import org.springblade.los.finance.fee.entity.FeeCenter;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 业务-海、空运舱单,快递业务,海运派车实体类
+ *
+ * @author BladeX
+ * @since 2025-06-19
+ */
+@Data
+@TableName("los_general_bill")
+@ApiModel(value = "GeneralBill对象", description = "业务-海、空运舱单,快递业务,海运派车")
+public class GeneralBill 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;
+	/**
+	 * 单据类型, MFS=海运舱单 MFA=空运运舱单, EXP=快递业务,TRUCK=海运派车
+	 */
+	@ApiModelProperty(value = "单据类型, MFS=海运舱单 MFA=空运运舱单, EXP=快递业务,TRUCK=海运派车")
+	private String billType;
+	/**
+	 * 业务类型,根据单据类型不同,取不同的值
+	 */
+	@ApiModelProperty(value = "业务类型,根据单据类型不同,取不同的值")
+	private String businessType;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * 单据日期
+	 */
+	@ApiModelProperty(value = "单据日期")
+	private Date billDate;
+	/**
+	 * 操作 Id
+	 */
+	@ApiModelProperty(value = "操作 Id")
+	private Long operatorId;
+	/**
+	 * 操作
+	 */
+	@ApiModelProperty(value = "操作")
+	private String operatorName;
+	/**
+	 * 核算部门 Id
+	 */
+	@ApiModelProperty(value = "核算部门 Id")
+	private String accDept;
+	/**
+	 * 核算部门
+	 */
+	@ApiModelProperty(value = "核算部门")
+	private String accDeptName;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * 业务来源
+	 */
+	@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 consignerId;
+	/**
+	 * 委托人,陆运公司中文名称
+	 */
+	@ApiModelProperty(value = "委托人,陆运公司中文名称")
+	private String consignerCnName;
+	/**
+	 * 委托人,陆运公司英文名称
+	 */
+	@ApiModelProperty(value = "委托人,陆运公司英文名称")
+	private String consignerEnName;
+	/**
+	 * 舱单平台 id
+	 */
+	@ApiModelProperty(value = "舱单平台 id")
+	private Long manifestId;
+	/**
+	 * 舱单平台中文名称
+	 */
+	@ApiModelProperty(value = "舱单平台中文名称")
+	private String manifestCnName;
+	/**
+	 * 舱单平台英文名称
+	 */
+	@ApiModelProperty(value = "舱单平台英文名称")
+	private String manifestEnName;
+	/**
+	 * 船名 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;
+	/**
+	 * Reference NO, 外提单号
+	 */
+	@ApiModelProperty(value = "Reference NO, 外提单号")
+	private String refno;
+	/**
+	 * 开船日期,发车日期
+	 */
+	@ApiModelProperty(value = "开船日期,发车日期")
+	private Date etd;
+	/**
+	 * 到港日期
+	 */
+	@ApiModelProperty(value = "到港日期")
+	private Date eta;
+	/**
+	 * 商品名称
+	 */
+	@ApiModelProperty(value = "商品名称")
+	private String commodityName;
+	/**
+	 * 装货港 id
+	 */
+	@ApiModelProperty(value = "装货港 id")
+	private Long polId;
+	/**
+	 * 装货港代码
+	 */
+	@ApiModelProperty(value = "装货港代码")
+	private String polCode;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polCnName;
+	/**
+	 * 装货港英文名称
+	 */
+	@ApiModelProperty(value = "装货港英文名称")
+	private String polEnName;
+	/**
+	 * 装货港 id
+	 */
+	@ApiModelProperty(value = "装货港 id")
+	private Long podId;
+	/**
+	 * 卸货港代码
+	 */
+	@ApiModelProperty(value = "卸货港代码")
+	private String podCode;
+	/**
+	 * 卸货港英文名称
+	 */
+	@ApiModelProperty(value = "卸货港英文名称")
+	private String podCnName;
+	/**
+	 * 卸货港英文名称
+	 */
+	@ApiModelProperty(value = "卸货港英文名称")
+	private String podEnName;
+	/**
+	 * 件数
+	 */
+	@ApiModelProperty(value = "件数")
+	private BigDecimal quantity;
+	/**
+	 * 毛重 (KGM)
+	 */
+	@ApiModelProperty(value = "毛重 (KGM)")
+	private BigDecimal grossWeight;
+	/**
+	 * 净重 (KGM)
+	 */
+	@ApiModelProperty(value = "净重 (KGM)")
+	private BigDecimal netWeight;
+	/**
+	 * 体积 (CBM)
+	 */
+	@ApiModelProperty(value = "体积 (CBM)")
+	private BigDecimal measurement;
+	/**
+	 * 箱量,箱量描述
+	 */
+	@ApiModelProperty(value = "箱量,箱量描述")
+	private String containerQuantity;
+	/**
+	 * 对账约号
+	 */
+	@ApiModelProperty(value = "对账约号")
+	private String checkRefno;
+	/**
+	 * 原操作
+	 */
+	@ApiModelProperty(value = "原操作")
+	private String srcOperatorName;
+	/**
+	 * 是否做过Amend业务,当存在对应的 Amend 业务时,值为 1(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否做过Amend业务,当存在对应的 Amend 业务时,值为 1(0 否 1是)")
+	private Integer isAmend;
+	/**
+	 * 版本
+	 */
+	@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;
+	/**
+	 * 签单状态,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;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+	/**
+	 * 本位币应收(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;
+
+	/**
+	 * 编码生成code
+	 */
+	@TableField(exist = false)
+	private String billNoFormat;
+
+	/**
+	 * 业务类型表 code
+	 */
+	@TableField(exist = false)
+	private String businessTypeCode;
+
+	/**
+	 * 物流-费用中心(付)
+	 */
+	@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;
+
+	/**
+	 * 审核路径
+	 */
+	@TableField(exist = false)
+	private List<LosAuditPathsLevels> auditPathsLevels;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/generalBill/vo/GeneralBillVO.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.generalBill.vo;
+
+import org.springblade.los.business.generalBill.entity.GeneralBill;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 业务-海、空运舱单,快递业务,海运派车视图实体类
+ *
+ * @author BladeX
+ * @since 2025-06-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "GeneralBillVO对象", description = "业务-海、空运舱单,快递业务,海运派车")
+public class GeneralBillVO extends GeneralBill {
+	private static final long serialVersionUID = 1L;
+
+}

+ 149 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/controller/GeneralBillController.java

@@ -0,0 +1,149 @@
+/*
+ *      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.generalBill.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.common.annotation.RepeatSubmit;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.business.generalBill.entity.GeneralBill;
+import org.springblade.los.business.generalBill.vo.GeneralBillVO;
+import org.springblade.los.business.generalBill.service.IGeneralBillService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 业务-海、空运舱单,快递业务,海运派车 控制器
+ *
+ * @author BladeX
+ * @since 2025-06-19
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/generalbill")
+@Api(value = "业务-海、空运舱单,快递业务,海运派车", tags = "业务-海、空运舱单,快递业务,海运派车接口")
+public class GeneralBillController extends BladeController {
+
+	private final IGeneralBillService generalBillService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入generalBill")
+	public R<GeneralBill> detail(GeneralBill generalBill) {
+		GeneralBill detail = generalBillService.detail(generalBill);
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 业务-海、空运舱单,快递业务,海运派车
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入generalBill")
+	public R<IPage<GeneralBill>> list(GeneralBill generalBill, Query query) {
+
+		IPage<GeneralBill> pages = generalBillService.page(Condition.getPage(query), Condition.getQueryWrapper(generalBill));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 业务-海、空运舱单,快递业务,海运派车
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入generalBill")
+	public R<IPage<GeneralBillVO>> page(GeneralBillVO generalBill, Query query) {
+		IPage<GeneralBillVO> pages = generalBillService.selectGeneralBillPage(Condition.getPage(query), generalBill);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 业务-海、空运舱单,快递业务,海运派车
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入generalBill")
+	public R save(@Valid @RequestBody GeneralBill generalBill) {
+		return R.status(generalBillService.save(generalBill));
+	}
+
+	/**
+	 * 修改 业务-海、空运舱单,快递业务,海运派车
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入generalBill")
+	public R update(@Valid @RequestBody GeneralBill generalBill) {
+		return R.status(generalBillService.updateById(generalBill));
+	}
+
+	/**
+	 * 新增或修改 业务-海、空运舱单,快递业务,海运派车
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入generalBill")
+	public R submit(@Valid @RequestBody GeneralBill generalBill) {
+		return generalBillService.submit(generalBill);
+	}
+
+
+	/**
+	 * 删除 业务-海、空运舱单,快递业务,海运派车
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(generalBillService.removeByIds(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 单据请核
+	 */
+	@PostMapping("/checkBills")
+	@RepeatSubmit
+	public R checkOrder(@RequestBody GeneralBill generalBill) {
+		GeneralBill declare = generalBillService.checkBills(generalBill);
+		return R.data(declare);
+	}
+
+	/**
+	 * 撤销单据请核
+	 */
+	@PostMapping("/revokeCheckBills")
+	@RepeatSubmit
+	public R revokeCheckBills(@RequestBody GeneralBill generalBill) {
+		GeneralBill declare = generalBillService.revokeCheckOrder(generalBill);
+		return R.data(declare);
+	}
+
+
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/mapper/GeneralBillMapper.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.generalBill.mapper;
+
+import org.springblade.los.business.generalBill.entity.GeneralBill;
+import org.springblade.los.business.generalBill.vo.GeneralBillVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 业务-海、空运舱单,快递业务,海运派车 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-06-19
+ */
+public interface GeneralBillMapper extends BaseMapper<GeneralBill> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param generalBill
+	 * @return
+	 */
+	List<GeneralBillVO> selectGeneralBillPage(IPage page, GeneralBillVO generalBill);
+
+}

+ 76 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/mapper/GeneralBillMapper.xml

@@ -0,0 +1,76 @@
+<?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.generalBill.mapper.GeneralBillMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="generalBillResultMap" type="org.springblade.los.business.generalBill.entity.GeneralBill">
+        <id column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_dept_name" property="createDeptName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="bill_type" property="billType"/>
+        <result column="business_type" property="businessType"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="bill_date" property="billDate"/>
+        <result column="operator_id" property="operatorId"/>
+        <result column="operator_name" property="operatorName"/>
+        <result column="acc_dept" property="accDept"/>
+        <result column="acc_dept_name" property="accDeptName"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+        <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="consigner_id" property="consignerId"/>
+        <result column="consigner_cn_name" property="consignerCnName"/>
+        <result column="consigner_en_name" property="consignerEnName"/>
+        <result column="manifest_id" property="manifestId"/>
+        <result column="manifest_cn_name" property="manifestCnName"/>
+        <result column="manifest_en_name" property="manifestEnName"/>
+        <result column="vessel_id" property="vesselId"/>
+        <result column="vessel_cn_name" property="vesselCnName"/>
+        <result column="vessel_en_name" property="vesselEnName"/>
+        <result column="voyage_no" property="voyageNo"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="refno" property="refno"/>
+        <result column="etd" property="etd"/>
+        <result column="eta" property="eta"/>
+        <result column="commodity_name" property="commodityName"/>
+        <result column="pol_id" property="polId"/>
+        <result column="pol_code" property="polCode"/>
+        <result column="pol_cn_name" property="polCnName"/>
+        <result column="pol_en_name" property="polEnName"/>
+        <result column="pod_id" property="podId"/>
+        <result column="pod_code" property="podCode"/>
+        <result column="pod_cn_name" property="podCnName"/>
+        <result column="pod_en_name" property="podEnName"/>
+        <result column="quantity" property="quantity"/>
+        <result column="gross_weight" property="grossWeight"/>
+        <result column="net_weight" property="netWeight"/>
+        <result column="measurement" property="measurement"/>
+        <result column="container_quantity" property="containerQuantity"/>
+        <result column="check_refno" property="checkRefno"/>
+        <result column="src_operator_name" property="srcOperatorName"/>
+        <result column="is_amend" property="isAmend"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="issue_status" property="issueStatus"/>
+    </resultMap>
+
+
+    <select id="selectGeneralBillPage" resultMap="generalBillResultMap">
+        select * from los_general_bill where is_deleted = 0
+    </select>
+
+</mapper>

+ 49 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/service/IGeneralBillService.java

@@ -0,0 +1,49 @@
+/*
+ *      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.generalBill.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.generalBill.entity.GeneralBill;
+import org.springblade.los.business.generalBill.vo.GeneralBillVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 业务-海、空运舱单,快递业务,海运派车 服务类
+ *
+ * @author BladeX
+ * @since 2025-06-19
+ */
+public interface IGeneralBillService extends IService<GeneralBill> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param generalBill
+	 * @return
+	 */
+	IPage<GeneralBillVO> selectGeneralBillPage(IPage<GeneralBillVO> page, GeneralBillVO generalBill);
+
+	GeneralBill detail(GeneralBill generalBill);
+
+	R submit(GeneralBill generalBill);
+
+	GeneralBill checkBills(GeneralBill generalBill);
+
+	GeneralBill revokeCheckOrder(GeneralBill generalBill);
+}

+ 445 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/generalBill/service/impl/GeneralBillServiceImpl.java

@@ -0,0 +1,445 @@
+/*
+ *      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.generalBill.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+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.StringUtil;
+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.billno.entity.BusinessBillNo;
+import org.springblade.los.billno.service.IBusinessBillNoService;
+import org.springblade.los.business.generalBill.entity.GeneralBill;
+import org.springblade.los.business.generalBill.mapper.GeneralBillMapper;
+import org.springblade.los.business.generalBill.service.IGeneralBillService;
+import org.springblade.los.business.generalBill.vo.GeneralBillVO;
+import org.springblade.los.check.dto.LosAuditProecessDTO;
+import org.springblade.los.check.entity.LosAuditPathsActs;
+import org.springblade.los.check.entity.LosAuditPathsLevels;
+import org.springblade.los.check.service.IAuditPathsActsService;
+import org.springblade.los.check.service.IAuditPathsLevelsService;
+import org.springblade.los.check.service.IAuditProecessService;
+import org.springblade.los.finance.fee.entity.FeeCenter;
+import org.springblade.los.finance.fee.service.IFeeCenterService;
+import org.springblade.system.entity.Dept;
+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.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 业务-海、空运舱单,快递业务,海运派车 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-06-19
+ */
+@Service
+@AllArgsConstructor
+public class GeneralBillServiceImpl extends ServiceImpl<GeneralBillMapper, GeneralBill> implements IGeneralBillService {
+
+	private final IFeeCenterService feeCenterService;
+
+	private final ISysClient sysClient;
+
+	private final IDeptUtils deptUtils;
+
+	private final IBusinessBillNoService businessBillNoService;
+
+	private final IBusinessTypeService bBusinessTypeService;
+
+	private final IAuditPathsActsService auditPathsActsService;
+
+	private final IAuditPathsLevelsService auditPathsLevelsService;
+
+	private final IAuditProecessService auditProecessService;
+
+	@Override
+	public IPage<GeneralBillVO> selectGeneralBillPage(IPage<GeneralBillVO> page, GeneralBillVO generalBill) {
+		return page.setRecords(baseMapper.selectGeneralBillPage(page, generalBill));
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public GeneralBill detail(GeneralBill generalBill) {
+		if (generalBill.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		GeneralBill detail = baseMapper.selectById(generalBill.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;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R submit(GeneralBill generalBill) {
+		String deptId = "";
+		String deptName = "";
+		String branchId = deptUtils.getDeptPid() + "";
+		//获取部门ids对应中文名
+		if (ObjectUtils.isNotNull(branchId)) {
+			deptId = deptUtils.getDeptPid() + "";
+			R<List<String>> res = sysClient.getDeptNames(branchId);
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				deptName = String.join(",", res.getData());
+			}
+		}
+		if (generalBill.getId() == null) {
+			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
+				.select(BusinessType::getId)
+				.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
+				.eq(BusinessType::getIsDeleted, 0)
+				.eq(BusinessType::getStatus, 0)
+				.eq(BusinessType::getCode, generalBill.getBusinessTypeCode()));
+			if (businessType == null) {
+				throw new RuntimeException("未找到可用业务类型");
+			}
+			BusinessBillNo businessBillNo = new BusinessBillNo();
+			businessBillNo.setBusinessTypeId(businessType.getId());
+			businessBillNo.setCode(generalBill.getBillNoFormat());
+			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+			if (!clientBillNo.isSuccess()) {
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				return R.fail(500, "生成订单编号失败");
+			}
+			generalBill.setBillNo((String) clientBillNo.getData());
+			generalBill.setCreateTime(new Date());
+			generalBill.setCreateUser(AuthUtil.getUserId());
+			generalBill.setCreateUserName(AuthUtil.getUserName());
+			generalBill.setTenantId(AuthUtil.getTenantId());
+			if (ObjectUtils.isNotNull(branchId)) {
+				generalBill.setBranchId(branchId);
+				generalBill.setCreateDept(deptId);
+				generalBill.setCreateDeptName(deptName);
+			}
+			// 初始创建为1
+			generalBill.setVersion("1");
+			this.save(generalBill);
+		} else {
+			GeneralBill dataSourceBill = baseMapper.selectOne(new LambdaQueryWrapper<GeneralBill>().select(GeneralBill::getId, GeneralBill::getVersion).eq(GeneralBill::getId, generalBill.getId()));
+			if (!Objects.equals(dataSourceBill.getVersion(), generalBill.getVersion())) {
+				return R.fail(601, "数据已被其他用户更新,请等待刷新后重试");
+			}
+			// 每更新一次往上累加一次版本
+			// 旧数据处理
+			int version = StringUtil.isBlank(dataSourceBill.getVersion()) ? 1 : Integer.parseInt(dataSourceBill.getVersion());
+			generalBill.setVersion(String.valueOf(version + 1));
+			generalBill.setUpdateUser(AuthUtil.getUserId());
+			generalBill.setUpdateTime(new Date());
+			generalBill.setUpdateUserName(AuthUtil.getUserName());
+		}
+		BigDecimal amountDr = new BigDecimal("0.00");
+		BigDecimal amountCr = new BigDecimal("0.00");
+		BigDecimal amountProfit;
+		BigDecimal amountDrUsd = new BigDecimal("0.00");
+		BigDecimal amountCrUsd = new BigDecimal("0.00");
+		BigDecimal amountProfitUsd;
+		BigDecimal amountDrLoc = new BigDecimal("0.00");
+		BigDecimal amountCrLoc = new BigDecimal("0.00");
+		BigDecimal amountProfitLoc;
+		List<FeeCenter> feeCenterListAll = new ArrayList<>();
+		//应付
+		if (ObjectUtils.isNotNull(generalBill.getFeeCenterListC())) {
+			for (FeeCenter item : generalBill.getFeeCenterListC()) {
+				item.setPid(generalBill.getId());
+				item.setBillNo(generalBill.getBillNo());
+				item.setBusinessType(generalBill.getBusinessType());
+				item.setBillType(generalBill.getBillType());
+				item.setBillDate(generalBill.getBillDate());
+				item.setSrcType(generalBill.getSrcType());
+				item.setSrcId(generalBill.getSrcId());
+				item.setSrcCnName(generalBill.getSrcCnName());
+				item.setSrcEnName(generalBill.getSrcEnName());
+				item.setBillCorpId(generalBill.getCorpId());
+				item.setBillCorpCnName(generalBill.getCorpCnName());
+				item.setBillCorpEnName(generalBill.getCorpEnName());
+				item.setVesselId(generalBill.getVesselId());
+				item.setVesselEnName(generalBill.getVesselEnName());
+				item.setVesselCnName(generalBill.getVesselCnName());
+				item.setVoyageNo(generalBill.getVoyageNo());
+				item.setMblno(generalBill.getMblno());
+				item.setHblno(generalBill.getHblno());
+				item.setEtd(generalBill.getEtd());
+				item.setEta(generalBill.getEta());
+				item.setPolId(generalBill.getPolId());
+				item.setPolCode(generalBill.getPolCode());
+				item.setPolCnName(generalBill.getPolCnName());
+				item.setPolEnName(generalBill.getPolEnName());
+				item.setPodId(generalBill.getPodId());
+				item.setPodCode(generalBill.getPodCode());
+				item.setPodCnName(generalBill.getPodCnName());
+				item.setPodEnName(generalBill.getPodEnName());
+				item.setRefno(generalBill.getRefno());
+				if ("USD".equals(item.getCurCode())) {
+					amountCrUsd = amountCrUsd.add(item.getAmount());
+					amountCrLoc = amountCrLoc.add(item.getAmount().multiply(item.getExrate()));
+				} else if ("CNY".equals(item.getCurCode())) {
+					amountCr = amountCr.add(item.getAmount());
+					amountCrLoc = amountCrLoc.add(item.getAmount());
+				} else {
+					BigDecimal usd = item.getAmount().multiply(item.getExrate());
+					amountCrUsd = amountCrUsd.add(usd);
+					amountCrLoc = amountCrLoc.add(usd);
+				}
+				feeCenterListAll.add(item);
+			}
+		}
+		//应收
+		if (ObjectUtils.isNotNull(generalBill.getFeeCenterListD())) {
+			for (FeeCenter item : generalBill.getFeeCenterListD()) {
+				item.setPid(generalBill.getId());
+				item.setBillNo(generalBill.getBillNo());
+				item.setBusinessType(generalBill.getBusinessType());
+				item.setBillType(generalBill.getBillType());
+				item.setBillDate(generalBill.getBillDate());
+				item.setSrcType(generalBill.getSrcType());
+				item.setSrcId(generalBill.getSrcId());
+				item.setSrcCnName(generalBill.getSrcCnName());
+				item.setSrcEnName(generalBill.getSrcEnName());
+				item.setBillCorpId(generalBill.getCorpId());
+				item.setBillCorpCnName(generalBill.getCorpCnName());
+				item.setBillCorpEnName(generalBill.getCorpEnName());
+				item.setVesselId(generalBill.getVesselId());
+				item.setVesselEnName(generalBill.getVesselEnName());
+				item.setVesselCnName(generalBill.getVesselCnName());
+				item.setVoyageNo(generalBill.getVoyageNo());
+				item.setMblno(generalBill.getMblno());
+				item.setHblno(generalBill.getHblno());
+				item.setEtd(generalBill.getEtd());
+				item.setEta(generalBill.getEta());
+				item.setPolId(generalBill.getPolId());
+				item.setPolCode(generalBill.getPolCode());
+				item.setPolCnName(generalBill.getPolCnName());
+				item.setPolEnName(generalBill.getPolEnName());
+				item.setPodId(generalBill.getPodId());
+				item.setPodCode(generalBill.getPodCode());
+				item.setPodCnName(generalBill.getPodCnName());
+				item.setPodEnName(generalBill.getPodEnName());
+				item.setRefno(generalBill.getRefno());
+				if ("USD".equals(item.getCurCode())) {
+					amountDrUsd = amountDrUsd.add(item.getAmount());
+					amountDrLoc = amountDrLoc.add(item.getAmount().multiply(item.getExrate()));
+				} else if ("CNY".equals(item.getCurCode())) {
+					amountDr = amountDr.add(item.getAmount());
+					amountDrLoc = amountDrLoc.add(item.getAmount());
+				} else {
+					BigDecimal usd = item.getAmount().multiply(item.getExrate());
+					amountDrUsd = amountDrUsd.add(usd);
+					amountDrLoc = amountDrLoc.add(usd);
+				}
+				feeCenterListAll.add(item);
+			}
+		}
+		if (!feeCenterListAll.isEmpty()) {
+			feeCenterService.submitListOptimization(feeCenterListAll);
+		}
+		//利润 = 收 - 付
+		amountProfit = amountDr.subtract(amountCr);
+		amountProfitUsd = amountDrUsd.subtract(amountCrUsd);
+		amountProfitLoc = amountDrLoc.subtract(amountCrLoc);
+		generalBill.setAmountDr(amountDr);
+		generalBill.setAmountCr(amountCr);
+		generalBill.setAmountProfit(amountProfit);
+		generalBill.setAmountDrUsd(amountDrUsd);
+		generalBill.setAmountCrUsd(amountCrUsd);
+		generalBill.setAmountProfitUsd(amountProfitUsd);
+		generalBill.setAmountDrLoc(amountDrLoc);
+		generalBill.setAmountCrLoc(amountCrLoc);
+		generalBill.setAmountProfitLoc(amountProfitLoc);
+		LocalDateTime now = LocalDateTime.now();
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+		String formatted = now.format(formatter);
+		System.out.println("起2 " + formatted);
+		this.updateById(generalBill);
+		LocalDateTime now2 = LocalDateTime.now();
+		String formatted2 = now2.format(formatter);
+		System.out.println("止2 " + formatted2);
+		return R.data(generalBill);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public GeneralBill checkBills(GeneralBill generalBill) {
+		GeneralBill declare = baseMapper.selectById(generalBill.getId());
+		Integer actId = null;
+		String processType = "";
+		String checkType = "";
+		if ("MFS".equals(declare.getBillType())) {
+			actId = 1130;
+			processType = "海运舱单审核";
+			checkType = "MFS";
+		} else if ("MFA".equals(declare.getBillType())) {
+			actId = 1132;
+			processType = "空运舱单审核";
+			checkType = "MFA";
+		} else if ("EXP".equals(declare.getBillType())) {
+			actId = 1128;
+			processType = "快递业务审核";
+			checkType = "EXP";
+		} else if ("TRUCK".equals(declare.getBillType())) {
+			actId = 1134;
+			processType = "海运派车审核";
+			checkType = "TRUCK";
+		}
+		//审批数据
+		LosAuditProecessDTO auditProecessDTO = new LosAuditProecessDTO();
+		//获取审批级次
+		List<LosAuditPathsLevels> auditPathsLevels;
+		// 判断是否有审批流,如果审批流已开启就进入审批流,否则直接走申请通过
+		LosAuditPathsActs pathsActs;
+		//是否开启流程
+		LambdaQueryWrapper<LosAuditPathsActs> auditPathsActsLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		auditPathsActsLambdaQueryWrapper
+			.eq(LosAuditPathsActs::getIsEnable, 1)
+			.eq(LosAuditPathsActs::getFidStatus, "status")
+			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId())
+			.eq(LosAuditPathsActs::getSalesCompanyId, deptUtils.getDeptPid())
+			.eq(LosAuditPathsActs::getActId, actId);
+		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
+		//获取审批信息
+		LosAuditPathsActs losAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<LosAuditPathsActs>()
+			.eq(LosAuditPathsActs::getActId, actId)
+			.eq(LosAuditPathsActs::getFidStatus, "status")
+			.eq(LosAuditPathsActs::getSalesCompanyId, deptUtils.getDeptPid())
+			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
+		Long pathId = losAuditPathsActs.getPathId();
+		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<LosAuditPathsLevels>()
+			.eq(LosAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(LosAuditPathsLevels::getPathId, pathId));
+		auditProecessDTO.setTimes(1);
+		auditProecessDTO.setProcessType(processType);
+		List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+			.eq(FeeCenter::getIsDeleted, 0)
+			.eq(FeeCenter::getPid, declare.getId()));
+		if (feeCenterList.isEmpty()) {
+			throw new RuntimeException("请维护费用信息");
+		}
+		// 没开启审批流直接走 通过流程
+		if (pathsActs == null || pathsActs.getIsEnable() == 2) {
+			throw new SecurityException("当前租户未查询到审批流配置");
+		} else {
+			if (CollectionUtils.isEmpty(auditPathsLevels)) {
+				throw new SecurityException("开启审批失败:未查询到审批信息");
+			}
+			// 绑定审核类型
+			auditProecessDTO.setCheckType(checkType);
+			// 追加跳转路由url
+			auditProecessDTO.setUrl(generalBill.getUrl());
+			auditProecessDTO.setPageStatus(generalBill.getPageStatus());
+			auditProecessDTO.setPageLabel(generalBill.getPageLabel());
+			auditProecessDTO.setOrderRemark(declare.getRemarks());
+			List<LosAuditPathsLevels> pathsLevelsList = generalBill.getAuditPathsLevels();
+			if (ObjectUtils.isNotNull(pathsLevelsList) && !pathsLevelsList.isEmpty()) {
+				List<Long> idList = pathsLevelsList.stream().map(LosAuditPathsLevels::getId).collect(Collectors.toList());
+				List<LosAuditPathsLevels> levelsList = new ArrayList<>();
+				for (LosAuditPathsLevels item : auditPathsLevels) {
+					if (2 == item.getUserMold()) {
+						if (idList.contains(item.getId())) {
+							levelsList.add(item);
+						}
+					} else {
+						levelsList.add(item);
+					}
+				}
+				auditProecessDTO.setPathsLevelsList(levelsList);
+			} else {
+				auditProecessDTO.setPathsLevelsList(auditPathsLevels);
+			}
+			auditProecessDTO.setActId(1);
+			auditProecessDTO.setSrcBillId(declare.getId());
+			auditProecessDTO.setBillId(declare.getId());
+			auditProecessDTO.setBillNo(declare.getBillNo());
+			auditProecessDTO.setSendUserId(AuthUtil.getUserId());
+			auditProecessDTO.setSendName(AuthUtil.getUserName());
+			auditProecessDTO.setSendTime(new Date());
+			auditProecessDTO.setBillTime(declare.getBillDate());
+			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
+			auditProecessDTO.setCorpId(declare.getCorpId());
+			auditProecessDTO.setCorpsName(declare.getCorpCnName());
+			auditProecessDTO.setReferenceNumber(declare.getMblno());
+			auditProecessDTO.setMorderNo(declare.getMblno());
+			Dept dept = deptUtils.getDept(declare.getCreateDept());
+			if (dept != null) {
+				auditProecessDTO.setSalesCompanyId(dept.getId());
+				auditProecessDTO.setSalesCompanyName(dept.getDeptName());
+			}
+			auditProecessDTO.setPayAmount(declare.getAmountCrLoc());
+			auditProecessDTO.setReceivableAmount(declare.getAmountDrLoc());
+			auditProecessDTO.setGrossProfit(declare.getAmountProfit());
+			auditProecessDTO.setGrossProfitUsd(declare.getAmountProfitUsd());
+			auditProecessDTO.setGrossProfitLoc(declare.getAmountProfitLoc());
+			auditProecessDTO.setSalesCompanyName(declare.getCreateDeptName());
+			auditProecessDTO.setSrcId(declare.getSrcId());
+			auditProecessDTO.setSrcCnName(declare.getSrcCnName());
+			auditProecessDTO.setSrcEnName(declare.getSrcEnName());
+			R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);
+			if (!financeProcess.isSuccess()) {
+				throw new SecurityException("操作失败,请联系管理员");
+			}
+		}
+		declare.setStatus(1);
+		baseMapper.updateById(declare);
+		return declare;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public GeneralBill revokeCheckOrder(GeneralBill generalBill) {
+		GeneralBill declare = baseMapper.selectById(generalBill.getId());
+		if (3 == declare.getStatus()) {
+			throw new SecurityException("审核已通过,撤销失败");
+		}
+		R financeProcess = auditProecessService.deteleByBillId(generalBill.getId());
+		if (!financeProcess.isSuccess()) {
+			throw new SecurityException("操作失败,请联系管理员");
+		}
+		declare.setStatus(0);
+		baseMapper.updateById(declare);
+		return declare;
+	}
+
+}

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

@@ -285,6 +285,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				return R.fail(500, "生成订单编号失败");
 			}
 			bills.setBillNo((String) clientBillNo.getData());
+			if (!baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.select(Bills::getId)
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.eq(Bills::getBillNo, bills.getBillNo())).isEmpty()) {
+				throw new RuntimeException("业务编号 在系统中不能重复");
+			}
 			bills.setCreateTime(new Date());
 			bills.setCreateUser(AuthUtil.getUserId());
 			bills.setCreateUserName(AuthUtil.getUserName());
@@ -3669,14 +3676,14 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				.eq(PreContainers::getIsDeleted, 0)
 				.in(PreContainers::getPid, Func.toLongList(ids)));
 		}
-		String type ="";
-		if ("SE".equals(billsList.get(0).getBusinessType())){
+		String type = "";
+		if ("SE".equals(billsList.get(0).getBusinessType())) {
 			type = "HYCK";
-		}else if ("SI".equals(billsList.get(0).getBusinessType())){
+		} else if ("SI".equals(billsList.get(0).getBusinessType())) {
 			type = "HYJK";
-		}else if ("AI".equals(billsList.get(0).getBusinessType())){
+		} else if ("AI".equals(billsList.get(0).getBusinessType())) {
 			type = "KYJK";
-		}else if ("AE".equals(billsList.get(0).getBusinessType())){
+		} else if ("AE".equals(billsList.get(0).getBusinessType())) {
 			type = "KYCK";
 		}
 		BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
@@ -3697,7 +3704,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			copyBills.setId(null);
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
-			if ("SE,SI".contains(item.getBusinessType())){
+			if ("SE,SI".contains(item.getBusinessType())) {
 				if ("dry".equals(copyBills.getCargoType())) {
 					businessBillNo.setCode(type + "-PH");
 				} else if ("danger".equals(copyBills.getCargoType())) {
@@ -3707,7 +3714,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				} else {
 					businessBillNo.setCode(type + "-PH");
 				}
-			}else{
+			} else {
 				businessBillNo.setCode(type);
 			}
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
@@ -3883,9 +3890,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>().in(Bills::getId, updateBillsFieldVo.getIds()));
 		List<Integer> statusList = Arrays.asList(1, 2, 3);
 		// 筛选不可更改状态的数据
-		Bills notUpdateBills = billsList.stream().filter(e -> !statusList.contains(e.getStatus()) || e.getIsDeleted() == 1).findFirst().orElse(null);
+		Bills notUpdateBills = billsList.stream().filter(e -> statusList.contains(e.getStatus()) || e.getIsDeleted() == 1).findFirst().orElse(null);
 		if (notUpdateBills != null) {
-			return R.fail("单据编号为" + notUpdateBills.getBillNo() + "的记录不能修改");
+			return R.fail("单据编号为" + notUpdateBills.getBillNo() + "的记录已提交审核或审核通过不能修改");
 		}
 		for (Bills bills : billsList) {
 			Bills updateBills = new Bills();

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/check/controller/AuditProecessController.java

@@ -262,6 +262,9 @@ public class AuditProecessController extends BladeController {
 			|| "FFSQ-WK".equals(proecess.getCheckType()) || "YSQR-D".equals(proecess.getCheckType())
 			|| "YSQR-C".equals(proecess.getCheckType())) {
 			auditProecessService.agentCheck(auditProecess);
+		}else if ("MFS".equals(proecess.getCheckType()) || "MFA".equals(proecess.getCheckType())
+			|| "EXP".equals(proecess.getCheckType()) || "TRUCK".equals(proecess.getCheckType())) {
+			auditProecessService.generalBillCheck(auditProecess);
 		}
 		return R.data(auditProecess);
 	}

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/check/service/IAuditProecessService.java

@@ -70,4 +70,6 @@ public interface IAuditProecessService extends IService<LosAuditProecess> {
 	void agentCheck(LosAuditProecess auditProecess);
 
 	R deteleByBillIdAndType(Long id, String paidApplication);
+
+	void generalBillCheck(LosAuditProecess auditProecess);
 }

+ 307 - 22
blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java

@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import io.seata.spring.annotation.GlobalTransactional;
 import lombok.AllArgsConstructor;
 import org.springblade.client.entity.Message;
 import org.springblade.client.feign.IMessageClient;
@@ -48,6 +47,8 @@ import org.springblade.los.business.amends.entity.Amends;
 import org.springblade.los.business.amends.mapper.AmendsMapper;
 import org.springblade.los.business.customsDeclaration.entity.CustomsDeclaration;
 import org.springblade.los.business.customsDeclaration.mapper.CustomsDeclarationMapper;
+import org.springblade.los.business.generalBill.entity.GeneralBill;
+import org.springblade.los.business.generalBill.mapper.GeneralBillMapper;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.mapper.BillsMapper;
 import org.springblade.los.check.dto.LosAuditProecessDTO;
@@ -141,6 +142,8 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 
 	private final IBCurrencyService bCurrencyService;
 
+	private final GeneralBillMapper generalBillMapper;
+
 
 	@Override
 	public IPage<LosAuditProecessVO> selectAuditProecessPage(IPage<LosAuditProecessVO> page, LosAuditProecessVO auditProecess) {
@@ -219,7 +222,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					if (corpMessage != null) {
 						corpName = corpMessage.getCorpName();
 					}
-				}else{
+				} else {
 					corpName = auditProecessDTO.getCorpsName();
 				}
 				String billsDate = null;
@@ -235,12 +238,13 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					message.setMessageBody("您有新的单据审核,客户名:" + corpName + "," + "业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ " 提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
-				}if ("海运进口审核".equals(auditProecessDTO.getProcessType())) {
+				}
+				if ("海运进口审核".equals(auditProecessDTO.getProcessType())) {
 					message.setMessageBody("您有新的单据审核,客户名:" + corpName + "," + "业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ " 提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
-				}else if ("贸易代理单据审核".equals(auditProecess.getProcessType())) {
-					message.setMessageBody("您有新的贸易代理审核,业务单号:" + auditProecessDTO.getBillNo()  + ",请审核。"
+				} else if ("贸易代理单据审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的贸易代理审核,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
 				} else if ("贸易代理货款付费申请".equals(auditProecess.getProcessType())) {
@@ -252,27 +256,43 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
 				} else if ("贸易代理货款付费确认".equals(auditProecess.getProcessType())) {
-					message.setMessageBody("您有新的贸易代理货款付费待确认,业务单号:" + auditProecessDTO.getBillNo()+",请审核。"
+					message.setMessageBody("您有新的贸易代理货款付费待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
+						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
+					);
+				} else if ("付费申请".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的付费申请待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
-				}else if ("付费申请".equals(auditProecess.getProcessType())) {
-					message.setMessageBody("您有新的付费申请待确认,业务单号:" + auditProecessDTO.getBillNo()+",请审核。"
+				} else if ("海运出口AMEND".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的海运出口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
-				}else if ("海运出口AMEND".equals(auditProecess.getProcessType())) {
-					message.setMessageBody("您有新的海运口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo()+",请审核。"
+				} else if ("海运进口AMEND".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的海运口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
-				}else if ("海运进口AMEND".equals(auditProecess.getProcessType())) {
-					message.setMessageBody("您有新的海运进口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo()+",请审核。"
+				} else if ("空运出口AMEND".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的空运出口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
-				}else if ("空运出口AMEND".equals(auditProecess.getProcessType())) {
-					message.setMessageBody("您有新的空运口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo()+",请审核。"
+				} else if ("空运进口AMEND".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的空运口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
-				}else if ("空运进口AMEND".equals(auditProecess.getProcessType())) {
-					message.setMessageBody("您有新的空运进口AMEND待确认,业务单号:" + auditProecessDTO.getBillNo()+",请审核。"
+				} else if ("海运舱单审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的海运舱单审核待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
+						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
+					);
+				} else if ("空运舱单审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的空运舱单审核待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
+						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
+					);
+				} else if ("快递业务审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的快递业务审核待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
+						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
+					);
+				} else if ("海运派车审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的海运派车审核待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
 				}
@@ -394,7 +414,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 						throw new SecurityException("审批通过失败");
 					}
 					detail.setStatus(2);
-					int version = StringUtil.isBlank(detail.getVersion()) ? 1 :Integer.parseInt(detail.getVersion());
+					int version = StringUtil.isBlank(detail.getVersion()) ? 1 : Integer.parseInt(detail.getVersion());
 					detail.setVersion(String.valueOf(version + 1));
 					int count = billsMapper.updateById(detail);
 					if (count == 0) {
@@ -479,7 +499,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				if (detail == null) {
 					throw new SecurityException("审批通过失败");
 				}
-				int version = StringUtil.isBlank(detail.getVersion()) ? 1 :Integer.parseInt(detail.getVersion());
+				int version = StringUtil.isBlank(detail.getVersion()) ? 1 : Integer.parseInt(detail.getVersion());
 				detail.setVersion(String.valueOf(version + 1));
 				detail.setStatus(4);
 				int count = billsMapper.updateById(detail);
@@ -519,7 +539,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				if (bills == null) {
 					throw new SecurityException("审批通过失败");
 				}
-				int version = StringUtil.isBlank(detail.getVersion()) ? 1 :Integer.parseInt(detail.getVersion());
+				int version = StringUtil.isBlank(detail.getVersion()) ? 1 : Integer.parseInt(detail.getVersion());
 				detail.setVersion(String.valueOf(version + 1));
 				detail.setStatus(3);
 				detail.setBillStatus(3);
@@ -3379,7 +3399,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				}
 				if ("FFSQ-SK".equals(auditProecess.getPaidApplication())) {
 					detail.setFirstStatus("录入");
-				}  else {
+				} else {
 					detail.setBusinessStatus("录入");
 				}
 				int count = agentMapper.updateById(detail);
@@ -3390,7 +3410,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					sendMessage.setMessageBody("您的贸易代理审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
 				} else if ("贸易代理货款付费申请".equals(auditProecess.getProcessType())) {
 					sendMessage.setMessageBody("您的贸易代理货款付费申请未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
-				}  else if ("贸易代理货款收费确认".equals(auditProecess.getProcessType())) {
+				} else if ("贸易代理货款收费确认".equals(auditProecess.getProcessType())) {
 					sendMessage.setMessageBody("您的贸易代理货款收费确认未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
 				} else if ("贸易代理货款付费确认".equals(auditProecess.getProcessType())) {
 					sendMessage.setMessageBody("您的贸易代理货款付费确认未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
@@ -3444,7 +3464,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				}
 				if ("FFSQ-SK".equals(auditProecess.getPaidApplication())) {
 					detail.setFirstStatus("录入");
-				}else {
+				} else {
 					detail.setBusinessStatus("录入");
 				}
 				int count = agentMapper.updateById(detail);
@@ -3484,6 +3504,271 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 	}
 
 	@Override
+	public void generalBillCheck(LosAuditProecess auditProecess) {
+		//查看最新操作记录,防止重复提交
+		LosAuditProecess proecessTemp = baseMapper.selectById(auditProecess.getId());
+		if (proecessTemp == null) {
+			throw new SecurityException("未查到此审批记录,禁止操作");
+		}
+		if ("A".equals(proecessTemp.getAuditStatus()) || "B".equals(proecessTemp.getAuditStatus())) {
+			throw new SecurityException("当前记录已经完成审批,禁止重复操作");
+		}
+
+		if (auditProecess.getAuditStatus() == null || !"S".equals(auditProecess.getAuditStatus())) {
+			throw new SecurityException("审批状态非待审,禁止操作");
+		}
+		//信息
+		Message sendMessage = new Message();
+		sendMessage.setParameter(String.valueOf(auditProecess.getBillId()));
+		sendMessage.setUserName(AuthUtil.getUserName());
+		sendMessage.setUserId(AuthUtil.getUserId());
+		sendMessage.setToUserId(auditProecess.getSendUserId());
+		sendMessage.setToUserName(auditProecess.getSendName());
+		sendMessage.setMessageType(1);
+		sendMessage.setTenantId(AuthUtil.getTenantId());
+		sendMessage.setCreateUser(AuthUtil.getUserId());
+		sendMessage.setCreateTime(new Date());
+		sendMessage.setUrl(auditProecess.getUrl());
+		sendMessage.setPageLabel(auditProecess.getPageLabel());
+		sendMessage.setPageStatus(auditProecess.getPageStatus());
+
+		//用户操作 1.通过  2.驳回
+		Integer operate = auditProecess.getOperate();
+		//查看当前审批是否为最后一级
+		String iffinalItem = auditProecess.getIffinalItem();
+		//审批人
+		auditProecess.setAuditUserId(String.valueOf(AuthUtil.getUserId()));
+		//审批时间
+		auditProecess.setAuditOpTime(new Date());
+
+		GeneralBill bills = generalBillMapper.selectById(proecessTemp.getBillId());
+		if (bills == null) {
+			throw new SecurityException("审批失败");
+		}
+		//不是最后一级
+		if ("F".equals(iffinalItem)) {
+			//通过
+			if (operate == 1) {
+				//如果是第一级, 则修改状态为审批中
+				if (auditProecess.getLevelId() == 1) {
+					bills.setStatus(2);
+					int version = StringUtil.isBlank(bills.getVersion()) ? 1 : Integer.parseInt(bills.getVersion());
+					bills.setVersion(String.valueOf(version + 1));
+					int count = generalBillMapper.updateById(bills);
+					if (count == 0) {
+						throw new SecurityException("审批开始修改审核状态失败");
+					}
+					List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+						.eq(FeeCenter::getIsDeleted, 0)
+						.eq(FeeCenter::getPid, bills.getId()));
+					for (FeeCenter item : feeCenterList) {
+						item.setApproverId(AuthUtil.getUserId());
+						item.setApproverName(AuthUtil.getUserName());
+						item.setApproveTime(new Date());
+					}
+					feeCenterService.saveOrUpdateBatch(feeCenterList);
+				}
+
+				auditProecess.setAuditStatus("A");
+				//查询下一级,开启待审
+				LambdaQueryWrapper<LosAuditProecess> auditProecessLambdaQueryWrapper = new LambdaQueryWrapper<>();
+				auditProecessLambdaQueryWrapper
+					.eq(LosAuditProecess::getBatchNo, auditProecess.getBatchNo())
+					.eq(LosAuditProecess::getSrcBillId, auditProecess.getSrcBillId())
+					.eq(LosAuditProecess::getIsDelete, 0)
+					.eq(LosAuditProecess::getActId, auditProecess.getActId())
+					.eq(LosAuditProecess::getBillId, auditProecess.getBillId())
+					.eq(LosAuditProecess::getBillNo, auditProecess.getBillNo())
+					.eq(LosAuditProecess::getTenantId, AuthUtil.getTenantId())
+					.eq(LosAuditProecess::getLevelId, auditProecess.getLevelId() + 1);
+				Integer count = baseMapper.selectCount(auditProecessLambdaQueryWrapper);
+				if (count != null && count > 1) {
+					throw new SecurityException("审核失败,获取下一级信息失败");
+				}
+				LosAuditProecess proecess = baseMapper.selectOne(auditProecessLambdaQueryWrapper);
+				if (proecess == null) {
+					throw new SecurityException("审批通过=>获取下一级信息失败");
+				}
+				proecess.setAuditStatus("S");
+				baseMapper.updateById(proecess);
+
+				SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
+
+				//获得订单创建日期
+				String billsDate = null;
+				if (proecessTemp.getBillId() != null) {
+					billsDate = simpleDateFormat.format(bills.getCreateTime());
+				}
+
+				Message message = new Message();
+				message.setUserName(AuthUtil.getUserName());
+				message.setUserId(AuthUtil.getUserId());
+				message.setParameter(String.valueOf(auditProecess.getBillId()));
+				message.setMessageType(1);
+				message.setTenantId(AuthUtil.getTenantId());
+				message.setUrl(auditProecess.getUrl());
+				message.setPageLabel(auditProecess.getPageLabel());
+				message.setPageStatus(auditProecess.getPageStatus());
+				if ("海运舱单审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的海运舱单审核,业务单号:" + proecessTemp.getBillNo() + ","
+						+ "单据日期:" + billsDate + ",请审核。"
+						+ "提交人:" + proecessTemp.getSendName() + "  " + "提交时间" + simpleDateFormat.format(proecessTemp.getSendTime())
+					);
+				} else if ("空运舱单审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的空运舱单审核,业务单号:" + proecessTemp.getBillNo() + ","
+						+ "单据日期:" + billsDate + ",请审核。"
+						+ "提交人:" + proecessTemp.getSendName() + "  " + "提交时间" + simpleDateFormat.format(proecessTemp.getSendTime())
+					);
+				} else if ("快递业务审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的快递业务审核,业务单号:" + proecessTemp.getBillNo() + ","
+						+ "单据日期:" + billsDate + ",请审核。"
+						+ "提交人:" + proecessTemp.getSendName() + "  " + "提交时间" + simpleDateFormat.format(proecessTemp.getSendTime())
+					);
+				} else if ("海运派车审核".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的海运派车审核,业务单号:" + proecessTemp.getBillNo() + ","
+						+ "单据日期:" + billsDate + ",请审核。"
+						+ "提交人:" + proecessTemp.getSendName() + "  " + "提交时间" + simpleDateFormat.format(proecessTemp.getSendTime())
+					);
+				}
+				message.setCreateUser(AuthUtil.getUserId());
+				message.setCreateTime(new Date());
+
+				// 消息批量通知下一级
+				sendMsgToGroup(message, proecess.getAuditUserId());
+			}
+			//不通过
+			else if (operate == 2) {
+				auditProecess.setAuditStatus("B");
+				int version = StringUtil.isBlank(bills.getVersion()) ? 1 : Integer.parseInt(bills.getVersion());
+				bills.setVersion(String.valueOf(version + 1));
+				bills.setStatus(4);
+				int count = generalBillMapper.updateById(bills);
+				if (count == 0) {
+					throw new SecurityException("修改订单数据失败");
+				}
+				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getPid, bills.getId()));
+				for (FeeCenter item : feeCenterList) {
+					item.setApproverId(AuthUtil.getUserId());
+					item.setApproverName(AuthUtil.getUserName());
+					item.setApproveTime(new Date());
+				}
+				feeCenterService.saveOrUpdateBatch(feeCenterList);
+				if ("海运舱单审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的海运舱单审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("空运舱单审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的空运舱单审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("快递业务审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的快递业务审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("海运派车审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的海运派车审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				}
+
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
+
+		}
+		//是最后一级
+		else if ("T".equals(iffinalItem)) {
+			//通过
+			if (operate == 1) {
+				auditProecess.setAuditStatus("A");
+				int version = StringUtil.isBlank(bills.getVersion()) ? 1 : Integer.parseInt(bills.getVersion());
+				bills.setVersion(String.valueOf(version + 1));
+				bills.setStatus(3);
+				int count = generalBillMapper.updateById(bills);
+				if (count == 0) {
+					throw new SecurityException("修改订单数据失败");
+				}
+				List<FeeCenter> feeCenterList = new ArrayList<>();
+				feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getPid, bills.getId()));
+				for (FeeCenter item : feeCenterList) {
+					item.setApproverId(AuthUtil.getUserId());
+					item.setApproverName(AuthUtil.getUserName());
+					item.setApproveTime(new Date());
+					item.setAuditStatus("1");
+				}
+				List<FeeCenter> feeCenters = feeCenterList.stream().filter(e -> 0 == e.getAccStatus()).collect(Collectors.toList());
+				if (!feeCenters.isEmpty()) {
+					FinAccBills finAccBills = new FinAccBills();
+					finAccBills.setFeeCenterList(feeCenters);
+					finAccBills.setBusinessTypeCode("HYZD");
+					finAccBills.setBillNoFormat("HYZD");
+					finAccBills.setAccountType("");
+					finAccBills.setRefno(bills.getRefno());
+					finAccBillsService.generateBill(finAccBills);
+				}
+				feeCenterService.saveOrUpdateBatch(feeCenterList);
+				if ("海运舱单审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的海运舱单审核已通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("空运舱单审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的空运舱单审核已通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("快递业务审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的快递业务审核已通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("海运派车审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的海运派车审核已通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				}
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
+			//不通过
+			else if (operate == 2) {
+				//todo 调用feign取消
+				auditProecess.setAuditStatus("B");
+				bills.setStatus(4);
+				int count = generalBillMapper.updateById(bills);
+				if (count == 0) {
+					throw new SecurityException("修改订单数据失败");
+				}
+				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getPid, bills.getId()));
+				for (FeeCenter item : feeCenterList) {
+					item.setApproverId(AuthUtil.getUserId());
+					item.setApproverName(AuthUtil.getUserName());
+					item.setApproveTime(new Date());
+				}
+				feeCenterService.saveOrUpdateBatch(feeCenterList);
+				if ("海运舱单审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的海运舱单审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("空运舱单审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的空运舱单审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("快递业务审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的快递业务审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				} else if ("海运派车审核".equals(auditProecess.getProcessType())) {
+					sendMessage.setMessageBody("您的海运派车审核未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + auditProecess.getAuditMsg());
+				}
+
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
+		} else {
+			throw new SecurityException("审批异常,请联系管理员");
+		}
+
+		cleanMsg(proecessTemp.getAuditUserId(), AuthUtil.getUserId(), proecessTemp.getSrcBillId());
+
+		//保存操作记录
+		auditProecess.setAuditMsg(auditProecess.getAuditMsg());
+		auditProecess.setAuditItem(new Date());
+		baseMapper.updateById(auditProecess);
+	}
+
+	@Override
 	public R deteleByBillId(Long billId) {
 		baseMapper.deteleByBillId(billId);
 		return R.data("操作成功");

+ 6 - 6
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.java

@@ -52,17 +52,17 @@ public interface FinAccBillsMapper extends BaseMapper<FinAccBills> {
 													   @Param("deptPid") Long deptPid, @Param("postId") String postId
 		, @Param("corpId") Long corpId);
 
-	List<FeeSummaryRD> feeSummary(IPage<FeeSummaryRD> page, @Param("fee") FeeSummaryQ feeSummaryQ);
+	List<FeeSummaryRD> feeSummaryList(IPage<FeeSummaryRD> page, @Param("fee") FeeSummaryQ feeSummaryQ);
 
-	List<FeeSummaryRD> feeSummaryExport(@Param("fee") FeeSummaryQ feeSummaryQ);
+	List<FeeSummaryRD> feeSummaryExportList(@Param("fee") FeeSummaryQ feeSummaryQ);
 
-	List<FeeSummaryDetailRD> feeSummaryDetail(IPage<FeeSummaryDetailRD> page, @Param("fee")FeeSummaryQ feeSummaryQ);
+	List<FeeSummaryDetailRD> feeSummaryDetailList(IPage<FeeSummaryDetailRD> page, @Param("fee")FeeSummaryQ feeSummaryQ);
 
-	List<FeeSummaryDetailRD> feeSummaryDetailExport(@Param("fee")FeeSummaryQ feeSummaryQ);
+	List<FeeSummaryDetailRD> feeSummaryDetailExportList(@Param("fee")FeeSummaryQ feeSummaryQ);
 
-	List<FeeSummaryDetailNotRD> feeSummaryDetailNot(IPage<FeeSummaryDetailNotRD> page, @Param("fee")FeeSummaryQ feeSummaryQ);
+	List<FeeSummaryDetailNotRD> feeSummaryDetailNotList(IPage<FeeSummaryDetailNotRD> page, @Param("fee")FeeSummaryQ feeSummaryQ);
 
-	List<FeeSummaryDetailNotRD> feeSummaryDetailExportNot(@Param("fee")FeeSummaryQ feeSummaryQ);
+	List<FeeSummaryDetailNotRD> feeSummaryDetailExportNotList(@Param("fee")FeeSummaryQ feeSummaryQ);
 
 	List<AgingAnalysisRD> agingAnalysis(IPage<AgingAnalysisRD> page, @Param("fee")FeeSummaryQ feeSummaryQ);
 

+ 8 - 6
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.xml

@@ -174,7 +174,7 @@
         GROUP BY
         mblno
     </select>
-    <select id="feeSummary" resultType="org.springblade.los.statisticAnalysis.FeeSummaryRD">
+    <select id="feeSummaryList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryRD">
         SELECT
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
             acc.corp_cn_name corpName,
@@ -254,7 +254,7 @@
             GROUP BY acc.corp_id
         </if>
     </select>
-    <select id="feeSummaryExport" resultType="org.springblade.los.statisticAnalysis.FeeSummaryRD">
+    <select id="feeSummaryExportList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryRD">
         SELECT
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
             acc.corp_cn_name corpName,
@@ -334,7 +334,7 @@
             GROUP BY acc.corp_id
         </if>
     </select>
-    <select id="feeSummaryDetail" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
+    <select id="feeSummaryDetailList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
         SELECT
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
             acc.corp_cn_name corpName,
@@ -432,7 +432,7 @@
         </if>
         ORDER BY acc.corp_id
     </select>
-    <select id="feeSummaryDetailExport" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
+    <select id="feeSummaryDetailExportList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
         SELECT
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
             acc.corp_cn_name corpName,
@@ -449,6 +449,8 @@
         acc.bill_no billNo,
         acc.mblno mblNo,
         acc.business_type businessType,
+        CASE
+        acc.business_type
         WHEN 'SI' THEN
         acc.eta
         WHEN 'SIA' THEN
@@ -533,7 +535,7 @@
         </if>
         ORDER BY acc.mblno,acc.corp_id
     </select>
-    <select id="feeSummaryDetailNot" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailNotRD">
+    <select id="feeSummaryDetailNotList" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailNotRD">
         SELECT
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
             acc.corp_cn_name corpName,
@@ -642,7 +644,7 @@
         </if>
         ORDER BY acc.mblno,acc.corp_id
     </select>
-    <select id="feeSummaryDetailExportNot"
+    <select id="feeSummaryDetailExportNotList"
             resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailNotRD">
         SELECT
         <if test='fee.type != null and fee.type != "" and fee.type == "1"'>

+ 6 - 6
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -954,32 +954,32 @@ public class StatisticAnalysisServiceImpl extends ServiceImpl<FinanceProfitMappe
 
 	@Override
 	public R<IPage<FeeSummaryRD>> feeSummary(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryRD> page) {
-		return R.data(page.setRecords(finAccBillsMapper.feeSummary(page, feeSummaryQ)));
+		return R.data(page.setRecords(finAccBillsMapper.feeSummaryList(page, feeSummaryQ)));
 	}
 
 	@Override
 	public List<FeeSummaryRD> feeSummaryExport(FeeSummaryQ feeSummaryQ) {
-		return finAccBillsMapper.feeSummaryExport(feeSummaryQ);
+		return finAccBillsMapper.feeSummaryExportList(feeSummaryQ);
 	}
 
 	@Override
 	public R<IPage<FeeSummaryDetailRD>> feeSummaryDetail(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryDetailRD> page) {
-		return R.data(page.setRecords(finAccBillsMapper.feeSummaryDetail(page, feeSummaryQ)));
+		return R.data(page.setRecords(finAccBillsMapper.feeSummaryDetailList(page, feeSummaryQ)));
 	}
 
 	@Override
 	public List<FeeSummaryDetailRD> feeSummaryDetailExport(FeeSummaryQ feeSummaryQ) {
-		return finAccBillsMapper.feeSummaryDetailExport(feeSummaryQ);
+		return finAccBillsMapper.feeSummaryDetailExportList(feeSummaryQ);
 	}
 
 	@Override
 	public R<IPage<FeeSummaryDetailNotRD>> feeSummaryDetailNot(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryDetailNotRD> page) {
-		return R.data(page.setRecords(finAccBillsMapper.feeSummaryDetailNot(page, feeSummaryQ)));
+		return R.data(page.setRecords(finAccBillsMapper.feeSummaryDetailNotList(page, feeSummaryQ)));
 	}
 
 	@Override
 	public List<FeeSummaryDetailNotRD> feeSummaryDetailExportNot(FeeSummaryQ feeSummaryQ) {
-		return finAccBillsMapper.feeSummaryDetailExportNot(feeSummaryQ);
+		return finAccBillsMapper.feeSummaryDetailExportNotList(feeSummaryQ);
 	}
 
 	@Override