From fa80c90eddf04c635fa94ed40330e835e6891a7e Mon Sep 17 00:00:00 2001 From: majian314 Date: Thu, 16 Oct 2025 16:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=96=B0=E5=A2=9Elot?= =?UTF-8?q?=E5=93=81=E7=89=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/operation/domain/ZcCar.java | 14 ++++++-- .../service/impl/ZcCarServiceImpl.java | 7 +++- .../mapper/operation/ZcCarMapper.xml | 13 +++++--- .../templates/operation/car/add.html | 33 +++++++++++-------- .../templates/operation/car/car.html | 15 +++++++++ .../templates/operation/car/edit.html | 19 ++++++++++- 6 files changed, 79 insertions(+), 22 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCar.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCar.java index 60d9ce8..aab33e5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCar.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCar.java @@ -56,6 +56,9 @@ public class ZcCar extends BaseEntity @Excel(name = "LOT识别号") private String lotNumber; + @Excel(name = "LOT品牌", dictType = "key_car_lot_brand") + private String lotBrand; + /** 采购日期 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "采购日期", width = 30, dateFormat = "yyyy-MM-dd") @@ -95,10 +98,9 @@ public class ZcCar extends BaseEntity @Excel(name = "所属门店") private String storeName; - /** 应用套餐ID */ + /** 闲置 */ private Long packageId; - /** 应用套餐名称 */ private String packageName; /** 状态 */ @@ -402,6 +404,14 @@ public class ZcCar extends BaseEntity return extend5; } + public String getLotBrand() { + return lotBrand; + } + + public void setLotBrand(String lotBrand) { + this.lotBrand = lotBrand; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarServiceImpl.java index 254f36f..636d745 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarServiceImpl.java @@ -231,7 +231,12 @@ public class ZcCarServiceImpl implements IZcCarService failureMsg.append("
" + failureNum + "、车辆品牌 " + car.getBrandName() + " 的车辆型号 " + car.getModelName() + " 不存在"); continue; } - + // 设置LOT品牌 + if (StringUtils.isNotEmpty(car.getLotNumber()) && StringUtils.isEmpty(car.getLotBrand())) { + failureNum++; + failureMsg.append("
" + failureNum + "、Lot号" + car.getLotNumber() + "未填写Lot品牌"); + continue; + } // 设置运营商ID if (StringUtils.isNotEmpty(car.getOperatorName()) && companyMap.containsKey(car.getOperatorName())) { car.setOperatorId(companyMap.get(car.getOperatorName())); diff --git a/ruoyi-admin/src/main/resources/mapper/operation/ZcCarMapper.xml b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarMapper.xml index 3697e79..d7bd38a 100644 --- a/ruoyi-admin/src/main/resources/mapper/operation/ZcCarMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarMapper.xml @@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -44,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, vin, license_plate, brand_id, brand_name, model_id, model_name, battery_type, weight, max_speed, lot_number, purchase_date, purchase_price, belong_type, images, brs_status, iot_status, iot_code, operator_id, operator_name, store_id, store_name, package_id, package_name, status, del_flag, create_by, create_time, update_by, update_time, remark, extend1, extend2, extend3, extend4, extend5 from zc_car + select id, vin, license_plate, brand_id, brand_name, model_id, model_name, battery_type, weight, max_speed, lot_number, lot_brand, purchase_date, purchase_price, belong_type, images, brs_status, iot_status, iot_code, operator_id, operator_name, store_id, store_name, package_id, package_name, status, del_flag, create_by, create_time, update_by, update_time, remark, extend1, extend2, extend3, extend4, extend5 from zc_car + + + +
+ +
+
@@ -96,19 +105,7 @@
- - - - - - - - - - - - - +
@@ -238,6 +235,14 @@ }); function submitHandler() { + var lotNumber = $("#lotNumber").val(); + if(lotNumber != '') { + var lotBrand = $("#lotBrand").val(); + if (lotBrand == '') { + $.modal.alert("请选择LOT品牌"); + return; + } + } if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-car-add').serialize()); } diff --git a/ruoyi-admin/src/main/resources/templates/operation/car/car.html b/ruoyi-admin/src/main/resources/templates/operation/car/car.html index d5f8bda..f8fad81 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/car/car.html +++ b/ruoyi-admin/src/main/resources/templates/operation/car/car.html @@ -51,6 +51,13 @@ +
  • + + +
  •  搜索  重置 @@ -91,6 +98,7 @@ var brsStatusDatas = [[${@dict.getType('key_car_brs_status')}]]; var batteryTypeDatas = [[${@dict.getType('key_car_battery_type')}]]; var belongTypeDatas = [[${@dict.getType('key_car_belong_type')}]]; + var lotBrandDatas = [[${@dict.getType('key_car_lot_brand')}]]; var prefix = ctx + "operation/car"; $(function() { @@ -131,6 +139,13 @@ field: 'lotNumber', title: 'LOT识别号' }, + { + field: 'lotBrand', + title: 'LOT品牌', + formatter: function(value, row, index) { + return $.table.selectDictLabel(lotBrandDatas, value); + } + }, { field: 'purchaseDate', title: '采购日期' diff --git a/ruoyi-admin/src/main/resources/templates/operation/car/edit.html b/ruoyi-admin/src/main/resources/templates/operation/car/edit.html index e0ac12e..200b3a0 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/car/edit.html +++ b/ruoyi-admin/src/main/resources/templates/operation/car/edit.html @@ -43,7 +43,16 @@
    - + +
    +
    +
    + +
    +
    @@ -286,6 +295,14 @@ }); function submitHandler() { + var lotNumber = $("#lotNumber").val(); + if(lotNumber != '') { + var lotBrand = $("#lotBrand").val(); + if (lotBrand == '') { + $.modal.alert("请选择LOT品牌"); + return; + } + } if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-car-edit').serialize()); }