车辆新增lot品牌
This commit is contained in:
		| @ -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) | ||||
|  | ||||
| @ -231,7 +231,12 @@ public class ZcCarServiceImpl implements IZcCarService | ||||
|                         failureMsg.append("<br/>" + failureNum + "、车辆品牌 " + car.getBrandName() + " 的车辆型号 " + car.getModelName() + " 不存在"); | ||||
|                         continue; | ||||
|                     } | ||||
|  | ||||
|                     // 设置LOT品牌 | ||||
|                     if (StringUtils.isNotEmpty(car.getLotNumber()) && StringUtils.isEmpty(car.getLotBrand())) { | ||||
|                         failureNum++; | ||||
|                         failureMsg.append("<br/>" + failureNum + "、Lot号" + car.getLotNumber() + "未填写Lot品牌"); | ||||
|                         continue; | ||||
|                     } | ||||
|                     // 设置运营商ID | ||||
|                     if (StringUtils.isNotEmpty(car.getOperatorName()) && companyMap.containsKey(car.getOperatorName())) { | ||||
|                         car.setOperatorId(companyMap.get(car.getOperatorName())); | ||||
|  | ||||
| @ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         <result property="weight"    column="weight"    /> | ||||
|         <result property="maxSpeed"    column="max_speed"    /> | ||||
|         <result property="lotNumber"    column="lot_number"    /> | ||||
|         <result property="lotBrand"    column="lot_brand"    /> | ||||
|         <result property="purchaseDate"    column="purchase_date"    /> | ||||
|         <result property="purchasePrice"    column="purchase_price"    /> | ||||
|         <result property="belongType"    column="belong_type"    /> | ||||
| @ -44,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectZcCarVo"> | ||||
|         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 | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectZcCarList" parameterType="ZcCar" resultMap="ZcCarResult"> | ||||
| @ -61,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="weight != null  and weight != ''"> and weight = #{weight}</if> | ||||
|             <if test="maxSpeed != null  and maxSpeed != ''"> and max_speed = #{maxSpeed}</if> | ||||
|             <if test="lotNumber != null  and lotNumber != ''"> and lot_number = #{lotNumber}</if> | ||||
|             <if test="lotBrand != null  and lotBrand != ''"> and lot_brand = #{lotBrand}</if> | ||||
|             <if test="purchaseDate != null "> and purchase_date = #{purchaseDate}</if> | ||||
|             <if test="purchasePrice != null "> and purchase_price = #{purchasePrice}</if> | ||||
|             <if test="belongType != null  and belongType != ''"> and belong_type = #{belongType}</if> | ||||
| @ -106,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="weight != null">weight,</if> | ||||
|             <if test="maxSpeed != null">max_speed,</if> | ||||
|             <if test="lotNumber != null">lot_number,</if> | ||||
|             <if test="lotBrand != null">lot_brand,</if> | ||||
|             <if test="purchaseDate != null">purchase_date,</if> | ||||
|             <if test="purchasePrice != null">purchase_price,</if> | ||||
|             <if test="belongType != null">belong_type,</if> | ||||
| @ -143,6 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="weight != null">#{weight},</if> | ||||
|             <if test="maxSpeed != null">#{maxSpeed},</if> | ||||
|             <if test="lotNumber != null">#{lotNumber},</if> | ||||
|             <if test="lotBrand != null">#{lotBrand},</if> | ||||
|             <if test="purchaseDate != null">#{purchaseDate},</if> | ||||
|             <if test="purchasePrice != null">#{purchasePrice},</if> | ||||
|             <if test="belongType != null">#{belongType},</if> | ||||
| @ -172,7 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|     </insert> | ||||
|     <insert id="batchInsert"> | ||||
|         INSERT INTO zc_car (vin, license_plate,  brand_name, | ||||
|                             model_name, lot_number, purchase_date, | ||||
|                             model_name, lot_number, lot_brand, purchase_date, | ||||
|                             purchase_price, belong_type, iot_code, | ||||
|                             operator_id, operator_name, | ||||
|                             store_id, store_name, | ||||
| @ -180,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         VALUES | ||||
|         <foreach collection="list" item="item" separator=","> | ||||
|             (#{item.vin}, #{item.licensePlate}, #{item.brandName} | ||||
|             #{item.modelName}, #{item.lotNumber}, #{item.purchaseDate} | ||||
|             #{item.modelName}, #{item.lotNumber}, #{item.lotBrand}, #{item.purchaseDate} | ||||
|             #{item.purchasePrice}, #{item.belongType}, #{item.iotCode} | ||||
|             #{item.operatorId}, #{item.operatorName}, | ||||
|             #{item.storeId}, #{item.storeName}, | ||||
| @ -201,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="weight != null">weight = #{weight},</if> | ||||
|             <if test="maxSpeed != null">max_speed = #{maxSpeed},</if> | ||||
|             <if test="lotNumber != null">lot_number = #{lotNumber},</if> | ||||
|             <if test="lotBrand != null">lot_brand = #{lotBrand},</if> | ||||
|             <if test="purchaseDate != null">purchase_date = #{purchaseDate},</if> | ||||
|             <if test="purchasePrice != null">purchase_price = #{purchasePrice},</if> | ||||
|             <if test="belongType != null">belong_type = #{belongType},</if> | ||||
| @ -241,4 +246,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         </foreach> | ||||
|     </delete> | ||||
|  | ||||
| </mapper> | ||||
| </mapper> | ||||
|  | ||||
| @ -41,7 +41,16 @@ | ||||
|             <div class="form-group"> | ||||
|                 <label class="col-sm-3 control-label">LOT识别号:</label> | ||||
|                 <div class="col-sm-8"> | ||||
|                     <input name="lotNumber" class="form-control" type="text"> | ||||
|                     <input name="lotNumber" id="lotNumber" class="form-control" type="text"> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="form-group"> | ||||
|                 <label class="col-sm-3 control-label">LOT品牌:</label> | ||||
|                 <div class="col-sm-8"> | ||||
|                     <select id="lotBrand" name="lotBrand" class="form-control m-b" th:with="type=${@dict.getType('key_car_lot_brand')}"> | ||||
|                         <option value="">请选择品牌</option> | ||||
|                         <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> | ||||
|                     </select> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="form-group">     | ||||
| @ -96,19 +105,7 @@ | ||||
|                     </select> | ||||
|                 </div> | ||||
|             </div> | ||||
|  | ||||
| <!--            <div class="form-group">    --> | ||||
| <!--                <label class="col-sm-3 control-label">应用套餐:</label>--> | ||||
| <!--                <div class="col-sm-8">--> | ||||
| <!--                    <input name="packageId" class="form-control" type="text">--> | ||||
| <!--                </div>--> | ||||
| <!--            </div>--> | ||||
| <!--            <div class="form-group">    --> | ||||
| <!--                <label class="col-sm-3 control-label">应用套餐名称:</label>--> | ||||
| <!--                <div class="col-sm-8">--> | ||||
| <!--                    <input name="packageName" class="form-control" type="text">--> | ||||
| <!--                </div>--> | ||||
| <!--            </div>--> | ||||
|              | ||||
|             <div class="form-group"> | ||||
|                 <label class="col-sm-3 control-label">备注信息:</label> | ||||
|                 <div class="col-sm-8"> | ||||
| @ -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()); | ||||
|             } | ||||
|  | ||||
| @ -51,6 +51,13 @@ | ||||
|                                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> | ||||
|                                 </select> | ||||
|                             </li> | ||||
|                             <li> | ||||
|                                 <label>LOT品牌:</label> | ||||
|                                 <select name="lotBrand" th:with="type=${@dict.getType('key_car_lot_brand')}"> | ||||
|                                     <option value="">所有</option> | ||||
|                                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> | ||||
|                                 </select> | ||||
|                             </li> | ||||
|                             <li> | ||||
|                                 <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> | ||||
|                                 <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> | ||||
| @ -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: '采购日期' | ||||
|  | ||||
| @ -43,7 +43,16 @@ | ||||
|             <div class="form-group">     | ||||
|                 <label class="col-sm-3 control-label">LOT识别号:</label> | ||||
|                 <div class="col-sm-8"> | ||||
|                     <input name="lotNumber" th:field="*{lotNumber}" class="form-control" type="text"> | ||||
|                     <input id="lotNumber" name="lotNumber" th:field="*{lotNumber}" class="form-control" type="text"> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="form-group"> | ||||
|                 <label class="col-sm-3 control-label">LOT品牌:</label> | ||||
|                 <div class="col-sm-8"> | ||||
|                     <select id="lotBrand" name="lotBrand" class="form-control m-b" th:with="type=${@dict.getType('key_car_lot_brand')}"> | ||||
|                         <option value="">请选择品牌</option> | ||||
|                         <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  th:field="*{lotBrand}"></option> | ||||
|                     </select> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="form-group">     | ||||
| @ -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()); | ||||
|             } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 majian314
					majian314