From 9f6170d39c29ca2140daf0647617e28fa8ac5bf1 Mon Sep 17 00:00:00 2001 From: chenlong Date: Tue, 27 Aug 2024 16:12:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=A6=E8=BE=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicdataVehicleController.java | 4 +- .../BasicdataVehicleReadingFriendlyExcel.java | 121 ++++++++++++++++++ .../mapper/BasicdataVehicleMapper.java | 3 +- .../mapper/BasicdataVehicleMapper.xml | 2 +- .../service/IBasicdataVehicleService.java | 3 +- .../impl/BasicdataVehicleServiceImpl.java | 14 +- ...DistributionSplitOrderTaskServiceImpl.java | 2 + .../distribution/vo/SplitPackageOrderVO.java | 1 + 8 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleReadingFriendlyExcel.java diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java index 163b9b6a4..754820195 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java @@ -210,8 +210,8 @@ public class BasicdataVehicleController extends BladeController { @ApiOperation(value = "导出数据", notes = "传入basicdataVehicle") public void exportBasicdataVehicle(@ApiIgnore @RequestParam String ids, HttpServletResponse response) { - List list = basicdataVehicleService.exportBasicdataVehicle(ids); - ExcelUtil.export(response, "车辆信息表数据" + DateUtil.time(), "车辆信息表数据表", list, BasicdataVehicleExcel.class); + List list = basicdataVehicleService.exportBasicdataVehicle(ids); + ExcelUtil.export(response, "车辆信息表数据" + DateUtil.time(), "车辆信息表数据表", list, BasicdataVehicleReadingFriendlyExcel.class); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleReadingFriendlyExcel.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleReadingFriendlyExcel.java new file mode 100644 index 000000000..37d91d72c --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleReadingFriendlyExcel.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.excel; + + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; +import org.springblade.system.cache.DictBizCache; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 车辆信息表 Excel实体类 + * + * @author lmy + * @since 2023-05-16 + */ +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicdataVehicleReadingFriendlyExcel extends BasicdataVehicleExcel implements Serializable { + + private static final long serialVersionUID = 1L; + +// // 车辆来源 +// getDictionaryBiz('basic_vehicle_source').then(res => handleData('车辆来源', res)), +// // 是否车头 +// getDictionaryBiz('yes_no').then(res => handleData('是否车头', res)), +// // 挂车类型 +// getDictionaryBiz('basic_trailer_type').then(res => handleData('挂车类型', res)), +// // 车辆类型 +// getDictionaryBiz('basic_vehicle_model').then(res => handleData('车辆类型', res)), +// // 车厢类型 +// getDictionaryBiz('basic_car_type').then(res => handleData('车厢类型', res)), +// // 付款方式 +// getDictionaryBiz('basicdata_vehicle_paymentmethod').then(res => handleData('付款方式', res)), +// // 车牌颜色 +// getDictionaryBiz('basic_plate_color').then(res => handleData('车牌颜色', res)), +// // 车身颜色 +// getDictionaryBiz('basic_vehicle_color').then(res => handleData('车身颜色', res)), +// // 能源类型 +// getDictionaryBiz('basic_energy_type').then(res => handleData('能源类型', res)), +// // 车牌类型 +// getDictionaryBiz('basic_plate_type').then(res => handleData('车牌类型', res)), + + + @Override + public String getVehicleSource() { + return DictBizCache.getValue("basic_vehicle_source", super.getVehicleSource()); + } + + @Override + public String getIsHead() { + return DictBizCache.getValue("yes_no", super.getIsHead()); + } + + @Override + public String getTrailerType() { + return DictBizCache.getValue("basic_trailer_type", super.getTrailerType()); + } + + @Override + public String getVehicleModel() { + return DictBizCache.getValue("basic_vehicle_model", super.getVehicleModel()); + } + + @Override + public String getCarType() { + return DictBizCache.getValue("basic_car_type", super.getCarType()); + } + + @Override + public String getPaymentMethod() { + return DictBizCache.getValue("basicdata_vehicle_paymentmethod", super.getPaymentMethod()); + } + + @Override + public String getLicensePlateColor() { + return DictBizCache.getValue("basic_plate_color", super.getLicensePlateColor()); + } + + @Override + public String getVehicleColor() { + return DictBizCache.getValue("basic_vehicle_color", super.getVehicleColor()); + } + + @Override + public String getEnergyType() { + return DictBizCache.getValue("basic_energy_type", super.getEnergyType()); + } + + @Override + public String getLicensePlateType() { + return DictBizCache.getValue("basic_plate_type", super.getLicensePlateType()); + } + + @Override + public String getWithGps() { + return DictBizCache.getValue("yes_no", super.getWithGps()); + } +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java index 90be4aadc..d6b788b68 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.basicdata.dto.BasicdataVehicleDTO; import com.logpm.basicdata.entity.BasicdataVehicleEntity; import com.logpm.basicdata.excel.BasicdataVehicleExcel; +import com.logpm.basicdata.excel.BasicdataVehicleReadingFriendlyExcel; import com.logpm.basicdata.vo.BasicdataVehicleVO; import org.apache.ibatis.annotations.Param; @@ -51,7 +52,7 @@ public interface BasicdataVehicleMapper extends BaseMapper exportBasicdataVehicle(@Param("ids") List ids); + List exportBasicdataVehicle(@Param("ids") List ids); List selectPhotoBymasterId(Long id); /** diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml index 6fc64c167..28388dabf 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml @@ -158,7 +158,7 @@ - SELECT lbc.vehicle_nub AS vehicleNub, lbc.vehicle_source AS vehicleSource, diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java index 0d849a8aa..d69417978 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java @@ -22,6 +22,7 @@ import com.logpm.basicdata.dto.BasicdataVehicleDTO; import com.logpm.basicdata.entity.BasicdataVehicleEntity; import com.logpm.basicdata.excel.BasicdataVehicleExcel; import com.logpm.basicdata.excel.BasicdataVehicleImportExcel; +import com.logpm.basicdata.excel.BasicdataVehicleReadingFriendlyExcel; import com.logpm.basicdata.vo.BasicdataVehicleVO; import org.springblade.core.mp.base.BaseService; @@ -50,7 +51,7 @@ public interface IBasicdataVehicleService extends BaseService exportBasicdataVehicle(String ids); + List exportBasicdataVehicle(String ids); /** * 查询历史照片 * diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java index 84fe80763..dff333a2a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java @@ -32,11 +32,13 @@ import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity; import com.logpm.basicdata.entity.BasicdataVehicleEntity; import com.logpm.basicdata.excel.BasicdataVehicleExcel; import com.logpm.basicdata.excel.BasicdataVehicleImportExcel; +import com.logpm.basicdata.excel.BasicdataVehicleReadingFriendlyExcel; import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper; import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper; import com.logpm.basicdata.mapper.BasicdataVehicleMapper; import com.logpm.basicdata.service.IBasicdataCarrierService; import com.logpm.basicdata.service.IBasicdataVehicleService; +import com.logpm.basicdata.vo.BasicdataCarrierVO; import com.logpm.basicdata.vo.BasicdataVehicleVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -80,9 +82,15 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl exportBasicdataVehicle(String ids) { - - List basicdataVehicleList = baseMapper.exportBasicdataVehicle(Func.toLongList(ids)); + public List exportBasicdataVehicle(String ids) { + + List basicdataVehicleList = baseMapper.exportBasicdataVehicle(Func.toLongList(ids)); +// List basicdataCarrierVOS = basicdataCarrierService.selectBasicdataCarrierDictionary(); +// Map carrierMap = basicdataCarrierVOS.stream().collect(Collectors.toMap(BasicdataCarrierVO::getId, BasicdataCarrierVO::getCarrierName)); +// +// basicdataVehicleList.stream().map(basicdataVehicleReadingFriendlyExcel -> { +// basicdataVehicleReadingFriendlyExcel.setCarrierName(carrierMap.get(basicdataVehicleReadingFriendlyExcel.getCarrierId())); +// }); return basicdataVehicleList; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java index a1ba712a4..483640402 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java @@ -891,6 +891,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl