From 31c68a857a7f5a0757cefd88c216d20709cbb4f1 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Fri, 17 Jul 2026 15:32:00 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=B0=83=E6=95=B4=E5=B8=81=E7=A7=8D?= =?UTF-8?q?=E6=B1=87=E7=8E=87=E6=A8=A1=E5=9D=97=202=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BF=9D=E9=99=A9=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=203=E3=80=81=E6=96=B0=E5=A2=9E=E8=BF=9D=E7=AB=A0=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=A8=A1=E5=9D=97=204=E3=80=81=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8D=A2=E8=83=8E=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97=205?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9E=E4=BA=8B=E6=95=85=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=206=E3=80=81=E6=96=B0=E5=A2=9E=E5=B9=B4?= =?UTF-8?q?=E6=A3=80=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97=207=E3=80=81?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=8C=E7=A8=8B=E8=AE=B0=E5=BD=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=208=E3=80=81=E6=96=B0=E5=A2=9E=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97=209=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=B2=B9=E7=94=B5=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=2010=E3=80=81=E6=96=B0=E5=A2=9EETC=E8=AE=B0=E5=BD=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=2011=E3=80=81=E6=96=B0=E5=A2=9E=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 9 +- .../auth/endpoint/IamSsoEndpoint.java | 79 +++ .../auth/granter/IamSsoTokenGranter.java | 9 + .../system/pojo/entity/Currency.java | 18 +- .../system/pojo/vo/AirportMasterVO.java | 7 + .../system/pojo/vo/CurrencyVO.java | 42 +- .../system/pojo/vo/PortTerminalVO.java | 7 + .../system/pojo/vo/RailwayStationVO.java | 7 + .../transport/pojo/entity/AccidentRecord.java | 108 +++ .../pojo/entity/AnnualInspectionRecord.java | 88 +++ .../pojo/entity/CustomerArchive.java | 137 ++++ .../pojo/entity/CustomerChangeRecord.java | 63 ++ .../pojo/entity/CustomerContact.java | 71 ++ .../pojo/entity/CustomerCreditScore.java | 92 +++ .../entity/CustomerCreditScoreDetail.java | 92 +++ .../pojo/entity/CustomerInvoiceInfo.java | 86 +++ .../pojo/entity/CustomerReceiptAccount.java | 74 ++ .../transport/pojo/entity/Driver.java | 212 ++++++ .../transport/pojo/entity/EtcRecord.java | 63 ++ .../pojo/entity/InsuranceRecord.java | 118 ++++ .../transport/pojo/entity/MileageRecord.java | 72 ++ .../pojo/entity/OilElectricRecord.java | 97 +++ .../pojo/entity/OtherExpenseRecord.java | 57 ++ .../pojo/entity/TireReplacementRecord.java | 98 +++ .../pojo/entity/TransportChangeRecord.java | 68 ++ .../transport/pojo/entity/TransportShip.java | 105 +++ .../pojo/entity/TransportVehicle.java | 197 ++++++ .../pojo/entity/ViolationRecord.java | 123 ++++ .../transport/pojo/vo/AccidentRecordVO.java | 90 +++ .../pojo/vo/AnnualInspectionRecordVO.java | 75 +++ .../transport/pojo/vo/CustomerArchiveVO.java | 80 +++ .../pojo/vo/CustomerChangeRecordVO.java | 45 ++ .../transport/pojo/vo/CustomerContactVO.java | 45 ++ .../pojo/vo/CustomerCreditScoreDetailVO.java | 45 ++ .../pojo/vo/CustomerCreditScoreVO.java | 52 ++ .../pojo/vo/CustomerInvoiceInfoVO.java | 45 ++ .../pojo/vo/CustomerReceiptAccountVO.java | 45 ++ .../transport/pojo/vo/DriverExpiryStatVO.java | 55 ++ .../transport/pojo/vo/DriverVO.java | 72 ++ .../transport/pojo/vo/EtcRecordVO.java | 33 + .../transport/pojo/vo/InsuranceRecordVO.java | 73 ++ .../transport/pojo/vo/MaintenancePlanVO.java | 7 + .../pojo/vo/MaintenanceRecordVO.java | 7 + .../transport/pojo/vo/MileageRecordVO.java | 73 ++ .../pojo/vo/OilElectricRecordVO.java | 83 +++ .../pojo/vo/OtherExpenseRecordVO.java | 56 ++ .../pojo/vo/TireReplacementRecordVO.java | 73 ++ .../pojo/vo/TransportChangeRecordVO.java | 64 ++ .../pojo/vo/TransportShipExpiryStatVO.java | 55 ++ .../transport/pojo/vo/TransportShipVO.java | 65 ++ .../pojo/vo/TransportVehicleExpiryStatVO.java | 55 ++ .../transport/pojo/vo/TransportVehicleVO.java | 72 ++ .../transport/pojo/vo/ViolationRecordVO.java | 73 ++ .../springblade/system/cache/UserCache.java | 26 + .../system/controller/CurrencyController.java | 100 ++- .../system/excel/CurrencyExcel.java | 25 +- .../system/excel/CurrencyImporter.java | 2 +- .../system/mapper/CurrencyMapper.xml | 30 +- .../system/service/ICurrencyService.java | 20 +- .../service/impl/CurrencyServiceImpl.java | 133 ++-- .../system/wrapper/AirportMasterWrapper.java | 5 +- .../system/wrapper/PortTerminalWrapper.java | 5 +- .../system/wrapper/RailwayStationWrapper.java | 5 +- blade-service/blade-transport/pom.xml | 4 + .../controller/AccidentRecordController.java | 215 ++++++ .../AnnualInspectionRecordController.java | 185 +++++ .../controller/CustomerArchiveController.java | 221 ++++++ .../controller/DriverController.java | 241 +++++++ .../controller/EtcRecordController.java | 155 +++++ .../controller/InsuranceRecordController.java | 220 ++++++ .../controller/MileageRecordController.java | 182 +++++ .../OilElectricRecordController.java | 176 +++++ .../OtherExpenseRecordController.java | 170 +++++ .../TireReplacementRecordController.java | 197 ++++++ .../TransportChangeRecordController.java | 182 +++++ .../controller/TransportShipController.java | 222 ++++++ .../TransportVehicleController.java | 246 +++++++ .../controller/ViolationRecordController.java | 206 ++++++ .../transport/excel/AccidentRecordExcel.java | 89 +++ .../excel/AccidentRecordImporter.java | 49 ++ .../excel/AnnualInspectionRecordExcel.java | 89 +++ .../excel/AnnualInspectionRecordImporter.java | 49 ++ .../transport/excel/CustomerArchiveExcel.java | 108 +++ .../transport/excel/DriverExcel.java | 119 ++++ .../transport/excel/EtcRecordExcel.java | 64 ++ .../transport/excel/EtcRecordImporter.java | 30 + .../transport/excel/InsuranceRecordExcel.java | 92 +++ .../excel/InsuranceRecordImporter.java | 49 ++ .../transport/excel/MileageRecordExcel.java | 76 +++ .../excel/MileageRecordImporter.java | 49 ++ .../excel/OilElectricRecordExcel.java | 85 +++ .../excel/OilElectricRecordImporter.java | 30 + .../excel/OtherExpenseRecordExcel.java | 58 ++ .../excel/OtherExpenseRecordImporter.java | 30 + .../excel/TireReplacementRecordExcel.java | 83 +++ .../excel/TireReplacementRecordImporter.java | 49 ++ .../excel/TransportChangeRecordExcel.java | 72 ++ .../excel/TransportChangeRecordImporter.java | 49 ++ .../transport/excel/TransportShipExcel.java | 101 +++ .../excel/TransportVehicleExcel.java | 137 ++++ .../transport/excel/ViolationRecordExcel.java | 95 +++ .../excel/ViolationRecordImporter.java | 49 ++ .../mapper/AccidentRecordMapper.java | 51 ++ .../transport/mapper/AccidentRecordMapper.xml | 89 +++ .../mapper/AnnualInspectionRecordMapper.java | 51 ++ .../mapper/AnnualInspectionRecordMapper.xml | 81 +++ .../mapper/CustomerArchiveMapper.java | 49 ++ .../mapper/CustomerArchiveMapper.xml | 133 ++++ .../mapper/CustomerChangeRecordMapper.java | 21 + .../mapper/CustomerContactMapper.java | 21 + .../CustomerCreditScoreDetailMapper.java | 21 + .../mapper/CustomerCreditScoreMapper.java | 21 + .../mapper/CustomerInvoiceInfoMapper.java | 21 + .../mapper/CustomerReceiptAccountMapper.java | 21 + .../transport/mapper/DriverMapper.java | 61 ++ .../transport/mapper/DriverMapper.xml | 161 +++++ .../transport/mapper/EtcRecordMapper.java | 25 + .../transport/mapper/EtcRecordMapper.xml | 66 ++ .../mapper/InsuranceRecordMapper.java | 52 ++ .../mapper/InsuranceRecordMapper.xml | 80 +++ .../transport/mapper/MileageRecordMapper.java | 51 ++ .../transport/mapper/MileageRecordMapper.xml | 68 ++ .../mapper/OilElectricRecordMapper.java | 25 + .../mapper/OilElectricRecordMapper.xml | 96 +++ .../mapper/OtherExpenseRecordMapper.java | 25 + .../mapper/OtherExpenseRecordMapper.xml | 76 +++ .../mapper/TireReplacementRecordMapper.java | 51 ++ .../mapper/TireReplacementRecordMapper.xml | 66 ++ .../mapper/TransportChangeRecordMapper.java | 51 ++ .../mapper/TransportChangeRecordMapper.xml | 67 ++ .../transport/mapper/TransportShipMapper.java | 48 ++ .../transport/mapper/TransportShipMapper.xml | 136 ++++ .../mapper/TransportVehicleMapper.java | 61 ++ .../mapper/TransportVehicleMapper.xml | 156 +++++ .../mapper/ViolationRecordMapper.java | 52 ++ .../mapper/ViolationRecordMapper.xml | 86 +++ .../service/IAccidentRecordService.java | 76 +++ .../IAnnualInspectionRecordService.java | 52 ++ .../service/ICustomerArchiveService.java | 124 ++++ .../transport/service/IDriverService.java | 87 +++ .../transport/service/IEtcRecordService.java | 33 + .../service/IInsuranceRecordService.java | 87 +++ .../service/IMileageRecordService.java | 52 ++ .../service/IOilElectricRecordService.java | 33 + .../service/IOtherExpenseRecordService.java | 33 + .../ITireReplacementRecordService.java | 76 +++ .../ITransportChangeRecordService.java | 52 ++ .../service/ITransportShipService.java | 55 ++ .../service/ITransportVehicleService.java | 87 +++ .../service/IViolationRecordService.java | 76 +++ .../impl/AccidentRecordServiceImpl.java | 195 ++++++ .../AnnualInspectionRecordServiceImpl.java | 228 +++++++ .../CreditScoreQuantificationServiceImpl.java | 11 +- .../impl/CustomerArchiveServiceImpl.java | 633 ++++++++++++++++++ .../service/impl/DriverServiceImpl.java | 247 +++++++ .../service/impl/EtcRecordServiceImpl.java | 163 +++++ .../impl/InsuranceRecordServiceImpl.java | 229 +++++++ .../impl/MileageRecordServiceImpl.java | 195 ++++++ .../impl/OilElectricRecordServiceImpl.java | 203 ++++++ .../impl/OtherExpenseRecordServiceImpl.java | 179 +++++ .../TireReplacementRecordServiceImpl.java | 183 +++++ .../TransportChangeRecordServiceImpl.java | 160 +++++ .../impl/TransportShipServiceImpl.java | 219 ++++++ .../impl/TransportVehicleServiceImpl.java | 264 ++++++++ .../impl/ViolationRecordServiceImpl.java | 264 ++++++++ .../wrapper/AccidentRecordWrapper.java | 54 ++ .../AnnualInspectionRecordWrapper.java | 54 ++ .../wrapper/CustomerArchiveWrapper.java | 48 ++ .../transport/wrapper/DriverWrapper.java | 51 ++ .../transport/wrapper/EtcRecordWrapper.java | 35 + .../wrapper/InsuranceRecordWrapper.java | 54 ++ .../wrapper/MaintenancePlanWrapper.java | 5 +- .../wrapper/MaintenanceRecordWrapper.java | 5 +- .../wrapper/MileageRecordWrapper.java | 54 ++ .../wrapper/OilElectricRecordWrapper.java | 35 + .../wrapper/OtherExpenseRecordWrapper.java | 35 + .../wrapper/TireReplacementRecordWrapper.java | 54 ++ .../wrapper/TransportChangeRecordWrapper.java | 54 ++ .../wrapper/TransportShipWrapper.java | 51 ++ .../wrapper/TransportVehicleWrapper.java | 51 ++ .../wrapper/ViolationRecordWrapper.java | 54 ++ doc/sql/transport/blade_accident_record.sql | 46 ++ .../blade_annual_inspection_record.sql | 46 ++ doc/sql/transport/blade_currency.sql | 11 +- doc/sql/transport/blade_customer_archive.sql | 231 +++++++ doc/sql/transport/blade_etc_record.sql | 45 ++ doc/sql/transport/blade_insurance_record.sql | 49 ++ doc/sql/transport/blade_mileage_record.sql | 40 ++ .../transport/blade_oil_electric_record.sql | 50 ++ .../transport/blade_other_expense_record.sql | 43 ++ .../blade_tire_replacement_record.sql | 42 ++ .../blade_transport_change_record.sql | 40 ++ doc/sql/transport/blade_transport_driver.sql | 68 ++ doc/sql/transport/blade_transport_ship.sql | 70 ++ doc/sql/transport/blade_transport_vehicle.sql | 80 +++ doc/sql/transport/blade_violation_record.sql | 49 ++ doc/sql/transport/transport.sql | 471 ++++++++++++- 197 files changed, 16907 insertions(+), 115 deletions(-) create mode 100644 blade-auth/src/main/java/org/springblade/auth/endpoint/IamSsoEndpoint.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AccidentRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AnnualInspectionRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerArchive.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerChangeRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerContact.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScore.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScoreDetail.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerInvoiceInfo.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerReceiptAccount.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Driver.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/EtcRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/InsuranceRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/MileageRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OilElectricRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OtherExpenseRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TireReplacementRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportChangeRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportShip.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportVehicle.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/ViolationRecord.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AccidentRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AnnualInspectionRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerArchiveVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerChangeRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerContactVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreDetailVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerInvoiceInfoVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerReceiptAccountVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverExpiryStatVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/EtcRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/InsuranceRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MileageRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OilElectricRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OtherExpenseRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TireReplacementRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportChangeRecordVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipExpiryStatVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleExpiryStatVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ViolationRecordVO.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AccidentRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AnnualInspectionRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/DriverController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/EtcRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/InsuranceRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/MileageRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OilElectricRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OtherExpenseRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TireReplacementRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportChangeRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportShipController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportVehicleController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ViolationRecordController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/DriverExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportShipExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportVehicleExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordImporter.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerChangeRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerContactMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreDetailMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerInvoiceInfoMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerReceiptAccountMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.xml create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAccidentRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAnnualInspectionRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IDriverService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IEtcRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IInsuranceRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IMileageRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOilElectricRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOtherExpenseRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITireReplacementRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportChangeRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportShipService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportVehicleService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IViolationRecordService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AccidentRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AnnualInspectionRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CustomerArchiveServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/EtcRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InsuranceRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/MileageRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OilElectricRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OtherExpenseRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TireReplacementRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportChangeRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportShipServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportVehicleServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ViolationRecordServiceImpl.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AccidentRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AnnualInspectionRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/CustomerArchiveWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/DriverWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/EtcRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/InsuranceRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/MileageRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OilElectricRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OtherExpenseRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TireReplacementRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportChangeRecordWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportShipWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportVehicleWrapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/ViolationRecordWrapper.java create mode 100644 doc/sql/transport/blade_accident_record.sql create mode 100644 doc/sql/transport/blade_annual_inspection_record.sql create mode 100644 doc/sql/transport/blade_customer_archive.sql create mode 100644 doc/sql/transport/blade_etc_record.sql create mode 100644 doc/sql/transport/blade_insurance_record.sql create mode 100644 doc/sql/transport/blade_mileage_record.sql create mode 100644 doc/sql/transport/blade_oil_electric_record.sql create mode 100644 doc/sql/transport/blade_other_expense_record.sql create mode 100644 doc/sql/transport/blade_tire_replacement_record.sql create mode 100644 doc/sql/transport/blade_transport_change_record.sql create mode 100644 doc/sql/transport/blade_transport_driver.sql create mode 100644 doc/sql/transport/blade_transport_ship.sql create mode 100644 doc/sql/transport/blade_transport_vehicle.sql create mode 100644 doc/sql/transport/blade_violation_record.sql diff --git a/AGENTS.md b/AGENTS.md index bbb8bdb..c906667 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -197,7 +197,14 @@ Entity 基类的选择**直接决定** Service 和 ServiceImpl 的继承方式 - 分页统一使用 `Condition.getPage(query)` + `Condition.getQueryWrapper()` - 禁止 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`,占位符传参(禁止字符串拼接) - 包含关键业务标识,异常必须携带堆栈,禁止打印敏感信息 diff --git a/blade-auth/src/main/java/org/springblade/auth/endpoint/IamSsoEndpoint.java b/blade-auth/src/main/java/org/springblade/auth/endpoint/IamSsoEndpoint.java new file mode 100644 index 0000000..1b54103 --- /dev/null +++ b/blade-auth/src/main/java/org/springblade/auth/endpoint/IamSsoEndpoint.java @@ -0,0 +1,79 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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(); + } + +} diff --git a/blade-auth/src/main/java/org/springblade/auth/granter/IamSsoTokenGranter.java b/blade-auth/src/main/java/org/springblade/auth/granter/IamSsoTokenGranter.java index c357d78..1c37272 100644 --- a/blade-auth/src/main/java/org/springblade/auth/granter/IamSsoTokenGranter.java +++ b/blade-auth/src/main/java/org/springblade/auth/granter/IamSsoTokenGranter.java @@ -81,6 +81,7 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter { private static final String GRANT_TYPE = "iam_sso"; 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 BASIC_PREFIX = "Basic "; @@ -123,6 +124,9 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter { @Override public OAuth2User user(OAuth2Request request) { + if (!isDedicatedIamEndpoint(request)) { + throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT); + } if (!isIamRequest(request, true)) { throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT); } @@ -196,6 +200,11 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter { 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) { String redirectUri = normalizeRedirectUri(request.getRedirectUri()); boolean iamRequest = StringUtil.isNotBlank(properties.getRedirectUri()) diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/entity/Currency.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/entity/Currency.java index bb1206a..954f13f 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/entity/Currency.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/entity/Currency.java @@ -25,6 +25,8 @@ */ 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 io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -33,16 +35,17 @@ import org.springblade.core.mp.base.BaseEntity; import java.io.Serial; import java.math.BigDecimal; +import java.time.LocalDate; /** - * 币种主数据实体类 + * 币种汇率实体类 * * @author Chill */ @Data @EqualsAndHashCode(callSuper = true) @TableName("blade_currency") -@Schema(description = "币种主数据") +@Schema(description = "币种汇率") public class Currency extends BaseEntity { @Serial @@ -78,6 +81,17 @@ public class Currency extends BaseEntity { */ @Schema(description = "汇率") private BigDecimal exchangeRate; + /** + * 生效日期 + */ + @Schema(description = "生效日期") + private LocalDate effectiveDate; + /** + * 失效日期 + */ + @TableField(updateStrategy = FieldStrategy.ALWAYS) + @Schema(description = "失效日期") + private LocalDate expiryDate; /** * 是否本位币 */ diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/AirportMasterVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/AirportMasterVO.java index 731adc2..28c7da6 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/AirportMasterVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/AirportMasterVO.java @@ -52,4 +52,11 @@ public class AirportMasterVO extends AirportMaster { @Schema(description = "导入错误信息") private String errorMessage; + /** + * 更新人姓名 + */ + @TableField(exist = false) + @Schema(description = "更新人姓名") + private String updateUserName; + } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/CurrencyVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/CurrencyVO.java index e47f36f..37ed667 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/CurrencyVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/CurrencyVO.java @@ -30,17 +30,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.pojo.entity.Currency; +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 = "币种主数据") +@Schema(description = "币种汇率") public class CurrencyVO extends Currency { @Serial private static final long serialVersionUID = 1L; @@ -52,4 +55,39 @@ public class CurrencyVO extends Currency { @Schema(description = "导入错误信息") 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; + } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/PortTerminalVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/PortTerminalVO.java index 3da6ff1..78474b0 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/PortTerminalVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/PortTerminalVO.java @@ -52,4 +52,11 @@ public class PortTerminalVO extends PortTerminal { @Schema(description = "导入错误信息") private String errorMessage; + /** + * 更新人姓名 + */ + @TableField(exist = false) + @Schema(description = "更新人姓名") + private String updateUserName; + } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/RailwayStationVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/RailwayStationVO.java index 31bd234..c28a15f 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/RailwayStationVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/pojo/vo/RailwayStationVO.java @@ -52,4 +52,11 @@ public class RailwayStationVO extends RailwayStation { @Schema(description = "导入错误信息") private String errorMessage; + /** + * 更新人姓名 + */ + @TableField(exist = false) + @Schema(description = "更新人姓名") + private String updateUserName; + } diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AccidentRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AccidentRecord.java new file mode 100644 index 0000000..935fe47 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AccidentRecord.java @@ -0,0 +1,108 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AnnualInspectionRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AnnualInspectionRecord.java new file mode 100644 index 0000000..7abca83 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/AnnualInspectionRecord.java @@ -0,0 +1,88 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerArchive.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerArchive.java new file mode 100644 index 0000000..9170e97 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerArchive.java @@ -0,0 +1,137 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerChangeRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerChangeRecord.java new file mode 100644 index 0000000..dbda316 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerChangeRecord.java @@ -0,0 +1,63 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerContact.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerContact.java new file mode 100644 index 0000000..e0c5631 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerContact.java @@ -0,0 +1,71 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScore.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScore.java new file mode 100644 index 0000000..3307ce3 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScore.java @@ -0,0 +1,92 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScoreDetail.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScoreDetail.java new file mode 100644 index 0000000..2e388c0 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerCreditScoreDetail.java @@ -0,0 +1,92 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerInvoiceInfo.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerInvoiceInfo.java new file mode 100644 index 0000000..88cda22 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerInvoiceInfo.java @@ -0,0 +1,86 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerReceiptAccount.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerReceiptAccount.java new file mode 100644 index 0000000..ccf07ab --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/CustomerReceiptAccount.java @@ -0,0 +1,74 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Driver.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Driver.java new file mode 100644 index 0000000..a214768 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Driver.java @@ -0,0 +1,212 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/EtcRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/EtcRecord.java new file mode 100644 index 0000000..5a9e28a --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/EtcRecord.java @@ -0,0 +1,63 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/InsuranceRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/InsuranceRecord.java new file mode 100644 index 0000000..780e773 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/InsuranceRecord.java @@ -0,0 +1,118 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/MileageRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/MileageRecord.java new file mode 100644 index 0000000..f73b307 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/MileageRecord.java @@ -0,0 +1,72 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OilElectricRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OilElectricRecord.java new file mode 100644 index 0000000..cf2ad51 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OilElectricRecord.java @@ -0,0 +1,97 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OtherExpenseRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OtherExpenseRecord.java new file mode 100644 index 0000000..f5434d0 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/OtherExpenseRecord.java @@ -0,0 +1,57 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TireReplacementRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TireReplacementRecord.java new file mode 100644 index 0000000..5530bb9 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TireReplacementRecord.java @@ -0,0 +1,98 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportChangeRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportChangeRecord.java new file mode 100644 index 0000000..c39c96c --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportChangeRecord.java @@ -0,0 +1,68 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportShip.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportShip.java new file mode 100644 index 0000000..3fdcc55 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportShip.java @@ -0,0 +1,105 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportVehicle.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportVehicle.java new file mode 100644 index 0000000..d24c906 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/TransportVehicle.java @@ -0,0 +1,197 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/ViolationRecord.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/ViolationRecord.java new file mode 100644 index 0000000..28c628c --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/ViolationRecord.java @@ -0,0 +1,123 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AccidentRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AccidentRecordVO.java new file mode 100644 index 0000000..e06dc08 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AccidentRecordVO.java @@ -0,0 +1,90 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AnnualInspectionRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AnnualInspectionRecordVO.java new file mode 100644 index 0000000..d1d3c96 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/AnnualInspectionRecordVO.java @@ -0,0 +1,75 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerArchiveVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerArchiveVO.java new file mode 100644 index 0000000..a413eeb --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerArchiveVO.java @@ -0,0 +1,80 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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 contacts = new ArrayList<>(); + + @TableField(exist = false) + @Schema(description = "收款信息") + private List receiptAccounts = new ArrayList<>(); + + @TableField(exist = false) + @Schema(description = "发票信息") + private List invoices = new ArrayList<>(); + + @TableField(exist = false) + @Schema(description = "评分记录") + private List scores = new ArrayList<>(); + + @TableField(exist = false) + @Schema(description = "变更记录") + private List changeRecords = new ArrayList<>(); + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerChangeRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerChangeRecordVO.java new file mode 100644 index 0000000..008dca7 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerChangeRecordVO.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerContactVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerContactVO.java new file mode 100644 index 0000000..d4ccb73 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerContactVO.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreDetailVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreDetailVO.java new file mode 100644 index 0000000..aea5f61 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreDetailVO.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreVO.java new file mode 100644 index 0000000..45f55ee --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerCreditScoreVO.java @@ -0,0 +1,52 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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 details = new ArrayList<>(); + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerInvoiceInfoVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerInvoiceInfoVO.java new file mode 100644 index 0000000..0d88697 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerInvoiceInfoVO.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerReceiptAccountVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerReceiptAccountVO.java new file mode 100644 index 0000000..2778572 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/CustomerReceiptAccountVO.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverExpiryStatVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverExpiryStatVO.java new file mode 100644 index 0000000..a374594 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverExpiryStatVO.java @@ -0,0 +1,55 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverVO.java new file mode 100644 index 0000000..856575c --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/DriverVO.java @@ -0,0 +1,72 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/EtcRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/EtcRecordVO.java new file mode 100644 index 0000000..cef2656 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/EtcRecordVO.java @@ -0,0 +1,33 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/InsuranceRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/InsuranceRecordVO.java new file mode 100644 index 0000000..3af9b3b --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/InsuranceRecordVO.java @@ -0,0 +1,73 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenancePlanVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenancePlanVO.java index 4ad272b..bb4d225 100644 --- a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenancePlanVO.java +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenancePlanVO.java @@ -62,4 +62,11 @@ public class MaintenancePlanVO extends MaintenancePlan { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTimeEnd; + /** + * 更新人姓名 + */ + @TableField(exist = false) + @Schema(description = "更新人姓名") + private String updateUserName; + } diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenanceRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenanceRecordVO.java index 19d6cbd..260f094 100644 --- a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenanceRecordVO.java +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MaintenanceRecordVO.java @@ -62,4 +62,11 @@ public class MaintenanceRecordVO extends MaintenanceRecord { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTimeEnd; + /** + * 更新人姓名 + */ + @TableField(exist = false) + @Schema(description = "更新人姓名") + private String updateUserName; + } diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MileageRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MileageRecordVO.java new file mode 100644 index 0000000..4c39754 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/MileageRecordVO.java @@ -0,0 +1,73 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OilElectricRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OilElectricRecordVO.java new file mode 100644 index 0000000..94b3502 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OilElectricRecordVO.java @@ -0,0 +1,83 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OtherExpenseRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OtherExpenseRecordVO.java new file mode 100644 index 0000000..0c6db1e --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/OtherExpenseRecordVO.java @@ -0,0 +1,56 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TireReplacementRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TireReplacementRecordVO.java new file mode 100644 index 0000000..f914095 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TireReplacementRecordVO.java @@ -0,0 +1,73 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportChangeRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportChangeRecordVO.java new file mode 100644 index 0000000..2ae66b5 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportChangeRecordVO.java @@ -0,0 +1,64 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipExpiryStatVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipExpiryStatVO.java new file mode 100644 index 0000000..7a720bf --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipExpiryStatVO.java @@ -0,0 +1,55 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipVO.java new file mode 100644 index 0000000..76fb12a --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportShipVO.java @@ -0,0 +1,65 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleExpiryStatVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleExpiryStatVO.java new file mode 100644 index 0000000..271fc26 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleExpiryStatVO.java @@ -0,0 +1,55 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleVO.java new file mode 100644 index 0000000..46acec1 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/TransportVehicleVO.java @@ -0,0 +1,72 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ViolationRecordVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ViolationRecordVO.java new file mode 100644 index 0000000..98b7569 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ViolationRecordVO.java @@ -0,0 +1,73 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/cache/UserCache.java b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/cache/UserCache.java index a0c0ac2..0dbd04f 100644 --- a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/cache/UserCache.java +++ b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/cache/UserCache.java @@ -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); + } + /** * 获取用户 * diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/CurrencyController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/CurrencyController.java index b2dfd8f..d6ec0ef 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/CurrencyController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/CurrencyController.java @@ -25,8 +25,9 @@ */ 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.toolkit.Wrappers; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.v3.oas.annotations.Operation; 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.service.ICurrencyService; 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.PostMapping; 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.multipart.MultipartFile; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; -import java.util.Map; /** - * 币种主数据 控制器 + * 币种汇率 控制器 * * @author Chill */ @@ -71,7 +73,7 @@ import java.util.Map; @AllArgsConstructor @PreAuth(menu = "currency") @RequestMapping("/currency") -@Tag(name = "币种主数据", description = "币种主数据") +@Tag(name = "币种汇率", description = "币种汇率") public class CurrencyController extends BladeController { private final ICurrencyService currencyService; @@ -98,11 +100,22 @@ public class CurrencyController extends BladeController { return R.data(pages); } + /** + * 有效汇率查询 + */ + @GetMapping("/rate") + @ApiOperationSupport(order = 3) + @Operation(summary = "有效汇率查询", description = "根据币种编码和业务日期查询有效汇率") + public R 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") - @ApiOperationSupport(order = 3) + @ApiOperationSupport(order = 4) @Operation(summary = "新增或修改", description = "传入currency") public R submit(@Valid @RequestBody Currency currency) { return R.status(currencyService.submit(currency)); @@ -112,7 +125,7 @@ public class CurrencyController extends BladeController { * 删除 */ @PostMapping("/remove") - @ApiOperationSupport(order = 4) + @ApiOperationSupport(order = 5) @Operation(summary = "逻辑删除", description = "传入ids") public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { return R.status(currencyService.deleteLogic(Func.toLongList(ids))); @@ -122,7 +135,7 @@ public class CurrencyController extends BladeController { * 启用或停用 */ @PostMapping("/status") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 6) @Operation(summary = "启用或停用", description = "传入id和status") public R status(@Parameter(description = "主键", required = true) @RequestParam Long id, @Parameter(description = "状态", required = true) @RequestParam Integer status) { @@ -130,11 +143,11 @@ public class CurrencyController extends BladeController { } /** - * 导入币种主数据 + * 导入币种汇率 */ @PostMapping("/import-currency") - @ApiOperationSupport(order = 6) - @Operation(summary = "导入币种主数据", description = "传入excel") + @ApiOperationSupport(order = 7) + @Operation(summary = "导入币种汇率", description = "传入excel") public R importCurrency(MultipartFile file) { CurrencyImporter currencyImporter = new CurrencyImporter(currencyService); ExcelUtil.save(file, currencyImporter, CurrencyExcel.class); @@ -142,30 +155,71 @@ public class CurrencyController extends BladeController { } /** - * 导出币种主数据 + * 导出币种汇率 */ @GetMapping("/export-currency") - @ApiOperationSupport(order = 7) - @Operation(summary = "导出币种主数据") - public void exportCurrency(@Parameter(hidden = true) @RequestParam Map currency, HttpServletResponse response) { - Object ids = currency.remove("ids"); - QueryWrapper queryWrapper = Condition.getQueryWrapper(currency, Currency.class); - if (Func.isNotEmpty(ids)) { - queryWrapper.lambda().in(Currency::getId, Func.toLongList(ids.toString())); - } - List list = currencyService.exportCurrency(queryWrapper); - ExcelUtil.export(response, "币种主数据" + DateUtil.time(), "币种主数据表", list, CurrencyExcel.class); + @ApiOperationSupport(order = 8) + @Operation(summary = "导出币种汇率") + public void exportCurrency(CurrencyVO currency, + @RequestParam(required = false) String ids, + HttpServletResponse response) { + List list = currencyService.exportCurrency(buildExportQuery(currency, ids)); + ExcelUtil.export(response, "币种汇率" + DateUtil.time(), "币种汇率表", list, CurrencyExcel.class); } /** * 导出模板 */ @GetMapping("/export-template") - @ApiOperationSupport(order = 8) + @ApiOperationSupport(order = 9) @Operation(summary = "导出模板") public void exportTemplate(HttpServletResponse response) { List list = new ArrayList<>(); - ExcelUtil.export(response, "币种主数据模板", "币种主数据表", list, CurrencyExcel.class); + ExcelUtil.export(response, "币种汇率模板", "币种汇率表", list, CurrencyExcel.class); + } + + private LambdaQueryWrapper buildExportQuery(CurrencyVO currency, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; } } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyExcel.java b/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyExcel.java index 9083d77..89e6bf0 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyExcel.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyExcel.java @@ -35,9 +35,10 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; +import java.time.LocalDate; /** - * 币种主数据 Excel + * 币种汇率 Excel * * @author Chill */ @@ -58,27 +59,21 @@ public class CurrencyExcel implements Serializable { @ExcelProperty("币种中文名称") private String name; - @ExcelProperty("币种英文名称") - private String englishName; - - @ExcelProperty("货币符号") - private String symbol; - - @ExcelProperty("小数位数") - private Integer decimalPlaces; - @ExcelProperty("汇率") private BigDecimal exchangeRate; - @ExcelProperty("是否本位币") - private String baseCurrencyName; - - @ExcelProperty("数据来源") - private String dataSource; + @ExcelProperty("生效日期") + private LocalDate effectiveDate; @ExcelProperty("状态") private String statusName; + @ExcelProperty("来源") + private String dataSource; + + @ExcelProperty("失效日期") + private LocalDate expiryDate; + @ExcelProperty("备注") private String remark; diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyImporter.java b/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyImporter.java index 81ffdb3..b805902 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyImporter.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/excel/CurrencyImporter.java @@ -32,7 +32,7 @@ import org.springblade.system.service.ICurrencyService; import java.util.List; /** - * 币种主数据导入类 + * 币种汇率导入类 * * @author Chill */ diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/CurrencyMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/CurrencyMapper.xml index b44ba55..2a0a0f9 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/CurrencyMapper.xml +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/CurrencyMapper.xml @@ -17,6 +17,8 @@ + + @@ -41,16 +43,34 @@ AND english_name LIKE #{englishNameLike} - - AND is_base_currency = #{currency.baseCurrency} + + AND status = #{currency.status} + + + AND exchange_rate = #{currency.exchangeRate} AND data_source = #{currency.dataSource} - - AND status = #{currency.status} + + AND effective_date >= #{currency.effectiveDateStart} - ORDER BY update_time DESC, create_time DESC + + AND effective_date <= #{currency.effectiveDateEnd} + + + AND expiry_date >= #{currency.expiryDateStart} + + + AND expiry_date <= #{currency.expiryDateEnd} + + + AND update_time >= #{currency.updateTimeStart} + + + AND update_time <= #{currency.updateTimeEnd} + + ORDER BY code ASC, effective_date DESC, create_time DESC diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/ICurrencyService.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/ICurrencyService.java index 57e0a80..1908734 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/ICurrencyService.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/ICurrencyService.java @@ -32,10 +32,11 @@ import org.springblade.system.excel.CurrencyExcel; import org.springblade.system.pojo.entity.Currency; import org.springblade.system.pojo.vo.CurrencyVO; +import java.time.LocalDate; import java.util.List; /** - * 币种主数据 服务类 + * 币种汇率 服务类 * * @author Chill */ @@ -51,9 +52,9 @@ public interface ICurrencyService extends BaseService { IPage selectCurrencyPage(IPage page, CurrencyVO currency); /** - * 新增或修改币种 + * 新增或修改币种汇率 * - * @param currency 币种 + * @param currency 币种汇率 * @return 是否成功 */ boolean submit(Currency currency); @@ -68,18 +69,27 @@ public interface ICurrencyService extends BaseService { boolean changeStatus(Long id, Integer status); /** - * 导入币种 + * 导入币种汇率 * * @param data 导入数据 */ void importCurrency(List data); /** - * 导出币种 + * 导出币种汇率 * * @param queryWrapper 查询条件 * @return 导出数据 */ List exportCurrency(Wrapper queryWrapper); + /** + * 查询有效汇率 + * + * @param code 币种编码 + * @param businessDate 业务日期 + * @return 有效汇率 + */ + CurrencyVO getEffectiveRate(String code, LocalDate businessDate); + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CurrencyServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CurrencyServiceImpl.java index de6e6a3..4e52485 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CurrencyServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/CurrencyServiceImpl.java @@ -42,6 +42,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -49,7 +50,7 @@ import java.util.Objects; import java.util.regex.Pattern; /** - * 币种主数据 服务实现类 + * 币种汇率 服务实现类 * * @author Chill */ @@ -57,7 +58,7 @@ import java.util.regex.Pattern; public class CurrencyServiceImpl extends BaseServiceImpl implements ICurrencyService { 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_DISABLED = 2; private static final int YES = 1; @@ -65,6 +66,7 @@ public class CurrencyServiceImpl extends BaseServiceImpl data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } List errorList = new ArrayList<>(); + int successCount = 0; for (int index = 0; index < data.size(); index++) { CurrencyExcel excel = data.get(index); try { Currency currency = Objects.requireNonNull(BeanUtil.copyProperties(excel, Currency.class)); - currency.setBaseCurrency(parseBaseCurrency(excel.getBaseCurrencyName())); currency.setDataSource(SOURCE_BATCH); currency.setStatus(STATUS_ENABLED); prepare(currency, SOURCE_BATCH); validate(currency); save(currency); + rebuildEnabledValidity(currency.getCode()); + successCount++; } catch (Exception exception) { String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败"; errorList.add("第" + (index + 2) + "行:" + message); } } 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 currencyList = list(queryWrapper); return currencyList.stream().map(currency -> { CurrencyExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(currency, CurrencyExcel.class)); - excel.setBaseCurrencyName(Objects.equals(currency.getBaseCurrency(), YES) ? "是" : "否"); excel.setStatusName(Objects.equals(currency.getStatus(), STATUS_ENABLED) ? "启用" : "停用"); return excel; }).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.lambdaQuery() + .eq(Currency::getCode, currencyCode) + .eq(Currency::getIsDeleted, 0)) <= 0L) { + throw new ServiceException("币种不存在"); + } + LocalDate queryDate = businessDate == null ? LocalDate.now() : businessDate; + Currency currency = getOne(Wrappers.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) { currency.setCode(trimToEmpty(currency.getCode()).toUpperCase(Locale.ROOT)); currency.setName(trimToEmpty(currency.getName())); @@ -141,12 +180,10 @@ public class CurrencyServiceImpl extends BaseServiceImpl MAX_DECIMAL_PLACES) { throw new ServiceException("小数位数范围为0到8"); } + if (Func.isEmpty(currency.getExchangeRate())) { + throw new ServiceException("汇率不能为空"); + } if (currency.getExchangeRate().compareTo(BigDecimal.ZERO) <= 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)) { 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) { throw new ServiceException("备注不能超过200字"); } - validateUnique(currency, Currency::getCode, currency.getCode(), "该币种代码已存在"); - validateBaseCurrency(currency); + validateCodeName(currency); + validateUniqueEffectiveDate(currency); } - private void validateUnique(Currency currency, com.baomidou.mybatisplus.core.toolkit.support.SFunction column, String value, String message) { + private void validateUniqueEffectiveDate(Currency currency) { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() - .eq(column, value) + .eq(Currency::getCode, currency.getCode()) + .eq(Currency::getEffectiveDate, currency.getEffectiveDate()) .eq(Currency::getIsDeleted, 0); if (Func.isNotEmpty(currency.getId())) { queryWrapper.ne(Currency::getId, currency.getId()); } if (count(queryWrapper) > 0L) { - throw new ServiceException(message); + throw new ServiceException("同币种同生效日期已存在"); } } - private void validateBaseCurrency(Currency currency) { - if (!Objects.equals(currency.getBaseCurrency(), YES)) { + private void validateCodeName(Currency currency) { + LambdaQueryWrapper queryWrapper = Wrappers.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; } - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() - .eq(Currency::getBaseCurrency, YES) - .eq(Currency::getIsDeleted, 0); - if (Func.isNotEmpty(currency.getId())) { - queryWrapper.ne(Currency::getId, currency.getId()); + List enabledRecords = list(Wrappers.lambdaQuery() + .eq(Currency::getCode, currencyCode) + .eq(Currency::getStatus, STATUS_ENABLED) + .eq(Currency::getIsDeleted, 0) + .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) { diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/AirportMasterWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/AirportMasterWrapper.java index 09f6c1e..bb980c1 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/AirportMasterWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/AirportMasterWrapper.java @@ -27,6 +27,7 @@ package org.springblade.system.wrapper; import org.springblade.core.mp.support.BaseEntityWrapper; 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.vo.AirportMasterVO; @@ -45,7 +46,9 @@ public class AirportMasterWrapper extends BaseEntityWrapperorg.springblade blade-transport-api + + org.springblade + blade-user-api + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AccidentRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AccidentRecordController.java new file mode 100644 index 0000000..9c7b171 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AccidentRecordController.java @@ -0,0 +1,215 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(AccidentRecordVO accidentRecord, Query query) { + IPage 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 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 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 buildExportQuery(AccidentRecordVO accidentRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AnnualInspectionRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AnnualInspectionRecordController.java new file mode 100644 index 0000000..47cee3d --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/AnnualInspectionRecordController.java @@ -0,0 +1,185 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(AnnualInspectionRecordVO annualInspectionRecord, Query query) { + IPage 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 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 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 buildExportQuery(AnnualInspectionRecordVO annualInspectionRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java new file mode 100644 index 0000000..62764b3 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/CustomerArchiveController.java @@ -0,0 +1,221 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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 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> list(CustomerArchiveVO customerArchive, Query query) { + IPage 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 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 list = customerArchiveService.exportCustomerArchive(buildExportQuery(customerArchive, ids)); + ExcelUtil.export(response, "客商档案" + DateUtil.time(), "客商档案", list, CustomerArchiveExcel.class); + } + + private LambdaQueryWrapper buildExportQuery(CustomerArchiveVO customerArchive, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/DriverController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/DriverController.java new file mode 100644 index 0000000..e9a8265 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/DriverController.java @@ -0,0 +1,241 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(DriverVO driver, Query query) { + fillExpiryDate(driver); + IPage 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 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 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 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 buildExportQuery(DriverVO driver, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/EtcRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/EtcRecordController.java new file mode 100644 index 0000000..677fbba --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/EtcRecordController.java @@ -0,0 +1,155 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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 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> list(EtcRecordVO etcRecord, Query query) { + IPage 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 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 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 buildExportQuery(EtcRecordVO etcRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/InsuranceRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/InsuranceRecordController.java new file mode 100644 index 0000000..a623839 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/InsuranceRecordController.java @@ -0,0 +1,220 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(InsuranceRecordVO insuranceRecord, Query query) { + IPage 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 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 list = new ArrayList<>(); + ExcelUtil.export(response, "保险记录模板", "保险记录表", list, InsuranceRecordExcel.class); + } + + /** + * OCR识别保单 + */ + @PostMapping("/recognize") + @ApiOperationSupport(order = 8) + @Operation(summary = "OCR识别保单", description = "上传保单图片或PDF") + public R 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 buildExportQuery(InsuranceRecordVO insuranceRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/MileageRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/MileageRecordController.java new file mode 100644 index 0000000..5aed70b --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/MileageRecordController.java @@ -0,0 +1,182 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(MileageRecordVO mileageRecord, Query query) { + IPage 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 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 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 buildExportQuery(MileageRecordVO mileageRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OilElectricRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OilElectricRecordController.java new file mode 100644 index 0000000..9b23538 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OilElectricRecordController.java @@ -0,0 +1,176 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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 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> list(OilElectricRecordVO oilElectricRecord, Query query) { + IPage 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 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 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 buildExportQuery(OilElectricRecordVO oilElectricRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OtherExpenseRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OtherExpenseRecordController.java new file mode 100644 index 0000000..45b773b --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/OtherExpenseRecordController.java @@ -0,0 +1,170 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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 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> list(OtherExpenseRecordVO otherExpenseRecord, Query query) { + IPage 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 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 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 buildExportQuery(OtherExpenseRecordVO otherExpenseRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TireReplacementRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TireReplacementRecordController.java new file mode 100644 index 0000000..56d63a1 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TireReplacementRecordController.java @@ -0,0 +1,197 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(TireReplacementRecordVO tireReplacementRecord, Query query) { + IPage 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 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 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 buildExportQuery(TireReplacementRecordVO tireReplacementRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportChangeRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportChangeRecordController.java new file mode 100644 index 0000000..ed5d7f1 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportChangeRecordController.java @@ -0,0 +1,182 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(TransportChangeRecordVO transportChangeRecord, Query query) { + IPage 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 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 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 buildExportQuery(TransportChangeRecordVO transportChangeRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportShipController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportShipController.java new file mode 100644 index 0000000..a21e4fb --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportShipController.java @@ -0,0 +1,222 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(TransportShipVO ship, Query query) { + fillExpiryDate(ship); + IPage 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 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 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 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 buildExportQuery(TransportShipVO ship, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportVehicleController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportVehicleController.java new file mode 100644 index 0000000..ec60559 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/TransportVehicleController.java @@ -0,0 +1,246 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(TransportVehicleVO vehicle, Query query) { + fillExpiryDate(vehicle); + IPage 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 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 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 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 buildExportQuery(TransportVehicleVO vehicle, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ViolationRecordController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ViolationRecordController.java new file mode 100644 index 0000000..8098c50 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ViolationRecordController.java @@ -0,0 +1,206 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 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> list(ViolationRecordVO violationRecord, Query query) { + IPage 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 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 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 buildExportQuery(ViolationRecordVO violationRecord, String ids) { + LambdaQueryWrapper queryWrapper = Wrappers.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; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordExcel.java new file mode 100644 index 0000000..97faa62 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordExcel.java @@ -0,0 +1,89 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordImporter.java new file mode 100644 index 0000000..b6aeeff --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AccidentRecordImporter.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 { + + private final IAccidentRecordService service; + + @Override + public void save(List data) { + service.importAccidentRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordExcel.java new file mode 100644 index 0000000..98081bd --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordExcel.java @@ -0,0 +1,89 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordImporter.java new file mode 100644 index 0000000..9de4718 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/AnnualInspectionRecordImporter.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 { + + private final IAnnualInspectionRecordService service; + + @Override + public void save(List data) { + service.importAnnualInspectionRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java new file mode 100644 index 0000000..3db48f3 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/CustomerArchiveExcel.java @@ -0,0 +1,108 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/DriverExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/DriverExcel.java new file mode 100644 index 0000000..933c5fd --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/DriverExcel.java @@ -0,0 +1,119 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordExcel.java new file mode 100644 index 0000000..5d83d8e --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordExcel.java @@ -0,0 +1,64 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordImporter.java new file mode 100644 index 0000000..398a389 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/EtcRecordImporter.java @@ -0,0 +1,30 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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 { + + private final IEtcRecordService service; + + @Override + public void save(List data) { + service.importEtcRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordExcel.java new file mode 100644 index 0000000..8077577 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordExcel.java @@ -0,0 +1,92 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordImporter.java new file mode 100644 index 0000000..4eee159 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/InsuranceRecordImporter.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 { + + private final IInsuranceRecordService service; + + @Override + public void save(List data) { + service.importInsuranceRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordExcel.java new file mode 100644 index 0000000..54ae58e --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordExcel.java @@ -0,0 +1,76 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordImporter.java new file mode 100644 index 0000000..b701cc1 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/MileageRecordImporter.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 { + + private final IMileageRecordService service; + + @Override + public void save(List data) { + service.importMileageRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordExcel.java new file mode 100644 index 0000000..d71e5f1 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordExcel.java @@ -0,0 +1,85 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordImporter.java new file mode 100644 index 0000000..a078178 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OilElectricRecordImporter.java @@ -0,0 +1,30 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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 { + + private final IOilElectricRecordService service; + + @Override + public void save(List data) { + service.importOilElectricRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordExcel.java new file mode 100644 index 0000000..6246240 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordExcel.java @@ -0,0 +1,58 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordImporter.java new file mode 100644 index 0000000..639c817 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/OtherExpenseRecordImporter.java @@ -0,0 +1,30 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * 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 { + + private final IOtherExpenseRecordService service; + + @Override + public void save(List data) { + service.importOtherExpenseRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordExcel.java new file mode 100644 index 0000000..b6f7c73 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordExcel.java @@ -0,0 +1,83 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordImporter.java new file mode 100644 index 0000000..6c2b67c --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TireReplacementRecordImporter.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 { + + private final ITireReplacementRecordService service; + + @Override + public void save(List data) { + service.importTireReplacementRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordExcel.java new file mode 100644 index 0000000..6b3b2d8 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordExcel.java @@ -0,0 +1,72 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordImporter.java new file mode 100644 index 0000000..c27ce29 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportChangeRecordImporter.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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 { + + private final ITransportChangeRecordService service; + + @Override + public void save(List data) { + service.importTransportChangeRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportShipExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportShipExcel.java new file mode 100644 index 0000000..bf69825 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportShipExcel.java @@ -0,0 +1,101 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportVehicleExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportVehicleExcel.java new file mode 100644 index 0000000..2814475 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/TransportVehicleExcel.java @@ -0,0 +1,137 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordExcel.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordExcel.java new file mode 100644 index 0000000..51fbc5a --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordExcel.java @@ -0,0 +1,95 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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(18) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class ViolationRecordExcel implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + @ExcelIgnore + private Long id; + + @ExcelProperty("车船类型") + private String vehicleType; + + @ExcelProperty("车牌号/船号") + private String vehicleNo; + + @ExcelProperty("驾驶人") + private String driverName; + + @ExcelProperty("类型/事项") + private String violationContent; + + @ExcelProperty("时间") + private LocalDateTime violationTime; + + @ExcelProperty("地址") + private String location; + + @ExcelProperty("被罚金额") + private BigDecimal fineAmount; + + @ExcelProperty("被扣分数") + private Integer deductPoints; + + @ExcelProperty("被罚单位") + private String penaltyUnit; + + @ExcelProperty("状态") + private String processStatus; + + @ExcelProperty("过程描述") + private String processDescription; + + @ExcelProperty("处理结果") + private String processResult; + + @ExcelProperty("报错文案") + private String errorMessage; + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordImporter.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordImporter.java new file mode 100644 index 0000000..986db7c --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/excel/ViolationRecordImporter.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * 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.IViolationRecordService; + +import java.util.List; + +/** + * 违章记录导入类 + * + * @author Chill + */ +@RequiredArgsConstructor +public class ViolationRecordImporter implements ExcelImporter { + + private final IViolationRecordService service; + + @Override + public void save(List data) { + service.importViolationRecord(data); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.java new file mode 100644 index 0000000..0beed4e --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.AccidentRecord; +import org.springblade.transport.pojo.vo.AccidentRecordVO; + +import java.util.List; + +/** + * 事故记录 Mapper 接口 + * + * @author Chill + */ +public interface AccidentRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param accidentRecord 查询参数 + * @return 事故记录分页 + */ + List selectAccidentRecordPage(IPage page, AccidentRecordVO accidentRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.xml new file mode 100644 index 0000000..2e134ff --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AccidentRecordMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.java new file mode 100644 index 0000000..477a993 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.AnnualInspectionRecord; +import org.springblade.transport.pojo.vo.AnnualInspectionRecordVO; + +import java.util.List; + +/** + * 年检记录 Mapper 接口 + * + * @author Chill + */ +public interface AnnualInspectionRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param annualInspectionRecord 查询参数 + * @return 年检记录分页 + */ + List selectAnnualInspectionRecordPage(IPage page, AnnualInspectionRecordVO annualInspectionRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.xml new file mode 100644 index 0000000..d37d5e3 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/AnnualInspectionRecordMapper.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.java new file mode 100644 index 0000000..69dfa8b --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.java @@ -0,0 +1,49 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.springblade.transport.pojo.entity.CustomerArchive; +import org.springblade.transport.pojo.vo.CustomerArchiveVO; + +import java.util.List; + +/** + * 客商档案 Mapper 接口 + * + * @author Chill + */ +public interface CustomerArchiveMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param customer 查询参数 + * @return 客商档案列表 + */ + List selectCustomerArchivePage(IPage page, @Param("customer") CustomerArchiveVO customer); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.xml new file mode 100644 index 0000000..fd79cee --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerArchiveMapper.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerChangeRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerChangeRecordMapper.java new file mode 100644 index 0000000..b0a9efd --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerChangeRecordMapper.java @@ -0,0 +1,21 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.transport.pojo.entity.CustomerChangeRecord; + +/** + * 客商变更记录 Mapper 接口 + * + * @author Chill + */ +public interface CustomerChangeRecordMapper extends BaseMapper { +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerContactMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerContactMapper.java new file mode 100644 index 0000000..ef9f807 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerContactMapper.java @@ -0,0 +1,21 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.transport.pojo.entity.CustomerContact; + +/** + * 客商联系人 Mapper 接口 + * + * @author Chill + */ +public interface CustomerContactMapper extends BaseMapper { +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreDetailMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreDetailMapper.java new file mode 100644 index 0000000..6a17162 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreDetailMapper.java @@ -0,0 +1,21 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.transport.pojo.entity.CustomerCreditScoreDetail; + +/** + * 客商评分明细 Mapper 接口 + * + * @author Chill + */ +public interface CustomerCreditScoreDetailMapper extends BaseMapper { +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreMapper.java new file mode 100644 index 0000000..1e81377 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerCreditScoreMapper.java @@ -0,0 +1,21 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.transport.pojo.entity.CustomerCreditScore; + +/** + * 客商评分记录 Mapper 接口 + * + * @author Chill + */ +public interface CustomerCreditScoreMapper extends BaseMapper { +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerInvoiceInfoMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerInvoiceInfoMapper.java new file mode 100644 index 0000000..4d2fb62 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerInvoiceInfoMapper.java @@ -0,0 +1,21 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.transport.pojo.entity.CustomerInvoiceInfo; + +/** + * 客商发票信息 Mapper 接口 + * + * @author Chill + */ +public interface CustomerInvoiceInfoMapper extends BaseMapper { +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerReceiptAccountMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerReceiptAccountMapper.java new file mode 100644 index 0000000..9a26c36 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/CustomerReceiptAccountMapper.java @@ -0,0 +1,21 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springblade.transport.pojo.entity.CustomerReceiptAccount; + +/** + * 客商收款信息 Mapper 接口 + * + * @author Chill + */ +public interface CustomerReceiptAccountMapper extends BaseMapper { +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.java new file mode 100644 index 0000000..850d9b9 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.java @@ -0,0 +1,61 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.springblade.transport.pojo.entity.Driver; +import org.springblade.transport.pojo.vo.DriverExpiryStatVO; +import org.springblade.transport.pojo.vo.DriverVO; + +import java.util.List; + +/** + * 司机管理 Mapper 接口 + * + * @author Chill + */ +public interface DriverMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param driver 查询参数 + * @return 司机分页 + */ + List selectDriverPage(IPage page, @Param("driver") DriverVO driver); + + /** + * 证件有效期统计 + * + * @param driver 查询参数 + * @return 统计信息 + */ + DriverExpiryStatVO selectExpiryStat(@Param("driver") DriverVO driver); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.xml new file mode 100644 index 0000000..73aa017 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/DriverMapper.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, + tenant_id, + create_user, + create_dept, + create_time, + update_user, + update_time, + status, + is_deleted, + driver_name, + id_card_no, + birthday, + gender, + nation, + education, + address_region, + address, + posts, + id_card_front, + id_card_back, + head_photo, + driving_type, + driving_license_no, + driving_license_start_date, + driving_license_end_date, + driving_license_long_term, + driving_license_front, + driving_license_back, + qualification_type, + qualification_no, + qualification_end_date, + qualification_long_term, + qualification_front, + qualification_back, + driver_type, + mobile, + contact_relation, + organization_name, + emergency_contact_name, + emergency_contact_mobile, + remark + + + + is_deleted = 0 + + + AND driver_name LIKE #{driverNameLike} + + + + AND mobile LIKE #{mobileLike} + + + + AND id_card_no LIKE #{idCardNoLike} + + + AND driving_type = #{driver.drivingType} + + + AND driver_type = #{driver.driverType} + + + + AND organization_name LIKE #{organizationNameLike} + + + AND status = #{driver.status} + + + AND ( + (driving_license_long_term != 1 AND driving_license_end_date BETWEEN #{driver.today} AND #{driver.warningDate}) + OR (qualification_long_term != 1 AND qualification_end_date BETWEEN #{driver.today} AND #{driver.warningDate}) + ) + + + AND ( + (driving_license_long_term != 1 AND driving_license_end_date < #{driver.today}) + OR (qualification_long_term != 1 AND qualification_end_date < #{driver.today}) + ) + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.java new file mode 100644 index 0000000..d482cd3 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.java @@ -0,0 +1,25 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.EtcRecord; +import org.springblade.transport.pojo.vo.EtcRecordVO; + +import java.util.List; + +/** + * ETC记录 Mapper 接口 + * + * @author Chill + */ +public interface EtcRecordMapper extends BaseMapper { + + List selectEtcRecordPage(IPage page, EtcRecordVO etcRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.xml new file mode 100644 index 0000000..f4ba965 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/EtcRecordMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.java new file mode 100644 index 0000000..717d9c7 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.java @@ -0,0 +1,52 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.springblade.transport.pojo.entity.InsuranceRecord; +import org.springblade.transport.pojo.vo.InsuranceRecordVO; + +import java.util.List; + +/** + * 保险记录 Mapper 接口 + * + * @author Chill + */ +public interface InsuranceRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param insuranceRecord 查询参数 + * @return 保险记录列表 + */ + List selectInsuranceRecordPage(IPage page, @Param("insuranceRecord") InsuranceRecordVO insuranceRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.xml new file mode 100644 index 0000000..c70f572 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/InsuranceRecordMapper.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.java new file mode 100644 index 0000000..ac39f1b --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.MileageRecord; +import org.springblade.transport.pojo.vo.MileageRecordVO; + +import java.util.List; + +/** + * 里程记录 Mapper 接口 + * + * @author Chill + */ +public interface MileageRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param mileageRecord 查询参数 + * @return 里程记录分页 + */ + List selectMileageRecordPage(IPage page, MileageRecordVO mileageRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.xml new file mode 100644 index 0000000..9781cd5 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/MileageRecordMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.java new file mode 100644 index 0000000..eff0cda --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.java @@ -0,0 +1,25 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.OilElectricRecord; +import org.springblade.transport.pojo.vo.OilElectricRecordVO; + +import java.util.List; + +/** + * 油电记录 Mapper 接口 + * + * @author Chill + */ +public interface OilElectricRecordMapper extends BaseMapper { + + List selectOilElectricRecordPage(IPage page, OilElectricRecordVO oilElectricRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.xml new file mode 100644 index 0000000..8d1fcdb --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OilElectricRecordMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.java new file mode 100644 index 0000000..7568b1e --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.java @@ -0,0 +1,25 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.OtherExpenseRecord; +import org.springblade.transport.pojo.vo.OtherExpenseRecordVO; + +import java.util.List; + +/** + * 其他费用记录 Mapper 接口 + * + * @author Chill + */ +public interface OtherExpenseRecordMapper extends BaseMapper { + + List selectOtherExpenseRecordPage(IPage page, OtherExpenseRecordVO otherExpenseRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.xml new file mode 100644 index 0000000..b5c738f --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/OtherExpenseRecordMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.java new file mode 100644 index 0000000..19fd1fe --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.TireReplacementRecord; +import org.springblade.transport.pojo.vo.TireReplacementRecordVO; + +import java.util.List; + +/** + * 换胎记录 Mapper 接口 + * + * @author Chill + */ +public interface TireReplacementRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param tireReplacementRecord 查询参数 + * @return 换胎记录分页 + */ + List selectTireReplacementRecordPage(IPage page, TireReplacementRecordVO tireReplacementRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.xml new file mode 100644 index 0000000..eba5a70 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TireReplacementRecordMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.java new file mode 100644 index 0000000..b4978e6 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.transport.pojo.entity.TransportChangeRecord; +import org.springblade.transport.pojo.vo.TransportChangeRecordVO; + +import java.util.List; + +/** + * 变更记录 Mapper 接口 + * + * @author Chill + */ +public interface TransportChangeRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param transportChangeRecord 查询参数 + * @return 变更记录分页 + */ + List selectTransportChangeRecordPage(IPage page, TransportChangeRecordVO transportChangeRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.xml new file mode 100644 index 0000000..b4dcb0f --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportChangeRecordMapper.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.java new file mode 100644 index 0000000..26c51e4 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.java @@ -0,0 +1,48 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.springblade.transport.pojo.entity.TransportShip; +import org.springblade.transport.pojo.vo.TransportShipExpiryStatVO; +import org.springblade.transport.pojo.vo.TransportShipVO; + +import java.util.List; + +/** + * 船舶管理 Mapper 接口 + * + * @author Chill + */ +public interface TransportShipMapper extends BaseMapper { + + List selectTransportShipPage(IPage page, @Param("ship") TransportShipVO ship); + + TransportShipExpiryStatVO selectExpiryStat(@Param("ship") TransportShipVO ship); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.xml new file mode 100644 index 0000000..b257ed0 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportShipMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, + tenant_id, + create_user, + create_dept, + create_time, + update_user, + update_time, + status, + is_deleted, + ship_name, + ship_identifier_no, + organization_name, + ship_inspection_no, + ship_type, + nationality_cert_end_date, + nationality_cert_long_term, + nationality_cert_image, + safe_manning_cert_end_date, + safe_manning_cert_long_term, + safe_manning_cert_image, + business_transport_cert_end_date, + business_transport_cert_long_term, + business_transport_cert_image, + lease_end_date, + lease_long_term, + lease_contract_image, + remark + + + + ( + (nationality_cert_long_term != 1 AND nationality_cert_end_date BETWEEN #{ship.today} AND #{ship.warningDate}) + OR (safe_manning_cert_long_term != 1 AND safe_manning_cert_end_date BETWEEN #{ship.today} AND #{ship.warningDate}) + OR (business_transport_cert_long_term != 1 AND business_transport_cert_end_date BETWEEN #{ship.today} AND #{ship.warningDate}) + OR (lease_long_term != 1 AND lease_end_date BETWEEN #{ship.today} AND #{ship.warningDate}) + ) + + + + ( + (nationality_cert_long_term != 1 AND nationality_cert_end_date < #{ship.today}) + OR (safe_manning_cert_long_term != 1 AND safe_manning_cert_end_date < #{ship.today}) + OR (business_transport_cert_long_term != 1 AND business_transport_cert_end_date < #{ship.today}) + OR (lease_long_term != 1 AND lease_end_date < #{ship.today}) + ) + + + + is_deleted = 0 + + + AND ship_name LIKE #{shipNameLike} + + + + AND ship_identifier_no LIKE #{shipIdentifierNoLike} + + + + AND organization_name LIKE #{organizationNameLike} + + + + AND ship_inspection_no LIKE #{shipInspectionNoLike} + + + AND ship_type = #{ship.shipType} + + + AND status = #{ship.status} + + + AND + + + AND + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.java new file mode 100644 index 0000000..753664b --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.java @@ -0,0 +1,61 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.springblade.transport.pojo.entity.TransportVehicle; +import org.springblade.transport.pojo.vo.TransportVehicleExpiryStatVO; +import org.springblade.transport.pojo.vo.TransportVehicleVO; + +import java.util.List; + +/** + * 车辆管理 Mapper 接口 + * + * @author Chill + */ +public interface TransportVehicleMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param vehicle 查询参数 + * @return 车辆列表 + */ + List selectTransportVehiclePage(IPage page, @Param("vehicle") TransportVehicleVO vehicle); + + /** + * 证件有效期统计 + * + * @param vehicle 查询参数 + * @return 统计信息 + */ + TransportVehicleExpiryStatVO selectExpiryStat(@Param("vehicle") TransportVehicleVO vehicle); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.xml new file mode 100644 index 0000000..097ffe2 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/TransportVehicleMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, + tenant_id, + create_user, + create_dept, + create_time, + update_user, + update_time, + status, + is_deleted, + organization_name, + plate_no, + vehicle_type, + outer_length, + outer_width, + outer_height, + approved_load_kg, + traction_mass_kg, + business_relation, + energy_type, + compulsory_scrap_date, + compulsory_scrap_long_term, + customs_record_no, + driving_license_no, + driving_license_start_date, + driving_license_end_date, + driving_license_long_term, + driving_license_image, + road_transport_cert_no, + road_transport_cert_start_date, + road_transport_cert_end_date, + road_transport_cert_long_term, + road_transport_cert_image, + annual_review_end_date, + annual_review_long_term, + registration_no, + registration_date, + registration_image, + remark + + + + ( + (compulsory_scrap_long_term != 1 AND compulsory_scrap_date BETWEEN #{vehicle.today} AND #{vehicle.warningDate}) + OR (driving_license_long_term != 1 AND driving_license_end_date BETWEEN #{vehicle.today} AND #{vehicle.warningDate}) + OR (road_transport_cert_long_term != 1 AND road_transport_cert_end_date BETWEEN #{vehicle.today} AND #{vehicle.warningDate}) + OR (annual_review_long_term != 1 AND annual_review_end_date BETWEEN #{vehicle.today} AND #{vehicle.warningDate}) + ) + + + + ( + (compulsory_scrap_long_term != 1 AND compulsory_scrap_date < #{vehicle.today}) + OR (driving_license_long_term != 1 AND driving_license_end_date < #{vehicle.today}) + OR (road_transport_cert_long_term != 1 AND road_transport_cert_end_date < #{vehicle.today}) + OR (annual_review_long_term != 1 AND annual_review_end_date < #{vehicle.today}) + ) + + + + is_deleted = 0 + + + AND organization_name LIKE #{organizationNameLike} + + + + AND plate_no LIKE #{plateNoLike} + + + AND vehicle_type = #{vehicle.vehicleType} + + + AND business_relation = #{vehicle.businessRelation} + + + AND energy_type = #{vehicle.energyType} + + + AND status = #{vehicle.status} + + + AND + + + AND + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.java new file mode 100644 index 0000000..0bf7b27 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.java @@ -0,0 +1,52 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.springblade.transport.pojo.entity.ViolationRecord; +import org.springblade.transport.pojo.vo.ViolationRecordVO; + +import java.util.List; + +/** + * 违章记录 Mapper 接口 + * + * @author Chill + */ +public interface ViolationRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param violationRecord 查询参数 + * @return 违章记录列表 + */ + List selectViolationRecordPage(IPage page, @Param("violationRecord") ViolationRecordVO violationRecord); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.xml b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.xml new file mode 100644 index 0000000..7e75e35 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/ViolationRecordMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAccidentRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAccidentRecordService.java new file mode 100644 index 0000000..c3b9508 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAccidentRecordService.java @@ -0,0 +1,76 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.AccidentRecordExcel; +import org.springblade.transport.pojo.entity.AccidentRecord; +import org.springblade.transport.pojo.vo.AccidentRecordVO; + +import java.util.List; + +/** + * 事故记录 服务类 + * + * @author Chill + */ +public interface IAccidentRecordService extends BaseService { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param accidentRecord 查询参数 + * @return 事故记录分页 + */ + IPage selectAccidentRecordPage(IPage page, AccidentRecordVO accidentRecord); + + /** + * 新增或修改事故记录 + * + * @param accidentRecord 事故记录 + * @return 是否成功 + */ + boolean submit(AccidentRecord accidentRecord); + + /** + * 导入事故记录 + * + * @param data 导入数据 + */ + void importAccidentRecord(List data); + + /** + * 导出事故记录 + * + * @param queryWrapper 查询条件 + * @return 导出数据 + */ + List exportAccidentRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAnnualInspectionRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAnnualInspectionRecordService.java new file mode 100644 index 0000000..8dfe1b0 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IAnnualInspectionRecordService.java @@ -0,0 +1,52 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.AnnualInspectionRecordExcel; +import org.springblade.transport.pojo.entity.AnnualInspectionRecord; +import org.springblade.transport.pojo.vo.AnnualInspectionRecordVO; + +import java.util.List; + +/** + * 年检记录 服务类 + * + * @author Chill + */ +public interface IAnnualInspectionRecordService extends BaseService { + + IPage selectAnnualInspectionRecordPage(IPage page, AnnualInspectionRecordVO annualInspectionRecord); + + boolean submit(AnnualInspectionRecord annualInspectionRecord); + + void importAnnualInspectionRecord(List data); + + List exportAnnualInspectionRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java new file mode 100644 index 0000000..54d05f8 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ICustomerArchiveService.java @@ -0,0 +1,124 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +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 java.util.List; + +/** + * 客商档案 服务类 + * + * @author Chill + */ +public interface ICustomerArchiveService extends BaseService { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param customer 查询参数 + * @return 客商档案分页 + */ + IPage selectCustomerArchivePage(IPage page, CustomerArchiveVO customer); + + /** + * 聚合详情 + * + * @param id 主键 + * @return 客商档案详情 + */ + CustomerArchiveVO detail(Long id); + + /** + * 新增或修改客商档案 + * + * @param customer 客商档案 + * @return 是否成功 + */ + boolean submit(CustomerArchiveVO customer); + + /** + * 提交审核 + * + * @param id 主键 + * @return 是否成功 + */ + boolean submitApproval(Long id); + + /** + * 审核通过 + * + * @param id 主键 + * @return 是否成功 + */ + boolean approve(Long id); + + /** + * 审核驳回 + * + * @param id 主键 + * @return 是否成功 + */ + boolean reject(Long id); + + /** + * 启用或停用 + * + * @param id 主键 + * @param status 状态 + * @return 是否成功 + */ + boolean changeStatus(Long id, Integer status); + + /** + * 删除草稿客商 + * + * @param ids 主键集合 + * @return 是否成功 + */ + boolean removeDraft(String ids); + + /** + * 基于启用评分量化表生成评分记录 + * + * @param quantificationId 评分量化表ID + * @return 评分记录 + */ + CustomerCreditScoreVO buildScoreTemplate(Long quantificationId); + + /** + * 导出客商档案 + * + * @param queryWrapper 查询条件 + * @return 导出数据 + */ + List exportCustomerArchive(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IDriverService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IDriverService.java new file mode 100644 index 0000000..4520017 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IDriverService.java @@ -0,0 +1,87 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +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 java.util.List; + +/** + * 司机管理 服务类 + * + * @author Chill + */ +public interface IDriverService extends BaseService { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param driver 查询参数 + * @return 司机分页 + */ + IPage selectDriverPage(IPage page, DriverVO driver); + + /** + * 新增或修改司机 + * + * @param driver 司机 + * @return 是否成功 + */ + boolean submit(Driver driver); + + /** + * 修改状态 + * + * @param id 主键 + * @param status 状态 + * @return 是否成功 + */ + boolean changeStatus(Long id, Integer status); + + /** + * 证件有效期统计 + * + * @param driver 查询参数 + * @return 统计信息 + */ + DriverExpiryStatVO expiryStat(DriverVO driver); + + /** + * 导出司机 + * + * @param queryWrapper 查询条件 + * @return 导出数据 + */ + List exportDriver(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IEtcRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IEtcRecordService.java new file mode 100644 index 0000000..07214a9 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IEtcRecordService.java @@ -0,0 +1,33 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.EtcRecordExcel; +import org.springblade.transport.pojo.entity.EtcRecord; +import org.springblade.transport.pojo.vo.EtcRecordVO; + +import java.util.List; + +/** + * ETC记录 服务类 + * + * @author Chill + */ +public interface IEtcRecordService extends BaseService { + + IPage selectEtcRecordPage(IPage page, EtcRecordVO etcRecord); + + boolean submit(EtcRecord etcRecord); + + void importEtcRecord(List data); + + List exportEtcRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IInsuranceRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IInsuranceRecordService.java new file mode 100644 index 0000000..2cbb28e --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IInsuranceRecordService.java @@ -0,0 +1,87 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.InsuranceRecordExcel; +import org.springblade.transport.pojo.entity.InsuranceRecord; +import org.springblade.transport.pojo.vo.InsuranceRecordVO; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * 保险记录 服务类 + * + * @author Chill + */ +public interface IInsuranceRecordService extends BaseService { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param insuranceRecord 查询参数 + * @return 保险记录分页 + */ + IPage selectInsuranceRecordPage(IPage page, InsuranceRecordVO insuranceRecord); + + /** + * 新增或修改保险记录 + * + * @param insuranceRecord 保险记录 + * @return 是否成功 + */ + boolean submit(InsuranceRecord insuranceRecord); + + /** + * 导入保险记录 + * + * @param data 导入数据 + */ + void importInsuranceRecord(List data); + + /** + * 导出保险记录 + * + * @param queryWrapper 查询条件 + * @return 导出数据 + */ + List exportInsuranceRecord(Wrapper queryWrapper); + + /** + * 识别保单文件 + * + * @param file 保单图片或PDF + * @param vehicleType 车船类型 + * @param ocrTemplate OCR模板 + * @return 识别结果 + */ + InsuranceRecord recognizePolicy(MultipartFile file, String vehicleType, String ocrTemplate); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IMileageRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IMileageRecordService.java new file mode 100644 index 0000000..b3478ab --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IMileageRecordService.java @@ -0,0 +1,52 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.MileageRecordExcel; +import org.springblade.transport.pojo.entity.MileageRecord; +import org.springblade.transport.pojo.vo.MileageRecordVO; + +import java.util.List; + +/** + * 里程记录 服务类 + * + * @author Chill + */ +public interface IMileageRecordService extends BaseService { + + IPage selectMileageRecordPage(IPage page, MileageRecordVO mileageRecord); + + boolean submit(MileageRecord mileageRecord); + + void importMileageRecord(List data); + + List exportMileageRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOilElectricRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOilElectricRecordService.java new file mode 100644 index 0000000..b270435 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOilElectricRecordService.java @@ -0,0 +1,33 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.OilElectricRecordExcel; +import org.springblade.transport.pojo.entity.OilElectricRecord; +import org.springblade.transport.pojo.vo.OilElectricRecordVO; + +import java.util.List; + +/** + * 油电记录 服务类 + * + * @author Chill + */ +public interface IOilElectricRecordService extends BaseService { + + IPage selectOilElectricRecordPage(IPage page, OilElectricRecordVO oilElectricRecord); + + boolean submit(OilElectricRecord oilElectricRecord); + + void importOilElectricRecord(List data); + + List exportOilElectricRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOtherExpenseRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOtherExpenseRecordService.java new file mode 100644 index 0000000..7a5d763 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IOtherExpenseRecordService.java @@ -0,0 +1,33 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.OtherExpenseRecordExcel; +import org.springblade.transport.pojo.entity.OtherExpenseRecord; +import org.springblade.transport.pojo.vo.OtherExpenseRecordVO; + +import java.util.List; + +/** + * 其他费用记录 服务类 + * + * @author Chill + */ +public interface IOtherExpenseRecordService extends BaseService { + + IPage selectOtherExpenseRecordPage(IPage page, OtherExpenseRecordVO otherExpenseRecord); + + boolean submit(OtherExpenseRecord otherExpenseRecord); + + void importOtherExpenseRecord(List data); + + List exportOtherExpenseRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITireReplacementRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITireReplacementRecordService.java new file mode 100644 index 0000000..7e8d5a2 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITireReplacementRecordService.java @@ -0,0 +1,76 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.TireReplacementRecordExcel; +import org.springblade.transport.pojo.entity.TireReplacementRecord; +import org.springblade.transport.pojo.vo.TireReplacementRecordVO; + +import java.util.List; + +/** + * 换胎记录 服务类 + * + * @author Chill + */ +public interface ITireReplacementRecordService extends BaseService { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param tireReplacementRecord 查询参数 + * @return 换胎记录分页 + */ + IPage selectTireReplacementRecordPage(IPage page, TireReplacementRecordVO tireReplacementRecord); + + /** + * 新增或修改换胎记录 + * + * @param tireReplacementRecord 换胎记录 + * @return 是否成功 + */ + boolean submit(TireReplacementRecord tireReplacementRecord); + + /** + * 导入换胎记录 + * + * @param data 导入数据 + */ + void importTireReplacementRecord(List data); + + /** + * 导出换胎记录 + * + * @param queryWrapper 查询条件 + * @return 导出数据 + */ + List exportTireReplacementRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportChangeRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportChangeRecordService.java new file mode 100644 index 0000000..9dd406b --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportChangeRecordService.java @@ -0,0 +1,52 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.TransportChangeRecordExcel; +import org.springblade.transport.pojo.entity.TransportChangeRecord; +import org.springblade.transport.pojo.vo.TransportChangeRecordVO; + +import java.util.List; + +/** + * 变更记录 服务类 + * + * @author Chill + */ +public interface ITransportChangeRecordService extends BaseService { + + IPage selectTransportChangeRecordPage(IPage page, TransportChangeRecordVO transportChangeRecord); + + boolean submit(TransportChangeRecord transportChangeRecord); + + void importTransportChangeRecord(List data); + + List exportTransportChangeRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportShipService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportShipService.java new file mode 100644 index 0000000..f1a211a --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportShipService.java @@ -0,0 +1,55 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +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 java.util.List; + +/** + * 船舶管理 服务类 + * + * @author Chill + */ +public interface ITransportShipService extends BaseService { + + IPage selectTransportShipPage(IPage page, TransportShipVO ship); + + boolean submit(TransportShip ship); + + boolean changeStatus(Long id, Integer status); + + TransportShipExpiryStatVO expiryStat(TransportShipVO ship); + + List exportTransportShip(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportVehicleService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportVehicleService.java new file mode 100644 index 0000000..8b3a2d3 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/ITransportVehicleService.java @@ -0,0 +1,87 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +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 java.util.List; + +/** + * 车辆管理 服务类 + * + * @author Chill + */ +public interface ITransportVehicleService extends BaseService { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param vehicle 查询参数 + * @return 车辆分页 + */ + IPage selectTransportVehiclePage(IPage page, TransportVehicleVO vehicle); + + /** + * 新增或修改车辆 + * + * @param vehicle 车辆 + * @return 是否成功 + */ + boolean submit(TransportVehicle vehicle); + + /** + * 修改状态 + * + * @param id 主键 + * @param status 状态 + * @return 是否成功 + */ + boolean changeStatus(Long id, Integer status); + + /** + * 证件有效期统计 + * + * @param vehicle 查询参数 + * @return 统计信息 + */ + TransportVehicleExpiryStatVO expiryStat(TransportVehicleVO vehicle); + + /** + * 导出车辆 + * + * @param queryWrapper 查询条件 + * @return 导出数据 + */ + List exportTransportVehicle(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IViolationRecordService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IViolationRecordService.java new file mode 100644 index 0000000..c865351 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IViolationRecordService.java @@ -0,0 +1,76 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.transport.excel.ViolationRecordExcel; +import org.springblade.transport.pojo.entity.ViolationRecord; +import org.springblade.transport.pojo.vo.ViolationRecordVO; + +import java.util.List; + +/** + * 违章记录 服务类 + * + * @author Chill + */ +public interface IViolationRecordService extends BaseService { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param violationRecord 查询参数 + * @return 违章记录分页 + */ + IPage selectViolationRecordPage(IPage page, ViolationRecordVO violationRecord); + + /** + * 新增或修改违章记录 + * + * @param violationRecord 违章记录 + * @return 是否成功 + */ + boolean submit(ViolationRecord violationRecord); + + /** + * 导入违章记录 + * + * @param data 导入数据 + */ + void importViolationRecord(List data); + + /** + * 导出违章记录 + * + * @param queryWrapper 查询条件 + * @return 导出数据 + */ + List exportViolationRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AccidentRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AccidentRecordServiceImpl.java new file mode 100644 index 0000000..1b4bfe1 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AccidentRecordServiceImpl.java @@ -0,0 +1,195 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.AccidentRecordExcel; +import org.springblade.transport.mapper.AccidentRecordMapper; +import org.springblade.transport.pojo.entity.AccidentRecord; +import org.springblade.transport.pojo.vo.AccidentRecordVO; +import org.springblade.transport.service.IAccidentRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 事故记录 服务实现类 + * + * @author Chill + */ +@Service +public class AccidentRecordServiceImpl extends BaseServiceImpl implements IAccidentRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int LOCATION_MAX_LENGTH = 100; + private static final int REASON_DAMAGE_MAX_LENGTH = 500; + private static final int REMARK_MAX_LENGTH = 200; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MONEY_SCALE = 2; + private static final String VEHICLE = "车辆"; + private static final String SHIP = "船舶"; + + @Override + public IPage selectAccidentRecordPage(IPage page, AccidentRecordVO accidentRecord) { + return page.setRecords(baseMapper.selectAccidentRecordPage(page, accidentRecord)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(AccidentRecord accidentRecord) { + prepare(accidentRecord); + validate(accidentRecord); + validateVehicleTypeImmutable(accidentRecord); + return saveOrUpdate(accidentRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importAccidentRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + AccidentRecord accidentRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), AccidentRecord.class)); + submit(accidentRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportAccidentRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(accidentRecord -> { + AccidentRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(accidentRecord, AccidentRecordExcel.class)); + excel.setDirectEconomicLoss(nonNegative(accidentRecord.getDirectEconomicLoss())); + excel.setInsuranceClaimAmount(nonNegative(accidentRecord.getInsuranceClaimAmount())); + return excel; + }).toList(); + } + + private void prepare(AccidentRecord accidentRecord) { + accidentRecord.setVehicleType(normalizeVehicleType(accidentRecord.getVehicleType())); + accidentRecord.setVehicleNo(trimToEmpty(accidentRecord.getVehicleNo()).toUpperCase()); + accidentRecord.setAccidentLocation(trimToNull(accidentRecord.getAccidentLocation())); + accidentRecord.setAccidentNature(trimToNull(accidentRecord.getAccidentNature())); + accidentRecord.setAccidentResponsibility(trimToNull(accidentRecord.getAccidentResponsibility())); + accidentRecord.setAccidentReasonDamage(trimToNull(accidentRecord.getAccidentReasonDamage())); + accidentRecord.setAttachments(trimToNull(accidentRecord.getAttachments())); + accidentRecord.setRemark(trimToNull(accidentRecord.getRemark())); + } + + private void validate(AccidentRecord accidentRecord) { + if (Func.isEmpty(accidentRecord.getVehicleType())) { + throw new ServiceException("车船类型不能为空"); + } + if (!VEHICLE.equals(accidentRecord.getVehicleType()) && !SHIP.equals(accidentRecord.getVehicleType())) { + throw new ServiceException("车船类型不正确"); + } + if (Func.isEmpty(accidentRecord.getVehicleNo())) { + throw new ServiceException("车牌号/船号不能为空"); + } + if (Func.isEmpty(accidentRecord.getAccidentDate())) { + throw new ServiceException("事故发生日期不能为空"); + } + validateLength(accidentRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过30字"); + validateLength(accidentRecord.getAccidentLocation(), LOCATION_MAX_LENGTH, "事故发生地点不能超过100字"); + validateLength(accidentRecord.getAccidentReasonDamage(), REASON_DAMAGE_MAX_LENGTH, "事故原因及损坏情况不能超过500字"); + validateLength(accidentRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateLength(accidentRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + validateMoney(accidentRecord.getDirectEconomicLoss(), "直接经济损失"); + validateMoney(accidentRecord.getInsuranceClaimAmount(), "保险理赔金额"); + if (Func.isNotEmpty(accidentRecord.getInsuranceClaimAmount()) + && Func.isNotEmpty(accidentRecord.getDirectEconomicLoss()) + && accidentRecord.getInsuranceClaimAmount().compareTo(accidentRecord.getDirectEconomicLoss()) > 0) { + throw new ServiceException("保险理赔金额不能超过直接经济损失金额"); + } + } + + private void validateVehicleTypeImmutable(AccidentRecord accidentRecord) { + if (Func.isEmpty(accidentRecord.getId())) { + return; + } + AccidentRecord oldRecord = getById(accidentRecord.getId()); + if (oldRecord != null && Func.isNotEmpty(oldRecord.getVehicleType()) && !oldRecord.getVehicleType().equals(accidentRecord.getVehicleType())) { + throw new ServiceException("车船类型保存后不可修改"); + } + } + + private void validateMoney(BigDecimal value, String fieldName) { + if (Func.isEmpty(value)) { + return; + } + if (value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(fieldName + "不能小于0"); + } + if (value.stripTrailingZeros().scale() > MONEY_SCALE) { + throw new ServiceException(fieldName + "最多保留2位小数"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private String normalizeVehicleType(String vehicleType) { + String value = trimToEmpty(vehicleType); + return value.isEmpty() ? VEHICLE : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AnnualInspectionRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AnnualInspectionRecordServiceImpl.java new file mode 100644 index 0000000..3b40c29 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/AnnualInspectionRecordServiceImpl.java @@ -0,0 +1,228 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.AnnualInspectionRecordExcel; +import org.springblade.transport.mapper.AnnualInspectionRecordMapper; +import org.springblade.transport.pojo.entity.AnnualInspectionRecord; +import org.springblade.transport.pojo.vo.AnnualInspectionRecordVO; +import org.springblade.transport.service.IAnnualInspectionRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 年检记录 服务实现类 + * + * @author Chill + */ +@Service +public class AnnualInspectionRecordServiceImpl extends BaseServiceImpl implements IAnnualInspectionRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int PASSENGER_TYPE_LEVEL_MAX_LENGTH = 50; + private static final int INSPECTION_UNIT_MAX_LENGTH = 50; + private static final int ASSESSMENT_UNIT_MAX_LENGTH = 50; + private static final int REMARK_MAX_LENGTH = 200; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MONEY_SCALE = 2; + private static final String VEHICLE = "车辆"; + private static final String SHIP = "船舶"; + + @Override + public IPage selectAnnualInspectionRecordPage(IPage page, AnnualInspectionRecordVO annualInspectionRecord) { + return page.setRecords(baseMapper.selectAnnualInspectionRecordPage(page, annualInspectionRecord)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(AnnualInspectionRecord annualInspectionRecord) { + prepare(annualInspectionRecord); + validate(annualInspectionRecord); + validateVehicleTypeImmutable(annualInspectionRecord); + return saveOrUpdate(annualInspectionRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importAnnualInspectionRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + AnnualInspectionRecordExcel excel = data.get(index); + AnnualInspectionRecord annualInspectionRecord = Objects.requireNonNull(BeanUtil.copyProperties(excel, AnnualInspectionRecord.class)); + fillInspectionContent(annualInspectionRecord, excel.getInspectionContent()); + submit(annualInspectionRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportAnnualInspectionRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(annualInspectionRecord -> { + AnnualInspectionRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(annualInspectionRecord, AnnualInspectionRecordExcel.class)); + excel.setInspectionContent(inspectionContent(annualInspectionRecord)); + excel.setFee(nonNegative(annualInspectionRecord.getFee())); + return excel; + }).toList(); + } + + private void prepare(AnnualInspectionRecord annualInspectionRecord) { + annualInspectionRecord.setVehicleType(normalizeVehicleType(annualInspectionRecord.getVehicleType())); + annualInspectionRecord.setVehicleNo(trimToEmpty(annualInspectionRecord.getVehicleNo()).toUpperCase()); + annualInspectionRecord.setVehicleTechnicalLevel(trimToNull(annualInspectionRecord.getVehicleTechnicalLevel())); + annualInspectionRecord.setShipInspectionType(trimToNull(annualInspectionRecord.getShipInspectionType())); + annualInspectionRecord.setPassengerTypeLevel(trimToNull(annualInspectionRecord.getPassengerTypeLevel())); + annualInspectionRecord.setInspectionUnit(trimToNull(annualInspectionRecord.getInspectionUnit())); + annualInspectionRecord.setAssessmentUnit(trimToNull(annualInspectionRecord.getAssessmentUnit())); + annualInspectionRecord.setAttachments(trimToNull(annualInspectionRecord.getAttachments())); + annualInspectionRecord.setRemark(trimToNull(annualInspectionRecord.getRemark())); + if (annualInspectionRecord.getInspectionAssessmentDate() == null) { + annualInspectionRecord.setInspectionAssessmentDate(LocalDate.now()); + } + if (VEHICLE.equals(annualInspectionRecord.getVehicleType())) { + annualInspectionRecord.setShipInspectionType(null); + } else { + annualInspectionRecord.setVehicleTechnicalLevel(null); + annualInspectionRecord.setPassengerTypeLevel(null); + } + } + + private void validate(AnnualInspectionRecord annualInspectionRecord) { + if (Func.isEmpty(annualInspectionRecord.getVehicleType())) { + throw new ServiceException("车船类型不能为空"); + } + if (!VEHICLE.equals(annualInspectionRecord.getVehicleType()) && !SHIP.equals(annualInspectionRecord.getVehicleType())) { + throw new ServiceException("车船类型不正确"); + } + if (Func.isEmpty(annualInspectionRecord.getVehicleNo())) { + throw new ServiceException("车牌号/船号不能为空"); + } + if (VEHICLE.equals(annualInspectionRecord.getVehicleType()) && Func.isEmpty(annualInspectionRecord.getVehicleTechnicalLevel())) { + throw new ServiceException("车辆技术等级不能为空"); + } + if (SHIP.equals(annualInspectionRecord.getVehicleType()) && Func.isEmpty(annualInspectionRecord.getShipInspectionType())) { + throw new ServiceException("船舶检验类型不能为空"); + } + if (Func.isEmpty(annualInspectionRecord.getValidUntilDate())) { + throw new ServiceException("有效期截止日不能为空"); + } + if (!annualInspectionRecord.getValidUntilDate().isAfter(annualInspectionRecord.getInspectionAssessmentDate())) { + throw new ServiceException("有效期截止日应大于检测评定日期"); + } + if (Func.isEmpty(annualInspectionRecord.getFee())) { + throw new ServiceException("费用不能为空"); + } + validateLength(annualInspectionRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过30字"); + validateLength(annualInspectionRecord.getPassengerTypeLevel(), PASSENGER_TYPE_LEVEL_MAX_LENGTH, "客车类型及等级不能超过50字"); + validateLength(annualInspectionRecord.getInspectionUnit(), INSPECTION_UNIT_MAX_LENGTH, "检测评定单位不能超过50字"); + validateLength(annualInspectionRecord.getAssessmentUnit(), ASSESSMENT_UNIT_MAX_LENGTH, "评定(复核)单位不能超过50字"); + validateLength(annualInspectionRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateLength(annualInspectionRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + validateMoney(annualInspectionRecord.getFee(), "费用"); + } + + private void validateVehicleTypeImmutable(AnnualInspectionRecord annualInspectionRecord) { + if (Func.isEmpty(annualInspectionRecord.getId())) { + return; + } + AnnualInspectionRecord oldRecord = getById(annualInspectionRecord.getId()); + if (oldRecord != null && Func.isNotEmpty(oldRecord.getVehicleType()) && !oldRecord.getVehicleType().equals(annualInspectionRecord.getVehicleType())) { + throw new ServiceException("车船类型保存后不可修改"); + } + } + + private void fillInspectionContent(AnnualInspectionRecord annualInspectionRecord, String inspectionContent) { + if (SHIP.equals(normalizeVehicleType(annualInspectionRecord.getVehicleType()))) { + annualInspectionRecord.setShipInspectionType(inspectionContent); + } else { + annualInspectionRecord.setVehicleTechnicalLevel(inspectionContent); + } + } + + private String inspectionContent(AnnualInspectionRecord annualInspectionRecord) { + return SHIP.equals(annualInspectionRecord.getVehicleType()) ? annualInspectionRecord.getShipInspectionType() : annualInspectionRecord.getVehicleTechnicalLevel(); + } + + private void validateMoney(BigDecimal value, String fieldName) { + if (Func.isEmpty(value)) { + return; + } + if (value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(fieldName + "不能小于0"); + } + if (value.stripTrailingZeros().scale() > MONEY_SCALE) { + throw new ServiceException(fieldName + "最多保留2位小数"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private String normalizeVehicleType(String vehicleType) { + String value = trimToEmpty(vehicleType); + return value.isEmpty() ? VEHICLE : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java index 91526d3..7821374 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/CreditScoreQuantificationServiceImpl.java @@ -516,7 +516,7 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl sortedStandards = standards.stream() .sorted(Comparator.comparing(CreditRatingStandardVO::getScoreRateLower)) .toList(); - int expectedLower = 0; + Integer previousUpper = null; for (CreditRatingStandardVO standard : sortedStandards) { prepareStandard(standard); if (!creditLevels.add(standard.getCreditLevel())) { @@ -528,10 +528,10 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl= standard.getScoreRateUpper()) { throw new ServiceException("得分率下限必须小于上限"); } - if (standard.getScoreRateLower() != expectedLower) { - throw new ServiceException("信用等级得分率区间必须连续无断层"); + if (previousUpper != null && standard.getScoreRateLower() < previousUpper) { + throw new ServiceException("信用等级得分率区间不能重叠"); } - expectedLower = standard.getScoreRateUpper(); + previousUpper = standard.getScoreRateUpper(); validateNonNegative(standard.getCreditLimitLower(), "最大资金使用额度下限不能小于0"); validateNonNegative(standard.getCreditLimitUpper(), "最大资金使用额度上限不能小于0"); validateNonNegative(standard.getCreditLimitIncrease(), "额度增加不能小于0"); @@ -540,9 +540,6 @@ public class CreditScoreQuantificationServiceImpl extends BaseServiceImpl + * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.jackson.JsonUtil; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.CustomerArchiveExcel; +import org.springblade.transport.mapper.CreditRatingStandardMapper; +import org.springblade.transport.mapper.CreditScoreCategoryMapper; +import org.springblade.transport.mapper.CreditScoreItemMapper; +import org.springblade.transport.mapper.CreditScoreItemOptionMapper; +import org.springblade.transport.mapper.CreditScoreQuantificationMapper; +import org.springblade.transport.mapper.CustomerArchiveMapper; +import org.springblade.transport.mapper.CustomerChangeRecordMapper; +import org.springblade.transport.mapper.CustomerContactMapper; +import org.springblade.transport.mapper.CustomerCreditScoreDetailMapper; +import org.springblade.transport.mapper.CustomerCreditScoreMapper; +import org.springblade.transport.mapper.CustomerInvoiceInfoMapper; +import org.springblade.transport.mapper.CustomerReceiptAccountMapper; +import org.springblade.transport.pojo.entity.CreditRatingStandard; +import org.springblade.transport.pojo.entity.CreditScoreCategory; +import org.springblade.transport.pojo.entity.CreditScoreItem; +import org.springblade.transport.pojo.entity.CreditScoreItemOption; +import org.springblade.transport.pojo.entity.CreditScoreQuantification; +import org.springblade.transport.pojo.entity.CustomerArchive; +import org.springblade.transport.pojo.entity.CustomerChangeRecord; +import org.springblade.transport.pojo.entity.CustomerContact; +import org.springblade.transport.pojo.entity.CustomerCreditScore; +import org.springblade.transport.pojo.entity.CustomerCreditScoreDetail; +import org.springblade.transport.pojo.entity.CustomerInvoiceInfo; +import org.springblade.transport.pojo.entity.CustomerReceiptAccount; +import org.springblade.transport.pojo.vo.CustomerArchiveVO; +import org.springblade.transport.pojo.vo.CustomerChangeRecordVO; +import org.springblade.transport.pojo.vo.CustomerContactVO; +import org.springblade.transport.pojo.vo.CustomerCreditScoreDetailVO; +import org.springblade.transport.pojo.vo.CustomerCreditScoreVO; +import org.springblade.transport.pojo.vo.CustomerInvoiceInfoVO; +import org.springblade.transport.pojo.vo.CustomerReceiptAccountVO; +import org.springblade.transport.service.ICustomerArchiveService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 客商档案 服务实现类 + * + * @author Chill + */ +@Service +@RequiredArgsConstructor +public class CustomerArchiveServiceImpl extends BaseServiceImpl implements ICustomerArchiveService { + + private static final int STATUS_ENABLED = 1; + private static final int STATUS_DISABLED = 2; + private static final String ACCESS_TEMPORARY = "temporary"; + private static final String ACCESS_FORMAL = "formal"; + private static final String APPROVAL_DRAFT = "draft"; + private static final String APPROVAL_REVIEWING = "reviewing"; + private static final String APPROVAL_APPROVED = "approved"; + private static final String APPROVAL_REJECTED = "rejected"; + private static final String CUSTOMER_CODE_PREFIX = "KS"; + + private final CustomerContactMapper contactMapper; + private final CustomerReceiptAccountMapper receiptAccountMapper; + private final CustomerInvoiceInfoMapper invoiceInfoMapper; + private final CustomerCreditScoreMapper creditScoreMapper; + private final CustomerCreditScoreDetailMapper creditScoreDetailMapper; + private final CustomerChangeRecordMapper changeRecordMapper; + private final CreditScoreQuantificationMapper quantificationMapper; + private final CreditScoreCategoryMapper categoryMapper; + private final CreditScoreItemMapper itemMapper; + private final CreditScoreItemOptionMapper optionMapper; + private final CreditRatingStandardMapper standardMapper; + + @Override + public IPage selectCustomerArchivePage(IPage page, CustomerArchiveVO customer) { + return page.setRecords(baseMapper.selectCustomerArchivePage(page, customer)); + } + + @Override + public CustomerArchiveVO detail(Long id) { + if (Func.isEmpty(id)) { + throw new ServiceException("主键不能为空"); + } + CustomerArchive customer = getById(id); + if (Func.isEmpty(customer) || Objects.equals(customer.getIsDeleted(), 1)) { + throw new ServiceException("客商档案不存在"); + } + CustomerArchiveVO detail = Objects.requireNonNull(BeanUtil.copyProperties(customer, CustomerArchiveVO.class)); + detail.setContacts(loadContacts(id)); + detail.setReceiptAccounts(loadReceiptAccounts(id)); + detail.setInvoices(loadInvoices(id)); + detail.setScores(loadScores(id)); + detail.setChangeRecords(loadChangeRecords(id)); + return detail; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(CustomerArchiveVO customer) { + prepare(customer); + validateBase(customer); + boolean created = Func.isEmpty(customer.getId()); + if (created) { + customer.setCustomerCode(nextCustomerCode()); + } + CustomerArchive entity = Objects.requireNonNull(BeanUtil.copyProperties(customer, CustomerArchive.class)); + boolean result = saveOrUpdate(entity); + replaceDetail(entity.getId(), customer); + addChangeRecord(entity.getId(), created ? "新增客商档案" : "修改客商档案"); + return result; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submitApproval(Long id) { + CustomerArchiveVO detail = detail(id); + prepare(detail); + validateBase(detail); + validateApproval(detail); + CustomerArchive update = new CustomerArchive(); + update.setId(id); + update.setApprovalStatus(APPROVAL_REVIEWING); + update.setCurrentNode("客商准入审批"); + update.setCurrentProcessor("待处理"); + addChangeRecord(id, "提交客商准入审批"); + return updateById(update); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean approve(Long id) { + CustomerArchiveVO detail = detail(id); + prepare(detail); + validateBase(detail); + validateApproval(detail); + CustomerArchive update = new CustomerArchive(); + update.setId(id); + update.setApprovalStatus(APPROVAL_APPROVED); + update.setCurrentNode("审核通过"); + update.setCurrentProcessor(AuthUtil.getUserName()); + update.setApprovedTime(LocalDateTime.now()); + addChangeRecord(id, "客商准入审核通过"); + return updateById(update); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean reject(Long id) { + CustomerArchive update = new CustomerArchive(); + update.setId(id); + update.setApprovalStatus(APPROVAL_REJECTED); + update.setCurrentNode("审核不通过"); + update.setCurrentProcessor(AuthUtil.getUserName()); + addChangeRecord(id, "客商准入审核不通过"); + return updateById(update); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean changeStatus(Long id, Integer status) { + if (!Objects.equals(status, STATUS_ENABLED) && !Objects.equals(status, STATUS_DISABLED)) { + throw new ServiceException("启停状态不正确"); + } + CustomerArchive customer = getById(id); + if (Func.isEmpty(customer) || Objects.equals(customer.getIsDeleted(), 1)) { + throw new ServiceException("客商档案不存在"); + } + CustomerArchive update = new CustomerArchive(); + update.setId(id); + update.setStatus(status); + addChangeRecord(id, Objects.equals(status, STATUS_ENABLED) ? "启用客商档案" : "停用客商档案"); + return updateById(update); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeDraft(String ids) { + List idList = Func.toLongList(ids); + if (Func.isEmpty(idList)) { + throw new ServiceException("请选择需要删除的数据"); + } + List customers = listByIds(idList); + for (CustomerArchive customer : customers) { + if (!Objects.equals(customer.getApprovalStatus(), APPROVAL_DRAFT)) { + throw new ServiceException("仅草稿状态客商可删除"); + } + } + deleteDetail(idList); + return deleteLogic(idList); + } + + @Override + public CustomerCreditScoreVO buildScoreTemplate(Long quantificationId) { + CreditScoreQuantification quantification = resolveQuantification(quantificationId); + CustomerCreditScoreVO score = new CustomerCreditScoreVO(); + score.setQuantificationId(quantification.getId()); + score.setScoreDate(LocalDate.now()); + score.setSelfStatus("未完成"); + score.setReviewStatus("未完成"); + score.setDetails(loadScoreTemplateDetails(quantification.getId())); + return score; + } + + @Override + public List exportCustomerArchive(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(this::buildExcel).toList(); + } + + private void prepare(CustomerArchiveVO customer) { + customer.setShortName(trimToNull(customer.getShortName())); + customer.setFullName(trimToEmpty(customer.getFullName())); + customer.setCustomerNature(trimToEmpty(customer.getCustomerNature())); + customer.setUnifiedCreditCode(trimToEmpty(customer.getUnifiedCreditCode())); + customer.setCustomerType(trimToEmpty(customer.getCustomerType())); + customer.setLegalPerson(trimToEmpty(customer.getLegalPerson())); + customer.setContactPhone(trimToEmpty(customer.getContactPhone())); + customer.setDeptName(trimToEmpty(customer.getDeptName())); + customer.setAccessType(Func.isEmpty(customer.getAccessType()) ? ACCESS_TEMPORARY : customer.getAccessType()); + customer.setApprovalStatus(Func.isEmpty(customer.getApprovalStatus()) ? APPROVAL_DRAFT : customer.getApprovalStatus()); + if (Func.isEmpty(customer.getStatus())) { + customer.setStatus(STATUS_ENABLED); + } + customer.setContacts(customer.getContacts() == null ? new ArrayList<>() : customer.getContacts()); + customer.setReceiptAccounts(customer.getReceiptAccounts() == null ? new ArrayList<>() : customer.getReceiptAccounts()); + customer.setInvoices(customer.getInvoices() == null ? new ArrayList<>() : customer.getInvoices()); + customer.setScores(customer.getScores() == null ? new ArrayList<>() : customer.getScores()); + } + + private void validateBase(CustomerArchiveVO customer) { + if (Func.isEmpty(customer.getFullName())) { + throw new ServiceException("客商全称不能为空"); + } + if (Func.isEmpty(customer.getCustomerNature())) { + throw new ServiceException("客商性质不能为空"); + } + if (Func.isEmpty(customer.getUnifiedCreditCode())) { + throw new ServiceException("统一社会信用代码不能为空"); + } + if (!customer.getUnifiedCreditCode().matches("^[A-Z0-9]{18}$")) { + throw new ServiceException("统一社会信用代码必须为18位大写字母或数字"); + } + if (Func.isEmpty(customer.getCustomerType())) { + throw new ServiceException("客商类型不能为空"); + } + if (Func.isEmpty(customer.getLegalPerson())) { + throw new ServiceException("法人/负责人不能为空"); + } + if (Func.isEmpty(customer.getContactPhone())) { + throw new ServiceException("联系电话不能为空"); + } + if (!customer.getContactPhone().matches("^1\\d{10}$")) { + throw new ServiceException("联系电话必须为11位手机号"); + } + if (Func.isEmpty(customer.getDeptName())) { + throw new ServiceException("所属组织不能为空"); + } + validateLength(customer.getShortName(), 20, "客商简称最多20个汉字"); + validateLength(customer.getFullName(), 100, "客商全称最多100个字符"); + validateLength(customer.getRegisteredAddress(), 200, "地址最多200个字符"); + validateLength(customer.getBusinessScope(), 500, "经营范围最多500个字符"); + validateLength(customer.getRemark(), 500, "备注最多500个字符"); + validateNonNegative(customer.getInvoiceTaxRate(), "开票税点不能小于0"); + validateNonNegative(customer.getRegisteredCapital(), "注册资金不能小于0"); + validateNonNegative(customer.getMaxCreditLimit(), "最大资金使用额度不能小于0"); + validateNonNegative(customer.getApplyCreditLimit(), "申请总资金使用额度不能小于0"); + validateUnique(customer); + } + + private void validateApproval(CustomerArchiveVO customer) { + if (Objects.equals(customer.getAccessType(), ACCESS_FORMAL)) { + if (Func.isEmpty(customer.getQualificationAttachments())) { + throw new ServiceException("正式客商提交审核前必须上传资质附件"); + } + boolean hasCompletedScore = customer.getScores().stream() + .anyMatch(score -> "已完成".equals(score.getSelfStatus()) || "已完成".equals(score.getReviewStatus()) || Func.isNotEmpty(score.getFinalScore())); + if (!hasCompletedScore) { + throw new ServiceException("正式客商提交审核前必须完成信用评分"); + } + } + } + + private void validateUnique(CustomerArchiveVO customer) { + if (count(Wrappers.lambdaQuery() + .eq(CustomerArchive::getUnifiedCreditCode, customer.getUnifiedCreditCode()) + .eq(CustomerArchive::getIsDeleted, 0) + .ne(Func.isNotEmpty(customer.getId()), CustomerArchive::getId, customer.getId())) > 0L) { + throw new ServiceException("统一社会信用代码已存在"); + } + if (Func.isNotEmpty(customer.getCustomerCode()) && count(Wrappers.lambdaQuery() + .eq(CustomerArchive::getCustomerCode, customer.getCustomerCode()) + .eq(CustomerArchive::getIsDeleted, 0) + .ne(Func.isNotEmpty(customer.getId()), CustomerArchive::getId, customer.getId())) > 0L) { + throw new ServiceException("客商编号已存在"); + } + } + + private void replaceDetail(Long customerId, CustomerArchiveVO customer) { + deleteDetail(List.of(customerId)); + insertContacts(customerId, customer.getContacts()); + insertReceiptAccounts(customerId, customer.getReceiptAccounts()); + insertInvoices(customerId, customer.getInvoices()); + insertScores(customerId, customer.getScores()); + } + + private void insertContacts(Long customerId, List contacts) { + for (CustomerContactVO contactVO : contacts) { + if (Func.isEmpty(contactVO.getContactName()) && Func.isEmpty(contactVO.getContactPhone())) { + continue; + } + CustomerContact contact = Objects.requireNonNull(BeanUtil.copyProperties(contactVO, CustomerContact.class)); + contact.setId(IdWorker.getId()); + contact.setCustomerId(customerId); + contact.setStatus(STATUS_ENABLED); + contactMapper.insert(contact); + } + } + + private void insertReceiptAccounts(Long customerId, List accounts) { + for (CustomerReceiptAccountVO accountVO : accounts) { + if (Func.isEmpty(accountVO.getAccountName()) && Func.isEmpty(accountVO.getBankAccount())) { + continue; + } + CustomerReceiptAccount account = Objects.requireNonNull(BeanUtil.copyProperties(accountVO, CustomerReceiptAccount.class)); + account.setId(IdWorker.getId()); + account.setCustomerId(customerId); + account.setStatus(STATUS_ENABLED); + receiptAccountMapper.insert(account); + } + } + + private void insertInvoices(Long customerId, List invoices) { + for (CustomerInvoiceInfoVO invoiceVO : invoices) { + if (Func.isEmpty(invoiceVO.getInvoiceTitle()) && Func.isEmpty(invoiceVO.getTaxNo())) { + continue; + } + CustomerInvoiceInfo invoice = Objects.requireNonNull(BeanUtil.copyProperties(invoiceVO, CustomerInvoiceInfo.class)); + invoice.setId(IdWorker.getId()); + invoice.setCustomerId(customerId); + invoice.setStatus(STATUS_ENABLED); + invoiceInfoMapper.insert(invoice); + } + } + + private void insertScores(Long customerId, List scores) { + for (CustomerCreditScoreVO scoreVO : scores) { + if (Func.isEmpty(scoreVO.getQuantificationId()) && Func.isEmpty(scoreVO.getScoreDate())) { + continue; + } + Long scoreId = IdWorker.getId(); + CustomerCreditScore score = Objects.requireNonNull(BeanUtil.copyProperties(scoreVO, CustomerCreditScore.class)); + score.setId(scoreId); + score.setCustomerId(customerId); + score.setStatus(STATUS_ENABLED); + creditScoreMapper.insert(score); + List details = scoreVO.getDetails() == null ? new ArrayList<>() : scoreVO.getDetails(); + for (int detailIndex = 0; detailIndex < details.size(); detailIndex++) { + CustomerCreditScoreDetail detail = Objects.requireNonNull(BeanUtil.copyProperties(details.get(detailIndex), CustomerCreditScoreDetail.class)); + detail.setId(IdWorker.getId()); + detail.setScoreId(scoreId); + detail.setQuantificationId(score.getQuantificationId()); + detail.setSort(detailIndex + 1); + detail.setStatus(STATUS_ENABLED); + creditScoreDetailMapper.insert(detail); + } + } + } + + private void deleteDetail(List customerIds) { + contactMapper.update(null, Wrappers.lambdaUpdate().in(CustomerContact::getCustomerId, customerIds).set(CustomerContact::getIsDeleted, 1)); + receiptAccountMapper.update(null, Wrappers.lambdaUpdate().in(CustomerReceiptAccount::getCustomerId, customerIds).set(CustomerReceiptAccount::getIsDeleted, 1)); + invoiceInfoMapper.update(null, Wrappers.lambdaUpdate().in(CustomerInvoiceInfo::getCustomerId, customerIds).set(CustomerInvoiceInfo::getIsDeleted, 1)); + List scores = creditScoreMapper.selectList(Wrappers.lambdaQuery().in(CustomerCreditScore::getCustomerId, customerIds).eq(CustomerCreditScore::getIsDeleted, 0)); + if (Func.isNotEmpty(scores)) { + List scoreIds = scores.stream().map(CustomerCreditScore::getId).toList(); + creditScoreDetailMapper.update(null, Wrappers.lambdaUpdate().in(CustomerCreditScoreDetail::getScoreId, scoreIds).set(CustomerCreditScoreDetail::getIsDeleted, 1)); + creditScoreMapper.update(null, Wrappers.lambdaUpdate().in(CustomerCreditScore::getId, scoreIds).set(CustomerCreditScore::getIsDeleted, 1)); + } + } + + private List loadContacts(Long customerId) { + return contactMapper.selectList(Wrappers.lambdaQuery() + .eq(CustomerContact::getCustomerId, customerId) + .eq(CustomerContact::getIsDeleted, 0) + .orderByDesc(CustomerContact::getIsDefault) + .orderByAsc(CustomerContact::getCreateTime)) + .stream().map(contact -> Objects.requireNonNull(BeanUtil.copyProperties(contact, CustomerContactVO.class))).toList(); + } + + private List loadReceiptAccounts(Long customerId) { + return receiptAccountMapper.selectList(Wrappers.lambdaQuery() + .eq(CustomerReceiptAccount::getCustomerId, customerId) + .eq(CustomerReceiptAccount::getIsDeleted, 0) + .orderByDesc(CustomerReceiptAccount::getIsDefault) + .orderByAsc(CustomerReceiptAccount::getCreateTime)) + .stream().map(account -> Objects.requireNonNull(BeanUtil.copyProperties(account, CustomerReceiptAccountVO.class))).toList(); + } + + private List loadInvoices(Long customerId) { + return invoiceInfoMapper.selectList(Wrappers.lambdaQuery() + .eq(CustomerInvoiceInfo::getCustomerId, customerId) + .eq(CustomerInvoiceInfo::getIsDeleted, 0) + .orderByDesc(CustomerInvoiceInfo::getIsDefault) + .orderByAsc(CustomerInvoiceInfo::getCreateTime)) + .stream().map(invoice -> Objects.requireNonNull(BeanUtil.copyProperties(invoice, CustomerInvoiceInfoVO.class))).toList(); + } + + private List loadScores(Long customerId) { + List scores = creditScoreMapper.selectList(Wrappers.lambdaQuery() + .eq(CustomerCreditScore::getCustomerId, customerId) + .eq(CustomerCreditScore::getIsDeleted, 0) + .orderByDesc(CustomerCreditScore::getScoreDate) + .orderByDesc(CustomerCreditScore::getCreateTime)); + if (Func.isEmpty(scores)) { + return new ArrayList<>(); + } + List scoreIds = scores.stream().map(CustomerCreditScore::getId).toList(); + Map> detailMap = creditScoreDetailMapper.selectList(Wrappers.lambdaQuery() + .in(CustomerCreditScoreDetail::getScoreId, scoreIds) + .eq(CustomerCreditScoreDetail::getIsDeleted, 0) + .orderByAsc(CustomerCreditScoreDetail::getSort)) + .stream() + .map(detail -> Objects.requireNonNull(BeanUtil.copyProperties(detail, CustomerCreditScoreDetailVO.class))) + .collect(Collectors.groupingBy(CustomerCreditScoreDetailVO::getScoreId)); + return scores.stream().map(score -> { + CustomerCreditScoreVO scoreVO = Objects.requireNonNull(BeanUtil.copyProperties(score, CustomerCreditScoreVO.class)); + scoreVO.setDetails(detailMap.getOrDefault(score.getId(), new ArrayList<>())); + return scoreVO; + }).toList(); + } + + private List loadChangeRecords(Long customerId) { + return changeRecordMapper.selectList(Wrappers.lambdaQuery() + .eq(CustomerChangeRecord::getCustomerId, customerId) + .eq(CustomerChangeRecord::getIsDeleted, 0) + .orderByDesc(CustomerChangeRecord::getChangeTime)) + .stream().map(record -> Objects.requireNonNull(BeanUtil.copyProperties(record, CustomerChangeRecordVO.class))).toList(); + } + + private CreditScoreQuantification resolveQuantification(Long quantificationId) { + CreditScoreQuantification quantification; + if (Func.isNotEmpty(quantificationId)) { + quantification = quantificationMapper.selectById(quantificationId); + } else { + quantification = quantificationMapper.selectList(Wrappers.lambdaQuery() + .eq(CreditScoreQuantification::getStatus, STATUS_ENABLED) + .eq(CreditScoreQuantification::getIsDeleted, 0) + .orderByDesc(CreditScoreQuantification::getCreateTime)) + .stream().findFirst().orElse(null); + } + if (Func.isEmpty(quantification) || !Objects.equals(quantification.getStatus(), STATUS_ENABLED) || Objects.equals(quantification.getIsDeleted(), 1)) { + throw new ServiceException("请先维护并启用评分量化表"); + } + return quantification; + } + + private List loadScoreTemplateDetails(Long quantificationId) { + List categories = categoryMapper.selectList(Wrappers.lambdaQuery() + .eq(CreditScoreCategory::getQuantificationId, quantificationId) + .eq(CreditScoreCategory::getIsDeleted, 0) + .orderByAsc(CreditScoreCategory::getSort)); + List items = itemMapper.selectList(Wrappers.lambdaQuery() + .eq(CreditScoreItem::getQuantificationId, quantificationId) + .eq(CreditScoreItem::getIsDeleted, 0) + .orderByAsc(CreditScoreItem::getSort)); + List options = optionMapper.selectList(Wrappers.lambdaQuery() + .eq(CreditScoreItemOption::getQuantificationId, quantificationId) + .eq(CreditScoreItemOption::getIsDeleted, 0) + .orderByAsc(CreditScoreItemOption::getSort)); + Map> optionMap = options.stream().collect(Collectors.groupingBy(CreditScoreItemOption::getItemId)); + Map categoryMap = categories.stream().collect(Collectors.toMap(CreditScoreCategory::getId, category -> category)); + List details = new ArrayList<>(); + for (CreditScoreItem item : items) { + CreditScoreCategory category = categoryMap.get(item.getCategoryId()); + CustomerCreditScoreDetailVO detail = new CustomerCreditScoreDetailVO(); + detail.setQuantificationId(quantificationId); + detail.setItemId(item.getId()); + detail.setCategoryCode(category == null ? item.getCategoryCode() : category.getCategoryCode()); + detail.setCategoryName(category == null ? item.getCategoryCode() : category.getCategoryName()); + detail.setItemName(item.getItemName()); + detail.setOptionDescription(item.getOptionDescription()); + detail.setScoreDescription(item.getScoreDescription()); + detail.setOptionsJson(buildOptionsJson(optionMap.getOrDefault(item.getId(), new ArrayList<>()))); + detail.setSelfScore(BigDecimal.ZERO); + detail.setReviewScore(BigDecimal.ZERO); + details.add(detail); + } + return details; + } + + private String buildOptionsJson(List options) { + List> optionList = options.stream() + .sorted(Comparator.comparing(CreditScoreItemOption::getSort, Comparator.nullsLast(Integer::compareTo))) + .map(option -> { + Map map = new LinkedHashMap<>(); + map.put("label", option.getOptionName()); + map.put("value", option.getOptionName()); + map.put("score", option.getScore()); + return map; + }).toList(); + return JsonUtil.toJson(optionList); + } + + private String nextCustomerCode() { + CustomerArchive latest = list(Wrappers.lambdaQuery() + .likeRight(CustomerArchive::getCustomerCode, CUSTOMER_CODE_PREFIX) + .eq(CustomerArchive::getIsDeleted, 0) + .orderByDesc(CustomerArchive::getCustomerCode)) + .stream().findFirst().orElse(null); + int nextNumber = 1; + if (Func.isNotEmpty(latest) && Func.isNotEmpty(latest.getCustomerCode())) { + String number = latest.getCustomerCode().replace(CUSTOMER_CODE_PREFIX, ""); + if (number.matches("^\\d+$")) { + nextNumber = Integer.parseInt(number) + 1; + } + } + return CUSTOMER_CODE_PREFIX + String.format("%06d", nextNumber); + } + + private void addChangeRecord(Long customerId, String content) { + CustomerChangeRecord record = new CustomerChangeRecord(); + record.setId(IdWorker.getId()); + record.setCustomerId(customerId); + record.setChangeTime(LocalDateTime.now()); + record.setChangeContent(content); + record.setChangeUserName(AuthUtil.getUserName()); + record.setStatus(STATUS_ENABLED); + changeRecordMapper.insert(record); + } + + private CustomerArchiveExcel buildExcel(CustomerArchive customer) { + CustomerArchiveExcel excel = new CustomerArchiveExcel(); + excel.setCustomerCode(customer.getCustomerCode()); + excel.setShortName(customer.getShortName()); + excel.setFullName(customer.getFullName()); + excel.setCustomerType(customer.getCustomerType()); + excel.setCustomerNature(customer.getCustomerNature()); + excel.setUnifiedCreditCode(customer.getUnifiedCreditCode()); + excel.setDeptName(customer.getDeptName()); + excel.setAccessTypeName(accessTypeName(customer.getAccessType())); + excel.setApprovalStatusName(approvalStatusName(customer.getApprovalStatus())); + excel.setCurrentNode(customer.getCurrentNode()); + excel.setCurrentProcessor(customer.getCurrentProcessor()); + excel.setApprovedTime(customer.getApprovedTime()); + excel.setStatusName(Objects.equals(customer.getStatus(), STATUS_ENABLED) ? "启用" : "停用"); + excel.setCustomerLevel(customer.getCustomerLevel()); + excel.setMaxCreditLimit(customer.getMaxCreditLimit()); + excel.setApplyCreditLimit(customer.getApplyCreditLimit()); + excel.setContactPhone(customer.getContactPhone()); + excel.setLegalPerson(customer.getLegalPerson()); + excel.setCreateTime(customer.getCreateTime()); + return excel; + } + + private String accessTypeName(String accessType) { + return Objects.equals(accessType, ACCESS_FORMAL) ? "正式" : "临时"; + } + + private String approvalStatusName(String approvalStatus) { + if (Objects.equals(approvalStatus, APPROVAL_REVIEWING)) { + return "审核中"; + } + if (Objects.equals(approvalStatus, APPROVAL_APPROVED)) { + return "审核通过"; + } + if (Objects.equals(approvalStatus, APPROVAL_REJECTED)) { + return "审核不通过"; + } + return "草稿"; + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private void validateNonNegative(BigDecimal value, String message) { + if (Func.isNotEmpty(value) && value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(message); + } + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return Func.isEmpty(trimValue) ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverServiceImpl.java new file mode 100644 index 0000000..5b4b002 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverServiceImpl.java @@ -0,0 +1,247 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.DriverExcel; +import org.springblade.transport.mapper.DriverMapper; +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.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * 司机管理 服务实现类 + * + * @author Chill + */ +@Service +public class DriverServiceImpl extends BaseServiceImpl implements IDriverService { + + private static final int NAME_MAX_LENGTH = 20; + private static final int ID_CARD_MAX_LENGTH = 18; + private static final int MOBILE_MAX_LENGTH = 20; + private static final int SHORT_TEXT_MAX_LENGTH = 50; + private static final int ADDRESS_MAX_LENGTH = 200; + private static final int REMARK_MAX_LENGTH = 200; + private static final int DEFAULT_ENABLED_STATUS = 1; + private static final int DEFAULT_FALSE = 0; + + @Override + public IPage selectDriverPage(IPage page, DriverVO driver) { + prepareQuery(driver); + return page.setRecords(baseMapper.selectDriverPage(page, driver)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(Driver driver) { + prepare(driver); + validate(driver); + checkUniqueIdCard(driver); + return saveOrUpdate(driver); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean changeStatus(Long id, Integer status) { + if (Func.isEmpty(id)) { + throw new ServiceException("司机主键不能为空"); + } + if (Func.isEmpty(status) || (status != 1 && status != 2)) { + throw new ServiceException("状态值不正确"); + } + Driver driver = new Driver(); + driver.setId(id); + driver.setStatus(status); + return updateById(driver); + } + + @Override + public DriverExpiryStatVO expiryStat(DriverVO driver) { + prepareQuery(driver); + driver.setExpireStatus(null); + DriverExpiryStatVO stat = baseMapper.selectExpiryStat(driver); + if (stat == null) { + stat = new DriverExpiryStatVO(); + } + stat.setTotal(defaultZero(stat.getTotal())); + stat.setWithin30(defaultZero(stat.getWithin30())); + stat.setExpired(defaultZero(stat.getExpired())); + return stat; + } + + @Override + public List exportDriver(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(driver -> { + DriverExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(driver, DriverExcel.class)); + excel.setStatusName(driver.getStatus() != null && driver.getStatus() == 2 ? "停用" : "启用"); + excel.setDrivingLicenseLongTermName(driver.getDrivingLicenseLongTerm() != null && driver.getDrivingLicenseLongTerm() == 1 ? "是" : "否"); + excel.setQualificationLongTermName(driver.getQualificationLongTerm() != null && driver.getQualificationLongTerm() == 1 ? "是" : "否"); + return excel; + }).toList(); + } + + private void prepareQuery(DriverVO driver) { + if (driver.getToday() == null) { + driver.setToday(LocalDate.now()); + } + if (driver.getWarningDate() == null) { + driver.setWarningDate(driver.getToday().plusDays(30)); + } + } + + private void prepare(Driver driver) { + driver.setDriverName(trimToEmpty(driver.getDriverName())); + driver.setIdCardNo(trimToEmpty(driver.getIdCardNo()).toUpperCase()); + driver.setGender(trimToNull(driver.getGender())); + driver.setNation(trimToNull(driver.getNation())); + driver.setEducation(trimToNull(driver.getEducation())); + driver.setAddressRegion(trimToNull(driver.getAddressRegion())); + driver.setAddress(trimToNull(driver.getAddress())); + driver.setPosts(trimToNull(driver.getPosts())); + driver.setDrivingType(trimToEmpty(driver.getDrivingType()).toUpperCase()); + driver.setDrivingLicenseNo(trimToNull(driver.getDrivingLicenseNo())); + driver.setQualificationType(trimToNull(driver.getQualificationType())); + driver.setQualificationNo(trimToNull(driver.getQualificationNo())); + driver.setDriverType(trimToEmpty(driver.getDriverType())); + driver.setMobile(trimToEmpty(driver.getMobile())); + driver.setContactRelation(trimToNull(driver.getContactRelation())); + driver.setOrganizationName(trimToEmpty(driver.getOrganizationName())); + driver.setEmergencyContactName(trimToEmpty(driver.getEmergencyContactName())); + driver.setEmergencyContactMobile(trimToEmpty(driver.getEmergencyContactMobile())); + driver.setRemark(trimToNull(driver.getRemark())); + driver.setIdCardFront(trimToNull(driver.getIdCardFront())); + driver.setIdCardBack(trimToNull(driver.getIdCardBack())); + driver.setHeadPhoto(trimToNull(driver.getHeadPhoto())); + driver.setDrivingLicenseFront(trimToNull(driver.getDrivingLicenseFront())); + driver.setDrivingLicenseBack(trimToNull(driver.getDrivingLicenseBack())); + driver.setQualificationFront(trimToNull(driver.getQualificationFront())); + driver.setQualificationBack(trimToNull(driver.getQualificationBack())); + if (driver.getDrivingLicenseLongTerm() == null) { + driver.setDrivingLicenseLongTerm(DEFAULT_FALSE); + } + if (driver.getQualificationLongTerm() == null) { + driver.setQualificationLongTerm(DEFAULT_FALSE); + } + if (driver.getStatus() == null) { + driver.setStatus(DEFAULT_ENABLED_STATUS); + } + } + + private void validate(Driver driver) { + if (Func.isEmpty(driver.getDriverName())) { + throw new ServiceException("司机姓名不能为空"); + } + if (Func.isEmpty(driver.getIdCardNo())) { + throw new ServiceException("身份证号不能为空"); + } + if (Func.isEmpty(driver.getDrivingType())) { + throw new ServiceException("准驾车型不能为空"); + } + if (Func.isEmpty(driver.getDriverType())) { + throw new ServiceException("司机类型不能为空"); + } + if (Func.isEmpty(driver.getMobile())) { + throw new ServiceException("手机号不能为空"); + } + if (Func.isEmpty(driver.getOrganizationName())) { + throw new ServiceException("所属组织不能为空"); + } + if (Func.isEmpty(driver.getEmergencyContactName())) { + throw new ServiceException("紧急联系人姓名不能为空"); + } + if (Func.isEmpty(driver.getEmergencyContactMobile())) { + throw new ServiceException("紧急联系人手机号不能为空"); + } + if (Func.isEmpty(driver.getIdCardFront()) || Func.isEmpty(driver.getIdCardBack())) { + throw new ServiceException("身份证正反面照片不能为空"); + } + if (Func.isEmpty(driver.getDrivingLicenseFront()) || Func.isEmpty(driver.getDrivingLicenseBack())) { + throw new ServiceException("驾驶证主页和副页不能为空"); + } + if (driver.getDrivingLicenseLongTerm() != 1 && Func.isEmpty(driver.getDrivingLicenseEndDate())) { + throw new ServiceException("驾驶证有效期止不能为空"); + } + if (driver.getQualificationLongTerm() != 1 && Func.isNotEmpty(driver.getQualificationNo()) && Func.isEmpty(driver.getQualificationEndDate())) { + throw new ServiceException("从业资格证有效期止不能为空"); + } + validateLength(driver.getDriverName(), NAME_MAX_LENGTH, "司机姓名不能超过20字"); + validateLength(driver.getIdCardNo(), ID_CARD_MAX_LENGTH, "身份证号不能超过18字"); + validateLength(driver.getMobile(), MOBILE_MAX_LENGTH, "手机号不能超过20字"); + validateLength(driver.getEmergencyContactMobile(), MOBILE_MAX_LENGTH, "紧急联系人手机号不能超过20字"); + validateLength(driver.getDrivingLicenseNo(), SHORT_TEXT_MAX_LENGTH, "驾驶证档案编号不能超过50字"); + validateLength(driver.getQualificationNo(), SHORT_TEXT_MAX_LENGTH, "资格证号不能超过50字"); + validateLength(driver.getOrganizationName(), SHORT_TEXT_MAX_LENGTH, "所属组织不能超过50字"); + validateLength(driver.getAddress(), ADDRESS_MAX_LENGTH, "详细地址不能超过200字"); + validateLength(driver.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + if (Func.isNotEmpty(driver.getDrivingLicenseStartDate()) && Func.isNotEmpty(driver.getDrivingLicenseEndDate()) && driver.getDrivingLicenseEndDate().isBefore(driver.getDrivingLicenseStartDate())) { + throw new ServiceException("驾驶证有效期止不能早于有效期起"); + } + } + + private void checkUniqueIdCard(Driver driver) { + Long count = count(Wrappers.lambdaQuery() + .eq(Driver::getIsDeleted, 0) + .eq(Driver::getIdCardNo, driver.getIdCardNo()) + .ne(Func.isNotEmpty(driver.getId()), Driver::getId, driver.getId())); + if (count > 0) { + throw new ServiceException("身份证号已存在"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private Long defaultZero(Long value) { + return value == null ? 0L : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/EtcRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/EtcRecordServiceImpl.java new file mode 100644 index 0000000..7506cf0 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/EtcRecordServiceImpl.java @@ -0,0 +1,163 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.excel.EtcRecordExcel; +import org.springblade.transport.mapper.EtcRecordMapper; +import org.springblade.transport.pojo.entity.EtcRecord; +import org.springblade.transport.pojo.vo.EtcRecordVO; +import org.springblade.transport.service.IEtcRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * ETC记录 服务实现类 + * + * @author Chill + */ +@Service +public class EtcRecordServiceImpl extends BaseServiceImpl implements IEtcRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int ETC_CARD_NO_MAX_LENGTH = 30; + private static final int STATION_MAX_LENGTH = 50; + private static final int REMARK_MAX_LENGTH = 200; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MONEY_SCALE = 2; + + @Override + public IPage selectEtcRecordPage(IPage page, EtcRecordVO etcRecord) { + List records = baseMapper.selectEtcRecordPage(page, etcRecord); + records.forEach(record -> record.setUpdateUserName(UserCache.getUserRealName(record.getUpdateUser()))); + return page.setRecords(records); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(EtcRecord etcRecord) { + prepare(etcRecord); + validate(etcRecord); + return saveOrUpdate(etcRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importEtcRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + EtcRecord etcRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), EtcRecord.class)); + etcRecord.setDataSource("批量导入"); + submit(etcRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportEtcRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(etcRecord -> { + EtcRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(etcRecord, EtcRecordExcel.class)); + excel.setTransactionAmount(nonNegative(etcRecord.getTransactionAmount())); + return excel; + }).toList(); + } + + private void prepare(EtcRecord etcRecord) { + etcRecord.setVehicleNo(trimToEmpty(etcRecord.getVehicleNo()).toUpperCase()); + etcRecord.setEtcCardNo(trimToNull(etcRecord.getEtcCardNo())); + etcRecord.setEntryStation(trimToNull(etcRecord.getEntryStation())); + etcRecord.setExitStation(trimToNull(etcRecord.getExitStation())); + etcRecord.setDataSource(defaultDataSource(etcRecord.getDataSource())); + etcRecord.setAttachments(trimToNull(etcRecord.getAttachments())); + etcRecord.setRemark(trimToNull(etcRecord.getRemark())); + } + + private void validate(EtcRecord etcRecord) { + if (Func.isEmpty(etcRecord.getVehicleNo())) { + throw new ServiceException("车牌号不能为空"); + } + if (Func.isEmpty(etcRecord.getEtcCardNo())) { + throw new ServiceException("ETC卡号不能为空"); + } + if (Func.isEmpty(etcRecord.getExitTime())) { + throw new ServiceException("出口时间不能为空"); + } + if (Func.isEmpty(etcRecord.getTransactionAmount())) { + throw new ServiceException("交易金额不能为空"); + } + if (Func.isNotEmpty(etcRecord.getEntryTime()) && !etcRecord.getExitTime().isAfter(etcRecord.getEntryTime())) { + throw new ServiceException("出口时间应大于入口时间"); + } + validateLength(etcRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号不能超过30字"); + validateLength(etcRecord.getEtcCardNo(), ETC_CARD_NO_MAX_LENGTH, "ETC卡号不能超过30字"); + validateLength(etcRecord.getEntryStation(), STATION_MAX_LENGTH, "入口站不能超过50字"); + validateLength(etcRecord.getExitStation(), STATION_MAX_LENGTH, "出口站不能超过50字"); + validateLength(etcRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateLength(etcRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + validateMoney(etcRecord.getTransactionAmount(), "交易金额"); + } + + private void validateMoney(BigDecimal value, String fieldName) { + if (Func.isEmpty(value)) { + return; + } + if (value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(fieldName + "不能小于0"); + } + if (value.stripTrailingZeros().scale() > MONEY_SCALE) { + throw new ServiceException(fieldName + "最多保留" + MONEY_SCALE + "位小数"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private String defaultDataSource(String dataSource) { + String value = trimToEmpty(dataSource); + return value.isEmpty() ? "手工录入" : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InsuranceRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InsuranceRecordServiceImpl.java new file mode 100644 index 0000000..20832a4 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InsuranceRecordServiceImpl.java @@ -0,0 +1,229 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.InsuranceRecordExcel; +import org.springblade.transport.mapper.InsuranceRecordMapper; +import org.springblade.transport.pojo.entity.InsuranceRecord; +import org.springblade.transport.pojo.vo.InsuranceRecordVO; +import org.springblade.transport.service.IInsuranceRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +/** + * 保险记录 服务实现类 + * + * @author Chill + */ +@Service +public class InsuranceRecordServiceImpl extends BaseServiceImpl implements IInsuranceRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 50; + private static final int INSURANCE_TYPE_MAX_LENGTH = 50; + private static final int POLICY_NO_MAX_LENGTH = 80; + private static final int INVOICE_NO_MAX_LENGTH = 80; + private static final int OCR_TEMPLATE_MAX_LENGTH = 100; + private static final int POLICY_FILE_MAX_LENGTH = 1000; + private static final int REMARK_MAX_LENGTH = 200; + private static final Set SUPPORT_FILE_TYPES = Set.of("jpg", "jpeg", "png", "pdf"); + + @Override + public IPage selectInsuranceRecordPage(IPage page, InsuranceRecordVO insuranceRecord) { + return page.setRecords(baseMapper.selectInsuranceRecordPage(page, insuranceRecord)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(InsuranceRecord insuranceRecord) { + prepare(insuranceRecord); + validate(insuranceRecord); + checkUniquePolicyNo(insuranceRecord); + return saveOrUpdate(insuranceRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importInsuranceRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + InsuranceRecord insuranceRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), InsuranceRecord.class)); + submit(insuranceRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportInsuranceRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(insuranceRecord -> { + InsuranceRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(insuranceRecord, InsuranceRecordExcel.class)); + excel.setInsuredAmount(nonNegative(insuranceRecord.getInsuredAmount())); + excel.setPremium(nonNegative(insuranceRecord.getPremium())); + return excel; + }).toList(); + } + + @Override + public InsuranceRecord recognizePolicy(MultipartFile file, String vehicleType, String ocrTemplate) { + validatePolicyFile(file); + InsuranceRecord insuranceRecord = new InsuranceRecord(); + insuranceRecord.setVehicleType(normalizeVehicleType(vehicleType)); + insuranceRecord.setOcrTemplate(trimToNull(ocrTemplate)); + throw new ServiceException("当前未配置OCR识别服务,请手动填写保单信息"); + } + + private void prepare(InsuranceRecord insuranceRecord) { + insuranceRecord.setVehicleType(normalizeVehicleType(insuranceRecord.getVehicleType())); + insuranceRecord.setVehicleNo(trimToEmpty(insuranceRecord.getVehicleNo()).toUpperCase()); + insuranceRecord.setInsuranceType(trimToEmpty(insuranceRecord.getInsuranceType())); + insuranceRecord.setPolicyNo(trimToEmpty(insuranceRecord.getPolicyNo())); + insuranceRecord.setInvoiceNo(trimToNull(insuranceRecord.getInvoiceNo())); + insuranceRecord.setOcrTemplate(trimToNull(insuranceRecord.getOcrTemplate())); + insuranceRecord.setPolicyFile(trimToNull(insuranceRecord.getPolicyFile())); + insuranceRecord.setRemark(trimToNull(insuranceRecord.getRemark())); + } + + private void validate(InsuranceRecord insuranceRecord) { + if (Func.isEmpty(insuranceRecord.getVehicleType())) { + throw new ServiceException("车船类型不能为空"); + } + if (!"车辆".equals(insuranceRecord.getVehicleType()) && !"船舶".equals(insuranceRecord.getVehicleType())) { + throw new ServiceException("车船类型不正确"); + } + if (Func.isEmpty(insuranceRecord.getVehicleNo())) { + throw new ServiceException("车牌号/船号不能为空"); + } + if (Func.isEmpty(insuranceRecord.getInsuranceType())) { + throw new ServiceException("保险类型不能为空"); + } + if (Func.isEmpty(insuranceRecord.getPolicyNo())) { + throw new ServiceException("保单号不能为空"); + } + if (Func.isEmpty(insuranceRecord.getStartDate())) { + throw new ServiceException("开始日期不能为空"); + } + if (Func.isEmpty(insuranceRecord.getEndDate())) { + throw new ServiceException("结束日期不能为空"); + } + if (insuranceRecord.getEndDate().isBefore(insuranceRecord.getStartDate())) { + throw new ServiceException("结束日期不能早于开始日期"); + } + if (Func.isEmpty(insuranceRecord.getPremium())) { + throw new ServiceException("保费不能为空"); + } + validateNonNegative(insuranceRecord.getInsuredAmount(), "保额不能小于0"); + validateNonNegative(insuranceRecord.getPremium(), "保费不能小于0"); + validateLength(insuranceRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过50字"); + validateLength(insuranceRecord.getInsuranceType(), INSURANCE_TYPE_MAX_LENGTH, "保险类型不能超过50字"); + validateLength(insuranceRecord.getPolicyNo(), POLICY_NO_MAX_LENGTH, "保单号不能超过80字"); + validateLength(insuranceRecord.getInvoiceNo(), INVOICE_NO_MAX_LENGTH, "发票号不能超过80字"); + validateLength(insuranceRecord.getOcrTemplate(), OCR_TEMPLATE_MAX_LENGTH, "OCR识别模板不能超过100字"); + validateLength(insuranceRecord.getPolicyFile(), POLICY_FILE_MAX_LENGTH, "保单附件不能超过1000字"); + validateLength(insuranceRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + } + + private void checkUniquePolicyNo(InsuranceRecord insuranceRecord) { + Long count = count(Wrappers.lambdaQuery() + .eq(InsuranceRecord::getIsDeleted, 0) + .eq(InsuranceRecord::getVehicleType, insuranceRecord.getVehicleType()) + .eq(InsuranceRecord::getInsuranceType, insuranceRecord.getInsuranceType()) + .eq(InsuranceRecord::getPolicyNo, insuranceRecord.getPolicyNo()) + .ne(Func.isNotEmpty(insuranceRecord.getId()), InsuranceRecord::getId, insuranceRecord.getId())); + if (count > 0) { + throw new ServiceException("同一车船类型和保险类型下保单号已存在"); + } + } + + private void validatePolicyFile(MultipartFile file) { + if (file == null || file.isEmpty()) { + throw new ServiceException("请上传保单图片或PDF文件"); + } + String filename = file.getOriginalFilename(); + if (Func.isEmpty(filename) || !filename.contains(".")) { + throw new ServiceException("文件格式不正确"); + } + String extension = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase(); + if (!SUPPORT_FILE_TYPES.contains(extension)) { + throw new ServiceException("仅支持JPG、PNG、PDF文件"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private void validateNonNegative(BigDecimal value, String message) { + if (Func.isNotEmpty(value) && value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private String normalizeVehicleType(String vehicleType) { + String value = trimToEmpty(vehicleType); + return value.isEmpty() ? "车辆" : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/MileageRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/MileageRecordServiceImpl.java new file mode 100644 index 0000000..4083ea6 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/MileageRecordServiceImpl.java @@ -0,0 +1,195 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.excel.MileageRecordExcel; +import org.springblade.transport.mapper.MileageRecordMapper; +import org.springblade.transport.pojo.entity.MileageRecord; +import org.springblade.transport.pojo.vo.MileageRecordVO; +import org.springblade.transport.service.IMileageRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 里程记录 服务实现类 + * + * @author Chill + */ +@Service +public class MileageRecordServiceImpl extends BaseServiceImpl implements IMileageRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int REMARK_MAX_LENGTH = 200; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MILEAGE_SCALE = 2; + + @Override + public IPage selectMileageRecordPage(IPage page, MileageRecordVO mileageRecord) { + List records = baseMapper.selectMileageRecordPage(page, mileageRecord); + records.forEach(record -> record.setUpdateUserName(UserCache.getUserRealName(record.getUpdateUser()))); + return page.setRecords(records); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(MileageRecord mileageRecord) { + prepare(mileageRecord); + validate(mileageRecord); + validateVehicleNoImmutable(mileageRecord); + return saveOrUpdate(mileageRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importMileageRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + MileageRecord mileageRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), MileageRecord.class)); + submit(mileageRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportMileageRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(mileageRecord -> { + MileageRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(mileageRecord, MileageRecordExcel.class)); + excel.setPreviousMonthMileage(nonNegative(mileageRecord.getPreviousMonthMileage())); + excel.setCurrentMonthMileage(nonNegative(mileageRecord.getCurrentMonthMileage())); + excel.setMonthlyMileage(nonNegative(mileageRecord.getMonthlyMileage())); + excel.setTotalMileage(nonNegative(mileageRecord.getTotalMileage())); + return excel; + }).toList(); + } + + private void prepare(MileageRecord mileageRecord) { + mileageRecord.setVehicleNo(trimToEmpty(mileageRecord.getVehicleNo()).toUpperCase()); + mileageRecord.setRemark(trimToNull(mileageRecord.getRemark())); + mileageRecord.setAttachments(trimToNull(mileageRecord.getAttachments())); + if (mileageRecord.getMonthlyMileage() == null + && mileageRecord.getPreviousMonthMileage() != null + && mileageRecord.getCurrentMonthMileage() != null) { + mileageRecord.setMonthlyMileage(mileageRecord.getCurrentMonthMileage().subtract(mileageRecord.getPreviousMonthMileage())); + } + } + + private void validate(MileageRecord mileageRecord) { + if (Func.isEmpty(mileageRecord.getVehicleNo())) { + throw new ServiceException("车牌号不能为空"); + } + validateLength(mileageRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号不能超过30字"); + validateLength(mileageRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateLength(mileageRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + validateMileage(mileageRecord.getPreviousMonthMileage(), "上月统计里程"); + validateMileage(mileageRecord.getCurrentMonthMileage(), "本月统计里程"); + validateMileage(mileageRecord.getMonthlyMileage(), "本月行驶里程"); + validateMileage(mileageRecord.getTotalMileage(), "累计行驶里程"); + validateMonthlyMileageConsistency(mileageRecord); + if (mileageRecord.getTotalMileage() != null + && mileageRecord.getCurrentMonthMileage() != null + && mileageRecord.getTotalMileage().compareTo(mileageRecord.getCurrentMonthMileage()) < 0) { + throw new ServiceException("累计行驶里程应大于等于本月统计里程"); + } + } + + private void validateMonthlyMileageConsistency(MileageRecord mileageRecord) { + if (mileageRecord.getPreviousMonthMileage() == null + || mileageRecord.getCurrentMonthMileage() == null + || mileageRecord.getMonthlyMileage() == null) { + return; + } + BigDecimal calculated = mileageRecord.getCurrentMonthMileage().subtract(mileageRecord.getPreviousMonthMileage()); + if (calculated.compareTo(mileageRecord.getMonthlyMileage()) != 0) { + throw new ServiceException("本月行驶里程应等于本月统计里程减去上月统计里程"); + } + } + + private void validateVehicleNoImmutable(MileageRecord mileageRecord) { + if (Func.isEmpty(mileageRecord.getId())) { + return; + } + MileageRecord oldRecord = getById(mileageRecord.getId()); + if (oldRecord != null && Func.isNotEmpty(oldRecord.getVehicleNo()) && !oldRecord.getVehicleNo().equals(mileageRecord.getVehicleNo())) { + throw new ServiceException("车牌号保存后不可修改"); + } + } + + private void validateMileage(BigDecimal value, String fieldName) { + if (Func.isEmpty(value)) { + return; + } + if (value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(fieldName + "不能小于0"); + } + if (value.stripTrailingZeros().scale() > MILEAGE_SCALE) { + throw new ServiceException(fieldName + "最多保留2位小数"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OilElectricRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OilElectricRecordServiceImpl.java new file mode 100644 index 0000000..4957c91 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OilElectricRecordServiceImpl.java @@ -0,0 +1,203 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.excel.OilElectricRecordExcel; +import org.springblade.transport.mapper.OilElectricRecordMapper; +import org.springblade.transport.pojo.entity.OilElectricRecord; +import org.springblade.transport.pojo.vo.OilElectricRecordVO; +import org.springblade.transport.service.IOilElectricRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +/** + * 油电记录 服务实现类 + * + * @author Chill + */ +@Service +public class OilElectricRecordServiceImpl extends BaseServiceImpl implements IOilElectricRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int CARD_NO_MAX_LENGTH = 30; + private static final int CARD_HOLDER_MAX_LENGTH = 20; + private static final int OIL_PRODUCT_MAX_LENGTH = 50; + private static final int STATION_MAX_LENGTH = 50; + private static final int REMARK_MAX_LENGTH = 200; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MONEY_SCALE = 2; + private static final int QUANTITY_SCALE = 2; + private static final String VEHICLE = "车辆"; + private static final String SHIP = "船舶"; + private static final String FUEL = "加油"; + private static final String ELECTRIC = "充电"; + private static final Set FEE_TYPES = Set.of(FUEL, ELECTRIC); + + @Override + public IPage selectOilElectricRecordPage(IPage page, OilElectricRecordVO oilElectricRecord) { + List records = baseMapper.selectOilElectricRecordPage(page, oilElectricRecord); + records.forEach(record -> record.setUpdateUserName(UserCache.getUserRealName(record.getUpdateUser()))); + return page.setRecords(records); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(OilElectricRecord oilElectricRecord) { + prepare(oilElectricRecord); + validate(oilElectricRecord); + return saveOrUpdate(oilElectricRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importOilElectricRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + OilElectricRecord oilElectricRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), OilElectricRecord.class)); + oilElectricRecord.setDataSource(defaultDataSource(oilElectricRecord.getDataSource())); + submit(oilElectricRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportOilElectricRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(oilElectricRecord -> { + OilElectricRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(oilElectricRecord, OilElectricRecordExcel.class)); + excel.setQuantity(nonNegative(oilElectricRecord.getQuantity())); + excel.setUnitPrice(nonNegative(oilElectricRecord.getUnitPrice())); + excel.setTransactionAmount(nonNegative(oilElectricRecord.getTransactionAmount())); + excel.setBalance(nonNegative(oilElectricRecord.getBalance())); + return excel; + }).toList(); + } + + private void prepare(OilElectricRecord oilElectricRecord) { + oilElectricRecord.setVehicleType(normalizeVehicleType(oilElectricRecord.getVehicleType())); + oilElectricRecord.setVehicleNo(trimToEmpty(oilElectricRecord.getVehicleNo())); + if (VEHICLE.equals(oilElectricRecord.getVehicleType())) { + oilElectricRecord.setVehicleNo(oilElectricRecord.getVehicleNo().toUpperCase()); + } + oilElectricRecord.setFeeType(trimToNull(oilElectricRecord.getFeeType())); + oilElectricRecord.setOilProduct(trimToNull(oilElectricRecord.getOilProduct())); + oilElectricRecord.setCardNo(trimToNull(oilElectricRecord.getCardNo())); + oilElectricRecord.setCardHolder(trimToNull(oilElectricRecord.getCardHolder())); + oilElectricRecord.setStation(trimToNull(oilElectricRecord.getStation())); + oilElectricRecord.setDataSource(defaultDataSource(oilElectricRecord.getDataSource())); + oilElectricRecord.setAttachments(trimToNull(oilElectricRecord.getAttachments())); + oilElectricRecord.setRemark(trimToNull(oilElectricRecord.getRemark())); + if (ELECTRIC.equals(oilElectricRecord.getFeeType())) { + oilElectricRecord.setOilProduct(null); + } + } + + private void validate(OilElectricRecord oilElectricRecord) { + if (Func.isEmpty(oilElectricRecord.getVehicleType())) { + throw new ServiceException("车船类型不能为空"); + } + if (!VEHICLE.equals(oilElectricRecord.getVehicleType()) && !SHIP.equals(oilElectricRecord.getVehicleType())) { + throw new ServiceException("车船类型不正确"); + } + if (Func.isEmpty(oilElectricRecord.getVehicleNo())) { + throw new ServiceException("车牌号/船号不能为空"); + } + if (Func.isEmpty(oilElectricRecord.getTransactionTime())) { + throw new ServiceException("交易时间不能为空"); + } + if (Func.isEmpty(oilElectricRecord.getFeeType())) { + throw new ServiceException("费用类型不能为空"); + } + if (!FEE_TYPES.contains(oilElectricRecord.getFeeType())) { + throw new ServiceException("费用类型不正确"); + } + if (Func.isEmpty(oilElectricRecord.getTransactionAmount())) { + throw new ServiceException("交易金额不能为空"); + } + validateLength(oilElectricRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过30字"); + validateLength(oilElectricRecord.getCardNo(), CARD_NO_MAX_LENGTH, "卡号不能超过30字"); + validateLength(oilElectricRecord.getCardHolder(), CARD_HOLDER_MAX_LENGTH, "持卡人不能超过20字"); + validateLength(oilElectricRecord.getOilProduct(), OIL_PRODUCT_MAX_LENGTH, "油品不能超过50字"); + validateLength(oilElectricRecord.getStation(), STATION_MAX_LENGTH, "站点不能超过50字"); + validateLength(oilElectricRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateLength(oilElectricRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + validateMoney(oilElectricRecord.getTransactionAmount(), "交易金额"); + validateMoney(oilElectricRecord.getUnitPrice(), "单价"); + validateMoney(oilElectricRecord.getBalance(), "余额"); + validateNumber(oilElectricRecord.getQuantity(), "数量", QUANTITY_SCALE); + } + + private void validateMoney(BigDecimal value, String fieldName) { + validateNumber(value, fieldName, MONEY_SCALE); + } + + private void validateNumber(BigDecimal value, String fieldName, int scale) { + if (Func.isEmpty(value)) { + return; + } + if (value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(fieldName + "不能小于0"); + } + if (value.stripTrailingZeros().scale() > scale) { + throw new ServiceException(fieldName + "最多保留" + scale + "位小数"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private String defaultDataSource(String dataSource) { + String value = trimToEmpty(dataSource); + return value.isEmpty() ? "手工录入" : value; + } + + private String normalizeVehicleType(String vehicleType) { + String value = trimToEmpty(vehicleType); + return value.isEmpty() ? VEHICLE : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OtherExpenseRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OtherExpenseRecordServiceImpl.java new file mode 100644 index 0000000..1f88b9b --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/OtherExpenseRecordServiceImpl.java @@ -0,0 +1,179 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.excel.OtherExpenseRecordExcel; +import org.springblade.transport.mapper.OtherExpenseRecordMapper; +import org.springblade.transport.pojo.entity.OtherExpenseRecord; +import org.springblade.transport.pojo.vo.OtherExpenseRecordVO; +import org.springblade.transport.service.IOtherExpenseRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +/** + * 其他费用记录 服务实现类 + * + * @author Chill + */ +@Service +public class OtherExpenseRecordServiceImpl extends BaseServiceImpl implements IOtherExpenseRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int REMARK_MAX_LENGTH = 200; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MONEY_SCALE = 2; + private static final String VEHICLE = "车辆"; + private static final String SHIP = "船舶"; + private static final Set EXPENSE_TYPES = Set.of("过路费", "停车费", "维修费", "保险费", "年检费", "装卸费", "其他"); + + @Override + public IPage selectOtherExpenseRecordPage(IPage page, OtherExpenseRecordVO otherExpenseRecord) { + List records = baseMapper.selectOtherExpenseRecordPage(page, otherExpenseRecord); + records.forEach(record -> record.setUpdateUserName(UserCache.getUserRealName(record.getUpdateUser()))); + return page.setRecords(records); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(OtherExpenseRecord otherExpenseRecord) { + prepare(otherExpenseRecord); + validate(otherExpenseRecord); + return saveOrUpdate(otherExpenseRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importOtherExpenseRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + OtherExpenseRecord otherExpenseRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), OtherExpenseRecord.class)); + otherExpenseRecord.setDataSource("批量导入"); + submit(otherExpenseRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportOtherExpenseRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(otherExpenseRecord -> { + OtherExpenseRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(otherExpenseRecord, OtherExpenseRecordExcel.class)); + excel.setAmount(nonNegative(otherExpenseRecord.getAmount())); + return excel; + }).toList(); + } + + private void prepare(OtherExpenseRecord otherExpenseRecord) { + if (Func.isEmpty(otherExpenseRecord.getExpenseDate())) { + otherExpenseRecord.setExpenseDate(LocalDate.now()); + } + otherExpenseRecord.setExpenseType(trimToNull(otherExpenseRecord.getExpenseType())); + otherExpenseRecord.setVehicleType(normalizeVehicleType(otherExpenseRecord.getVehicleType())); + otherExpenseRecord.setVehicleNo(trimToEmpty(otherExpenseRecord.getVehicleNo())); + if (VEHICLE.equals(otherExpenseRecord.getVehicleType())) { + otherExpenseRecord.setVehicleNo(otherExpenseRecord.getVehicleNo().toUpperCase()); + } + otherExpenseRecord.setDataSource(defaultDataSource(otherExpenseRecord.getDataSource())); + otherExpenseRecord.setAttachments(trimToNull(otherExpenseRecord.getAttachments())); + otherExpenseRecord.setRemark(trimToNull(otherExpenseRecord.getRemark())); + } + + private void validate(OtherExpenseRecord otherExpenseRecord) { + if (Func.isEmpty(otherExpenseRecord.getExpenseDate())) { + throw new ServiceException("费用日期不能为空"); + } + if (Func.isEmpty(otherExpenseRecord.getExpenseType())) { + throw new ServiceException("费用类型不能为空"); + } + if (!EXPENSE_TYPES.contains(otherExpenseRecord.getExpenseType())) { + throw new ServiceException("费用类型不正确"); + } + if (Func.isEmpty(otherExpenseRecord.getVehicleType())) { + throw new ServiceException("车船类型不能为空"); + } + if (!VEHICLE.equals(otherExpenseRecord.getVehicleType()) && !SHIP.equals(otherExpenseRecord.getVehicleType())) { + throw new ServiceException("车船类型不正确"); + } + if (Func.isEmpty(otherExpenseRecord.getVehicleNo())) { + throw new ServiceException("车牌号/船号不能为空"); + } + if (Func.isEmpty(otherExpenseRecord.getAmount())) { + throw new ServiceException("金额不能为空"); + } + validateLength(otherExpenseRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过30字"); + validateLength(otherExpenseRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateLength(otherExpenseRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + validateMoney(otherExpenseRecord.getAmount(), "金额"); + } + + private void validateMoney(BigDecimal value, String fieldName) { + if (Func.isEmpty(value)) { + return; + } + if (value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(fieldName + "不能小于0"); + } + if (value.stripTrailingZeros().scale() > MONEY_SCALE) { + throw new ServiceException(fieldName + "最多保留" + MONEY_SCALE + "位小数"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private String defaultDataSource(String dataSource) { + String value = trimToEmpty(dataSource); + return value.isEmpty() ? "手工录入" : value; + } + + private String normalizeVehicleType(String vehicleType) { + String value = trimToEmpty(vehicleType); + return value.isEmpty() ? VEHICLE : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TireReplacementRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TireReplacementRecordServiceImpl.java new file mode 100644 index 0000000..9ec810a --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TireReplacementRecordServiceImpl.java @@ -0,0 +1,183 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.TireReplacementRecordExcel; +import org.springblade.transport.mapper.TireReplacementRecordMapper; +import org.springblade.transport.pojo.entity.TireReplacementRecord; +import org.springblade.transport.pojo.vo.TireReplacementRecordVO; +import org.springblade.transport.service.ITireReplacementRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 换胎记录 服务实现类 + * + * @author Chill + */ +@Service +public class TireReplacementRecordServiceImpl extends BaseServiceImpl implements ITireReplacementRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int HANDLER_MAX_LENGTH = 20; + private static final int TIRE_BRAND_MAX_LENGTH = 50; + private static final int DESCRIPTION_MAX_LENGTH = 200; + private static final int REMARK_MAX_LENGTH = 500; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MONEY_SCALE = 2; + + @Override + public IPage selectTireReplacementRecordPage(IPage page, TireReplacementRecordVO tireReplacementRecord) { + return page.setRecords(baseMapper.selectTireReplacementRecordPage(page, tireReplacementRecord)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(TireReplacementRecord tireReplacementRecord) { + prepare(tireReplacementRecord); + validate(tireReplacementRecord); + return saveOrUpdate(tireReplacementRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importTireReplacementRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + TireReplacementRecord tireReplacementRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), TireReplacementRecord.class)); + submit(tireReplacementRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportTireReplacementRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(tireReplacementRecord -> { + TireReplacementRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(tireReplacementRecord, TireReplacementRecordExcel.class)); + excel.setTireQuantity(validQuantity(tireReplacementRecord.getTireQuantity())); + excel.setReplacementCost(nonNegative(tireReplacementRecord.getReplacementCost())); + return excel; + }).toList(); + } + + private void prepare(TireReplacementRecord tireReplacementRecord) { + tireReplacementRecord.setVehicleNo(trimToEmpty(tireReplacementRecord.getVehicleNo()).toUpperCase()); + tireReplacementRecord.setHandler(trimToNull(tireReplacementRecord.getHandler())); + tireReplacementRecord.setTireBrand(trimToNull(tireReplacementRecord.getTireBrand())); + tireReplacementRecord.setReplacementDescription(trimToNull(tireReplacementRecord.getReplacementDescription())); + tireReplacementRecord.setAttachments(trimToNull(tireReplacementRecord.getAttachments())); + tireReplacementRecord.setRemark(trimToNull(tireReplacementRecord.getRemark())); + } + + private void validate(TireReplacementRecord tireReplacementRecord) { + if (Func.isEmpty(tireReplacementRecord.getVehicleNo())) { + throw new ServiceException("车牌号不能为空"); + } + if (Func.isEmpty(tireReplacementRecord.getReplacementTime())) { + throw new ServiceException("换胎时间不能为空"); + } + if (Func.isEmpty(tireReplacementRecord.getReplacementCost())) { + throw new ServiceException("换胎费用不能为空"); + } + validateLength(tireReplacementRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号不能超过30字"); + validateLength(tireReplacementRecord.getHandler(), HANDLER_MAX_LENGTH, "处理人不能超过20字"); + validateLength(tireReplacementRecord.getTireBrand(), TIRE_BRAND_MAX_LENGTH, "轮胎品牌不能超过50字"); + validateLength(tireReplacementRecord.getReplacementDescription(), DESCRIPTION_MAX_LENGTH, "换胎说明不能超过200字"); + validateLength(tireReplacementRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过500字"); + validateLength(tireReplacementRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + validatePositiveInteger(tireReplacementRecord.getTireQuantity()); + validateNonNegative(tireReplacementRecord.getReplacementCost(), "换胎费用不能小于0"); + validateScale(tireReplacementRecord.getReplacementCost(), "换胎费用最多保留2位小数"); + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private void validatePositiveInteger(Integer value) { + if (Func.isNotEmpty(value) && value <= 0) { + throw new ServiceException("换胎数量必须为正整数"); + } + } + + private void validateNonNegative(BigDecimal value, String message) { + if (Func.isNotEmpty(value) && value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(message); + } + } + + private void validateScale(BigDecimal value, String message) { + if (Func.isNotEmpty(value) && value.stripTrailingZeros().scale() > MONEY_SCALE) { + throw new ServiceException(message); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private Integer validQuantity(Integer value) { + if (Func.isEmpty(value) || value > 0) { + return value; + } + return null; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportChangeRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportChangeRecordServiceImpl.java new file mode 100644 index 0000000..71b5feb --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportChangeRecordServiceImpl.java @@ -0,0 +1,160 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.excel.TransportChangeRecordExcel; +import org.springblade.transport.mapper.TransportChangeRecordMapper; +import org.springblade.transport.pojo.entity.TransportChangeRecord; +import org.springblade.transport.pojo.vo.TransportChangeRecordVO; +import org.springblade.transport.service.ITransportChangeRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +/** + * 变更记录 服务实现类 + * + * @author Chill + */ +@Service +public class TransportChangeRecordServiceImpl extends BaseServiceImpl implements ITransportChangeRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int CHANGE_CONTENT_MAX_LENGTH = 200; + private static final int REMARK_MAX_LENGTH = 200; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final String VEHICLE = "车辆"; + private static final String SHIP = "船舶"; + private static final Set CHANGE_ITEMS = Set.of("所有人变更", "挂靠变更", "经营范围变更", "车牌号变更", "其他"); + + @Override + public IPage selectTransportChangeRecordPage(IPage page, TransportChangeRecordVO transportChangeRecord) { + List records = baseMapper.selectTransportChangeRecordPage(page, transportChangeRecord); + records.forEach(record -> record.setUpdateUserName(UserCache.getUserRealName(record.getUpdateUser()))); + return page.setRecords(records); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(TransportChangeRecord transportChangeRecord) { + prepare(transportChangeRecord); + validate(transportChangeRecord); + return saveOrUpdate(transportChangeRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importTransportChangeRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + TransportChangeRecord transportChangeRecord = Objects.requireNonNull(BeanUtil.copyProperties(data.get(index), TransportChangeRecord.class)); + submit(transportChangeRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportTransportChangeRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream() + .map(transportChangeRecord -> Objects.requireNonNull(BeanUtil.copyProperties(transportChangeRecord, TransportChangeRecordExcel.class))) + .toList(); + } + + private void prepare(TransportChangeRecord transportChangeRecord) { + transportChangeRecord.setVehicleType(normalizeVehicleType(transportChangeRecord.getVehicleType())); + transportChangeRecord.setVehicleNo(trimToNull(transportChangeRecord.getVehicleNo())); + if (Func.isNotEmpty(transportChangeRecord.getVehicleNo()) && VEHICLE.equals(transportChangeRecord.getVehicleType())) { + transportChangeRecord.setVehicleNo(transportChangeRecord.getVehicleNo().toUpperCase()); + } + transportChangeRecord.setChangeItem(trimToNull(transportChangeRecord.getChangeItem())); + transportChangeRecord.setChangeContent(trimToNull(transportChangeRecord.getChangeContent())); + transportChangeRecord.setAttachments(trimToNull(transportChangeRecord.getAttachments())); + transportChangeRecord.setRemark(trimToNull(transportChangeRecord.getRemark())); + } + + private void validate(TransportChangeRecord transportChangeRecord) { + if (Func.isEmpty(transportChangeRecord.getVehicleType())) { + throw new ServiceException("车船类型不能为空"); + } + if (!VEHICLE.equals(transportChangeRecord.getVehicleType()) && !SHIP.equals(transportChangeRecord.getVehicleType())) { + throw new ServiceException("车船类型不正确"); + } + if (Func.isEmpty(transportChangeRecord.getChangeItem())) { + throw new ServiceException("变更事项不能为空"); + } + if (!CHANGE_ITEMS.contains(transportChangeRecord.getChangeItem())) { + throw new ServiceException("变更事项不正确"); + } + if (Func.isEmpty(transportChangeRecord.getChangeContent())) { + throw new ServiceException("变更内容不能为空"); + } + validateLength(transportChangeRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过30字"); + validateLength(transportChangeRecord.getChangeContent(), CHANGE_CONTENT_MAX_LENGTH, "变更内容不能超过200字"); + validateLength(transportChangeRecord.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateLength(transportChangeRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private String normalizeVehicleType(String vehicleType) { + String value = trimToEmpty(vehicleType); + return value.isEmpty() ? VEHICLE : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportShipServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportShipServiceImpl.java new file mode 100644 index 0000000..c895a93 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportShipServiceImpl.java @@ -0,0 +1,219 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.TransportShipExcel; +import org.springblade.transport.mapper.TransportShipMapper; +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.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * 船舶管理 服务实现类 + * + * @author Chill + */ +@Service +public class TransportShipServiceImpl extends BaseServiceImpl implements ITransportShipService { + + private static final int NAME_MAX_LENGTH = 50; + private static final int SHORT_TEXT_MAX_LENGTH = 50; + private static final int REMARK_MAX_LENGTH = 200; + private static final int DEFAULT_ENABLED_STATUS = 1; + private static final int DEFAULT_FALSE = 0; + + @Override + public IPage selectTransportShipPage(IPage page, TransportShipVO ship) { + prepareQuery(ship); + return page.setRecords(baseMapper.selectTransportShipPage(page, ship)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(TransportShip ship) { + prepare(ship); + validate(ship); + checkUniqueIdentifier(ship); + return saveOrUpdate(ship); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean changeStatus(Long id, Integer status) { + if (Func.isEmpty(id)) { + throw new ServiceException("船舶主键不能为空"); + } + if (Func.isEmpty(status) || (status != 1 && status != 2)) { + throw new ServiceException("状态值不正确"); + } + TransportShip ship = new TransportShip(); + ship.setId(id); + ship.setStatus(status); + return updateById(ship); + } + + @Override + public TransportShipExpiryStatVO expiryStat(TransportShipVO ship) { + prepareQuery(ship); + ship.setExpireStatus(null); + TransportShipExpiryStatVO stat = baseMapper.selectExpiryStat(ship); + if (stat == null) { + stat = new TransportShipExpiryStatVO(); + } + stat.setTotal(defaultZero(stat.getTotal())); + stat.setWithin30(defaultZero(stat.getWithin30())); + stat.setExpired(defaultZero(stat.getExpired())); + return stat; + } + + @Override + public List exportTransportShip(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(ship -> { + TransportShipExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(ship, TransportShipExcel.class)); + excel.setStatusName(ship.getStatus() != null && ship.getStatus() == 2 ? "停用" : "启用"); + excel.setNationalityCertLongTermName(yesNo(ship.getNationalityCertLongTerm())); + excel.setSafeManningCertLongTermName(yesNo(ship.getSafeManningCertLongTerm())); + excel.setBusinessTransportCertLongTermName(yesNo(ship.getBusinessTransportCertLongTerm())); + excel.setLeaseLongTermName(yesNo(ship.getLeaseLongTerm())); + return excel; + }).toList(); + } + + private void prepareQuery(TransportShipVO ship) { + if (ship.getToday() == null) { + ship.setToday(LocalDate.now()); + } + if (ship.getWarningDate() == null) { + ship.setWarningDate(ship.getToday().plusDays(30)); + } + } + + private void prepare(TransportShip ship) { + ship.setShipName(trimToEmpty(ship.getShipName())); + ship.setShipIdentifierNo(trimToEmpty(ship.getShipIdentifierNo()).toUpperCase()); + ship.setOrganizationName(trimToEmpty(ship.getOrganizationName())); + ship.setShipInspectionNo(trimToNull(ship.getShipInspectionNo())); + ship.setShipType(trimToEmpty(ship.getShipType())); + ship.setNationalityCertImage(trimToNull(ship.getNationalityCertImage())); + ship.setSafeManningCertImage(trimToNull(ship.getSafeManningCertImage())); + ship.setBusinessTransportCertImage(trimToNull(ship.getBusinessTransportCertImage())); + ship.setLeaseContractImage(trimToNull(ship.getLeaseContractImage())); + ship.setRemark(trimToNull(ship.getRemark())); + if (ship.getNationalityCertLongTerm() == null) { + ship.setNationalityCertLongTerm(DEFAULT_FALSE); + } + if (ship.getSafeManningCertLongTerm() == null) { + ship.setSafeManningCertLongTerm(DEFAULT_FALSE); + } + if (ship.getBusinessTransportCertLongTerm() == null) { + ship.setBusinessTransportCertLongTerm(DEFAULT_FALSE); + } + if (ship.getLeaseLongTerm() == null) { + ship.setLeaseLongTerm(DEFAULT_FALSE); + } + if (ship.getStatus() == null) { + ship.setStatus(DEFAULT_ENABLED_STATUS); + } + } + + private void validate(TransportShip ship) { + if (Func.isEmpty(ship.getShipName())) { + throw new ServiceException("船舶名不能为空"); + } + if (Func.isEmpty(ship.getShipIdentifierNo())) { + throw new ServiceException("船舶识别号不能为空"); + } + if (Func.isEmpty(ship.getOrganizationName())) { + throw new ServiceException("所属组织不能为空"); + } + if (Func.isEmpty(ship.getShipType())) { + throw new ServiceException("船舶类型不能为空"); + } + if (ship.getNationalityCertLongTerm() != 1 && Func.isEmpty(ship.getNationalityCertEndDate())) { + throw new ServiceException("国籍证有效期至不能为空"); + } + if (ship.getSafeManningCertLongTerm() != 1 && Func.isEmpty(ship.getSafeManningCertEndDate())) { + throw new ServiceException("最低安全配员证书有效期至不能为空"); + } + if (ship.getBusinessTransportCertLongTerm() != 1 && Func.isEmpty(ship.getBusinessTransportCertEndDate())) { + throw new ServiceException("营业运输证有效期至不能为空"); + } + validateLength(ship.getShipName(), NAME_MAX_LENGTH, "船舶名不能超过50字"); + validateLength(ship.getShipIdentifierNo(), SHORT_TEXT_MAX_LENGTH, "船舶识别号不能超过50字"); + validateLength(ship.getOrganizationName(), NAME_MAX_LENGTH, "所属组织不能超过50字"); + validateLength(ship.getShipInspectionNo(), SHORT_TEXT_MAX_LENGTH, "船检登记号不能超过50字"); + validateLength(ship.getShipType(), SHORT_TEXT_MAX_LENGTH, "船舶类型不能超过50字"); + validateLength(ship.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + } + + private void checkUniqueIdentifier(TransportShip ship) { + Long count = count(Wrappers.lambdaQuery() + .eq(TransportShip::getIsDeleted, 0) + .eq(TransportShip::getShipIdentifierNo, ship.getShipIdentifierNo()) + .ne(Func.isNotEmpty(ship.getId()), TransportShip::getId, ship.getId())); + if (count > 0) { + throw new ServiceException("船舶识别号已存在"); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private Long defaultZero(Long value) { + return value == null ? 0L : value; + } + + private String yesNo(Integer value) { + return value != null && value == 1 ? "是" : "否"; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportVehicleServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportVehicleServiceImpl.java new file mode 100644 index 0000000..1eb8362 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/TransportVehicleServiceImpl.java @@ -0,0 +1,264 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.TransportVehicleExcel; +import org.springblade.transport.mapper.TransportVehicleMapper; +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.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; +import java.util.regex.Pattern; + +/** + * 车辆管理 服务实现类 + * + * @author Chill + */ +@Service +public class TransportVehicleServiceImpl extends BaseServiceImpl implements ITransportVehicleService { + + private static final Pattern PLATE_NO_PATTERN = Pattern.compile("^[\\u4e00-\\u9fa5][A-Z][A-Z0-9挂学警港澳]{5,6}$"); + private static final int SHORT_TEXT_MAX_LENGTH = 50; + private static final int ORG_MAX_LENGTH = 50; + private static final int REMARK_MAX_LENGTH = 200; + private static final int DEFAULT_ENABLED_STATUS = 1; + private static final int DEFAULT_FALSE = 0; + + @Override + public IPage selectTransportVehiclePage(IPage page, TransportVehicleVO vehicle) { + prepareQuery(vehicle); + return page.setRecords(baseMapper.selectTransportVehiclePage(page, vehicle)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(TransportVehicle vehicle) { + prepare(vehicle); + validate(vehicle); + checkUniquePlateNo(vehicle); + return saveOrUpdate(vehicle); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean changeStatus(Long id, Integer status) { + if (Func.isEmpty(id)) { + throw new ServiceException("车辆主键不能为空"); + } + if (Func.isEmpty(status) || (status != 1 && status != 2)) { + throw new ServiceException("状态值不正确"); + } + TransportVehicle vehicle = new TransportVehicle(); + vehicle.setId(id); + vehicle.setStatus(status); + return updateById(vehicle); + } + + @Override + public TransportVehicleExpiryStatVO expiryStat(TransportVehicleVO vehicle) { + prepareQuery(vehicle); + vehicle.setExpireStatus(null); + TransportVehicleExpiryStatVO stat = baseMapper.selectExpiryStat(vehicle); + if (stat == null) { + stat = new TransportVehicleExpiryStatVO(); + } + stat.setTotal(defaultZero(stat.getTotal())); + stat.setWithin30(defaultZero(stat.getWithin30())); + stat.setExpired(defaultZero(stat.getExpired())); + return stat; + } + + @Override + public List exportTransportVehicle(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(vehicle -> { + TransportVehicleExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(vehicle, TransportVehicleExcel.class)); + excel.setStatusName(vehicle.getStatus() != null && vehicle.getStatus() == 2 ? "停用" : "启用"); + excel.setCompulsoryScrapLongTermName(yesNo(vehicle.getCompulsoryScrapLongTerm())); + excel.setDrivingLicenseLongTermName(yesNo(vehicle.getDrivingLicenseLongTerm())); + excel.setRoadTransportCertLongTermName(yesNo(vehicle.getRoadTransportCertLongTerm())); + excel.setAnnualReviewLongTermName(yesNo(vehicle.getAnnualReviewLongTerm())); + return excel; + }).toList(); + } + + private void prepareQuery(TransportVehicleVO vehicle) { + if (vehicle.getToday() == null) { + vehicle.setToday(LocalDate.now()); + } + if (vehicle.getWarningDate() == null) { + vehicle.setWarningDate(vehicle.getToday().plusDays(30)); + } + } + + private void prepare(TransportVehicle vehicle) { + vehicle.setOrganizationName(trimToEmpty(vehicle.getOrganizationName())); + vehicle.setPlateNo(trimToEmpty(vehicle.getPlateNo()).toUpperCase()); + vehicle.setVehicleType(trimToEmpty(vehicle.getVehicleType())); + vehicle.setBusinessRelation(trimToEmpty(vehicle.getBusinessRelation())); + vehicle.setEnergyType(trimToEmpty(vehicle.getEnergyType())); + vehicle.setCustomsRecordNo(trimToNull(vehicle.getCustomsRecordNo())); + vehicle.setDrivingLicenseNo(trimToEmpty(vehicle.getDrivingLicenseNo())); + vehicle.setRoadTransportCertNo(trimToEmpty(vehicle.getRoadTransportCertNo())); + vehicle.setRegistrationNo(trimToEmpty(vehicle.getRegistrationNo())); + vehicle.setDrivingLicenseImage(trimToNull(vehicle.getDrivingLicenseImage())); + vehicle.setRoadTransportCertImage(trimToNull(vehicle.getRoadTransportCertImage())); + vehicle.setRegistrationImage(trimToNull(vehicle.getRegistrationImage())); + vehicle.setRemark(trimToNull(vehicle.getRemark())); + if (vehicle.getCompulsoryScrapLongTerm() == null) { + vehicle.setCompulsoryScrapLongTerm(DEFAULT_FALSE); + } + if (vehicle.getDrivingLicenseLongTerm() == null) { + vehicle.setDrivingLicenseLongTerm(DEFAULT_FALSE); + } + if (vehicle.getRoadTransportCertLongTerm() == null) { + vehicle.setRoadTransportCertLongTerm(DEFAULT_FALSE); + } + if (vehicle.getAnnualReviewLongTerm() == null) { + vehicle.setAnnualReviewLongTerm(DEFAULT_FALSE); + } + if (vehicle.getStatus() == null) { + vehicle.setStatus(DEFAULT_ENABLED_STATUS); + } + } + + private void validate(TransportVehicle vehicle) { + if (Func.isEmpty(vehicle.getOrganizationName())) { + throw new ServiceException("所属组织不能为空"); + } + if (Func.isEmpty(vehicle.getPlateNo())) { + throw new ServiceException("车牌号不能为空"); + } + if (!PLATE_NO_PATTERN.matcher(vehicle.getPlateNo()).matches()) { + throw new ServiceException("车牌号格式不正确"); + } + if (Func.isEmpty(vehicle.getVehicleType())) { + throw new ServiceException("车辆类型不能为空"); + } + if (Func.isEmpty(vehicle.getApprovedLoadKg())) { + throw new ServiceException("核定载质量不能为空"); + } + if (Func.isEmpty(vehicle.getBusinessRelation())) { + throw new ServiceException("业务关系不能为空"); + } + if (Func.isEmpty(vehicle.getEnergyType())) { + throw new ServiceException("能源类型不能为空"); + } + if (Func.isEmpty(vehicle.getDrivingLicenseNo())) { + throw new ServiceException("行驶证档案编号不能为空"); + } + if (vehicle.getDrivingLicenseLongTerm() != 1 && Func.isEmpty(vehicle.getDrivingLicenseEndDate())) { + throw new ServiceException("行驶证有效期止不能为空"); + } + if (Func.isEmpty(vehicle.getRoadTransportCertNo())) { + throw new ServiceException("道路运输证号不能为空"); + } + if (vehicle.getRoadTransportCertLongTerm() != 1 && Func.isEmpty(vehicle.getRoadTransportCertEndDate())) { + throw new ServiceException("道路运输证有效期止不能为空"); + } + if (vehicle.getAnnualReviewLongTerm() != 1 && Func.isEmpty(vehicle.getAnnualReviewEndDate())) { + throw new ServiceException("道路运输年审有效期不能为空"); + } + if (Func.isEmpty(vehicle.getRegistrationNo())) { + throw new ServiceException("机动车登记编号不能为空"); + } + validateNonNegative(vehicle.getOuterLength(), "外廓长度不能小于0"); + validateNonNegative(vehicle.getOuterWidth(), "外廓宽度不能小于0"); + validateNonNegative(vehicle.getOuterHeight(), "外廓高度不能小于0"); + validateNonNegative(vehicle.getApprovedLoadKg(), "核定载质量不能小于0"); + validateNonNegative(vehicle.getTractionMassKg(), "准牵引总质量不能小于0"); + validateLength(vehicle.getOrganizationName(), ORG_MAX_LENGTH, "所属组织不能超过50字"); + validateLength(vehicle.getVehicleType(), SHORT_TEXT_MAX_LENGTH, "车辆类型不能超过50字"); + validateLength(vehicle.getBusinessRelation(), SHORT_TEXT_MAX_LENGTH, "业务关系不能超过50字"); + validateLength(vehicle.getEnergyType(), SHORT_TEXT_MAX_LENGTH, "能源类型不能超过50字"); + validateLength(vehicle.getCustomsRecordNo(), SHORT_TEXT_MAX_LENGTH, "海关备案号不能超过50字"); + validateLength(vehicle.getDrivingLicenseNo(), SHORT_TEXT_MAX_LENGTH, "行驶证档案编号不能超过50字"); + validateLength(vehicle.getRoadTransportCertNo(), SHORT_TEXT_MAX_LENGTH, "道路运输证号不能超过50字"); + validateLength(vehicle.getRegistrationNo(), SHORT_TEXT_MAX_LENGTH, "机动车登记编号不能超过50字"); + validateLength(vehicle.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字"); + validateDateRange(vehicle.getDrivingLicenseStartDate(), vehicle.getDrivingLicenseEndDate(), "行驶证有效期止不能早于有效期起"); + validateDateRange(vehicle.getRoadTransportCertStartDate(), vehicle.getRoadTransportCertEndDate(), "道路运输证有效期止不能早于有效期起"); + } + + private void checkUniquePlateNo(TransportVehicle vehicle) { + Long count = count(Wrappers.lambdaQuery() + .eq(TransportVehicle::getIsDeleted, 0) + .eq(TransportVehicle::getPlateNo, vehicle.getPlateNo()) + .ne(Func.isNotEmpty(vehicle.getId()), TransportVehicle::getId, vehicle.getId())); + if (count > 0) { + throw new ServiceException("车牌号已存在"); + } + } + + private void validateNonNegative(Integer value, String message) { + if (Func.isNotEmpty(value) && value < 0) { + throw new ServiceException(message); + } + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private void validateDateRange(LocalDate startDate, LocalDate endDate, String message) { + if (Func.isNotEmpty(startDate) && Func.isNotEmpty(endDate) && endDate.isBefore(startDate)) { + throw new ServiceException(message); + } + } + + private Long defaultZero(Long value) { + return value == null ? 0L : value; + } + + private String yesNo(Integer value) { + return value != null && value == 1 ? "是" : "否"; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ViolationRecordServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ViolationRecordServiceImpl.java new file mode 100644 index 0000000..e31c85a --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ViolationRecordServiceImpl.java @@ -0,0 +1,264 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.transport.excel.ViolationRecordExcel; +import org.springblade.transport.mapper.ViolationRecordMapper; +import org.springblade.transport.pojo.entity.ViolationRecord; +import org.springblade.transport.pojo.vo.ViolationRecordVO; +import org.springblade.transport.service.IViolationRecordService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 违章记录 服务实现类 + * + * @author Chill + */ +@Service +public class ViolationRecordServiceImpl extends BaseServiceImpl implements IViolationRecordService { + + private static final int VEHICLE_NO_MAX_LENGTH = 30; + private static final int DRIVER_NAME_MAX_LENGTH = 20; + private static final int TYPE_MAX_LENGTH = 50; + private static final int ITEM_MAX_LENGTH = 100; + private static final int LOCATION_MAX_LENGTH = 100; + private static final int PENALTY_UNIT_MAX_LENGTH = 50; + private static final int DESCRIPTION_MAX_LENGTH = 500; + private static final int RESULT_MAX_LENGTH = 500; + private static final int ATTACHMENTS_MAX_LENGTH = 1000; + private static final int MAX_DEDUCT_POINTS = 15; + private static final String PROCESSED = "已处理"; + private static final String UNPROCESSED = "未处理"; + + @Override + public IPage selectViolationRecordPage(IPage page, ViolationRecordVO violationRecord) { + return page.setRecords(baseMapper.selectViolationRecordPage(page, violationRecord)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(ViolationRecord violationRecord) { + prepare(violationRecord); + validate(violationRecord); + validateVehicleTypeImmutable(violationRecord); + return saveOrUpdate(violationRecord); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importViolationRecord(List data) { + if (Func.isEmpty(data)) { + throw new ServiceException("导入数据不能为空"); + } + List errorList = new ArrayList<>(); + for (int index = 0; index < data.size(); index++) { + try { + ViolationRecordExcel excel = data.get(index); + ViolationRecord violationRecord = Objects.requireNonNull(BeanUtil.copyProperties(excel, ViolationRecord.class)); + fillViolationContent(violationRecord, excel.getViolationContent()); + submit(violationRecord); + } catch (Exception exception) { + errorList.add("第" + (index + 2) + "行:" + exception.getMessage()); + } + } + if (Func.isNotEmpty(errorList)) { + throw new ServiceException(String.join(";", errorList)); + } + } + + @Override + public List exportViolationRecord(Wrapper queryWrapper) { + return list(queryWrapper).stream().map(violationRecord -> { + ViolationRecordExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(violationRecord, ViolationRecordExcel.class)); + excel.setViolationContent(violationContent(violationRecord)); + excel.setFineAmount(nonNegative(violationRecord.getFineAmount())); + excel.setDeductPoints(validDeductPoints(violationRecord.getDeductPoints())); + return excel; + }).toList(); + } + + private void prepare(ViolationRecord violationRecord) { + violationRecord.setVehicleType(normalizeVehicleType(violationRecord.getVehicleType())); + violationRecord.setVehicleNo(trimToEmpty(violationRecord.getVehicleNo()).toUpperCase()); + violationRecord.setDriverName(trimToEmpty(violationRecord.getDriverName())); + violationRecord.setViolationType(trimToNull(violationRecord.getViolationType())); + violationRecord.setViolationItem(trimToNull(violationRecord.getViolationItem())); + violationRecord.setLocation(trimToEmpty(violationRecord.getLocation())); + violationRecord.setPenaltyUnit(trimToNull(violationRecord.getPenaltyUnit())); + violationRecord.setProcessStatus(normalizeProcessStatus(violationRecord.getProcessStatus())); + violationRecord.setProcessDescription(trimToEmpty(violationRecord.getProcessDescription())); + violationRecord.setProcessResult(trimToNull(violationRecord.getProcessResult())); + violationRecord.setAttachments(trimToNull(violationRecord.getAttachments())); + if ("车辆".equals(violationRecord.getVehicleType())) { + violationRecord.setViolationItem(null); + } else { + violationRecord.setViolationType(null); + } + if (UNPROCESSED.equals(violationRecord.getProcessStatus())) { + violationRecord.setProcessResult(null); + } + } + + private void validate(ViolationRecord violationRecord) { + if (Func.isEmpty(violationRecord.getVehicleType())) { + throw new ServiceException("车船类型不能为空"); + } + if (!"车辆".equals(violationRecord.getVehicleType()) && !"船舶".equals(violationRecord.getVehicleType())) { + throw new ServiceException("车船类型不正确"); + } + if (Func.isEmpty(violationRecord.getVehicleNo())) { + throw new ServiceException("车牌号/船号不能为空"); + } + if (Func.isEmpty(violationRecord.getDriverName())) { + throw new ServiceException("驾驶人/船长不能为空"); + } + if ("车辆".equals(violationRecord.getVehicleType()) && Func.isEmpty(violationRecord.getViolationType())) { + throw new ServiceException("类型不能为空"); + } + if ("船舶".equals(violationRecord.getVehicleType()) && Func.isEmpty(violationRecord.getViolationItem())) { + throw new ServiceException("事项不能为空"); + } + if (Func.isEmpty(violationRecord.getViolationTime())) { + throw new ServiceException("时间不能为空"); + } + if (violationRecord.getViolationTime().isAfter(LocalDateTime.now())) { + throw new ServiceException("时间不能超过当前时间"); + } + if (Func.isEmpty(violationRecord.getLocation())) { + throw new ServiceException("地址不能为空"); + } + if (Func.isEmpty(violationRecord.getProcessStatus())) { + throw new ServiceException("状态不能为空"); + } + if (!PROCESSED.equals(violationRecord.getProcessStatus()) && !UNPROCESSED.equals(violationRecord.getProcessStatus())) { + throw new ServiceException("状态值不正确"); + } + if (Func.isEmpty(violationRecord.getProcessDescription())) { + throw new ServiceException("过程描述不能为空"); + } + validateNonNegative(violationRecord.getFineAmount(), "被罚金额不能小于0"); + validateDeductPoints(violationRecord.getDeductPoints()); + validateLength(violationRecord.getVehicleNo(), VEHICLE_NO_MAX_LENGTH, "车牌号/船号不能超过30字"); + validateLength(violationRecord.getDriverName(), DRIVER_NAME_MAX_LENGTH, "驾驶人/船长不能超过20字"); + validateLength(violationRecord.getViolationType(), TYPE_MAX_LENGTH, "类型不能超过50字"); + validateLength(violationRecord.getViolationItem(), ITEM_MAX_LENGTH, "事项不能超过100字"); + validateLength(violationRecord.getLocation(), LOCATION_MAX_LENGTH, "地址不能超过100字"); + validateLength(violationRecord.getPenaltyUnit(), PENALTY_UNIT_MAX_LENGTH, "被罚单位不能超过50字"); + validateLength(violationRecord.getProcessDescription(), DESCRIPTION_MAX_LENGTH, "过程描述不能超过500字"); + validateLength(violationRecord.getProcessResult(), RESULT_MAX_LENGTH, "处理结果不能超过500字"); + validateLength(violationRecord.getAttachments(), ATTACHMENTS_MAX_LENGTH, "附件不能超过1000字"); + } + + private void validateVehicleTypeImmutable(ViolationRecord violationRecord) { + if (Func.isEmpty(violationRecord.getId())) { + return; + } + ViolationRecord oldRecord = getById(violationRecord.getId()); + if (oldRecord != null && Func.isNotEmpty(oldRecord.getVehicleType()) && !oldRecord.getVehicleType().equals(violationRecord.getVehicleType())) { + throw new ServiceException("车船类型保存后不可修改"); + } + } + + private void fillViolationContent(ViolationRecord violationRecord, String violationContent) { + if ("船舶".equals(normalizeVehicleType(violationRecord.getVehicleType()))) { + violationRecord.setViolationItem(violationContent); + } else { + violationRecord.setViolationType(violationContent); + } + } + + private String violationContent(ViolationRecord violationRecord) { + return "船舶".equals(violationRecord.getVehicleType()) ? violationRecord.getViolationItem() : violationRecord.getViolationType(); + } + + private void validateLength(String value, int maxLength, String message) { + if (Func.isNotEmpty(value) && value.length() > maxLength) { + throw new ServiceException(message); + } + } + + private void validateNonNegative(BigDecimal value, String message) { + if (Func.isNotEmpty(value) && value.compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException(message); + } + } + + private void validateDeductPoints(Integer value) { + if (Func.isNotEmpty(value) && (value < 0 || value > MAX_DEDUCT_POINTS)) { + throw new ServiceException("被扣分数范围为0-15分"); + } + } + + private BigDecimal nonNegative(BigDecimal value) { + if (Func.isEmpty(value) || value.compareTo(BigDecimal.ZERO) >= 0) { + return value; + } + return BigDecimal.ZERO; + } + + private Integer validDeductPoints(Integer value) { + if (Func.isEmpty(value)) { + return value; + } + if (value < 0) { + return 0; + } + return Math.min(value, MAX_DEDUCT_POINTS); + } + + private String normalizeVehicleType(String vehicleType) { + String value = trimToEmpty(vehicleType); + return value.isEmpty() ? "车辆" : value; + } + + private String normalizeProcessStatus(String processStatus) { + String value = trimToEmpty(processStatus); + return value.isEmpty() ? PROCESSED : value; + } + + private String trimToEmpty(String value) { + return value == null ? "" : value.trim(); + } + + private String trimToNull(String value) { + String trimValue = trimToEmpty(value); + return trimValue.isEmpty() ? null : trimValue; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AccidentRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AccidentRecordWrapper.java new file mode 100644 index 0000000..19e476f --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AccidentRecordWrapper.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.AccidentRecord; +import org.springblade.transport.pojo.vo.AccidentRecordVO; + +import java.util.Objects; + +/** + * 事故记录包装类 + * + * @author Chill + */ +public class AccidentRecordWrapper extends BaseEntityWrapper { + + public static AccidentRecordWrapper build() { + return new AccidentRecordWrapper(); + } + + @Override + public AccidentRecordVO entityVO(AccidentRecord accidentRecord) { + AccidentRecordVO accidentRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(accidentRecord, AccidentRecordVO.class)); + accidentRecordVO.setUpdateUserName(UserCache.getUserRealName(accidentRecord.getUpdateUser())); + return accidentRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AnnualInspectionRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AnnualInspectionRecordWrapper.java new file mode 100644 index 0000000..be0587c --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/AnnualInspectionRecordWrapper.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.AnnualInspectionRecord; +import org.springblade.transport.pojo.vo.AnnualInspectionRecordVO; + +import java.util.Objects; + +/** + * 年检记录包装类 + * + * @author Chill + */ +public class AnnualInspectionRecordWrapper extends BaseEntityWrapper { + + public static AnnualInspectionRecordWrapper build() { + return new AnnualInspectionRecordWrapper(); + } + + @Override + public AnnualInspectionRecordVO entityVO(AnnualInspectionRecord annualInspectionRecord) { + AnnualInspectionRecordVO annualInspectionRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(annualInspectionRecord, AnnualInspectionRecordVO.class)); + annualInspectionRecordVO.setUpdateUserName(UserCache.getUserRealName(annualInspectionRecord.getUpdateUser())); + return annualInspectionRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/CustomerArchiveWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/CustomerArchiveWrapper.java new file mode 100644 index 0000000..84a8b68 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/CustomerArchiveWrapper.java @@ -0,0 +1,48 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.transport.pojo.entity.CustomerArchive; +import org.springblade.transport.pojo.vo.CustomerArchiveVO; + +import java.util.Objects; + +/** + * 客商档案包装类 + * + * @author Chill + */ +public class CustomerArchiveWrapper extends BaseEntityWrapper { + + public static CustomerArchiveWrapper build() { + return new CustomerArchiveWrapper(); + } + + @Override + public CustomerArchiveVO entityVO(CustomerArchive customerArchive) { + return Objects.requireNonNull(BeanUtil.copyProperties(customerArchive, CustomerArchiveVO.class)); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/DriverWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/DriverWrapper.java new file mode 100644 index 0000000..73d0fa9 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/DriverWrapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.transport.pojo.entity.Driver; +import org.springblade.transport.pojo.vo.DriverVO; + +import java.util.Objects; + +/** + * 司机管理包装类 + * + * @author Chill + */ +public class DriverWrapper extends BaseEntityWrapper { + + public static DriverWrapper build() { + return new DriverWrapper(); + } + + @Override + public DriverVO entityVO(Driver driver) { + return Objects.requireNonNull(BeanUtil.copyProperties(driver, DriverVO.class)); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/EtcRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/EtcRecordWrapper.java new file mode 100644 index 0000000..ba05721 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/EtcRecordWrapper.java @@ -0,0 +1,35 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.EtcRecord; +import org.springblade.transport.pojo.vo.EtcRecordVO; + +import java.util.Objects; + +/** + * ETC记录包装类 + * + * @author Chill + */ +public class EtcRecordWrapper extends BaseEntityWrapper { + + public static EtcRecordWrapper build() { + return new EtcRecordWrapper(); + } + + @Override + public EtcRecordVO entityVO(EtcRecord etcRecord) { + EtcRecordVO etcRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(etcRecord, EtcRecordVO.class)); + etcRecordVO.setUpdateUserName(UserCache.getUserRealName(etcRecord.getUpdateUser())); + return etcRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/InsuranceRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/InsuranceRecordWrapper.java new file mode 100644 index 0000000..63f97da --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/InsuranceRecordWrapper.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.InsuranceRecord; +import org.springblade.transport.pojo.vo.InsuranceRecordVO; + +import java.util.Objects; + +/** + * 保险记录包装类 + * + * @author Chill + */ +public class InsuranceRecordWrapper extends BaseEntityWrapper { + + public static InsuranceRecordWrapper build() { + return new InsuranceRecordWrapper(); + } + + @Override + public InsuranceRecordVO entityVO(InsuranceRecord insuranceRecord) { + InsuranceRecordVO insuranceRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(insuranceRecord, InsuranceRecordVO.class)); + insuranceRecordVO.setUpdateUserName(UserCache.getUserRealName(insuranceRecord.getUpdateUser())); + return insuranceRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/MaintenancePlanWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/MaintenancePlanWrapper.java index 83bcbca..80d7ad7 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/MaintenancePlanWrapper.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/MaintenancePlanWrapper.java @@ -27,6 +27,7 @@ package org.springblade.transport.wrapper; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; import org.springblade.transport.pojo.entity.MaintenancePlan; import org.springblade.transport.pojo.vo.MaintenancePlanVO; @@ -45,7 +46,9 @@ public class MaintenancePlanWrapper extends BaseEntityWrapper + * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.MileageRecord; +import org.springblade.transport.pojo.vo.MileageRecordVO; + +import java.util.Objects; + +/** + * 里程记录包装类 + * + * @author Chill + */ +public class MileageRecordWrapper extends BaseEntityWrapper { + + public static MileageRecordWrapper build() { + return new MileageRecordWrapper(); + } + + @Override + public MileageRecordVO entityVO(MileageRecord mileageRecord) { + MileageRecordVO mileageRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(mileageRecord, MileageRecordVO.class)); + mileageRecordVO.setUpdateUserName(UserCache.getUserRealName(mileageRecord.getUpdateUser())); + return mileageRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OilElectricRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OilElectricRecordWrapper.java new file mode 100644 index 0000000..63c5e90 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OilElectricRecordWrapper.java @@ -0,0 +1,35 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.OilElectricRecord; +import org.springblade.transport.pojo.vo.OilElectricRecordVO; + +import java.util.Objects; + +/** + * 油电记录包装类 + * + * @author Chill + */ +public class OilElectricRecordWrapper extends BaseEntityWrapper { + + public static OilElectricRecordWrapper build() { + return new OilElectricRecordWrapper(); + } + + @Override + public OilElectricRecordVO entityVO(OilElectricRecord oilElectricRecord) { + OilElectricRecordVO oilElectricRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(oilElectricRecord, OilElectricRecordVO.class)); + oilElectricRecordVO.setUpdateUserName(UserCache.getUserRealName(oilElectricRecord.getUpdateUser())); + return oilElectricRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OtherExpenseRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OtherExpenseRecordWrapper.java new file mode 100644 index 0000000..0b1af04 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/OtherExpenseRecordWrapper.java @@ -0,0 +1,35 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.OtherExpenseRecord; +import org.springblade.transport.pojo.vo.OtherExpenseRecordVO; + +import java.util.Objects; + +/** + * 其他费用记录包装类 + * + * @author Chill + */ +public class OtherExpenseRecordWrapper extends BaseEntityWrapper { + + public static OtherExpenseRecordWrapper build() { + return new OtherExpenseRecordWrapper(); + } + + @Override + public OtherExpenseRecordVO entityVO(OtherExpenseRecord otherExpenseRecord) { + OtherExpenseRecordVO otherExpenseRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(otherExpenseRecord, OtherExpenseRecordVO.class)); + otherExpenseRecordVO.setUpdateUserName(UserCache.getUserRealName(otherExpenseRecord.getUpdateUser())); + return otherExpenseRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TireReplacementRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TireReplacementRecordWrapper.java new file mode 100644 index 0000000..649544f --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TireReplacementRecordWrapper.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.TireReplacementRecord; +import org.springblade.transport.pojo.vo.TireReplacementRecordVO; + +import java.util.Objects; + +/** + * 换胎记录包装类 + * + * @author Chill + */ +public class TireReplacementRecordWrapper extends BaseEntityWrapper { + + public static TireReplacementRecordWrapper build() { + return new TireReplacementRecordWrapper(); + } + + @Override + public TireReplacementRecordVO entityVO(TireReplacementRecord tireReplacementRecord) { + TireReplacementRecordVO tireReplacementRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(tireReplacementRecord, TireReplacementRecordVO.class)); + tireReplacementRecordVO.setUpdateUserName(UserCache.getUserRealName(tireReplacementRecord.getUpdateUser())); + return tireReplacementRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportChangeRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportChangeRecordWrapper.java new file mode 100644 index 0000000..2767ee7 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportChangeRecordWrapper.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.TransportChangeRecord; +import org.springblade.transport.pojo.vo.TransportChangeRecordVO; + +import java.util.Objects; + +/** + * 变更记录包装类 + * + * @author Chill + */ +public class TransportChangeRecordWrapper extends BaseEntityWrapper { + + public static TransportChangeRecordWrapper build() { + return new TransportChangeRecordWrapper(); + } + + @Override + public TransportChangeRecordVO entityVO(TransportChangeRecord transportChangeRecord) { + TransportChangeRecordVO transportChangeRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(transportChangeRecord, TransportChangeRecordVO.class)); + transportChangeRecordVO.setUpdateUserName(UserCache.getUserRealName(transportChangeRecord.getUpdateUser())); + return transportChangeRecordVO; + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportShipWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportShipWrapper.java new file mode 100644 index 0000000..45b09f9 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportShipWrapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.transport.pojo.entity.TransportShip; +import org.springblade.transport.pojo.vo.TransportShipVO; + +import java.util.Objects; + +/** + * 船舶管理包装类 + * + * @author Chill + */ +public class TransportShipWrapper extends BaseEntityWrapper { + + public static TransportShipWrapper build() { + return new TransportShipWrapper(); + } + + @Override + public TransportShipVO entityVO(TransportShip ship) { + return Objects.requireNonNull(BeanUtil.copyProperties(ship, TransportShipVO.class)); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportVehicleWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportVehicleWrapper.java new file mode 100644 index 0000000..b46dcd9 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/TransportVehicleWrapper.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.transport.pojo.entity.TransportVehicle; +import org.springblade.transport.pojo.vo.TransportVehicleVO; + +import java.util.Objects; + +/** + * 车辆管理包装类 + * + * @author Chill + */ +public class TransportVehicleWrapper extends BaseEntityWrapper { + + public static TransportVehicleWrapper build() { + return new TransportVehicleWrapper(); + } + + @Override + public TransportVehicleVO entityVO(TransportVehicle vehicle) { + return Objects.requireNonNull(BeanUtil.copyProperties(vehicle, TransportVehicleVO.class)); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/ViolationRecordWrapper.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/ViolationRecordWrapper.java new file mode 100644 index 0000000..0454d24 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/wrapper/ViolationRecordWrapper.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.cache.UserCache; +import org.springblade.transport.pojo.entity.ViolationRecord; +import org.springblade.transport.pojo.vo.ViolationRecordVO; + +import java.util.Objects; + +/** + * 违章记录包装类 + * + * @author Chill + */ +public class ViolationRecordWrapper extends BaseEntityWrapper { + + public static ViolationRecordWrapper build() { + return new ViolationRecordWrapper(); + } + + @Override + public ViolationRecordVO entityVO(ViolationRecord violationRecord) { + ViolationRecordVO violationRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(violationRecord, ViolationRecordVO.class)); + violationRecordVO.setUpdateUserName(UserCache.getUserRealName(violationRecord.getUpdateUser())); + return violationRecordVO; + } + +} diff --git a/doc/sql/transport/blade_accident_record.sql b/doc/sql/transport/blade_accident_record.sql new file mode 100644 index 0000000..c3362a4 --- /dev/null +++ b/doc/sql/transport/blade_accident_record.sql @@ -0,0 +1,46 @@ +-- ---------------------------- +-- Table structure for blade_accident_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_accident_record`; +CREATE TABLE `blade_accident_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `accident_date` date NOT NULL COMMENT '事故发生日期', + `accident_location` varchar(100) DEFAULT NULL COMMENT '事故发生地点', + `accident_nature` varchar(20) DEFAULT NULL COMMENT '事故性质', + `accident_responsibility` varchar(20) DEFAULT NULL COMMENT '事故责任', + `direct_economic_loss` decimal(18,2) DEFAULT NULL COMMENT '直接经济损失', + `insurance_claim_amount` decimal(18,2) DEFAULT NULL COMMENT '保险理赔金额', + `accident_reason_damage` varchar(500) DEFAULT NULL COMMENT '事故原因及损坏情况', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_accident_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_accident_record_date` (`accident_date`) USING BTREE, + KEY `idx_accident_record_nature` (`accident_nature`) USING BTREE, + KEY `idx_accident_record_responsibility` (`accident_responsibility`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事故记录'; + +-- ---------------------------- +-- Records of blade_menu for accident record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077640000000000001, 2075436235826896898, 'accident_record', '事故记录', 'accident_record', '/vehicle/accident-record', 'iconfont iconicon_doc', 90, 1, 0, 1, '', '', 0), +(2077640000000000002, 2077640000000000001, 'accident_record_add', '新增', 'accident_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077640000000000003, 2077640000000000001, 'accident_record_edit', '编辑', 'accident_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077640000000000004, 2077640000000000001, 'accident_record_delete', '批量删除', 'accident_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077640000000000005, 2077640000000000001, 'accident_record_view', '查看', 'accident_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077640000000000006, 2077640000000000001, 'accident_record_import', '批量导入', 'accident_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077640000000000007, 2077640000000000001, 'accident_record_template', '下载模板', 'accident_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077640000000000008, 2077640000000000001, 'accident_record_export', '批量导出', 'accident_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077640000000000009, 2077640000000000001, 'accident_record_list', '列表', 'accident_record_list', '/blade-transport/accident-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_annual_inspection_record.sql b/doc/sql/transport/blade_annual_inspection_record.sql new file mode 100644 index 0000000..449592e --- /dev/null +++ b/doc/sql/transport/blade_annual_inspection_record.sql @@ -0,0 +1,46 @@ +-- ---------------------------- +-- Table structure for blade_annual_inspection_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_annual_inspection_record`; +CREATE TABLE `blade_annual_inspection_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `inspection_assessment_date` date NOT NULL COMMENT '检测评定日期', + `vehicle_technical_level` varchar(20) DEFAULT NULL COMMENT '车辆技术等级', + `ship_inspection_type` varchar(20) DEFAULT NULL COMMENT '船舶检验类型', + `valid_until_date` date NOT NULL COMMENT '有效期截止日', + `passenger_type_level` varchar(50) DEFAULT NULL COMMENT '客车类型及等级', + `inspection_unit` varchar(50) DEFAULT NULL COMMENT '检测评定单位', + `fee` decimal(18,2) NOT NULL COMMENT '费用', + `assessment_unit` varchar(50) DEFAULT NULL COMMENT '评定(复核)单位', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_annual_inspection_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_annual_inspection_record_assessment` (`inspection_assessment_date`) USING BTREE, + KEY `idx_annual_inspection_record_valid` (`valid_until_date`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='年检记录'; + +-- ---------------------------- +-- Records of blade_menu for annual inspection record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077650000000000001, 2075436235826896898, 'annual_inspection_record', '年检记录', 'annual_inspection_record', '/vehicle/annual-inspection-record', 'iconfont iconicon_doc', 100, 1, 0, 1, '', '', 0), +(2077650000000000002, 2077650000000000001, 'annual_inspection_record_add', '新增', 'annual_inspection_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077650000000000003, 2077650000000000001, 'annual_inspection_record_edit', '编辑', 'annual_inspection_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077650000000000004, 2077650000000000001, 'annual_inspection_record_delete', '批量删除', 'annual_inspection_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077650000000000005, 2077650000000000001, 'annual_inspection_record_view', '查看', 'annual_inspection_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077650000000000006, 2077650000000000001, 'annual_inspection_record_import', '批量导入', 'annual_inspection_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077650000000000007, 2077650000000000001, 'annual_inspection_record_template', '下载模板', 'annual_inspection_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077650000000000008, 2077650000000000001, 'annual_inspection_record_export', '批量导出', 'annual_inspection_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077650000000000009, 2077650000000000001, 'annual_inspection_record_list', '列表', 'annual_inspection_record_list', '/blade-transport/annual-inspection-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_currency.sql b/doc/sql/transport/blade_currency.sql index 86d368e..8bdd98d 100644 --- a/doc/sql/transport/blade_currency.sql +++ b/doc/sql/transport/blade_currency.sql @@ -10,8 +10,10 @@ CREATE TABLE `blade_currency` ( `symbol` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '货币符号', `decimal_places` int NULL DEFAULT 2 COMMENT '小数位数', `exchange_rate` decimal(18,6) NULL DEFAULT 1.000000 COMMENT '汇率', + `effective_date` date NOT NULL COMMENT '生效日期', + `expiry_date` date NULL DEFAULT NULL COMMENT '失效日期', `is_base_currency` int NULL DEFAULT 0 COMMENT '是否本位币', - `data_source` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '手工导入' COMMENT '数据来源', + `data_source` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '手工录入' COMMENT '来源', `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', @@ -21,15 +23,16 @@ CREATE TABLE `blade_currency` ( `status` int NULL DEFAULT 1 COMMENT '状态', `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `uk_currency_code`(`code`) USING BTREE, + UNIQUE INDEX `uk_currency_code_effective_date`(`code`, `effective_date`) USING BTREE, + INDEX `idx_currency_effective`(`code`, `effective_date`, `expiry_date`) USING BTREE, INDEX `idx_currency_base`(`is_base_currency`) USING BTREE, INDEX `idx_currency_status`(`status`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '币种主数据'; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '币种汇率'; -- ---------------------------- -- Records of blade_menu for currency -- ---------------------------- -INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000001, 1164733399668962201, 'currency', '币种主数据', 'currency', '/base/currency', 'iconfont iconicon_exchange', 40, 1, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000001, 1164733399668962201, 'currency', '币种汇率管理', 'currency', '/base/currency', 'iconfont iconicon_exchange', 40, 1, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000002, 2075449000000000001, 'currency_import', '批量导入', 'currency_import', '', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000003, 2075449000000000001, 'currency_template', '下载模板', 'currency_template', '', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000004, 2075449000000000001, 'currency_export', '批量导出', 'currency_export', '', '', 1, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_customer_archive.sql b/doc/sql/transport/blade_customer_archive.sql new file mode 100644 index 0000000..3d73a8f --- /dev/null +++ b/doc/sql/transport/blade_customer_archive.sql @@ -0,0 +1,231 @@ +-- ---------------------------- +-- Table structure for blade_customer_archive +-- ---------------------------- +DROP TABLE IF EXISTS `blade_customer_archive`; +CREATE TABLE `blade_customer_archive` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', + `customer_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客商编号', + `short_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客商简称', + `full_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客商全称', + `customer_nature` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客商性质', + `unified_credit_code` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '统一社会信用代码', + `customer_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客商类型', + `project_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属项目', + `registered_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '注册/实际经营地址', + `legal_person` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '法人/负责人', + `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系电话', + `dept_id` bigint NULL DEFAULT NULL COMMENT '所属组织ID', + `dept_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所属组织', + `invoice_tax_rate` decimal(6,2) NULL DEFAULT NULL COMMENT '开票税点', + `business_scope` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经营范围', + `business_term_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '营业期限类型', + `business_end_date` date NULL DEFAULT NULL COMMENT '营业期限截止日', + `registered_capital` decimal(18,2) NULL DEFAULT NULL COMMENT '注册资金(万元)', + `principal` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客商负责人', + `mnemonic_code` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '助记码', + `customer_level` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户等级', + `max_credit_limit` decimal(18,2) NULL DEFAULT NULL COMMENT '最大资金使用额度(万元)', + `apply_credit_limit` decimal(18,2) NULL DEFAULT NULL COMMENT '申请总资金使用额度(万元)', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `qualification_attachments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '资质附件JSON', + `access_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'temporary' COMMENT '准入类型:temporary临时,formal正式', + `approval_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'draft' COMMENT '审批状态:draft草稿,reviewing审核中,approved审核通过,rejected审核不通过', + `current_node` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当前节点', + `current_processor` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当前处理人', + `approved_time` datetime NULL DEFAULT NULL COMMENT '审核通过时间', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', + `status` int NULL DEFAULT 1 COMMENT '状态:1启用,2停用', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_customer_archive_code` (`tenant_id`, `customer_code`, `is_deleted`) USING BTREE, + UNIQUE KEY `uk_customer_archive_credit_code` (`tenant_id`, `unified_credit_code`, `is_deleted`) USING BTREE, + KEY `idx_customer_archive_access` (`tenant_id`, `access_type`, `approval_status`) USING BTREE, + KEY `idx_customer_archive_name` (`tenant_id`, `full_name`, `short_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客商档案'; + +-- ---------------------------- +-- Table structure for blade_customer_contact +-- ---------------------------- +DROP TABLE IF EXISTS `blade_customer_contact`; +CREATE TABLE `blade_customer_contact` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', + `customer_id` bigint NOT NULL COMMENT '客商ID', + `contact_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人姓名', + `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `position_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职务', + `is_default` int NULL DEFAULT 0 COMMENT '是否默认', + `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', + `status` int NULL DEFAULT 1 COMMENT '状态', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_customer_contact_customer` (`tenant_id`, `customer_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客商联系人'; + +-- ---------------------------- +-- Table structure for blade_customer_receipt_account +-- ---------------------------- +DROP TABLE IF EXISTS `blade_customer_receipt_account`; +CREATE TABLE `blade_customer_receipt_account` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', + `customer_id` bigint NOT NULL COMMENT '客商ID', + `account_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收款方名称', + `bank_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开户行名称', + `bank_account` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '银行账号', + `registered_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '注册电话', + `registered_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '注册地址', + `tax_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纳税人识别号', + `is_default` int NULL DEFAULT 0 COMMENT '是否默认', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', + `status` int NULL DEFAULT 1 COMMENT '状态', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_customer_receipt_customer` (`tenant_id`, `customer_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客商收款信息'; + +-- ---------------------------- +-- Table structure for blade_customer_invoice_info +-- ---------------------------- +DROP TABLE IF EXISTS `blade_customer_invoice_info`; +CREATE TABLE `blade_customer_invoice_info` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', + `customer_id` bigint NOT NULL COMMENT '客商ID', + `invoice_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '受票方名称', + `tax_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纳税人识别号', + `bank_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开户行名称', + `registered_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '注册电话', + `bank_account` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '银行账号', + `registered_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '注册地址', + `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `receiver_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收件人姓名', + `receiver_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收件人电话', + `receiver_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收件人地址', + `is_default` int NULL DEFAULT 0 COMMENT '是否默认', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', + `status` int NULL DEFAULT 1 COMMENT '状态', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_customer_invoice_customer` (`tenant_id`, `customer_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客商发票信息'; + +-- ---------------------------- +-- Table structure for blade_customer_credit_score +-- ---------------------------- +DROP TABLE IF EXISTS `blade_customer_credit_score`; +CREATE TABLE `blade_customer_credit_score` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', + `customer_id` bigint NOT NULL COMMENT '客商ID', + `quantification_id` bigint NULL DEFAULT NULL COMMENT '评分量化表ID', + `score_date` date NULL DEFAULT NULL COMMENT '评分日期', + `self_score` decimal(10,2) NULL DEFAULT NULL COMMENT '自评得分', + `review_score` decimal(10,2) NULL DEFAULT NULL COMMENT '复评得分', + `final_score` decimal(10,2) NULL DEFAULT NULL COMMENT '最终得分', + `credit_level` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '信用等级', + `max_credit_limit` decimal(18,2) NULL DEFAULT NULL COMMENT '最大资金使用额度(万元)', + `apply_credit_limit` decimal(18,2) NULL DEFAULT NULL COMMENT '拟申请总资金使用额度(万元)', + `self_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '未完成' COMMENT '自评状态', + `review_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '未完成' COMMENT '复评状态', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `proof_attachments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '证明材料JSON', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', + `status` int NULL DEFAULT 1 COMMENT '状态', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_customer_credit_score_customer` (`tenant_id`, `customer_id`) USING BTREE, + KEY `idx_customer_credit_score_table` (`tenant_id`, `quantification_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客商评分记录'; + +-- ---------------------------- +-- Table structure for blade_customer_credit_score_detail +-- ---------------------------- +DROP TABLE IF EXISTS `blade_customer_credit_score_detail`; +CREATE TABLE `blade_customer_credit_score_detail` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', + `score_id` bigint NOT NULL COMMENT '评分记录ID', + `quantification_id` bigint NULL DEFAULT NULL COMMENT '评分量化表ID', + `item_id` bigint NULL DEFAULT NULL COMMENT '评分项目ID', + `category_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评分分类编码', + `category_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评分分类名称', + `item_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评分项目', + `option_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评分标准', + `options_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '选项JSON', + `selected_option` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '已选选项', + `score_description` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '得分说明', + `self_score` decimal(10,2) NULL DEFAULT NULL COMMENT '自评得分', + `review_score` decimal(10,2) NULL DEFAULT NULL COMMENT '复评得分', + `sort` int NULL DEFAULT 0 COMMENT '排序', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', + `status` int NULL DEFAULT 1 COMMENT '状态', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_customer_score_detail_score` (`tenant_id`, `score_id`) USING BTREE, + KEY `idx_customer_score_detail_item` (`tenant_id`, `item_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客商评分明细'; + +-- ---------------------------- +-- Table structure for blade_customer_change_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_customer_change_record`; +CREATE TABLE `blade_customer_change_record` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', + `customer_id` bigint NOT NULL COMMENT '客商ID', + `change_time` datetime NULL DEFAULT NULL COMMENT '变更日期', + `change_content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更内容', + `change_user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更账号', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', + `status` int NULL DEFAULT 1 COMMENT '状态', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_customer_change_record_customer` (`tenant_id`, `customer_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客商变更记录'; + +-- ---------------------------- +-- Records of blade_menu for customer archive +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000001, 2075436235826896898, 'customer_archive', '客商档案', 'customer_archive', '/vehicle/customer-archive', 'iconfont iconicon_group', 50, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000002, 2077600000000000001, 'customer_archive_add', '新增', 'customer_archive_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000003, 2077600000000000001, 'customer_archive_edit', '编辑', 'customer_archive_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000004, 2077600000000000001, 'customer_archive_delete', '删除', 'customer_archive_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000005, 2077600000000000001, 'customer_archive_view', '查看', 'customer_archive_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000006, 2077600000000000001, 'customer_archive_submit', '提交', 'customer_archive_submit', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000007, 2077600000000000001, 'customer_archive_approve', '审核通过', 'customer_archive_approve', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000008, 2077600000000000001, 'customer_archive_reject', '审核不通过', 'customer_archive_reject', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000009, 2077600000000000001, 'customer_archive_status', '启停', 'customer_archive_status', '', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077600000000000010, 2077600000000000001, 'customer_archive_export', '批量导出', 'customer_archive_export', '', '', 9, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_etc_record.sql b/doc/sql/transport/blade_etc_record.sql new file mode 100644 index 0000000..7703b8c --- /dev/null +++ b/doc/sql/transport/blade_etc_record.sql @@ -0,0 +1,45 @@ +-- ---------------------------- +-- Table structure for blade_etc_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_etc_record`; +CREATE TABLE `blade_etc_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号', + `etc_card_no` varchar(30) NOT NULL COMMENT 'ETC卡号', + `entry_time` datetime DEFAULT NULL COMMENT '入口时间', + `exit_time` datetime NOT NULL COMMENT '出口时间', + `entry_station` varchar(50) DEFAULT NULL COMMENT '入口站', + `exit_station` varchar(50) DEFAULT NULL COMMENT '出口站', + `data_source` varchar(20) DEFAULT '手工录入' COMMENT '数据来源', + `transaction_amount` decimal(18,2) NOT NULL COMMENT '交易金额', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_etc_record_vehicle` (`vehicle_no`) USING BTREE, + KEY `idx_etc_record_card` (`etc_card_no`) USING BTREE, + KEY `idx_etc_record_exit_time` (`exit_time`) USING BTREE, + KEY `idx_etc_record_amount` (`transaction_amount`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ETC记录'; + +-- ---------------------------- +-- Records of blade_menu for etc record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077690000000000001, 2075436235826896898, 'etc_record', 'ETC记录', 'etc_record', '/vehicle/etc-record', 'iconfont iconicon_doc', 140, 1, 0, 1, '', '', 0), +(2077690000000000002, 2077690000000000001, 'etc_record_add', '新增', 'etc_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077690000000000003, 2077690000000000001, 'etc_record_edit', '编辑', 'etc_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077690000000000004, 2077690000000000001, 'etc_record_delete', '批量删除', 'etc_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077690000000000005, 2077690000000000001, 'etc_record_view', '查看', 'etc_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077690000000000006, 2077690000000000001, 'etc_record_import', '批量导入', 'etc_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077690000000000007, 2077690000000000001, 'etc_record_template', '下载模板', 'etc_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077690000000000008, 2077690000000000001, 'etc_record_export', '批量导出', 'etc_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077690000000000009, 2077690000000000001, 'etc_record_list', '列表', 'etc_record_list', '/blade-transport/etc-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_insurance_record.sql b/doc/sql/transport/blade_insurance_record.sql new file mode 100644 index 0000000..500f017 --- /dev/null +++ b/doc/sql/transport/blade_insurance_record.sql @@ -0,0 +1,49 @@ +-- ---------------------------- +-- Table structure for blade_insurance_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_insurance_record`; +CREATE TABLE `blade_insurance_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(50) NOT NULL COMMENT '车牌号/船号', + `insurance_type` varchar(50) NOT NULL COMMENT '保险类型', + `policy_no` varchar(80) NOT NULL COMMENT '保单号', + `start_date` date NOT NULL COMMENT '开始日期', + `end_date` date NOT NULL COMMENT '结束日期', + `insured_amount` decimal(18,2) DEFAULT NULL COMMENT '保额', + `premium` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '保费', + `invoice_no` varchar(80) DEFAULT NULL COMMENT '发票号', + `invoice_date` date DEFAULT NULL COMMENT '开票日期', + `ocr_template` varchar(100) DEFAULT NULL COMMENT 'OCR识别模板', + `policy_file` varchar(1000) DEFAULT NULL COMMENT '保单附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_insurance_record_policy` (`vehicle_type`,`insurance_type`,`policy_no`) USING BTREE, + KEY `idx_insurance_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_insurance_record_type` (`insurance_type`) USING BTREE, + KEY `idx_insurance_record_end_date` (`end_date`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='保险记录'; + +-- ---------------------------- +-- Records of blade_menu for insurance record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0), +(2077610000000000002, 2077610000000000001, 'insurance_record_add', '新增', 'insurance_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077610000000000003, 2077610000000000001, 'insurance_record_edit', '编辑', 'insurance_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077610000000000004, 2077610000000000001, 'insurance_record_delete', '批量删除', 'insurance_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077610000000000005, 2077610000000000001, 'insurance_record_view', '查看', 'insurance_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077610000000000006, 2077610000000000001, 'insurance_record_import', '批量导入', 'insurance_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077610000000000007, 2077610000000000001, 'insurance_record_template', '下载模板', 'insurance_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077610000000000008, 2077610000000000001, 'insurance_record_export', '批量导出', 'insurance_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077610000000000009, 2077610000000000001, 'insurance_record_list', '列表', 'insurance_record_list', '/blade-transport/insurance-record/list', '', 8, 2, 0, 1, NULL, '', 0), +(2077610000000000010, 2077610000000000001, 'insurance_record_ocr', 'OCR识别', 'insurance_record_ocr', '', '', 9, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_mileage_record.sql b/doc/sql/transport/blade_mileage_record.sql new file mode 100644 index 0000000..fd9c4fc --- /dev/null +++ b/doc/sql/transport/blade_mileage_record.sql @@ -0,0 +1,40 @@ +-- ---------------------------- +-- Table structure for blade_mileage_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_mileage_record`; +CREATE TABLE `blade_mileage_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号', + `previous_month_mileage` decimal(18,2) DEFAULT NULL COMMENT '上月统计里程', + `current_month_mileage` decimal(18,2) DEFAULT NULL COMMENT '本月统计里程', + `monthly_mileage` decimal(18,2) DEFAULT NULL COMMENT '本月行驶里程', + `total_mileage` decimal(18,2) DEFAULT NULL COMMENT '累计行驶里程', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_mileage_record_vehicle` (`vehicle_no`) USING BTREE, + KEY `idx_mileage_record_total` (`total_mileage`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='里程记录'; + +-- ---------------------------- +-- Records of blade_menu for mileage record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0), +(2077660000000000002, 2077660000000000001, 'mileage_record_add', '新增', 'mileage_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077660000000000003, 2077660000000000001, 'mileage_record_edit', '编辑', 'mileage_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077660000000000004, 2077660000000000001, 'mileage_record_delete', '批量删除', 'mileage_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077660000000000005, 2077660000000000001, 'mileage_record_view', '查看', 'mileage_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077660000000000006, 2077660000000000001, 'mileage_record_import', '批量导入', 'mileage_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077660000000000007, 2077660000000000001, 'mileage_record_template', '下载模板', 'mileage_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077660000000000008, 2077660000000000001, 'mileage_record_export', '批量导出', 'mileage_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077660000000000009, 2077660000000000001, 'mileage_record_list', '列表', 'mileage_record_list', '/blade-transport/mileage-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_oil_electric_record.sql b/doc/sql/transport/blade_oil_electric_record.sql new file mode 100644 index 0000000..0e2a67b --- /dev/null +++ b/doc/sql/transport/blade_oil_electric_record.sql @@ -0,0 +1,50 @@ +-- ---------------------------- +-- Table structure for blade_oil_electric_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_oil_electric_record`; +CREATE TABLE `blade_oil_electric_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `card_no` varchar(30) DEFAULT NULL COMMENT '卡号', + `transaction_time` datetime NOT NULL COMMENT '交易时间', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `fee_type` varchar(20) NOT NULL COMMENT '费用类型', + `oil_product` varchar(50) DEFAULT NULL COMMENT '油品', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `card_holder` varchar(20) DEFAULT NULL COMMENT '持卡人', + `data_source` varchar(20) DEFAULT '手工录入' COMMENT '数据来源', + `quantity` decimal(18,2) DEFAULT NULL COMMENT '数量', + `unit_price` decimal(18,2) DEFAULT NULL COMMENT '单价', + `transaction_amount` decimal(18,2) NOT NULL COMMENT '交易金额', + `balance` decimal(18,2) DEFAULT NULL COMMENT '余额', + `station` varchar(50) DEFAULT NULL COMMENT '站点', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_oil_electric_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_oil_electric_record_fee_type` (`fee_type`) USING BTREE, + KEY `idx_oil_electric_record_transaction_time` (`transaction_time`) USING BTREE, + KEY `idx_oil_electric_record_amount` (`transaction_amount`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='油电记录'; + +-- ---------------------------- +-- Records of blade_menu for oil electric record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077680000000000001, 2075436235826896898, 'oil_electric_record', '油电记录', 'oil_electric_record', '/vehicle/oil-electric-record', 'iconfont iconicon_doc', 130, 1, 0, 1, '', '', 0), +(2077680000000000002, 2077680000000000001, 'oil_electric_record_add', '新增', 'oil_electric_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077680000000000003, 2077680000000000001, 'oil_electric_record_edit', '编辑', 'oil_electric_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077680000000000004, 2077680000000000001, 'oil_electric_record_delete', '批量删除', 'oil_electric_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077680000000000005, 2077680000000000001, 'oil_electric_record_view', '查看', 'oil_electric_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077680000000000006, 2077680000000000001, 'oil_electric_record_import', '批量导入', 'oil_electric_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077680000000000007, 2077680000000000001, 'oil_electric_record_template', '下载模板', 'oil_electric_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077680000000000008, 2077680000000000001, 'oil_electric_record_export', '批量导出', 'oil_electric_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077680000000000009, 2077680000000000001, 'oil_electric_record_list', '列表', 'oil_electric_record_list', '/blade-transport/oil-electric-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_other_expense_record.sql b/doc/sql/transport/blade_other_expense_record.sql new file mode 100644 index 0000000..d3e6577 --- /dev/null +++ b/doc/sql/transport/blade_other_expense_record.sql @@ -0,0 +1,43 @@ +-- ---------------------------- +-- Table structure for blade_other_expense_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_other_expense_record`; +CREATE TABLE `blade_other_expense_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `expense_date` date NOT NULL COMMENT '费用日期', + `expense_type` varchar(20) NOT NULL COMMENT '其他费用类型', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `data_source` varchar(20) DEFAULT '手工录入' COMMENT '数据来源', + `amount` decimal(18,2) NOT NULL COMMENT '金额', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_other_expense_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_other_expense_record_type` (`expense_type`) USING BTREE, + KEY `idx_other_expense_record_date` (`expense_date`) USING BTREE, + KEY `idx_other_expense_record_amount` (`amount`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='其他费用记录'; + +-- ---------------------------- +-- Records of blade_menu for other expense record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077700000000000001, 2075436235826896898, 'other_expense_record', '其他费用记录', 'other_expense_record', '/vehicle/other-expense-record', 'iconfont iconicon_doc', 150, 1, 0, 1, '', '', 0), +(2077700000000000002, 2077700000000000001, 'other_expense_record_add', '新增', 'other_expense_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077700000000000003, 2077700000000000001, 'other_expense_record_edit', '编辑', 'other_expense_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077700000000000004, 2077700000000000001, 'other_expense_record_delete', '批量删除', 'other_expense_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077700000000000005, 2077700000000000001, 'other_expense_record_view', '查看', 'other_expense_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077700000000000006, 2077700000000000001, 'other_expense_record_import', '批量导入', 'other_expense_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077700000000000007, 2077700000000000001, 'other_expense_record_template', '下载模板', 'other_expense_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077700000000000008, 2077700000000000001, 'other_expense_record_export', '批量导出', 'other_expense_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077700000000000009, 2077700000000000001, 'other_expense_record_list', '列表', 'other_expense_record_list', '/blade-transport/other-expense-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_tire_replacement_record.sql b/doc/sql/transport/blade_tire_replacement_record.sql new file mode 100644 index 0000000..8b6873f --- /dev/null +++ b/doc/sql/transport/blade_tire_replacement_record.sql @@ -0,0 +1,42 @@ +-- ---------------------------- +-- Table structure for blade_tire_replacement_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_tire_replacement_record`; +CREATE TABLE `blade_tire_replacement_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号', + `handler` varchar(20) DEFAULT NULL COMMENT '处理人', + `replacement_time` date NOT NULL COMMENT '换胎时间', + `tire_brand` varchar(50) DEFAULT NULL COMMENT '轮胎品牌', + `tire_quantity` int(11) DEFAULT NULL COMMENT '换胎数量', + `replacement_cost` decimal(18,2) NOT NULL COMMENT '换胎费用', + `replacement_description` varchar(200) DEFAULT NULL COMMENT '换胎说明', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(500) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_tire_replacement_record_vehicle` (`vehicle_no`) USING BTREE, + KEY `idx_tire_replacement_record_time` (`replacement_time`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='换胎记录'; + +-- ---------------------------- +-- Records of blade_menu for tire replacement record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0), +(2077630000000000002, 2077630000000000001, 'tire_replacement_record_add', '新增', 'tire_replacement_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077630000000000003, 2077630000000000001, 'tire_replacement_record_edit', '编辑', 'tire_replacement_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077630000000000004, 2077630000000000001, 'tire_replacement_record_delete', '批量删除', 'tire_replacement_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077630000000000005, 2077630000000000001, 'tire_replacement_record_view', '查看', 'tire_replacement_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077630000000000006, 2077630000000000001, 'tire_replacement_record_import', '批量导入', 'tire_replacement_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077630000000000007, 2077630000000000001, 'tire_replacement_record_template', '下载模板', 'tire_replacement_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077630000000000008, 2077630000000000001, 'tire_replacement_record_export', '批量导出', 'tire_replacement_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077630000000000009, 2077630000000000001, 'tire_replacement_record_list', '列表', 'tire_replacement_record_list', '/blade-transport/tire-replacement-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_transport_change_record.sql b/doc/sql/transport/blade_transport_change_record.sql new file mode 100644 index 0000000..eb1ab74 --- /dev/null +++ b/doc/sql/transport/blade_transport_change_record.sql @@ -0,0 +1,40 @@ +-- ---------------------------- +-- Table structure for blade_transport_change_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_transport_change_record`; +CREATE TABLE `blade_transport_change_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) DEFAULT NULL COMMENT '车牌号/船号', + `change_item` varchar(50) NOT NULL COMMENT '变更事项', + `change_content` varchar(200) NOT NULL COMMENT '变更内容', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_transport_change_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_transport_change_record_item` (`change_item`) USING BTREE, + KEY `idx_transport_change_record_create_time` (`create_time`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='变更记录'; + +-- ---------------------------- +-- Records of blade_menu for transport change record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077670000000000001, 2075436235826896898, 'transport_change_record', '变更记录', 'transport_change_record', '/vehicle/transport-change-record', 'iconfont iconicon_doc', 120, 1, 0, 1, '', '', 0), +(2077670000000000002, 2077670000000000001, 'transport_change_record_add', '新增', 'transport_change_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077670000000000003, 2077670000000000001, 'transport_change_record_edit', '编辑', 'transport_change_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077670000000000004, 2077670000000000001, 'transport_change_record_delete', '批量删除', 'transport_change_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077670000000000005, 2077670000000000001, 'transport_change_record_view', '查看', 'transport_change_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077670000000000006, 2077670000000000001, 'transport_change_record_import', '批量导入', 'transport_change_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077670000000000007, 2077670000000000001, 'transport_change_record_template', '下载模板', 'transport_change_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077670000000000008, 2077670000000000001, 'transport_change_record_export', '批量导出', 'transport_change_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077670000000000009, 2077670000000000001, 'transport_change_record_list', '列表', 'transport_change_record_list', '/blade-transport/transport-change-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_transport_driver.sql b/doc/sql/transport/blade_transport_driver.sql new file mode 100644 index 0000000..a6f25bf --- /dev/null +++ b/doc/sql/transport/blade_transport_driver.sql @@ -0,0 +1,68 @@ +-- ---------------------------- +-- Table structure for blade_transport_driver +-- ---------------------------- +DROP TABLE IF EXISTS `blade_transport_driver`; +CREATE TABLE `blade_transport_driver` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `driver_name` varchar(20) NOT NULL COMMENT '司机姓名', + `id_card_no` varchar(18) NOT NULL COMMENT '身份证号', + `birthday` date DEFAULT NULL COMMENT '出生年月', + `gender` varchar(10) DEFAULT NULL COMMENT '性别', + `nation` varchar(20) DEFAULT NULL COMMENT '民族', + `education` varchar(20) DEFAULT NULL COMMENT '学历', + `address_region` varchar(100) DEFAULT NULL COMMENT '地址区划', + `address` varchar(200) DEFAULT NULL COMMENT '详细地址', + `posts` varchar(100) DEFAULT NULL COMMENT '岗位,多个使用逗号分隔', + `id_card_front` varchar(1000) DEFAULT NULL COMMENT '身份证正面照', + `id_card_back` varchar(1000) DEFAULT NULL COMMENT '身份证反面照', + `head_photo` varchar(1000) DEFAULT NULL COMMENT '大头照', + `driving_type` varchar(20) NOT NULL COMMENT '准驾车型', + `driving_license_no` varchar(50) DEFAULT NULL COMMENT '驾驶证档案编号', + `driving_license_start_date` date DEFAULT NULL COMMENT '驾驶证有效期起', + `driving_license_end_date` date DEFAULT NULL COMMENT '驾驶证有效期止', + `driving_license_long_term` int(11) DEFAULT '0' COMMENT '驾驶证长期有效:0否 1是', + `driving_license_front` varchar(1000) DEFAULT NULL COMMENT '驾驶证主页', + `driving_license_back` varchar(1000) DEFAULT NULL COMMENT '驾驶证副页', + `qualification_type` varchar(50) DEFAULT NULL COMMENT '从业资格证类型', + `qualification_no` varchar(50) DEFAULT NULL COMMENT '资格证号', + `qualification_end_date` date DEFAULT NULL COMMENT '从业资格证有效期止', + `qualification_long_term` int(11) DEFAULT '0' COMMENT '从业资格证长期有效:0否 1是', + `qualification_front` varchar(1000) DEFAULT NULL COMMENT '从业资格证封面页', + `qualification_back` varchar(1000) DEFAULT NULL COMMENT '从业资格证内容页', + `driver_type` varchar(20) NOT NULL COMMENT '司机类型:自有/外协', + `mobile` varchar(20) NOT NULL COMMENT '手机号', + `contact_relation` varchar(20) DEFAULT NULL COMMENT '与联系人关系', + `organization_name` varchar(50) NOT NULL COMMENT '所属组织', + `emergency_contact_name` varchar(20) NOT NULL COMMENT '紧急联系人姓名', + `emergency_contact_mobile` varchar(20) NOT NULL COMMENT '紧急联系人手机号', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_transport_driver_id_card` (`id_card_no`) USING BTREE, + KEY `idx_transport_driver_mobile` (`mobile`) USING BTREE, + KEY `idx_transport_driver_type` (`driver_type`) USING BTREE, + KEY `idx_transport_driver_org` (`organization_name`) USING BTREE, + KEY `idx_transport_driver_license_end` (`driving_license_end_date`) USING BTREE, + KEY `idx_transport_driver_qualification_end` (`qualification_end_date`) USING BTREE, + KEY `idx_transport_driver_status` (`status`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='司机管理'; + +-- ---------------------------- +-- Records of blade_menu for transport capacity driver +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2079000000000000001, 0, 'transport_capacity', '运力管理', 'transport_capacity', '/transportCapacity', 'iconfont icon-yunshu', 20, 1, 0, 1, '', '', 0), +(2079000000000000002, 2079000000000000001, 'driver', '司机管理', 'driver', '/transportCapacity/driver', 'iconfont icon-yonghu', 1, 1, 0, 1, '', '', 0), +(2079000000000000003, 2079000000000000002, 'driver_add', '新增', 'driver_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2079000000000000004, 2079000000000000002, 'driver_edit', '编辑', 'driver_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2079000000000000005, 2079000000000000002, 'driver_delete', '删除', 'driver_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2079000000000000006, 2079000000000000002, 'driver_view', '查看', 'driver_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2079000000000000007, 2079000000000000002, 'driver_status', '启停', 'driver_status', '', '', 5, 2, 0, 1, NULL, '', 0), +(2079000000000000008, 2079000000000000002, 'driver_export', '批量导出', 'driver_export', '', '', 6, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/blade_transport_ship.sql b/doc/sql/transport/blade_transport_ship.sql new file mode 100644 index 0000000..c205602 --- /dev/null +++ b/doc/sql/transport/blade_transport_ship.sql @@ -0,0 +1,70 @@ +-- ---------------------------- +-- Table structure for blade_transport_ship +-- ---------------------------- +DROP TABLE IF EXISTS `blade_transport_ship`; +CREATE TABLE `blade_transport_ship` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `ship_name` varchar(50) NOT NULL COMMENT '船舶名', + `ship_identifier_no` varchar(50) NOT NULL COMMENT '船舶识别号', + `organization_name` varchar(50) NOT NULL COMMENT '所属组织', + `ship_inspection_no` varchar(50) DEFAULT NULL COMMENT '船检登记号', + `ship_type` varchar(50) NOT NULL COMMENT '船舶类型', + `nationality_cert_end_date` date DEFAULT NULL COMMENT '国籍证有效期至', + `nationality_cert_long_term` int(11) DEFAULT '0' COMMENT '国籍证长期有效:0否 1是', + `nationality_cert_image` varchar(1000) DEFAULT NULL COMMENT '国籍证图片', + `safe_manning_cert_end_date` date DEFAULT NULL COMMENT '最低安全配员证书有效期至', + `safe_manning_cert_long_term` int(11) DEFAULT '0' COMMENT '最低安全配员证书长期有效:0否 1是', + `safe_manning_cert_image` varchar(1000) DEFAULT NULL COMMENT '最低安全配员证书图片', + `business_transport_cert_end_date` date DEFAULT NULL COMMENT '营业运输证有效期至', + `business_transport_cert_long_term` int(11) DEFAULT '0' COMMENT '营业运输证长期有效:0否 1是', + `business_transport_cert_image` varchar(1000) DEFAULT NULL COMMENT '营业运输证图片', + `lease_end_date` date DEFAULT NULL COMMENT '承租有效期至', + `lease_long_term` int(11) DEFAULT '0' COMMENT '承租长期有效:0否 1是', + `lease_contract_image` varchar(1000) DEFAULT NULL COMMENT '承租合同图片', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_transport_ship_identifier` (`ship_identifier_no`) USING BTREE, + KEY `idx_transport_ship_name` (`ship_name`) USING BTREE, + KEY `idx_transport_ship_org` (`organization_name`) USING BTREE, + KEY `idx_transport_ship_type` (`ship_type`) USING BTREE, + KEY `idx_transport_ship_nationality_end` (`nationality_cert_end_date`) USING BTREE, + KEY `idx_transport_ship_safe_end` (`safe_manning_cert_end_date`) USING BTREE, + KEY `idx_transport_ship_business_end` (`business_transport_cert_end_date`) USING BTREE, + KEY `idx_transport_ship_lease_end` (`lease_end_date`) USING BTREE, + KEY `idx_transport_ship_status` (`status`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='船舶管理'; + +-- ---------------------------- +-- Records of blade_menu for transport capacity ship +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2079000000000000001, 0, 'transport_capacity', '运力管理', 'transport_capacity', '/transportCapacity', 'iconfont icon-yunshu', 20, 1, 0, 1, '', '', 0), +(2079000000000000020, 2079000000000000001, 'transport_ship', '船舶管理', 'transport_ship', '/transportCapacity/ship', 'iconfont icon-chuanbo', 3, 1, 0, 1, '', '', 0), +(2079000000000000021, 2079000000000000020, 'transport_ship_add', '新增', 'transport_ship_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2079000000000000022, 2079000000000000020, 'transport_ship_edit', '编辑', 'transport_ship_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2079000000000000023, 2079000000000000020, 'transport_ship_delete', '删除', 'transport_ship_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2079000000000000024, 2079000000000000020, 'transport_ship_view', '查看', 'transport_ship_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2079000000000000025, 2079000000000000020, 'transport_ship_status', '启停', 'transport_ship_status', '', '', 5, 2, 0, 1, NULL, '', 0), +(2079000000000000026, 2079000000000000020, 'transport_ship_export', '批量导出', 'transport_ship_export', '', '', 6, 2, 0, 1, NULL, '', 0) +ON DUPLICATE KEY UPDATE + `parent_id` = VALUES(`parent_id`), + `code` = VALUES(`code`), + `name` = VALUES(`name`), + `alias` = VALUES(`alias`), + `path` = VALUES(`path`), + `source` = VALUES(`source`), + `sort` = VALUES(`sort`), + `category` = VALUES(`category`), + `action` = VALUES(`action`), + `is_open` = VALUES(`is_open`), + `component` = VALUES(`component`), + `remark` = VALUES(`remark`), + `is_deleted` = VALUES(`is_deleted`); diff --git a/doc/sql/transport/blade_transport_vehicle.sql b/doc/sql/transport/blade_transport_vehicle.sql new file mode 100644 index 0000000..19b5229 --- /dev/null +++ b/doc/sql/transport/blade_transport_vehicle.sql @@ -0,0 +1,80 @@ +-- ---------------------------- +-- Table structure for blade_transport_vehicle +-- ---------------------------- +DROP TABLE IF EXISTS `blade_transport_vehicle`; +CREATE TABLE `blade_transport_vehicle` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `organization_name` varchar(50) NOT NULL COMMENT '所属组织', + `plate_no` varchar(16) NOT NULL COMMENT '车牌号', + `vehicle_type` varchar(50) NOT NULL COMMENT '车辆类型', + `outer_length` int(11) DEFAULT NULL COMMENT '外廓长度,毫米', + `outer_width` int(11) DEFAULT NULL COMMENT '外廓宽度,毫米', + `outer_height` int(11) DEFAULT NULL COMMENT '外廓高度,毫米', + `approved_load_kg` int(11) NOT NULL COMMENT '核定载质量,KG', + `traction_mass_kg` int(11) DEFAULT NULL COMMENT '准牵引总质量,KG', + `business_relation` varchar(50) NOT NULL COMMENT '业务关系', + `energy_type` varchar(50) NOT NULL COMMENT '能源类型', + `compulsory_scrap_date` date DEFAULT NULL COMMENT '强制报废日期', + `compulsory_scrap_long_term` int(11) DEFAULT '0' COMMENT '强制报废长期有效:0否 1是', + `customs_record_no` varchar(50) DEFAULT NULL COMMENT '海关备案号', + `driving_license_no` varchar(50) NOT NULL COMMENT '行驶证档案编号', + `driving_license_start_date` date DEFAULT NULL COMMENT '行驶证有效期起', + `driving_license_end_date` date DEFAULT NULL COMMENT '行驶证有效期止', + `driving_license_long_term` int(11) DEFAULT '0' COMMENT '行驶证长期有效:0否 1是', + `driving_license_image` varchar(1000) DEFAULT NULL COMMENT '行驶证图片', + `road_transport_cert_no` varchar(50) NOT NULL COMMENT '道路运输证号', + `road_transport_cert_start_date` date DEFAULT NULL COMMENT '道路运输证有效期起', + `road_transport_cert_end_date` date DEFAULT NULL COMMENT '道路运输证有效期止', + `road_transport_cert_long_term` int(11) DEFAULT '0' COMMENT '道路运输证长期有效:0否 1是', + `road_transport_cert_image` varchar(1000) DEFAULT NULL COMMENT '道路运输证图片', + `annual_review_end_date` date DEFAULT NULL COMMENT '道路运输年审有效期', + `annual_review_long_term` int(11) DEFAULT '0' COMMENT '道路运输年审长期有效:0否 1是', + `registration_no` varchar(50) NOT NULL COMMENT '机动车登记编号', + `registration_date` date DEFAULT NULL COMMENT '机动车登记日期', + `registration_image` varchar(1000) DEFAULT NULL COMMENT '机动车登记本图片', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_transport_vehicle_plate_no` (`plate_no`) USING BTREE, + KEY `idx_transport_vehicle_org` (`organization_name`) USING BTREE, + KEY `idx_transport_vehicle_type` (`vehicle_type`) USING BTREE, + KEY `idx_transport_vehicle_relation` (`business_relation`) USING BTREE, + KEY `idx_transport_vehicle_driving_end` (`driving_license_end_date`) USING BTREE, + KEY `idx_transport_vehicle_road_end` (`road_transport_cert_end_date`) USING BTREE, + KEY `idx_transport_vehicle_annual_end` (`annual_review_end_date`) USING BTREE, + KEY `idx_transport_vehicle_status` (`status`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='车辆管理'; + +-- ---------------------------- +-- Records of blade_menu for transport capacity vehicle +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2079000000000000001, 0, 'transport_capacity', '运力管理', 'transport_capacity', '/transportCapacity', 'iconfont icon-yunshu', 20, 1, 0, 1, '', '', 0), +(2079000000000000010, 2079000000000000001, 'transport_vehicle', '车辆管理', 'transport_vehicle', '/transportCapacity/vehicle', 'iconfont icon-qiche', 2, 1, 0, 1, '', '', 0), +(2079000000000000011, 2079000000000000010, 'transport_vehicle_add', '新增', 'transport_vehicle_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2079000000000000012, 2079000000000000010, 'transport_vehicle_edit', '编辑', 'transport_vehicle_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2079000000000000013, 2079000000000000010, 'transport_vehicle_delete', '删除', 'transport_vehicle_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2079000000000000014, 2079000000000000010, 'transport_vehicle_view', '查看', 'transport_vehicle_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2079000000000000015, 2079000000000000010, 'transport_vehicle_status', '启停', 'transport_vehicle_status', '', '', 5, 2, 0, 1, NULL, '', 0), +(2079000000000000016, 2079000000000000010, 'transport_vehicle_export', '批量导出', 'transport_vehicle_export', '', '', 6, 2, 0, 1, NULL, '', 0) +ON DUPLICATE KEY UPDATE + `parent_id` = VALUES(`parent_id`), + `code` = VALUES(`code`), + `name` = VALUES(`name`), + `alias` = VALUES(`alias`), + `path` = VALUES(`path`), + `source` = VALUES(`source`), + `sort` = VALUES(`sort`), + `category` = VALUES(`category`), + `action` = VALUES(`action`), + `is_open` = VALUES(`is_open`), + `component` = VALUES(`component`), + `remark` = VALUES(`remark`), + `is_deleted` = VALUES(`is_deleted`); diff --git a/doc/sql/transport/blade_violation_record.sql b/doc/sql/transport/blade_violation_record.sql new file mode 100644 index 0000000..88cda9b --- /dev/null +++ b/doc/sql/transport/blade_violation_record.sql @@ -0,0 +1,49 @@ +-- ---------------------------- +-- Table structure for blade_violation_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_violation_record`; +CREATE TABLE `blade_violation_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `driver_name` varchar(20) NOT NULL COMMENT '驾驶人/船长', + `violation_type` varchar(50) DEFAULT NULL COMMENT '类型', + `violation_item` varchar(100) DEFAULT NULL COMMENT '事项', + `violation_time` datetime NOT NULL COMMENT '违章时间', + `location` varchar(100) NOT NULL COMMENT '地址', + `fine_amount` decimal(18,2) DEFAULT NULL COMMENT '被罚金额', + `deduct_points` int(11) DEFAULT NULL COMMENT '被扣分数', + `penalty_unit` varchar(50) DEFAULT NULL COMMENT '被罚单位', + `process_status` varchar(20) NOT NULL DEFAULT '已处理' COMMENT '处理状态', + `process_description` varchar(500) NOT NULL COMMENT '过程描述', + `process_result` varchar(500) DEFAULT NULL COMMENT '处理结果', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_violation_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_violation_record_driver` (`driver_name`) USING BTREE, + KEY `idx_violation_record_time` (`violation_time`) USING BTREE, + KEY `idx_violation_record_status` (`process_status`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='违章记录'; + +-- ---------------------------- +-- Records of blade_menu for violation record +-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”:2075436235826896898 +-- ---------------------------- +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES +(2077620000000000001, 2075436235826896898, 'violation_record', '违章记录', 'violation_record', '/vehicle/violation-record', 'iconfont iconicon_doc', 70, 1, 0, 1, '', '', 0), +(2077620000000000002, 2077620000000000001, 'violation_record_add', '新增', 'violation_record_add', '', '', 1, 2, 0, 1, NULL, '', 0), +(2077620000000000003, 2077620000000000001, 'violation_record_edit', '编辑', 'violation_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0), +(2077620000000000004, 2077620000000000001, 'violation_record_delete', '批量删除', 'violation_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0), +(2077620000000000005, 2077620000000000001, 'violation_record_view', '查看', 'violation_record_view', '', '', 4, 2, 0, 1, NULL, '', 0), +(2077620000000000006, 2077620000000000001, 'violation_record_import', '批量导入', 'violation_record_import', '', '', 5, 2, 0, 1, NULL, '', 0), +(2077620000000000007, 2077620000000000001, 'violation_record_template', '下载模板', 'violation_record_template', '', '', 6, 2, 0, 1, NULL, '', 0), +(2077620000000000008, 2077620000000000001, 'violation_record_export', '批量导出', 'violation_record_export', '', '', 7, 2, 0, 1, NULL, '', 0), +(2077620000000000009, 2077620000000000001, 'violation_record_list', '列表', 'violation_record_list', '/blade-transport/violation-record/list', '', 8, 2, 0, 1, NULL, '', 0); diff --git a/doc/sql/transport/transport.sql b/doc/sql/transport/transport.sql index be3aa2d..9e90962 100644 --- a/doc/sql/transport/transport.sql +++ b/doc/sql/transport/transport.sql @@ -70,8 +70,10 @@ CREATE TABLE `blade_currency` ( `symbol` varchar(10) DEFAULT NULL COMMENT '货币符号', `decimal_places` int(11) DEFAULT '2' COMMENT '小数位数', `exchange_rate` decimal(18,6) DEFAULT '1.000000' COMMENT '汇率', + `effective_date` date NOT NULL COMMENT '生效日期', + `expiry_date` date DEFAULT NULL COMMENT '失效日期', `is_base_currency` int(11) DEFAULT '0' COMMENT '是否本位币', - `data_source` varchar(20) DEFAULT '手工导入' COMMENT '数据来源', + `data_source` varchar(20) DEFAULT '手工录入' COMMENT '来源', `remark` varchar(200) DEFAULT NULL COMMENT '备注', `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', @@ -81,10 +83,11 @@ CREATE TABLE `blade_currency` ( `status` int(11) DEFAULT '1' COMMENT '状态', `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', PRIMARY KEY (`id`) USING BTREE, - UNIQUE KEY `uk_currency_code` (`code`) USING BTREE, + UNIQUE KEY `uk_currency_code_effective_date` (`code`,`effective_date`) USING BTREE, + KEY `idx_currency_effective` (`code`,`effective_date`,`expiry_date`) USING BTREE, KEY `idx_currency_base` (`is_base_currency`) USING BTREE, KEY `idx_currency_status` (`status`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='币种主数据'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='币种汇率'; -- ---------------------------- -- Records of blade_currency @@ -999,7 +1002,7 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075431710063828994, 2075431169720033282, 'airport_master_edit', '编辑', 'airport_master_edit', '', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075431753298714626, 2075431169720033282, 'airport_master_status', '修改状态', 'airport_master_status', '', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075431820189474818, 2075431169720033282, 'airport_master_add', '新增', 'airport_master_add', '', '', 1, 2, 0, 1, NULL, '', 0); -INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000001, 1164733399668962201, 'currency', '币种主数据', 'currency', '/base/currency', 'iconfont iconicon_exchange', 40, 1, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000001, 1164733399668962201, 'currency', '币种汇率管理', 'currency', '/base/currency', 'iconfont iconicon_exchange', 40, 1, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000002, 2075449000000000001, 'currency_import', '批量导入', 'currency_import', '', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000003, 2075449000000000001, 'currency_template', '下载模板', 'currency_template', '', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075449000000000004, 2075449000000000001, 'currency_export', '批量导出', 'currency_export', '', '', 1, 2, 0, 1, NULL, '', 0); @@ -1036,6 +1039,97 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075438207636316165, 2075437082342301697, 'maintenance_record_export', '批量导出', 'maintenance_record_export', '', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075444068651868162, 2075437082342301697, 'maintenance_record_list', '列表', 'maintenance_record_list', '/blade-transport/maintenance-record/list', '', 1, 2, 0, 1, NULL, '', 0); INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075444261606629377, 2075437237678350338, 'maintenance_plan_list', '列表', 'maintenance_plan_list', '/blade-transport/maintenance-plan/list', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000002, 2077610000000000001, 'insurance_record_add', '新增', 'insurance_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000003, 2077610000000000001, 'insurance_record_edit', '编辑', 'insurance_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000004, 2077610000000000001, 'insurance_record_delete', '批量删除', 'insurance_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000005, 2077610000000000001, 'insurance_record_view', '查看', 'insurance_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000006, 2077610000000000001, 'insurance_record_import', '批量导入', 'insurance_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000007, 2077610000000000001, 'insurance_record_template', '下载模板', 'insurance_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000008, 2077610000000000001, 'insurance_record_export', '批量导出', 'insurance_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000009, 2077610000000000001, 'insurance_record_list', '列表', 'insurance_record_list', '/blade-transport/insurance-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000010, 2077610000000000001, 'insurance_record_ocr', 'OCR识别', 'insurance_record_ocr', '', '', 9, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000001, 2075436235826896898, 'violation_record', '违章记录', 'violation_record', '/vehicle/violation-record', 'iconfont iconicon_doc', 70, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000002, 2077620000000000001, 'violation_record_add', '新增', 'violation_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000003, 2077620000000000001, 'violation_record_edit', '编辑', 'violation_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000004, 2077620000000000001, 'violation_record_delete', '批量删除', 'violation_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000005, 2077620000000000001, 'violation_record_view', '查看', 'violation_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000006, 2077620000000000001, 'violation_record_import', '批量导入', 'violation_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000007, 2077620000000000001, 'violation_record_template', '下载模板', 'violation_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000008, 2077620000000000001, 'violation_record_export', '批量导出', 'violation_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000009, 2077620000000000001, 'violation_record_list', '列表', 'violation_record_list', '/blade-transport/violation-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000002, 2077630000000000001, 'tire_replacement_record_add', '新增', 'tire_replacement_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000003, 2077630000000000001, 'tire_replacement_record_edit', '编辑', 'tire_replacement_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000004, 2077630000000000001, 'tire_replacement_record_delete', '批量删除', 'tire_replacement_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000005, 2077630000000000001, 'tire_replacement_record_view', '查看', 'tire_replacement_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000006, 2077630000000000001, 'tire_replacement_record_import', '批量导入', 'tire_replacement_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000007, 2077630000000000001, 'tire_replacement_record_template', '下载模板', 'tire_replacement_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000008, 2077630000000000001, 'tire_replacement_record_export', '批量导出', 'tire_replacement_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000009, 2077630000000000001, 'tire_replacement_record_list', '列表', 'tire_replacement_record_list', '/blade-transport/tire-replacement-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000001, 2075436235826896898, 'accident_record', '事故记录', 'accident_record', '/vehicle/accident-record', 'iconfont iconicon_doc', 90, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000002, 2077640000000000001, 'accident_record_add', '新增', 'accident_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000003, 2077640000000000001, 'accident_record_edit', '编辑', 'accident_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000004, 2077640000000000001, 'accident_record_delete', '批量删除', 'accident_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000005, 2077640000000000001, 'accident_record_view', '查看', 'accident_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000006, 2077640000000000001, 'accident_record_import', '批量导入', 'accident_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000007, 2077640000000000001, 'accident_record_template', '下载模板', 'accident_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000008, 2077640000000000001, 'accident_record_export', '批量导出', 'accident_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077640000000000009, 2077640000000000001, 'accident_record_list', '列表', 'accident_record_list', '/blade-transport/accident-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000001, 2075436235826896898, 'annual_inspection_record', '年检记录', 'annual_inspection_record', '/vehicle/annual-inspection-record', 'iconfont iconicon_doc', 100, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000002, 2077650000000000001, 'annual_inspection_record_add', '新增', 'annual_inspection_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000003, 2077650000000000001, 'annual_inspection_record_edit', '编辑', 'annual_inspection_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000004, 2077650000000000001, 'annual_inspection_record_delete', '批量删除', 'annual_inspection_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000005, 2077650000000000001, 'annual_inspection_record_view', '查看', 'annual_inspection_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000006, 2077650000000000001, 'annual_inspection_record_import', '批量导入', 'annual_inspection_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000007, 2077650000000000001, 'annual_inspection_record_template', '下载模板', 'annual_inspection_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000008, 2077650000000000001, 'annual_inspection_record_export', '批量导出', 'annual_inspection_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000009, 2077650000000000001, 'annual_inspection_record_list', '列表', 'annual_inspection_record_list', '/blade-transport/annual-inspection-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000002, 2077660000000000001, 'mileage_record_add', '新增', 'mileage_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000003, 2077660000000000001, 'mileage_record_edit', '编辑', 'mileage_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000004, 2077660000000000001, 'mileage_record_delete', '批量删除', 'mileage_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000005, 2077660000000000001, 'mileage_record_view', '查看', 'mileage_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000006, 2077660000000000001, 'mileage_record_import', '批量导入', 'mileage_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000007, 2077660000000000001, 'mileage_record_template', '下载模板', 'mileage_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000008, 2077660000000000001, 'mileage_record_export', '批量导出', 'mileage_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000009, 2077660000000000001, 'mileage_record_list', '列表', 'mileage_record_list', '/blade-transport/mileage-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000001, 2075436235826896898, 'transport_change_record', '变更记录', 'transport_change_record', '/vehicle/transport-change-record', 'iconfont iconicon_doc', 120, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000002, 2077670000000000001, 'transport_change_record_add', '新增', 'transport_change_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000003, 2077670000000000001, 'transport_change_record_edit', '编辑', 'transport_change_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000004, 2077670000000000001, 'transport_change_record_delete', '批量删除', 'transport_change_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000005, 2077670000000000001, 'transport_change_record_view', '查看', 'transport_change_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000006, 2077670000000000001, 'transport_change_record_import', '批量导入', 'transport_change_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000007, 2077670000000000001, 'transport_change_record_template', '下载模板', 'transport_change_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000008, 2077670000000000001, 'transport_change_record_export', '批量导出', 'transport_change_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077670000000000009, 2077670000000000001, 'transport_change_record_list', '列表', 'transport_change_record_list', '/blade-transport/transport-change-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000001, 2075436235826896898, 'oil_electric_record', '油电记录', 'oil_electric_record', '/vehicle/oil-electric-record', 'iconfont iconicon_doc', 130, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000002, 2077680000000000001, 'oil_electric_record_add', '新增', 'oil_electric_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000003, 2077680000000000001, 'oil_electric_record_edit', '编辑', 'oil_electric_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000004, 2077680000000000001, 'oil_electric_record_delete', '批量删除', 'oil_electric_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000005, 2077680000000000001, 'oil_electric_record_view', '查看', 'oil_electric_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000006, 2077680000000000001, 'oil_electric_record_import', '批量导入', 'oil_electric_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000007, 2077680000000000001, 'oil_electric_record_template', '下载模板', 'oil_electric_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000008, 2077680000000000001, 'oil_electric_record_export', '批量导出', 'oil_electric_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077680000000000009, 2077680000000000001, 'oil_electric_record_list', '列表', 'oil_electric_record_list', '/blade-transport/oil-electric-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000001, 2075436235826896898, 'etc_record', 'ETC记录', 'etc_record', '/vehicle/etc-record', 'iconfont iconicon_doc', 140, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000002, 2077690000000000001, 'etc_record_add', '新增', 'etc_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000003, 2077690000000000001, 'etc_record_edit', '编辑', 'etc_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000004, 2077690000000000001, 'etc_record_delete', '批量删除', 'etc_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000005, 2077690000000000001, 'etc_record_view', '查看', 'etc_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000006, 2077690000000000001, 'etc_record_import', '批量导入', 'etc_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000007, 2077690000000000001, 'etc_record_template', '下载模板', 'etc_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000008, 2077690000000000001, 'etc_record_export', '批量导出', 'etc_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077690000000000009, 2077690000000000001, 'etc_record_list', '列表', 'etc_record_list', '/blade-transport/etc-record/list', '', 8, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000001, 2075436235826896898, 'other_expense_record', '其他费用记录', 'other_expense_record', '/vehicle/other-expense-record', 'iconfont iconicon_doc', 150, 1, 0, 1, '', '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000002, 2077700000000000001, 'other_expense_record_add', '新增', 'other_expense_record_add', '', '', 1, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000003, 2077700000000000001, 'other_expense_record_edit', '编辑', 'other_expense_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000004, 2077700000000000001, 'other_expense_record_delete', '批量删除', 'other_expense_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000005, 2077700000000000001, 'other_expense_record_view', '查看', 'other_expense_record_view', '', '', 4, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000006, 2077700000000000001, 'other_expense_record_import', '批量导入', 'other_expense_record_import', '', '', 5, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000007, 2077700000000000001, 'other_expense_record_template', '下载模板', 'other_expense_record_template', '', '', 6, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000008, 2077700000000000001, 'other_expense_record_export', '批量导出', 'other_expense_record_export', '', '', 7, 2, 0, 1, NULL, '', 0); +INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077700000000000009, 2077700000000000001, 'other_expense_record_list', '列表', 'other_expense_record_list', '/blade-transport/other-expense-record/list', '', 8, 2, 0, 1, NULL, '', 0); COMMIT; -- ---------------------------- @@ -5525,4 +5619,373 @@ BEGIN; INSERT INTO `blade_vehicle_maintenance_record` (`id`, `tenant_id`, `vehicle_type`, `vehicle_no`, `maintainer`, `maintenance_time`, `location`, `replaced_part`, `cost`, `company`, `contact`, `address`, `factory_time`, `mileage`, `mileage_unit`, `attachments`, `remark`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `status`, `is_deleted`) VALUES (2075444431140397057, '000000', '车辆', '桂A12323', '测试人员', '2026-07-01 00:00:00', '轮胎', '', 1000.00, '', '', '', NULL, NULL, '公里', '', '', 1123598821738675201, 1123598813738675201, '2026-07-10 12:58:07', 1123598821738675201, '2026-07-10 12:58:07', 1, 0); COMMIT; +-- ---------------------------- +-- Table structure for blade_insurance_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_insurance_record`; +CREATE TABLE `blade_insurance_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(50) NOT NULL COMMENT '车牌号/船号', + `insurance_type` varchar(50) NOT NULL COMMENT '保险类型', + `policy_no` varchar(80) NOT NULL COMMENT '保单号', + `start_date` date NOT NULL COMMENT '开始日期', + `end_date` date NOT NULL COMMENT '结束日期', + `insured_amount` decimal(18,2) DEFAULT NULL COMMENT '保额', + `premium` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '保费', + `invoice_no` varchar(80) DEFAULT NULL COMMENT '发票号', + `invoice_date` date DEFAULT NULL COMMENT '开票日期', + `ocr_template` varchar(100) DEFAULT NULL COMMENT 'OCR识别模板', + `policy_file` varchar(1000) DEFAULT NULL COMMENT '保单附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_insurance_record_policy` (`vehicle_type`,`insurance_type`,`policy_no`) USING BTREE, + KEY `idx_insurance_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_insurance_record_type` (`insurance_type`) USING BTREE, + KEY `idx_insurance_record_end_date` (`end_date`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='保险记录'; + +-- ---------------------------- +-- Records of blade_insurance_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_violation_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_violation_record`; +CREATE TABLE `blade_violation_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `driver_name` varchar(20) NOT NULL COMMENT '驾驶人/船长', + `violation_type` varchar(50) DEFAULT NULL COMMENT '类型', + `violation_item` varchar(100) DEFAULT NULL COMMENT '事项', + `violation_time` datetime NOT NULL COMMENT '违章时间', + `location` varchar(100) NOT NULL COMMENT '地址', + `fine_amount` decimal(18,2) DEFAULT NULL COMMENT '被罚金额', + `deduct_points` int(11) DEFAULT NULL COMMENT '被扣分数', + `penalty_unit` varchar(50) DEFAULT NULL COMMENT '被罚单位', + `process_status` varchar(20) NOT NULL DEFAULT '已处理' COMMENT '处理状态', + `process_description` varchar(500) NOT NULL COMMENT '过程描述', + `process_result` varchar(500) DEFAULT NULL COMMENT '处理结果', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_violation_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_violation_record_driver` (`driver_name`) USING BTREE, + KEY `idx_violation_record_time` (`violation_time`) USING BTREE, + KEY `idx_violation_record_status` (`process_status`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='违章记录'; + +-- ---------------------------- +-- Records of blade_violation_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_tire_replacement_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_tire_replacement_record`; +CREATE TABLE `blade_tire_replacement_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号', + `handler` varchar(20) DEFAULT NULL COMMENT '处理人', + `replacement_time` date NOT NULL COMMENT '换胎时间', + `tire_brand` varchar(50) DEFAULT NULL COMMENT '轮胎品牌', + `tire_quantity` int(11) DEFAULT NULL COMMENT '换胎数量', + `replacement_cost` decimal(18,2) NOT NULL COMMENT '换胎费用', + `replacement_description` varchar(200) DEFAULT NULL COMMENT '换胎说明', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(500) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_tire_replacement_record_vehicle` (`vehicle_no`) USING BTREE, + KEY `idx_tire_replacement_record_time` (`replacement_time`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='换胎记录'; + +-- ---------------------------- +-- Records of blade_tire_replacement_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_accident_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_accident_record`; +CREATE TABLE `blade_accident_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `accident_date` date NOT NULL COMMENT '事故发生日期', + `accident_location` varchar(100) DEFAULT NULL COMMENT '事故发生地点', + `accident_nature` varchar(20) DEFAULT NULL COMMENT '事故性质', + `accident_responsibility` varchar(20) DEFAULT NULL COMMENT '事故责任', + `direct_economic_loss` decimal(18,2) DEFAULT NULL COMMENT '直接经济损失', + `insurance_claim_amount` decimal(18,2) DEFAULT NULL COMMENT '保险理赔金额', + `accident_reason_damage` varchar(500) DEFAULT NULL COMMENT '事故原因及损坏情况', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_accident_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_accident_record_date` (`accident_date`) USING BTREE, + KEY `idx_accident_record_nature` (`accident_nature`) USING BTREE, + KEY `idx_accident_record_responsibility` (`accident_responsibility`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事故记录'; + +-- ---------------------------- +-- Records of blade_accident_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_annual_inspection_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_annual_inspection_record`; +CREATE TABLE `blade_annual_inspection_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `inspection_assessment_date` date NOT NULL COMMENT '检测评定日期', + `vehicle_technical_level` varchar(20) DEFAULT NULL COMMENT '车辆技术等级', + `ship_inspection_type` varchar(20) DEFAULT NULL COMMENT '船舶检验类型', + `valid_until_date` date NOT NULL COMMENT '有效期截止日', + `passenger_type_level` varchar(50) DEFAULT NULL COMMENT '客车类型及等级', + `inspection_unit` varchar(50) DEFAULT NULL COMMENT '检测评定单位', + `fee` decimal(18,2) NOT NULL COMMENT '费用', + `assessment_unit` varchar(50) DEFAULT NULL COMMENT '评定(复核)单位', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_annual_inspection_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_annual_inspection_record_assessment` (`inspection_assessment_date`) USING BTREE, + KEY `idx_annual_inspection_record_valid` (`valid_until_date`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='年检记录'; + +-- ---------------------------- +-- Records of blade_annual_inspection_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_mileage_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_mileage_record`; +CREATE TABLE `blade_mileage_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号', + `previous_month_mileage` decimal(18,2) DEFAULT NULL COMMENT '上月统计里程', + `current_month_mileage` decimal(18,2) DEFAULT NULL COMMENT '本月统计里程', + `monthly_mileage` decimal(18,2) DEFAULT NULL COMMENT '本月行驶里程', + `total_mileage` decimal(18,2) DEFAULT NULL COMMENT '累计行驶里程', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_mileage_record_vehicle` (`vehicle_no`) USING BTREE, + KEY `idx_mileage_record_total` (`total_mileage`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='里程记录'; + +-- ---------------------------- +-- Records of blade_mileage_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_transport_change_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_transport_change_record`; +CREATE TABLE `blade_transport_change_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) DEFAULT NULL COMMENT '车牌号/船号', + `change_item` varchar(50) NOT NULL COMMENT '变更事项', + `change_content` varchar(200) NOT NULL COMMENT '变更内容', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_transport_change_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_transport_change_record_item` (`change_item`) USING BTREE, + KEY `idx_transport_change_record_create_time` (`create_time`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='变更记录'; + +-- ---------------------------- +-- Records of blade_transport_change_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_oil_electric_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_oil_electric_record`; +CREATE TABLE `blade_oil_electric_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `card_no` varchar(30) DEFAULT NULL COMMENT '卡号', + `transaction_time` datetime NOT NULL COMMENT '交易时间', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `fee_type` varchar(20) NOT NULL COMMENT '费用类型', + `oil_product` varchar(50) DEFAULT NULL COMMENT '油品', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `card_holder` varchar(20) DEFAULT NULL COMMENT '持卡人', + `data_source` varchar(20) DEFAULT '手工录入' COMMENT '数据来源', + `quantity` decimal(18,2) DEFAULT NULL COMMENT '数量', + `unit_price` decimal(18,2) DEFAULT NULL COMMENT '单价', + `transaction_amount` decimal(18,2) NOT NULL COMMENT '交易金额', + `balance` decimal(18,2) DEFAULT NULL COMMENT '余额', + `station` varchar(50) DEFAULT NULL COMMENT '站点', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_oil_electric_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_oil_electric_record_fee_type` (`fee_type`) USING BTREE, + KEY `idx_oil_electric_record_transaction_time` (`transaction_time`) USING BTREE, + KEY `idx_oil_electric_record_amount` (`transaction_amount`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='油电记录'; + +-- ---------------------------- +-- Records of blade_oil_electric_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_etc_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_etc_record`; +CREATE TABLE `blade_etc_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号', + `etc_card_no` varchar(30) NOT NULL COMMENT 'ETC卡号', + `entry_time` datetime DEFAULT NULL COMMENT '入口时间', + `exit_time` datetime NOT NULL COMMENT '出口时间', + `entry_station` varchar(50) DEFAULT NULL COMMENT '入口站', + `exit_station` varchar(50) DEFAULT NULL COMMENT '出口站', + `data_source` varchar(20) DEFAULT '手工录入' COMMENT '数据来源', + `transaction_amount` decimal(18,2) NOT NULL COMMENT '交易金额', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_etc_record_vehicle` (`vehicle_no`) USING BTREE, + KEY `idx_etc_record_card` (`etc_card_no`) USING BTREE, + KEY `idx_etc_record_exit_time` (`exit_time`) USING BTREE, + KEY `idx_etc_record_amount` (`transaction_amount`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ETC记录'; + +-- ---------------------------- +-- Records of blade_etc_record +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for blade_other_expense_record +-- ---------------------------- +DROP TABLE IF EXISTS `blade_other_expense_record`; +CREATE TABLE `blade_other_expense_record` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID', + `expense_date` date NOT NULL COMMENT '费用日期', + `expense_type` varchar(20) NOT NULL COMMENT '其他费用类型', + `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型', + `vehicle_no` varchar(30) NOT NULL COMMENT '车牌号/船号', + `data_source` varchar(20) DEFAULT '手工录入' COMMENT '数据来源', + `amount` decimal(18,2) NOT NULL COMMENT '金额', + `attachments` varchar(1000) DEFAULT NULL COMMENT '附件', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `create_user` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_user` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `status` int(11) DEFAULT '1' COMMENT '状态', + `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_other_expense_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE, + KEY `idx_other_expense_record_type` (`expense_type`) USING BTREE, + KEY `idx_other_expense_record_date` (`expense_date`) USING BTREE, + KEY `idx_other_expense_record_amount` (`amount`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='其他费用记录'; + +-- ---------------------------- +-- Records of blade_other_expense_record +-- ---------------------------- +BEGIN; +COMMIT; + SET FOREIGN_KEY_CHECKS = 1;