BUG修复

This commit is contained in:
dengjun 2024-07-23 15:36:01 +08:00
parent b31b25b6ff
commit d7daf871ca
101 changed files with 5548 additions and 801 deletions

View File

@ -0,0 +1,31 @@
package com.haitonggauto.rtosc.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
@Data
@ApiModel(value = "多船批量审核")
public class BatchCheckShipVo implements Serializable {
@ApiModelProperty(value = "船ID")
@NotBlank(message = "船ID不能为空")
private String shipId;
@ApiModelProperty(value = "航次ID")
@NotBlank(message = "航次ID不能为空")
private String voyageId;
@ApiModelProperty(value = "港区ID")
@NotBlank(message = "港区ID不能为空")
private String portAreaId;
@ApiModelProperty(value = "预进港时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date preArrivalTime;
}

View File

@ -0,0 +1,28 @@
package com.haitonggauto.rtosc.dto;
import com.haitonggauto.rtosc.common.utils.ValidationGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
@ApiModel("提单号验证")
public class BillNumValidVo {
@ApiModelProperty(value = "船ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "船ID不能为空")
private String shipId;
@ApiModelProperty(value = "航次ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次ID不能为空")
private String voyageId;
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "货代ID不能为空")
@ApiModelProperty(value = "货代ID", required = true)
private String freightId;
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "提单号不能为空")
@ApiModelProperty(value = "提单号", required = true)
private String billNum;
}

View File

@ -1,5 +1,6 @@
package com.haitonggauto.rtosc.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.haitonggauto.rtosc.common.utils.ValidationGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -9,6 +10,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@ApiModel(value = "提离港区货物表",description = "")
@ -46,14 +48,13 @@ public class DepartureCargoVo implements Serializable {
* 货物类型
*/
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "车型不能为空")
@ApiModelProperty(value = "车型", required = true)
private String cargoType;
// @ApiModelProperty(value = "车型", required = true)
// private String cargoType;
/**
* 车架号/条码
*/
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "车架号/条码不能为空")
@Size(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, min = 17, max = 17, message = "车架号长度为17位")
@ApiModelProperty(value = "车架号/条码", required = true)
private String vin;
@ -71,6 +72,53 @@ public class DepartureCargoVo implements Serializable {
@ApiModelProperty(value = "是否退关", required = true)
private Integer isShutout;
/**
* 车型ID
*/
@ApiModelProperty(value = "车型ID")
private String cartTypeId;
/**
* 车型
*/
@ApiModelProperty(value = "车型")
private String cartType;
// 型号
@ApiModelProperty(value = "型号")
private String models;
/**
*
*/
@ApiModelProperty(value = "")
private BigDecimal length;
/**
*
*/
@ApiModelProperty(value = "")
private BigDecimal width;
/**
*
*/
@ApiModelProperty(value = "")
private BigDecimal height;
/**
* 重量()
*/
@TableField(value = "weight")
@ApiModelProperty(value = "重量")
private BigDecimal weight;
// 是否报关
@ApiModelProperty(value = "是否报关")
private Integer isCustoms;
@ApiModelProperty(value = "是否随车备件")
private Integer isSpare;
@ApiModelProperty(value = "车辆状态")
private String vinStatus;

View File

@ -0,0 +1,47 @@
package com.haitonggauto.rtosc.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
@Data
@ApiModel("提离港区验证")
public class DepartureValidVo {
@ApiModelProperty(value = "船ID")
@NotBlank(message = "船ID不能为空")
private String shipId;
@ApiModelProperty(value = "航次ID")
@NotBlank(message = "航次ID不能为空")
private String voyageId;
@NotBlank(message = "港区ID不能为空")
@ApiModelProperty(value = "港区ID", required = true)
private String portAreaId;
@ApiModelProperty(value = "品牌ID", required = true)
@NotBlank(message = "品牌ID不能为空")
private String brandId;
@Valid
@NotNull(message = "车架号不能为空")
@Size(min = 1, message = "车架号不能为空")
private List<BillVin> vins;
@Data
public static class BillVin {
@ApiModelProperty(value = "提单号", required = true)
@NotBlank(message = "提单号不能为空")
private String billNo;
@ApiModelProperty(value = "车架号", required = true)
@NotBlank(message = "车架号不能为空")
private String vin;
}
}

View File

@ -56,30 +56,44 @@ public class DepartureVo implements Serializable {
* 航次ID
*/
@ApiModelProperty(value = "航次ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次ID不能为空")
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次ID不能为空")
private String voyageId;
/**
* 航次
*/
@ApiModelProperty(value = "航次", required = true)
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次不能为空")
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次不能为空")
private String voyage;
/**
* 港区ID
*/
@ApiModelProperty(value = "港区ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "港区ID不能为空")
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "港区ID不能为空")
private String portAreaId;
/**
* 港区
*/
@ApiModelProperty(value = "港区", required = true)
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "港区不能为空")
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "港区不能为空")
private String portArea;
/**
* 品牌ID
*/
@ApiModelProperty(value = "品牌ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "品牌ID不能为空")
private String brandId;
/**
* 品牌
*/
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "品牌不能为空")
@ApiModelProperty(value = "品牌")
private String brand;
/**
* 贸易类型
*/

View File

@ -0,0 +1,51 @@
package com.haitonggauto.rtosc.dto;
import com.haitonggauto.rtosc.common.utils.ValidationGroup;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
/**
* 出口进场基本表
*
* @TableName customer_export_in
*/
@Data
@ApiModel(value = "进港审核", description = "")
public class ExportInAuditVo implements Serializable {
@ApiModelProperty(value = "船ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "船ID不能为空")
private String shipId;
/**
* 航次ID
*/
@ApiModelProperty(value = "航次ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次ID不能为空")
private String voyageId;
/**
* 审核状态
*/
@ApiModelProperty(value = "审核状态")
@NotNull(groups = {ValidationGroup.insert.class}, message = "审核状态不能为空")
private AuditEnum checkStatus;
@ApiModelProperty(value = "提单号列表")
@NotNull(groups = {ValidationGroup.insert.class}, message = "提单号列表不能为空")
@Size(min = 1, message = "提单号列表不能为空")
private List<String> billNums;
/**
* 审核原因
*/
@ApiModelProperty(value = "审核原因")
private String checkResult;
}

View File

@ -0,0 +1,44 @@
package com.haitonggauto.rtosc.dto;
import com.haitonggauto.rtosc.common.utils.ValidationGroup;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
/**
* 出口进场货物表
* @TableName customer_export_in_cargo
*/
@Data
@ApiModel(value = "多船审核信息",description = "")
public class ExportInBatchCheckVo implements Serializable {
@ApiModelProperty(value = "原始审核状态")
@NotNull(message = "原始审核状态不能为空")
private AuditEnum originalCheckStatus;
@ApiModelProperty(value = "审核状态")
@NotNull(message = "审核状态不能为空")
private AuditEnum checkStatus;
/**
* 审核原因
*/
@ApiModelProperty(value = "审核原因")
private String checkResult;
@ApiModelProperty(value = "审核类型, 0-全部1-车辆2-备件")
private String type;
@Valid
@NotNull(message = "审核船名列表为空")
@Size(min = 1, message = "审核船名列表不能为空")
private List<BatchCheckShipVo> ships;
}

View File

@ -32,7 +32,6 @@ public class ExportInCargoVo implements Serializable {
* 车架号
*/
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "车架号不能为空")
@Size(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, min = 17, max = 17, message = "车架号长度为17位")
@ApiModelProperty(value = "车架号", required = true)
private String vin;

View File

@ -0,0 +1,30 @@
package com.haitonggauto.rtosc.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel(value = "进港计划查询",description = "")
public class ExportInQueryVo implements Serializable {
@ApiModelProperty(value = "船ID")
private String shipId;
/**
* 受理号
*/
@ApiModelProperty(value = "航次ID")
private String voyageId;
@ApiModelProperty(value = "车架号列表")
@NotNull(message = "请传入车架号列表")
@Size(min = 1, message = "车架号列表不能为空")
private List<String> billNums;
}

View File

@ -1,6 +1,5 @@
package com.haitonggauto.rtosc.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.haitonggauto.rtosc.common.utils.ValidationGroup;
import com.haitonggauto.rtosc.common.validate.DependsOn;
@ -182,6 +181,14 @@ public class ExportInVo implements Serializable {
@ApiModelProperty(value = "运输方式", required = true)
private String transportWay;
@ApiModelProperty(value = "预进港时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date preArrivalTime;
@ApiModelProperty(value = "预靠泊时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date planArrivePortTime;
@ApiModelProperty(value = "进场开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date beginEnterTime;

View File

@ -47,7 +47,6 @@ public class ExportInspectCargoVo implements Serializable {
*/
@ApiModelProperty(value = "车架号", required = true)
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "车架号/条码不能为空")
@Size(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, min = 17, max = 17, message = "车架号长度为17位")
private String vin;
/**

View File

@ -43,7 +43,7 @@ public class ExportInspectVo implements Serializable {
* 航次
*/
@ApiModelProperty(value = "航次", required = true)
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次不能为空")
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次不能为空")
private String voyage;
/**
@ -85,7 +85,7 @@ public class ExportInspectVo implements Serializable {
* 公司名
*/
@ApiModelProperty(value = "公司名", required = true)
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "公司名不能为空")
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "公司名不能为空")
private String company;
@ApiModelProperty(value = "申请对象ID")
@ -96,7 +96,7 @@ public class ExportInspectVo implements Serializable {
* 申请对象(从基础数据库获取客户类型为进口货代的数据)
*/
@ApiModelProperty(value = "申请对象", required = true)
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "请对象不能为空")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "请对象不能为空")
private String applyObj;
/**
@ -144,7 +144,7 @@ public class ExportInspectVo implements Serializable {
* 航次ID
*/
@ApiModelProperty(value = "航次ID")
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次ID不能为空")
// @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次ID不能为空")
private String voyageId;
@ApiModelProperty(value = "港区ID")

View File

@ -39,7 +39,6 @@ public class ExportLoadCargoVo implements Serializable {
* 车架号/条码
*/
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "车架号/条码不能为空")
@Size(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, min = 17, max = 17, message = "车架号长度为17位")
@ApiModelProperty(value = "车架号/条码", required = true)
private String vin;

View File

@ -48,6 +48,12 @@ public class ExportLoadCheckVo implements Serializable {
@NotNull(groups = {ValidationGroup.insert.class}, message = "审核状态不能为空")
private AuditEnum checkStatus;
@ApiModelProperty("提单号")
private List<String> billNos;
@ApiModelProperty(value = "是否为备件")
private Boolean spare;
/**
* 审核原因
*/

View File

@ -0,0 +1,25 @@
package com.haitonggauto.rtosc.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
@ApiModel("出口查验检验")
@Data
public class InspectValidVo implements Serializable {
@ApiModelProperty("船ID")
@NotBlank(message = "船ID不能为空")
private String shipId;
@ApiModelProperty("提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ApiModelProperty("车架号")
private List<String> vins;
}

View File

@ -0,0 +1,33 @@
package com.haitonggauto.rtosc.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* 出口进场货物表
* @TableName customer_export_in_cargo
*/
@Data
@ApiModel(value = "同步预靠泊时间",description = "")
public class UpdatePlanArrivePortVo implements Serializable {
@ApiModelProperty(value = "船ID")
@NotBlank(message = "船ID不能为空")
private String shipId;
@ApiModelProperty(value = "航次ID")
@NotBlank(message = "航次ID不能为空")
private String voyageId;
@ApiModelProperty(value = "预靠泊时间")
@NotNull(message = "预靠泊时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date planArrivePortTime;
}

View File

@ -0,0 +1,44 @@
package com.haitonggauto.rtosc.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 出口进场货物表
* @TableName customer_export_in_cargo
*/
@Data
@ApiModel(value = "同步预进港时间",description = "")
public class UpdatePreArrivalTimeVo implements Serializable {
@ApiModelProperty(value = "船ID")
@NotBlank(message = "船ID不能为空")
private String shipId;
@ApiModelProperty(value = "航次ID")
@NotBlank(message = "航次ID不能为空")
private String voyageId;
@ApiModelProperty(value = "原预进港时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date oldPreArrivalTime;
@ApiModelProperty(value = "预进港时间")
@NotNull(message = "预进港时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date preArrivalTime;
@ApiModelProperty(value = "新航次名称")
private String newVoyage;
}

View File

@ -19,10 +19,10 @@ public class UpdateVoyageVo implements Serializable {
/**
* 船名
*/
@Valid
// @Valid
@ApiModelProperty(value = "计划ID")
@Size(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, min = 1, message = "计划ID不能为空")
@NotNull(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "计划ID不能为空")
// @Size(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, min = 1, message = "计划ID不能为空")
// @NotNull(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "计划ID不能为空")
private List<Long> ids;
/**
@ -39,4 +39,9 @@ public class UpdateVoyageVo implements Serializable {
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "航次不能为空")
private String voyage;
@ApiModelProperty(value = "提单号列表")
private List<String> billNums;
@ApiModelProperty(value = "是否验证")
private Boolean valid;
}

View File

@ -0,0 +1,31 @@
package com.haitonggauto.rtosc.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel(value = "验证车架号是否激活",description = "")
public class ValidVinActivateVo implements Serializable {
@ApiModelProperty(value = "船ID")
private String shipId;
/**
* 受理号
*/
@ApiModelProperty(value = "航次ID")
private String voyageId;
@ApiModelProperty(value = "车架号列表")
@NotNull(message = "请传入车架号列表")
@Size(min = 1, message = "车架号列表不能为空")
private List<String> vins;
}

View File

@ -0,0 +1,59 @@
package com.haitonggauto.rtosc.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
@Data
@ApiModel("提离港区导入")
public class DepartureImportExcel {
@ApiModelProperty("提单号")
@ExcelProperty(value = "提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ApiModelProperty("车架号/备件号")
@ExcelProperty(value = "车架号/备件号")
@NotBlank(message = "车架号/备件号不能为空")
private String vin;
@ApiModelProperty("车型")
@ExcelProperty(value = "车型")
private String cartType;
@ApiModelProperty(value = "型号")
@ExcelProperty(value = "型号")
private String models;
@ApiModelProperty(value = "长(米)")
@ExcelProperty(value = "长(米)")
private BigDecimal length;
@ApiModelProperty(value = "宽(米)")
@ExcelProperty(value = "宽(米)")
private BigDecimal width;
@ApiModelProperty(value = "高(米)")
@ExcelProperty(value = "高(米)")
private BigDecimal height;
@ApiModelProperty(value = "重量kg")
@ExcelProperty(value = "重量kg")
private BigDecimal weight;
@ApiModelProperty(value = "是否报关")
@ExcelProperty(value = "是否报关")
private String isCustoms;
@ApiModelProperty(value = "是否退关提离")
@ExcelProperty(value = "是否退关提离")
private String isShutout;
@ApiModelProperty(value = "是否随车备件")
@ExcelProperty(value = "是否随车备件")
private String isSpare;
}

View File

@ -9,23 +9,23 @@ import javax.validation.constraints.Size;
@Data
public class ExportInBillSpareExcel {
@ExcelProperty("*船名")
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
@ExcelProperty("*航次")
@ExcelProperty(value = "*航次")
@NotBlank(message = "航次不能为空")
private String voyage;
@ExcelProperty("*提单号")
@ExcelProperty(value = "*提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ExcelProperty("*品牌")
@ExcelProperty(value = "*品牌")
@NotBlank(message = "品牌不能为空")
private String brand;
@ExcelProperty("*备件号")
@ExcelProperty(value = "*备件号")
@NotBlank(message = "备件号不能为空")
@Size(min = 17, max = 17, message = "备件号长度为17位")
private String vin;

View File

@ -12,31 +12,31 @@ import java.math.BigDecimal;
@Data
public class ExportInCargoExportExcel {
@ExcelProperty("船名")
@ExcelProperty(value = "船名")
private String shipName;
@ExcelProperty("航次")
@ExcelProperty(value = "航次")
private String voyage;
@ExcelProperty("提单号")
@ExcelProperty(value = "提单号")
private String billNum;
@ExcelProperty("品牌")
@ExcelProperty(value = "品牌")
private String brand;
@ExcelProperty("型号")
@ExcelProperty(value = "型号")
private String models;
@ExcelProperty("车架号")
@ExcelProperty(value = "车架号")
private String vin;
@ExcelProperty("实际进港时间")
@ExcelProperty(value = "实际进港时间")
private String enterPortTime;
@ExcelProperty("场地")
@ExcelProperty(value = "场地")
private String position;
@ExcelProperty("港口")
@ExcelProperty(value = "港口")
private String portName;
}

View File

@ -9,28 +9,27 @@ import javax.validation.constraints.Size;
@Data
public class ExportInExcel {
@ExcelProperty("*船名")
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
@ExcelProperty("*航次")
@ExcelProperty(value = "*航次")
@NotBlank(message = "航次不能为空")
private String voyage;
@ExcelProperty("*提单号")
@ExcelProperty(value = "*提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ExcelProperty("*品牌")
@ExcelProperty(value = "*品牌")
@NotBlank(message = "品牌不能为空")
private String brand;
@ExcelProperty("*型号")
@ExcelProperty(value = "*型号")
@NotBlank(message = "型号不能为空")
private String models;
@ExcelProperty("*车架号")
@ExcelProperty(value = "*车架号")
@NotBlank(message = "车架号不能为空")
@Size(min = 17, max = 17, message = "车架号长度为17位")
private String vin;
}

View File

@ -43,39 +43,39 @@ public class ExportInPlanExcel {
/**
* 港区
*/
@ExcelProperty("*港区")
@ExcelProperty(value = "*港区")
@NotBlank(message = "港区不能为空")
private String portArea;
/**
* 船名
*/
@ExcelProperty("*船名")
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
/**
* 航次
*/
@ExcelProperty("*航次")
@ExcelProperty(value = "*航次")
@NotBlank(message = "航次不能为空")
private String voyage;
@ExcelProperty("*货物性质")
@ExcelProperty(value = "*货物性质")
@NotBlank(message = "货物性质不能为空")
private String natureFlagName;
@ExcelProperty("中转进口船名")
@ExcelProperty(value = "中转进口船名")
private String transferShipName;
@ExcelProperty("中转进口航次")
@ExcelProperty(value = "中转进口航次")
private String transferVoyage;
/**
* 货代
*/
@ExcelProperty("*货代")
@ExcelProperty(value = "*货代")
@NotBlank(message = "货代不能为空")
private String freight;
@ -83,43 +83,43 @@ public class ExportInPlanExcel {
/**
* 联系人
*/
@ExcelProperty("*联系人")
@ExcelProperty(value = "*联系人")
@NotBlank(message = "联系人不能为空")
private String contact;
/**
* 联系方式
*/
@ExcelProperty("*联系方式")
@ExcelProperty(value = "*联系方式")
@NotBlank(message = "联系方式不能为空")
private String contactPhone;
/**
* 港口
*/
@ExcelProperty("*国家")
@ExcelProperty(value = "*国家")
@NotBlank(message = "国家不能为空")
private String country;
/**
* 港口
*/
@ExcelProperty("*港口")
@ExcelProperty(value = "*港口")
@NotBlank(message = "港口不能为空")
private String portName;
/**
* 运输方式
*/
@ExcelProperty("*运输方式")
@ExcelProperty(value = "*运输方式")
@NotBlank(message = "运输方式不能为空")
private String transportWay;
@ExcelProperty("*进场开始日期")
@ExcelProperty(value = "*进场开始日期")
@NotBlank(message = "进场开始日期不能为空")
private String beginEnterTime;
@ExcelProperty("*进场结束日期")
@ExcelProperty(value = "*进场结束日期")
@NotBlank(message = "进场结束日期不能为空")
private String endEnterTime;
@ -127,26 +127,26 @@ public class ExportInPlanExcel {
* 进场时间
*/
// @DateTimeFormat("yyyy-MM-dd HH:mm")
@ExcelProperty("进场时间")
@ExcelProperty(value = "进场时间")
private String enterTime;
/**
* 进场数量
*/
@ExcelProperty("进场数量")
@ExcelProperty(value = "进场数量")
private Integer enterQuantity;
/**
* 提单号
*/
@ExcelProperty("*提单号")
@ExcelProperty(value = "*提单号")
@NotBlank(message = "提单号不能为空")
private String billNum;
/**
* 单票数量
*/
@ExcelProperty("*单票件数")
@ExcelProperty(value = "*单票件数")
@NotNull(message = "单票件数不能为空")
private Integer eachQuantity;
@ -160,7 +160,7 @@ public class ExportInPlanExcel {
/**
* 单票体积
*/
@ExcelProperty("*单票体积")
@ExcelProperty(value = "*单票体积")
@NotNull(message = "单票体积不能为空")
@NumberFormat("#.####")
private BigDecimal eachVolume;
@ -168,7 +168,7 @@ public class ExportInPlanExcel {
/**
* 单票重量
*/
@ExcelProperty("*单票重量(千克)")
@ExcelProperty(value = "*单票重量(千克)")
@NotNull(message = "单票重量不能为空")
@NumberFormat("#.####")
private BigDecimal eachWeight;
@ -176,49 +176,49 @@ public class ExportInPlanExcel {
/**
* 品牌
*/
@ExcelProperty("*品牌")
@ExcelProperty(value = "*品牌")
@NotBlank(message = "品牌不能为空")
private String brand;
/**
* 车型
*/
@ExcelProperty("*车型")
@ExcelProperty(value = "*车型")
@NotBlank(message = "车型不能为空")
private String cartType;
/**
* 车型明细
*/
@ExcelProperty("*车型明细")
@ExcelProperty(value = "*车型明细")
@NotBlank(message = "车型明细不能为空")
private String cartTypeDetail;
/**
* 型号
*/
@ExcelProperty("*型号")
@ExcelProperty(value = "*型号")
@NotBlank(message = "型号不能为空")
private String models;
/**
* 产地
*/
@ExcelProperty("*产地")
@ExcelProperty(value = "*产地")
@NotBlank(message = "产地不能为空")
private String originPlace;
/**
* 数量
*/
@ExcelProperty("*数量")
@ExcelProperty(value = "*数量")
@NotNull(message = "数量不能为空")
private Integer quantity;
/**
*
*/
@ExcelProperty("*长")
@ExcelProperty(value = "*长")
@NotNull(message = "长不能为空")
@NumberFormat("#.####")
private BigDecimal length;
@ -226,7 +226,7 @@ public class ExportInPlanExcel {
/**
*
*/
@ExcelProperty("*宽")
@ExcelProperty(value = "*宽")
@NotNull(message = "宽不能为空")
@NumberFormat("#.####")
private BigDecimal width;
@ -234,7 +234,7 @@ public class ExportInPlanExcel {
/**
*
*/
@ExcelProperty("*高")
@ExcelProperty(value = "*高")
@NotNull(message = "高不能为空")
@NumberFormat("#.####")
private BigDecimal height;
@ -242,34 +242,37 @@ public class ExportInPlanExcel {
/**
* 重量()
*/
@ExcelProperty("*重量(吨)")
@ExcelProperty(value = "*重量(吨)")
@NotNull(message = "重量不能为空")
@NumberFormat("#.####")
private BigDecimal weight;
@ExcelProperty("*体积")
@ExcelProperty(value = "*体积")
@ApiModelProperty(value = "体积")
private BigDecimal volume;
/**
* 操作模式
*/
@ExcelProperty("*操作模式")
@ExcelProperty(value = "*操作模式")
@NotBlank(message = "操作模式不能为空")
private String operateType;
@NotBlank(message = "特殊作业不能为空")
@ExcelProperty("*特殊作业")
@ExcelProperty(value = "*特殊作业")
private String specWork;
/**
* 源类型
*/
@ExcelProperty("*能源类型")
@ExcelProperty(value = "*能源类型")
// @NotBlank(message = "*能源类型不能为空")
private String energyTypeName;
@ExcelProperty("*是否二手车")
@ExcelProperty(value = "*是否二手车")
// @NotBlank(message = "是否是二手车不能为空")
private String secondHand;
@ExcelProperty(value = "备注")
private String remark;
}

View File

@ -22,7 +22,7 @@ public class ExportInSpareExcel {
@NotBlank(message = "备件号不能为空")
@Size(min = 17, max = 17, message = "备件号长度为17位")
@ApiModelProperty(value = "备件号")
@ExcelProperty("*备件号")
@ExcelProperty(value = "*备件号")
private String vin;
}

View File

@ -9,28 +9,27 @@ import javax.validation.constraints.Size;
@Data
public class ExportLoadExcel {
@ExcelProperty("*船名")
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
@ExcelProperty("*航次")
@ExcelProperty(value = "*航次")
@NotBlank(message = "航次不能为空")
private String voyage;
@ExcelProperty("*提单号")
@ExcelProperty(value = "*提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ExcelProperty("*车架号")
@ExcelProperty(value = "*车架号")
@NotBlank(message = "车架号不能为空")
@Size(min = 17, max = 17, message = "车架号长度为17位")
private String vin;
@ExcelProperty(value = "*目的港")
@NotBlank(message = "目的港不能为空")
private String destPort;
@ExcelProperty("*品牌")
@ExcelProperty(value = "*品牌")
@NotBlank(message = "品牌不能为空")
private String brand;

View File

@ -0,0 +1,60 @@
package com.haitonggauto.rtosc.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel("出口装船导出")
@Data
public class ExportLoadExportExcel implements Serializable {
@ApiModelProperty(value = "中文船名")
@ExcelProperty("船名")
private String shipName;
@ApiModelProperty(value = "航次")
@ExcelProperty("船名")
private String voyage;
@ApiModelProperty(value = "货物性质名称")
@ExcelProperty("货物性质")
private String natureFlagName;
@ApiModelProperty(value = "中转进口船名")
@ExcelProperty("中转进口船名")
private String transferShipName;
@ApiModelProperty(value = "中转进口航次")
@ExcelProperty("中转进口航次")
private String transferVoyage;
@ApiModelProperty(value = "提单号")
@ExcelProperty("提单号")
private String billNo;
@ApiModelProperty(value = "品牌")
@ExcelProperty("品牌")
private String brand;
@ApiModelProperty(value = "目的港")
@ExcelProperty("目的港")
private String destPort;
@ApiModelProperty(value = "车架号")
@ExcelProperty("车架号")
private String vin;
@ApiModelProperty(value = "结算单位")
@ExcelProperty("结算单位")
private String settleCompName;
@ApiModelProperty(value = "联系人")
@ExcelProperty("联系人")
private String contact;
@ApiModelProperty(value = "联系方式")
@ExcelProperty("联系方式")
private String contactPhone;
}

View File

@ -12,56 +12,55 @@ import javax.validation.constraints.Size;
@DependsOn(field1 = "natureFlagName", fields = {"transferShipName", "transferVoyage"}, message = "货物性质为“正常”时,中转船名,中转航次为空, 否则必填")
public class ExportLoadInsideExcel {
@ExcelProperty("*船名")
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
@ExcelProperty("*航次")
@ExcelProperty(value = "*航次")
@NotBlank(message = "航次不能为空")
private String voyage;
@ExcelProperty("*货物性质")
@ExcelProperty(value = "*货物性质")
@NotBlank(message = "货物性质不能为空")
private String natureFlagName;
@ExcelProperty("中转进口船名")
@ExcelProperty(value = "中转进口船名")
private String transferShipName;
@ExcelProperty("中转进口航次")
@ExcelProperty(value = "中转进口航次")
private String transferVoyage;
@ExcelProperty("*港区")
@NotBlank(message = "港区不能为空")
private String portArea;
// @ExcelProperty("*港区")
// @NotBlank(message = "港区不能为空")
// private String portArea;
@ExcelProperty("*提单号")
@ExcelProperty(value = "*提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ExcelProperty("*品牌")
@ExcelProperty(value = "*品牌")
@NotBlank(message = "品牌不能为空")
private String brand;
@ExcelProperty("*目的港")
@ExcelProperty(value = "*目的港")
@NotBlank(message = "目的港不能为空")
private String destPort;
@ExcelProperty("*车架号")
@ExcelProperty(value = "*车架号")
@NotBlank(message = "车架号不能为空")
@Size(min = 17, max = 17, message = "车架号长度为17位")
private String vin;
@ExcelProperty("*结算单位")
@ExcelProperty(value = "*结算单位")
@ApiModelProperty(value = "结算单位")
@NotBlank(message = "结算单位不能为空")
private String settleCompName;
@ExcelProperty("*联系人")
@ExcelProperty(value = "*联系人")
@ApiModelProperty(value = "联系人")
@NotBlank(message = "联系人不能为空")
private String contact;
@ExcelProperty("*联系方式")
@ExcelProperty(value = "*联系方式")
@ApiModelProperty(value = "联系方式")
@NotBlank(message = "联系方式不能为空")
private String contactPhone;

View File

@ -10,15 +10,15 @@ import javax.validation.constraints.Size;
@Data
public class ExportLoadSpareExcel {
@ExcelProperty("*船名")
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
@ExcelProperty("*航次")
@ExcelProperty(value = "*航次")
@NotBlank(message = "航次不能为空")
private String voyage;
@ExcelProperty("*提单号")
@ExcelProperty(value = "*提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ -26,11 +26,11 @@ public class ExportLoadSpareExcel {
@NotBlank(message = "目的港不能为空")
private String destPort;
@ExcelProperty("*品牌")
@ExcelProperty(value = "*品牌")
@NotBlank(message = "品牌不能为空")
private String brand;
@ExcelProperty("*数量")
@ExcelProperty(value = "*数量")
@NotNull(message = "数量不能为空")
private Integer num;

View File

@ -22,16 +22,15 @@ public class ExportVinExcel {
*/
@ApiModelProperty(value = "提单号")
@NotBlank(message = "提单号不能为空")
@ExcelProperty("*提单号")
@ExcelProperty(value = "*提单号")
private String billNo;
/**
* 船名
*/
@NotBlank(message = "车架号不能为空")
@Size(min = 17, max = 17, message = "车架号长度为17位")
@ApiModelProperty(value = "车架号")
@ExcelProperty("*车架号")
@ExcelProperty(value = "*车架号")
private String vin;
}

View File

@ -18,104 +18,125 @@ public class FreeTradeExcel {
* 港区
*/
@NotBlank(message = "港区不能为空")
@ExcelProperty("*港区")
@ExcelProperty(value = "*港区")
@ApiModelProperty(value = "港区")
private String portArea;
/**
* 船名
*/
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
/**
* 航次
*/
@ExcelProperty(value = "*航次")
@NotBlank(message = "航次不能为空")
private String voyage;
// 批次号
@ApiModelProperty(value = "批次号")
@NotBlank(message = "批次号不能为空")
@ExcelProperty("批次号")
@ExcelProperty(value = "批次号")
private String batchNo;
// 企业编码
@ApiModelProperty(value = "企业编码")
@NotBlank(message = "企业编码不能为空")
@ExcelProperty("*企业编码")
@ExcelProperty(value = "*企业编码")
private String companyCode;
// 企业社会信用代码
@ApiModelProperty(value = "企业社会信用代码")
@NotBlank(message = "企业社会信用代码不能为空")
@ExcelProperty("*企业社会信用代码")
@ExcelProperty(value = "*企业社会信用代码")
private String companySocialCode;
// 企业名称
@ApiModelProperty(value = "企业名称")
@NotBlank(message = "企业名称不能为空")
@ExcelProperty("*企业名称")
@ExcelProperty(value = "*企业名称")
private String companyName;
// 企业所在国家
@ApiModelProperty(value = "企业所在国家")
@NotBlank(message = "企业所在国家不能为空")
@ExcelProperty("*企业所在国家")
@ExcelProperty(value = "*企业所在国家")
private String country;
// 企业所在城市
@ApiModelProperty(value = "企业所在城市")
@NotBlank(message = "企业所在城市不能为空")
@ExcelProperty("*企业所在城市")
@ExcelProperty(value = "*企业所在城市")
private String city;
// 商品料号
/**
* 商品料号
*/
@ApiModelProperty(value = "商品料号")
@NotBlank(message = "商品料号不能为空")
@ExcelProperty("*商品料号")
@ExcelProperty(value = "*商品料号")
private String cargoItemNo;
// 商品料号
@ApiModelProperty(value = "商品编码")
@NotBlank(message = "商品编码不能为空")
@ExcelProperty(value = "*商品编码")
private String cargoCode;
// 商品名称
@ApiModelProperty(value = "商品名称")
@NotBlank(message = "商品名称不能为空")
@ExcelProperty("*商品名称")
@ExcelProperty(value = "*商品名称")
private String cargoName;
// 规格型号
@ApiModelProperty(value = "规格型号")
@NotBlank(message = "规格型号不能为空")
@ExcelProperty("*规格型号")
@ExcelProperty(value = "*规格型号")
private String spec;
// 币制
@ApiModelProperty(value = "币制")
@NotBlank(message = "币制不能为空")
@ExcelProperty("*币制")
@ExcelProperty(value = "*币制")
private String currency;
// 总价
@ApiModelProperty(value = "总价")
@NotNull(message = "总价不能为空")
@ExcelProperty("*总价")
@ExcelProperty(value = "*总价")
private BigDecimal totalPrice;
// 净重
@ApiModelProperty(value = "净重")
@NotNull(message = "净重不能为空")
@ExcelProperty("*净重")
@ExcelProperty(value = "*净重")
private BigDecimal netWeight;
// 申报计量单位
@ApiModelProperty(value = "申报计量单位")
@NotBlank(message = "申报计量单位不能为空")
@ExcelProperty("*申报计量单位")
@ExcelProperty(value = "*申报计量单位")
private String unitMeasure;
// 法定单位
@ApiModelProperty(value = "法定单位")
@NotBlank(message = "法定单位不能为空")
@ExcelProperty("*法定单位")
@ExcelProperty(value = "*法定单位")
private String unitLegal;
// 原产国地区
@ApiModelProperty(value = "原产国")
@NotBlank(message = "原产国不能为空")
@ExcelProperty("*原产国(地区)")
@ExcelProperty(value = "*原产国(地区)")
private String originArea;
// 车架号
@ApiModelProperty(value = "车架号")
@NotBlank(message = "车架号不能为空")
@Size(min = 17, max = 17, message = "车架号长度为17位")
@ExcelProperty("*车架号")
@ExcelProperty(value = "*车架号")
private String vin;
}

View File

@ -31,6 +31,5 @@ public class ImportUnloadExcel {
@ExcelProperty("*车架号")
@NotBlank(message = "车架号不能为空")
@Size(min = 17, max = 17, message = "车架号长度为17位")
private String vin;
}

View File

@ -0,0 +1,58 @@
package com.haitonggauto.rtosc.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
@ApiModel("查验导入")
public class InspectExcel {
/**
* 港区
*/
@ExcelProperty(value = "*港区")
@NotBlank(message = "港区不能为空")
private String portArea;
/**
* 船名
*/
@ExcelProperty(value = "*船名")
@NotBlank(message = "船名不能为空")
private String shipName;
@ApiModelProperty(value = "航次")
@ExcelProperty(index = 2)
private String voyage;
@ExcelProperty(value = "*提单号")
@NotBlank(message = "提单号不能为空")
private String billNo;
@ApiModelProperty(value = "报关单号")
private String passport;
@ApiModelProperty(value = "*查验日期")
@NotNull(message = "查验日期不能为空")
private Date inspectTime;
@ApiModelProperty(value = "公司名")
private String company;
@ApiModelProperty(value = "*联系人")
@NotBlank(message = "联系人不能为空")
private String contact;
@ApiModelProperty(value = "*联系电话")
@NotBlank(message = "联系电话不能为空")
private String contactPhone;
@ApiModelProperty(value = "*车架号/备件号")
@NotBlank(message = "车架号/备件号不能为空")
private String vin;
}

View File

@ -19,4 +19,11 @@ public class CargoQuery extends BaseQuery {
@ApiModelProperty(value = "品牌ID")
private String brandId;
@ApiModelProperty(value = "提单号")
@DbQuery(field = "select id from customer_export_load where export_load_id=customer_export_load.id and bill_no like {0}", symbol = SqlSymbol.EXISTS)
private String billNum;
@ApiModelProperty(value = "是否填充车辆状态")
private Boolean vinStatus;
}

View File

@ -0,0 +1,16 @@
package com.haitonggauto.rtosc.query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "货物明细查询")
public class CargoVinQuery {
@ApiModelProperty(value = "车架号")
private String vin;
@ApiModelProperty("提单号")
private String billNum;
}

View File

@ -74,6 +74,22 @@ public class DepartureQuery extends BaseQuery {
@ApiModelProperty(value = "港区ID")
private String portAreaId;
@ApiModelProperty(value = "提单号")
@DbQuery(field = "select id from customer_departure_cargo where departure_id=customer_departure.id and bill_no like {0}", symbol = SqlSymbol.EXISTS)
private String billNum;
@ApiModelProperty(value = "精确提单号")
@DbQuery(field = "select id from customer_departure_cargo where departure_id=customer_departure.id and bill_no={0}", symbol = SqlSymbol.EXISTS)
private String billNumAccurate;
@ApiModelProperty(value = "品牌ID")
// @DbQuery(field = "select id from customer_departure_cargo where departure_id=customer_departure.id and brand_id={0}", symbol = SqlSymbol.EXISTS)
private String brandId;
@ApiModelProperty(value = "车架号")
@DbQuery(field = "select id from customer_departure_cargo where departure_id=customer_departure.id and vin like {0}", symbol = SqlSymbol.EXISTS)
private String vin;
@ApiModelProperty(value = "港区ID集合")
@DbQuery(field = "portAreaId", symbol = SqlSymbol.IN)
private List<String> pamIds;

View File

@ -0,0 +1,28 @@
package com.haitonggauto.rtosc.query;
import com.haitonggauto.rtosc.common.db.query.BaseQuery;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "出口进港查询")
public class ExportInBathCheckQuery extends BaseQuery {
@ApiModelProperty(value = "船ID")
private String shipId;
@ApiModelProperty(value = "航次ID")
private String voyageId;
@ApiModelProperty(value = "港区ID")
private String portAreaId;
@ApiModelProperty(value = "审核状态")
@NotNull(message = "审核状态不能为空")
private AuditEnum checkStatus;
}

View File

@ -56,12 +56,12 @@ public class ExportInCheckQuery extends BaseQuery {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "开始进场时间")
@DbQuery(field = "beginEnterTime", symbol = SqlSymbol.GTE)
@DbQuery(field = "beginEnterTime", symbol = SqlSymbol.LTE)
private Date beginEnterTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束进场时间")
@DbQuery(field = "endEnterTime", symbol = SqlSymbol.LTE)
@DbQuery(field = "endEnterTime", symbol = SqlSymbol.GTE)
private Date endEnterTime;
@ApiModelProperty(value = "贸易类型")
@ -90,6 +90,10 @@ public class ExportInCheckQuery extends BaseQuery {
@DbQuery(symbol = SqlSymbol.LIKE)
private String billNum;
@ApiModelProperty(value = "精确提单号")
@DbQuery(field = "billNum")
private String billNumAccurate;
@ApiModelProperty(value = "受理号")
@DbQuery(symbol = SqlSymbol.LIKE)
private String batchNo;
@ -101,6 +105,7 @@ public class ExportInCheckQuery extends BaseQuery {
private String freightId;
@ApiModelProperty(value = "车架号")
@DbQuery(field = "select id from customer_export_in_cargo where export_in_id=customer_export_in.id and vin like {0}", symbol = SqlSymbol.EXISTS)
private String vin;
@ApiModelProperty(value = "国家Id")
@ -109,12 +114,18 @@ public class ExportInCheckQuery extends BaseQuery {
@ApiModelProperty(value = "港口ID")
private String portId;
@ApiModelProperty(hidden = true)
@DbQuery(field = "vin", symbol = SqlSymbol.IN)
private List<String> vins;
@ApiModelProperty(value = "联系人")
@DbQuery(symbol = SqlSymbol.LIKE)
private String contact;
// 明细表查询时会用到
@ApiModelProperty(hidden = true)
private Long exportInId;
@ApiModelProperty(value = "是否加载车架号列表")
private Boolean vinStatus;
@ApiModelProperty(value = "是否调用车架号状态接口")
private Boolean vinStatusApi;
}

View File

@ -66,6 +66,10 @@ public class ExportInQuery extends BaseQuery {
@DbQuery(symbol = SqlSymbol.LIKE)
private String billNum;
@ApiModelProperty(value = "精确提单号")
@DbQuery(field = "billNum")
private String billNumAccurate;
@ApiModelProperty(value = "受理号")
@DbQuery(symbol = SqlSymbol.LIKE)
private String batchNo;
@ -82,9 +86,13 @@ public class ExportInQuery extends BaseQuery {
@ApiModelProperty(value = "货代ID")
private String freightId;
@ApiModelProperty(hidden = true)
@DbQuery(field = "vin", symbol = SqlSymbol.IN)
private List<String> vins;
@ApiModelProperty(value = "联系人")
@DbQuery(symbol = SqlSymbol.LIKE)
private String contact;
@ApiModelProperty(value = "车架号")
@DbQuery(field = "select id from customer_export_in_cargo where export_in_id=customer_export_in.id and vin like {0}", symbol = SqlSymbol.EXISTS)
private String vin;
// 明细表查询时会用到
@ApiModelProperty(hidden = true)

View File

@ -1,5 +1,6 @@
package com.haitonggauto.rtosc.query;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.haitonggauto.rtosc.common.db.anno.DbQuery;
import com.haitonggauto.rtosc.common.db.enums.SqlSymbol;
import com.haitonggauto.rtosc.common.db.query.BaseQuery;
@ -7,7 +8,9 @@ import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
@ -24,6 +27,9 @@ public class ExportInspectCheckQuery extends BaseQuery {
@ApiModelProperty(value = "航次ID")
private String voyageId;
@ApiModelProperty(value = "申请对象ID")
private String applyObjId;
@ApiModelProperty(value = "航次")
private String voyage;
@ -45,6 +51,38 @@ public class ExportInspectCheckQuery extends BaseQuery {
@DbQuery(symbol = SqlSymbol.LIKE)
private String batchNo;
@ApiModelProperty(value = "报关单号")
@DbQuery(symbol = SqlSymbol.LIKE)
private String passport;
@ApiModelProperty(value = "提单号")
@DbQuery(field = "billNo", symbol = SqlSymbol.LIKE)
private String billNum;
@ApiModelProperty(value = "精确提单号")
@DbQuery(field = "billNo")
private String billNumAccurate;
@ApiModelProperty(value = "品牌ID")
@DbQuery(field = "select id from customer_export_inspect_cargo where export_inspect_id=customer_export_inspect.id and brand_id={0}", symbol = SqlSymbol.EXISTS)
private String brandId;
@ApiModelProperty(value = "车架号")
@DbQuery(field = "select id from customer_export_inspect_cargo where export_inspect_id=customer_export_inspect.id and vin like {0}", symbol = SqlSymbol.EXISTS)
private String vin;
@ApiModelProperty(value = "开始查验日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@DbQuery(field = "inspectTime", symbol = SqlSymbol.GTE)
private Date beginInspectTime;
@ApiModelProperty(value = "结束查验日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@DbQuery(field = "inspectTime", symbol = SqlSymbol.LTE)
private Date endInspectTime;
@ApiModelProperty(hidden = true)
private String tradType;

View File

@ -1,5 +1,6 @@
package com.haitonggauto.rtosc.query;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.haitonggauto.rtosc.common.db.anno.DbQuery;
import com.haitonggauto.rtosc.common.db.enums.SqlSymbol;
import com.haitonggauto.rtosc.common.db.query.BaseQuery;
@ -8,6 +9,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
@ -20,6 +22,9 @@ public class ExportInspectQuery extends BaseQuery {
@ApiModelProperty(value = "航次ID")
private String voyageId;
@ApiModelProperty(value = "申请对象ID")
private String applyObjId;
@ApiModelProperty(value = "船名")
@DbQuery(symbol = SqlSymbol.LIKE)
private String shipName;
@ -42,6 +47,36 @@ public class ExportInspectQuery extends BaseQuery {
@DbQuery(symbol = SqlSymbol.LIKE)
private String batchNo;
@ApiModelProperty(value = "报关单号")
@DbQuery(symbol = SqlSymbol.LIKE)
private String passport;
@ApiModelProperty(value = "提单号")
@DbQuery(field = "billNo", symbol = SqlSymbol.LIKE)
private String billNum;
@ApiModelProperty(value = "精确提单号")
@DbQuery(field = "billNo")
private String billNumAccurate;
@ApiModelProperty(value = "品牌ID")
@DbQuery(field = "select id from customer_export_inspect_cargo where export_inspect_id=customer_export_inspect.id and brand_id={0}", symbol = SqlSymbol.EXISTS)
private String brandId;
@ApiModelProperty(value = "车架号")
@DbQuery(field = "select id from customer_export_inspect_cargo where export_inspect_id=customer_export_inspect.id and vin like {0}", symbol = SqlSymbol.EXISTS)
private String vin;
@ApiModelProperty(value = "开始查验日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@DbQuery(field = "inspectTime", symbol = SqlSymbol.GTE)
private Date beginInspectTime;
@ApiModelProperty(value = "结束查验日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@DbQuery(field = "inspectTime", symbol = SqlSymbol.LTE)
private Date endInspectTime;
@ApiModelProperty(hidden = true)
private String tradType;

View File

@ -54,6 +54,13 @@ public class ExportLoadCheckQuery extends BaseQuery {
@ApiModelProperty(hidden = true)
private Long exportLoadId;
@DbQuery(field = "billNo", symbol = SqlSymbol.IN)
private List<String> billNos;
@ApiModelProperty(value = "车架号")
@DbQuery(field = "select id from customer_export_load_cargo where export_load_id=customer_export_load.id and vin like {0}", symbol = SqlSymbol.EXISTS)
private String vin;
@ApiModelProperty(hidden = true)
@DbQuery(field = "vin", symbol = SqlSymbol.IN)
private List<String> vins;

View File

@ -51,6 +51,10 @@ public class ExportLoadQuery extends BaseQuery {
@ApiModelProperty(hidden = true)
private Long exportLoadId;
@ApiModelProperty(value = "车架号")
@DbQuery(field = "select id from customer_export_load_cargo where export_load_id=customer_export_load.id and vin like {0}", symbol = SqlSymbol.EXISTS)
private String vin;
@ApiModelProperty(hidden = true)
@DbQuery(field = "vin", symbol = SqlSymbol.IN)
private List<String> vins;

View File

@ -11,6 +11,9 @@ public class LoginUser implements Serializable {
// 用户ID
private String userId;
// 用户名
private String username;
// 角色ID
private Long roleId;
@ -57,4 +60,12 @@ public class LoginUser implements Serializable {
public void setPermList(Set<String> permList) {
this.permList = permList;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}

View File

@ -189,12 +189,18 @@ public interface WrapperKit {
return;
}
if (!fieldMetadataMap.containsKey(fName)) {
if (symbol != SqlSymbol.EXISTS && symbol != SqlSymbol.NOT_EXISTS && symbol != SqlSymbol.EXPRESSION && !fieldMetadataMap.containsKey(fName)) {
throw new FieldNotExistsException(String.format("类:%s, 不存在属性: %s" , classMetadata.getClazz().getName(), fName));
}
String column = fieldMetadataMap.get(fName).getColumn();
if (StringUtils.isNotEmpty(alias)) {
column = alias + "." + column;
String column = null;
if (symbol == SqlSymbol.EXISTS || symbol == SqlSymbol.NOT_EXISTS || symbol == SqlSymbol.EXPRESSION) {
column = fName;
} else {
column = fieldMetadataMap.get(fName).getColumn();
if (StringUtils.isNotEmpty(alias)) {
column = alias + "." + column;
}
}
if (symbol == SqlSymbol.IN) {
@ -212,9 +218,9 @@ public interface WrapperKit {
} else if (symbol.equals(SqlSymbol.RLIKE)) {
queryWrapper.likeRight(column, fValue);
} else if (symbol.equals(SqlSymbol.EXISTS)) {
queryWrapper.exists(column, fValue);
queryWrapper.exists(column, StringUtils.containsIgnoreCase(column, " like ") ? "%" + fValue + "%" : fValue);
} else if (symbol.equals(SqlSymbol.NOT_EXISTS)) {
queryWrapper.notExists(column, fValue);
queryWrapper.notExists(column, StringUtils.containsIgnoreCase(column, " like ") ? "%" + fValue + "%" : fValue);
} else if (symbol.equals(SqlSymbol.GTE)) {
queryWrapper.ge(column, fValue);
} else if (symbol.equals(SqlSymbol.GT)) {

View File

@ -39,7 +39,7 @@ public class DependsOnValidator implements ConstraintValidator<DependsOn, Object
}
if (value1 != null) {
if (StringUtils.equals("正常", (String)value1)) {
if (!StringUtils.equalsAny((String)value1,"内进转外出", "外进转内出", "国际中转", "国内中转")) {
for (String field : fields) {
String v = (String) wrapper.getPropertyValue(field);
if (StringUtils.isNotEmpty(v)) {

View File

@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.haitonggauto.rtosc.api.dto.*;
import com.haitonggauto.rtosc.client.dto.UserAuthRequestDto;
import com.haitonggauto.rtosc.dto.LoginDTO;
import com.haitonggauto.rtosc.dto.UpdateVoyageVo;
import org.springframework.cloud.openfeign.FeignClient;
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.RequestParam;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -117,6 +119,9 @@ public interface NuzarOpenApi {
@GetMapping("/customer/shipment/shipLoad/getShipPlan")
List<Long> haveShipPlan(@RequestParam("vvyId") String vvyId);
@PostMapping("/customer/shipment/shipLoad/getShipPlans")
Map<String, List<Long>> haveShipPlans(@RequestBody CheckShipPlanReq req);
// 装船审核获取国际中转备件
@PostMapping("/customer/shipment/shipLoad/transitPart")
Map<String, List<TransitPartResp>> getTransitPart(@RequestBody TransitPartRequest request);
@ -140,4 +145,23 @@ public interface NuzarOpenApi {
// 获取绑定货代
@GetMapping("/rtos/user/getFreightId")
List<FreightVo> getUserBindFreight();
@PostMapping("/customer/shipment/queryTrendShips")
List<TrendShipResp> getTrendShipList(@RequestBody List<String> shipNames);
@PostMapping("/customer/yard/batchConfirmRevise")
Boolean batchConfirmRevise(UpdateVoyageVo req);
@PostMapping("/customer/yard/getCarPickTime")
Map<String, Date> getCarPickTime(@RequestBody List<String> vinCodes);
@GetMapping("/rtos/user/searchUser")
UserInfoDto getUserInfo();
// 提离港区车架号验证
@PostMapping("/customer/pickDeparture/vinCheckInfo")
List<VinCheckResp> vinCheckInfo(@RequestBody VinCheckReq req);
@PostMapping("/customer/yard/batchConfirmReview")
Boolean batchConfirmReview(@RequestBody BatchConfirmReviewReq req);
}

View File

@ -1,9 +1,6 @@
package com.haitonggauto.rtosc.api;
import com.haitonggauto.rtosc.api.dto.CheckVinReq;
import com.haitonggauto.rtosc.api.dto.VoyageDTO;
import com.haitonggauto.rtosc.api.dto.VoyageReq;
import com.haitonggauto.rtosc.api.dto.VoyageResp;
import com.haitonggauto.rtosc.api.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -32,4 +29,15 @@ public interface NuzarShpApi {
@PostMapping("/vesselVoyages/shipNameFilter")
List<String> checkShipStatus(@RequestBody List<String> req);
@PostMapping("/shipment/unload/plans/unloadInfoVerify")
List<ImportInspectResp> unloadInfoVerify(@RequestBody List<ImportInspectReq> req);
/**
* 离泊状态
* @param vvyIds
* @return
*/
@PostMapping("/vesselVoyages/queryBerthsStatusByVvyIds")
List<ShipmentBerthsStatusRespDTO> queryVoyagesBerthsStatusByVvyIds(@RequestBody List<String> vvyIds);
}

View File

@ -0,0 +1,27 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel("审核后批量修对对应航次")
public class BatchConfirmReviewReq implements Serializable {
private List<String> billNos;
private List<String> ids;
private List<String> mnfBls;
private String shipId;
private String shipName;
private String voyage;
private String voyageId;
private String vvyId;
}

View File

@ -0,0 +1,16 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel("验证是否有装船计划")
public class CheckShipPlanReq implements Serializable {
@ApiModelProperty("航次ID")
private List<String> vvyIds;
}

View File

@ -19,4 +19,7 @@ public class CheckVinReq implements Serializable {
@ApiModelProperty("车架号")
private String vinCode;
@ApiModelProperty("航次ID")
private String vvyId;
}

View File

@ -0,0 +1,31 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("进口查验检验请求")
public class ImportInspectReq implements Serializable {
@ApiModelProperty("提单号")
private String mnfBl;
@ApiModelProperty("船ID")
private String spmId;
@ApiModelProperty("船名")
private String spmName;
@ApiModelProperty("车架号")
private String vinCode;
@ApiModelProperty("航次ID")
private String vvyId;
@ApiModelProperty("船次")
private String vvyName;
}

View File

@ -0,0 +1,55 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("进口查验返回")
public class ImportInspectResp implements Serializable {
private String errorMsg;
private String mnfBl;
private String spmName;
private String vinCode;
private String vvyName;
private YardGoodsDTO yardGoodsDTO;
@Data
public static class YardGoodsDTO implements Serializable {
private String brdId;
private String brdName;
private String bvmName;
private String goodsType;
private String model;
private String position;
private String spmId;
private String storeArea;
private String vvyId;
private String yacId;
private String yalId;
private String yarId;
private String yardId;
private String pamId;
private String pamName;
}
}

View File

@ -0,0 +1,23 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoyusheng
* @version 1.0.0
* @classname ShipmentBerthsStatusRespDTO
* @date 2024/7/23
* @time 13:13
* @description 航次泊位状态
*/
@Data
public class ShipmentBerthsStatusRespDTO implements Serializable {
private static final long serialVersionUID = 1566352212034798745L;
@ApiModelProperty(value = "航次id")
private String vvyId;
@ApiModelProperty(value = "是否离泊0否 1是")
private String unberthedStatus;
}

View File

@ -0,0 +1,26 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("旬度计划船名")
public class TrendShipResp {
@ApiModelProperty("船舶id")
private String spmId;
@ApiModelProperty("船名")
private String spmName;
@ApiModelProperty("船code")
private String vslCode;
@ApiModelProperty("预计到港时间")
private Date planArrivePortTime;
@ApiModelProperty("英文名")
private String spmEname;
}

View File

@ -0,0 +1,94 @@
package com.haitonggauto.rtosc.api.dto;
import com.fasterxml.jackson.annotation.JsonAlias;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @author wangzhengyan
* @Date 2023/5/5 0005 13:55
*/
@Data
public class UserInfoDto implements Serializable {
private static final long serialVersionUID = -2463058823324072492L;
@ApiModelProperty(value = "用户id")
private String id;
@ApiModelProperty(value = "客户姓名")
private String name;
@ApiModelProperty(value = "登录账号")
private String account;
@ApiModelProperty(value = "联系人")
@JsonAlias("memo")
private String contactPerson;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "客户地址")
private String address;
@ApiModelProperty(value = "创建时间")
protected Date createTime;
@ApiModelProperty(value = "创建人")
protected String createUser;
@ApiModelProperty(value = "更新时间")
protected String updateUser;
@ApiModelProperty(value = "更新人")
protected Date updateTime;
@ApiModelProperty(value = "登录时间")
private String loginTime;
@ApiModelProperty(value = "是否启用")
private String enabled;
@ApiModelProperty(value = "手机号")
private String phone;
@ApiModelProperty(value = "头像地址")
private String uploadUrl;
@ApiModelProperty(value = "身份证号")
private String idCard;
// @ApiModelProperty(value = "手机号群组")
// private List<UsersPhones> phones;
/**
* 货代Id
*/
@ApiModelProperty(value = "货代ID")
private String freightId;
/**
* 货代Id
*/
@ApiModelProperty(value = "货代类型")
private String freightType;
/**
* 用户角色id
*/
@ApiModelProperty(value = "用户角色id")
private List<String> roleIds;
@ApiModelProperty(value = "货代类型")
private String med;
private String mediaType;
}

View File

@ -0,0 +1,27 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel("提离港区车架号验证")
public class VinCheckReq implements Serializable {
@ApiModelProperty("品牌ID")
private String brdId;
@ApiModelProperty("港区ID")
private String pamId;
@ApiModelProperty("船舶ID")
private String spmId;
@ApiModelProperty("航次ID")
private String vvyId;
@ApiModelProperty("车架号列表")
private List<String> vinCodeList;
}

View File

@ -0,0 +1,20 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("提离港区车架号验证")
public class VinCheckResp implements Serializable {
@ApiModelProperty("是否退关扫描")
private Boolean hasShutoutScan;
@ApiModelProperty("是否无计划收车")
private Boolean noPlanCollect;
@ApiModelProperty("车架号")
private String vinCode;
}

View File

@ -16,6 +16,9 @@ public class VoyageResp {
@ApiModelProperty("船舶id")
private String spmId;
@ApiModelProperty("港区ID")
private String pamId;
@ApiModelProperty("内贸/外贸/内外贸")
private String tradeType;

View File

@ -2,7 +2,11 @@ package com.haitonggauto.rtosc.config;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.haitonggauto.rtosc.api.NuzarOpenApi;
import com.nuzar.rtops.log.service.SpringApplicationContextHolder;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -11,6 +15,7 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
/**
* 拦截器的属性配置
@ -34,12 +39,15 @@ public class InterceptorConfiguration implements WebMvcConfigurer {
* @return
*/
@Bean
public PermInterceptor permInterceptor() { return new PermInterceptor(); }
public PermInterceptor permInterceptor() {
return new PermInterceptor();
}
@Override
@ConditionalOnBean(PermInterceptor.class)
public void addInterceptors(InterceptorRegistry registry) {
// 拦截器
InterceptorRegistration registration = registry.addInterceptor(this.permInterceptor());
InterceptorRegistration registration = registry.addInterceptor(permInterceptor());
}
}

View File

@ -1,15 +1,13 @@
package com.haitonggauto.rtosc.config;
import com.haitonggauto.rtosc.api.NuzarOpenApi;
import com.haitonggauto.rtosc.api.dto.UserInfoDto;
import com.haitonggauto.rtosc.common.context.UserContext;
import com.haitonggauto.rtosc.common.dto.LoginUser;
import com.haitonggauto.rtosc.common.exception.NoLoginException;
import com.haitonggauto.rtosc.common.exception.NoPermException;
import com.haitonggauto.rtosc.common.handler.anno.HandlerMethod;
import com.haitonggauto.rtosc.common.service.AuthService;
import com.haitonggauto.rtosc.common.utils.MethodInterceptorUtils;
import com.nuzar.common.security5.common.util.SecurityUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
@ -19,23 +17,51 @@ import javax.servlet.http.HttpServletResponse;
* 权限过滤器
*/
public class PermInterceptor implements HandlerInterceptor {
public static final String[] SWAGGER_EXCLUDE_PATHS = {"/doc.html", "/swagger-resources/**", "/webjars/**", "/v2/**", "/favicon.ico", "/swagger-ui.htmL/**", "/health/ping"};
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//判断是否登录
String userId = "";
try {
userId = SecurityUtils.getUserId();
} catch (Exception e) {
// e.printStackTrace();
userId = "0";
String uri = request.getRequestURI();
AntPathMatcher antPathMatcher = new AntPathMatcher();
for (String p : SWAGGER_EXCLUDE_PATHS) {
if (antPathMatcher.match(p, uri)) {
return true;
}
}
System.err.println(userId);
//判断是否登录
String userId = "";
String username = "";
try {
// userId = SecurityUtils.getUserId();
BeanFactory factory = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getServletContext());
NuzarOpenApi openApi = factory.getBean(NuzarOpenApi.class);
UserInfoDto info = openApi.getUserInfo();
userId = info.getId();
username = info.getName();
if (StringUtils.equalsIgnoreCase(info.getMediaType(), "MINIAPP") && !StringUtils.equalsAny(request.getRequestURI(), "/dd/ship/all"
, "/ee/plan/ship", "/dd/port", "/ee/plan/port", "/dd/brand", "/ee/voyage/brand", "/it/shipVoyage", "/spz/valid-vins")) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
// 可以设置响应体
response.getWriter().write("Access Forbidden");
return false;
}
} catch (Exception e) {
throw new RuntimeException(e);
// response.setStatus(HttpServletResponse.SC_FORBIDDEN);
// // 可以设置响应体
// response.getWriter().write("Access Forbidden");
// return false;
}
LoginUser tmpUser = new LoginUser();
tmpUser.setUserId(userId);
tmpUser.setRoleId(0L);
tmpUser.setUsername(username);
tmpUser.setAdmin(true);
UserContext.setUser(tmpUser);

View File

@ -4,9 +4,11 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.fill.FillWrapper;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -22,16 +24,14 @@ import com.haitonggauto.rtosc.common.enums.ErrorType;
import com.haitonggauto.rtosc.common.handler.BaseHandler;
import com.haitonggauto.rtosc.common.utils.*;
import com.haitonggauto.rtosc.dto.*;
import com.haitonggauto.rtosc.excel.DepartureImportExcel;
import com.haitonggauto.rtosc.handler.excel.ReadExcelListener;
import com.haitonggauto.rtosc.query.CargoQuery;
import com.haitonggauto.rtosc.query.DepartureQuery;
import com.haitonggauto.rtosc.query.ExportInCheckQuery;
import com.haitonggauto.rtosc.repository.entity.*;
import com.haitonggauto.rtosc.handler.mapper.PoMapper;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import com.haitonggauto.rtosc.repository.service.CustomerDepartureCargoService;
import com.haitonggauto.rtosc.repository.service.CustomerDepartureDriversService;
import com.haitonggauto.rtosc.repository.service.CustomerDeparturePlanService;
import com.haitonggauto.rtosc.repository.service.CustomerDepartureService;
import com.haitonggauto.rtosc.repository.service.*;
import com.haitonggauto.rtosc.service.CustomerService;
import com.itextpdf.forms.PdfAcroForm;
import com.itextpdf.forms.fields.PdfFormField;
@ -51,11 +51,12 @@ import com.itextpdf.layout.layout.LayoutArea;
import com.itextpdf.layout.layout.LayoutResult;
import com.itextpdf.layout.properties.UnitValue;
import com.itextpdf.layout.renderer.DocumentRenderer;
import com.nuzar.common.security5.common.util.SecurityUtils;
import com.nuzar.rtops.log.dto.LogRecordDTO;
import com.nuzar.rtops.log.service.EsLogApprovalUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
@ -65,15 +66,18 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.*;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
@ -82,6 +86,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/ep")
@Validated
@Slf4j
public class DepartureHandler implements BaseHandler {
@Resource
@ -99,6 +104,12 @@ public class DepartureHandler implements BaseHandler {
@Resource
private CustomerDeparturePlanService departurePlanService;
@Resource
private CustomerExportInCargoService exportInCargoService;
@Resource
private CustomerExportInService exportInService;
@Resource
private NuzarOpenApi openApi;
@ -217,6 +228,32 @@ public class DepartureHandler implements BaseHandler {
return ResultUtil.success(rst, String.valueOf(page.getTotal()));
}
@ApiOperation("提单号模糊匹配")
@PostMapping("/billNo/query")
public Result<List<String>> getExportInBillNoList(
@ApiParam(name = "操作方式, 0为前端1为审核端") @RequestParam(required = false, defaultValue = "0") String type,
@RequestParam(required = false, defaultValue = "1") Integer current,
@RequestParam(required = false, defaultValue = "10") Integer size,
@RequestParam(required = false) String shipId,
@RequestParam(required = false) String voyageId,
@RequestParam(required = false) String q) {
QueryWrapper<CustomerDepartureCargo> query = new QueryWrapper<>();
query.select("distinct bill_no");
query.eq(StringUtils.equals(type, "0"), "create_by", UserContext.getUser().getUserId());
query.exists(StringUtils.isNotEmpty(shipId), "select id from customer_departure where departure_id=customer_departure.id and ship_id={0}", shipId);
query.exists(StringUtils.isNotEmpty(voyageId), "select id from customer_departure where departure_id=customer_departure.id and voyage_id={0}", shipId);
// query.eq("create_by", UserContext.getUser().getUserId());
query.like(StringUtils.isNotEmpty(q), "bill_no", q);
Page<CustomerDepartureCargo> page = departureCargoService.page(new Page<>(current, size), query);
List<CustomerDepartureCargo> list = page.getRecords();
List<String> rst = list.stream().map(tmp -> tmp.getBillNo()).collect(Collectors.toList());
return ResultUtil.success(rst, String.valueOf(page.getTotal()));
}
/**
* 分页查询
* @param query
@ -324,6 +361,10 @@ public class DepartureHandler implements BaseHandler {
return entity;
}).collect(Collectors.toList());
departure.setQuantity(cargos.size());
departure.setSpareQuantity((int)cargos.stream().filter(s -> StringUtils.startsWith(s.getVin(), "BJ")).count());
departure.setCarQuantity(departure.getQuantity() - departure.getSpareQuantity());
List<CustomerDepartureDrivers> drivers = form.getDrivers().stream().map(item -> {
CustomerDepartureDrivers entity = PoMapper.instance.departureDriverVo2Entity(item);
entity.setTermcd(departure.getPortAreaId());
@ -336,6 +377,11 @@ public class DepartureHandler implements BaseHandler {
return entity;
}).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(plans)) {
String collect = plans.stream().filter(s -> StringUtils.isNotEmpty(s.getMachine())).map(s -> s.getMachine()).collect(Collectors.joining(","));
departure.setWorkStatus(collect);
}
Long id = customerService.saveDeparture(departure, cargos, drivers, plans);
return ResultUtil.success(String.valueOf(id));
@ -352,7 +398,7 @@ public class DepartureHandler implements BaseHandler {
.in("vin", vo.getVins())
.exists("select id from customer_departure where customer_departure.id=customer_departure_cargo.departure_id and customer_departure.voyage_id={0}", vo.getVoyageId())
.groupBy("vin")
.having("count(quantity) > 1")
.having("count(*) > 1")
.list();
rst.put(vo.getVoyageId(), cargos.stream().map(item -> item.getVin()).collect(Collectors.toList()));
}
@ -366,7 +412,7 @@ public class DepartureHandler implements BaseHandler {
.select("count(*) as quantity, vin")
.in("vin", vins)
.groupBy("vin")
.having("count(quantity) > 0")
.having("count(*) > 0")
.list();
return ResultUtil.success(cargos.stream().map(item -> item.getVin()).collect(Collectors.toList()));
}
@ -475,6 +521,10 @@ public class DepartureHandler implements BaseHandler {
return entity;
}).collect(Collectors.toList());
departure.setQuantity(cargos.size());
departure.setSpareQuantity((int)cargos.stream().filter(s -> StringUtils.startsWith(s.getVin(), "BJ")).count());
departure.setCarQuantity(departure.getQuantity() - departure.getSpareQuantity());
List<CustomerDepartureDrivers> drivers = form.getDrivers().stream().map(item -> {
CustomerDepartureDrivers entity = PoMapper.instance.departureDriverVo2Entity(item);
entity.setTermcd(departure.getPortAreaId());
@ -487,6 +537,11 @@ public class DepartureHandler implements BaseHandler {
return entity;
}).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(plans)) {
String collect = plans.stream().filter(s -> StringUtils.isNotEmpty(s.getMachine())).map(s -> s.getMachine()).collect(Collectors.joining(","));
departure.setWorkStatus(collect);
}
customerService.updateDeparture(false, departure, cargos, drivers, plans);
return ResultUtil.success(String.valueOf(departure.getId()));
@ -572,6 +627,16 @@ public class DepartureHandler implements BaseHandler {
customerService.wrapperEntity(cargos);
// 获取进港时间
Map<String, Date> carPickTime = openApi.getCarPickTime(cargos.stream().map(s -> s.getVin()).collect(Collectors.toList()));
if (MapUtils.isNotEmpty(carPickTime)) {
cargos.stream().forEach(s -> {
if (carPickTime.containsKey(s.getVin()) && carPickTime.get(s.getVin()) != null) {
s.setCarPickTime(DateUtils.formatDate(carPickTime.get(s.getVin())));
}
});
}
List<CustomerDepartureDrivers> drivers = departureDriversService.list(new LambdaQueryWrapper<CustomerDepartureDrivers>().eq(CustomerDepartureDrivers::getDepartureId, id));
customerService.wrapperEntity(drivers);
@ -632,13 +697,23 @@ public class DepartureHandler implements BaseHandler {
LambdaQueryWrapper<CustomerDepartureCargo> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(query.getId() != null, CustomerDepartureCargo::getDepartureId, query.getId());
if (query.getCargoType() != null) {
queryWrapper.eq(query.getCargoType() != null, CustomerDepartureCargo::getCargoType, query.getCargoType());
queryWrapper.eq(query.getCargoType() != null, CustomerDepartureCargo::getCartType, query.getCargoType());
}
Page<CustomerDepartureCargo> page = departureCargoService.page(new Page<>(query.getPage(), query.getRows()), queryWrapper);
customerService.wrapperEntity(page.getRecords());
if (CollectionUtils.isNotEmpty(page.getRecords())) {
// 获取进港时间
Map<String, Date> carPickTime = openApi.getCarPickTime(page.getRecords().stream().map(s -> s.getVin()).collect(Collectors.toList()));
if (MapUtils.isNotEmpty(carPickTime)) {
page.getRecords().stream().forEach(s -> {
if (carPickTime.containsKey(s.getVin()) && carPickTime.get(s.getVin()) != null) {
s.setCarPickTime(DateUtils.formatDate(carPickTime.get(s.getVin())));
}
});
}
CustomerDeparture departure = departureService.getById(page.getRecords().get(0).getDepartureId());
// 获取作业状态
@ -699,8 +774,8 @@ public class DepartureHandler implements BaseHandler {
log.setOperateData(l);
log.setStatus(check.getCheckStatus() == AuditEnum.AUDIT_PASS ? 0 : 1);
log.setOperateTime(new Date());
log.setUserId(SecurityUtils.getUserId());
log.setUserName(SecurityUtils.getUserName());
log.setUserId(UserContext.getUser().getUserId());
log.setUserName(UserContext.getUser().getUsername());
EsLogApprovalUtil.writeLog(log);
}
}
@ -755,8 +830,8 @@ public class DepartureHandler implements BaseHandler {
log.setOperateData(l);
log.setStatus(check.getCheckStatus() == AuditEnum.AUDIT_PASS ? 0 : 1);
log.setOperateTime(new Date());
log.setUserId(SecurityUtils.getUserId());
log.setUserName(SecurityUtils.getUserName());
log.setUserId(UserContext.getUser().getUserId());
log.setUserName(UserContext.getUser().getUsername());
EsLogApprovalUtil.writeLog(log);
}
}
@ -820,6 +895,7 @@ public class DepartureHandler implements BaseHandler {
// 查询出要加载的数据
List<CustomerDeparture> departures = departureService.list(new LambdaQueryWrapper<CustomerDeparture>().in(CustomerDeparture::getBatchNo, nos));
customerService.wrapperEntity(departures);
ExcelWriter excelWriter = null;
try(ByteArrayOutputStream bos = new ByteArrayOutputStream()){
@ -863,18 +939,19 @@ public class DepartureHandler implements BaseHandler {
// 简单的说 如果你的模板有list,且list不是最后一行下面还有数据需要填充 就必须设置 forceNewRow=true 但是这个就会把所有数据放到内存 会很耗内存
// 如果数据量大 list不是最后一行 参照下一个
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.FALSE).build();
List<CustomerDeparturePlan> before = CollectionUtil.sub(plans, 0, 1);
List<CustomerDeparturePlan> after = CollectionUtil.sub(plans, 1, plans.size() - 1);
List<CustomerDeparturePlan> after = CollectionUtil.sub(plans, 1, plans.size());
excelWriter.fill(new FillWrapper("plan", before), writeSheet);
excelWriter.fill(new FillWrapper("plan", after), fillConfig, writeSheet);
Map<String, Object> map = new HashMap<>();
map.put("batchNo", departures.get(i).getBatchNo()); // {batchNo}
// map.put("batchNo", departures.get(i).getBatchNo()); // {batchNo}
map.put("receiveCompany", departures.get(i).getReceiveCompany()); // {receiveCompany}
//{applicant}
map.put("applicant", departures.get(i).getApplicant());
map.put("applicant", departures.get(i).getCheckMan());
map.put("remark", departures.get(i).getRemark());
//{applyTime}
map.put("applyTime", departures.get(i).getApplyTime());
//{shipName}
@ -933,10 +1010,13 @@ public class DepartureHandler implements BaseHandler {
List<CustomerDepartureCargo> cargos = departureCargoService.list(new LambdaQueryWrapper<CustomerDepartureCargo>().eq(CustomerDepartureCargo::getDepartureId, departure.getId()));
Integer num = cargos.stream().mapToInt(CustomerDepartureCargo::getQuantity).sum();
Integer num = cargos.size();
List<CustomerDepartureDrivers> drivers = departureDriversService.list(new LambdaQueryWrapper<CustomerDepartureDrivers>().eq(CustomerDepartureDrivers::getDepartureId, departure.getId()));
// 获取进港时间
Map<String, Date> carPickTime = openApi.getCarPickTime(cargos.stream().map(s -> s.getVin()).collect(Collectors.toList()));
PdfDocument pdfDoc = new PdfDocument(new PdfReader(inputStream), new PdfWriter(response.getOutputStream()));
org.springframework.core.io.Resource resource = new ClassPathResource("templates/SourceHanSansCN-Regular.ttf");
@ -944,20 +1024,24 @@ public class DepartureHandler implements BaseHandler {
byte[] bytes = IOUtils.toByteArray(stream);
PdfFont font = PdfFontFactory.createFont(bytes, PdfEncodings.IDENTITY_H, PdfFontFactory.EmbeddingStrategy.PREFER_EMBEDDED);
PdfFont enFont = PdfFontFactory.createFont();
PdfAcroForm form = PdfAcroForm.getAcroForm(pdfDoc, false);
Map<String, PdfFormField> fields = form.getFormFields();
fields.get("batchNo").setValue(departure.getBatchNo()).setFont(font).setFontSize(12);
fields.get("shipName").setValue(departure.getShipName()).setFont(font).setFontSize(12);
fields.get("voyage").setValue(departure.getVoyage()).setFont(font).setFontSize(12);
fields.get("voyage").setValue(StringUtils.isNotEmpty(departure.getVoyage()) ? departure.getVoyage() : "").setFont(font).setFontSize(12);
fields.get("arrivalTime").setValue(DateUtil.format(departure.getArrivalTime(), "yyyy-MM-dd")).setFont(font).setFontSize(12);
fields.get("deliveryTime").setValue(DateUtil.format(departure.getDeliveryTime(), "yyyy-MM-dd")).setFont(font).setFontSize(12);
fields.get("returnTime").setValue(DateUtil.format(departure.getReturnTime(), "yyyy-MM-dd")).setFont(font).setFontSize(12);
fields.get("num").setValue(String.valueOf(num)).setFont(font).setFontSize(12);
if (StringUtils.isNotEmpty(departure.getRemark())) {
fields.get("remark").setValue(departure.getRemark()).setFont(font).setFontSize(12);
if (departure.getReturnTime() != null) {
fields.get("returnTime").setValue(DateUtil.format(departure.getReturnTime(), "yyyy-MM-dd")).setFont(font).setFontSize(12);
}
fields.get("num").setValue(String.valueOf(num)).setFont(font).setFontSize(12);
fields.get("brand").setValue(StringUtils.isNotEmpty(departure.getBrand()) ? departure.getBrand() : "").setFont(font).setFontSize(12);
fields.get("remark").setValue(StringUtils.isNotEmpty(departure.getRemark()) ? departure.getRemark() : "").setFont(font).setFontSize(12);
fields.get("reason").setValue(StringUtils.isNotEmpty(departure.getReason()) ? departure.getReason() : "").setFont(font).setFontSize(12);
Table driverTable = new Table(UnitValue.createPercentArray(new float[] {30f, 50f, 50f}));
driverTable.addHeaderCell(new Cell().add(new Paragraph("司机姓名").setFont(font)));
@ -969,18 +1053,30 @@ public class DepartureHandler implements BaseHandler {
driverTable.addCell(new Paragraph(driver.getContactPhone()).setFont(font));
});
Table cargoTable = new Table(UnitValue.createPercentArray(new float[] {30f, 50f, 50f, 50f, 50f}));
Table cargoTable = new Table(UnitValue.createPercentArray(new float[] {30f, 50f, 50f, 50f, 50f, 50f, 50f, 50f, 50f,50f}));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("提单号").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("品牌").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("货物类型").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("车架号").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("数量").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("车型").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("型号").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("通关性质").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("尺寸(米)").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("重量KG").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("是否退关提离").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("是否随车备件").setFont(font)));
cargoTable.addHeaderCell(new Cell().add(new Paragraph("进港时间").setFont(font)));
cargos.stream().forEach(cargo -> {
cargoTable.addCell(new Paragraph(cargo.getBillNo()).setFont(font));
cargoTable.addCell(new Paragraph(cargo.getBrand()).setFont(font));
cargoTable.addCell(new Paragraph(cargo.getCargoType()).setFont(font));
cargoTable.addCell(cargo.getVin());
cargoTable.addCell(String.valueOf(cargo.getQuantity()));
cargoTable.addCell(new Paragraph(StringUtils.isNotEmpty(cargo.getCartType()) ? cargo.getCartType() : "").setFont(font));
cargoTable.addCell(new Paragraph(StringUtils.isNotEmpty(cargo.getModels()) ? cargo.getModels() : "").setFont(font));
cargoTable.addCell(new Paragraph(cargo.getIsCustoms() != null ? (cargo.getIsCustoms() == 0 ? "未报关" : "已报关") : "").setFont(font));
cargoTable.addCell(new Paragraph((cargo.getLength() != null && cargo.getWidth() != null && cargo.getHeight() != null) ? StringUtils.join(cargo.getLength(), "*", cargo.getWidth(), "\n*", cargo.getHeight()) : "").setFont(enFont));
cargoTable.addCell(new Paragraph(cargo.getWeight() != null ? cargo.getWeight().toString() : "").setFont(font));
cargoTable.addCell(new Paragraph(cargo.getIsShutout() != null ? (cargo.getIsShutout() == 0 ? "" : "") : "").setFont(font));
cargoTable.addCell(new Paragraph(cargo.getIsSpare() != null ? (cargo.getIsSpare() == 0 ? "" : "") : "").setFont(font));
cargoTable.addCell(new Paragraph(carPickTime != null && carPickTime.containsKey(cargo.getVin()) && carPickTime.get(cargo.getVin()) != null ? DateUtils.formatDate(carPickTime.get(cargo.getVin())) : "").setFont(font));
});
final Document doc = new Document(pdfDoc);
@ -1010,4 +1106,223 @@ public class DepartureHandler implements BaseHandler {
doc.close();
}
@ApiOperation("提离港区导入模板下载")
@GetMapping("/temp/down")
public void tempDownPlan(HttpServletResponse response) throws Exception {
// 加载模板
ClassPathResource classPathResource = new ClassPathResource("templates/departure_temp.xlsx");
InputStream inputStream = classPathResource.getInputStream();
XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
OutputStream out = response.getOutputStream();
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
// 这里注意 有同学反应使用swagger 会导致各种问题请直接用浏览器或者用postman
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
String fileName = URLEncoder.encode("提离港区导入模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
workbook.write(bos);
byte[] bArray = bos.toByteArray();
InputStream is = new ByteArrayInputStream(bArray);
org.apache.commons.io.IOUtils.copy(is, out);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@ApiOperation("通过车架号获取信息")
@PostMapping("/getInfoByVin")
public Result<CustomerExportIn> getInfoByVin(@RequestParam(required = false) @NotBlank(message = "船ID不能为空") @ApiParam("船ID") String shipId,
@RequestParam(required = false) @NotBlank(message = "航次ID不能为空") @ApiParam("航次ID") String voyageId,
@RequestParam(required = false) @NotBlank(message = "港区ID不能为空") @ApiParam("港区ID") String portAreaId,
@RequestParam(required = false) @NotBlank(message = "品牌ID不能为空") @ApiParam("品牌ID") String brandId,
@RequestParam(required = false) @NotBlank(message = "提单号不能为空") @ApiParam("提单号") String billNo,
@RequestParam(required = false) @NotBlank(message = "车架号不能为空") @ApiParam("车架号") String vin) {
DepartureValidVo form = new DepartureValidVo();
form.setBrandId(brandId);
form.setShipId(shipId);
form.setVoyageId(voyageId);
form.setPortAreaId(portAreaId);
DepartureValidVo.BillVin bvin = new DepartureValidVo.BillVin();
bvin.setBillNo(billNo);
bvin.setVin(vin);
form.setVins(Arrays.asList(bvin));
Result<Map<String, CustomerExportIn>> mapResult = this.validVins(form);
if (mapResult.getCode() != 0) { // 验证失败
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), mapResult.getMsg());
}
return ResultUtil.success(mapResult.getData().get(vin));
}
@ApiOperation("提离港区导入")
@PostMapping("/import")
public Result<List<DepartureImportExcel>> importExcel(@RequestParam(required = false) @NotBlank(message = "船ID不能为空") @ApiParam("船ID") String shipId,
@RequestParam(required = false) @NotBlank(message = "航次ID不能为空") @ApiParam("航次ID") String voyageId,
@RequestParam(required = false) @NotBlank(message = "港区ID不能为空") @ApiParam("港区ID") String portAreaId,
@RequestParam(required = false) @NotBlank(message = "品牌ID不能为空") @ApiParam("品牌ID") String brandId,
MultipartFile file) {
try {
// 所有读取的数据
List<DepartureImportExcel> dataList = new ArrayList<>();
EasyExcel.read(file.getInputStream(), DepartureImportExcel.class, new ReadExcelListener<DepartureImportExcel>() {
@Override
protected void saveData(List<DepartureImportExcel> list) { // 缓存数据
dataList.addAll(list);
}
}).sheet().doRead();
if (CollectionUtils.isEmpty(dataList)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "没有读取到数据");
}
ValidatorFactory vf = Validation.buildDefaultValidatorFactory();
Validator validator = vf.getValidator();
// 数据验证
for (DepartureImportExcel item : dataList) {
Set<ConstraintViolation<DepartureImportExcel>> set = validator.validate(item);
if (CollectionUtils.isNotEmpty(set)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), set.stream().map(p -> p.getMessage()).collect(Collectors.joining(",")));
}
}
DepartureValidVo form = new DepartureValidVo();
form.setBrandId(brandId);
form.setShipId(shipId);
form.setVoyageId(voyageId);
form.setPortAreaId(portAreaId);
List<DepartureValidVo.BillVin> billVins = dataList.stream().map(item -> {
DepartureValidVo.BillVin vin = new DepartureValidVo.BillVin();
vin.setBillNo(item.getBillNo());
vin.setVin(item.getVin());
return vin;
}).collect(Collectors.toList());
form.setVins(billVins);
Result<Map<String, CustomerExportIn>> mapResult = this.validVins(form);
if (mapResult.getCode() != 0) { // 验证失败
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), mapResult.getMsg());
}
dataList.stream().forEach(item -> {
if (mapResult.getData().containsKey(item.getVin())) {
CustomerExportIn in = mapResult.getData().get(item.getVin());
item.setCartType(in.getCartType());
item.setModels(in.getModels());
item.setHeight(in.getHeight());
item.setLength(in.getLength());
item.setWidth(in.getWidth());
item.setWeight(in.getWeight());
}
});
return ResultUtil.success(dataList);
} catch (ExcelDataConvertException e) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入数据错误,请确认导入数据模板是否正确, 行:" + e.getRowIndex() + " 列:" + e.getColumnIndex());
} catch (Exception e) {
log.error("错误信息", e);
return ResultUtil.failure(ErrorType.PROGRAM_ERROR.id(), e.getMessage());
}
}
@ApiOperation("车架号验证")
@PostMapping("/vin/valid")
public Result<Map<String, CustomerExportIn>> validVins(@RequestBody @Validated DepartureValidVo form) {
Map<String, CustomerExportIn> rst = new HashMap<>();
// 所有车架号
List<String> vins = form.getVins().stream().map(s -> s.getVin()).collect(Collectors.toList());
// 根据车架号查询进港申请
List<CustomerExportInCargo> list = exportInCargoService.lambdaQuery()
.in(CustomerExportInCargo::getVin, vins)
.exists("select id from customer_export_in B where B.id=customer_export_in_cargo.export_in_id and B.ship_id={0} and B.voyage_id={1} and port_area_id={2} and brand_id={3} and check_status={4}",
form.getShipId(), form.getVoyageId(), form.getPortAreaId(), form.getBrandId(), AuditEnum.AUDIT_PASS).list();
// 有进港计划的
List<String> strings = list.stream().map(s -> s.getVin()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(strings)) {
// 检验提单号是否属于这个账号
List<FreightVo> userBindFreight = openApi.getUserBindFreight();
List<Long> ids = list.stream().map(s -> s.getExportInId()).distinct().collect(Collectors.toList());
List<CustomerExportIn> exportIns = exportInService.lambdaQuery().in(CustomerExportIn::getId, ids).list();
// 账号不一致的
List<CustomerExportIn> ins = exportIns.stream().filter(item -> CollectionUtils.isEmpty(userBindFreight) || userBindFreight.stream().filter(s -> StringUtils.equalsAny(item.getFreightId(), s.getCueId())).count() == 0).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(ins)) {
// 提示车架号不存在
List<Long> longs = ins.stream().map(s -> s.getId()).collect(Collectors.toList());
String collect = list.stream().filter(s -> longs.contains(s.getExportInId())).map(s -> s.getVin()).collect(Collectors.joining(","));
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "车架号"+collect+"不存在");
}
// 提单号与车架号是否匹配
Map<String, String> stringMap = form.getVins().stream().collect(Collectors.toMap(s -> s.getVin(), s -> s.getBillNo()));
Map<Long, String> exportInMap = exportIns.stream().collect(Collectors.toMap(s -> s.getId(), s -> s.getBillNum()));
Map<String, Long> longMap = list.stream().collect(Collectors.toMap(s -> s.getVin(), s -> s.getExportInId()));
List<String> collect = strings.stream().filter(s -> !StringUtils.equals(stringMap.get(s), exportInMap.get(longMap.get(s)))).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
String s1 = collect.stream().map(s -> "车架号" + s + "与提单号" + stringMap.get(s) + "不匹配").collect(Collectors.joining(","));
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), s1);
}
// 是否做过退关退运扫描
VinCheckReq req = new VinCheckReq();
req.setPamId(form.getPortAreaId());
req.setBrdId(form.getBrandId());
req.setSpmId(form.getShipId());
req.setVvyId(form.getVoyageId());
req.setVinCodeList(strings);
List<VinCheckResp> resp = openApi.vinCheckInfo(req);
System.err.println(JSON.toJSONString(req));
System.err.println(JSON.toJSONString(resp));
List<VinCheckResp> checkResps = resp.stream().filter(s -> !s.getHasShutoutScan()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(checkResps)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), checkResps.stream().map(s -> s.getVinCode()).collect(Collectors.joining(",")) + "暂无提离车辆信息,请联系码头确认");
}
list.stream().forEach(s -> {
rst.put(s.getVin(), exportIns.stream().filter(i -> Long.compare(i.getId(), s.getExportInId()) == 0).findFirst().get());
});
}
// 没有进港计划的
List<String> noVins = vins.stream().filter(s -> !strings.contains(s)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(noVins)) {
// 是否做过退关退运扫描
VinCheckReq req = new VinCheckReq();
req.setPamId(form.getPortAreaId());
req.setBrdId(form.getBrandId());
req.setSpmId(form.getShipId());
req.setVvyId(form.getVoyageId());
req.setVinCodeList(noVins);
List<VinCheckResp> resp = openApi.vinCheckInfo(req);
List<VinCheckResp> checkResps = resp.stream().filter(s -> !s.getNoPlanCollect()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(checkResps)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), checkResps.stream().map(s -> s.getVinCode()).collect(Collectors.joining(",")) + "车架号不正确");
}
checkResps = resp.stream().filter(s -> !s.getHasShutoutScan()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(checkResps)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), checkResps.stream().map(s -> s.getVinCode()).collect(Collectors.joining(",")) + "暂无提离车辆信息,请联系码头确认");
}
}
return ResultUtil.success(rst);
}
}

View File

@ -1,10 +1,14 @@
package com.haitonggauto.rtosc.handler;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -19,11 +23,15 @@ import com.haitonggauto.rtosc.common.dto.DictDTO;
import com.haitonggauto.rtosc.common.dto.Result;
import com.haitonggauto.rtosc.common.enums.ErrorType;
import com.haitonggauto.rtosc.common.handler.BaseHandler;
import com.haitonggauto.rtosc.common.utils.DateUtils;
import com.haitonggauto.rtosc.common.utils.ResultUtil;
import com.haitonggauto.rtosc.common.utils.ValidationGroup;
import com.haitonggauto.rtosc.common.utils.WrapperKit;
import com.haitonggauto.rtosc.dto.*;
import com.haitonggauto.rtosc.excel.ExportInPlanExcel;
import com.haitonggauto.rtosc.excel.ExportInspectExportExcel;
import com.haitonggauto.rtosc.excel.InspectExcel;
import com.haitonggauto.rtosc.handler.excel.ReadExcelListener;
import com.haitonggauto.rtosc.query.CargoQuery;
import com.haitonggauto.rtosc.query.ExportInspectCheckQuery;
import com.haitonggauto.rtosc.query.ExportInspectQuery;
@ -31,6 +39,8 @@ import com.haitonggauto.rtosc.repository.entity.*;
import com.haitonggauto.rtosc.handler.mapper.PoMapper;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import com.haitonggauto.rtosc.repository.enums.InspectStatusEnum;
import com.haitonggauto.rtosc.repository.service.CustomerExportInCargoService;
import com.haitonggauto.rtosc.repository.service.CustomerExportInService;
import com.haitonggauto.rtosc.repository.service.CustomerExportInspectCargoService;
import com.haitonggauto.rtosc.repository.service.CustomerExportInspectService;
import com.haitonggauto.rtosc.service.CustomerService;
@ -40,22 +50,34 @@ import com.nuzar.rtops.log.service.EsLogApprovalUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.core.io.ClassPathResource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@Slf4j
@RestController
@RequestMapping("/ci")
@Api(tags = "出口海关查验")
@ -77,6 +99,15 @@ public class ExportInspectHandler implements BaseHandler {
@Resource
private NuzarYardApi yardApi;
@Resource
private CustomerExportInService exportInService;
@Resource
private CustomerExportInCargoService exportInCargoService;
@Resource
private DictHandler dictHandler;
@ApiOperation("船名航次模糊匹配")
@PostMapping("/shipVoyage")
public Result<List<ShipVoyageVo>> getExportInShipNameList(
@ -176,16 +207,19 @@ public class ExportInspectHandler implements BaseHandler {
@ApiOperation("提单号模糊匹配")
@PostMapping("/billNo/query")
public Result<List<String>> getExportInBillNoList(
@ApiParam(name = "操作方式, 0为前端1为审核端") @RequestParam(required = false, defaultValue = "0") String type,
@RequestParam(required = false, defaultValue = "1") Integer current,
@RequestParam(required = false, defaultValue = "10") Integer size,
@RequestParam(required = false) String shipName,
@RequestParam(required = false) String voyage,
@RequestParam(required = false) String q) {
LambdaQueryWrapper<CustomerExportInspect> query = new LambdaQueryWrapper<>();
query.eq(CustomerExportInspect::getTradType, "E");
query.eq(StringUtils.isNotEmpty(shipName), CustomerExportInspect::getShipName, shipName);
query.eq(StringUtils.isNotEmpty(voyage), CustomerExportInspect::getVoyage, voyage);
query.like(StringUtils.isNotEmpty(q), CustomerExportInspect::getBillNo, q); // 提单号
QueryWrapper<CustomerExportInspect> query = new QueryWrapper<>();
query.select("distinct bill_no");
query.eq("trad_type", "E");
query.eq(StringUtils.equals(type, "0"), "create_by", UserContext.getUser().getUserId());
query.eq(StringUtils.isNotEmpty(shipName), "ship_name", shipName);
query.eq(StringUtils.isNotEmpty(voyage), "voyage", voyage);
query.like(StringUtils.isNotEmpty(q), "bill_no", q); // 提单号
Page<CustomerExportInspect> page = customerExportInspectService.page(new Page<>(current, size), query);
List<CustomerExportInspect> list = page.getRecords();
@ -506,6 +540,28 @@ public class ExportInspectHandler implements BaseHandler {
List<CustomerExportInspectCargo> cargos = customerExportInspectCargoService.list(new LambdaQueryWrapper<CustomerExportInspectCargo>().eq(CustomerExportInspectCargo::getExportInspectId, id));
// 获取实时
if (CollectionUtils.isNotEmpty(cargos)) {
GoodsStatusReq req = new GoodsStatusReq();
req.setBusinessType("INSPECT");
req.setImportExportType("E");
req.setVvyId(StringUtils.equalsAnyIgnoreCase(exportInspect.getVoyageId(), "HT6", "HTLG", "HTTC") ? "" : exportInspect.getVoyageId());
req.setVinCodeList(cargos.stream().map(p -> p.getVin()).collect(Collectors.toList()));
List<GoodsStatusResp> resp = openApi.getGoodsStatus(req);
Map<String, GoodsStatusResp> respMap = resp.stream().collect(Collectors.toMap(p -> p.getVinCode(), p -> p));
cargos.stream().forEach(p -> {
GoodsStatusResp r = respMap.get(p.getVin());
if (r != null) {
p.setArea(r.getPosition());
} else {
p.setArea("");
}
});
}
customerService.wrapperEntity(cargos);
exportInspect.setCargos(cargos);
@ -549,6 +605,34 @@ public class ExportInspectHandler implements BaseHandler {
}
Page<CustomerExportInspectCargo> page = customerExportInspectCargoService.page(new Page<>(query.getPage(), query.getRows()), queryWrapper);
// 获取实时
if (CollectionUtils.isNotEmpty(page.getRecords())) {
// 需要按InspectId 进行分组
Map<Long, List<CustomerExportInspectCargo>> collect = page.getRecords().stream().collect(Collectors.groupingBy(CustomerExportInspectCargo::getExportInspectId));
collect.entrySet().forEach(item -> {
CustomerExportInspect inspect = customerExportInspectService.getById(item.getKey());
GoodsStatusReq req = new GoodsStatusReq();
req.setBusinessType("INSPECT");
req.setImportExportType("E");
req.setVvyId(StringUtils.equalsAnyIgnoreCase(inspect.getVoyageId(), "HT6", "HTLG", "HTTC") ? "" : inspect.getVoyageId());
req.setVinCodeList(item.getValue().stream().map(p -> p.getVin()).collect(Collectors.toList()));
List<GoodsStatusResp> resp = openApi.getGoodsStatus(req);
Map<String, GoodsStatusResp> respMap = resp.stream().collect(Collectors.toMap(p -> p.getVinCode(), p -> p));
page.getRecords().stream().filter(p -> p.getExportInspectId() == item.getKey()).forEach(p -> {
GoodsStatusResp r = respMap.get(p.getVin());
if (r != null) {
p.setArea(r.getPosition());
} else {
p.setArea("");
}
});
});
}
customerService.wrapperEntity(page.getRecords());
return ResultUtil.success(page);
@ -599,10 +683,11 @@ public class ExportInspectHandler implements BaseHandler {
// 判断车辆是否在场
List<VinStatus> vinStatus = yardApi.getVinStatus(vins);
List<String> exists = vinStatus.stream().map(item -> item.getVinCode()).collect(Collectors.toList());
page.getRecords().stream().forEach(item -> {
item.setInspect(collect.get(item.getExportInspectId()));
item.setInArea(vinStatus.contains(item.getVin()));
item.setInArea(exists.contains(item.getVin()));
});
}
@ -638,8 +723,8 @@ public class ExportInspectHandler implements BaseHandler {
log.setOperateData(record);
log.setStatus(check.getCheckStatus() == AuditEnum.AUDIT_PASS ? 0 : 1);
log.setOperateTime(new Date());
log.setUserId(SecurityUtils.getUserId());
log.setUserName(SecurityUtils.getUserName());
log.setUserId(UserContext.getUser().getUserId());
log.setUserName(UserContext.getUser().getUsername());
EsLogApprovalUtil.writeLog(log);
}
@ -685,8 +770,8 @@ public class ExportInspectHandler implements BaseHandler {
log.setOperateData(record);
log.setStatus(check.getCheckStatus() == AuditEnum.AUDIT_PASS ? 0 : 1);
log.setOperateTime(new Date());
log.setUserId(SecurityUtils.getUserId());
log.setUserName(SecurityUtils.getUserName());
log.setUserId(UserContext.getUser().getUserId());
log.setUserName(UserContext.getUser().getUsername());
EsLogApprovalUtil.writeLog(log);
}
@ -787,6 +872,7 @@ public class ExportInspectHandler implements BaseHandler {
private void write(AtomicInteger index, List<CustomerExportInspect> headers, ExcelWriter excelWriter, WriteSheet writeSheet) {
if (CollectionUtils.isEmpty(headers)) {
excelWriter.write(new ArrayList<>(), writeSheet);
return;
}
@ -810,6 +896,10 @@ public class ExportInspectHandler implements BaseHandler {
// 备件号排序
List<ExportInspectExportExcel> details = list.stream().filter(p -> ids.contains(p.getExportInspectId()))
.map(s -> {
s.setCartType(StringUtils.isBlank(s.getCartType()) ? "":s.getCartType());
return s;
})
.sorted(Comparator.comparing(CustomerExportInspectCargo::getCartType).reversed())
.map(p -> {
CustomerExportInspect head = collect.get(p.getExportInspectId());
@ -823,4 +913,337 @@ public class ExportInspectHandler implements BaseHandler {
});
}
@ApiOperation("出口查验导入模板下载")
@GetMapping("/temp/down")
public void tempDownPlan(HttpServletResponse response) throws Exception {
// 加载模板
ClassPathResource classPathResource = new ClassPathResource("templates/export_inspect_temp.xlsx");
InputStream inputStream = classPathResource.getInputStream();
XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
OutputStream out = response.getOutputStream();
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
// 这里注意 有同学反应使用swagger 会导致各种问题请直接用浏览器或者用postman
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
String fileName = URLEncoder.encode("出口查验导入模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
workbook.write(bos);
byte[] bArray = bos.toByteArray();
InputStream is = new ByteArrayInputStream(bArray);
IOUtils.copy(is, out);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@ApiOperation("出口查验导入")
@PostMapping("/inspect/import-to-add")
public Result<List<JSONObject>> exportInPlanUpload(
@ApiParam(name = "操作方式, 0为前端1为审核端") @RequestParam(required = false, defaultValue = "0") String type,
MultipartFile file) {
// 所有读取的数据
List<InspectExcel> dataList = new ArrayList<>();
// 有错误的数据
List<JSONObject> errorDataList = new ArrayList<>();
// 验证通过的数据
List<JSONObject> successDataList = new ArrayList<>();
Map<String, CustomerExportInspect> headMap = new HashMap<>();
Map<String, List<CustomerExportInspectCargo>> detailMap = new HashMap<>();
try {
EasyExcel.read(file.getInputStream(), InspectExcel.class, new ReadExcelListener<InspectExcel>() {
@Override
protected void saveData(List<InspectExcel> list) { // 保存数据
dataList.addAll(list);
}
}).sheet().doRead();
ValidatorFactory vf = Validation.buildDefaultValidatorFactory();
Validator validator = vf.getValidator();
List<InspectExcel> validData = new ArrayList<>();
// 需要保存的数据
List<InspectExcel> saveData = new ArrayList<>();
// 数据验证
dataList.stream().forEach(item -> {
Set<ConstraintViolation<InspectExcel>> set = validator.validate(item);
if (CollectionUtils.isEmpty(set)) { // 验证通过的
validData.add(item);
} else { // 验证失败的
JSONObject o = JSONObject.from(item);
o.put("status", set.stream().map(p -> p.getMessage()).collect(Collectors.joining(",")));
errorDataList.add(o);
}
});
if (CollectionUtils.isEmpty(validData)) { // 数据完整性检验
if (CollectionUtils.isEmpty(errorDataList)) { // 代表没有读取到数据
JSONObject o = new JSONObject();
o.put("status", "未读取到数据");
errorDataList.add(o);
}
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
// 获取用户绑定的货代
List<FreightVo> userBindFreight = openApi.getUserBindFreight();
// 港区基础数据
List<DictDTO> portAreaList = dictHandler.getPortAreaList(null).getData();
// 航次不能为空
validData.stream().forEach(item -> {
if (portAreaList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getPortArea())).count() == 0) {
JSONObject o = JSONObject.from(item);
o.put("status", "港区不存在");
errorDataList.add(o);
return;
}
saveData.add(item);
});
// 首先按对船名般次提单进行分组
Map<String, List<InspectExcel>> inMap = saveData.stream()
.collect(Collectors.groupingBy(item -> StringUtils.joinWith("#$#", item.getShipName(), StringUtils.isEmpty(item.getVoyage()) ? " " : item.getVoyage(), item.getBillNo()), Collectors.toList()));
inMap.entrySet().forEach(item -> {
String[] keys = StringUtils.split(item.getKey(), "#$#");
String shipName = keys[0]; // 船名
String voyageName = keys[1]; // 航次
String billNo = keys[2]; // 提单号
// 判断船名是否在进港计划中
List<CustomerExportIn> list = exportInService.lambdaQuery().eq(CustomerExportIn::getShipName, shipName)
.ne(CustomerExportIn::getCheckStatus, AuditEnum.AUDIT_REJECT)
.last("limit 1").list();
if (CollectionUtils.isEmpty(list)) {
errorDataList.addAll(item.getValue().stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "查验申请中的船名不存在");
return o;
}).collect(Collectors.toList()));
return;
}
// 如果航次不为空
if (StringUtils.isNotBlank(voyageName)) {
list = exportInService.lambdaQuery().eq(CustomerExportIn::getShipName, shipName)
.eq(CustomerExportIn::getVoyage, voyageName)
.ne(CustomerExportIn::getCheckStatus, AuditEnum.AUDIT_REJECT)
.last("limit 1").list();
if (CollectionUtils.isEmpty(list)) {
errorDataList.addAll(item.getValue().stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "查验申请中的航次不存在");
return o;
}).collect(Collectors.toList()));
return;
}
}
// 判断提单号
list = exportInService.lambdaQuery().eq(CustomerExportIn::getShipName, shipName)
.eq(StringUtils.isNotEmpty(voyageName), CustomerExportIn::getVoyage, voyageName)
.eq(CustomerExportIn::getBillNum, billNo)
.ne(CustomerExportIn::getCheckStatus, AuditEnum.AUDIT_REJECT)
.last("limit 1").list();
if (CollectionUtils.isEmpty(list)) {
errorDataList.addAll(item.getValue().stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", StringUtils.isNotEmpty(voyageName) ? "该船名航次下的提单号不存在" : "该船名下的提单号不存在");
return o;
}).collect(Collectors.toList()));
return;
}
CustomerExportIn in = list.get(0);
// 提单对应的货代与登录账号是否一致
Long id = in.getId();
String freightId = in.getFreightId();
if (CollectionUtils.isEmpty(userBindFreight) || userBindFreight.stream().filter(s -> StringUtils.equals(freightId, s.getCueId())).count() == 0) {
errorDataList.addAll(item.getValue().stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "提单号的货代与登录账号不一致");
return o;
}).collect(Collectors.toList()));
return;
}
// 车架号是否在该提单下
Map<String, InspectExcel> vins = item.getValue().stream().collect(Collectors.toMap(InspectExcel::getVin, s -> s));
List<CustomerExportInCargo> exists = exportInCargoService.lambdaQuery().eq(CustomerExportInCargo::getExportInId, id)
.in(CustomerExportInCargo::getVin, vins.keySet()).list();
List<String> existsVins = exists.stream().map(s -> s.getVin()).collect(Collectors.toList());
List<String> collect = vins.keySet().stream().filter(s -> !existsVins.contains(s)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
collect.stream().forEach(s -> {
JSONObject o = JSONObject.from(vins.get(s));
o.put("status", "提单号不存在此车架号");
errorDataList.add(o);
});
return;
}
// 港区是否一致
long count = item.getValue().stream().map(s -> s.getPortArea()).collect(Collectors.toList())
.stream().filter(s -> !StringUtils.equals(s, in.getPortArea())).count();
if (count > 0) {
errorDataList.addAll(item.getValue().stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "港区不一致");
return o;
}).collect(Collectors.toList()));
return;
}
CustomerExportInspect head = PoMapper.instance.excel2Entity(item.getValue().get(0));
String batchNo = customerService.getSequenceNo("inspect_in_batch_no", "出口查验", "CI");
head.setInspectStatus(InspectStatusEnum.NO_INSPECT);
head.setBatchNo(batchNo);
head.setApplicantId(UserContext.getUser().getUserId());
head.setTradType("E");
head.setPortAreaId(in.getPortAreaId());
head.setCheckStatus(StringUtils.equals(type, "1") ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
head.setTermcd(head.getPortAreaId());
head.setApplyTime(new Date());
head.setShipId(in.getShipId());
head.setShipEnName(in.getShipEnName());
if (StringUtils.isNotEmpty(head.getVoyage())) {
head.setVoyageId(in.getVoyageId());
}
head.setApplyObjId(in.getFreightId());
head.setApplyObj(in.getFreight());
if (StringUtils.isEmpty(head.getCompany())) {
head.setCompany(head.getApplyObj());
}
List<CustomerExportInspectCargo> detail = item.getValue().stream().map(s -> {
CustomerExportInspectCargo c = new CustomerExportInspectCargo();
c.setCargoType(StringUtils.startsWith(s.getVin(), "BJ") ? 1 : 0);
c.setBrand(in.getBrand());
c.setBrandId(in.getBrandId());
c.setCartTypeId(in.getCartTypeId());
c.setCartType(in.getCartType());
c.setModels(in.getModels());
c.setVin(s.getVin());
return c;
}).collect(Collectors.toList());
head.setPlannedCargoQuantity((int)detail.stream().filter( s -> s.getCargoType() == 0).count());
head.setPlannedSpareQuantity(detail.size() - head.getPlannedCargoQuantity());
headMap.put(item.getKey(), head);
detailMap.put(item.getKey(), detail);
});
if (CollectionUtils.isNotEmpty(errorDataList)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
// 判断车辆是否在场
List<VinStatus> vinStatus = yardApi.getVinStatus(dataList.stream().map(s -> s.getVin()).collect(Collectors.toList()));
if (CollectionUtils.isEmpty(vinStatus)) {
errorDataList.addAll(dataList.stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "所有查验的车架号均不在场");
return o;
}).collect(Collectors.toList()));
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
Map<String, VinStatus> vinStatusMap = vinStatus.stream().collect(Collectors.toMap(VinStatus::getVinCode, s -> s));
// 保存对象
headMap.keySet().stream().forEach(s -> customerService.saveExportInspect(headMap.get(s), detailMap.get(s)));
successDataList.addAll(dataList.stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "成攻");
o.put("yardPos", vinStatusMap.containsKey(p.getVin()) ? vinStatusMap.get(p.getVin()).getYardPos() : "未进港");
return o;
}).collect(Collectors.toList()));
} catch (ExcelDataConvertException e) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入数据错误,请确认导入数据模板是否正确, 行:"+e.getRowIndex()+" 列:" + e.getColumnIndex());
} catch (Exception e) {
log.error("上传错误", e);
return ResultUtil.failure(ErrorType.PROGRAM_ERROR.id(), e.getMessage());
}
List<JSONObject> rst = new ArrayList<>();
rst.addAll(successDataList.stream().filter(s -> StringUtils.isNotBlank(s.getString("yardPos"))).collect(Collectors.toList()));
rst.addAll(successDataList.stream().filter(s -> StringUtils.isBlank(s.getString("yardPos"))).collect(Collectors.toList()));
return ResultUtil.success(rst);
}
@ApiOperation("验证航次是否在进港计划中")
@PostMapping("/valid/voyage")
public Result<Boolean> validVoyage(@RequestParam @NotBlank(message = "船ID不能为空") String shipId, @RequestParam @NotBlank(message = "航次ID不能为空") String voyageId) {
Long count = exportInService.lambdaQuery().eq(CustomerExportIn::getVoyageId, voyageId)
.eq(CustomerExportIn::getShipId, shipId).count();
return ResultUtil.success(count > 0);
}
@ApiOperation("提单号,货代,车架号验证")
@PostMapping("/valid/billno")
public Result<JSONObject> validBillno(@RequestBody InspectValidVo form) {
List<CustomerExportIn> list = exportInService.lambdaQuery().eq(CustomerExportIn::getShipId, form.getShipId())
.eq(CustomerExportIn::getBillNum, form.getBillNo())
.ne(CustomerExportIn::getCheckStatus, AuditEnum.AUDIT_REJECT)
.list();
if(CollectionUtil.isEmpty(list)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(),"该船名下提单号不存在");
}
// 获取用户绑定的货代
List<FreightVo> userBindFreight = openApi.getUserBindFreight();
if (CollectionUtils.isEmpty(userBindFreight) || userBindFreight.stream().filter(s -> StringUtils.equals(list.get(0).getFreightId(), s.getCueId())).count() == 0) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(),"提单号的货代与登录账号不一致");
}
if (CollectionUtils.isNotEmpty(form.getVins())) {
List<CustomerExportInCargo> cargos = exportInCargoService.lambdaQuery().in(CustomerExportInCargo::getExportInId, list.stream().map(s -> s.getId()).collect(Collectors.toList()))
.in(CustomerExportInCargo::getVin, form.getVins()).list();
List<String> collect = cargos.stream().map(s -> s.getVin()).collect(Collectors.toList());
List<String> strings = form.getVins().stream().filter(s -> !collect.contains(s)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(strings)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(),"提单号不存在此车架号," + StringUtils.join(strings, ","));
}
}
JSONObject rst = new JSONObject();
rst.put("portAreaId", list.get(0).getPortAreaId());
rst.put("portArea", list.get(0).getPortArea());
return ResultUtil.success(rst);
}
}

View File

@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
@ -12,13 +13,18 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.haitonggauto.rtosc.api.NuzarMiniApi;
import com.haitonggauto.rtosc.api.NuzarShpApi;
import com.haitonggauto.rtosc.api.dto.VoyageReq;
import com.haitonggauto.rtosc.api.dto.VoyageResp;
import com.haitonggauto.rtosc.common.context.UserContext;
import com.haitonggauto.rtosc.common.dto.DictDTO;
import com.haitonggauto.rtosc.common.dto.Result;
import com.haitonggauto.rtosc.common.enums.ErrorType;
import com.haitonggauto.rtosc.common.handler.BaseHandler;
import com.haitonggauto.rtosc.common.utils.*;
import com.haitonggauto.rtosc.dto.FreeTradeCheckVo;
import com.haitonggauto.rtosc.dto.FreeTradeVo;
import com.haitonggauto.rtosc.dto.ValidVinActivateVo;
import com.haitonggauto.rtosc.dto.VoyageSubmitVo;
import com.haitonggauto.rtosc.excel.*;
import com.haitonggauto.rtosc.handler.excel.ReadExcelListener;
@ -74,6 +80,12 @@ public class FreeTradeHandler implements BaseHandler {
@Resource
private NuzarMiniApi miniApi;
@Resource
private NuzarShpApi shpApi;
@Resource
private DictHandler dictHandler;
/**
* 分页查询
*
@ -267,19 +279,37 @@ public class FreeTradeHandler implements BaseHandler {
return ResultUtil.success("success");
}
@ApiOperation("返回车架号详情, IsActivate 为 1 代表已激活")
@PostMapping("/valid-vins-all")
public Result<List<CustomerFreeTrade>> validAllVins(@RequestBody @Validated ValidVinActivateVo vo) {
List<CustomerFreeTrade> list = customerFreeTradeService.lambdaQuery()
.eq(StringUtils.isNotEmpty(vo.getShipId()), CustomerFreeTrade::getShipId, vo.getShipId())
.eq(StringUtils.isNotEmpty(vo.getVoyageId()), CustomerFreeTrade::getVoyageId, vo.getVoyageId())
.in(CustomerFreeTrade::getVin, vo.getVins()).list();
// 返回的车架号信息
// List<String> collect = list.stream().map(item -> item.getVin()).collect(Collectors.toList());
// 待激活的车架号信息
// List<String> noActivate = list.stream().filter(item -> item.getIsActivate() == ActiveEnum.NO).map(item -> item.getVin()).collect(Collectors.toList());
// List<String> noValid = vins.stream().filter(item -> !collect.contains(item) || noActivate.contains(item)).collect(Collectors.toList());
// if (CollectionUtils.isNotEmpty(noValid)) {
// return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), StringUtils.join(noValid, ","));
// }
return ResultUtil.success(list);
}
/**
* 验证车架号状态是否激活
* @param vins
* @param vo
* @return
*/
@ApiOperation("验证车架号激活状态, 返回已激活车架号详情")
@PostMapping("/valid-vins")
public Result<List<CustomerFreeTrade>> validVins(@RequestBody
@NotNull(message = "请传入车架号列表")
@Size(min = 1, message = "车架号列表不能为空") List<String> vins) {
public Result<List<CustomerFreeTrade>> validVins(@RequestBody @Validated ValidVinActivateVo vo) {
List<CustomerFreeTrade> list = customerFreeTradeService.lambdaQuery()
.eq(StringUtils.isNotEmpty(vo.getShipId()), CustomerFreeTrade::getShipId, vo.getShipId())
.eq(StringUtils.isNotEmpty(vo.getVoyageId()), CustomerFreeTrade::getVoyageId, vo.getVoyageId())
.eq(CustomerFreeTrade::getIsActivate, ActiveEnum.YES)
.in(CustomerFreeTrade::getVin, vins).list();
.in(CustomerFreeTrade::getVin, vo.getVins()).list();
// 返回的车架号信息
// List<String> collect = list.stream().map(item -> item.getVin()).collect(Collectors.toList());
// 待激活的车架号信息
@ -333,8 +363,8 @@ public class FreeTradeHandler implements BaseHandler {
log.setOperateData(record);
log.setStatus(check.getCheckStatus() == AuditEnum.AUDIT_PASS ? 0 : 1);
log.setOperateTime(new Date());
log.setUserId(SecurityUtils.getUserId());
log.setUserName(SecurityUtils.getUserName());
log.setUserId(UserContext.getUser().getUserId());
log.setUserName(UserContext.getUser().getUsername());
EsLogApprovalUtil.writeLog(log);
}
@ -422,6 +452,12 @@ public class FreeTradeHandler implements BaseHandler {
// 验证成功的数据
List<JSONObject> successDataList = new ArrayList<>();
// 船名基础数据
List<DictDTO> shipList = dictHandler.getAllShip(null).getData();
// 航次缴存
Map<String, String> voyageMap = new HashMap<>();
try {
EasyExcel.read(file.getInputStream(), FreeTradeExcel.class, new ReadExcelListener<FreeTradeExcel>() {
@ -450,6 +486,41 @@ public class FreeTradeHandler implements BaseHandler {
// 所有数据验证都不通过
if (CollectionUtils.isEmpty(validData)) {
if (CollectionUtils.isEmpty(errorDataList)) { // 代表没有读取到数据
JSONObject o = new JSONObject();
o.put("status", "未读取到数据");
errorDataList.add(o);
}
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
validData.stream().forEach(item -> {
if (shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getShipName())).count() == 0) {
JSONObject o = JSONObject.from(item);
o.put("status", "船名不存在");
errorDataList.add(o);
return;
}
if (!voyageMap.containsKey(StringUtils.join(item.getShipName(), item.getVoyage()))) {
VoyageReq req = new VoyageReq();
req.setSpmName(item.getShipName());
req.setVvyName(item.getVoyage());
List<VoyageResp> resp = shpApi.queryVvyListByVvNameAndSpmName(Arrays.asList(req));
if (CollectionUtils.isEmpty(resp)) {
voyageMap.put(StringUtils.join(item.getShipName(), item.getVoyage()), "");
} else {
voyageMap.put(StringUtils.join(item.getShipName(), item.getVoyage()), StringUtils.trim(resp.get(0).getVvyId()));
}
}
if (StringUtils.isEmpty(voyageMap.get(StringUtils.join(item.getShipName(), item.getVoyage())))) {
JSONObject o = JSONObject.from(item);
o.put("status", "航次不存在");
errorDataList.add(o);
return;
}
});
if (CollectionUtils.isNotEmpty(errorDataList)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
@ -467,6 +538,11 @@ public class FreeTradeHandler implements BaseHandler {
List<CustomerFreeTrade> collect = validData.stream().map(item -> {
CustomerFreeTrade freeTrade = PoMapper.instance.excel2Entity(item);
freeTrade.setShipId(shipList.stream().filter(s -> StringUtils.equalsIgnoreCase(s.getText(), item.getShipName())).findFirst().get().getId());
freeTrade.setShipEnName(shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getShipName())).findFirst().get().getExtra1());
freeTrade.setVoyageId(voyageMap.get(StringUtils.join(item.getShipName(), item.getVoyage())));
freeTrade.setApplicantId(UserContext.getUser().getUserId());
freeTrade.setIsActivate(ActiveEnum.NO);
freeTrade.setApplyTime(new Date());
@ -514,6 +590,8 @@ public class FreeTradeHandler implements BaseHandler {
customerFreeTradeService.saveBatch(save);
return ResultUtil.success(errorDataList);
} catch (ExcelDataConvertException e) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入数据错误,请确认导入数据模板是否正确, 行:"+e.getRowIndex()+" 列:" + e.getColumnIndex());
} catch (Exception e) {
log.error("错误信息", e);
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), e.getMessage());

View File

@ -0,0 +1,14 @@
package com.haitonggauto.rtosc.handler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/health")
public class HeathCheckHandler {
@GetMapping("/ping")
public String ping() {
return "pong";
}
}

View File

@ -2,15 +2,20 @@ package com.haitonggauto.rtosc.handler;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.haitonggauto.rtosc.api.NuzarOpenApi;
import com.haitonggauto.rtosc.api.NuzarShpApi;
import com.haitonggauto.rtosc.api.NuzarYardApi;
import com.haitonggauto.rtosc.api.dto.*;
import com.haitonggauto.rtosc.api.dto.log.ImportInspectLog;
@ -19,12 +24,16 @@ import com.haitonggauto.rtosc.common.dto.DictDTO;
import com.haitonggauto.rtosc.common.dto.Result;
import com.haitonggauto.rtosc.common.enums.ErrorType;
import com.haitonggauto.rtosc.common.handler.BaseHandler;
import com.haitonggauto.rtosc.common.utils.DateUtils;
import com.haitonggauto.rtosc.common.utils.ResultUtil;
import com.haitonggauto.rtosc.common.utils.ValidationGroup;
import com.haitonggauto.rtosc.common.utils.WrapperKit;
import com.haitonggauto.rtosc.dto.*;
import com.haitonggauto.rtosc.excel.ExportInPlanExcel;
import com.haitonggauto.rtosc.excel.ExportInspectExportExcel;
import com.haitonggauto.rtosc.excel.ImportInspectExportExcel;
import com.haitonggauto.rtosc.excel.InspectExcel;
import com.haitonggauto.rtosc.handler.excel.ReadExcelListener;
import com.haitonggauto.rtosc.handler.mapper.PoMapper;
import com.haitonggauto.rtosc.query.CargoQuery;
import com.haitonggauto.rtosc.query.ExportInspectCheckQuery;
@ -41,18 +50,32 @@ import com.nuzar.rtops.log.service.EsLogApprovalUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.core.io.ClassPathResource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.IOException;
import java.io.OutputStream;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@ -62,6 +85,7 @@ import java.util.stream.Collectors;
@RequestMapping("/iis")
@Api(tags = "进口海关查验")
@Validated
@Slf4j
public class ImportInspectHandler implements BaseHandler {
@Resource
@ -79,6 +103,12 @@ public class ImportInspectHandler implements BaseHandler {
@Resource
private NuzarYardApi yardApi;
@Resource
private NuzarShpApi shpApi;
@Resource
private DictHandler dictHandler;
@ApiOperation("船名航次模糊匹配")
@PostMapping("/shipVoyage")
public Result<List<ShipVoyageVo>> getExportInShipNameList(
@ -178,17 +208,19 @@ public class ImportInspectHandler implements BaseHandler {
@ApiOperation("提单号模糊匹配")
@PostMapping("/billNo/query")
public Result<List<String>> getExportInBillNoList(
@ApiParam(name = "操作方式, 0为前端1为审核端") @RequestParam(required = false, defaultValue = "0") String type,
@RequestParam(required = false, defaultValue = "1") Integer current,
@RequestParam(required = false, defaultValue = "10") Integer size,
@RequestParam(required = false) String shipName,
@RequestParam(required = false) String voyage,
@RequestParam(required = false) String q) {
LambdaQueryWrapper<CustomerExportInspect> query = new LambdaQueryWrapper<>();
query.eq(CustomerExportInspect::getTradType, "I");
query.eq(StringUtils.isNotEmpty(shipName), CustomerExportInspect::getShipName, shipName);
query.eq(StringUtils.isNotEmpty(voyage), CustomerExportInspect::getVoyage, voyage);
query.like(StringUtils.isNotEmpty(q), CustomerExportInspect::getBillNo, q); // 提单号
QueryWrapper<CustomerExportInspect> query = new QueryWrapper<>();
query.select("distinct bill_no");
query.eq("trad_type", "I");
query.eq(StringUtils.equals(type, "0"), "create_by", UserContext.getUser().getUserId());
query.eq(StringUtils.isNotEmpty(shipName), "ship_name", shipName);
query.eq(StringUtils.isNotEmpty(voyage), "voyage", voyage);
query.like(StringUtils.isNotEmpty(q), "bill_no", q); // 提单号
Page<CustomerExportInspect> page = customerExportInspectService.page(new Page<>(current, size), query);
List<CustomerExportInspect> list = page.getRecords();
@ -346,6 +378,9 @@ public class ImportInspectHandler implements BaseHandler {
exportInspect.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
exportInspect.setTermcd(exportInspect.getPortAreaId());
exportInspect.setApplyTime(new Date());
if (StringUtils.isEmpty(exportInspect.getCompany())) { // 公司为空则填充申请对象
exportInspect.setCompany(exportInspect.getApplyObj());
}
List<CustomerExportInspectCargo> cargos = form.getCargos().stream().map(item -> {
CustomerExportInspectCargo entity = PoMapper.instance.exportInspectCargoVo2Entity(item);
@ -474,6 +509,28 @@ public class ImportInspectHandler implements BaseHandler {
customerService.wrapperEntity(exportInspect);
List<CustomerExportInspectCargo> cargos = customerExportInspectCargoService.list(new LambdaQueryWrapper<CustomerExportInspectCargo>().eq(CustomerExportInspectCargo::getExportInspectId, id));
// 获取实时
if (CollectionUtils.isNotEmpty(cargos)) {
GoodsStatusReq req = new GoodsStatusReq();
req.setBusinessType("INSPECT");
req.setImportExportType("I");
req.setVvyId(StringUtils.equalsAnyIgnoreCase(exportInspect.getVoyageId(), "HT6", "HTLG", "HTTC") ? "" : exportInspect.getVoyageId());
req.setVinCodeList(cargos.stream().map(p -> p.getVin()).collect(Collectors.toList()));
List<GoodsStatusResp> resp = openApi.getGoodsStatus(req);
Map<String, GoodsStatusResp> respMap = resp.stream().collect(Collectors.toMap(p -> p.getVinCode(), p -> p));
cargos.stream().forEach(p -> {
GoodsStatusResp r = respMap.get(p.getVin());
if (r != null) {
p.setArea(r.getPosition());
} else {
p.setArea("");
}
});
}
customerService.wrapperEntity(cargos);
exportInspect.setCargos(cargos);
@ -516,6 +573,35 @@ public class ImportInspectHandler implements BaseHandler {
queryWrapper.eq(query.getCargoType() != null, CustomerExportInspectCargo::getCargoType, query.getCargoType());
}
Page<CustomerExportInspectCargo> page = customerExportInspectCargoService.page(new Page<>(query.getPage(), query.getRows()), queryWrapper);
// 获取实时
if (CollectionUtils.isNotEmpty(page.getRecords())) {
// 需要按InspectId 进行分组
Map<Long, List<CustomerExportInspectCargo>> collect = page.getRecords().stream().collect(Collectors.groupingBy(CustomerExportInspectCargo::getExportInspectId));
collect.entrySet().forEach(item -> {
CustomerExportInspect inspect = customerExportInspectService.getById(item.getKey());
GoodsStatusReq req = new GoodsStatusReq();
req.setBusinessType("INSPECT");
req.setImportExportType("I");
req.setVvyId(StringUtils.equalsAnyIgnoreCase(inspect.getVoyageId(), "HT6", "HTLG", "HTTC") ? "" : inspect.getVoyageId());
req.setVinCodeList(item.getValue().stream().map(p -> p.getVin()).collect(Collectors.toList()));
List<GoodsStatusResp> resp = openApi.getGoodsStatus(req);
Map<String, GoodsStatusResp> respMap = resp.stream().collect(Collectors.toMap(p -> p.getVinCode(), p -> p));
page.getRecords().stream().filter(p -> p.getExportInspectId() == item.getKey()).forEach(p -> {
GoodsStatusResp r = respMap.get(p.getVin());
if (r != null) {
p.setArea(r.getPosition());
} else {
p.setArea("");
}
});
});
}
customerService.wrapperEntity(page.getRecords());
return ResultUtil.success(page);
}
@ -565,10 +651,11 @@ public class ImportInspectHandler implements BaseHandler {
// 判断车辆是否在场
List<VinStatus> vinStatus = yardApi.getVinStatus(vins);
List<String> exists = vinStatus.stream().map(item -> item.getVinCode()).collect(Collectors.toList());
page.getRecords().stream().forEach(item -> {
item.setInspect(collect.get(item.getExportInspectId()));
item.setInArea(vinStatus.contains(item.getVin()));
item.setInArea(exists.contains(item.getVin()));
});
}
@ -607,8 +694,8 @@ public class ImportInspectHandler implements BaseHandler {
log.setOperateData(importInspectLog);
log.setStatus(check.getCheckStatus() == AuditEnum.AUDIT_PASS ? 0 : 1);
log.setOperateTime(new Date());
log.setUserId(SecurityUtils.getUserId());
log.setUserName(SecurityUtils.getUserName());
log.setUserId(UserContext.getUser().getUserId());
log.setUserName(UserContext.getUser().getUsername());
EsLogApprovalUtil.writeLog(log);
}
@ -655,8 +742,8 @@ public class ImportInspectHandler implements BaseHandler {
log.setOperateData(record);
log.setStatus(check.getCheckStatus() == AuditEnum.AUDIT_PASS ? 0 : 1);
log.setOperateTime(new Date());
log.setUserId(SecurityUtils.getUserId());
log.setUserName(SecurityUtils.getUserName());
log.setUserId(UserContext.getUser().getUserId());
log.setUserName(UserContext.getUser().getUsername());
EsLogApprovalUtil.writeLog(log);
}
@ -756,6 +843,7 @@ public class ImportInspectHandler implements BaseHandler {
private void write(AtomicInteger index, List<CustomerExportInspect> headers, ExcelWriter excelWriter, WriteSheet writeSheet) {
if (CollectionUtils.isEmpty(headers)) {
excelWriter.write(new ArrayList<>(), writeSheet);
return;
}
@ -779,6 +867,10 @@ public class ImportInspectHandler implements BaseHandler {
// 备件号排序
List<ExportInspectExportExcel> details = list.stream().filter(p -> ids.contains(p.getExportInspectId()))
.map(s -> {
s.setCartType(StringUtils.isBlank(s.getCartType()) ? "":s.getCartType());
return s;
})
.sorted(Comparator.comparing(CustomerExportInspectCargo::getCartType).reversed())
.map(p -> {
CustomerExportInspect head = collect.get(p.getExportInspectId());
@ -791,4 +883,279 @@ public class ImportInspectHandler implements BaseHandler {
excelWriter.write(details, writeSheet);
});
}
@ApiOperation("进口查验导入模板下载")
@GetMapping("/temp/down")
public void tempDownPlan(HttpServletResponse response) throws Exception {
// 加载模板
ClassPathResource classPathResource = new ClassPathResource("templates/import_inspect_temp.xlsx");
InputStream inputStream = classPathResource.getInputStream();
XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
OutputStream out = response.getOutputStream();
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
// 这里注意 有同学反应使用swagger 会导致各种问题请直接用浏览器或者用postman
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
String fileName = URLEncoder.encode("进口查验导入模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
workbook.write(bos);
byte[] bArray = bos.toByteArray();
InputStream is = new ByteArrayInputStream(bArray);
IOUtils.copy(is, out);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@ApiOperation("进口查验导入")
@PostMapping("/inspect/import-to-add")
public Result<List<JSONObject>> exportInPlanUpload(
@ApiParam(name = "操作方式, 0为前端1为审核端") @RequestParam(required = false, defaultValue = "0") String type,
MultipartFile file) {
// 所有读取的数据
List<InspectExcel> dataList = new ArrayList<>();
// 有错误的数据
List<JSONObject> errorDataList = new ArrayList<>();
// 验证通过的数据
List<JSONObject> successDataList = new ArrayList<>();
Map<String, CustomerExportInspect> headMap = new HashMap<>();
Map<String, List<CustomerExportInspectCargo>> detailMap = new HashMap<>();
try {
EasyExcel.read(file.getInputStream(), InspectExcel.class, new ReadExcelListener<InspectExcel>() {
@Override
protected void saveData(List<InspectExcel> list) { // 保存数据
dataList.addAll(list);
}
}).sheet().doRead();
ValidatorFactory vf = Validation.buildDefaultValidatorFactory();
Validator validator = vf.getValidator();
List<InspectExcel> validData = new ArrayList<>();
// 需要保存的数据
List<InspectExcel> saveData = new ArrayList<>();
// 数据验证
dataList.stream().forEach(item -> {
Set<ConstraintViolation<InspectExcel>> set = validator.validate(item);
if (CollectionUtils.isEmpty(set)) { // 验证通过的
validData.add(item);
} else { // 验证失败的
JSONObject o = JSONObject.from(item);
o.put("status", set.stream().map(p -> p.getMessage()).collect(Collectors.joining(",")));
errorDataList.add(o);
}
});
if (CollectionUtils.isEmpty(validData)) { // 数据完整性检验
if (CollectionUtils.isEmpty(errorDataList)) { // 代表没有读取到数据
JSONObject o = new JSONObject();
o.put("status", "未读取到数据");
errorDataList.add(o);
}
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
// 获取用户绑定的货代
List<FreightVo> userBindFreight = openApi.getUserBindFreight();
// 港区基础数据
List<DictDTO> portAreaList = dictHandler.getPortAreaList(null).getData();
// 航次不能为空
validData.stream().forEach(item -> {
if (StringUtils.isEmpty(item.getVoyage())) {
JSONObject o = JSONObject.from(item);
o.put("status", "般次不能为空");
errorDataList.add(o);
return;
}
if (portAreaList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getPortArea())).count() == 0) {
JSONObject o = JSONObject.from(item);
o.put("status", "港区不存在");
errorDataList.add(o);
return;
}
saveData.add(item);
});
// 首先按对船名般次提单进行分组
Map<String, List<InspectExcel>> inMap = saveData.stream()
.collect(Collectors.groupingBy(item -> StringUtils.joinWith("#$#", item.getShipName(), item.getVoyage(), item.getBillNo()), Collectors.toList()));
inMap.entrySet().forEach(item -> {
String[] keys = StringUtils.split(item.getKey(), "#$#");
String shipName = keys[0]; // 船名
String voyageName = keys[1]; // 航次
String billNo = keys[2]; // 提单号
List<ImportInspectReq> req = item.getValue().stream().map(s -> {
ImportInspectReq r = new ImportInspectReq();
r.setSpmName(shipName);
r.setMnfBl(billNo);
r.setVinCode(s.getVin());
r.setVvyName(voyageName);
return r;
}).collect(Collectors.toList());
System.err.println(JSON.toJSONString(req));
// 调用接口进行验证
List<ImportInspectResp> resp = shpApi.unloadInfoVerify(req);
Map<String, String> stringMap = resp.stream().filter(s -> StringUtils.isNotBlank(s.getErrorMsg())).collect(Collectors.toMap(s -> s.getVinCode(), s -> s.getErrorMsg()));
if (MapUtils.isNotEmpty(stringMap)) {
errorDataList.addAll(item.getValue().stream().filter(p -> stringMap.keySet().contains(p.getVin())).map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", stringMap.get(p.getVin()));
return o;
}).collect(Collectors.toList()));
return;
}
long count1 = resp.stream().filter(s -> s.getYardGoodsDTO() == null).count();
if (count1 > 0) {
errorDataList.addAll(item.getValue().stream().filter(p -> stringMap.keySet().contains(p.getVin())).map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "接口未返回货物详细信息,参数为:" + JSONObject.toJSONString(req));
return o;
}).collect(Collectors.toList()));
return;
}
ImportInspectResp.YardGoodsDTO in = resp.get(0).getYardGoodsDTO();
// 港区是否一致
long count = item.getValue().stream().map(s -> s.getPortArea()).collect(Collectors.toList())
.stream().filter(s -> !StringUtils.equals(s, in.getPamName())).count();
if (count > 0) {
errorDataList.addAll(item.getValue().stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "港区不一致");
return o;
}).collect(Collectors.toList()));
return;
}
Map<String, ImportInspectResp> respMap = resp.stream().collect(Collectors.toMap(ImportInspectResp::getVinCode, s -> s));
List<JSONObject> tList = new ArrayList<>();
item.getValue().forEach(s -> {
String errorMsg = respMap.get(s.getVin()).getErrorMsg();
if (StringUtils.isNotEmpty(errorMsg)) {
JSONObject o = JSONObject.from(item);
o.put("status", errorMsg);
tList.add(o);
}
});
if (CollectionUtils.isNotEmpty(tList)) {
errorDataList.addAll(tList);
return;
}
CustomerExportInspect head = PoMapper.instance.excel2Entity(item.getValue().get(0));
String batchNo = customerService.getSequenceNo("inspect_in_batch_no", "出口查验", "CI");
head.setInspectStatus(InspectStatusEnum.NO_INSPECT);
head.setBatchNo(batchNo);
head.setApplicantId(UserContext.getUser().getUserId());
head.setTradType("I");
head.setPortAreaId(portAreaList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), head.getPortArea())).findFirst().get().getId());
head.setCheckStatus(StringUtils.equals(type, "1") ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
head.setTermcd(head.getPortAreaId());
head.setApplyTime(new Date());
head.setShipId(in.getSpmId());
// head.setShipEnName(in.getShipEnName());
if (StringUtils.isNotEmpty(head.getVoyage())) {
head.setVoyageId(in.getVvyId());
}
// head.setApplyObjId(in.getFreightId());
// head.setApplyObj(in.getFreight());
if (StringUtils.isEmpty(head.getCompany())) {
head.setCompany(head.getApplyObj());
}
List<CustomerExportInspectCargo> detail = item.getValue().stream().map(s -> {
CustomerExportInspectCargo c = new CustomerExportInspectCargo();
c.setCargoType(StringUtils.startsWith(s.getVin(), "BJ") ? 1 : 0);
ImportInspectResp.YardGoodsDTO ss = respMap.get(s.getVin()).getYardGoodsDTO();
c.setBrand(ss.getBrdName());
c.setBrandId(ss.getBrdId());
c.setCartTypeId(ss.getGoodsType());
c.setCartType(ss.getBvmName());
c.setModels(in.getModel());
c.setVin(s.getVin());
return c;
}).collect(Collectors.toList());
head.setPlannedCargoQuantity((int)detail.stream().filter( s -> s.getCargoType() == 0).count());
head.setPlannedSpareQuantity(detail.size() - head.getPlannedCargoQuantity());
headMap.put(item.getKey(), head);
detailMap.put(item.getKey(), detail);
});
if (CollectionUtils.isNotEmpty(errorDataList)) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
// 判断车辆是否在场
List<VinStatus> vinStatus = yardApi.getVinStatus(dataList.stream().map(s -> s.getVin()).collect(Collectors.toList()));
// if (CollectionUtils.isEmpty(vinStatus)) {
// errorDataList.addAll(dataList.stream().map(p -> {
// JSONObject o = JSONObject.from(p);
// o.put("status", "所有查验的车架号均不在场");
// return o;
// }).collect(Collectors.toList()));
// return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
// }
Map<String, VinStatus> vinStatusMap = vinStatus.stream().collect(Collectors.toMap(VinStatus::getVinCode, s -> s));
// 保存对象
headMap.keySet().stream().forEach(s -> customerService.saveExportInspect(headMap.get(s), detailMap.get(s)));
successDataList.addAll(dataList.stream().map(p -> {
JSONObject o = JSONObject.from(p);
o.put("status", "成功");
o.put("yardPos", vinStatusMap.containsKey(p.getVin()) ? vinStatusMap.get(p.getVin()).getYardPos() : "未进港");
return o;
}).collect(Collectors.toList()));
} catch (ExcelDataConvertException e) {
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入数据错误,请确认导入数据模板是否正确, 行:"+e.getRowIndex()+" 列:" + e.getColumnIndex());
} catch (Exception e) {
log.error("上传错误", e);
return ResultUtil.failure(ErrorType.PROGRAM_ERROR.id(), e.getMessage());
}
List<JSONObject> rst = new ArrayList<>();
rst.addAll(successDataList.stream().filter(s -> StringUtils.isNotBlank(s.getString("yardPos"))).collect(Collectors.toList()));
rst.addAll(successDataList.stream().filter(s -> StringUtils.isBlank(s.getString("yardPos"))).collect(Collectors.toList()));
return ResultUtil.success(rst);
}
}

View File

@ -441,6 +441,11 @@ public class ImportUnloadHandler implements BaseHandler {
});
if (CollectionUtils.isEmpty(validData)) {
if (CollectionUtils.isEmpty(errorDataList)) { // 代表没有读取到数据
JSONObject o = new JSONObject();
o.put("status", "未读取到数据");
errorDataList.add(o);
}
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}
@ -632,6 +637,11 @@ public class ImportUnloadHandler implements BaseHandler {
});
if (CollectionUtils.isEmpty(validData)) {
if (CollectionUtils.isEmpty(errorDataList)) { // 代表没有读取到数据
JSONObject o = new JSONObject();
o.put("status", "未读取到数据");
errorDataList.add(o);
}
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
}

View File

@ -74,7 +74,7 @@ public class ExcelMergeUtil implements CellWriteHandler {
// 将当前单元格数据与上一个单元格数据比较
Boolean dataBool = preData.equals(curData);
//此处需要注意获取每一行第二列数据和上一行第一列数据进行比较如果相等合并getCell里面的值是名称所在列的下标
System.err.println(cell.getRow().getCell(baseColIndex).getStringCellValue());
// System.err.println(cell.getRow().getCell(baseColIndex).getStringCellValue());
Boolean bool = cell.getRow().getCell(baseColIndex).getStringCellValue().equals(cell.getSheet().getRow(curRowIndex - 1).getCell(baseColIndex).getStringCellValue());
if (dataBool && bool) {
Sheet sheet = writeSheetHolder.getSheet();

View File

@ -5,6 +5,8 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.fastjson2.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ReflectionUtils;
import org.thymeleaf.util.StringUtils;
import java.util.List;
@ -37,10 +39,23 @@ public abstract class ReadExcelListener<T> implements ReadListener<T> {
@Override
public void invoke(T data, AnalysisContext context) {
log.info("解析到一条数据:{}", JSON.toJSONString(data));
// 去除空格的处理
ReflectionUtils.doWithFields(data.getClass(), (field) -> {
field.setAccessible(true);
// 只处理字符串类型
if (String.class.isAssignableFrom(field.getType())) {
// 属性值
String str = (String)field.get(data);
field.set(data, StringUtils.trim(str));
}
});
cachedDataList.add(data);
// 达到BATCH_COUNT了需要去存储一次数据库防止数据几万条数据在内存容易OOM
if (cachedDataList.size() >= BATCH_COUNT) {
saveData(cachedDataList);
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);

View File

@ -116,4 +116,8 @@ public interface PoMapper {
@Mapping(source = "endEnterTime", target = "inEndTm", dateFormat = "yyyy-MM-dd")
@Mapping(source = "contactPhone", target = "personTel")
OldExportInAddReq exportIn2OldExportInAddReq(CustomerExportIn exportIn);
CustomerExportInspect excel2Entity(InspectExcel excel);
ExportLoadExportExcel entity2Excel(CustomerExportLoad entity);
}

View File

@ -40,13 +40,6 @@ public class SyncToOldHandler {
XxlJobHelper.log("需要同步的数据:" + JSONObject.toJSONString(collect));
// 异步时变量会丢失
// LoginUser tmpUser = new LoginUser();
// tmpUser.setUserId(SecurityUtils.getUserId());
// tmpUser.setRoleId(0L);
// tmpUser.setAdmin(true);
//
// UserContext.setUser(tmpUser);
for (CustomerExportInSyncLog item : page.getRecords()) {
try {

View File

@ -49,7 +49,7 @@ public interface CustomerService {
* @param cargos
* @return
*/
Long saveExportLoad(CustomerExportLoad exportLoad, List<CustomerExportLoadCargo> cargos);
Long saveExportLoad(CustomerExportLoad exportLoad, List<Long> removeIds, List<CustomerExportLoadCargo> cargos);
/**
* 删除出口装船

View File

@ -3,6 +3,8 @@ package com.haitonggauto.rtosc.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.haitonggauto.rtosc.api.NuzarOpenApi;
import com.haitonggauto.rtosc.api.dto.UserInfoDto;
import com.haitonggauto.rtosc.common.context.UserContext;
import com.haitonggauto.rtosc.common.dto.LoginUser;
import com.haitonggauto.rtosc.common.utils.OkHttpUtils;
@ -20,10 +22,12 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.DateUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.support.WebApplicationContextUtils;
import javax.annotation.Resource;
import java.math.RoundingMode;
@ -94,6 +98,9 @@ public class CustomerServiceImpl implements CustomerService {
@Resource
private SyncConfig syncConfig;
@Resource
private NuzarOpenApi openApi;
@Override
@EchoResult
public <T extends EchoEntity> T wrapperEntity(T entity) {
@ -190,6 +197,8 @@ public class CustomerServiceImpl implements CustomerService {
@Override
@Transactional(rollbackFor = {Exception.class})
public Long saveExportIn(CustomerExportIn exportIn, List<CustomerExportInCargo> cargos, List<CustomerExportInTimes> times, List<CustomerExportInCargo> spares) {
// 去除空格
exportIn.setBillNum(StringUtils.trim(exportIn.getBillNum()));
// 保存表头
exportInService.save(exportIn);
@ -341,7 +350,12 @@ public class CustomerServiceImpl implements CustomerService {
@Override
@Transactional(rollbackFor = {Exception.class})
public Long saveExportLoad(CustomerExportLoad exportLoad, List<CustomerExportLoadCargo> cargos) {
public Long saveExportLoad(CustomerExportLoad exportLoad, List<Long> removeIds, List<CustomerExportLoadCargo> cargos) {
if (CollectionUtils.isNotEmpty(removeIds)) {
exportLoadCargoService.lambdaUpdate().in(CustomerExportLoadCargo::getExportLoadId, removeIds).remove();
exportLoadService.lambdaUpdate().in(CustomerExportLoad::getId, removeIds).remove();
}
// 保存表头
exportLoadService.save(exportLoad);
@ -794,9 +808,12 @@ public class CustomerServiceImpl implements CustomerService {
if (!syncConfig.getSync() || CollectionUtils.isEmpty(list)) { // 没有打开同步或列表为空真直接返回
return;
}
UserInfoDto info = openApi.getUserInfo();
// 异步时变量会丢失
LoginUser tmpUser = new LoginUser();
tmpUser.setUserId(SecurityUtils.getUserId());
tmpUser.setUserId(info.getId());
tmpUser.setUsername(info.getName());
tmpUser.setRoleId(0L);
tmpUser.setAdmin(true);
@ -861,9 +878,13 @@ public class CustomerServiceImpl implements CustomerService {
if (!syncConfig.getSync() || CollectionUtils.isEmpty(list)) { // 没有打开同步或列表为空真直接返回
return;
}
UserInfoDto info = openApi.getUserInfo();
// 异步时变量会丢失
LoginUser tmpUser = new LoginUser();
tmpUser.setUserId(SecurityUtils.getUserId());
tmpUser.setUserId(info.getId());
tmpUser.setUsername(info.getName());
tmpUser.setRoleId(0L);
tmpUser.setAdmin(true);

View File

@ -16,7 +16,7 @@
# import:
# - optional:nacos:${spring.application.name}-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
server:
port: 18086
#server:
# port: 18086
# servlet:
# context-path: /move

View File

@ -43,8 +43,8 @@
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>1</maxHistory>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
<maxHistory>7</maxHistory>
<!-- <cleanHistoryOnStart>true</cleanHistoryOnStart>-->
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">

View File

@ -2,14 +2,15 @@
上海海通国际汽车码头有限公司:
基本信息 航次
受理号: 提货日期:
船名
基本信息 船名
受理号: 品牌:
航次: 提货日期
进港日期:
返回日期: 数量:
事由:
备注:
司机信息

View File

@ -1,6 +1,7 @@
package com.haitonggauto.rtosc;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.generator.SnowflakeGenerator;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson2.JSONObject;
import com.haitonggauto.rtosc.common.utils.OkHttpUtils;
@ -11,42 +12,65 @@ import org.asynchttpclient.RequestBuilder;
import org.asynchttpclient.Response;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.concurrent.ExecutionException;
public class BJNumTest {
public static void main(String[] args) {
JSONObject page = new JSONObject();
page.put("current", 1);
page.put("size", 50);
// JSONObject page = new JSONObject();
// page.put(current, 1);
// page.put(size, 50);
//
// JSONObject params = new JSONObject();
// params.put(queryPage, page);
//
// DefaultAsyncHttpClient asyncHttpClient = new DefaultAsyncHttpClient();
// try {
// String str = http://192.168.61.133/tos/yard/shutout/list;
//
// org.asynchttpclient.Request r = new RequestBuilder()
// .setUrl(str)
// .setBody(JSONObject.toJSONString(params))
// .addHeader(Content-Type, application/json)
// .build();
//
// ListenableFuture<Response> future = asyncHttpClient.executeRequest(r);
//
// org.asynchttpclient.Response resp = future.get();
//
// System.err.println(responseASYN=============+resp.getResponseBody());
//
// } catch (ExecutionException e) {
// e.printStackTrace();
// } catch (InterruptedException e) {
// e.printStackTrace();
// } finally {
// asyncHttpClient.close();
// }
JSONObject params = new JSONObject();
params.put("queryPage", page);
// Map<String, String> map = new HashMap<>();
//
// map.put(MV.ETERNAL LIGHT, ceshi);
//
// System.err.println(map.get(MV.ETERNAL LIGHT));
DefaultAsyncHttpClient asyncHttpClient = new DefaultAsyncHttpClient();
try {
String str = "http://192.168.61.133/tos/yard/shutout/list";
SnowflakeGenerator generator = new SnowflakeGenerator();
org.asynchttpclient.Request r = new RequestBuilder()
.setUrl(str)
.setBody(JSONObject.toJSONString(params))
.addHeader("Content-Type", "application/json")
.build();
// for (int j = 0; j < 5; j++) {
// new Runnable() {
// @Override
// public void run() {
// for (int i = 0; i < 500; i++) {
// System.err.println(generator.next());
// }
// }
// }.run();
// }
ListenableFuture<Response> future = asyncHttpClient.executeRequest(r);
List<String> vins = new ArrayList<>(5);
System.err.println(vins.size());
org.asynchttpclient.Response resp = future.get();
System.err.println(StringUtils.isNotBlank(" "));
System.err.println("responseASYN============="+resp.getResponseBody());
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
asyncHttpClient.close();
}
}
}

View File

@ -2,6 +2,7 @@ package com.haitonggauto.rtosc.repository.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.haitonggauto.rtosc.common.db.entity.BaseEntity;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import com.nuzar.cloud.annotation.echo.Echo;
@ -131,13 +132,29 @@ public class CustomerDeparture extends BaseEntity implements Serializable {
/**
* 进港日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField(value = "arrival_time")
@ApiModelProperty(value = "进港日期")
private Date arrivalTime;
/**
* 品牌ID
*/
@TableField(value = "brand_id")
@ApiModelProperty(value = "品牌ID")
private String brandId;
/**
* 品牌
*/
@TableField(value = "brand")
@ApiModelProperty(value = "品牌")
private String brand;
/**
* 提货日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField(value = "delivery_time")
@ApiModelProperty(value = "提货日期")
private Date deliveryTime;
@ -145,6 +162,7 @@ public class CustomerDeparture extends BaseEntity implements Serializable {
/**
* 返回日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField(value = "return_time")
@ApiModelProperty(value = "返回日期")
private Date returnTime;
@ -214,10 +232,22 @@ public class CustomerDeparture extends BaseEntity implements Serializable {
@ApiModelProperty(value = "备注")
private String remark;
@TableField(exist = false)
@ApiModelProperty(value = "数量(计划中,备件数和车辆数之)")
@TableField(value = "quantity")
@ApiModelProperty(value = "数量(计划中,备件数和车辆数之)")
private Integer quantity;
@TableField(value = "car_quantity")
@ApiModelProperty(value = "车辆数")
private Integer carQuantity;
@TableField(value = "spare_quantity")
@ApiModelProperty(value = "备件数")
private Integer spareQuantity;
@TableField(value = "work_status")
@ApiModelProperty(value = "工作过程")
private String workStatus;
/**
* 事由
*/

View File

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 提离港区货物表
@ -24,13 +25,6 @@ public class CustomerDepartureCargo extends BaseEntity implements Serializable {
@ApiModelProperty(hidden = true)
private Long departureId;
/**
* 货物类型ID,0代表车辆1代表备件
*/
@TableField(value = "cargo_type")
@ApiModelProperty(hidden = true)
private String cargoType;
/**
* 提单号
*/
@ -38,20 +32,6 @@ public class CustomerDepartureCargo extends BaseEntity implements Serializable {
@ApiModelProperty(value = "提单号")
private String billNo;
/**
* 品牌ID
*/
@TableField(value = "brand_id")
@ApiModelProperty(value = "品牌ID")
private String brandId;
/**
* 品牌
*/
@TableField(value = "brand")
@ApiModelProperty(value = "品牌")
private String brand;
/**
* 车架号/条码
*/
@ -59,12 +39,10 @@ public class CustomerDepartureCargo extends BaseEntity implements Serializable {
@TableField(value = "vin")
private String vin;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
@TableField(value = "quantity")
private Integer quantity;
// 是否报关
@ApiModelProperty(value = "是否报关")
@TableField(value = "is_customs")
private Integer isCustoms;
/**
* 是否退关
@ -73,6 +51,11 @@ public class CustomerDepartureCargo extends BaseEntity implements Serializable {
@TableField(value = "is_shutout")
private Integer isShutout;
// 是否随车备件
@ApiModelProperty(value = "是否随车备件")
@TableField(value = "is_spare")
private Integer isSpare;
/**
* 车辆状态
*/
@ -80,6 +63,57 @@ public class CustomerDepartureCargo extends BaseEntity implements Serializable {
@ApiModelProperty(value = "车辆状态")
private String vinStatus;
/**
* 车型ID
*/
@TableField(value = "cart_type_id")
@ApiModelProperty(value = "车型ID")
private String cartTypeId;
/**
* 车型
*/
@TableField(value = "cart_type")
@ApiModelProperty(value = "车型")
private String cartType;
// 型号
@TableField(value = "models")
@ApiModelProperty(value = "型号")
private String models;
/**
*
*/
@TableField(value = "length")
@ApiModelProperty(value = "")
private BigDecimal length;
/**
*
*/
@TableField(value = "width")
@ApiModelProperty(value = "")
private BigDecimal width;
/**
*
*/
@TableField(value = "height")
@ApiModelProperty(value = "")
private BigDecimal height;
/**
* 重量()
*/
@TableField(value = "weight")
@ApiModelProperty(value = "重量")
private BigDecimal weight;
@TableField(exist = false)
@ApiModelProperty(value = "进港时间")
private String carPickTime;
@TableField(exist = false)
@ApiModelProperty(hidden = true)
private static final long serialVersionUID = 1L;

View File

@ -192,6 +192,14 @@ public class CustomerExportIn extends BaseEntity implements Serializable {
@ApiModelProperty(value = "运输方式")
private String transportWay;
@TableField(value = "pre_arrival_time")
@ApiModelProperty(value = "预进港时间")
private Date preArrivalTime;
@TableField(value = "plan_arrive_port_time")
@ApiModelProperty(value = "预靠泊时间")
private Date planArrivePortTime;
/**
* 进场开始时间
*/
@ -451,6 +459,10 @@ public class CustomerExportIn extends BaseEntity implements Serializable {
@ApiModelProperty(value = "是否装船确认")
private Integer loadShipFlag = 0;
@TableField(value = "unberth_flag")
@ApiModelProperty(value = "是否离泊确认")
private Integer unberthFlag = 0;
@TableField(exist = false)
@ApiModelProperty(value = "进场日期", hidden = true)
private Date tmpEnterDate;

View File

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 出口进场货物表
@ -82,6 +83,14 @@ public class CustomerExportInCargo extends BaseEntity implements Serializable {
@ApiModelProperty(value = "航次")
private String voyage;
@TableField(exist = false)
@ApiModelProperty(value = "港口ID")
private String portId;
@TableField(exist = false)
@ApiModelProperty(value = "港口名称")
private String portName;
@TableField(exist = false)
@ApiModelProperty(value = "型号")
private String models;
@ -112,6 +121,34 @@ public class CustomerExportInCargo extends BaseEntity implements Serializable {
@ApiModelProperty(value = "车架号")
private String vin;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "")
private BigDecimal length;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "")
private BigDecimal width;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "")
private BigDecimal height;
/**
* 重量()
*/
@TableField(exist = false)
@ApiModelProperty(value = "重量")
private BigDecimal weight;
@TableField(exist = false)
@ApiModelProperty(value = "进港记录")
private CustomerExportIn exportIn;

View File

@ -3,7 +3,6 @@ package com.haitonggauto.rtosc.repository.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.haitonggauto.rtosc.common.db.entity.BaseEntity;
import com.haitonggauto.rtosc.common.dto.DictDTO;
import com.haitonggauto.rtosc.repository.enums.AuditEnum;
import com.haitonggauto.rtosc.repository.enums.InspectStatusEnum;
import com.nuzar.cloud.annotation.echo.Echo;

View File

@ -47,6 +47,43 @@ public class CustomerFreeTrade extends BaseEntity implements Serializable {
@ApiModelProperty(value = "港区")
private String portArea;
/**
* 船名
*/
@TableField(value = "ship_id")
@ApiModelProperty(value = "船ID")
private String shipId;
/**
* 中文船名
*/
@TableField(value = "ship_name")
@ApiModelProperty(value = "中文船名")
@EsLogMean(name = "船名", title = true)
private String shipName;
/**
* 英文船名
*/
@TableField(value = "ship_en_name")
@ApiModelProperty(value = "英文船名")
private String shipEnName;
/**
* 航次ID
*/
@TableField(value = "voyage_id")
@ApiModelProperty(value = "航次ID")
private String voyageId;
/**
* 航次
*/
@TableField(value = "voyage")
@ApiModelProperty(value = "航次")
@EsLogMean(name = "航次", title = true)
private String voyage;
/**
* 企业编码
*/

View File

@ -19,7 +19,7 @@ public interface CustomerExportInMapper extends BaseMapper<CustomerExportIn> {
* @param voyageId
* @return
*/
List<CustomerExportIn> getListByVoyageId(@Param("voyageId") String voyageId, @Param("status") AuditEnum status);
List<CustomerExportIn> getListByVoyageId(@Param("shipId") String shipId, @Param("voyageId") String voyageId, @Param("billNos") List<String> billNos, @Param("status") AuditEnum status);
List<CustomerExportIn> getExportList(@Param("ids")List<Long> ids, @Param("voyageId") String voyageId);
}

View File

@ -17,7 +17,7 @@ import java.util.List;
*/
public interface CustomerExportLoadMapper extends BaseMapper<CustomerExportLoad> {
List<CustomerExportLoad> getListByVoyageId(@Param("voyageId") String voyageId, @Param("status") AuditEnum status);
List<CustomerExportLoad> getListByVoyageId(@Param("voyageId") String voyageId, @Param("billNos") List<String> billNos, @Param("status") AuditEnum status);
Page<CustomerExportLoad> getReceiveCarShipList(@Param("page") Page<CustomerExportLoad> page, @Param("q") String q);
}

View File

@ -10,6 +10,9 @@ import java.util.List;
@Data
@ApiModel("打印查询")
public class PrintQuery implements Serializable {
@ApiModelProperty("船ID")
private String shipId;
@ApiModelProperty("航次ID")
private String voyageId;
@ -18,4 +21,7 @@ public class PrintQuery implements Serializable {
@ApiModelProperty("货物ID列表")
private List<Long> id;
@ApiModelProperty("0代表车辆1代表备件空代表所有")
private String flag;
}

View File

@ -18,7 +18,7 @@ public interface CustomerExportInService extends IService<CustomerExportIn> {
* @param voyageId
* @return
*/
List<CustomerExportIn> getListByVoyageId(String voyageId, AuditEnum status);
List<CustomerExportIn> getListByVoyageId(String shipId, String voyageId, List<String> billNos, AuditEnum status);
/**
* 数据导出

View File

@ -18,7 +18,7 @@ public interface CustomerExportLoadService extends IService<CustomerExportLoad>
* @param voyageId
* @return
*/
List<CustomerExportLoad> getListByVoyageId(String voyageId, AuditEnum status);
List<CustomerExportLoad> getListByVoyageId(String voyageId, List<String> billNos, AuditEnum status);
/**
* 收车凭证 进港申请审核通过装船申请审核通过

View File

@ -20,8 +20,8 @@ public class CustomerExportInServiceImpl extends ServiceImpl<CustomerExportInMap
implements CustomerExportInService{
@Override
public List<CustomerExportIn> getListByVoyageId(String voyageId, AuditEnum status) {
return getBaseMapper().getListByVoyageId(voyageId, status);
public List<CustomerExportIn> getListByVoyageId(String shipId, String voyageId, List<String> billNos, AuditEnum status) {
return getBaseMapper().getListByVoyageId(shipId, voyageId, billNos, status);
}
@Override

View File

@ -20,8 +20,8 @@ public class CustomerExportLoadServiceImpl extends ServiceImpl<CustomerExportLoa
implements CustomerExportLoadService{
@Override
public List<CustomerExportLoad> getListByVoyageId(String voyageId, AuditEnum status) {
return getBaseMapper().getListByVoyageId(voyageId, status);
public List<CustomerExportLoad> getListByVoyageId(String voyageId, List<String> billNos, AuditEnum status) {
return getBaseMapper().getListByVoyageId(voyageId, billNos, status);
}
@Override

View File

@ -4,31 +4,31 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.haitonggauto.rtosc.repository.mapper.CustomerDepartureCargoMapper">
<resultMap id="BaseResultMap" type="com.haitonggauto.rtosc.repository.entity.CustomerDepartureCargo">
<result property="id" column="id" jdbcType="BIGINT"/>
<result property="departureId" column="departure_id" jdbcType="BIGINT"/>
<result property="billNo" column="bill_no" jdbcType="VARCHAR"/>
<result property="brand" column="brand" jdbcType="VARCHAR"/>
<result property="cargoType" column="cargo_type" jdbcType="VARCHAR"/>
<result property="vin" column="vin" jdbcType="VARCHAR"/>
<result property="quantity" column="quantity" jdbcType="NUMERIC"/>
<result property="isShutout" column="is_shutout" jdbcType="SMALLINT"/>
<result property="isDel" column="is_del" jdbcType="SMALLINT"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
<result property="version" column="version" jdbcType="NUMERIC"/>
<result property="termcd" column="termcd" jdbcType="VARCHAR"/>
<result property="brandId" column="brand_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- <resultMap id="BaseResultMap" type="com.haitonggauto.rtosc.repository.entity.CustomerDepartureCargo">-->
<!-- <result property="id" column="id" jdbcType="BIGINT"/>-->
<!-- <result property="departureId" column="departure_id" jdbcType="BIGINT"/>-->
<!-- <result property="billNo" column="bill_no" jdbcType="VARCHAR"/>-->
<!-- <result property="brand" column="brand" jdbcType="VARCHAR"/>-->
<!-- <result property="cargoType" column="cargo_type" jdbcType="VARCHAR"/>-->
<!-- <result property="vin" column="vin" jdbcType="VARCHAR"/>-->
<!-- <result property="quantity" column="quantity" jdbcType="NUMERIC"/>-->
<!-- <result property="isShutout" column="is_shutout" jdbcType="SMALLINT"/>-->
<!-- <result property="isDel" column="is_del" jdbcType="SMALLINT"/>-->
<!-- <result property="createBy" column="create_by" jdbcType="VARCHAR"/>-->
<!-- <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>-->
<!-- <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>-->
<!-- <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>-->
<!-- <result property="version" column="version" jdbcType="NUMERIC"/>-->
<!-- <result property="termcd" column="termcd" jdbcType="VARCHAR"/>-->
<!-- <result property="brandId" column="brand_id" jdbcType="VARCHAR"/>-->
<!-- </resultMap>-->
<sql id="Base_Column_List">
id,departure_id,bill_no,
brand,cargo_type,vin,
quantity,is_shutout,is_del,
create_by,create_date,update_by,
update_date,version,termcd,
brand_id
</sql>
<!-- <sql id="Base_Column_List">-->
<!-- id,departure_id,bill_no,-->
<!-- brand,cargo_type,vin,-->
<!-- quantity,is_shutout,is_del,-->
<!-- create_by,create_date,update_by,-->
<!-- update_date,version,termcd,-->
<!-- brand_id-->
<!-- </sql>-->
</mapper>

View File

@ -104,6 +104,9 @@
<select id="getListByVoyageId" resultMap="CMap">
select * from customer_export_in_cargo left join customer_export_in on customer_export_in.id=customer_export_in_cargo.export_in_id
where customer_export_in.check_status=2 and customer_export_in_cargo.is_del=0
<if test="shipId != null and shipId != ''">
and customer_export_in.ship_id=#{shipId}
</if>
<if test="voyageId != null and voyageId != ''">
and customer_export_in.voyage_id=#{voyageId}
</if>

View File

@ -117,6 +117,7 @@
<result property="freight" column="freight" jdbcType="VARCHAR"/>
<result property="enterQuantity" column="enter_quantity" jdbcType="NUMERIC"/>
<result property="termcd" column="termcd" jdbcType="VARCHAR"/>
<result property="preArrivalTime" column="pre_arrival_time" jdbcType="TIMESTAMP"/>
<result property="beginEnterTime" column="begin_enter_time" jdbcType="TIMESTAMP"/>
<result property="endEnterTime" column="end_enter_time" jdbcType="TIMESTAMP"/>
<result property="shipId" column="ship_id" jdbcType="VARCHAR"/>
@ -178,7 +179,12 @@
<select id="getListByVoyageId" resultMap="CMap">
select customer_export_in.*, customer_export_in.id as m_id,
customer_export_in_cargo.id as vin_id, export_in_id,
vin,cargo_type, work_status from customer_export_in left join customer_export_in_cargo on customer_export_in.id=customer_export_in_cargo.export_in_id where customer_export_in.is_del = 0 and (customer_export_in_cargo.is_del = 0 and customer_export_in_cargo.vin_status=1 or customer_export_in_cargo.is_del is null) and customer_export_in.voyage_id=#{voyageId} and customer_export_in.check_status=#{status}
vin,cargo_type, work_status from customer_export_in left join customer_export_in_cargo on customer_export_in.id=customer_export_in_cargo.export_in_id where customer_export_in.is_del = 0 and (customer_export_in_cargo.is_del = 0 and customer_export_in_cargo.vin_status=1 or customer_export_in_cargo.is_del is null)
and customer_export_in.ship_id=#{shipId} and customer_export_in.voyage_id=#{voyageId} and customer_export_in.check_status=#{status}
<if test="billNos != null and billNos.size() > 0">
and customer_export_in.bill_num in
<foreach collection="billNos" item="billNo" open="(" close=")" separator=",">#{billNo}</foreach>
</if>
</select>
<select id="getExportList" resultMap="CMap">
select customer_export_in.*, customer_export_in.id as m_id,

Some files were not shown because too many files have changed in this diff Show More