1、新增应付明细

2、新增应收明细
3、新增异常处置
4、新增风险处置
5、新增在途追踪
6、修复业务模块bug
This commit is contained in:
2026-08-13 00:01:10 +08:00
parent 4571a7fce0
commit 2441fb3023
42 changed files with 3177 additions and 0 deletions
@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 异常处置跟进请求
*
* @author Chill
*/
@Data
@Schema(description = "异常处置跟进请求")
public class ExceptionDisposalFollowRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "异常处置ID")
private Long id;
@Schema(description = "跟进说明")
private String followContent;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;
/**
* 应收应付生成费用请求
*
* @author Chill
*/
@Data
@Schema(description = "应收应付生成费用请求")
public class ReceivablePayableGenerateRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "合同ID")
private Long contractId;
@Schema(description = "计费方案ID")
private String billingPlanId;
@Schema(description = "批次号")
private String batchNo;
@Schema(description = "运单完成开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate finishStartDate;
@Schema(description = "运单完成结束日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate finishEndDate;
@Schema(description = "运单ID")
private List<Long> waybillIds;
}
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 应收应付批量转结算请求
*
* @author Chill
*/
@Data
@Schema(description = "应收应付批量转结算请求")
public class ReceivablePayableTransferRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "明细ID")
private List<Long> ids;
@Schema(description = "结算单类型:pre/formal")
private String settlementBillType;
}
@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 应收应付更新费用请求
*
* @author Chill
*/
@Data
@Schema(description = "应收应付更新费用请求")
public class ReceivablePayableUpdateFeeRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "明细ID")
private List<Long> ids;
@Schema(description = "合同ID")
private Long contractId;
@Schema(description = "计费方案ID")
private String billingPlanId;
@Schema(description = "调整原因")
private String adjustReason;
@Schema(description = "仅关闭")
private Boolean closeOnly;
}
@@ -0,0 +1,30 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Data
@Schema(description = "风险处置批量请求")
public class RiskDisposalBatchDisposeRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "主键集合")
private List<Long> ids;
@Schema(description = "处理方式")
private String disposalMethod;
@Schema(description = "处置说明")
private String disposalRemark;
}
@@ -0,0 +1,29 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
@Schema(description = "风险处置请求")
public class RiskDisposalDisposeRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "主键")
private Long id;
@Schema(description = "处理方式")
private String disposalMethod;
@Schema(description = "处置说明")
private String disposalRemark;
}
@@ -0,0 +1,105 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 异常处置实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_exception_disposal")
@Schema(description = "异常处置")
public class ExceptionDisposal extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "运单ID")
private Long waybillId;
@Schema(description = "运单号")
private String waybillNo;
@Schema(description = "配载单号/总单号")
private String loadingOrMasterNo;
@Schema(description = "项目ID")
private Long projectId;
@Schema(description = "项目")
private String projectName;
@Schema(description = "车牌号")
private String vehicleNo;
@Schema(description = "上报人ID")
private Long reporterId;
@Schema(description = "上报人")
private String reporterName;
@Schema(description = "上报时间")
private LocalDateTime reportTime;
@Schema(description = "异常类型")
private String exceptionType;
@Schema(description = "异常原因")
private String exceptionReason;
@Schema(description = "上报说明")
private String reportDescription;
@Schema(description = "承运商ID")
private Long carrierId;
@Schema(description = "承运商")
private String carrierName;
@Schema(description = "现场照片")
private String scenePhotos;
@Schema(description = "最新跟进说明")
private String latestFollowContent;
@Schema(description = "处置状态:pending/processing/completed")
private String disposalStatus;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
}
@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 异常处置跟进记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_exception_disposal_follow_record")
@Schema(description = "异常处置跟进记录")
public class ExceptionDisposalFollowRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "异常处置ID")
private Long disposalId;
@Schema(description = "跟进说明")
private String followContent;
@Schema(description = "跟进人")
private Long followUser;
@Schema(description = "跟进人姓名")
private String followUserName;
@Schema(description = "跟进时间")
private LocalDateTime followTime;
}
@@ -0,0 +1,108 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 应收应付货物费用明细实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_receivable_payable_cargo_fee")
@Schema(description = "应收应付货物费用明细")
public class ReceivablePayableCargoFee extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "应收应付明细ID")
private Long detailId;
@Schema(description = "运单ID")
private Long waybillId;
@Schema(description = "行号")
private String lineNo;
@Schema(description = "货物名称")
private String cargoName;
@Schema(description = "货物类型")
private String cargoType;
@Schema(description = "规格")
private String specification;
@Schema(description = "型号")
private String model;
@Schema(description = "运费计费要素")
private String billingFactor;
@Schema(description = "运费计费类型")
private String billingType;
@Schema(description = "运输量")
private BigDecimal transportQuantity;
@Schema(description = "数量单位")
private String quantityUnit;
@Schema(description = "运费计算单位")
private String priceUnit;
@Schema(description = "运输单价")
private BigDecimal unitPrice;
@Schema(description = "里程")
private BigDecimal mileage;
@Schema(description = "运输费")
private BigDecimal freightAmount;
@Schema(description = "费用项JSON")
private String feeItemsJson;
@Schema(description = "原总金额")
private BigDecimal originalAmount;
@Schema(description = "调整金额")
private BigDecimal adjustAmount;
@Schema(description = "调整后总金额")
private BigDecimal afterAmount;
@Schema(description = "备注")
private String remark;
}
@@ -0,0 +1,72 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 应收应付费用变更记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_receivable_payable_change_record")
@Schema(description = "应收应付费用变更记录")
public class ReceivablePayableChangeRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "应收应付明细ID")
private Long detailId;
@Schema(description = "行号")
private String lineNo;
@Schema(description = "货物名称")
private String cargoName;
@Schema(description = "变更内容")
private String changeContent;
@Schema(description = "调整人")
private Long adjustUser;
@Schema(description = "调整人姓名")
private String adjustUserName;
@Schema(description = "调整原因")
private String adjustReason;
@Schema(description = "调整时间")
private LocalDateTime adjustTime;
}
@@ -0,0 +1,145 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 应收应付明细实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_receivable_payable_detail")
@Schema(description = "应收应付明细")
public class ReceivablePayableDetail extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "单据号")
private String documentNo;
@Schema(description = "结算明细类型:receivable/payable")
private String settlementType;
@Schema(description = "项目ID")
private Long projectId;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "费用日期")
private LocalDate feeDate;
@Schema(description = "客商名称")
private String customerName;
@Schema(description = "合同ID")
private Long contractId;
@Schema(description = "合同编号")
private String contractNo;
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "来源")
private String sourceType;
@Schema(description = "预结算单号")
private String preSettlementNo;
@Schema(description = "正式结算单号")
private String formalSettlementNo;
@Schema(description = "运单ID")
private Long waybillId;
@Schema(description = "运单号")
private String waybillNo;
@Schema(description = "车号")
private String vehicleNo;
@Schema(description = "运输类型")
private String transportType;
@Schema(description = "货物名称")
private String cargoName;
@Schema(description = "货物类型")
private String cargoType;
@Schema(description = "运输总量")
private BigDecimal transportQuantity;
@Schema(description = "数量单位")
private String quantityUnit;
@Schema(description = "里程")
private BigDecimal mileage;
@Schema(description = "批次号")
private String batchNo;
@Schema(description = "运输单价")
private BigDecimal unitPrice;
@Schema(description = "币种")
private String currency;
@Schema(description = "运输费")
private BigDecimal freightAmount;
@Schema(description = "其它费用")
private BigDecimal otherFeeAmount;
@Schema(description = "费用合计")
private BigDecimal totalAmount;
@Schema(description = "状态:pending/pre_settled/formal_settled/closed")
private String settlementStatus;
@Schema(description = "费用项JSON")
private String feeItemsJson;
@Schema(description = "备注")
private String remark;
}
@@ -0,0 +1,76 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 风险处置实体类
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_risk_disposal")
@Schema(description = "风险处置")
public class RiskDisposal extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "风险编号")
private String riskNo;
@Schema(description = "规则名称")
private String ruleName;
@Schema(description = "运单ID")
private Long waybillId;
@Schema(description = "运单号")
private String waybillNo;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "车牌号")
private String vehicleNo;
@Schema(description = "风险等级")
private String riskLevel;
@Schema(description = "运输类型")
private String transportType;
@Schema(description = "风险描述")
private String riskDescription;
@Schema(description = "处置状态")
private String disposalStatus;
@Schema(description = "处理方式")
private String disposalMethod;
@Schema(description = "处置说明")
private String disposalRemark;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "触发时间")
private LocalDateTime triggerTime;
@Schema(description = "处理时间")
private LocalDateTime disposeTime;
}
@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ExceptionDisposalFollowRecord;
import java.io.Serial;
/**
* 异常处置跟进记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "异常处置跟进记录")
public class ExceptionDisposalFollowRecordVO extends ExceptionDisposalFollowRecord {
@Serial
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,88 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ExceptionDisposal;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* 异常处置视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "异常处置")
public class ExceptionDisposalVO extends ExceptionDisposal {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "上报开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime reportStartTime;
@TableField(exist = false)
@Schema(description = "上报结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime reportEndTime;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "状态名称")
private String disposalStatusName;
@TableField(exist = false)
@Schema(description = "异常类型名称")
private String exceptionTypeName;
@TableField(exist = false)
@Schema(description = "现场照片列表")
private List<String> scenePhotoList;
@TableField(exist = false)
@Schema(description = "历史跟进")
private List<ExceptionDisposalFollowRecordVO> followRecords;
@TableField(exist = false)
@Schema(description = "扩展信息")
private Map<String, Object> extra;
}
@@ -0,0 +1,71 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ReceivablePayableCargoFee;
import java.io.Serial;
import java.util.Map;
/**
* 应收应付货物费用明细视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "应收应付货物费用明细")
public class ReceivablePayableCargoFeeVO extends ReceivablePayableCargoFee {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "运输量展示")
private String transportQuantityText;
@TableField(exist = false)
@Schema(description = "原总金额展示")
private String originalAmountText;
@TableField(exist = false)
@Schema(description = "调整金额展示")
private String adjustAmountText;
@TableField(exist = false)
@Schema(description = "调整后总金额展示")
private String afterAmountText;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "费用项目")
private Map<String, Object> feeItems;
}
@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ReceivablePayableChangeRecord;
import java.io.Serial;
/**
* 应收应付费用变更记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "应收应付费用变更记录")
public class ReceivablePayableChangeRecordVO extends ReceivablePayableChangeRecord {
@Serial
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,80 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ReceivablePayableDetail;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
/**
* 应收应付明细视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "应收应付明细")
public class ReceivablePayableDetailVO extends ReceivablePayableDetail {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "生成开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate generateStartDate;
@TableField(exist = false)
@Schema(description = "生成结束日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate generateEndDate;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "状态名称")
private String settlementStatusName;
@TableField(exist = false)
@Schema(description = "费用项目")
private Map<String, Object> feeItems;
@TableField(exist = false)
@Schema(description = "货物费用明细")
private List<ReceivablePayableCargoFeeVO> cargoFees;
}
@@ -0,0 +1,54 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 应收应付费用明细弹窗视图
*
* @author Chill
*/
@Data
@Schema(description = "应收应付费用明细弹窗")
public class ReceivablePayableFeeDetailVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "动态费用项名称")
private List<String> feeItemNames = new ArrayList<>();
@Schema(description = "费用明细")
private List<ReceivablePayableCargoFeeVO> records = new ArrayList<>();
@Schema(description = "总数")
private Long total = 0L;
}
@@ -0,0 +1,26 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
@Schema(description = "风险处置批量结果")
public class RiskDisposalBatchResultVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "成功数")
private Integer successCount = 0;
@Schema(description = "失败数")
private Integer skippedCount = 0;
}
@@ -0,0 +1,42 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.RiskDisposal;
import java.io.Serial;
/**
* 风险处置视图实体类
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "风险处置")
public class RiskDisposalVO extends RiskDisposal {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "风险等级名称")
private String riskLevelName;
@TableField(exist = false)
@Schema(description = "处置状态名称")
private String disposalStatusName;
}
@@ -0,0 +1,97 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.transport.pojo.dto.ExceptionDisposalFollowRequest;
import org.springblade.transport.pojo.vo.ExceptionDisposalVO;
import org.springblade.transport.service.IExceptionDisposalService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 异常处置控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "exception_disposal")
@RequestMapping("/exception-disposal")
@Tag(name = "异常处置", description = "异常处置")
public class ExceptionDisposalController extends BladeController {
private final IExceptionDisposalService exceptionDisposalService;
@GetMapping("/list")
@ApiOperationSupport(order = 1)
@Operation(summary = "异常处置分页")
public R<IPage<ExceptionDisposalVO>> list(ExceptionDisposalVO exceptionDisposal, Query query) {
return R.data(exceptionDisposalService.selectPage(Condition.getPage(query), exceptionDisposal));
}
@GetMapping("/detail")
@ApiOperationSupport(order = 2)
@Operation(summary = "异常处置详情")
public R<ExceptionDisposalVO> detail(@RequestParam Long id) {
return R.data(exceptionDisposalService.detail(id));
}
@PostMapping("/follow")
@ApiOperationSupport(order = 3)
@Operation(summary = "异常跟进")
public R follow(@RequestBody ExceptionDisposalFollowRequest request) {
exceptionDisposalService.follow(request);
return R.success("跟进成功");
}
@PostMapping("/complete")
@ApiOperationSupport(order = 4)
@Operation(summary = "完成异常")
public R complete(@RequestBody ExceptionDisposalFollowRequest request) {
exceptionDisposalService.complete(request.getId());
return R.success("完成成功");
}
@PostMapping("/batch-complete")
@ApiOperationSupport(order = 5)
@Operation(summary = "批量完成异常")
public R batchComplete(@RequestParam String ids) {
exceptionDisposalService.batchComplete(ids);
return R.success("批量完成成功");
}
}
@@ -0,0 +1,147 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.transport.pojo.dto.ReceivablePayableGenerateRequest;
import org.springblade.transport.pojo.dto.ReceivablePayableTransferRequest;
import org.springblade.transport.pojo.dto.ReceivablePayableUpdateFeeRequest;
import org.springblade.transport.pojo.vo.ReceivablePayableChangeRecordVO;
import org.springblade.transport.pojo.vo.ReceivablePayableDetailVO;
import org.springblade.transport.pojo.vo.ReceivablePayableFeeDetailVO;
import org.springblade.transport.service.IReceivablePayableDetailService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 应收应付明细控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "receivable_payable_detail")
@RequestMapping("/receivable-payable-detail")
@Tag(name = "应收应付明细", description = "应收应付明细")
public class ReceivablePayableDetailController extends BladeController {
private final IReceivablePayableDetailService detailService;
@GetMapping("/list")
@ApiOperationSupport(order = 1)
@Operation(summary = "应收应付明细分页")
public R<IPage<ReceivablePayableDetailVO>> list(ReceivablePayableDetailVO query, Query pageQuery) {
return R.data(detailService.selectPage(Condition.getPage(pageQuery), query));
}
@GetMapping("/fee-detail")
@ApiOperationSupport(order = 2)
@Operation(summary = "费用明细")
public R<ReceivablePayableFeeDetailVO> feeDetail(@RequestParam Long id) {
return R.data(detailService.feeDetail(id));
}
@GetMapping("/change-records")
@ApiOperationSupport(order = 3)
@Operation(summary = "变更记录")
public R<IPage<ReceivablePayableChangeRecordVO>> changeRecords(Query query, @RequestParam Long detailId) {
return R.data(detailService.changeRecords(Condition.getPage(query), detailId));
}
@PostMapping("/update-fee")
@ApiOperationSupport(order = 4)
@Operation(summary = "更新费用")
public R updateFee(@RequestBody ReceivablePayableUpdateFeeRequest request) {
detailService.updateFee(request);
return R.success("更新成功");
}
@GetMapping("/transfer-candidates")
@ApiOperationSupport(order = 5)
@Operation(summary = "转结算候选明细")
public R<IPage<Map<String, Object>>> transferCandidates(Query query,
@RequestParam(required = false) String contractName,
@RequestParam(required = false) String batchNo,
@RequestParam(required = false) String generateStartDate,
@RequestParam(required = false) String generateEndDate,
@RequestParam(required = false) String settlementBillType) {
return R.data(detailService.transferCandidates(Condition.getPage(query), contractName, batchNo,
generateStartDate, generateEndDate, settlementBillType));
}
@PostMapping("/transfer-settlement")
@ApiOperationSupport(order = 6)
@Operation(summary = "批量转结算")
public R transferSettlement(@RequestBody ReceivablePayableTransferRequest request) {
detailService.transferSettlement(request);
return R.success("转结算成功");
}
@GetMapping("/generate-waybills")
@ApiOperationSupport(order = 7)
@Operation(summary = "生成费用可选运单")
public R<IPage<Map<String, Object>>> generateWaybills(Query query, ReceivablePayableGenerateRequest request) {
return R.data(detailService.generateWaybills(Condition.getPage(query), request));
}
@GetMapping("/generate-preview")
@ApiOperationSupport(order = 8)
@Operation(summary = "生成费用预览")
public R<ReceivablePayableFeeDetailVO> generatePreview(Query query, ReceivablePayableGenerateRequest request) {
return R.data(detailService.generatePreview(Condition.getPage(query), request));
}
@PostMapping("/generate-fee")
@ApiOperationSupport(order = 9)
@Operation(summary = "确认生成费用")
public R generateFee(@RequestBody ReceivablePayableGenerateRequest request) {
detailService.generateFee(request);
return R.success("生成费用成功");
}
@GetMapping("/export-receivable-payable-detail")
@ApiOperationSupport(order = 10)
@Operation(summary = "导出应收应付明细")
public void exportReceivablePayableDetail(ReceivablePayableDetailVO query, HttpServletResponse response) {
IPage<ReceivablePayableDetailVO> page = detailService.selectPage(Condition.getPage(new Query()), query);
ExcelUtil.export(response, "应收应付明细" + DateUtil.time(), "应收应付明细", page.getRecords(), ReceivablePayableDetailVO.class);
}
}
@@ -0,0 +1,57 @@
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.transport.pojo.dto.RiskDisposalBatchDisposeRequest;
import org.springblade.transport.pojo.dto.RiskDisposalDisposeRequest;
import org.springblade.transport.pojo.vo.RiskDisposalBatchResultVO;
import org.springblade.transport.pojo.vo.RiskDisposalVO;
import org.springblade.transport.service.IRiskDisposalService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@AllArgsConstructor
@PreAuth(menu = "risk_disposal")
@RequestMapping("/risk-disposal")
@Tag(name = "风险处置", description = "风险处置")
public class RiskDisposalController extends BladeController {
private final IRiskDisposalService riskDisposalService;
@GetMapping("/list")
@Operation(summary = "风险处置分页")
public R<IPage<RiskDisposalVO>> list(RiskDisposalVO query, Query pageQuery) {
return R.data(riskDisposalService.selectPage(Condition.getPage(pageQuery), query));
}
@GetMapping("/detail")
@Operation(summary = "风险处置详情")
public R<RiskDisposalVO> detail(@RequestParam Long id) {
return R.data(riskDisposalService.detail(id));
}
@PostMapping("/dispose")
@Operation(summary = "风险处置")
public R dispose(@RequestBody RiskDisposalDisposeRequest request) {
riskDisposalService.dispose(request);
return R.success("处理成功");
}
@PostMapping("/batch-dispose")
@Operation(summary = "批量风险处置")
public R<RiskDisposalBatchResultVO> batchDispose(@RequestBody RiskDisposalBatchDisposeRequest request) {
return R.data(riskDisposalService.batchDispose(request));
}
}
@@ -46,6 +46,7 @@ import org.springblade.transport.pojo.entity.ProjectApply;
import org.springblade.transport.pojo.entity.TransportPlan;
import org.springblade.transport.pojo.entity.Waybill;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.LoadingManageVO;
import org.springblade.transport.pojo.vo.WaybillVO;
import org.springblade.transport.service.IContractManageService;
import org.springblade.transport.service.ICustomerArchiveService;
@@ -204,6 +205,13 @@ public class WaybillController extends BladeController {
return R.data(waybillService.batchComplete(ids));
}
@PostMapping("/road-loading")
@ApiOperationSupport(order = 15)
@Operation(summary = "公路配载", description = "传入ids")
public R<LoadingManageVO> roadLoading(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.data(waybillService.roadLoading(ids));
}
private Map<String, Object> option(Long id, String nameKey, String name, String extraKey, Object extraValue) {
Map<String, Object> option = new LinkedHashMap<>();
option.put("id", id);
@@ -0,0 +1,36 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.transport.pojo.entity.ExceptionDisposalFollowRecord;
/**
* 异常处置跟进记录 Mapper
*
* @author Chill
*/
@Mapper
public interface ExceptionDisposalFollowRecordMapper extends BaseMapper<ExceptionDisposalFollowRecord> {
}
@@ -0,0 +1,36 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.transport.pojo.entity.ExceptionDisposal;
/**
* 异常处置 Mapper
*
* @author Chill
*/
@Mapper
public interface ExceptionDisposalMapper extends BaseMapper<ExceptionDisposal> {
}
@@ -0,0 +1,36 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.transport.pojo.entity.ReceivablePayableCargoFee;
/**
* 应收应付货物费用 Mapper
*
* @author Chill
*/
@Mapper
public interface ReceivablePayableCargoFeeMapper extends BaseMapper<ReceivablePayableCargoFee> {
}
@@ -0,0 +1,36 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.transport.pojo.entity.ReceivablePayableChangeRecord;
/**
* 应收应付变更记录 Mapper
*
* @author Chill
*/
@Mapper
public interface ReceivablePayableChangeRecordMapper extends BaseMapper<ReceivablePayableChangeRecord> {
}
@@ -0,0 +1,36 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.transport.pojo.entity.ReceivablePayableDetail;
/**
* 应收应付明细 Mapper
*
* @author Chill
*/
@Mapper
public interface ReceivablePayableDetailMapper extends BaseMapper<ReceivablePayableDetail> {
}
@@ -0,0 +1,9 @@
package org.springblade.transport.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.transport.pojo.entity.RiskDisposal;
@Mapper
public interface RiskDisposalMapper extends BaseMapper<RiskDisposal> {
}
@@ -0,0 +1,48 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.transport.pojo.dto.ExceptionDisposalFollowRequest;
import org.springblade.transport.pojo.entity.ExceptionDisposal;
import org.springblade.transport.pojo.vo.ExceptionDisposalVO;
/**
* 异常处置服务
*
* @author Chill
*/
public interface IExceptionDisposalService extends BaseService<ExceptionDisposal> {
IPage<ExceptionDisposalVO> selectPage(IPage<ExceptionDisposal> page, ExceptionDisposalVO query);
ExceptionDisposalVO detail(Long id);
void follow(ExceptionDisposalFollowRequest request);
void complete(Long id);
void batchComplete(String ids);
}
@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.transport.pojo.dto.ReceivablePayableGenerateRequest;
import org.springblade.transport.pojo.dto.ReceivablePayableTransferRequest;
import org.springblade.transport.pojo.dto.ReceivablePayableUpdateFeeRequest;
import org.springblade.transport.pojo.entity.ReceivablePayableDetail;
import org.springblade.transport.pojo.vo.ReceivablePayableChangeRecordVO;
import org.springblade.transport.pojo.vo.ReceivablePayableDetailVO;
import org.springblade.transport.pojo.vo.ReceivablePayableFeeDetailVO;
import java.util.Map;
/**
* 应收应付明细服务
*
* @author Chill
*/
public interface IReceivablePayableDetailService extends BaseService<ReceivablePayableDetail> {
IPage<ReceivablePayableDetailVO> selectPage(IPage<ReceivablePayableDetail> page, ReceivablePayableDetailVO query);
ReceivablePayableFeeDetailVO feeDetail(Long id);
IPage<ReceivablePayableChangeRecordVO> changeRecords(IPage<?> page, Long detailId);
void updateFee(ReceivablePayableUpdateFeeRequest request);
void transferSettlement(ReceivablePayableTransferRequest request);
IPage<Map<String, Object>> transferCandidates(IPage<?> page, String contractName, String batchNo,
String generateStartDate, String generateEndDate, String settlementBillType);
IPage<Map<String, Object>> generateWaybills(IPage<?> page, ReceivablePayableGenerateRequest request);
ReceivablePayableFeeDetailVO generatePreview(IPage<?> page, ReceivablePayableGenerateRequest request);
void generateFee(ReceivablePayableGenerateRequest request);
}
@@ -0,0 +1,21 @@
package org.springblade.transport.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.transport.pojo.dto.RiskDisposalBatchDisposeRequest;
import org.springblade.transport.pojo.dto.RiskDisposalDisposeRequest;
import org.springblade.transport.pojo.entity.RiskDisposal;
import org.springblade.transport.pojo.vo.RiskDisposalBatchResultVO;
import org.springblade.transport.pojo.vo.RiskDisposalVO;
public interface IRiskDisposalService extends BaseService<RiskDisposal> {
IPage<RiskDisposalVO> selectPage(IPage<RiskDisposal> page, RiskDisposalVO query);
RiskDisposalVO detail(Long id);
void dispose(RiskDisposalDisposeRequest request);
RiskDisposalBatchResultVO batchDispose(RiskDisposalBatchDisposeRequest request);
}
@@ -27,6 +27,7 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.transport.excel.WaybillExcel;
import org.springblade.transport.pojo.entity.Waybill;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.LoadingManageVO;
import org.springblade.transport.pojo.vo.WaybillVO;
import java.util.List;
@@ -49,5 +50,6 @@ public interface IWaybillService extends BaseService<Waybill> {
boolean reassign(Long id);
boolean complete(Long id);
BusinessRemoveResultVO batchComplete(String ids);
LoadingManageVO roadLoading(String ids);
}
@@ -0,0 +1,203 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.transport.mapper.ExceptionDisposalFollowRecordMapper;
import org.springblade.transport.mapper.ExceptionDisposalMapper;
import org.springblade.transport.pojo.dto.ExceptionDisposalFollowRequest;
import org.springblade.transport.pojo.entity.ExceptionDisposal;
import org.springblade.transport.pojo.entity.ExceptionDisposalFollowRecord;
import org.springblade.transport.pojo.vo.ExceptionDisposalFollowRecordVO;
import org.springblade.transport.pojo.vo.ExceptionDisposalVO;
import org.springblade.transport.service.IExceptionDisposalService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
/**
* 异常处置服务实现类
*
* @author Chill
*/
@Service
public class ExceptionDisposalServiceImpl
extends BaseServiceImpl<ExceptionDisposalMapper, ExceptionDisposal>
implements IExceptionDisposalService {
private static final String STATUS_PENDING = "pending";
private static final String STATUS_PROCESSING = "processing";
private static final String STATUS_COMPLETED = "completed";
private final ExceptionDisposalFollowRecordMapper followRecordMapper;
public ExceptionDisposalServiceImpl(ExceptionDisposalFollowRecordMapper followRecordMapper) {
this.followRecordMapper = followRecordMapper;
}
@Override
public IPage<ExceptionDisposalVO> selectPage(IPage<ExceptionDisposal> page, ExceptionDisposalVO query) {
IPage<ExceptionDisposal> entityPage = page(page, buildQuery(query));
Page<ExceptionDisposalVO> voPage = new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal());
voPage.setRecords(entityPage.getRecords().stream().map(this::toVO).toList());
return voPage;
}
@Override
public ExceptionDisposalVO detail(Long id) {
ExceptionDisposalVO vo = toVO(getExisting(id));
vo.setFollowRecords(followRecords(id));
return vo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void follow(ExceptionDisposalFollowRequest request) {
if (request == null || request.getId() == null) {
throw new ServiceException("请选择需要跟进的异常");
}
if (Func.isBlank(request.getFollowContent())) {
throw new ServiceException("请填写跟进说明");
}
if (request.getFollowContent().length() > 500) {
throw new ServiceException("跟进说明不能超过500字");
}
ExceptionDisposal disposal = getExisting(request.getId());
if (STATUS_COMPLETED.equals(disposal.getDisposalStatus())) {
throw new ServiceException("已完成的异常不允许继续跟进");
}
disposal.setDisposalStatus(STATUS_PROCESSING);
disposal.setLatestFollowContent(request.getFollowContent());
updateById(disposal);
ExceptionDisposalFollowRecord record = new ExceptionDisposalFollowRecord();
record.setDisposalId(disposal.getId());
record.setFollowContent(request.getFollowContent());
record.setFollowUser(AuthUtil.getUserId());
record.setFollowUserName(UserCache.getUserRealName(AuthUtil.getUserId()));
record.setFollowTime(LocalDateTime.now());
followRecordMapper.insert(record);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void complete(Long id) {
ExceptionDisposal disposal = getExisting(id);
if (STATUS_COMPLETED.equals(disposal.getDisposalStatus())) {
throw new ServiceException("异常已完成,请勿重复操作");
}
disposal.setDisposalStatus(STATUS_COMPLETED);
updateById(disposal);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void batchComplete(String ids) {
if (Func.isBlank(ids)) {
throw new ServiceException("请选择需要完成的异常");
}
List<Long> idList = Func.toLongList(ids);
if (Func.isEmpty(idList)) {
throw new ServiceException("请选择需要完成的异常");
}
List<ExceptionDisposal> disposals = listByIds(idList);
if (disposals.size() != idList.size()) {
throw new ServiceException("存在无效的异常记录");
}
for (ExceptionDisposal disposal : disposals) {
if (STATUS_COMPLETED.equals(disposal.getDisposalStatus())) {
throw new ServiceException("已完成的异常不允许重复完成");
}
disposal.setDisposalStatus(STATUS_COMPLETED);
}
updateBatchById(disposals);
}
private LambdaQueryWrapper<ExceptionDisposal> buildQuery(ExceptionDisposalVO query) {
LambdaQueryWrapper<ExceptionDisposal> wrapper = Wrappers.<ExceptionDisposal>lambdaQuery()
.eq(ExceptionDisposal::getIsDeleted, 0)
.like(Func.isNotEmpty(query.getWaybillNo()), ExceptionDisposal::getWaybillNo, query.getWaybillNo())
.like(Func.isNotEmpty(query.getVehicleNo()), ExceptionDisposal::getVehicleNo, query.getVehicleNo())
.like(Func.isNotEmpty(query.getReporterName()), ExceptionDisposal::getReporterName, query.getReporterName())
.ge(query.getReportStartTime() != null, ExceptionDisposal::getReportTime, query.getReportStartTime())
.le(query.getReportEndTime() != null, ExceptionDisposal::getReportTime, query.getReportEndTime())
.like(Func.isNotEmpty(query.getProjectName()), ExceptionDisposal::getProjectName, query.getProjectName())
.like(Func.isNotEmpty(query.getCarrierName()), ExceptionDisposal::getCarrierName, query.getCarrierName())
.eq(Func.isNotEmpty(query.getExceptionType()), ExceptionDisposal::getExceptionType, query.getExceptionType())
.eq(Func.isNotEmpty(query.getDisposalStatus()), ExceptionDisposal::getDisposalStatus, query.getDisposalStatus());
return wrapper.orderByDesc(ExceptionDisposal::getCreateTime);
}
private ExceptionDisposal getExisting(Long id) {
if (id == null) {
throw new ServiceException("异常记录不存在");
}
ExceptionDisposal disposal = getById(id);
if (disposal == null || Objects.equals(disposal.getIsDeleted(), 1)) {
throw new ServiceException("异常记录不存在");
}
return disposal;
}
private ExceptionDisposalVO toVO(ExceptionDisposal entity) {
ExceptionDisposalVO vo = BeanUtil.copyProperties(entity, ExceptionDisposalVO.class);
if (vo == null) {
return null;
}
vo.setCreateUserName(UserCache.getUserRealName(entity.getCreateUser()));
vo.setUpdateUserName(UserCache.getUserRealName(entity.getUpdateUser()));
vo.setDisposalStatusName(statusName(entity.getDisposalStatus()));
return vo;
}
private List<ExceptionDisposalFollowRecordVO> followRecords(Long id) {
List<ExceptionDisposalFollowRecord> records = followRecordMapper.selectList(Wrappers.<ExceptionDisposalFollowRecord>lambdaQuery()
.eq(ExceptionDisposalFollowRecord::getDisposalId, id)
.eq(ExceptionDisposalFollowRecord::getIsDeleted, 0)
.orderByDesc(ExceptionDisposalFollowRecord::getFollowTime));
return records.stream().map(record -> Objects.requireNonNull(
BeanUtil.copyProperties(record, ExceptionDisposalFollowRecordVO.class))).toList();
}
private String statusName(String status) {
return switch (Func.toStr(status)) {
case STATUS_PENDING -> "待处理";
case STATUS_PROCESSING -> "处理中";
case STATUS_COMPLETED -> "已完成";
default -> "";
};
}
}
@@ -0,0 +1,532 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.transport.mapper.ReceivablePayableCargoFeeMapper;
import org.springblade.transport.mapper.ReceivablePayableChangeRecordMapper;
import org.springblade.transport.mapper.ReceivablePayableDetailMapper;
import org.springblade.transport.pojo.dto.ReceivablePayableGenerateRequest;
import org.springblade.transport.pojo.dto.ReceivablePayableTransferRequest;
import org.springblade.transport.pojo.dto.ReceivablePayableUpdateFeeRequest;
import org.springblade.transport.pojo.entity.ContractManage;
import org.springblade.transport.pojo.entity.ReceivablePayableCargoFee;
import org.springblade.transport.pojo.entity.ReceivablePayableChangeRecord;
import org.springblade.transport.pojo.entity.ReceivablePayableDetail;
import org.springblade.transport.pojo.entity.Waybill;
import org.springblade.transport.pojo.vo.ReceivablePayableCargoFeeVO;
import org.springblade.transport.pojo.vo.ReceivablePayableChangeRecordVO;
import org.springblade.transport.pojo.vo.ReceivablePayableDetailVO;
import org.springblade.transport.pojo.vo.ReceivablePayableFeeDetailVO;
import org.springblade.transport.service.IContractManageService;
import org.springblade.transport.service.IReceivablePayableDetailService;
import org.springblade.transport.service.IWaybillService;
import org.springblade.transport.wrapper.ReceivablePayableDetailWrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/**
* 应收应付明细服务实现类
*
* @author Chill
*/
@Service
public class ReceivablePayableDetailServiceImpl
extends BaseServiceImpl<ReceivablePayableDetailMapper, ReceivablePayableDetail>
implements IReceivablePayableDetailService {
private final ReceivablePayableCargoFeeMapper cargoFeeMapper;
private final ReceivablePayableChangeRecordMapper changeRecordMapper;
private final IWaybillService waybillService;
private final IContractManageService contractManageService;
public ReceivablePayableDetailServiceImpl(ReceivablePayableCargoFeeMapper cargoFeeMapper,
ReceivablePayableChangeRecordMapper changeRecordMapper,
IWaybillService waybillService,
IContractManageService contractManageService) {
this.cargoFeeMapper = cargoFeeMapper;
this.changeRecordMapper = changeRecordMapper;
this.waybillService = waybillService;
this.contractManageService = contractManageService;
}
@Override
public IPage<ReceivablePayableDetailVO> selectPage(IPage<ReceivablePayableDetail> page, ReceivablePayableDetailVO query) {
return ReceivablePayableDetailWrapper.build().pageVO(page(page, buildQuery(query)));
}
@Override
public ReceivablePayableFeeDetailVO feeDetail(Long id) {
ReceivablePayableDetail detail = getExisting(id);
List<ReceivablePayableCargoFee> rows = cargoFeeMapper.selectList(Wrappers.<ReceivablePayableCargoFee>lambdaQuery()
.eq(ReceivablePayableCargoFee::getDetailId, detail.getId())
.eq(ReceivablePayableCargoFee::getIsDeleted, 0)
.orderByAsc(ReceivablePayableCargoFee::getCreateTime));
return buildFeeDetail(rows);
}
@Override
public IPage<ReceivablePayableChangeRecordVO> changeRecords(IPage<?> page, Long detailId) {
LambdaQueryWrapper<ReceivablePayableChangeRecord> wrapper = Wrappers.<ReceivablePayableChangeRecord>lambdaQuery()
.eq(ReceivablePayableChangeRecord::getDetailId, detailId)
.eq(ReceivablePayableChangeRecord::getIsDeleted, 0)
.orderByDesc(ReceivablePayableChangeRecord::getAdjustTime);
IPage<ReceivablePayableChangeRecord> entityPage = changeRecordMapper.selectPage(new Page<>(page.getCurrent(), page.getSize()), wrapper);
Page<ReceivablePayableChangeRecordVO> voPage = new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal());
voPage.setRecords(entityPage.getRecords().stream().map(record -> Objects.requireNonNull(
BeanUtil.copyProperties(record, ReceivablePayableChangeRecordVO.class))).toList());
return voPage;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateFee(ReceivablePayableUpdateFeeRequest request) {
if (Boolean.TRUE.equals(request.getCloseOnly())) {
closeDetails(request.getIds());
return;
}
if (Func.isEmpty(request.getIds()) && Func.isEmpty(request.getContractId())) {
throw new ServiceException("请选择需要更新的费用明细或合同");
}
List<ReceivablePayableDetail> details = list(buildUpdateQuery(request));
if (Func.isEmpty(details)) {
throw new ServiceException("没有可更新的待结算明细");
}
for (ReceivablePayableDetail detail : details) {
if (!"pending".equals(detail.getSettlementStatus())) {
continue;
}
BigDecimal before = money(detail.getTotalAmount());
rebuildDetailFee(detail);
saveChangeRecord(detail, "【费用合计】从[" + formatMoney(before) + "]调整为[" + formatMoney(detail.getTotalAmount()) + "]",
request.getAdjustReason());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void transferSettlement(ReceivablePayableTransferRequest request) {
if (Func.isEmpty(request.getIds())) {
throw new ServiceException("请选择需要转结算的明细");
}
if (!List.of("pre", "formal").contains(request.getSettlementBillType())) {
throw new ServiceException("转结算类型不正确");
}
List<ReceivablePayableDetail> details = listByIds(request.getIds());
if (details.size() != request.getIds().size()) {
throw new ServiceException("存在无效的费用明细");
}
String billNo = settlementBillNo(request.getSettlementBillType());
for (ReceivablePayableDetail detail : details) {
if (!"pending".equals(detail.getSettlementStatus())) {
throw new ServiceException("仅待结算明细允许转结算");
}
if ("pre".equals(request.getSettlementBillType())) {
detail.setPreSettlementNo(billNo);
detail.setSettlementStatus("pre_settled");
} else {
detail.setFormalSettlementNo(billNo);
detail.setSettlementStatus("formal_settled");
}
updateById(detail);
}
}
@Override
public IPage<Map<String, Object>> transferCandidates(IPage<?> page, String contractName, String batchNo,
String generateStartDate, String generateEndDate, String settlementBillType) {
ReceivablePayableDetailVO query = new ReceivablePayableDetailVO();
query.setContractName(contractName);
query.setBatchNo(batchNo);
query.setSettlementStatus("pending");
query.setGenerateStartDate(parseDate(generateStartDate));
query.setGenerateEndDate(parseDate(generateEndDate));
IPage<ReceivablePayableDetailVO> detailPage = selectPage(new Page<>(page.getCurrent(), page.getSize()), query);
Page<Map<String, Object>> result = new Page<>(detailPage.getCurrent(), detailPage.getSize(), detailPage.getTotal());
result.setRecords(detailPage.getRecords().stream().map(this::beanMap).toList());
return result;
}
@Override
public IPage<Map<String, Object>> generateWaybills(IPage<?> page, ReceivablePayableGenerateRequest request) {
validateGenerateRequest(request, false);
IPage<Waybill> waybillPage = waybillService.page(new Page<>(page.getCurrent(), page.getSize()), buildWaybillQuery(request));
Page<Map<String, Object>> result = new Page<>(waybillPage.getCurrent(), waybillPage.getSize(), waybillPage.getTotal());
result.setRecords(waybillPage.getRecords().stream().map(this::waybillMap).toList());
return result;
}
@Override
public ReceivablePayableFeeDetailVO generatePreview(IPage<?> page, ReceivablePayableGenerateRequest request) {
validateGenerateRequest(request, true);
List<Waybill> waybills = waybillService.list(buildWaybillQuery(request));
List<ReceivablePayableCargoFee> fees = waybills.stream()
.skip((page.getCurrent() - 1) * page.getSize())
.limit(page.getSize())
.map(waybill -> buildCargoFee(null, waybill))
.toList();
ReceivablePayableFeeDetailVO vo = buildFeeDetail(fees);
vo.setTotal((long) waybills.size());
return vo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void generateFee(ReceivablePayableGenerateRequest request) {
validateGenerateRequest(request, true);
List<Waybill> waybills = waybillService.list(buildWaybillQuery(request));
if (Func.isEmpty(waybills)) {
throw new ServiceException("没有可生成费用的运单");
}
ContractManage contract = contractManageService.getById(request.getContractId());
for (Waybill waybill : waybills) {
if (existsByWaybill(waybill.getId())) {
continue;
}
ReceivablePayableDetail detail = buildDetail(waybill, contract);
save(detail);
ReceivablePayableCargoFee cargoFee = buildCargoFee(detail.getId(), waybill);
cargoFeeMapper.insert(cargoFee);
}
}
private LambdaQueryWrapper<ReceivablePayableDetail> buildQuery(ReceivablePayableDetailVO query) {
LambdaQueryWrapper<ReceivablePayableDetail> wrapper = Wrappers.<ReceivablePayableDetail>lambdaQuery()
.eq(ReceivablePayableDetail::getIsDeleted, 0)
.like(Func.isNotEmpty(query.getDocumentNo()), ReceivablePayableDetail::getDocumentNo, query.getDocumentNo())
.ge(query.getGenerateStartDate() != null, ReceivablePayableDetail::getFeeDate, query.getGenerateStartDate())
.le(query.getGenerateEndDate() != null, ReceivablePayableDetail::getFeeDate, query.getGenerateEndDate())
.like(Func.isNotEmpty(query.getCustomerName()), ReceivablePayableDetail::getCustomerName, query.getCustomerName())
.like(Func.isNotEmpty(query.getDeptName()), ReceivablePayableDetail::getDeptName, query.getDeptName())
.like(Func.isNotEmpty(query.getProjectName()), ReceivablePayableDetail::getProjectName, query.getProjectName())
.like(Func.isNotEmpty(query.getCargoType()), ReceivablePayableDetail::getCargoType, query.getCargoType())
.like(Func.isNotEmpty(query.getCargoName()), ReceivablePayableDetail::getCargoName, query.getCargoName())
.like(Func.isNotEmpty(query.getContractNo()), ReceivablePayableDetail::getContractNo, query.getContractNo())
.like(Func.isNotEmpty(query.getContractName()), ReceivablePayableDetail::getContractName, query.getContractName())
.like(Func.isNotEmpty(query.getPreSettlementNo()), ReceivablePayableDetail::getPreSettlementNo, query.getPreSettlementNo())
.like(Func.isNotEmpty(query.getFormalSettlementNo()), ReceivablePayableDetail::getFormalSettlementNo, query.getFormalSettlementNo())
.like(Func.isNotEmpty(query.getBatchNo()), ReceivablePayableDetail::getBatchNo, query.getBatchNo())
.like(Func.isNotEmpty(query.getVehicleNo()), ReceivablePayableDetail::getVehicleNo, query.getVehicleNo())
.eq(Func.isNotEmpty(query.getSettlementStatus()), ReceivablePayableDetail::getSettlementStatus, query.getSettlementStatus());
return wrapper.orderByDesc(ReceivablePayableDetail::getCreateTime);
}
private LambdaQueryWrapper<ReceivablePayableDetail> buildUpdateQuery(ReceivablePayableUpdateFeeRequest request) {
LambdaQueryWrapper<ReceivablePayableDetail> wrapper = Wrappers.<ReceivablePayableDetail>lambdaQuery()
.eq(ReceivablePayableDetail::getIsDeleted, 0)
.eq(ReceivablePayableDetail::getSettlementStatus, "pending");
if (Func.isNotEmpty(request.getIds())) {
wrapper.in(ReceivablePayableDetail::getId, request.getIds());
}
if (Func.isNotEmpty(request.getContractId())) {
wrapper.eq(ReceivablePayableDetail::getContractId, request.getContractId());
}
return wrapper;
}
private LambdaQueryWrapper<Waybill> buildWaybillQuery(ReceivablePayableGenerateRequest request) {
LambdaQueryWrapper<Waybill> wrapper = Wrappers.<Waybill>lambdaQuery()
.eq(Waybill::getIsDeleted, 0)
.eq(Waybill::getContractId, request.getContractId())
.eq(Waybill::getBusinessStatus, "completed")
.notInSql(Waybill::getId, "select waybill_id from blade_receivable_payable_detail where is_deleted = 0");
if (Func.isNotEmpty(request.getBatchNo())) {
wrapper.like(Waybill::getBatchNo, request.getBatchNo());
}
if (request.getFinishStartDate() != null) {
wrapper.ge(Waybill::getEndDate, request.getFinishStartDate());
}
if (request.getFinishEndDate() != null) {
wrapper.le(Waybill::getEndDate, request.getFinishEndDate());
}
if (Func.isNotEmpty(request.getWaybillIds())) {
wrapper.in(Waybill::getId, request.getWaybillIds());
}
return wrapper.orderByDesc(Waybill::getCreateTime);
}
private ReceivablePayableDetail buildDetail(Waybill waybill, ContractManage contract) {
ReceivablePayableCargoFee cargoFee = buildCargoFee(null, waybill);
ReceivablePayableDetail detail = new ReceivablePayableDetail();
detail.setDocumentNo(nextDocumentNo());
detail.setSettlementType("receivable");
detail.setProjectId(waybill.getProjectId());
detail.setProjectName(waybill.getProjectName());
detail.setDeptId(waybill.getDeptId());
detail.setDeptName(waybill.getDeptName());
detail.setFeeDate(waybill.getEndDate() == null ? LocalDate.now() : waybill.getEndDate());
detail.setCustomerName(waybill.getCustomerName());
detail.setContractId(waybill.getContractId());
detail.setContractNo(contract == null ? null : contract.getContractNo());
detail.setContractName(waybill.getContractName());
detail.setSourceType("系统生成");
detail.setWaybillId(waybill.getId());
detail.setWaybillNo(waybill.getWaybillNo());
detail.setVehicleNo(waybill.getVehicleNo());
detail.setTransportType(waybill.getTransportType());
detail.setCargoName(waybill.getCargoName());
detail.setCargoType(waybill.getCargoType());
detail.setTransportQuantity(waybill.getQuantity());
detail.setQuantityUnit(waybill.getQuantityUnit());
detail.setMileage(waybill.getMileage());
detail.setBatchNo(waybill.getBatchNo());
detail.setUnitPrice(waybill.getUnitPrice());
detail.setCurrency("RMB");
detail.setFreightAmount(cargoFee.getFreightAmount());
detail.setOtherFeeAmount(waybill.getOtherFeeTotal());
detail.setTotalAmount(cargoFee.getAfterAmount());
detail.setSettlementStatus("pending");
detail.setFeeItemsJson(cargoFee.getFeeItemsJson());
return detail;
}
private ReceivablePayableCargoFee buildCargoFee(Long detailId, Waybill waybill) {
BigDecimal quantity = money(waybill.getQuantity());
BigDecimal unitPrice = money(waybill.getUnitPrice());
BigDecimal freightAmount = quantity.multiply(unitPrice).setScale(2, RoundingMode.HALF_UP);
BigDecimal otherFeeAmount = money(waybill.getOtherFeeTotal());
Map<String, Object> feeItems = parseMap(waybill.getFreightJson());
if (feeItems.isEmpty() && otherFeeAmount.compareTo(BigDecimal.ZERO) > 0) {
feeItems.put("其它费用", otherFeeAmount);
}
BigDecimal feeItemTotal = feeItems.values().stream().map(this::decimal).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal total = freightAmount.add(feeItemTotal).setScale(2, RoundingMode.HALF_UP);
ReceivablePayableCargoFee cargoFee = new ReceivablePayableCargoFee();
cargoFee.setDetailId(detailId);
cargoFee.setWaybillId(waybill.getId());
cargoFee.setLineNo("0001");
cargoFee.setCargoName(waybill.getCargoName());
cargoFee.setCargoType(waybill.getCargoType());
cargoFee.setSpecification(waybill.getSpecification());
cargoFee.setModel(waybill.getModel());
cargoFee.setBillingFactor("按重量");
cargoFee.setBillingType("固定单价");
cargoFee.setTransportQuantity(quantity);
cargoFee.setQuantityUnit(waybill.getQuantityUnit());
cargoFee.setPriceUnit(waybill.getPriceUnit());
cargoFee.setUnitPrice(unitPrice);
cargoFee.setMileage(waybill.getMileage());
cargoFee.setFreightAmount(freightAmount);
cargoFee.setFeeItemsJson(JsonUtil.toJson(feeItems));
cargoFee.setOriginalAmount(total);
cargoFee.setAdjustAmount(BigDecimal.ZERO);
cargoFee.setAfterAmount(total);
cargoFee.setRemark(waybill.getRemark());
return cargoFee;
}
private ReceivablePayableFeeDetailVO buildFeeDetail(List<ReceivablePayableCargoFee> rows) {
Set<String> feeItemNames = new LinkedHashSet<>();
List<ReceivablePayableCargoFeeVO> records = rows.stream().map(row -> {
ReceivablePayableCargoFeeVO vo = Objects.requireNonNull(BeanUtil.copyProperties(row, ReceivablePayableCargoFeeVO.class));
Map<String, Object> feeItems = parseMap(row.getFeeItemsJson());
feeItemNames.addAll(feeItems.keySet());
vo.setFeeItems(feeItems);
vo.setTransportQuantityText(formatQuantity(row.getTransportQuantity(), row.getQuantityUnit()));
vo.setOriginalAmountText(formatMoney(row.getOriginalAmount()));
vo.setAdjustAmountText(formatMoney(row.getAdjustAmount()));
vo.setAfterAmountText(formatMoney(row.getAfterAmount()));
vo.setUpdateUserName(UserCache.getUserRealName(row.getUpdateUser()));
return vo;
}).toList();
ReceivablePayableFeeDetailVO vo = new ReceivablePayableFeeDetailVO();
vo.setFeeItemNames(new ArrayList<>(feeItemNames));
vo.setRecords(records);
vo.setTotal((long) records.size());
return vo;
}
private void rebuildDetailFee(ReceivablePayableDetail detail) {
Waybill waybill = waybillService.getById(detail.getWaybillId());
if (waybill == null) {
throw new ServiceException("关联运单不存在");
}
ReceivablePayableCargoFee cargoFee = buildCargoFee(detail.getId(), waybill);
cargoFeeMapper.delete(Wrappers.<ReceivablePayableCargoFee>lambdaQuery().eq(ReceivablePayableCargoFee::getDetailId, detail.getId()));
cargoFeeMapper.insert(cargoFee);
detail.setFreightAmount(cargoFee.getFreightAmount());
detail.setOtherFeeAmount(money(waybill.getOtherFeeTotal()));
detail.setTotalAmount(cargoFee.getAfterAmount());
detail.setFeeItemsJson(cargoFee.getFeeItemsJson());
updateById(detail);
}
private void closeDetails(List<Long> ids) {
if (Func.isEmpty(ids)) {
throw new ServiceException("请选择需要关闭的明细");
}
for (ReceivablePayableDetail detail : listByIds(ids)) {
if (!"pending".equals(detail.getSettlementStatus())) {
throw new ServiceException("仅待结算明细允许关闭");
}
detail.setSettlementStatus("closed");
updateById(detail);
}
}
private void saveChangeRecord(ReceivablePayableDetail detail, String content, String reason) {
ReceivablePayableChangeRecord record = new ReceivablePayableChangeRecord();
record.setDetailId(detail.getId());
record.setLineNo("0001");
record.setCargoName(detail.getCargoName());
record.setChangeContent(content);
record.setAdjustUser(AuthUtil.getUserId());
record.setAdjustUserName(AuthUtil.getUserName());
record.setAdjustReason(reason);
record.setAdjustTime(LocalDateTime.now());
changeRecordMapper.insert(record);
}
private ReceivablePayableDetail getExisting(Long id) {
ReceivablePayableDetail detail = getById(id);
if (detail == null || Objects.equals(detail.getIsDeleted(), 1)) {
throw new ServiceException("应收应付明细不存在");
}
return detail;
}
private boolean existsByWaybill(Long waybillId) {
return count(Wrappers.<ReceivablePayableDetail>lambdaQuery()
.eq(ReceivablePayableDetail::getWaybillId, waybillId)
.eq(ReceivablePayableDetail::getIsDeleted, 0)) > 0;
}
private void validateGenerateRequest(ReceivablePayableGenerateRequest request, boolean requireWaybill) {
if (Func.isEmpty(request.getContractId())) {
throw new ServiceException("请选择运单合同");
}
if (Func.isEmpty(request.getBillingPlanId())) {
throw new ServiceException("请选择计费方案");
}
if (requireWaybill && Func.isEmpty(request.getWaybillIds())) {
throw new ServiceException("请选择需要生成费用的运单");
}
}
private Map<String, Object> waybillMap(Waybill waybill) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("id", waybill.getId());
map.put("waybillNo", waybill.getWaybillNo());
map.put("projectName", waybill.getProjectName());
map.put("customerName", waybill.getCustomerName());
map.put("vehicleNo", waybill.getVehicleNo());
map.put("driverName", waybill.getDriverName());
map.put("carrierName", waybill.getCarrierName());
map.put("transportType", waybill.getTransportType());
map.put("carrierType", waybill.getCarrierType());
map.put("cargoInfo", waybill.getCargoName());
return map;
}
private Map<String, Object> beanMap(ReceivablePayableDetailVO detail) {
Map<String, Object> map = new LinkedHashMap<>();
BeanUtil.copyProperties(detail, map);
return map;
}
private Map<String, Object> parseMap(String json) {
if (Func.isEmpty(json)) {
return new LinkedHashMap<>();
}
try {
Object parsed = JsonUtil.parse(json, Map.class);
if (parsed instanceof Map<?, ?> source) {
Map<String, Object> map = new LinkedHashMap<>();
source.forEach((key, value) -> map.put(String.valueOf(key), value));
return map;
}
if (parsed instanceof List<?> list && !list.isEmpty() && list.get(0) instanceof Map<?, ?> source) {
Map<String, Object> map = new LinkedHashMap<>();
source.forEach((key, value) -> {
String name = String.valueOf(key);
if (name.contains("")) {
map.put(name, value);
}
});
return map;
}
} catch (Exception ignored) {
return new LinkedHashMap<>();
}
return new LinkedHashMap<>();
}
private BigDecimal decimal(Object value) {
if (value == null || "".equals(value)) {
return BigDecimal.ZERO;
}
try {
return new BigDecimal(String.valueOf(value)).setScale(2, RoundingMode.HALF_UP);
} catch (Exception ignored) {
return BigDecimal.ZERO;
}
}
private BigDecimal money(BigDecimal value) {
return value == null ? BigDecimal.ZERO : value.setScale(2, RoundingMode.HALF_UP);
}
private String formatMoney(BigDecimal value) {
return money(value).toPlainString();
}
private String formatQuantity(BigDecimal quantity, String unit) {
return money(quantity).stripTrailingZeros().toPlainString() + (unit == null ? "" : " " + unit);
}
private LocalDate parseDate(String value) {
return Func.isEmpty(value) ? null : LocalDate.parse(value);
}
private synchronized String nextDocumentNo() {
return "YS" + LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE) + System.currentTimeMillis() % 100000;
}
private synchronized String settlementBillNo(String type) {
String prefix = "pre".equals(type) ? "YJ" : "ZJ";
return prefix + LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE) + System.currentTimeMillis() % 100000;
}
}
@@ -0,0 +1,135 @@
package org.springblade.transport.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.transport.mapper.RiskDisposalMapper;
import org.springblade.transport.pojo.dto.RiskDisposalBatchDisposeRequest;
import org.springblade.transport.pojo.dto.RiskDisposalDisposeRequest;
import org.springblade.transport.pojo.entity.RiskDisposal;
import org.springblade.transport.pojo.vo.RiskDisposalBatchResultVO;
import org.springblade.transport.pojo.vo.RiskDisposalVO;
import org.springblade.transport.service.IRiskDisposalService;
import org.springblade.transport.support.TransportBusinessSupport;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
@Service
public class RiskDisposalServiceImpl extends BaseServiceImpl<RiskDisposalMapper, RiskDisposal> implements IRiskDisposalService {
private static final String STATUS_PENDING = "pending";
private static final String STATUS_PROCESSED = "processed";
private static final String STATUS_IGNORED = "ignored";
@Override
public IPage<RiskDisposalVO> selectPage(IPage<RiskDisposal> page, RiskDisposalVO query) {
IPage<RiskDisposal> entityPage = page(page, buildQuery(query));
IPage<RiskDisposalVO> voPage = entityPage.convert(this::toVO);
return voPage;
}
@Override
public RiskDisposalVO detail(Long id) {
return toVO(getExisting(id));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void dispose(RiskDisposalDisposeRequest request) {
RiskDisposal risk = getExisting(request.getId());
if (!STATUS_PENDING.equals(risk.getDisposalStatus())) {
throw new ServiceException("仅待处理风险允许处置");
}
risk.setDisposalMethod(request.getDisposalMethod());
risk.setDisposalRemark(TransportBusinessSupport.trimToNull(request.getDisposalRemark()));
risk.setDisposalStatus("ignore".equals(request.getDisposalMethod()) ? STATUS_IGNORED : STATUS_PROCESSED);
risk.setDisposeTime(LocalDateTime.now());
updateById(risk);
}
@Override
@Transactional(rollbackFor = Exception.class)
public RiskDisposalBatchResultVO batchDispose(RiskDisposalBatchDisposeRequest request) {
RiskDisposalBatchResultVO result = new RiskDisposalBatchResultVO();
if (request == null || Func.isEmpty(request.getIds())) {
throw new ServiceException("请选择需要处理的风险");
}
for (Long id : request.getIds()) {
try {
dispose(single(id, request.getDisposalMethod(), request.getDisposalRemark()));
result.setSuccessCount(result.getSuccessCount() + 1);
} catch (Exception ex) {
result.setSkippedCount(result.getSkippedCount() + 1);
}
}
return result;
}
private RiskDisposalDisposeRequest single(Long id, String method, String remark) {
RiskDisposalDisposeRequest request = new RiskDisposalDisposeRequest();
request.setId(id);
request.setDisposalMethod(method);
request.setDisposalRemark(remark);
return request;
}
private LambdaQueryWrapper<RiskDisposal> buildQuery(RiskDisposalVO query) {
return Wrappers.<RiskDisposal>lambdaQuery()
.eq(RiskDisposal::getIsDeleted, 0)
.like(Func.isNotEmpty(query.getRiskNo()), RiskDisposal::getRiskNo, query.getRiskNo())
.like(Func.isNotEmpty(query.getRuleName()), RiskDisposal::getRuleName, query.getRuleName())
.like(Func.isNotEmpty(query.getWaybillNo()), RiskDisposal::getWaybillNo, query.getWaybillNo())
.like(Func.isNotEmpty(query.getProjectName()), RiskDisposal::getProjectName, query.getProjectName())
.eq(Func.isNotEmpty(query.getRiskLevel()), RiskDisposal::getRiskLevel, query.getRiskLevel())
.eq(Func.isNotEmpty(query.getDisposalStatus()), RiskDisposal::getDisposalStatus, query.getDisposalStatus())
.orderByDesc(RiskDisposal::getCreateTime);
}
private RiskDisposalVO toVO(RiskDisposal entity) {
RiskDisposalVO vo = Objects.requireNonNull(BeanUtil.copyProperties(entity, RiskDisposalVO.class));
vo.setCreateUserName(UserCache.getUserRealName(entity.getCreateUser()));
vo.setUpdateUserName(UserCache.getUserRealName(entity.getUpdateUser()));
vo.setRiskLevelName(levelName(entity.getRiskLevel()));
vo.setDisposalStatusName(statusName(entity.getDisposalStatus()));
return vo;
}
private RiskDisposal getExisting(Long id) {
if (id == null) {
throw new ServiceException("风险记录不存在");
}
RiskDisposal risk = getById(id);
if (risk == null || Objects.equals(risk.getIsDeleted(), 1)) {
throw new ServiceException("风险记录不存在");
}
return risk;
}
private String levelName(String level) {
return switch (Func.toStr(level)) {
case "low" -> "";
case "medium" -> "";
case "high" -> "";
default -> "";
};
}
private String statusName(String status) {
return switch (Func.toStr(status)) {
case STATUS_PENDING -> "待处理";
case STATUS_PROCESSED -> "已处理";
case STATUS_IGNORED -> "已忽略";
default -> "";
};
}
}
@@ -36,9 +36,12 @@ import org.springblade.transport.excel.WaybillExcel;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import org.springblade.transport.mapper.WaybillMapper;
import org.springblade.transport.pojo.entity.LoadingManage;
import org.springblade.transport.pojo.entity.Waybill;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.LoadingManageVO;
import org.springblade.transport.pojo.vo.WaybillVO;
import org.springblade.transport.service.ILoadingManageService;
import org.springblade.transport.service.IWaybillService;
import org.springblade.transport.support.TransportBusinessSupport;
import org.springblade.transport.wrapper.WaybillWrapper;
@@ -51,6 +54,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 运单管理 服务实现类
@@ -60,6 +64,11 @@ import java.util.Objects;
@Service
public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill> implements IWaybillService {
private static final String STATUS_DRAFT = "draft";
@jakarta.annotation.Resource
private ILoadingManageService loadingManageService;
@Override
public IPage<WaybillVO> selectWaybillPage(IPage<Waybill> page, WaybillVO waybill) {
IPage<Waybill> entityPage = page(page, buildQuery(waybill));
@@ -279,6 +288,58 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public LoadingManageVO roadLoading(String ids) {
List<Long> idList = Func.toLongList(ids);
if (Func.isEmpty(idList)) {
throw new ServiceException("请选择待配载运单");
}
List<Waybill> waybills = listByIds(idList);
if (waybills.size() != idList.size()) {
throw new ServiceException("待配载运单不存在或已删除");
}
Waybill first = waybills.get(0);
LoadingManage loadingManage = new LoadingManage();
loadingManage.setWaybillIdsJson(JsonUtil.toJson(idList));
loadingManage.setLoadingSubNos(waybills.stream()
.map(Waybill::getWaybillNo)
.filter(Func::isNotEmpty)
.collect(Collectors.joining(",")));
loadingManage.setProjectId(first.getProjectId());
loadingManage.setProjectName(first.getProjectName());
loadingManage.setCustomerName(first.getCustomerName());
loadingManage.setTransportType(first.getTransportType());
loadingManage.setCargoType(first.getCargoType());
loadingManage.setCargoName(first.getCargoName());
loadingManage.setVehicleNo(first.getVehicleNo());
loadingManage.setTrailerVehicleNo(first.getTrailerVehicleNo());
loadingManage.setDriverName(first.getDriverName());
loadingManage.setDriverPhone(first.getDriverPhone());
loadingManage.setEscortName(first.getEscortName());
loadingManage.setEscortPhone(first.getEscortPhone());
loadingManage.setCarrierType(first.getCarrierType());
loadingManage.setCarrierName(first.getCarrierName());
loadingManage.setDepartureAddress(first.getDepartureAddress());
loadingManage.setArrivalAddress(first.getArrivalAddress());
loadingManage.setOriginalNo(first.getOriginalNo());
loadingManage.setDataSource(first.getDataSource());
loadingManage.setStartDate(first.getStartDate());
loadingManage.setEndDate(first.getEndDate());
loadingManage.setPlanName(first.getPlanName());
loadingManage.setBatchNo(first.getBatchNo());
loadingManage.setCurrentProcessNode(first.getCurrentProcessNode());
loadingManage.setMileage(first.getMileage());
loadingManage.setEstimatedStartDate(first.getEstimatedStartTime());
loadingManage.setEstimatedEndDate(first.getEstimatedEndTime());
loadingManage.setTaskRemark(first.getTaskRemark());
loadingManage.setGoodsJson(first.getGoodsJson());
loadingManage.setTaskInfoJson(first.getTaskInfoJson());
loadingManage.setBusinessStatus(STATUS_DRAFT);
loadingManageService.saveDraft(loadingManage);
return loadingManageService.detail(loadingManage.getId());
}
private LambdaQueryWrapper<Waybill> buildQuery(WaybillVO waybill) {
TransportBusinessSupport.validateAllDept(waybill.getAllDept(), "运单管理");
LambdaQueryWrapper<Waybill> queryWrapper = Wrappers.<Waybill>lambdaQuery().eq(Waybill::getIsDeleted, 0);
@@ -0,0 +1,74 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.transport.pojo.entity.ReceivablePayableDetail;
import org.springblade.transport.pojo.vo.ReceivablePayableDetailVO;
import java.util.Map;
import java.util.Objects;
/**
* 应收应付明细包装类
*
* @author Chill
*/
public class ReceivablePayableDetailWrapper
extends BaseEntityWrapper<ReceivablePayableDetail, ReceivablePayableDetailVO> {
public static ReceivablePayableDetailWrapper build() {
return new ReceivablePayableDetailWrapper();
}
@Override
public ReceivablePayableDetailVO entityVO(ReceivablePayableDetail entity) {
ReceivablePayableDetailVO vo = Objects.requireNonNull(
BeanUtil.copyProperties(entity, ReceivablePayableDetailVO.class));
vo.setCreateUserName(UserCache.getUserRealName(entity.getCreateUser()));
vo.setUpdateUserName(UserCache.getUserRealName(entity.getUpdateUser()));
vo.setSettlementStatusName(statusName(entity.getSettlementStatus()));
try {
Object parsed = JsonUtil.parse(entity.getFeeItemsJson(), Map.class);
if (parsed instanceof Map<?, ?> map) {
vo.setFeeItems((Map<String, Object>) map);
}
} catch (Exception ignored) {
// 兼容历史脏数据,列表仍需正常展示。
}
return vo;
}
private String statusName(String status) {
return switch (status == null ? "" : status) {
case "pending" -> "待结算";
case "pre_settled" -> "已转预结算";
case "formal_settled" -> "已转正式结算";
case "closed" -> "已关闭";
default -> status;
};
}
}
@@ -0,0 +1,67 @@
-- 在途管理 / 异常处置
CREATE TABLE IF NOT EXISTS `blade_exception_disposal` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`waybill_id` bigint(20) DEFAULT NULL COMMENT '运单ID',
`waybill_no` varchar(100) DEFAULT NULL COMMENT '运单号',
`loading_or_master_no` varchar(100) DEFAULT NULL COMMENT '配载单号/总单号',
`project_id` bigint(20) DEFAULT NULL COMMENT '项目ID',
`project_name` varchar(100) DEFAULT NULL COMMENT '项目',
`vehicle_no` varchar(100) DEFAULT NULL COMMENT '车牌号',
`reporter_id` bigint(20) DEFAULT NULL COMMENT '上报人ID',
`reporter_name` varchar(100) DEFAULT NULL COMMENT '上报人',
`report_time` datetime DEFAULT NULL COMMENT '上报时间',
`exception_type` varchar(100) DEFAULT NULL COMMENT '异常类型',
`exception_reason` varchar(200) DEFAULT NULL COMMENT '异常原因',
`report_description` varchar(500) DEFAULT NULL COMMENT '上报说明',
`carrier_id` bigint(20) DEFAULT NULL COMMENT '承运商ID',
`carrier_name` varchar(100) DEFAULT NULL COMMENT '承运商',
`scene_photos` text DEFAULT NULL COMMENT '现场照片',
`latest_follow_content` varchar(500) DEFAULT NULL COMMENT '最新跟进说明',
`disposal_status` varchar(30) NOT NULL DEFAULT 'pending' COMMENT '处置状态',
`dept_id` bigint(20) DEFAULT NULL COMMENT '所属组织ID',
`dept_name` varchar(100) DEFAULT NULL COMMENT '所属组织',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_exception_disposal_waybill` (`waybill_id`, `waybill_no`) USING BTREE,
KEY `idx_exception_disposal_status` (`disposal_status`) USING BTREE,
KEY `idx_exception_disposal_report_time` (`report_time`) USING BTREE,
KEY `idx_exception_disposal_create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常处置';
CREATE TABLE IF NOT EXISTS `blade_exception_disposal_follow_record` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`disposal_id` bigint(20) NOT NULL COMMENT '异常处置ID',
`follow_content` varchar(500) NOT NULL COMMENT '跟进说明',
`follow_user` bigint(20) DEFAULT NULL COMMENT '跟进人',
`follow_user_name` varchar(100) DEFAULT NULL COMMENT '跟进人姓名',
`follow_time` datetime DEFAULT NULL COMMENT '跟进时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_exception_follow_disposal` (`disposal_id`) USING BTREE,
KEY `idx_exception_follow_time` (`follow_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常处置跟进记录';
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`)
VALUES
(2090000000000002000, 0, 'transit_manage', '在途管理', 'transit_manage', '/transit', 'iconfont icon-caidanguanli', 90, 1, 0, 1, NULL, '', 0),
(2090000000000002001, 2090000000000002000, 'exception_disposal', '异常处置', 'exception_disposal', '/transit/exception-disposal', 'iconfont icon-caidanguanli', 1, 1, 0, 1, NULL, '', 0),
(2090000000000002002, 2090000000000002001, 'exception_disposal_view', '查看', 'exception_disposal_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2090000000000002003, 2090000000000002001, 'exception_disposal_follow', '跟进', 'exception_disposal_follow', '', '', 2, 2, 0, 1, NULL, '', 0),
(2090000000000002004, 2090000000000002001, 'exception_disposal_complete', '完成', 'exception_disposal_complete', '', '', 3, 2, 0, 1, NULL, '', 0),
(2090000000000002005, 2090000000000002001, 'exception_disposal_batch_complete', '批量完成', 'exception_disposal_batch_complete', '', '', 4, 2, 0, 1, NULL, '', 0)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `path` = VALUES(`path`), `is_deleted` = 0;
@@ -0,0 +1,127 @@
-- 结算管理 / 应收应付明细
CREATE TABLE IF NOT EXISTS `blade_receivable_payable_detail` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`document_no` varchar(100) NOT NULL COMMENT '单据号',
`settlement_type` varchar(30) NOT NULL DEFAULT 'receivable' COMMENT '结算明细类型',
`project_id` bigint(20) DEFAULT NULL COMMENT '项目ID',
`project_name` varchar(100) DEFAULT NULL COMMENT '项目名称',
`dept_id` bigint(20) DEFAULT NULL COMMENT '所属组织ID',
`dept_name` varchar(100) DEFAULT NULL COMMENT '所属组织',
`fee_date` date DEFAULT NULL COMMENT '费用日期',
`customer_name` varchar(100) DEFAULT NULL COMMENT '客商名称',
`contract_id` bigint(20) DEFAULT NULL COMMENT '合同ID',
`contract_no` varchar(100) DEFAULT NULL COMMENT '合同编号',
`contract_name` varchar(100) DEFAULT NULL COMMENT '合同名称',
`source_type` varchar(30) DEFAULT NULL COMMENT '来源',
`pre_settlement_no` varchar(100) DEFAULT NULL COMMENT '预结算单号',
`formal_settlement_no` varchar(100) DEFAULT NULL COMMENT '正式结算单号',
`waybill_id` bigint(20) DEFAULT NULL COMMENT '运单ID',
`waybill_no` varchar(100) DEFAULT NULL COMMENT '运单号',
`vehicle_no` varchar(100) DEFAULT NULL COMMENT '车号',
`transport_type` varchar(100) DEFAULT NULL COMMENT '运输类型',
`cargo_name` varchar(100) DEFAULT NULL COMMENT '货物名称',
`cargo_type` varchar(100) DEFAULT NULL COMMENT '货物类型',
`transport_quantity` decimal(18,6) DEFAULT NULL COMMENT '运输总量',
`quantity_unit` varchar(50) DEFAULT NULL COMMENT '数量单位',
`mileage` decimal(18,2) DEFAULT NULL COMMENT '里程',
`batch_no` varchar(100) DEFAULT NULL COMMENT '批次号',
`unit_price` decimal(18,2) DEFAULT NULL COMMENT '运输单价',
`currency` varchar(20) DEFAULT 'RMB' COMMENT '币种',
`freight_amount` decimal(18,2) DEFAULT NULL COMMENT '运输费',
`other_fee_amount` decimal(18,2) DEFAULT NULL COMMENT '其它费用',
`total_amount` decimal(18,2) DEFAULT NULL COMMENT '费用合计',
`settlement_status` varchar(30) NOT NULL DEFAULT 'pending' COMMENT '状态',
`fee_items_json` text DEFAULT NULL COMMENT '费用项JSON',
`remark` varchar(200) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_receivable_payable_document_no` (`tenant_id`, `document_no`) USING BTREE,
KEY `idx_receivable_payable_create_time` (`create_time`) USING BTREE,
KEY `idx_receivable_payable_fee_date` (`fee_date`) USING BTREE,
KEY `idx_receivable_payable_contract` (`contract_id`) USING BTREE,
KEY `idx_receivable_payable_waybill` (`waybill_id`) USING BTREE,
KEY `idx_receivable_payable_status` (`settlement_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收应付明细';
CREATE TABLE IF NOT EXISTS `blade_receivable_payable_cargo_fee` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`detail_id` bigint(20) NOT NULL COMMENT '应收应付明细ID',
`waybill_id` bigint(20) DEFAULT NULL COMMENT '运单ID',
`line_no` varchar(30) DEFAULT NULL COMMENT '行号',
`cargo_name` varchar(100) DEFAULT NULL COMMENT '货物名称',
`cargo_type` varchar(100) DEFAULT NULL COMMENT '货物类型',
`specification` varchar(255) DEFAULT NULL COMMENT '规格',
`model` varchar(255) DEFAULT NULL COMMENT '型号',
`billing_factor` varchar(100) DEFAULT NULL COMMENT '运费计费要素',
`billing_type` varchar(100) DEFAULT NULL COMMENT '运费计费类型',
`transport_quantity` decimal(18,6) DEFAULT NULL COMMENT '运输量',
`quantity_unit` varchar(50) DEFAULT NULL COMMENT '数量单位',
`price_unit` varchar(50) DEFAULT NULL COMMENT '运费计算单位',
`unit_price` decimal(18,2) DEFAULT NULL COMMENT '运输单价',
`mileage` decimal(18,2) DEFAULT NULL COMMENT '里程',
`freight_amount` decimal(18,2) DEFAULT NULL COMMENT '运输费',
`fee_items_json` text DEFAULT NULL COMMENT '费用项JSON',
`original_amount` decimal(18,2) DEFAULT NULL COMMENT '原总金额',
`adjust_amount` decimal(18,2) DEFAULT NULL COMMENT '调整金额',
`after_amount` decimal(18,2) DEFAULT NULL COMMENT '调整后总金额',
`remark` varchar(200) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_receivable_payable_cargo_detail` (`detail_id`) USING BTREE,
KEY `idx_receivable_payable_cargo_waybill` (`waybill_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收应付货物费用明细';
CREATE TABLE IF NOT EXISTS `blade_receivable_payable_change_record` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`detail_id` bigint(20) NOT NULL COMMENT '应收应付明细ID',
`line_no` varchar(30) DEFAULT NULL COMMENT '行号',
`cargo_name` varchar(100) DEFAULT NULL COMMENT '货物名称',
`change_content` varchar(500) DEFAULT NULL COMMENT '变更内容',
`adjust_user` bigint(20) DEFAULT NULL COMMENT '调整人',
`adjust_user_name` varchar(100) DEFAULT NULL COMMENT '调整人姓名',
`adjust_reason` varchar(200) DEFAULT NULL COMMENT '调整原因',
`adjust_time` datetime DEFAULT NULL COMMENT '调整时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_receivable_payable_change_detail` (`detail_id`) USING BTREE,
KEY `idx_receivable_payable_change_time` (`adjust_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收应付费用变更记录';
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`)
VALUES
(2090000000000001000, 0, 'settlement_manage', '结算管理', 'settlement_manage', '/settlement', 'iconfont icon-caidanguanli', 100, 1, 0, 1, NULL, '', 0),
(2090000000000001001, 2090000000000001000, 'receivable_detail', '应收', 'receivable_detail', '/settlement/receivable-detail', 'iconfont icon-caidanguanli', 1, 1, 0, 1, NULL, '', 0),
(2090000000000001002, 2090000000000001001, 'receivable_detail_view', '查看', 'receivable_detail_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2090000000000001003, 2090000000000001001, 'receivable_detail_generate', '生成费用', 'receivable_detail_generate', '', '', 2, 2, 0, 1, NULL, '', 0),
(2090000000000001004, 2090000000000001001, 'receivable_detail_update_fee', '更新费用', 'receivable_detail_update_fee', '', '', 3, 2, 0, 1, NULL, '', 0),
(2090000000000001005, 2090000000000001001, 'receivable_detail_transfer', '批量转结算', 'receivable_detail_transfer', '', '', 4, 2, 0, 1, NULL, '', 0),
(2090000000000001006, 2090000000000001001, 'receivable_detail_export', '导出', 'receivable_detail_export', '', '', 5, 2, 0, 1, NULL, '', 0),
(2090000000000001007, 2090000000000001000, 'payable_detail', '应付', 'payable_detail', '/settlement/payable-detail', 'iconfont icon-caidanguanli', 2, 1, 0, 1, NULL, '', 0),
(2090000000000001008, 2090000000000001007, 'payable_detail_view', '查看', 'payable_detail_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2090000000000001009, 2090000000000001007, 'payable_detail_generate', '生成费用', 'payable_detail_generate', '', '', 2, 2, 0, 1, NULL, '', 0),
(2090000000000001010, 2090000000000001007, 'payable_detail_update_fee', '更新费用', 'payable_detail_update_fee', '', '', 3, 2, 0, 1, NULL, '', 0),
(2090000000000001011, 2090000000000001007, 'payable_detail_transfer', '批量转结算', 'payable_detail_transfer', '', '', 4, 2, 0, 1, NULL, '', 0),
(2090000000000001012, 2090000000000001007, 'payable_detail_export', '导出', 'payable_detail_export', '', '', 5, 2, 0, 1, NULL, '', 0)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `path` = VALUES(`path`), `is_deleted` = 0;
+44
View File
@@ -0,0 +1,44 @@
-- 在途管理 / 风险处置
CREATE TABLE IF NOT EXISTS `blade_risk_disposal` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`risk_no` varchar(100) DEFAULT NULL COMMENT '风险编号',
`rule_name` varchar(100) DEFAULT NULL COMMENT '规则名称',
`waybill_id` bigint(20) DEFAULT NULL COMMENT '运单ID',
`waybill_no` varchar(100) DEFAULT NULL COMMENT '运单号',
`project_name` varchar(100) DEFAULT NULL COMMENT '项目名称',
`vehicle_no` varchar(100) DEFAULT NULL COMMENT '车牌号',
`risk_level` varchar(30) DEFAULT NULL COMMENT '风险等级',
`transport_type` varchar(50) DEFAULT NULL COMMENT '运输类型',
`risk_description` varchar(500) DEFAULT NULL COMMENT '风险描述',
`disposal_status` varchar(30) NOT NULL DEFAULT 'pending' COMMENT '处置状态',
`disposal_method` varchar(30) DEFAULT NULL COMMENT '处理方式',
`disposal_remark` varchar(500) DEFAULT NULL COMMENT '处置说明',
`dept_id` bigint(20) DEFAULT NULL COMMENT '所属组织ID',
`dept_name` varchar(100) DEFAULT NULL COMMENT '所属组织',
`trigger_time` datetime DEFAULT NULL COMMENT '触发时间',
`dispose_time` datetime DEFAULT NULL COMMENT '处理时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_risk_disposal_waybill` (`waybill_id`, `waybill_no`) USING BTREE,
KEY `idx_risk_disposal_status` (`disposal_status`) USING BTREE,
KEY `idx_risk_disposal_trigger_time` (`trigger_time`) USING BTREE,
KEY `idx_risk_disposal_create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='风险处置';
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`)
VALUES
(2090000000000003000, 0, 'transit_manage', '在途管理', 'transit_manage', '/transit', 'iconfont icon-caidanguanli', 90, 1, 0, 1, NULL, '', 0),
(2090000000000003001, 2090000000000003000, 'risk_disposal', '风险处置', 'risk_disposal', '/transit/risk-disposal', 'iconfont icon-caidanguanli', 2, 1, 0, 1, NULL, '', 0),
(2090000000000003002, 2090000000000003001, 'risk_disposal_view', '查看', 'risk_disposal_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2090000000000003003, 2090000000000003001, 'risk_disposal_follow', '处理', 'risk_disposal_follow', '', '', 2, 2, 0, 1, NULL, '', 0),
(2090000000000003004, 2090000000000003001, 'risk_disposal_batch_dispose', '批量处理', 'risk_disposal_batch_dispose', '', '', 3, 2, 0, 1, NULL, '', 0)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `path` = VALUES(`path`), `is_deleted` = 0;