1、调整币种汇率模块

2、新增保险记录模块
3、新增违章记录模块
4、新增换胎记录模块
5、新增事故记录模块
6、新增年检记录模块
7、新增里程记录模块
8、新增变更记录模块
9、新增油电记录模块
10、新增ETC记录模块
11、新增其他费用记录模块
This commit is contained in:
2026-07-17 15:32:00 +08:00
parent 34ee6e6269
commit 31c68a857a
197 changed files with 16907 additions and 115 deletions

View File

@@ -197,7 +197,14 @@ Entity 基类的选择**直接决定** Service 和 ServiceImpl 的继承方式
- 分页统一使用 `Condition.getPage(query)` + `Condition.getQueryWrapper()` - 分页统一使用 `Condition.getPage(query)` + `Condition.getQueryWrapper()`
- 禁止 JDBC 直连查询 - 禁止 JDBC 直连查询
### 6.9 日志 ### 6.9 审计字段展示
- `create_user``update_user` 等审计字段只保存用户 ID禁止为了展示姓名改变表结构或覆盖审计 ID。
- 面向前端的 VO 应额外提供 `createUserName``updateUserName` 等展示字段,并使用 `@TableField(exist = false)` 标记。
- Entity → VO 转换统一在 `XxxWrapper` 中完成;审计人姓名通过 `UserCache.getUserRealName(userId)` 获取,优先返回用户真实姓名,缓存未命中时兜底返回用户 ID。
- Controller 不应在列表、详情方法中重复编写审计人翻译逻辑,避免各模块显示规则不一致。
### 6.10 日志
- 使用 `@Slf4j`,占位符传参(禁止字符串拼接) - 使用 `@Slf4j`,占位符传参(禁止字符串拼接)
- 包含关键业务标识,异常必须携带堆栈,禁止打印敏感信息 - 包含关键业务标识,异常必须携带堆栈,禁止打印敏感信息

View File

@@ -0,0 +1,79 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.auth.endpoint;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import lombok.AllArgsConstructor;
import org.springblade.core.oauth2.endpoint.OAuth2TokenEndPoint;
import org.springblade.core.oauth2.provider.OAuth2Response;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* IAM统一身份认证端点
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@RequestMapping("/iam/sso")
@Tag(name = "IAM统一身份认证", description = "IAM统一身份认证端点")
public class IamSsoEndpoint {
private static final String GRANT_TYPE = "iam_sso";
private final OAuth2TokenEndPoint tokenEndPoint;
/**
* IAM统一身份认证登录
*
* @param request 请求信息
* @return token
*/
@PostMapping("/token")
@Operation(summary = "IAM统一身份认证登录", description = "使用IAM授权码换取本系统Token")
public ResponseEntity<Kv> token(HttpServletRequest request) {
String grantType = request.getParameter("grant_type");
if (!StringUtil.equals(GRANT_TYPE, grantType)) {
return ResponseEntity.ok(
OAuth2Response.create().ofFailure(400, "IAM统一身份认证接口仅支持iam_sso授权类型")
);
}
if (StringUtil.isBlank(request.getParameter("code"))) {
return ResponseEntity.ok(
OAuth2Response.create().ofFailure(400, "IAM统一身份认证授权码不能为空")
);
}
return tokenEndPoint.token();
}
}

View File

@@ -81,6 +81,7 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
private static final String GRANT_TYPE = "iam_sso"; private static final String GRANT_TYPE = "iam_sso";
private static final String IAM_GRANT_TYPE = "authorization_code"; private static final String IAM_GRANT_TYPE = "authorization_code";
private static final String IAM_TOKEN_URI = "/iam/sso/token";
private static final String BEARER_PREFIX = "Bearer "; private static final String BEARER_PREFIX = "Bearer ";
private static final String BASIC_PREFIX = "Basic "; private static final String BASIC_PREFIX = "Basic ";
@@ -123,6 +124,9 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
@Override @Override
public OAuth2User user(OAuth2Request request) { public OAuth2User user(OAuth2Request request) {
if (!isDedicatedIamEndpoint(request)) {
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
}
if (!isIamRequest(request, true)) { if (!isIamRequest(request, true)) {
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT); throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
} }
@@ -196,6 +200,11 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
return isIamRequest(request, false); return isIamRequest(request, false);
} }
private boolean isDedicatedIamEndpoint(OAuth2Request request) {
return request.getHttpRequest() != null
&& request.getHttpRequest().getRequestURI().endsWith(IAM_TOKEN_URI);
}
private boolean isIamRequest(OAuth2Request request, boolean logMiss) { private boolean isIamRequest(OAuth2Request request, boolean logMiss) {
String redirectUri = normalizeRedirectUri(request.getRedirectUri()); String redirectUri = normalizeRedirectUri(request.getRedirectUri());
boolean iamRequest = StringUtil.isNotBlank(properties.getRedirectUri()) boolean iamRequest = StringUtil.isNotBlank(properties.getRedirectUri())

View File

@@ -25,6 +25,8 @@
*/ */
package org.springblade.system.pojo.entity; package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@@ -33,16 +35,17 @@ import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial; import java.io.Serial;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
/** /**
* 币种主数据实体类 * 币种汇率实体类
* *
* @author Chill * @author Chill
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("blade_currency") @TableName("blade_currency")
@Schema(description = "币种主数据") @Schema(description = "币种汇率")
public class Currency extends BaseEntity { public class Currency extends BaseEntity {
@Serial @Serial
@@ -78,6 +81,17 @@ public class Currency extends BaseEntity {
*/ */
@Schema(description = "汇率") @Schema(description = "汇率")
private BigDecimal exchangeRate; private BigDecimal exchangeRate;
/**
* 生效日期
*/
@Schema(description = "生效日期")
private LocalDate effectiveDate;
/**
* 失效日期
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@Schema(description = "失效日期")
private LocalDate expiryDate;
/** /**
* 是否本位币 * 是否本位币
*/ */

View File

@@ -52,4 +52,11 @@ public class AirportMasterVO extends AirportMaster {
@Schema(description = "导入错误信息") @Schema(description = "导入错误信息")
private String errorMessage; private String errorMessage;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
} }

View File

@@ -30,17 +30,20 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.system.pojo.entity.Currency; import org.springblade.system.pojo.entity.Currency;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial; import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
/** /**
* 币种主数据视图实体类 * 币种汇率视图实体类
* *
* @author Chill * @author Chill
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Schema(description = "币种主数据") @Schema(description = "币种汇率")
public class CurrencyVO extends Currency { public class CurrencyVO extends Currency {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -52,4 +55,39 @@ public class CurrencyVO extends Currency {
@Schema(description = "导入错误信息") @Schema(description = "导入错误信息")
private String errorMessage; private String errorMessage;
@TableField(exist = false)
@Schema(description = "业务日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate businessDate;
@TableField(exist = false)
@Schema(description = "生效日期开始")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate effectiveDateStart;
@TableField(exist = false)
@Schema(description = "生效日期结束")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate effectiveDateEnd;
@TableField(exist = false)
@Schema(description = "失效日期开始")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate expiryDateStart;
@TableField(exist = false)
@Schema(description = "失效日期结束")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate expiryDateEnd;
@TableField(exist = false)
@Schema(description = "更新时间开始")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTimeStart;
@TableField(exist = false)
@Schema(description = "更新时间结束")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTimeEnd;
} }

View File

@@ -52,4 +52,11 @@ public class PortTerminalVO extends PortTerminal {
@Schema(description = "导入错误信息") @Schema(description = "导入错误信息")
private String errorMessage; private String errorMessage;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
} }

View File

@@ -52,4 +52,11 @@ public class RailwayStationVO extends RailwayStation {
@Schema(description = "导入错误信息") @Schema(description = "导入错误信息")
private String errorMessage; private String errorMessage;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
} }

View File

@@ -0,0 +1,108 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 事故记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_accident_record")
@Schema(description = "事故记录")
public class AccidentRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 车船类型
*/
@Schema(description = "车船类型")
private String vehicleType;
/**
* 车牌号/船号
*/
@Schema(description = "车牌号/船号")
private String vehicleNo;
/**
* 事故发生日期
*/
@Schema(description = "事故发生日期")
private LocalDate accidentDate;
/**
* 事故发生地点
*/
@Schema(description = "事故发生地点")
private String accidentLocation;
/**
* 事故性质
*/
@Schema(description = "事故性质")
private String accidentNature;
/**
* 事故责任
*/
@Schema(description = "事故责任")
private String accidentResponsibility;
/**
* 直接经济损失
*/
@Schema(description = "直接经济损失")
private BigDecimal directEconomicLoss;
/**
* 保险理赔金额
*/
@Schema(description = "保险理赔金额")
private BigDecimal insuranceClaimAmount;
/**
* 事故原因及损坏情况
*/
@Schema(description = "事故原因及损坏情况")
private String accidentReasonDamage;
/**
* 附件
*/
@Schema(description = "附件")
private String attachments;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,88 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 年检记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_annual_inspection_record")
@Schema(description = "年检记录")
public class AnnualInspectionRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "车船类型")
private String vehicleType;
@Schema(description = "车牌号/船号")
private String vehicleNo;
@Schema(description = "检测评定日期")
private LocalDate inspectionAssessmentDate;
@Schema(description = "车辆技术等级")
private String vehicleTechnicalLevel;
@Schema(description = "船舶检验类型")
private String shipInspectionType;
@Schema(description = "有效期截止日")
private LocalDate validUntilDate;
@Schema(description = "客车类型及等级")
private String passengerTypeLevel;
@Schema(description = "检测评定单位")
private String inspectionUnit;
@Schema(description = "费用")
private BigDecimal fee;
@Schema(description = "评定(复核)单位")
private String assessmentUnit;
@Schema(description = "附件")
private String attachments;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,137 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 客商档案实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_customer_archive")
@Schema(description = "客商档案")
public class CustomerArchive extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "客商编号")
private String customerCode;
@Schema(description = "客商简称")
private String shortName;
@Schema(description = "客商全称")
private String fullName;
@Schema(description = "客商性质")
private String customerNature;
@Schema(description = "统一社会信用代码")
private String unifiedCreditCode;
@Schema(description = "客商类型")
private String customerType;
@Schema(description = "所属项目")
private String projectName;
@Schema(description = "注册/实际经营地址")
private String registeredAddress;
@Schema(description = "法人/负责人")
private String legalPerson;
@Schema(description = "联系电话")
private String contactPhone;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "开票税点")
private BigDecimal invoiceTaxRate;
@Schema(description = "经营范围")
private String businessScope;
@Schema(description = "营业期限类型")
private String businessTermType;
@Schema(description = "营业期限截止日")
private LocalDate businessEndDate;
@Schema(description = "注册资金(万元)")
private BigDecimal registeredCapital;
@Schema(description = "客商负责人")
private String principal;
@Schema(description = "助记码")
private String mnemonicCode;
@Schema(description = "客户等级")
private String customerLevel;
@Schema(description = "最大资金使用额度(万元)")
private BigDecimal maxCreditLimit;
@Schema(description = "申请总资金使用额度(万元)")
private BigDecimal applyCreditLimit;
@Schema(description = "备注")
private String remark;
@Schema(description = "资质附件JSON")
private String qualificationAttachments;
@Schema(description = "准入类型temporary/formal")
private String accessType;
@Schema(description = "审批状态draft/reviewing/approved/rejected")
private String approvalStatus;
@Schema(description = "当前节点")
private String currentNode;
@Schema(description = "当前处理人")
private String currentProcessor;
@Schema(description = "审核通过时间")
private LocalDateTime approvedTime;
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 客商变更记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_customer_change_record")
@Schema(description = "客商变更记录")
public class CustomerChangeRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "客商ID")
private Long customerId;
@Schema(description = "变更日期")
private LocalDateTime changeTime;
@Schema(description = "变更内容")
private String changeContent;
@Schema(description = "变更账号")
private String changeUserName;
}

View File

@@ -0,0 +1,71 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 客商联系人实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_customer_contact")
@Schema(description = "客商联系人")
public class CustomerContact extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "客商ID")
private Long customerId;
@Schema(description = "联系人姓名")
private String contactName;
@Schema(description = "联系电话")
private String contactPhone;
@Schema(description = "邮箱")
private String email;
@Schema(description = "职务")
private String positionName;
@Schema(description = "是否默认")
private Integer isDefault;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,92 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 客商评分记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_customer_credit_score")
@Schema(description = "客商评分记录")
public class CustomerCreditScore extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "客商ID")
private Long customerId;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "评分量化表ID")
private Long quantificationId;
@Schema(description = "评分日期")
private LocalDate scoreDate;
@Schema(description = "自评得分")
private BigDecimal selfScore;
@Schema(description = "复评得分")
private BigDecimal reviewScore;
@Schema(description = "最终得分")
private BigDecimal finalScore;
@Schema(description = "信用等级")
private String creditLevel;
@Schema(description = "最大资金使用额度(万元)")
private BigDecimal maxCreditLimit;
@Schema(description = "拟申请总资金使用额度(万元)")
private BigDecimal applyCreditLimit;
@Schema(description = "自评状态")
private String selfStatus;
@Schema(description = "复评状态")
private String reviewStatus;
@Schema(description = "备注")
private String remark;
@Schema(description = "证明材料JSON")
private String proofAttachments;
}

View File

@@ -0,0 +1,92 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 客商评分明细实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_customer_credit_score_detail")
@Schema(description = "客商评分明细")
public class CustomerCreditScoreDetail extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "评分记录ID")
private Long scoreId;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "评分量化表ID")
private Long quantificationId;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "评分项目ID")
private Long itemId;
@Schema(description = "评分分类编码")
private String categoryCode;
@Schema(description = "评分分类名称")
private String categoryName;
@Schema(description = "评分项目")
private String itemName;
@Schema(description = "评分标准")
private String optionDescription;
@Schema(description = "选项JSON")
private String optionsJson;
@Schema(description = "已选选项")
private String selectedOption;
@Schema(description = "得分说明")
private String scoreDescription;
@Schema(description = "自评得分")
private BigDecimal selfScore;
@Schema(description = "复评得分")
private BigDecimal reviewScore;
@Schema(description = "排序")
private Integer sort;
}

View File

@@ -0,0 +1,86 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 客商发票信息实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_customer_invoice_info")
@Schema(description = "客商发票信息")
public class CustomerInvoiceInfo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "客商ID")
private Long customerId;
@Schema(description = "受票方名称")
private String invoiceTitle;
@Schema(description = "纳税人识别号")
private String taxNo;
@Schema(description = "开户行名称")
private String bankName;
@Schema(description = "注册电话")
private String registeredPhone;
@Schema(description = "银行账号")
private String bankAccount;
@Schema(description = "注册地址")
private String registeredAddress;
@Schema(description = "邮箱")
private String email;
@Schema(description = "收件人姓名")
private String receiverName;
@Schema(description = "收件人电话")
private String receiverPhone;
@Schema(description = "收件人地址")
private String receiverAddress;
@Schema(description = "是否默认")
private Integer isDefault;
}

View File

@@ -0,0 +1,74 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 客商收款信息实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_customer_receipt_account")
@Schema(description = "客商收款信息")
public class CustomerReceiptAccount extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "客商ID")
private Long customerId;
@Schema(description = "收款方名称")
private String accountName;
@Schema(description = "开户行名称")
private String bankName;
@Schema(description = "银行账号")
private String bankAccount;
@Schema(description = "注册电话")
private String registeredPhone;
@Schema(description = "注册地址")
private String registeredAddress;
@Schema(description = "纳税人识别号")
private String taxNo;
@Schema(description = "是否默认")
private Integer isDefault;
}

View File

@@ -0,0 +1,212 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDate;
/**
* 司机管理实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_transport_driver")
@Schema(description = "司机管理")
public class Driver extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 司机姓名
*/
@Schema(description = "司机姓名")
private String driverName;
/**
* 身份证号
*/
@Schema(description = "身份证号")
private String idCardNo;
/**
* 出生年月
*/
@Schema(description = "出生年月")
private LocalDate birthday;
/**
* 性别
*/
@Schema(description = "性别")
private String gender;
/**
* 民族
*/
@Schema(description = "民族")
private String nation;
/**
* 学历
*/
@Schema(description = "学历")
private String education;
/**
* 地址区划
*/
@Schema(description = "地址区划")
private String addressRegion;
/**
* 详细地址
*/
@Schema(description = "详细地址")
private String address;
/**
* 岗位,多个使用逗号分隔
*/
@Schema(description = "岗位,多个使用逗号分隔")
private String posts;
/**
* 身份证正面照
*/
@Schema(description = "身份证正面照")
private String idCardFront;
/**
* 身份证反面照
*/
@Schema(description = "身份证反面照")
private String idCardBack;
/**
* 大头照
*/
@Schema(description = "大头照")
private String headPhoto;
/**
* 准驾车型
*/
@Schema(description = "准驾车型")
private String drivingType;
/**
* 驾驶证档案编号
*/
@Schema(description = "驾驶证档案编号")
private String drivingLicenseNo;
/**
* 驾驶证有效期起
*/
@Schema(description = "驾驶证有效期起")
private LocalDate drivingLicenseStartDate;
/**
* 驾驶证有效期止
*/
@Schema(description = "驾驶证有效期止")
private LocalDate drivingLicenseEndDate;
/**
* 驾驶证长期有效
*/
@Schema(description = "驾驶证长期有效")
private Integer drivingLicenseLongTerm;
/**
* 驾驶证主页
*/
@Schema(description = "驾驶证主页")
private String drivingLicenseFront;
/**
* 驾驶证副页
*/
@Schema(description = "驾驶证副页")
private String drivingLicenseBack;
/**
* 从业资格证类型
*/
@Schema(description = "从业资格证类型")
private String qualificationType;
/**
* 资格证号
*/
@Schema(description = "资格证号")
private String qualificationNo;
/**
* 从业资格证有效期止
*/
@Schema(description = "从业资格证有效期止")
private LocalDate qualificationEndDate;
/**
* 从业资格证长期有效
*/
@Schema(description = "从业资格证长期有效")
private Integer qualificationLongTerm;
/**
* 从业资格证封面页
*/
@Schema(description = "从业资格证封面页")
private String qualificationFront;
/**
* 从业资格证内容页
*/
@Schema(description = "从业资格证内容页")
private String qualificationBack;
/**
* 司机类型
*/
@Schema(description = "司机类型")
private String driverType;
/**
* 手机号
*/
@Schema(description = "手机号")
private String mobile;
/**
* 与联系人关系
*/
@Schema(description = "与联系人关系")
private String contactRelation;
/**
* 所属组织
*/
@Schema(description = "所属组织")
private String organizationName;
/**
* 紧急联系人姓名
*/
@Schema(description = "紧急联系人姓名")
private String emergencyContactName;
/**
* 紧急联系人手机号
*/
@Schema(description = "紧急联系人手机号")
private String emergencyContactMobile;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* ETC记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_etc_record")
@Schema(description = "ETC记录")
public class EtcRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "车牌号")
private String vehicleNo;
@Schema(description = "ETC卡号")
private String etcCardNo;
@Schema(description = "入口时间")
private LocalDateTime entryTime;
@Schema(description = "出口时间")
private LocalDateTime exitTime;
@Schema(description = "入口站")
private String entryStation;
@Schema(description = "出口站")
private String exitStation;
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "交易金额")
private BigDecimal transactionAmount;
@Schema(description = "附件")
private String attachments;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,118 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 保险记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_insurance_record")
@Schema(description = "保险记录")
public class InsuranceRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 车船类型
*/
@Schema(description = "车船类型")
private String vehicleType;
/**
* 车牌号/船号
*/
@Schema(description = "车牌号/船号")
private String vehicleNo;
/**
* 保险类型
*/
@Schema(description = "保险类型")
private String insuranceType;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/**
* 开始日期
*/
@Schema(description = "开始日期")
private LocalDate startDate;
/**
* 结束日期
*/
@Schema(description = "结束日期")
private LocalDate endDate;
/**
* 保额
*/
@Schema(description = "保额")
private BigDecimal insuredAmount;
/**
* 保费
*/
@Schema(description = "保费")
private BigDecimal premium;
/**
* 发票号
*/
@Schema(description = "发票号")
private String invoiceNo;
/**
* 开票日期
*/
@Schema(description = "开票日期")
private LocalDate invoiceDate;
/**
* OCR识别模板
*/
@Schema(description = "OCR识别模板")
private String ocrTemplate;
/**
* 保单附件
*/
@Schema(description = "保单附件")
private String policyFile;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,72 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 里程记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_mileage_record")
@Schema(description = "里程记录")
public class MileageRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "车牌号")
private String vehicleNo;
@Schema(description = "上月统计里程")
private BigDecimal previousMonthMileage;
@Schema(description = "本月统计里程")
private BigDecimal currentMonthMileage;
@Schema(description = "本月行驶里程")
private BigDecimal monthlyMileage;
@Schema(description = "累计行驶里程")
private BigDecimal totalMileage;
@Schema(description = "附件")
private String attachments;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,97 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 油电记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_oil_electric_record")
@Schema(description = "油电记录")
public class OilElectricRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "卡号")
private String cardNo;
@Schema(description = "交易时间")
private LocalDateTime transactionTime;
@Schema(description = "车船类型")
private String vehicleType;
@Schema(description = "费用类型")
private String feeType;
@Schema(description = "油品")
private String oilProduct;
@Schema(description = "车牌号/船号")
private String vehicleNo;
@Schema(description = "持卡人")
private String cardHolder;
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "数量")
private BigDecimal quantity;
@Schema(description = "单价")
private BigDecimal unitPrice;
@Schema(description = "交易金额")
private BigDecimal transactionAmount;
@Schema(description = "余额")
private BigDecimal balance;
@Schema(description = "站点")
private String station;
@Schema(description = "附件")
private String attachments;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,57 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 其他费用记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_other_expense_record")
@Schema(description = "其他费用记录")
public class OtherExpenseRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "费用日期")
private LocalDate expenseDate;
@Schema(description = "其他费用类型")
private String expenseType;
@Schema(description = "车船类型")
private String vehicleType;
@Schema(description = "车牌号/船号")
private String vehicleNo;
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "金额")
private BigDecimal amount;
@Schema(description = "附件")
private String attachments;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,98 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 换胎记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_tire_replacement_record")
@Schema(description = "换胎记录")
public class TireReplacementRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 车牌号
*/
@Schema(description = "车牌号")
private String vehicleNo;
/**
* 处理人
*/
@Schema(description = "处理人")
private String handler;
/**
* 换胎时间
*/
@Schema(description = "换胎时间")
private LocalDate replacementTime;
/**
* 轮胎品牌
*/
@Schema(description = "轮胎品牌")
private String tireBrand;
/**
* 换胎数量
*/
@Schema(description = "换胎数量")
private Integer tireQuantity;
/**
* 换胎费用
*/
@Schema(description = "换胎费用")
private BigDecimal replacementCost;
/**
* 换胎说明
*/
@Schema(description = "换胎说明")
private String replacementDescription;
/**
* 附件
*/
@Schema(description = "附件")
private String attachments;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,68 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 变更记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_transport_change_record")
@Schema(description = "变更记录")
public class TransportChangeRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "车船类型")
private String vehicleType;
@Schema(description = "车牌号/船号")
private String vehicleNo;
@Schema(description = "变更事项")
private String changeItem;
@Schema(description = "变更内容")
private String changeContent;
@Schema(description = "附件")
private String attachments;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,105 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDate;
/**
* 船舶管理实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_transport_ship")
@Schema(description = "船舶管理")
public class TransportShip extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "船舶名")
private String shipName;
@Schema(description = "船舶识别号")
private String shipIdentifierNo;
@Schema(description = "所属组织")
private String organizationName;
@Schema(description = "船检登记号")
private String shipInspectionNo;
@Schema(description = "船舶类型")
private String shipType;
@Schema(description = "国籍证有效期至")
private LocalDate nationalityCertEndDate;
@Schema(description = "国籍证长期有效")
private Integer nationalityCertLongTerm;
@Schema(description = "国籍证图片")
private String nationalityCertImage;
@Schema(description = "最低安全配员证书有效期至")
private LocalDate safeManningCertEndDate;
@Schema(description = "最低安全配员证书长期有效")
private Integer safeManningCertLongTerm;
@Schema(description = "最低安全配员证书图片")
private String safeManningCertImage;
@Schema(description = "营业运输证有效期至")
private LocalDate businessTransportCertEndDate;
@Schema(description = "营业运输证长期有效")
private Integer businessTransportCertLongTerm;
@Schema(description = "营业运输证图片")
private String businessTransportCertImage;
@Schema(description = "承租有效期至")
private LocalDate leaseEndDate;
@Schema(description = "承租长期有效")
private Integer leaseLongTerm;
@Schema(description = "承租合同图片")
private String leaseContractImage;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,197 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDate;
/**
* 车辆管理实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_transport_vehicle")
@Schema(description = "车辆管理")
public class TransportVehicle extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 所属组织
*/
@Schema(description = "所属组织")
private String organizationName;
/**
* 车牌号
*/
@Schema(description = "车牌号")
private String plateNo;
/**
* 车辆类型
*/
@Schema(description = "车辆类型")
private String vehicleType;
/**
* 外廓长度,毫米
*/
@Schema(description = "外廓长度,毫米")
private Integer outerLength;
/**
* 外廓宽度,毫米
*/
@Schema(description = "外廓宽度,毫米")
private Integer outerWidth;
/**
* 外廓高度,毫米
*/
@Schema(description = "外廓高度,毫米")
private Integer outerHeight;
/**
* 核定载质量KG
*/
@Schema(description = "核定载质量KG")
private Integer approvedLoadKg;
/**
* 准牵引总质量KG
*/
@Schema(description = "准牵引总质量KG")
private Integer tractionMassKg;
/**
* 业务关系
*/
@Schema(description = "业务关系")
private String businessRelation;
/**
* 能源类型
*/
@Schema(description = "能源类型")
private String energyType;
/**
* 强制报废日期
*/
@Schema(description = "强制报废日期")
private LocalDate compulsoryScrapDate;
/**
* 强制报废长期有效
*/
@Schema(description = "强制报废长期有效")
private Integer compulsoryScrapLongTerm;
/**
* 海关备案号
*/
@Schema(description = "海关备案号")
private String customsRecordNo;
/**
* 行驶证档案编号
*/
@Schema(description = "行驶证档案编号")
private String drivingLicenseNo;
/**
* 行驶证有效期起
*/
@Schema(description = "行驶证有效期起")
private LocalDate drivingLicenseStartDate;
/**
* 行驶证有效期止
*/
@Schema(description = "行驶证有效期止")
private LocalDate drivingLicenseEndDate;
/**
* 行驶证长期有效
*/
@Schema(description = "行驶证长期有效")
private Integer drivingLicenseLongTerm;
/**
* 行驶证图片
*/
@Schema(description = "行驶证图片")
private String drivingLicenseImage;
/**
* 道路运输证号
*/
@Schema(description = "道路运输证号")
private String roadTransportCertNo;
/**
* 道路运输证有效期起
*/
@Schema(description = "道路运输证有效期起")
private LocalDate roadTransportCertStartDate;
/**
* 道路运输证有效期止
*/
@Schema(description = "道路运输证有效期止")
private LocalDate roadTransportCertEndDate;
/**
* 道路运输证长期有效
*/
@Schema(description = "道路运输证长期有效")
private Integer roadTransportCertLongTerm;
/**
* 道路运输证图片
*/
@Schema(description = "道路运输证图片")
private String roadTransportCertImage;
/**
* 道路运输年审有效期
*/
@Schema(description = "道路运输年审有效期")
private LocalDate annualReviewEndDate;
/**
* 道路运输年审长期有效
*/
@Schema(description = "道路运输年审长期有效")
private Integer annualReviewLongTerm;
/**
* 机动车登记编号
*/
@Schema(description = "机动车登记编号")
private String registrationNo;
/**
* 机动车登记日期
*/
@Schema(description = "机动车登记日期")
private LocalDate registrationDate;
/**
* 机动车登记本图片
*/
@Schema(description = "机动车登记本图片")
private String registrationImage;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,123 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 违章记录实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_violation_record")
@Schema(description = "违章记录")
public class ViolationRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 车船类型
*/
@Schema(description = "车船类型")
private String vehicleType;
/**
* 车牌号/船号
*/
@Schema(description = "车牌号/船号")
private String vehicleNo;
/**
* 驾驶人/船长
*/
@Schema(description = "驾驶人/船长")
private String driverName;
/**
* 类型
*/
@Schema(description = "类型")
private String violationType;
/**
* 事项
*/
@Schema(description = "事项")
private String violationItem;
/**
* 违章时间
*/
@Schema(description = "违章时间")
private LocalDateTime violationTime;
/**
* 地点
*/
@Schema(description = "地点")
private String location;
/**
* 被罚金额
*/
@Schema(description = "被罚金额")
private BigDecimal fineAmount;
/**
* 被扣分数
*/
@Schema(description = "被扣分数")
private Integer deductPoints;
/**
* 被罚单位
*/
@Schema(description = "被罚单位")
private String penaltyUnit;
/**
* 处理状态
*/
@Schema(description = "处理状态")
private String processStatus;
/**
* 过程描述
*/
@Schema(description = "过程描述")
private String processDescription;
/**
* 处理结果
*/
@Schema(description = "处理结果")
private String processResult;
/**
* 附件
*/
@Schema(description = "附件")
private String attachments;
}

View File

@@ -0,0 +1,90 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.AccidentRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 事故记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "事故记录")
public class AccidentRecordVO extends AccidentRecord {
@Serial
private static final long serialVersionUID = 1L;
/**
* 事故评定开始日期
*/
@TableField(exist = false)
@Schema(description = "事故评定开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate accidentAssessmentDateStart;
/**
* 事故评定结束日期
*/
@TableField(exist = false)
@Schema(description = "事故评定结束日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate accidentAssessmentDateEnd;
/**
* 创建开始时间
*/
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
/**
* 创建结束时间
*/
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,75 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.AnnualInspectionRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 年检记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "年检记录")
public class AnnualInspectionRecordVO extends AnnualInspectionRecord {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "检测评定开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate inspectionAssessmentDateStart;
@TableField(exist = false)
@Schema(description = "检测评定结束日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate inspectionAssessmentDateEnd;
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,80 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CustomerArchive;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* 客商档案视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客商档案")
public class CustomerArchiveVO extends CustomerArchive {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "联系人")
private List<CustomerContactVO> contacts = new ArrayList<>();
@TableField(exist = false)
@Schema(description = "收款信息")
private List<CustomerReceiptAccountVO> receiptAccounts = new ArrayList<>();
@TableField(exist = false)
@Schema(description = "发票信息")
private List<CustomerInvoiceInfoVO> invoices = new ArrayList<>();
@TableField(exist = false)
@Schema(description = "评分记录")
private List<CustomerCreditScoreVO> scores = new ArrayList<>();
@TableField(exist = false)
@Schema(description = "变更记录")
private List<CustomerChangeRecordVO> changeRecords = new ArrayList<>();
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CustomerChangeRecord;
import java.io.Serial;
/**
* 客商变更记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客商变更记录")
public class CustomerChangeRecordVO extends CustomerChangeRecord {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CustomerContact;
import java.io.Serial;
/**
* 客商联系人视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客商联系人")
public class CustomerContactVO extends CustomerContact {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CustomerCreditScoreDetail;
import java.io.Serial;
/**
* 客商评分明细视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客商评分明细")
public class CustomerCreditScoreDetailVO extends CustomerCreditScoreDetail {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,52 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CustomerCreditScore;
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
/**
* 客商评分记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客商评分记录")
public class CustomerCreditScoreVO extends CustomerCreditScore {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "评分明细")
private List<CustomerCreditScoreDetailVO> details = new ArrayList<>();
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CustomerInvoiceInfo;
import java.io.Serial;
/**
* 客商发票信息视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客商发票信息")
public class CustomerInvoiceInfoVO extends CustomerInvoiceInfo {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CustomerReceiptAccount;
import java.io.Serial;
/**
* 客商收款信息视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "客商收款信息")
public class CustomerReceiptAccountVO extends CustomerReceiptAccount {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,55 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 司机证件有效期统计
*
* @author Chill
*/
@Data
@Schema(description = "司机证件有效期统计")
public class DriverExpiryStatVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "全部")
private Long total;
@Schema(description = "30天内到期")
private Long within30;
@Schema(description = "已到期")
private Long expired;
}

View File

@@ -0,0 +1,72 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.Driver;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
/**
* 司机管理视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "司机管理")
public class DriverVO extends Driver {
@Serial
private static final long serialVersionUID = 1L;
/**
* 证件有效期状态within30-30天内到期expired-已到期
*/
@TableField(exist = false)
@Schema(description = "证件有效期状态")
private String expireStatus;
/**
* 当前日期
*/
@TableField(exist = false)
@Schema(description = "当前日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate today;
/**
* 预警日期
*/
@TableField(exist = false)
@Schema(description = "预警日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate warningDate;
}

View File

@@ -0,0 +1,33 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.EtcRecord;
import java.io.Serial;
/**
* ETC记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "ETC记录")
public class EtcRecordVO extends EtcRecord {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,73 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.InsuranceRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 保险记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "保险记录")
public class InsuranceRecordVO extends InsuranceRecord {
@Serial
private static final long serialVersionUID = 1L;
/**
* 创建开始时间
*/
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
/**
* 创建结束时间
*/
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -62,4 +62,11 @@ public class MaintenancePlanVO extends MaintenancePlan {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd; private LocalDateTime createTimeEnd;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
} }

View File

@@ -62,4 +62,11 @@ public class MaintenanceRecordVO extends MaintenanceRecord {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd; private LocalDateTime createTimeEnd;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
} }

View File

@@ -0,0 +1,73 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.MileageRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 里程记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "里程记录")
public class MileageRecordVO extends MileageRecord {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "累计行驶里程开始值")
private BigDecimal totalMileageStart;
@TableField(exist = false)
@Schema(description = "累计行驶里程结束值")
private BigDecimal totalMileageEnd;
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,83 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.OilElectricRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 油电记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "油电记录")
public class OilElectricRecordVO extends OilElectricRecord {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "交易开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime transactionTimeStart;
@TableField(exist = false)
@Schema(description = "交易结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime transactionTimeEnd;
@TableField(exist = false)
@Schema(description = "消费金额开始值")
private BigDecimal transactionAmountStart;
@TableField(exist = false)
@Schema(description = "消费金额结束值")
private BigDecimal transactionAmountEnd;
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,56 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.OtherExpenseRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 其他费用记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "其他费用记录")
public class OtherExpenseRecordVO extends OtherExpenseRecord {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "费用开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate expenseDateStart;
@TableField(exist = false)
@Schema(description = "费用结束日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate expenseDateEnd;
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,73 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.TireReplacementRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 换胎记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "换胎记录")
public class TireReplacementRecordVO extends TireReplacementRecord {
@Serial
private static final long serialVersionUID = 1L;
/**
* 创建开始时间
*/
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
/**
* 创建结束时间
*/
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,64 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.TransportChangeRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 变更记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "变更记录")
public class TransportChangeRecordVO extends TransportChangeRecord {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,55 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 船舶证件有效期统计
*
* @author Chill
*/
@Data
@Schema(description = "船舶证件有效期统计")
public class TransportShipExpiryStatVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "全部")
private Long total;
@Schema(description = "30天内到期")
private Long within30;
@Schema(description = "已到期")
private Long expired;
}

View File

@@ -0,0 +1,65 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.TransportShip;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
/**
* 船舶管理视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "船舶管理")
public class TransportShipVO extends TransportShip {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "证件有效期状态")
private String expireStatus;
@TableField(exist = false)
@Schema(description = "当前日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate today;
@TableField(exist = false)
@Schema(description = "预警日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate warningDate;
}

View File

@@ -0,0 +1,55 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 车辆证件有效期统计
*
* @author Chill
*/
@Data
@Schema(description = "车辆证件有效期统计")
public class TransportVehicleExpiryStatVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "全部")
private Long total;
@Schema(description = "30天内到期")
private Long within30;
@Schema(description = "已到期")
private Long expired;
}

View File

@@ -0,0 +1,72 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.TransportVehicle;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
/**
* 车辆管理视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "车辆管理")
public class TransportVehicleVO extends TransportVehicle {
@Serial
private static final long serialVersionUID = 1L;
/**
* 证件有效期状态within30-30天内到期expired-已到期
*/
@TableField(exist = false)
@Schema(description = "证件有效期状态")
private String expireStatus;
/**
* 当前日期
*/
@TableField(exist = false)
@Schema(description = "当前日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate today;
/**
* 预警日期
*/
@TableField(exist = false)
@Schema(description = "预警日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate warningDate;
}

View File

@@ -0,0 +1,73 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ViolationRecord;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDateTime;
/**
* 违章记录视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "违章记录")
public class ViolationRecordVO extends ViolationRecord {
@Serial
private static final long serialVersionUID = 1L;
/**
* 创建开始时间
*/
@TableField(exist = false)
@Schema(description = "创建开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeStart;
/**
* 创建结束时间
*/
@TableField(exist = false)
@Schema(description = "创建结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTimeEnd;
/**
* 更新人姓名
*/
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -79,6 +79,32 @@ public class UserCache {
}); });
} }
/**
* 获取用户姓名
*
* @param userId 用户id
* @return 用户姓名
*/
public static String getUserRealName(Long userId) {
if (userId == null) {
return StringPool.EMPTY;
}
User user = getUser(userId);
if (user == null) {
return Func.toStr(userId);
}
if (StringUtil.isNotBlank(user.getRealName())) {
return user.getRealName();
}
if (StringUtil.isNotBlank(user.getName())) {
return user.getName();
}
if (StringUtil.isNotBlank(user.getAccount())) {
return user.getAccount();
}
return Func.toStr(userId);
}
/** /**
* 获取用户 * 获取用户
* *

View File

@@ -25,8 +25,9 @@
*/ */
package org.springblade.system.controller; package org.springblade.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@@ -49,6 +50,7 @@ import org.springblade.system.pojo.entity.Currency;
import org.springblade.system.pojo.vo.CurrencyVO; import org.springblade.system.pojo.vo.CurrencyVO;
import org.springblade.system.service.ICurrencyService; import org.springblade.system.service.ICurrencyService;
import org.springblade.system.wrapper.CurrencyWrapper; import org.springblade.system.wrapper.CurrencyWrapper;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -57,12 +59,12 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 币种主数据 控制器 * 币种汇率 控制器
* *
* @author Chill * @author Chill
*/ */
@@ -71,7 +73,7 @@ import java.util.Map;
@AllArgsConstructor @AllArgsConstructor
@PreAuth(menu = "currency") @PreAuth(menu = "currency")
@RequestMapping("/currency") @RequestMapping("/currency")
@Tag(name = "币种主数据", description = "币种主数据") @Tag(name = "币种汇率", description = "币种汇率")
public class CurrencyController extends BladeController { public class CurrencyController extends BladeController {
private final ICurrencyService currencyService; private final ICurrencyService currencyService;
@@ -98,11 +100,22 @@ public class CurrencyController extends BladeController {
return R.data(pages); return R.data(pages);
} }
/**
* 有效汇率查询
*/
@GetMapping("/rate")
@ApiOperationSupport(order = 3)
@Operation(summary = "有效汇率查询", description = "根据币种编码和业务日期查询有效汇率")
public R<CurrencyVO> rate(@Parameter(description = "币种编码", required = true) @RequestParam String code,
@Parameter(description = "业务日期") @DateTimeFormat(pattern = "yyyy-MM-dd") @RequestParam(required = false) LocalDate businessDate) {
return R.data(currencyService.getEffectiveRate(code, businessDate));
}
/** /**
* 新增或修改 * 新增或修改
*/ */
@PostMapping("/submit") @PostMapping("/submit")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 4)
@Operation(summary = "新增或修改", description = "传入currency") @Operation(summary = "新增或修改", description = "传入currency")
public R submit(@Valid @RequestBody Currency currency) { public R submit(@Valid @RequestBody Currency currency) {
return R.status(currencyService.submit(currency)); return R.status(currencyService.submit(currency));
@@ -112,7 +125,7 @@ public class CurrencyController extends BladeController {
* 删除 * 删除
*/ */
@PostMapping("/remove") @PostMapping("/remove")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 5)
@Operation(summary = "逻辑删除", description = "传入ids") @Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(currencyService.deleteLogic(Func.toLongList(ids))); return R.status(currencyService.deleteLogic(Func.toLongList(ids)));
@@ -122,7 +135,7 @@ public class CurrencyController extends BladeController {
* 启用或停用 * 启用或停用
*/ */
@PostMapping("/status") @PostMapping("/status")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 6)
@Operation(summary = "启用或停用", description = "传入id和status") @Operation(summary = "启用或停用", description = "传入id和status")
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id, public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
@Parameter(description = "状态", required = true) @RequestParam Integer status) { @Parameter(description = "状态", required = true) @RequestParam Integer status) {
@@ -130,11 +143,11 @@ public class CurrencyController extends BladeController {
} }
/** /**
* 导入币种主数据 * 导入币种汇率
*/ */
@PostMapping("/import-currency") @PostMapping("/import-currency")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 7)
@Operation(summary = "导入币种主数据", description = "传入excel") @Operation(summary = "导入币种汇率", description = "传入excel")
public R importCurrency(MultipartFile file) { public R importCurrency(MultipartFile file) {
CurrencyImporter currencyImporter = new CurrencyImporter(currencyService); CurrencyImporter currencyImporter = new CurrencyImporter(currencyService);
ExcelUtil.save(file, currencyImporter, CurrencyExcel.class); ExcelUtil.save(file, currencyImporter, CurrencyExcel.class);
@@ -142,30 +155,71 @@ public class CurrencyController extends BladeController {
} }
/** /**
* 导出币种主数据 * 导出币种汇率
*/ */
@GetMapping("/export-currency") @GetMapping("/export-currency")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 8)
@Operation(summary = "导出币种主数据") @Operation(summary = "导出币种汇率")
public void exportCurrency(@Parameter(hidden = true) @RequestParam Map<String, Object> currency, HttpServletResponse response) { public void exportCurrency(CurrencyVO currency,
Object ids = currency.remove("ids"); @RequestParam(required = false) String ids,
QueryWrapper<Currency> queryWrapper = Condition.getQueryWrapper(currency, Currency.class); HttpServletResponse response) {
if (Func.isNotEmpty(ids)) { List<CurrencyExcel> list = currencyService.exportCurrency(buildExportQuery(currency, ids));
queryWrapper.lambda().in(Currency::getId, Func.toLongList(ids.toString())); ExcelUtil.export(response, "币种汇率" + DateUtil.time(), "币种汇率表", list, CurrencyExcel.class);
}
List<CurrencyExcel> list = currencyService.exportCurrency(queryWrapper);
ExcelUtil.export(response, "币种主数据" + DateUtil.time(), "币种主数据表", list, CurrencyExcel.class);
} }
/** /**
* 导出模板 * 导出模板
*/ */
@GetMapping("/export-template") @GetMapping("/export-template")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 9)
@Operation(summary = "导出模板") @Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) { public void exportTemplate(HttpServletResponse response) {
List<CurrencyExcel> list = new ArrayList<>(); List<CurrencyExcel> list = new ArrayList<>();
ExcelUtil.export(response, "币种主数据模板", "币种主数据", list, CurrencyExcel.class); ExcelUtil.export(response, "币种汇率模板", "币种汇率", list, CurrencyExcel.class);
}
private LambdaQueryWrapper<Currency> buildExportQuery(CurrencyVO currency, String ids) {
LambdaQueryWrapper<Currency> queryWrapper = Wrappers.<Currency>lambdaQuery()
.eq(Currency::getIsDeleted, 0)
.orderByAsc(Currency::getCode)
.orderByDesc(Currency::getEffectiveDate);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(Currency::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(currency.getCode())) {
queryWrapper.like(Currency::getCode, currency.getCode());
}
if (Func.isNotEmpty(currency.getName())) {
queryWrapper.like(Currency::getName, currency.getName());
}
if (Func.isNotEmpty(currency.getStatus())) {
queryWrapper.eq(Currency::getStatus, currency.getStatus());
}
if (Func.isNotEmpty(currency.getExchangeRate())) {
queryWrapper.eq(Currency::getExchangeRate, currency.getExchangeRate());
}
if (Func.isNotEmpty(currency.getDataSource())) {
queryWrapper.eq(Currency::getDataSource, currency.getDataSource());
}
if (Func.isNotEmpty(currency.getEffectiveDateStart())) {
queryWrapper.ge(Currency::getEffectiveDate, currency.getEffectiveDateStart());
}
if (Func.isNotEmpty(currency.getEffectiveDateEnd())) {
queryWrapper.le(Currency::getEffectiveDate, currency.getEffectiveDateEnd());
}
if (Func.isNotEmpty(currency.getExpiryDateStart())) {
queryWrapper.ge(Currency::getExpiryDate, currency.getExpiryDateStart());
}
if (Func.isNotEmpty(currency.getExpiryDateEnd())) {
queryWrapper.le(Currency::getExpiryDate, currency.getExpiryDateEnd());
}
if (Func.isNotEmpty(currency.getUpdateTimeStart())) {
queryWrapper.ge(Currency::getUpdateTime, currency.getUpdateTimeStart());
}
if (Func.isNotEmpty(currency.getUpdateTimeEnd())) {
queryWrapper.le(Currency::getUpdateTime, currency.getUpdateTimeEnd());
}
return queryWrapper;
} }
} }

View File

@@ -35,9 +35,10 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
/** /**
* 币种主数据 Excel * 币种汇率 Excel
* *
* @author Chill * @author Chill
*/ */
@@ -58,27 +59,21 @@ public class CurrencyExcel implements Serializable {
@ExcelProperty("币种中文名称") @ExcelProperty("币种中文名称")
private String name; private String name;
@ExcelProperty("币种英文名称")
private String englishName;
@ExcelProperty("货币符号")
private String symbol;
@ExcelProperty("小数位数")
private Integer decimalPlaces;
@ExcelProperty("汇率") @ExcelProperty("汇率")
private BigDecimal exchangeRate; private BigDecimal exchangeRate;
@ExcelProperty("是否本位币") @ExcelProperty("生效日期")
private String baseCurrencyName; private LocalDate effectiveDate;
@ExcelProperty("数据来源")
private String dataSource;
@ExcelProperty("状态") @ExcelProperty("状态")
private String statusName; private String statusName;
@ExcelProperty("来源")
private String dataSource;
@ExcelProperty("失效日期")
private LocalDate expiryDate;
@ExcelProperty("备注") @ExcelProperty("备注")
private String remark; private String remark;

View File

@@ -32,7 +32,7 @@ import org.springblade.system.service.ICurrencyService;
import java.util.List; import java.util.List;
/** /**
* 币种主数据导入类 * 币种汇率导入类
* *
* @author Chill * @author Chill
*/ */

View File

@@ -17,6 +17,8 @@
<result column="symbol" property="symbol"/> <result column="symbol" property="symbol"/>
<result column="decimal_places" property="decimalPlaces"/> <result column="decimal_places" property="decimalPlaces"/>
<result column="exchange_rate" property="exchangeRate"/> <result column="exchange_rate" property="exchangeRate"/>
<result column="effective_date" property="effectiveDate"/>
<result column="expiry_date" property="expiryDate"/>
<result column="is_base_currency" property="baseCurrency"/> <result column="is_base_currency" property="baseCurrency"/>
<result column="data_source" property="dataSource"/> <result column="data_source" property="dataSource"/>
<result column="remark" property="remark"/> <result column="remark" property="remark"/>
@@ -41,16 +43,34 @@
<bind name="englishNameLike" value="'%' + currency.englishName + '%'"/> <bind name="englishNameLike" value="'%' + currency.englishName + '%'"/>
AND english_name LIKE #{englishNameLike} AND english_name LIKE #{englishNameLike}
</if> </if>
<if test="currency.baseCurrency != null"> <if test="currency.status != null">
AND is_base_currency = #{currency.baseCurrency} AND status = #{currency.status}
</if>
<if test="currency.exchangeRate != null">
AND exchange_rate = #{currency.exchangeRate}
</if> </if>
<if test="currency.dataSource != null and currency.dataSource != ''"> <if test="currency.dataSource != null and currency.dataSource != ''">
AND data_source = #{currency.dataSource} AND data_source = #{currency.dataSource}
</if> </if>
<if test="currency.status != null"> <if test="currency.effectiveDateStart != null">
AND status = #{currency.status} AND effective_date &gt;= #{currency.effectiveDateStart}
</if> </if>
ORDER BY update_time DESC, create_time DESC <if test="currency.effectiveDateEnd != null">
AND effective_date &lt;= #{currency.effectiveDateEnd}
</if>
<if test="currency.expiryDateStart != null">
AND expiry_date &gt;= #{currency.expiryDateStart}
</if>
<if test="currency.expiryDateEnd != null">
AND expiry_date &lt;= #{currency.expiryDateEnd}
</if>
<if test="currency.updateTimeStart != null">
AND update_time &gt;= #{currency.updateTimeStart}
</if>
<if test="currency.updateTimeEnd != null">
AND update_time &lt;= #{currency.updateTimeEnd}
</if>
ORDER BY code ASC, effective_date DESC, create_time DESC
</select> </select>
</mapper> </mapper>

View File

@@ -32,10 +32,11 @@ import org.springblade.system.excel.CurrencyExcel;
import org.springblade.system.pojo.entity.Currency; import org.springblade.system.pojo.entity.Currency;
import org.springblade.system.pojo.vo.CurrencyVO; import org.springblade.system.pojo.vo.CurrencyVO;
import java.time.LocalDate;
import java.util.List; import java.util.List;
/** /**
* 币种主数据 服务类 * 币种汇率 服务类
* *
* @author Chill * @author Chill
*/ */
@@ -51,9 +52,9 @@ public interface ICurrencyService extends BaseService<Currency> {
IPage<CurrencyVO> selectCurrencyPage(IPage<CurrencyVO> page, CurrencyVO currency); IPage<CurrencyVO> selectCurrencyPage(IPage<CurrencyVO> page, CurrencyVO currency);
/** /**
* 新增或修改币种 * 新增或修改币种汇率
* *
* @param currency 币种 * @param currency 币种汇率
* @return 是否成功 * @return 是否成功
*/ */
boolean submit(Currency currency); boolean submit(Currency currency);
@@ -68,18 +69,27 @@ public interface ICurrencyService extends BaseService<Currency> {
boolean changeStatus(Long id, Integer status); boolean changeStatus(Long id, Integer status);
/** /**
* 导入币种 * 导入币种汇率
* *
* @param data 导入数据 * @param data 导入数据
*/ */
void importCurrency(List<CurrencyExcel> data); void importCurrency(List<CurrencyExcel> data);
/** /**
* 导出币种 * 导出币种汇率
* *
* @param queryWrapper 查询条件 * @param queryWrapper 查询条件
* @return 导出数据 * @return 导出数据
*/ */
List<CurrencyExcel> exportCurrency(Wrapper<Currency> queryWrapper); List<CurrencyExcel> exportCurrency(Wrapper<Currency> queryWrapper);
/**
* 查询有效汇率
*
* @param code 币种编码
* @param businessDate 业务日期
* @return 有效汇率
*/
CurrencyVO getEffectiveRate(String code, LocalDate businessDate);
} }

View File

@@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@@ -49,7 +50,7 @@ import java.util.Objects;
import java.util.regex.Pattern; import java.util.regex.Pattern;
/** /**
* 币种主数据 服务实现类 * 币种汇率 服务实现类
* *
* @author Chill * @author Chill
*/ */
@@ -57,7 +58,7 @@ import java.util.regex.Pattern;
public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currency> implements ICurrencyService { public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currency> implements ICurrencyService {
private static final String SOURCE_BATCH = "批量导入"; private static final String SOURCE_BATCH = "批量导入";
private static final String SOURCE_MANUAL = "手工"; private static final String SOURCE_MANUAL = "手工";
private static final int STATUS_ENABLED = 1; private static final int STATUS_ENABLED = 1;
private static final int STATUS_DISABLED = 2; private static final int STATUS_DISABLED = 2;
private static final int YES = 1; private static final int YES = 1;
@@ -65,6 +66,7 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
private static final int REMARK_MAX_LENGTH = 200; private static final int REMARK_MAX_LENGTH = 200;
private static final int MIN_DECIMAL_PLACES = 0; private static final int MIN_DECIMAL_PLACES = 0;
private static final int MAX_DECIMAL_PLACES = 8; private static final int MAX_DECIMAL_PLACES = 8;
private static final int EXCHANGE_RATE_SCALE = 6;
private static final Pattern CURRENCY_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$"); private static final Pattern CURRENCY_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
@Override @Override
@@ -75,9 +77,15 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean submit(Currency currency) { public boolean submit(Currency currency) {
Currency oldCurrency = Func.isNotEmpty(currency.getId()) ? getById(currency.getId()) : null;
prepare(currency, SOURCE_MANUAL); prepare(currency, SOURCE_MANUAL);
validate(currency); validate(currency);
return saveOrUpdate(currency); boolean result = saveOrUpdate(currency);
rebuildEnabledValidity(currency.getCode());
if (oldCurrency != null && !Objects.equals(oldCurrency.getCode(), currency.getCode())) {
rebuildEnabledValidity(oldCurrency.getCode());
}
return result;
} }
@Override @Override
@@ -96,30 +104,36 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
Currency update = new Currency(); Currency update = new Currency();
update.setId(id); update.setId(id);
update.setStatus(status); update.setStatus(status);
return updateById(update); boolean result = updateById(update);
rebuildEnabledValidity(currency.getCode());
return result;
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void importCurrency(List<CurrencyExcel> data) { public void importCurrency(List<CurrencyExcel> data) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<String> errorList = new ArrayList<>(); List<String> errorList = new ArrayList<>();
int successCount = 0;
for (int index = 0; index < data.size(); index++) { for (int index = 0; index < data.size(); index++) {
CurrencyExcel excel = data.get(index); CurrencyExcel excel = data.get(index);
try { try {
Currency currency = Objects.requireNonNull(BeanUtil.copyProperties(excel, Currency.class)); Currency currency = Objects.requireNonNull(BeanUtil.copyProperties(excel, Currency.class));
currency.setBaseCurrency(parseBaseCurrency(excel.getBaseCurrencyName()));
currency.setDataSource(SOURCE_BATCH); currency.setDataSource(SOURCE_BATCH);
currency.setStatus(STATUS_ENABLED); currency.setStatus(STATUS_ENABLED);
prepare(currency, SOURCE_BATCH); prepare(currency, SOURCE_BATCH);
validate(currency); validate(currency);
save(currency); save(currency);
rebuildEnabledValidity(currency.getCode());
successCount++;
} catch (Exception exception) { } catch (Exception exception) {
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败"; String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
errorList.add("" + (index + 2) + "行:" + message); errorList.add("" + (index + 2) + "行:" + message);
} }
} }
if (Func.isNotEmpty(errorList)) { if (Func.isNotEmpty(errorList)) {
throw new ServiceException(String.join("", errorList)); throw new ServiceException("导入成功" + successCount + "条,失败" + errorList.size() + "条:" + String.join("", errorList));
} }
} }
@@ -128,12 +142,37 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
List<Currency> currencyList = list(queryWrapper); List<Currency> currencyList = list(queryWrapper);
return currencyList.stream().map(currency -> { return currencyList.stream().map(currency -> {
CurrencyExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(currency, CurrencyExcel.class)); CurrencyExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(currency, CurrencyExcel.class));
excel.setBaseCurrencyName(Objects.equals(currency.getBaseCurrency(), YES) ? "" : "");
excel.setStatusName(Objects.equals(currency.getStatus(), STATUS_ENABLED) ? "启用" : "停用"); excel.setStatusName(Objects.equals(currency.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
return excel; return excel;
}).toList(); }).toList();
} }
@Override
public CurrencyVO getEffectiveRate(String code, LocalDate businessDate) {
String currencyCode = trimToEmpty(code).toUpperCase(Locale.ROOT);
if (!CURRENCY_CODE_PATTERN.matcher(currencyCode).matches()) {
throw new ServiceException("币种代码为3位大写字母");
}
if (count(Wrappers.<Currency>lambdaQuery()
.eq(Currency::getCode, currencyCode)
.eq(Currency::getIsDeleted, 0)) <= 0L) {
throw new ServiceException("币种不存在");
}
LocalDate queryDate = businessDate == null ? LocalDate.now() : businessDate;
Currency currency = getOne(Wrappers.<Currency>lambdaQuery()
.eq(Currency::getCode, currencyCode)
.eq(Currency::getStatus, STATUS_ENABLED)
.eq(Currency::getIsDeleted, 0)
.le(Currency::getEffectiveDate, queryDate)
.and(wrapper -> wrapper.isNull(Currency::getExpiryDate).or().gt(Currency::getExpiryDate, queryDate))
.orderByDesc(Currency::getEffectiveDate)
.last("limit 1"));
if (currency == null) {
throw new ServiceException("未找到有效汇率");
}
return Objects.requireNonNull(BeanUtil.copyProperties(currency, CurrencyVO.class));
}
private void prepare(Currency currency, String defaultDataSource) { private void prepare(Currency currency, String defaultDataSource) {
currency.setCode(trimToEmpty(currency.getCode()).toUpperCase(Locale.ROOT)); currency.setCode(trimToEmpty(currency.getCode()).toUpperCase(Locale.ROOT));
currency.setName(trimToEmpty(currency.getName())); currency.setName(trimToEmpty(currency.getName()));
@@ -141,12 +180,10 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
currency.setSymbol(trimToNull(currency.getSymbol())); currency.setSymbol(trimToNull(currency.getSymbol()));
currency.setRemark(trimToNull(currency.getRemark())); currency.setRemark(trimToNull(currency.getRemark()));
currency.setDataSource(Func.toStrWithEmpty(currency.getDataSource(), defaultDataSource)); currency.setDataSource(Func.toStrWithEmpty(currency.getDataSource(), defaultDataSource));
currency.setExpiryDate(null);
if (Func.isEmpty(currency.getDecimalPlaces())) { if (Func.isEmpty(currency.getDecimalPlaces())) {
currency.setDecimalPlaces(2); currency.setDecimalPlaces(2);
} }
if (Func.isEmpty(currency.getExchangeRate())) {
currency.setExchangeRate(BigDecimal.ONE);
}
if (Func.isEmpty(currency.getBaseCurrency())) { if (Func.isEmpty(currency.getBaseCurrency())) {
currency.setBaseCurrency(NO); currency.setBaseCurrency(NO);
} }
@@ -163,63 +200,77 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
throw new ServiceException("币种代码为3位大写字母"); throw new ServiceException("币种代码为3位大写字母");
} }
if (Func.isEmpty(currency.getName())) { if (Func.isEmpty(currency.getName())) {
throw new ServiceException("币种中文名称不能为空"); throw new ServiceException("币种名称不能为空");
} }
if (currency.getDecimalPlaces() < MIN_DECIMAL_PLACES || currency.getDecimalPlaces() > MAX_DECIMAL_PLACES) { if (currency.getDecimalPlaces() < MIN_DECIMAL_PLACES || currency.getDecimalPlaces() > MAX_DECIMAL_PLACES) {
throw new ServiceException("小数位数范围为0到8"); throw new ServiceException("小数位数范围为0到8");
} }
if (Func.isEmpty(currency.getExchangeRate())) {
throw new ServiceException("汇率不能为空");
}
if (currency.getExchangeRate().compareTo(BigDecimal.ZERO) <= 0) { if (currency.getExchangeRate().compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("汇率必须大于0"); throw new ServiceException("汇率必须大于0");
} }
if (currency.getExchangeRate().stripTrailingZeros().scale() > EXCHANGE_RATE_SCALE) {
throw new ServiceException("汇率最多保留6位小数");
}
if (Func.isEmpty(currency.getEffectiveDate())) {
throw new ServiceException("生效日期不能为空");
}
if (!Objects.equals(currency.getBaseCurrency(), YES) && !Objects.equals(currency.getBaseCurrency(), NO)) { if (!Objects.equals(currency.getBaseCurrency(), YES) && !Objects.equals(currency.getBaseCurrency(), NO)) {
throw new ServiceException("是否本位币取值不正确"); throw new ServiceException("是否本位币取值不正确");
} }
if (Objects.equals(currency.getBaseCurrency(), YES) && currency.getExchangeRate().compareTo(BigDecimal.ONE) != 0) {
throw new ServiceException("本位币汇率必须为1");
}
if (Func.isNotEmpty(currency.getRemark()) && currency.getRemark().length() > REMARK_MAX_LENGTH) { if (Func.isNotEmpty(currency.getRemark()) && currency.getRemark().length() > REMARK_MAX_LENGTH) {
throw new ServiceException("备注不能超过200字"); throw new ServiceException("备注不能超过200字");
} }
validateUnique(currency, Currency::getCode, currency.getCode(), "该币种代码已存在"); validateCodeName(currency);
validateBaseCurrency(currency); validateUniqueEffectiveDate(currency);
} }
private void validateUnique(Currency currency, com.baomidou.mybatisplus.core.toolkit.support.SFunction<Currency, ?> column, String value, String message) { private void validateUniqueEffectiveDate(Currency currency) {
LambdaQueryWrapper<Currency> queryWrapper = Wrappers.<Currency>lambdaQuery() LambdaQueryWrapper<Currency> queryWrapper = Wrappers.<Currency>lambdaQuery()
.eq(column, value) .eq(Currency::getCode, currency.getCode())
.eq(Currency::getEffectiveDate, currency.getEffectiveDate())
.eq(Currency::getIsDeleted, 0); .eq(Currency::getIsDeleted, 0);
if (Func.isNotEmpty(currency.getId())) { if (Func.isNotEmpty(currency.getId())) {
queryWrapper.ne(Currency::getId, currency.getId()); queryWrapper.ne(Currency::getId, currency.getId());
} }
if (count(queryWrapper) > 0L) { if (count(queryWrapper) > 0L) {
throw new ServiceException(message); throw new ServiceException("同币种同生效日期已存在");
} }
} }
private void validateBaseCurrency(Currency currency) { private void validateCodeName(Currency currency) {
if (!Objects.equals(currency.getBaseCurrency(), YES)) { LambdaQueryWrapper<Currency> queryWrapper = Wrappers.<Currency>lambdaQuery()
.eq(Currency::getCode, currency.getCode())
.eq(Currency::getIsDeleted, 0);
if (Func.isNotEmpty(currency.getId())) {
queryWrapper.ne(Currency::getId, currency.getId());
}
Currency exists = getOne(queryWrapper.last("limit 1"));
if (exists != null && !Objects.equals(exists.getName(), currency.getName())) {
throw new ServiceException("同一币种编码的币种名称必须一致");
}
}
private void rebuildEnabledValidity(String code) {
String currencyCode = trimToEmpty(code).toUpperCase(Locale.ROOT);
if (Func.isEmpty(currencyCode)) {
return; return;
} }
LambdaQueryWrapper<Currency> queryWrapper = Wrappers.<Currency>lambdaQuery() List<Currency> enabledRecords = list(Wrappers.<Currency>lambdaQuery()
.eq(Currency::getBaseCurrency, YES) .eq(Currency::getCode, currencyCode)
.eq(Currency::getIsDeleted, 0); .eq(Currency::getStatus, STATUS_ENABLED)
if (Func.isNotEmpty(currency.getId())) { .eq(Currency::getIsDeleted, 0)
queryWrapper.ne(Currency::getId, currency.getId()); .orderByAsc(Currency::getEffectiveDate)
.orderByAsc(Currency::getCreateTime));
for (int index = 0; index < enabledRecords.size(); index++) {
Currency record = enabledRecords.get(index);
Currency update = new Currency();
update.setId(record.getId());
update.setExpiryDate(index + 1 < enabledRecords.size() ? enabledRecords.get(index + 1).getEffectiveDate() : null);
updateById(update);
} }
if (count(queryWrapper) > 0L) {
throw new ServiceException("本位币只能设置一个");
}
}
private Integer parseBaseCurrency(String value) {
String trimValue = trimToEmpty(value);
if (Func.isEmpty(trimValue) || "".equals(trimValue) || "0".equals(trimValue)) {
return NO;
}
if ("".equals(trimValue) || "1".equals(trimValue)) {
return YES;
}
throw new ServiceException("是否本位币只能填写是或否");
} }
private String trimToEmpty(String value) { private String trimToEmpty(String value) {

View File

@@ -27,6 +27,7 @@ package org.springblade.system.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.AirportMaster; import org.springblade.system.pojo.entity.AirportMaster;
import org.springblade.system.pojo.vo.AirportMasterVO; import org.springblade.system.pojo.vo.AirportMasterVO;
@@ -45,7 +46,9 @@ public class AirportMasterWrapper extends BaseEntityWrapper<AirportMaster, Airpo
@Override @Override
public AirportMasterVO entityVO(AirportMaster airportMaster) { public AirportMasterVO entityVO(AirportMaster airportMaster) {
return Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterVO.class)); AirportMasterVO airportMasterVO = Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterVO.class));
airportMasterVO.setUpdateUserName(UserCache.getUserRealName(airportMaster.getUpdateUser()));
return airportMasterVO;
} }
} }

View File

@@ -27,6 +27,7 @@ package org.springblade.system.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.PortTerminal; import org.springblade.system.pojo.entity.PortTerminal;
import org.springblade.system.pojo.vo.PortTerminalVO; import org.springblade.system.pojo.vo.PortTerminalVO;
@@ -45,7 +46,9 @@ public class PortTerminalWrapper extends BaseEntityWrapper<PortTerminal, PortTer
@Override @Override
public PortTerminalVO entityVO(PortTerminal portTerminal) { public PortTerminalVO entityVO(PortTerminal portTerminal) {
return Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalVO.class)); PortTerminalVO portTerminalVO = Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalVO.class));
portTerminalVO.setUpdateUserName(UserCache.getUserRealName(portTerminal.getUpdateUser()));
return portTerminalVO;
} }
} }

View File

@@ -27,6 +27,7 @@ package org.springblade.system.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.RailwayStation; import org.springblade.system.pojo.entity.RailwayStation;
import org.springblade.system.pojo.vo.RailwayStationVO; import org.springblade.system.pojo.vo.RailwayStationVO;
@@ -45,7 +46,9 @@ public class RailwayStationWrapper extends BaseEntityWrapper<RailwayStation, Rai
@Override @Override
public RailwayStationVO entityVO(RailwayStation railwayStation) { public RailwayStationVO entityVO(RailwayStation railwayStation) {
return Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationVO.class)); RailwayStationVO railwayStationVO = Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationVO.class));
railwayStationVO.setUpdateUserName(UserCache.getUserRealName(railwayStation.getUpdateUser()));
return railwayStationVO;
} }
} }

View File

@@ -31,6 +31,10 @@
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-transport-api</artifactId> <artifactId>blade-transport-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-user-api</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@@ -0,0 +1,215 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.AccidentRecordExcel;
import org.springblade.transport.excel.AccidentRecordImporter;
import org.springblade.transport.pojo.entity.AccidentRecord;
import org.springblade.transport.pojo.vo.AccidentRecordVO;
import org.springblade.transport.service.IAccidentRecordService;
import org.springblade.transport.wrapper.AccidentRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 事故记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "accident_record")
@RequestMapping("/accident-record")
@Tag(name = "事故记录", description = "事故记录")
public class AccidentRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IAccidentRecordService accidentRecordService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入accidentRecord")
public R<AccidentRecordVO> detail(AccidentRecord accidentRecord) {
AccidentRecord detail = accidentRecordService.getOne(Condition.getQueryWrapper(accidentRecord));
return R.data(AccidentRecordWrapper.build().entityVO(detail));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入accidentRecord")
public R<IPage<AccidentRecordVO>> list(AccidentRecordVO accidentRecord, Query query) {
IPage<AccidentRecordVO> pages = accidentRecordService.selectAccidentRecordPage(Condition.getPage(normalizeQuery(query)), accidentRecord);
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入accidentRecord")
public R submit(@Valid @RequestBody AccidentRecord accidentRecord) {
return R.status(accidentRecordService.submit(accidentRecord));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(accidentRecordService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导入事故记录
*/
@PostMapping("/import-accident-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入事故记录", description = "传入excel")
public R importAccidentRecord(MultipartFile file) {
AccidentRecordImporter accidentRecordImporter = new AccidentRecordImporter(accidentRecordService);
ExcelUtil.save(file, accidentRecordImporter, AccidentRecordExcel.class);
return R.success("操作成功");
}
/**
* 导出事故记录
*/
@GetMapping("/export-accident-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出事故记录")
public void exportAccidentRecord(AccidentRecordVO accidentRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<AccidentRecordExcel> list = accidentRecordService.exportAccidentRecord(buildExportQuery(accidentRecord, ids));
ExcelUtil.export(response, "事故记录" + DateUtil.time(), "事故记录表", list, AccidentRecordExcel.class);
}
/**
* 导出模板
*/
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<AccidentRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "事故记录模板", "事故记录表", list, AccidentRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<AccidentRecord> buildExportQuery(AccidentRecordVO accidentRecord, String ids) {
LambdaQueryWrapper<AccidentRecord> queryWrapper = Wrappers.<AccidentRecord>lambdaQuery()
.eq(AccidentRecord::getIsDeleted, 0)
.orderByDesc(AccidentRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(AccidentRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(accidentRecord.getCreateDept())) {
queryWrapper.eq(AccidentRecord::getCreateDept, accidentRecord.getCreateDept());
}
if (Func.isNotEmpty(accidentRecord.getVehicleType())) {
queryWrapper.eq(AccidentRecord::getVehicleType, accidentRecord.getVehicleType());
}
if (Func.isNotEmpty(accidentRecord.getVehicleNo())) {
queryWrapper.like(AccidentRecord::getVehicleNo, accidentRecord.getVehicleNo());
}
if (Func.isNotEmpty(accidentRecord.getAccidentNature())) {
queryWrapper.eq(AccidentRecord::getAccidentNature, accidentRecord.getAccidentNature());
}
if (Func.isNotEmpty(accidentRecord.getAccidentResponsibility())) {
queryWrapper.eq(AccidentRecord::getAccidentResponsibility, accidentRecord.getAccidentResponsibility());
}
if (Func.isNotEmpty(accidentRecord.getAccidentReasonDamage())) {
queryWrapper.like(AccidentRecord::getAccidentReasonDamage, accidentRecord.getAccidentReasonDamage());
}
if (Func.isNotEmpty(accidentRecord.getAccidentAssessmentDateStart())) {
queryWrapper.ge(AccidentRecord::getAccidentDate, accidentRecord.getAccidentAssessmentDateStart());
}
if (Func.isNotEmpty(accidentRecord.getAccidentAssessmentDateEnd())) {
queryWrapper.le(AccidentRecord::getAccidentDate, accidentRecord.getAccidentAssessmentDateEnd());
}
if (Func.isNotEmpty(accidentRecord.getCreateTimeStart())) {
queryWrapper.ge(AccidentRecord::getCreateTime, accidentRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(accidentRecord.getCreateTimeEnd())) {
queryWrapper.le(AccidentRecord::getCreateTime, accidentRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,185 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.AnnualInspectionRecordExcel;
import org.springblade.transport.excel.AnnualInspectionRecordImporter;
import org.springblade.transport.pojo.entity.AnnualInspectionRecord;
import org.springblade.transport.pojo.vo.AnnualInspectionRecordVO;
import org.springblade.transport.service.IAnnualInspectionRecordService;
import org.springblade.transport.wrapper.AnnualInspectionRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 年检记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "annual_inspection_record")
@RequestMapping("/annual-inspection-record")
@Tag(name = "年检记录", description = "年检记录")
public class AnnualInspectionRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IAnnualInspectionRecordService annualInspectionRecordService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入annualInspectionRecord")
public R<AnnualInspectionRecordVO> detail(AnnualInspectionRecord annualInspectionRecord) {
AnnualInspectionRecord detail = annualInspectionRecordService.getOne(Condition.getQueryWrapper(annualInspectionRecord));
return R.data(AnnualInspectionRecordWrapper.build().entityVO(detail));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入annualInspectionRecord")
public R<IPage<AnnualInspectionRecordVO>> list(AnnualInspectionRecordVO annualInspectionRecord, Query query) {
IPage<AnnualInspectionRecordVO> pages = annualInspectionRecordService.selectAnnualInspectionRecordPage(Condition.getPage(normalizeQuery(query)), annualInspectionRecord);
return R.data(pages);
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入annualInspectionRecord")
public R submit(@Valid @RequestBody AnnualInspectionRecord annualInspectionRecord) {
return R.status(annualInspectionRecordService.submit(annualInspectionRecord));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(annualInspectionRecordService.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/import-annual-inspection-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入年检记录", description = "传入excel")
public R importAnnualInspectionRecord(MultipartFile file) {
AnnualInspectionRecordImporter annualInspectionRecordImporter = new AnnualInspectionRecordImporter(annualInspectionRecordService);
ExcelUtil.save(file, annualInspectionRecordImporter, AnnualInspectionRecordExcel.class);
return R.success("操作成功");
}
@GetMapping("/export-annual-inspection-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出年检记录")
public void exportAnnualInspectionRecord(AnnualInspectionRecordVO annualInspectionRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<AnnualInspectionRecordExcel> list = annualInspectionRecordService.exportAnnualInspectionRecord(buildExportQuery(annualInspectionRecord, ids));
ExcelUtil.export(response, "年检记录" + DateUtil.time(), "年检记录表", list, AnnualInspectionRecordExcel.class);
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<AnnualInspectionRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "年检记录模板", "年检记录表", list, AnnualInspectionRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<AnnualInspectionRecord> buildExportQuery(AnnualInspectionRecordVO annualInspectionRecord, String ids) {
LambdaQueryWrapper<AnnualInspectionRecord> queryWrapper = Wrappers.<AnnualInspectionRecord>lambdaQuery()
.eq(AnnualInspectionRecord::getIsDeleted, 0)
.orderByDesc(AnnualInspectionRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(AnnualInspectionRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(annualInspectionRecord.getCreateDept())) {
queryWrapper.eq(AnnualInspectionRecord::getCreateDept, annualInspectionRecord.getCreateDept());
}
if (Func.isNotEmpty(annualInspectionRecord.getVehicleType())) {
queryWrapper.eq(AnnualInspectionRecord::getVehicleType, annualInspectionRecord.getVehicleType());
}
if (Func.isNotEmpty(annualInspectionRecord.getVehicleNo())) {
queryWrapper.like(AnnualInspectionRecord::getVehicleNo, annualInspectionRecord.getVehicleNo());
}
if (Func.isNotEmpty(annualInspectionRecord.getInspectionAssessmentDateStart())) {
queryWrapper.ge(AnnualInspectionRecord::getInspectionAssessmentDate, annualInspectionRecord.getInspectionAssessmentDateStart());
}
if (Func.isNotEmpty(annualInspectionRecord.getInspectionAssessmentDateEnd())) {
queryWrapper.le(AnnualInspectionRecord::getInspectionAssessmentDate, annualInspectionRecord.getInspectionAssessmentDateEnd());
}
if (Func.isNotEmpty(annualInspectionRecord.getCreateTimeStart())) {
queryWrapper.ge(AnnualInspectionRecord::getCreateTime, annualInspectionRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(annualInspectionRecord.getCreateTimeEnd())) {
queryWrapper.le(AnnualInspectionRecord::getCreateTime, annualInspectionRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,221 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.CustomerArchiveExcel;
import org.springblade.transport.pojo.entity.CustomerArchive;
import org.springblade.transport.pojo.vo.CustomerArchiveVO;
import org.springblade.transport.pojo.vo.CustomerCreditScoreVO;
import org.springblade.transport.service.ICustomerArchiveService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 客商档案 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "customer_archive")
@RequestMapping("/customer-archive")
@Tag(name = "客商档案", description = "客商档案")
public class CustomerArchiveController extends BladeController {
private final ICustomerArchiveService customerArchiveService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入id")
public R<CustomerArchiveVO> detail(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.data(customerArchiveService.detail(id));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入customerArchive")
public R<IPage<CustomerArchiveVO>> list(CustomerArchiveVO customerArchive, Query query) {
IPage<CustomerArchiveVO> pages = customerArchiveService.selectCustomerArchivePage(Condition.getPage(query), customerArchive);
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入customerArchive")
public R submit(@RequestBody CustomerArchiveVO customerArchive) {
return R.status(customerArchiveService.submit(customerArchive));
}
/**
* 提交审核
*/
@PostMapping("/submit-approval")
@ApiOperationSupport(order = 4)
@Operation(summary = "提交审核", description = "传入id")
public R submitApproval(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(customerArchiveService.submitApproval(id));
}
/**
* 审核通过
*/
@PostMapping("/approve")
@ApiOperationSupport(order = 5)
@Operation(summary = "审核通过", description = "传入id")
public R approve(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(customerArchiveService.approve(id));
}
/**
* 审核不通过
*/
@PostMapping("/reject")
@ApiOperationSupport(order = 6)
@Operation(summary = "审核不通过", description = "传入id")
public R reject(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(customerArchiveService.reject(id));
}
/**
* 启用或停用
*/
@PostMapping("/status")
@ApiOperationSupport(order = 7)
@Operation(summary = "启用或停用", description = "传入id和status")
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
@Parameter(description = "状态", required = true) @RequestParam Integer status) {
return R.status(customerArchiveService.changeStatus(id, status));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 8)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(customerArchiveService.removeDraft(ids));
}
/**
* 评分明细模板
*/
@GetMapping("/score-template")
@ApiOperationSupport(order = 9)
@Operation(summary = "评分明细模板", description = "传入评分量化表ID")
public R<CustomerCreditScoreVO> scoreTemplate(@RequestParam(required = false) Long quantificationId) {
return R.data(customerArchiveService.buildScoreTemplate(quantificationId));
}
/**
* 导出客商档案
*/
@GetMapping("/export-customer-archive")
@ApiOperationSupport(order = 10)
@Operation(summary = "导出客商档案")
public void exportCustomerArchive(CustomerArchiveVO customerArchive,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<CustomerArchiveExcel> list = customerArchiveService.exportCustomerArchive(buildExportQuery(customerArchive, ids));
ExcelUtil.export(response, "客商档案" + DateUtil.time(), "客商档案", list, CustomerArchiveExcel.class);
}
private LambdaQueryWrapper<CustomerArchive> buildExportQuery(CustomerArchiveVO customerArchive, String ids) {
LambdaQueryWrapper<CustomerArchive> queryWrapper = Wrappers.<CustomerArchive>lambdaQuery()
.eq(CustomerArchive::getIsDeleted, 0)
.orderByDesc(CustomerArchive::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(CustomerArchive::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(customerArchive.getCustomerCode())) {
queryWrapper.like(CustomerArchive::getCustomerCode, customerArchive.getCustomerCode());
}
if (Func.isNotEmpty(customerArchive.getFullName())) {
queryWrapper.like(CustomerArchive::getFullName, customerArchive.getFullName());
}
if (Func.isNotEmpty(customerArchive.getShortName())) {
queryWrapper.like(CustomerArchive::getShortName, customerArchive.getShortName());
}
if (Func.isNotEmpty(customerArchive.getUnifiedCreditCode())) {
queryWrapper.like(CustomerArchive::getUnifiedCreditCode, customerArchive.getUnifiedCreditCode());
}
if (Func.isNotEmpty(customerArchive.getCustomerNature())) {
queryWrapper.eq(CustomerArchive::getCustomerNature, customerArchive.getCustomerNature());
}
if (Func.isNotEmpty(customerArchive.getCustomerType())) {
queryWrapper.like(CustomerArchive::getCustomerType, customerArchive.getCustomerType());
}
if (Func.isNotEmpty(customerArchive.getAccessType())) {
queryWrapper.eq(CustomerArchive::getAccessType, customerArchive.getAccessType());
}
if (Func.isNotEmpty(customerArchive.getApprovalStatus())) {
queryWrapper.eq(CustomerArchive::getApprovalStatus, customerArchive.getApprovalStatus());
}
if (Func.isNotEmpty(customerArchive.getStatus())) {
queryWrapper.eq(CustomerArchive::getStatus, customerArchive.getStatus());
}
if (Func.isNotEmpty(customerArchive.getDeptName())) {
queryWrapper.like(CustomerArchive::getDeptName, customerArchive.getDeptName());
}
if (Func.isNotEmpty(customerArchive.getCreateTimeStart())) {
queryWrapper.ge(CustomerArchive::getCreateTime, customerArchive.getCreateTimeStart());
}
if (Func.isNotEmpty(customerArchive.getCreateTimeEnd())) {
queryWrapper.le(CustomerArchive::getCreateTime, customerArchive.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,241 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.DriverExcel;
import org.springblade.transport.pojo.entity.Driver;
import org.springblade.transport.pojo.vo.DriverExpiryStatVO;
import org.springblade.transport.pojo.vo.DriverVO;
import org.springblade.transport.service.IDriverService;
import org.springblade.transport.wrapper.DriverWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* 司机管理 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "driver")
@RequestMapping("/driver")
@Tag(name = "司机管理", description = "司机管理")
public class DriverController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IDriverService driverService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入driver")
public R<DriverVO> detail(Driver driver) {
Driver detail = driverService.getOne(Condition.getQueryWrapper(driver));
return R.data(DriverWrapper.build().entityVO(detail));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入driver")
public R<IPage<DriverVO>> list(DriverVO driver, Query query) {
fillExpiryDate(driver);
IPage<DriverVO> pages = driverService.selectDriverPage(Condition.getPage(normalizeQuery(query)), driver);
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入driver")
public R submit(@Valid @RequestBody Driver driver) {
return R.status(driverService.submit(driver));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(driverService.deleteLogic(Func.toLongList(ids)));
}
/**
* 修改状态
*/
@PostMapping("/status")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改状态")
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
@Parameter(description = "状态", required = true) @RequestParam Integer status) {
return R.status(driverService.changeStatus(id, status));
}
/**
* 证件有效期统计
*/
@GetMapping("/expiry-stat")
@ApiOperationSupport(order = 6)
@Operation(summary = "证件有效期统计", description = "传入driver")
public R<DriverExpiryStatVO> expiryStat(DriverVO driver) {
fillExpiryDate(driver);
return R.data(driverService.expiryStat(driver));
}
/**
* 导出司机
*/
@GetMapping("/export-driver")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出司机")
public void exportDriver(DriverVO driver,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
fillExpiryDate(driver);
List<DriverExcel> list = driverService.exportDriver(buildExportQuery(driver, ids));
ExcelUtil.export(response, "司机管理" + DateUtil.time(), "司机管理表", list, DriverExcel.class);
}
/**
* 导出模板
*/
@GetMapping("/export-template")
@ApiOperationSupport(order = 8)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<DriverExcel> list = new ArrayList<>();
ExcelUtil.export(response, "司机管理模板", "司机管理表", list, DriverExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private void fillExpiryDate(DriverVO driver) {
if (driver.getToday() == null) {
driver.setToday(LocalDate.now());
}
if (driver.getWarningDate() == null) {
driver.setWarningDate(driver.getToday().plusDays(30));
}
}
private LambdaQueryWrapper<Driver> buildExportQuery(DriverVO driver, String ids) {
LambdaQueryWrapper<Driver> queryWrapper = Wrappers.<Driver>lambdaQuery()
.eq(Driver::getIsDeleted, 0)
.orderByDesc(Driver::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(Driver::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(driver.getDriverName())) {
queryWrapper.like(Driver::getDriverName, driver.getDriverName());
}
if (Func.isNotEmpty(driver.getMobile())) {
queryWrapper.like(Driver::getMobile, driver.getMobile());
}
if (Func.isNotEmpty(driver.getIdCardNo())) {
queryWrapper.like(Driver::getIdCardNo, driver.getIdCardNo());
}
if (Func.isNotEmpty(driver.getDrivingType())) {
queryWrapper.eq(Driver::getDrivingType, driver.getDrivingType());
}
if (Func.isNotEmpty(driver.getDriverType())) {
queryWrapper.eq(Driver::getDriverType, driver.getDriverType());
}
if (Func.isNotEmpty(driver.getOrganizationName())) {
queryWrapper.like(Driver::getOrganizationName, driver.getOrganizationName());
}
if (Func.isNotEmpty(driver.getStatus())) {
queryWrapper.eq(Driver::getStatus, driver.getStatus());
}
if ("within30".equals(driver.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(Driver::getDrivingLicenseLongTerm, 1)
.between(Driver::getDrivingLicenseEndDate, driver.getToday(), driver.getWarningDate()))
.or(item -> item.ne(Driver::getQualificationLongTerm, 1)
.between(Driver::getQualificationEndDate, driver.getToday(), driver.getWarningDate())));
}
if ("expired".equals(driver.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(Driver::getDrivingLicenseLongTerm, 1)
.lt(Driver::getDrivingLicenseEndDate, driver.getToday()))
.or(item -> item.ne(Driver::getQualificationLongTerm, 1)
.lt(Driver::getQualificationEndDate, driver.getToday())));
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,155 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.EtcRecordExcel;
import org.springblade.transport.excel.EtcRecordImporter;
import org.springblade.transport.pojo.entity.EtcRecord;
import org.springblade.transport.pojo.vo.EtcRecordVO;
import org.springblade.transport.service.IEtcRecordService;
import org.springblade.transport.wrapper.EtcRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* ETC记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "etc_record")
@RequestMapping("/etc-record")
@Tag(name = "ETC记录", description = "ETC记录")
public class EtcRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IEtcRecordService etcRecordService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入etcRecord")
public R<EtcRecordVO> detail(EtcRecord etcRecord) {
EtcRecord detail = etcRecordService.getOne(Condition.getQueryWrapper(etcRecord));
return R.data(EtcRecordWrapper.build().entityVO(detail));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入etcRecord")
public R<IPage<EtcRecordVO>> list(EtcRecordVO etcRecord, Query query) {
IPage<EtcRecordVO> pages = etcRecordService.selectEtcRecordPage(Condition.getPage(normalizeQuery(query)), etcRecord);
return R.data(pages);
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入etcRecord")
public R submit(@Valid @RequestBody EtcRecord etcRecord) {
return R.status(etcRecordService.submit(etcRecord));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(etcRecordService.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/import-etc-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入ETC记录", description = "传入excel")
public R importEtcRecord(MultipartFile file) {
EtcRecordImporter etcRecordImporter = new EtcRecordImporter(etcRecordService);
ExcelUtil.save(file, etcRecordImporter, EtcRecordExcel.class);
return R.success("操作成功");
}
@GetMapping("/export-etc-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出ETC记录")
public void exportEtcRecord(EtcRecordVO etcRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<EtcRecordExcel> list = etcRecordService.exportEtcRecord(buildExportQuery(etcRecord, ids));
ExcelUtil.export(response, "ETC记录" + DateUtil.time(), "ETC记录表", list, EtcRecordExcel.class);
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<EtcRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "ETC记录模板", "ETC记录表", list, EtcRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<EtcRecord> buildExportQuery(EtcRecordVO etcRecord, String ids) {
LambdaQueryWrapper<EtcRecord> queryWrapper = Wrappers.<EtcRecord>lambdaQuery()
.eq(EtcRecord::getIsDeleted, 0)
.orderByDesc(EtcRecord::getExitTime)
.orderByDesc(EtcRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(EtcRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(etcRecord.getCreateDept())) {
queryWrapper.eq(EtcRecord::getCreateDept, etcRecord.getCreateDept());
}
if (Func.isNotEmpty(etcRecord.getVehicleNo())) {
queryWrapper.like(EtcRecord::getVehicleNo, etcRecord.getVehicleNo());
}
if (Func.isNotEmpty(etcRecord.getEtcCardNo())) {
queryWrapper.like(EtcRecord::getEtcCardNo, etcRecord.getEtcCardNo());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,220 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.InsuranceRecordExcel;
import org.springblade.transport.excel.InsuranceRecordImporter;
import org.springblade.transport.pojo.entity.InsuranceRecord;
import org.springblade.transport.pojo.vo.InsuranceRecordVO;
import org.springblade.transport.service.IInsuranceRecordService;
import org.springblade.transport.wrapper.InsuranceRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 保险记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "insurance_record")
@RequestMapping("/insurance-record")
@Tag(name = "保险记录", description = "保险记录")
public class InsuranceRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IInsuranceRecordService insuranceRecordService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入insuranceRecord")
public R<InsuranceRecordVO> detail(InsuranceRecord insuranceRecord) {
InsuranceRecord detail = insuranceRecordService.getOne(Condition.getQueryWrapper(insuranceRecord));
return R.data(InsuranceRecordWrapper.build().entityVO(detail));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入insuranceRecord")
public R<IPage<InsuranceRecordVO>> list(InsuranceRecordVO insuranceRecord, Query query) {
IPage<InsuranceRecordVO> pages = insuranceRecordService.selectInsuranceRecordPage(Condition.getPage(normalizeQuery(query)), insuranceRecord);
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入insuranceRecord")
public R submit(@Valid @RequestBody InsuranceRecord insuranceRecord) {
return R.status(insuranceRecordService.submit(insuranceRecord));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(insuranceRecordService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导入保险记录
*/
@PostMapping("/import-insurance-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入保险记录", description = "传入excel")
public R importInsuranceRecord(MultipartFile file) {
InsuranceRecordImporter insuranceRecordImporter = new InsuranceRecordImporter(insuranceRecordService);
ExcelUtil.save(file, insuranceRecordImporter, InsuranceRecordExcel.class);
return R.success("操作成功");
}
/**
* 导出保险记录
*/
@GetMapping("/export-insurance-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出保险记录")
public void exportInsuranceRecord(InsuranceRecordVO insuranceRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<InsuranceRecordExcel> list = insuranceRecordService.exportInsuranceRecord(buildExportQuery(insuranceRecord, ids));
ExcelUtil.export(response, "保险记录" + DateUtil.time(), "保险记录表", list, InsuranceRecordExcel.class);
}
/**
* 导出模板
*/
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<InsuranceRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "保险记录模板", "保险记录表", list, InsuranceRecordExcel.class);
}
/**
* OCR识别保单
*/
@PostMapping("/recognize")
@ApiOperationSupport(order = 8)
@Operation(summary = "OCR识别保单", description = "上传保单图片或PDF")
public R<InsuranceRecord> recognize(MultipartFile file,
@RequestParam(required = false) String vehicleType,
@RequestParam(required = false) String ocrTemplate) {
try {
return R.data(insuranceRecordService.recognizePolicy(file, vehicleType, ocrTemplate));
} catch (ServiceException exception) {
return R.fail(exception.getMessage());
}
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<InsuranceRecord> buildExportQuery(InsuranceRecordVO insuranceRecord, String ids) {
LambdaQueryWrapper<InsuranceRecord> queryWrapper = Wrappers.<InsuranceRecord>lambdaQuery()
.eq(InsuranceRecord::getIsDeleted, 0)
.orderByDesc(InsuranceRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(InsuranceRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(insuranceRecord.getCreateDept())) {
queryWrapper.eq(InsuranceRecord::getCreateDept, insuranceRecord.getCreateDept());
}
if (Func.isNotEmpty(insuranceRecord.getVehicleType())) {
queryWrapper.eq(InsuranceRecord::getVehicleType, insuranceRecord.getVehicleType());
}
if (Func.isNotEmpty(insuranceRecord.getVehicleNo())) {
queryWrapper.like(InsuranceRecord::getVehicleNo, insuranceRecord.getVehicleNo());
}
if (Func.isNotEmpty(insuranceRecord.getInsuranceType())) {
queryWrapper.eq(InsuranceRecord::getInsuranceType, insuranceRecord.getInsuranceType());
}
if (Func.isNotEmpty(insuranceRecord.getCreateTimeStart())) {
queryWrapper.ge(InsuranceRecord::getCreateTime, insuranceRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(insuranceRecord.getCreateTimeEnd())) {
queryWrapper.le(InsuranceRecord::getCreateTime, insuranceRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,182 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.MileageRecordExcel;
import org.springblade.transport.excel.MileageRecordImporter;
import org.springblade.transport.pojo.entity.MileageRecord;
import org.springblade.transport.pojo.vo.MileageRecordVO;
import org.springblade.transport.service.IMileageRecordService;
import org.springblade.transport.wrapper.MileageRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 里程记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "mileage_record")
@RequestMapping("/mileage-record")
@Tag(name = "里程记录", description = "里程记录")
public class MileageRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IMileageRecordService mileageRecordService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入mileageRecord")
public R<MileageRecordVO> detail(MileageRecord mileageRecord) {
MileageRecord detail = mileageRecordService.getOne(Condition.getQueryWrapper(mileageRecord));
return R.data(MileageRecordWrapper.build().entityVO(detail));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入mileageRecord")
public R<IPage<MileageRecordVO>> list(MileageRecordVO mileageRecord, Query query) {
IPage<MileageRecordVO> pages = mileageRecordService.selectMileageRecordPage(Condition.getPage(normalizeQuery(query)), mileageRecord);
return R.data(pages);
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入mileageRecord")
public R submit(@Valid @RequestBody MileageRecord mileageRecord) {
return R.status(mileageRecordService.submit(mileageRecord));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(mileageRecordService.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/import-mileage-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入里程记录", description = "传入excel")
public R importMileageRecord(MultipartFile file) {
MileageRecordImporter mileageRecordImporter = new MileageRecordImporter(mileageRecordService);
ExcelUtil.save(file, mileageRecordImporter, MileageRecordExcel.class);
return R.success("操作成功");
}
@GetMapping("/export-mileage-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出里程记录")
public void exportMileageRecord(MileageRecordVO mileageRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<MileageRecordExcel> list = mileageRecordService.exportMileageRecord(buildExportQuery(mileageRecord, ids));
ExcelUtil.export(response, "里程记录" + DateUtil.time(), "里程记录表", list, MileageRecordExcel.class);
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<MileageRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "里程记录模板", "里程记录表", list, MileageRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<MileageRecord> buildExportQuery(MileageRecordVO mileageRecord, String ids) {
LambdaQueryWrapper<MileageRecord> queryWrapper = Wrappers.<MileageRecord>lambdaQuery()
.eq(MileageRecord::getIsDeleted, 0)
.orderByDesc(MileageRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(MileageRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(mileageRecord.getCreateDept())) {
queryWrapper.eq(MileageRecord::getCreateDept, mileageRecord.getCreateDept());
}
if (Func.isNotEmpty(mileageRecord.getVehicleNo())) {
queryWrapper.like(MileageRecord::getVehicleNo, mileageRecord.getVehicleNo());
}
if (Func.isNotEmpty(mileageRecord.getTotalMileageStart())) {
queryWrapper.ge(MileageRecord::getTotalMileage, mileageRecord.getTotalMileageStart());
}
if (Func.isNotEmpty(mileageRecord.getTotalMileageEnd())) {
queryWrapper.le(MileageRecord::getTotalMileage, mileageRecord.getTotalMileageEnd());
}
if (Func.isNotEmpty(mileageRecord.getCreateTimeStart())) {
queryWrapper.ge(MileageRecord::getCreateTime, mileageRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(mileageRecord.getCreateTimeEnd())) {
queryWrapper.le(MileageRecord::getCreateTime, mileageRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,176 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.OilElectricRecordExcel;
import org.springblade.transport.excel.OilElectricRecordImporter;
import org.springblade.transport.pojo.entity.OilElectricRecord;
import org.springblade.transport.pojo.vo.OilElectricRecordVO;
import org.springblade.transport.service.IOilElectricRecordService;
import org.springblade.transport.wrapper.OilElectricRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 油电记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "oil_electric_record")
@RequestMapping("/oil-electric-record")
@Tag(name = "油电记录", description = "油电记录")
public class OilElectricRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IOilElectricRecordService oilElectricRecordService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入oilElectricRecord")
public R<OilElectricRecordVO> detail(OilElectricRecord oilElectricRecord) {
OilElectricRecord detail = oilElectricRecordService.getOne(Condition.getQueryWrapper(oilElectricRecord));
return R.data(OilElectricRecordWrapper.build().entityVO(detail));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入oilElectricRecord")
public R<IPage<OilElectricRecordVO>> list(OilElectricRecordVO oilElectricRecord, Query query) {
IPage<OilElectricRecordVO> pages = oilElectricRecordService.selectOilElectricRecordPage(Condition.getPage(normalizeQuery(query)), oilElectricRecord);
return R.data(pages);
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入oilElectricRecord")
public R submit(@Valid @RequestBody OilElectricRecord oilElectricRecord) {
return R.status(oilElectricRecordService.submit(oilElectricRecord));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(oilElectricRecordService.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/import-oil-electric-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入油电记录", description = "传入excel")
public R importOilElectricRecord(MultipartFile file) {
OilElectricRecordImporter oilElectricRecordImporter = new OilElectricRecordImporter(oilElectricRecordService);
ExcelUtil.save(file, oilElectricRecordImporter, OilElectricRecordExcel.class);
return R.success("操作成功");
}
@GetMapping("/export-oil-electric-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出油电记录")
public void exportOilElectricRecord(OilElectricRecordVO oilElectricRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<OilElectricRecordExcel> list = oilElectricRecordService.exportOilElectricRecord(buildExportQuery(oilElectricRecord, ids));
ExcelUtil.export(response, "油电记录" + DateUtil.time(), "油电记录表", list, OilElectricRecordExcel.class);
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<OilElectricRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "油电记录模板", "油电记录表", list, OilElectricRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<OilElectricRecord> buildExportQuery(OilElectricRecordVO oilElectricRecord, String ids) {
LambdaQueryWrapper<OilElectricRecord> queryWrapper = Wrappers.<OilElectricRecord>lambdaQuery()
.eq(OilElectricRecord::getIsDeleted, 0)
.orderByDesc(OilElectricRecord::getTransactionTime)
.orderByDesc(OilElectricRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(OilElectricRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(oilElectricRecord.getCreateDept())) {
queryWrapper.eq(OilElectricRecord::getCreateDept, oilElectricRecord.getCreateDept());
}
if (Func.isNotEmpty(oilElectricRecord.getVehicleType())) {
queryWrapper.eq(OilElectricRecord::getVehicleType, oilElectricRecord.getVehicleType());
}
if (Func.isNotEmpty(oilElectricRecord.getFeeType())) {
queryWrapper.eq(OilElectricRecord::getFeeType, oilElectricRecord.getFeeType());
}
if (Func.isNotEmpty(oilElectricRecord.getVehicleNo())) {
queryWrapper.like(OilElectricRecord::getVehicleNo, oilElectricRecord.getVehicleNo());
}
if (Func.isNotEmpty(oilElectricRecord.getTransactionTimeStart())) {
queryWrapper.ge(OilElectricRecord::getTransactionTime, oilElectricRecord.getTransactionTimeStart());
}
if (Func.isNotEmpty(oilElectricRecord.getTransactionTimeEnd())) {
queryWrapper.le(OilElectricRecord::getTransactionTime, oilElectricRecord.getTransactionTimeEnd());
}
if (Func.isNotEmpty(oilElectricRecord.getTransactionAmountStart())) {
queryWrapper.ge(OilElectricRecord::getTransactionAmount, oilElectricRecord.getTransactionAmountStart());
}
if (Func.isNotEmpty(oilElectricRecord.getTransactionAmountEnd())) {
queryWrapper.le(OilElectricRecord::getTransactionAmount, oilElectricRecord.getTransactionAmountEnd());
}
if (Func.isNotEmpty(oilElectricRecord.getCreateTimeStart())) {
queryWrapper.ge(OilElectricRecord::getCreateTime, oilElectricRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(oilElectricRecord.getCreateTimeEnd())) {
queryWrapper.le(OilElectricRecord::getCreateTime, oilElectricRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,170 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.OtherExpenseRecordExcel;
import org.springblade.transport.excel.OtherExpenseRecordImporter;
import org.springblade.transport.pojo.entity.OtherExpenseRecord;
import org.springblade.transport.pojo.vo.OtherExpenseRecordVO;
import org.springblade.transport.service.IOtherExpenseRecordService;
import org.springblade.transport.wrapper.OtherExpenseRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 其他费用记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "other_expense_record")
@RequestMapping("/other-expense-record")
@Tag(name = "其他费用记录", description = "其他费用记录")
public class OtherExpenseRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IOtherExpenseRecordService otherExpenseRecordService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入otherExpenseRecord")
public R<OtherExpenseRecordVO> detail(OtherExpenseRecord otherExpenseRecord) {
OtherExpenseRecord detail = otherExpenseRecordService.getOne(Condition.getQueryWrapper(otherExpenseRecord));
return R.data(OtherExpenseRecordWrapper.build().entityVO(detail));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入otherExpenseRecord")
public R<IPage<OtherExpenseRecordVO>> list(OtherExpenseRecordVO otherExpenseRecord, Query query) {
IPage<OtherExpenseRecordVO> pages = otherExpenseRecordService.selectOtherExpenseRecordPage(Condition.getPage(normalizeQuery(query)), otherExpenseRecord);
return R.data(pages);
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入otherExpenseRecord")
public R submit(@Valid @RequestBody OtherExpenseRecord otherExpenseRecord) {
return R.status(otherExpenseRecordService.submit(otherExpenseRecord));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(otherExpenseRecordService.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/import-other-expense-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入其他费用记录", description = "传入excel")
public R importOtherExpenseRecord(MultipartFile file) {
OtherExpenseRecordImporter otherExpenseRecordImporter = new OtherExpenseRecordImporter(otherExpenseRecordService);
ExcelUtil.save(file, otherExpenseRecordImporter, OtherExpenseRecordExcel.class);
return R.success("操作成功");
}
@GetMapping("/export-other-expense-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出其他费用记录")
public void exportOtherExpenseRecord(OtherExpenseRecordVO otherExpenseRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<OtherExpenseRecordExcel> list = otherExpenseRecordService.exportOtherExpenseRecord(buildExportQuery(otherExpenseRecord, ids));
ExcelUtil.export(response, "其他费用记录" + DateUtil.time(), "其他费用记录表", list, OtherExpenseRecordExcel.class);
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<OtherExpenseRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "其他费用记录模板", "其他费用记录表", list, OtherExpenseRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<OtherExpenseRecord> buildExportQuery(OtherExpenseRecordVO otherExpenseRecord, String ids) {
LambdaQueryWrapper<OtherExpenseRecord> queryWrapper = Wrappers.<OtherExpenseRecord>lambdaQuery()
.eq(OtherExpenseRecord::getIsDeleted, 0)
.orderByDesc(OtherExpenseRecord::getExpenseDate)
.orderByDesc(OtherExpenseRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(OtherExpenseRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(otherExpenseRecord.getCreateDept())) {
queryWrapper.eq(OtherExpenseRecord::getCreateDept, otherExpenseRecord.getCreateDept());
}
if (Func.isNotEmpty(otherExpenseRecord.getExpenseType())) {
queryWrapper.eq(OtherExpenseRecord::getExpenseType, otherExpenseRecord.getExpenseType());
}
if (Func.isNotEmpty(otherExpenseRecord.getVehicleType())) {
queryWrapper.eq(OtherExpenseRecord::getVehicleType, otherExpenseRecord.getVehicleType());
}
if (Func.isNotEmpty(otherExpenseRecord.getVehicleNo())) {
queryWrapper.like(OtherExpenseRecord::getVehicleNo, otherExpenseRecord.getVehicleNo());
}
if (Func.isNotEmpty(otherExpenseRecord.getExpenseDateStart())) {
queryWrapper.ge(OtherExpenseRecord::getExpenseDate, otherExpenseRecord.getExpenseDateStart());
}
if (Func.isNotEmpty(otherExpenseRecord.getExpenseDateEnd())) {
queryWrapper.le(OtherExpenseRecord::getExpenseDate, otherExpenseRecord.getExpenseDateEnd());
}
if (Func.isNotEmpty(otherExpenseRecord.getCreateTimeStart())) {
queryWrapper.ge(OtherExpenseRecord::getCreateTime, otherExpenseRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(otherExpenseRecord.getCreateTimeEnd())) {
queryWrapper.le(OtherExpenseRecord::getCreateTime, otherExpenseRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,197 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.TireReplacementRecordExcel;
import org.springblade.transport.excel.TireReplacementRecordImporter;
import org.springblade.transport.pojo.entity.TireReplacementRecord;
import org.springblade.transport.pojo.vo.TireReplacementRecordVO;
import org.springblade.transport.service.ITireReplacementRecordService;
import org.springblade.transport.wrapper.TireReplacementRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 换胎记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "tire_replacement_record")
@RequestMapping("/tire-replacement-record")
@Tag(name = "换胎记录", description = "换胎记录")
public class TireReplacementRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final ITireReplacementRecordService tireReplacementRecordService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入tireReplacementRecord")
public R<TireReplacementRecordVO> detail(TireReplacementRecord tireReplacementRecord) {
TireReplacementRecord detail = tireReplacementRecordService.getOne(Condition.getQueryWrapper(tireReplacementRecord));
return R.data(TireReplacementRecordWrapper.build().entityVO(detail));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入tireReplacementRecord")
public R<IPage<TireReplacementRecordVO>> list(TireReplacementRecordVO tireReplacementRecord, Query query) {
IPage<TireReplacementRecordVO> pages = tireReplacementRecordService.selectTireReplacementRecordPage(Condition.getPage(normalizeQuery(query)), tireReplacementRecord);
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入tireReplacementRecord")
public R submit(@Valid @RequestBody TireReplacementRecord tireReplacementRecord) {
return R.status(tireReplacementRecordService.submit(tireReplacementRecord));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(tireReplacementRecordService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导入换胎记录
*/
@PostMapping("/import-tire-replacement-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入换胎记录", description = "传入excel")
public R importTireReplacementRecord(MultipartFile file) {
TireReplacementRecordImporter tireReplacementRecordImporter = new TireReplacementRecordImporter(tireReplacementRecordService);
ExcelUtil.save(file, tireReplacementRecordImporter, TireReplacementRecordExcel.class);
return R.success("操作成功");
}
/**
* 导出换胎记录
*/
@GetMapping("/export-tire-replacement-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出换胎记录")
public void exportTireReplacementRecord(TireReplacementRecordVO tireReplacementRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<TireReplacementRecordExcel> list = tireReplacementRecordService.exportTireReplacementRecord(buildExportQuery(tireReplacementRecord, ids));
ExcelUtil.export(response, "换胎记录" + DateUtil.time(), "换胎记录表", list, TireReplacementRecordExcel.class);
}
/**
* 导出模板
*/
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<TireReplacementRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "换胎记录模板", "换胎记录表", list, TireReplacementRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<TireReplacementRecord> buildExportQuery(TireReplacementRecordVO tireReplacementRecord, String ids) {
LambdaQueryWrapper<TireReplacementRecord> queryWrapper = Wrappers.<TireReplacementRecord>lambdaQuery()
.eq(TireReplacementRecord::getIsDeleted, 0)
.orderByDesc(TireReplacementRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(TireReplacementRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(tireReplacementRecord.getCreateDept())) {
queryWrapper.eq(TireReplacementRecord::getCreateDept, tireReplacementRecord.getCreateDept());
}
if (Func.isNotEmpty(tireReplacementRecord.getVehicleNo())) {
queryWrapper.like(TireReplacementRecord::getVehicleNo, tireReplacementRecord.getVehicleNo());
}
if (Func.isNotEmpty(tireReplacementRecord.getCreateTimeStart())) {
queryWrapper.ge(TireReplacementRecord::getCreateTime, tireReplacementRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(tireReplacementRecord.getCreateTimeEnd())) {
queryWrapper.le(TireReplacementRecord::getCreateTime, tireReplacementRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,182 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.TransportChangeRecordExcel;
import org.springblade.transport.excel.TransportChangeRecordImporter;
import org.springblade.transport.pojo.entity.TransportChangeRecord;
import org.springblade.transport.pojo.vo.TransportChangeRecordVO;
import org.springblade.transport.service.ITransportChangeRecordService;
import org.springblade.transport.wrapper.TransportChangeRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 变更记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "transport_change_record")
@RequestMapping("/transport-change-record")
@Tag(name = "变更记录", description = "变更记录")
public class TransportChangeRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final ITransportChangeRecordService transportChangeRecordService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入transportChangeRecord")
public R<TransportChangeRecordVO> detail(TransportChangeRecord transportChangeRecord) {
TransportChangeRecord detail = transportChangeRecordService.getOne(Condition.getQueryWrapper(transportChangeRecord));
return R.data(TransportChangeRecordWrapper.build().entityVO(detail));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入transportChangeRecord")
public R<IPage<TransportChangeRecordVO>> list(TransportChangeRecordVO transportChangeRecord, Query query) {
IPage<TransportChangeRecordVO> pages = transportChangeRecordService.selectTransportChangeRecordPage(Condition.getPage(normalizeQuery(query)), transportChangeRecord);
return R.data(pages);
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入transportChangeRecord")
public R submit(@Valid @RequestBody TransportChangeRecord transportChangeRecord) {
return R.status(transportChangeRecordService.submit(transportChangeRecord));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(transportChangeRecordService.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/import-transport-change-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入变更记录", description = "传入excel")
public R importTransportChangeRecord(MultipartFile file) {
TransportChangeRecordImporter transportChangeRecordImporter = new TransportChangeRecordImporter(transportChangeRecordService);
ExcelUtil.save(file, transportChangeRecordImporter, TransportChangeRecordExcel.class);
return R.success("操作成功");
}
@GetMapping("/export-transport-change-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出变更记录")
public void exportTransportChangeRecord(TransportChangeRecordVO transportChangeRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<TransportChangeRecordExcel> list = transportChangeRecordService.exportTransportChangeRecord(buildExportQuery(transportChangeRecord, ids));
ExcelUtil.export(response, "变更记录" + DateUtil.time(), "变更记录表", list, TransportChangeRecordExcel.class);
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<TransportChangeRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "变更记录模板", "变更记录表", list, TransportChangeRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<TransportChangeRecord> buildExportQuery(TransportChangeRecordVO transportChangeRecord, String ids) {
LambdaQueryWrapper<TransportChangeRecord> queryWrapper = Wrappers.<TransportChangeRecord>lambdaQuery()
.eq(TransportChangeRecord::getIsDeleted, 0)
.orderByDesc(TransportChangeRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(TransportChangeRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(transportChangeRecord.getCreateDept())) {
queryWrapper.eq(TransportChangeRecord::getCreateDept, transportChangeRecord.getCreateDept());
}
if (Func.isNotEmpty(transportChangeRecord.getVehicleType())) {
queryWrapper.eq(TransportChangeRecord::getVehicleType, transportChangeRecord.getVehicleType());
}
if (Func.isNotEmpty(transportChangeRecord.getVehicleNo())) {
queryWrapper.like(TransportChangeRecord::getVehicleNo, transportChangeRecord.getVehicleNo());
}
if (Func.isNotEmpty(transportChangeRecord.getChangeContent())) {
queryWrapper.like(TransportChangeRecord::getChangeContent, transportChangeRecord.getChangeContent());
}
if (Func.isNotEmpty(transportChangeRecord.getCreateTimeStart())) {
queryWrapper.ge(TransportChangeRecord::getCreateTime, transportChangeRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(transportChangeRecord.getCreateTimeEnd())) {
queryWrapper.le(TransportChangeRecord::getCreateTime, transportChangeRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,222 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.TransportShipExcel;
import org.springblade.transport.pojo.entity.TransportShip;
import org.springblade.transport.pojo.vo.TransportShipExpiryStatVO;
import org.springblade.transport.pojo.vo.TransportShipVO;
import org.springblade.transport.service.ITransportShipService;
import org.springblade.transport.wrapper.TransportShipWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* 船舶管理 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "transport_ship")
@RequestMapping("/transport-ship")
@Tag(name = "船舶管理", description = "船舶管理")
public class TransportShipController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final ITransportShipService transportShipService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入transportShip")
public R<TransportShipVO> detail(TransportShip ship) {
TransportShip detail = transportShipService.getOne(Condition.getQueryWrapper(ship));
return R.data(TransportShipWrapper.build().entityVO(detail));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入transportShip")
public R<IPage<TransportShipVO>> list(TransportShipVO ship, Query query) {
fillExpiryDate(ship);
IPage<TransportShipVO> pages = transportShipService.selectTransportShipPage(Condition.getPage(normalizeQuery(query)), ship);
return R.data(pages);
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入transportShip")
public R submit(@Valid @RequestBody TransportShip ship) {
return R.status(transportShipService.submit(ship));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(transportShipService.deleteLogic(Func.toLongList(ids)));
}
@PostMapping("/status")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改状态")
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
@Parameter(description = "状态", required = true) @RequestParam Integer status) {
return R.status(transportShipService.changeStatus(id, status));
}
@GetMapping("/expiry-stat")
@ApiOperationSupport(order = 6)
@Operation(summary = "证件有效期统计", description = "传入transportShip")
public R<TransportShipExpiryStatVO> expiryStat(TransportShipVO ship) {
fillExpiryDate(ship);
return R.data(transportShipService.expiryStat(ship));
}
@GetMapping("/export-transport-ship")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出船舶")
public void exportTransportShip(TransportShipVO ship,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
fillExpiryDate(ship);
List<TransportShipExcel> list = transportShipService.exportTransportShip(buildExportQuery(ship, ids));
ExcelUtil.export(response, "船舶管理" + DateUtil.time(), "船舶管理表", list, TransportShipExcel.class);
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 8)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<TransportShipExcel> list = new ArrayList<>();
ExcelUtil.export(response, "船舶管理模板", "船舶管理表", list, TransportShipExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private void fillExpiryDate(TransportShipVO ship) {
if (ship.getToday() == null) {
ship.setToday(LocalDate.now());
}
if (ship.getWarningDate() == null) {
ship.setWarningDate(ship.getToday().plusDays(30));
}
}
private LambdaQueryWrapper<TransportShip> buildExportQuery(TransportShipVO ship, String ids) {
LambdaQueryWrapper<TransportShip> queryWrapper = Wrappers.<TransportShip>lambdaQuery()
.eq(TransportShip::getIsDeleted, 0)
.orderByDesc(TransportShip::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(TransportShip::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(ship.getShipName())) {
queryWrapper.like(TransportShip::getShipName, ship.getShipName());
}
if (Func.isNotEmpty(ship.getShipIdentifierNo())) {
queryWrapper.like(TransportShip::getShipIdentifierNo, ship.getShipIdentifierNo());
}
if (Func.isNotEmpty(ship.getOrganizationName())) {
queryWrapper.like(TransportShip::getOrganizationName, ship.getOrganizationName());
}
if (Func.isNotEmpty(ship.getShipInspectionNo())) {
queryWrapper.like(TransportShip::getShipInspectionNo, ship.getShipInspectionNo());
}
if (Func.isNotEmpty(ship.getShipType())) {
queryWrapper.eq(TransportShip::getShipType, ship.getShipType());
}
if (Func.isNotEmpty(ship.getStatus())) {
queryWrapper.eq(TransportShip::getStatus, ship.getStatus());
}
if ("within30".equals(ship.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(TransportShip::getNationalityCertLongTerm, 1)
.between(TransportShip::getNationalityCertEndDate, ship.getToday(), ship.getWarningDate()))
.or(item -> item.ne(TransportShip::getSafeManningCertLongTerm, 1)
.between(TransportShip::getSafeManningCertEndDate, ship.getToday(), ship.getWarningDate()))
.or(item -> item.ne(TransportShip::getBusinessTransportCertLongTerm, 1)
.between(TransportShip::getBusinessTransportCertEndDate, ship.getToday(), ship.getWarningDate()))
.or(item -> item.ne(TransportShip::getLeaseLongTerm, 1)
.between(TransportShip::getLeaseEndDate, ship.getToday(), ship.getWarningDate())));
}
if ("expired".equals(ship.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(TransportShip::getNationalityCertLongTerm, 1)
.lt(TransportShip::getNationalityCertEndDate, ship.getToday()))
.or(item -> item.ne(TransportShip::getSafeManningCertLongTerm, 1)
.lt(TransportShip::getSafeManningCertEndDate, ship.getToday()))
.or(item -> item.ne(TransportShip::getBusinessTransportCertLongTerm, 1)
.lt(TransportShip::getBusinessTransportCertEndDate, ship.getToday()))
.or(item -> item.ne(TransportShip::getLeaseLongTerm, 1)
.lt(TransportShip::getLeaseEndDate, ship.getToday())));
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,246 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.TransportVehicleExcel;
import org.springblade.transport.pojo.entity.TransportVehicle;
import org.springblade.transport.pojo.vo.TransportVehicleExpiryStatVO;
import org.springblade.transport.pojo.vo.TransportVehicleVO;
import org.springblade.transport.service.ITransportVehicleService;
import org.springblade.transport.wrapper.TransportVehicleWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* 车辆管理 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "transport_vehicle")
@RequestMapping("/transport-vehicle")
@Tag(name = "车辆管理", description = "车辆管理")
public class TransportVehicleController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final ITransportVehicleService transportVehicleService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入transportVehicle")
public R<TransportVehicleVO> detail(TransportVehicle vehicle) {
TransportVehicle detail = transportVehicleService.getOne(Condition.getQueryWrapper(vehicle));
return R.data(TransportVehicleWrapper.build().entityVO(detail));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入transportVehicle")
public R<IPage<TransportVehicleVO>> list(TransportVehicleVO vehicle, Query query) {
fillExpiryDate(vehicle);
IPage<TransportVehicleVO> pages = transportVehicleService.selectTransportVehiclePage(Condition.getPage(normalizeQuery(query)), vehicle);
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入transportVehicle")
public R submit(@Valid @RequestBody TransportVehicle vehicle) {
return R.status(transportVehicleService.submit(vehicle));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(transportVehicleService.deleteLogic(Func.toLongList(ids)));
}
/**
* 修改状态
*/
@PostMapping("/status")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改状态")
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
@Parameter(description = "状态", required = true) @RequestParam Integer status) {
return R.status(transportVehicleService.changeStatus(id, status));
}
/**
* 证件有效期统计
*/
@GetMapping("/expiry-stat")
@ApiOperationSupport(order = 6)
@Operation(summary = "证件有效期统计", description = "传入transportVehicle")
public R<TransportVehicleExpiryStatVO> expiryStat(TransportVehicleVO vehicle) {
fillExpiryDate(vehicle);
return R.data(transportVehicleService.expiryStat(vehicle));
}
/**
* 导出车辆
*/
@GetMapping("/export-transport-vehicle")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出车辆")
public void exportTransportVehicle(TransportVehicleVO vehicle,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
fillExpiryDate(vehicle);
List<TransportVehicleExcel> list = transportVehicleService.exportTransportVehicle(buildExportQuery(vehicle, ids));
ExcelUtil.export(response, "车辆管理" + DateUtil.time(), "车辆管理表", list, TransportVehicleExcel.class);
}
/**
* 导出模板
*/
@GetMapping("/export-template")
@ApiOperationSupport(order = 8)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<TransportVehicleExcel> list = new ArrayList<>();
ExcelUtil.export(response, "车辆管理模板", "车辆管理表", list, TransportVehicleExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private void fillExpiryDate(TransportVehicleVO vehicle) {
if (vehicle.getToday() == null) {
vehicle.setToday(LocalDate.now());
}
if (vehicle.getWarningDate() == null) {
vehicle.setWarningDate(vehicle.getToday().plusDays(30));
}
}
private LambdaQueryWrapper<TransportVehicle> buildExportQuery(TransportVehicleVO vehicle, String ids) {
LambdaQueryWrapper<TransportVehicle> queryWrapper = Wrappers.<TransportVehicle>lambdaQuery()
.eq(TransportVehicle::getIsDeleted, 0)
.orderByDesc(TransportVehicle::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(TransportVehicle::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(vehicle.getOrganizationName())) {
queryWrapper.like(TransportVehicle::getOrganizationName, vehicle.getOrganizationName());
}
if (Func.isNotEmpty(vehicle.getPlateNo())) {
queryWrapper.like(TransportVehicle::getPlateNo, vehicle.getPlateNo());
}
if (Func.isNotEmpty(vehicle.getVehicleType())) {
queryWrapper.eq(TransportVehicle::getVehicleType, vehicle.getVehicleType());
}
if (Func.isNotEmpty(vehicle.getBusinessRelation())) {
queryWrapper.eq(TransportVehicle::getBusinessRelation, vehicle.getBusinessRelation());
}
if (Func.isNotEmpty(vehicle.getEnergyType())) {
queryWrapper.eq(TransportVehicle::getEnergyType, vehicle.getEnergyType());
}
if (Func.isNotEmpty(vehicle.getStatus())) {
queryWrapper.eq(TransportVehicle::getStatus, vehicle.getStatus());
}
if ("within30".equals(vehicle.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(TransportVehicle::getCompulsoryScrapLongTerm, 1)
.between(TransportVehicle::getCompulsoryScrapDate, vehicle.getToday(), vehicle.getWarningDate()))
.or(item -> item.ne(TransportVehicle::getDrivingLicenseLongTerm, 1)
.between(TransportVehicle::getDrivingLicenseEndDate, vehicle.getToday(), vehicle.getWarningDate()))
.or(item -> item.ne(TransportVehicle::getRoadTransportCertLongTerm, 1)
.between(TransportVehicle::getRoadTransportCertEndDate, vehicle.getToday(), vehicle.getWarningDate()))
.or(item -> item.ne(TransportVehicle::getAnnualReviewLongTerm, 1)
.between(TransportVehicle::getAnnualReviewEndDate, vehicle.getToday(), vehicle.getWarningDate())));
}
if ("expired".equals(vehicle.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(TransportVehicle::getCompulsoryScrapLongTerm, 1)
.lt(TransportVehicle::getCompulsoryScrapDate, vehicle.getToday()))
.or(item -> item.ne(TransportVehicle::getDrivingLicenseLongTerm, 1)
.lt(TransportVehicle::getDrivingLicenseEndDate, vehicle.getToday()))
.or(item -> item.ne(TransportVehicle::getRoadTransportCertLongTerm, 1)
.lt(TransportVehicle::getRoadTransportCertEndDate, vehicle.getToday()))
.or(item -> item.ne(TransportVehicle::getAnnualReviewLongTerm, 1)
.lt(TransportVehicle::getAnnualReviewEndDate, vehicle.getToday())));
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,206 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.ViolationRecordExcel;
import org.springblade.transport.excel.ViolationRecordImporter;
import org.springblade.transport.pojo.entity.ViolationRecord;
import org.springblade.transport.pojo.vo.ViolationRecordVO;
import org.springblade.transport.service.IViolationRecordService;
import org.springblade.transport.wrapper.ViolationRecordWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 违章记录 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "violation_record")
@RequestMapping("/violation-record")
@Tag(name = "违章记录", description = "违章记录")
public class ViolationRecordController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private final IViolationRecordService violationRecordService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入violationRecord")
public R<ViolationRecordVO> detail(ViolationRecord violationRecord) {
ViolationRecord detail = violationRecordService.getOne(Condition.getQueryWrapper(violationRecord));
return R.data(ViolationRecordWrapper.build().entityVO(detail));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入violationRecord")
public R<IPage<ViolationRecordVO>> list(ViolationRecordVO violationRecord, Query query) {
IPage<ViolationRecordVO> pages = violationRecordService.selectViolationRecordPage(Condition.getPage(normalizeQuery(query)), violationRecord);
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入violationRecord")
public R submit(@Valid @RequestBody ViolationRecord violationRecord) {
return R.status(violationRecordService.submit(violationRecord));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(violationRecordService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导入违章记录
*/
@PostMapping("/import-violation-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入违章记录", description = "传入excel")
public R importViolationRecord(MultipartFile file) {
ViolationRecordImporter violationRecordImporter = new ViolationRecordImporter(violationRecordService);
ExcelUtil.save(file, violationRecordImporter, ViolationRecordExcel.class);
return R.success("操作成功");
}
/**
* 导出违章记录
*/
@GetMapping("/export-violation-record")
@ApiOperationSupport(order = 6)
@Operation(summary = "导出违章记录")
public void exportViolationRecord(ViolationRecordVO violationRecord,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<ViolationRecordExcel> list = violationRecordService.exportViolationRecord(buildExportQuery(violationRecord, ids));
ExcelUtil.export(response, "违章记录" + DateUtil.time(), "违章记录表", list, ViolationRecordExcel.class);
}
/**
* 导出模板
*/
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<ViolationRecordExcel> list = new ArrayList<>();
ExcelUtil.export(response, "违章记录模板", "违章记录表", list, ViolationRecordExcel.class);
}
private Query normalizeQuery(Query query) {
if (query == null) {
query = new Query();
}
if (query.getCurrent() == null || query.getCurrent() < DEFAULT_CURRENT) {
query.setCurrent(DEFAULT_CURRENT);
}
if (query.getSize() == null || query.getSize() <= 0) {
query.setSize(DEFAULT_SIZE);
}
if (query.getSize() > MAX_SIZE) {
query.setSize(MAX_SIZE);
}
return query;
}
private LambdaQueryWrapper<ViolationRecord> buildExportQuery(ViolationRecordVO violationRecord, String ids) {
LambdaQueryWrapper<ViolationRecord> queryWrapper = Wrappers.<ViolationRecord>lambdaQuery()
.eq(ViolationRecord::getIsDeleted, 0)
.orderByDesc(ViolationRecord::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(ViolationRecord::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(violationRecord.getCreateDept())) {
queryWrapper.eq(ViolationRecord::getCreateDept, violationRecord.getCreateDept());
}
if (Func.isNotEmpty(violationRecord.getVehicleType())) {
queryWrapper.eq(ViolationRecord::getVehicleType, violationRecord.getVehicleType());
}
if (Func.isNotEmpty(violationRecord.getVehicleNo())) {
queryWrapper.like(ViolationRecord::getVehicleNo, violationRecord.getVehicleNo());
}
if (Func.isNotEmpty(violationRecord.getDriverName())) {
queryWrapper.like(ViolationRecord::getDriverName, violationRecord.getDriverName());
}
if (Func.isNotEmpty(violationRecord.getProcessStatus())) {
queryWrapper.eq(ViolationRecord::getProcessStatus, violationRecord.getProcessStatus());
}
if (Func.isNotEmpty(violationRecord.getCreateTimeStart())) {
queryWrapper.ge(ViolationRecord::getCreateTime, violationRecord.getCreateTimeStart());
}
if (Func.isNotEmpty(violationRecord.getCreateTimeEnd())) {
queryWrapper.le(ViolationRecord::getCreateTime, violationRecord.getCreateTimeEnd());
}
return queryWrapper;
}
}

View File

@@ -0,0 +1,89 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 事故记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(18)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class AccidentRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车船类型")
private String vehicleType;
@ExcelProperty("车牌号/船号")
private String vehicleNo;
@ExcelProperty("事故发生日期")
private LocalDate accidentDate;
@ExcelProperty("事故发生地点")
private String accidentLocation;
@ExcelProperty("事故性质")
private String accidentNature;
@ExcelProperty("事故责任")
private String accidentResponsibility;
@ExcelProperty("直接经济损失")
private BigDecimal directEconomicLoss;
@ExcelProperty("保险理赔金额")
private BigDecimal insuranceClaimAmount;
@ExcelProperty("事故原因及损坏情况")
private String accidentReasonDamage;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.IAccidentRecordService;
import java.util.List;
/**
* 事故记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class AccidentRecordImporter implements ExcelImporter<AccidentRecordExcel> {
private final IAccidentRecordService service;
@Override
public void save(List<AccidentRecordExcel> data) {
service.importAccidentRecord(data);
}
}

View File

@@ -0,0 +1,89 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 年检记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(22)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class AnnualInspectionRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车船类型")
private String vehicleType;
@ExcelProperty("车牌号/船号")
private String vehicleNo;
@ExcelProperty("检测评定日期")
private LocalDate inspectionAssessmentDate;
@ExcelProperty("车辆技术等级/船舶检验类型")
private String inspectionContent;
@ExcelProperty("有效期截止日")
private LocalDate validUntilDate;
@ExcelProperty("客车类型及等级")
private String passengerTypeLevel;
@ExcelProperty("检测评定单位")
private String inspectionUnit;
@ExcelProperty("费用")
private BigDecimal fee;
@ExcelProperty("评定(复核)单位")
private String assessmentUnit;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.IAnnualInspectionRecordService;
import java.util.List;
/**
* 年检记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class AnnualInspectionRecordImporter implements ExcelImporter<AnnualInspectionRecordExcel> {
private final IAnnualInspectionRecordService service;
@Override
public void save(List<AnnualInspectionRecordExcel> data) {
service.importAnnualInspectionRecord(data);
}
}

View File

@@ -0,0 +1,108 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 客商档案 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(22)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class CustomerArchiveExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelProperty("客商编号")
private String customerCode;
@ExcelProperty("客商简称")
private String shortName;
@ExcelProperty("客商名称")
private String fullName;
@ExcelProperty("客商类型")
private String customerType;
@ExcelProperty("客商性质")
private String customerNature;
@ExcelProperty("统一信用代码")
private String unifiedCreditCode;
@ExcelProperty("所属组织")
private String deptName;
@ExcelProperty("准入类型")
private String accessTypeName;
@ExcelProperty("审批状态")
private String approvalStatusName;
@ExcelProperty("当前节点")
private String currentNode;
@ExcelProperty("当前处理人")
private String currentProcessor;
@ExcelProperty("审核通过时间")
private LocalDateTime approvedTime;
@ExcelProperty("状态")
private String statusName;
@ExcelProperty("客户等级")
private String customerLevel;
@ExcelProperty("最大资金使用额度(万元)")
private BigDecimal maxCreditLimit;
@ExcelProperty("申请总资金使用额度(万元)")
private BigDecimal applyCreditLimit;
@ExcelProperty("联系电话")
private String contactPhone;
@ExcelProperty("法人/负责人")
private String legalPerson;
@ExcelProperty("创建时间")
private Date createTime;
}

View File

@@ -0,0 +1,119 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* 司机管理 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(18)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DriverExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("司机姓名")
private String driverName;
@ExcelProperty("身份证号")
private String idCardNo;
@ExcelProperty("手机号")
private String mobile;
@ExcelProperty("性别")
private String gender;
@ExcelProperty("司机类型")
private String driverType;
@ExcelProperty("岗位")
private String posts;
@ExcelProperty("所属组织")
private String organizationName;
@ExcelProperty("状态")
private String statusName;
@ExcelProperty("准驾车型")
private String drivingType;
@ExcelProperty("驾驶证档案编号")
private String drivingLicenseNo;
@ExcelProperty("驾驶证有效期起")
private LocalDate drivingLicenseStartDate;
@ExcelProperty("驾驶证有效期止")
private LocalDate drivingLicenseEndDate;
@ExcelProperty("驾驶证长期有效")
private String drivingLicenseLongTermName;
@ExcelProperty("从业资格证类型")
private String qualificationType;
@ExcelProperty("资格证号")
private String qualificationNo;
@ExcelProperty("从业资格证有效期止")
private LocalDate qualificationEndDate;
@ExcelProperty("从业资格证长期有效")
private String qualificationLongTermName;
@ExcelProperty("紧急联系人")
private String emergencyContactName;
@ExcelProperty("紧急联系人手机号")
private String emergencyContactMobile;
@ExcelProperty("与联系人关系")
private String contactRelation;
@ExcelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,64 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* ETC记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(22)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class EtcRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车牌号")
private String vehicleNo;
@ExcelProperty("ETC卡号")
private String etcCardNo;
@ExcelProperty("入口时间")
private LocalDateTime entryTime;
@ExcelProperty("出口时间")
private LocalDateTime exitTime;
@ExcelProperty("入口站")
private String entryStation;
@ExcelProperty("出口站")
private String exitStation;
@ExcelProperty("交易金额")
private BigDecimal transactionAmount;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,30 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.IEtcRecordService;
import java.util.List;
/**
* ETC记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class EtcRecordImporter implements ExcelImporter<EtcRecordExcel> {
private final IEtcRecordService service;
@Override
public void save(List<EtcRecordExcel> data) {
service.importEtcRecord(data);
}
}

View File

@@ -0,0 +1,92 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 保险记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(18)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class InsuranceRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车船类型")
private String vehicleType;
@ExcelProperty("车牌号/船号")
private String vehicleNo;
@ExcelProperty("保险类型")
private String insuranceType;
@ExcelProperty("保单号")
private String policyNo;
@ExcelProperty("开始日期")
private LocalDate startDate;
@ExcelProperty("结束日期")
private LocalDate endDate;
@ExcelProperty("保额")
private BigDecimal insuredAmount;
@ExcelProperty("保费")
private BigDecimal premium;
@ExcelProperty("发票号")
private String invoiceNo;
@ExcelProperty("开票日期")
private LocalDate invoiceDate;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.IInsuranceRecordService;
import java.util.List;
/**
* 保险记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class InsuranceRecordImporter implements ExcelImporter<InsuranceRecordExcel> {
private final IInsuranceRecordService service;
@Override
public void save(List<InsuranceRecordExcel> data) {
service.importInsuranceRecord(data);
}
}

View File

@@ -0,0 +1,76 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 里程记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(22)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class MileageRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车牌号")
private String vehicleNo;
@ExcelProperty("上月统计里程")
private BigDecimal previousMonthMileage;
@ExcelProperty("本月统计里程")
private BigDecimal currentMonthMileage;
@ExcelProperty("本月行驶里程")
private BigDecimal monthlyMileage;
@ExcelProperty("累计行驶里程")
private BigDecimal totalMileage;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.IMileageRecordService;
import java.util.List;
/**
* 里程记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class MileageRecordImporter implements ExcelImporter<MileageRecordExcel> {
private final IMileageRecordService service;
@Override
public void save(List<MileageRecordExcel> data) {
service.importMileageRecord(data);
}
}

View File

@@ -0,0 +1,85 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 油电记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(22)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class OilElectricRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车船类型")
private String vehicleType;
@ExcelProperty("车牌号/船号")
private String vehicleNo;
@ExcelProperty("交易时间")
private LocalDateTime transactionTime;
@ExcelProperty("费用类型")
private String feeType;
@ExcelProperty("交易金额")
private BigDecimal transactionAmount;
@ExcelProperty("数量")
private BigDecimal quantity;
@ExcelProperty("单价")
private BigDecimal unitPrice;
@ExcelProperty("持卡人")
private String cardHolder;
@ExcelProperty("余额")
private BigDecimal balance;
@ExcelProperty("油品")
private String oilProduct;
@ExcelProperty("站点")
private String station;
@ExcelProperty("卡号")
private String cardNo;
@ExcelProperty("数据来源")
private String dataSource;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,30 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.IOilElectricRecordService;
import java.util.List;
/**
* 油电记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class OilElectricRecordImporter implements ExcelImporter<OilElectricRecordExcel> {
private final IOilElectricRecordService service;
@Override
public void save(List<OilElectricRecordExcel> data) {
service.importOilElectricRecord(data);
}
}

View File

@@ -0,0 +1,58 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 其他费用记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(22)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class OtherExpenseRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("费用日期")
private LocalDate expenseDate;
@ExcelProperty("费用类型")
private String expenseType;
@ExcelProperty("车船类型")
private String vehicleType;
@ExcelProperty("车牌号/船号")
private String vehicleNo;
@ExcelProperty("金额")
private BigDecimal amount;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,30 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.IOtherExpenseRecordService;
import java.util.List;
/**
* 其他费用记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class OtherExpenseRecordImporter implements ExcelImporter<OtherExpenseRecordExcel> {
private final IOtherExpenseRecordService service;
@Override
public void save(List<OtherExpenseRecordExcel> data) {
service.importOtherExpenseRecord(data);
}
}

View File

@@ -0,0 +1,83 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 换胎记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(18)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class TireReplacementRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车牌号")
private String vehicleNo;
@ExcelProperty("处理人")
private String handler;
@ExcelProperty("换胎时间")
private LocalDate replacementTime;
@ExcelProperty("轮胎品牌")
private String tireBrand;
@ExcelProperty("换胎数量")
private Integer tireQuantity;
@ExcelProperty("换胎费用")
private BigDecimal replacementCost;
@ExcelProperty("换胎说明")
private String replacementDescription;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.ITireReplacementRecordService;
import java.util.List;
/**
* 换胎记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class TireReplacementRecordImporter implements ExcelImporter<TireReplacementRecordExcel> {
private final ITireReplacementRecordService service;
@Override
public void save(List<TireReplacementRecordExcel> data) {
service.importTireReplacementRecord(data);
}
}

View File

@@ -0,0 +1,72 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 变更记录 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(24)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class TransportChangeRecordExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("车船类型")
private String vehicleType;
@ExcelProperty("车牌号/船号")
private String vehicleNo;
@ExcelProperty("变更事项")
private String changeItem;
@ExcelProperty("变更内容")
private String changeContent;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
private String errorMessage;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.transport.service.ITransportChangeRecordService;
import java.util.List;
/**
* 变更记录导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class TransportChangeRecordImporter implements ExcelImporter<TransportChangeRecordExcel> {
private final ITransportChangeRecordService service;
@Override
public void save(List<TransportChangeRecordExcel> data) {
service.importTransportChangeRecord(data);
}
}

View File

@@ -0,0 +1,101 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* 船舶管理 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(18)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class TransportShipExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("船舶名")
private String shipName;
@ExcelProperty("船舶识别号")
private String shipIdentifierNo;
@ExcelProperty("所属组织")
private String organizationName;
@ExcelProperty("船检登记号")
private String shipInspectionNo;
@ExcelProperty("船舶类型")
private String shipType;
@ExcelProperty("国籍证有效期至")
private LocalDate nationalityCertEndDate;
@ExcelProperty("国籍证长期有效")
private String nationalityCertLongTermName;
@ExcelProperty("最低安全配员证书有效期至")
private LocalDate safeManningCertEndDate;
@ExcelProperty("最低安全配员证书长期有效")
private String safeManningCertLongTermName;
@ExcelProperty("营业运输证有效期至")
private LocalDate businessTransportCertEndDate;
@ExcelProperty("营业运输证长期有效")
private String businessTransportCertLongTermName;
@ExcelProperty("承租有效期至")
private LocalDate leaseEndDate;
@ExcelProperty("承租长期有效")
private String leaseLongTermName;
@ExcelProperty("状态")
private String statusName;
@ExcelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,137 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* 车辆管理 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(18)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class TransportVehicleExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long id;
@ExcelProperty("所属组织")
private String organizationName;
@ExcelProperty("车牌号")
private String plateNo;
@ExcelProperty("车辆类型")
private String vehicleType;
@ExcelProperty("外廓长度(mm)")
private Integer outerLength;
@ExcelProperty("外廓宽度(mm)")
private Integer outerWidth;
@ExcelProperty("外廓高度(mm)")
private Integer outerHeight;
@ExcelProperty("核定载质量(KG)")
private Integer approvedLoadKg;
@ExcelProperty("准牵引总质量(KG)")
private Integer tractionMassKg;
@ExcelProperty("业务关系")
private String businessRelation;
@ExcelProperty("能源类型")
private String energyType;
@ExcelProperty("强制报废日期")
private LocalDate compulsoryScrapDate;
@ExcelProperty("强制报废长期有效")
private String compulsoryScrapLongTermName;
@ExcelProperty("海关备案号")
private String customsRecordNo;
@ExcelProperty("行驶证档案编号")
private String drivingLicenseNo;
@ExcelProperty("行驶证有效期起")
private LocalDate drivingLicenseStartDate;
@ExcelProperty("行驶证有效期止")
private LocalDate drivingLicenseEndDate;
@ExcelProperty("行驶证长期有效")
private String drivingLicenseLongTermName;
@ExcelProperty("道路运输证号")
private String roadTransportCertNo;
@ExcelProperty("道路运输证有效期起")
private LocalDate roadTransportCertStartDate;
@ExcelProperty("道路运输证有效期止")
private LocalDate roadTransportCertEndDate;
@ExcelProperty("道路运输证长期有效")
private String roadTransportCertLongTermName;
@ExcelProperty("道路运输年审有效期")
private LocalDate annualReviewEndDate;
@ExcelProperty("道路运输年审长期有效")
private String annualReviewLongTermName;
@ExcelProperty("机动车登记编号")
private String registrationNo;
@ExcelProperty("机动车登记日期")
private LocalDate registrationDate;
@ExcelProperty("状态")
private String statusName;
@ExcelProperty("备注")
private String remark;
}

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