Browse Source

Merge remote-tracking branch 'origin/dev' into dev

chenglong
pref_mail@163.com 1 year ago
parent
commit
40d734c7b2
  1. 13
      blade-biz-common/src/main/java/org/springblade/common/utils/PhoneCheckUtil.java
  2. 22
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  3. 88
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java
  4. 96
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleExcel.java
  5. 332
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java
  6. 35
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImporter.java
  7. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java
  8. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml
  9. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java
  10. 67
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml
  11. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java
  12. 110
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java

13
blade-biz-common/src/main/java/org/springblade/common/utils/PhoneCheckUtil.java

@ -0,0 +1,13 @@
package org.springblade.common.utils;
/**
* 电话校验
*/
public class PhoneCheckUtil {
public static boolean checkPhone(String phone){
String regex = "^1[3-9]\\d{9}$";
return phone.matches(regex);
}
}

22
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -107,9 +107,6 @@
<if test="param.first != null and param.first != '' ">and lawo.first like concat('%', #{param.first },'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and lawo.secondary like concat('%', #{param.secondary },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<!-- create_time >= unix_timestamp('2013-10-24 00:00:00') and create_time <= unix_timestamp('2013-10-24 23:59:59')
date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
-->
<if test="param.brandName !=null and param.brandName !='' " >and lawo.brand_name like concat('%', #{param.brandName },'%') </if>
<if test="param.deliverGoodsTime != null ">and date_format(from_unixtime( lawo.deliver_goods_time),'%Y-%m-%d') = date_format(#{param.deliverGoodsTime },'%Y-%m-%d') </if>
<if test="param.discoveryTime != null ">and date_format(from_unixtime(lawo.discovery_time),'%Y-%m-%d') = date_format( #{param.discoveryTime},'%Y-%m-%d') </if>
@ -125,12 +122,12 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.customerServiceState != null and param.customerServiceState == 40 "> and lawo.work_order_status in ('20') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 31 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 60 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 10 "> and lawo.work_order_status in ('70','80') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 10 "> and lawo.work_order_status in ('70','80','100') </if>
<if test="param.customerServiceId != null and param.customerServiceId != '' ">and lawo.customer_service_id = #{param.customerServiceId } </if>
<if test="param.customerServiceName != null and param.customerServiceName != '' ">and lawo.customer_service_name like concat('%', #{param.customerServiceName },'%') </if>
<if test="param.waybillMallId != null and param.waybillMallId != '' ">and lawo.waybill_mall_id = #{param.waybillMallId } </if>
<if test="param.problemDescription != null and param.problemDescription != '' ">and lawo.problem_description = #{param.problemDescription} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != null ">and (lap.warehouse_id = #{param.warehouseId} OR lap.business_id = #{param.warehouseId}) </if>
<if test="param.personResponsible != null and param.personResponsible != '' ">and lawo.person_responsible = #{param.personResponsible } </if>
<if test="param.processNumber != null and param.processNumber != '' ">and lawo.process_number = #{param.processNumber } </if>
<if test="param.reviewedBy != null and param.reviewedBy != '' ">and lawo.reviewed_by = #{param.reviewedBy } </if>
@ -143,7 +140,11 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.customerIdentification != null and param.customerIdentification == 1 ">
and lawo.work_order_status IN ( '10', '20', '21', '30', '40', '50', '60', '70', '80', '90' ,'100','110')
</if>
<if test="param.handleStatus != null "> or 1=1 </if>
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30"> and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and ((lawo.work_order_status in (80,100,70) OR lacr.warehouse_id=#{param.warehouseId}) AND lawo.warehouse_id =#{param.warehouseId} ) </if>
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
@ -153,15 +154,8 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.first != null and param.first != '' ">and lawo.first like concat('%', #{param.first },'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and lawo.secondary like concat('%', #{param.secondary },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20 "> and lap.business_id = #{param.warehouseId} </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<!-- <if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null "> and lawo.work_order_status in ( #{param.workOrderStatus }) and lap.types_of = '2' </if>-->
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100,70) and lacr.warehouse_id=#{param.warehouseId} </if>
<if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
<if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
ORDER BY lawo.create_time DESC
</where>

88
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.controller;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.nacos.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -23,7 +24,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.BasicdataVehicleDTO;
import com.logpm.basicdata.dto.BasicdataVehiclePhotoDTO;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.excel.BasicdataVehicleExcel;
import com.logpm.basicdata.excel.*;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
import com.logpm.basicdata.service.IBasicdataVehiclePhotoService;
import com.logpm.basicdata.service.IBasicdataVehicleService;
@ -45,10 +46,14 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -201,14 +206,81 @@ public class BasicdataVehicleController extends BladeController {
@GetMapping("/export-basicdataVehicle")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入basicdataVehicle")
public void exportBasicdataVehicle(@ApiIgnore @RequestParam Map<String, Object> basicdataVehicle, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<BasicdataVehicleEntity> queryWrapper = Condition.getQueryWrapper(basicdataVehicle, BasicdataVehicleEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(BasicdataVehicle::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(BasicdataVehicleEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<BasicdataVehicleExcel> list = basicdataVehicleService.exportBasicdataVehicle(queryWrapper);
public void exportBasicdataVehicle(@ApiIgnore @RequestParam String ids, HttpServletResponse response) {
List<BasicdataVehicleExcel> list = basicdataVehicleService.exportBasicdataVehicle(ids);
ExcelUtil.export(response, "车辆信息表数据" + DateUtil.time(), "车辆信息表数据表", list, BasicdataVehicleExcel.class);
}
/**
* 导出数据
*/
@GetMapping("/export-vehicleTemplate")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "下载导出模板", notes = "传入basicdataVehicle")
public void exportVehicleTemplate(HttpServletResponse response) {
List<BasicdataVehicleImportExcel> list = new ArrayList<>();
BasicdataVehicleImportExcel basicdataVehicleImportExcel = new BasicdataVehicleImportExcel();
// basicdataVehicleImportExcel.setVehicleNub("鄂HG40Q9");
// basicdataVehicleImportExcel.setVehicleSource("1");
// basicdataVehicleImportExcel.setIsHead("1");
// basicdataVehicleImportExcel.setTrailerType("1");
// basicdataVehicleImportExcel.setVehicleModel("1");
// basicdataVehicleImportExcel.setCarType("1");
// basicdataVehicleImportExcel.setVehicleCommander(new BigDecimal(70.0));
// basicdataVehicleImportExcel.setVehicleHeight(new BigDecimal(70.0));
// basicdataVehicleImportExcel.setApprovedVolume(new BigDecimal(500.0));
// basicdataVehicleImportExcel.setPaymentMethod("1");
// basicdataVehicleImportExcel.setLicensePlateColor("1");
// basicdataVehicleImportExcel.setVehicleCode("代号");
// basicdataVehicleImportExcel.setVehicleColor("1");
// basicdataVehicleImportExcel.setLicensePlateType("1");
// basicdataVehicleImportExcel.setNotes("备注");
// basicdataVehicleImportExcel.setVehicleOwner("如需绑定司机填写司机名称");
// basicdataVehicleImportExcel.setVehicleBrand("车辆品牌");
// basicdataVehicleImportExcel.setEngineCode("B48");
// basicdataVehicleImportExcel.setVehicleQuality(new BigDecimal(500.0));
// basicdataVehicleImportExcel.setLoadMass(new BigDecimal(500.0));
// basicdataVehicleImportExcel.setOuterWidth(new BigDecimal(500.0));
// basicdataVehicleImportExcel.setExpirationTime(DateUtils.format(new Date(),"dd/MM/yyyy"));
// basicdataVehicleImportExcel.setInsuranceStartTime(DateUtils.format(new Date(),"dd/MM/yyyy"));
// basicdataVehicleImportExcel.setInsuranceEndTime(DateUtils.format(new Date(),"dd/MM/yyyy"));
// basicdataVehicleImportExcel.setAdvertisementsNewTimes(DateUtils.format(new Date(),"dd/MM/yyyy"));
// basicdataVehicleImportExcel.setReviewTime(DateUtils.format(new Date(),"dd/MM/yyyy"));
// basicdataVehicleImportExcel.setRoadTransport("420303001532");
// basicdataVehicleImportExcel.setBusinessLicense("420303001532");
// basicdataVehicleImportExcel.setVehicleUnit("个人");
// basicdataVehicleImportExcel.setVehicleUnitPhone("15678923467");
// basicdataVehicleImportExcel.setVehicleOwnerPhone("如需绑定司机填写司机手机号码");
// basicdataVehicleImportExcel.setVehicleOwnerCard("车辆所属人身份证号");
// basicdataVehicleImportExcel.setCarrierName("汇通运输");
// basicdataVehicleImportExcel.setReviewValidity(24);
// basicdataVehicleImportExcel.setBodyAdvertising("有");
// basicdataVehicleImportExcel.setBodyAdvertising("有");
// basicdataVehicleImportExcel.setVehicleParkingCompany("XXX挂靠公司");
// basicdataVehicleImportExcel.setWithGps("1");
// basicdataVehicleImportExcel.setGpsServiceProvider("XXX服务商");
// basicdataVehicleImportExcel.setGpsModel("VT77M");
// basicdataVehicleImportExcel.setDemonstrate("是");
list.add(basicdataVehicleImportExcel);
ExcelUtil.export(response, "车辆信息表数据" + DateUtil.time(), "车辆信息表数据表", list, BasicdataVehicleImportExcel.class);
}
/**
* 导入司机信息
*/
@PostMapping("import-basicdataVehicle")
@ApiOperationSupport(order = 12)
@ApiOperation(value = "导入车辆信息", notes = "传入excel")
public R importBasicdataVehicle(MultipartFile file) {
log.info("传入>>>>>>>{}",file);
BasicdataVehicleImporter basicdataDriverArteryImporter = new BasicdataVehicleImporter(basicdataVehicleService);
ExcelUtil.save(file,basicdataDriverArteryImporter, BasicdataVehicleImportExcel.class);
return R.success("操作成功");
}
}

96
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleExcel.java

@ -42,18 +42,18 @@ public class BasicdataVehicleExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
/**
* 是否已删除;1-未删除2-已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除;1-未删除,2-已删除")
private Integer isDeleted;
// /**
// * 租户号
// */
// @ColumnWidth(20)
// @ExcelProperty("租户号")
// private String tenantId;
// /**
// * 是否已删除;1-未删除,2-已删除
// */
// @ColumnWidth(20)
// @ExcelProperty("是否已删除;1-未删除,2-已删除")
// private Integer isDeleted;
/**
* 车牌号
*/
@ -282,12 +282,18 @@ public class BasicdataVehicleExcel implements Serializable {
@ColumnWidth(20)
@ExcelProperty("保险卡照片")
private String insuranceCardPhoto;
// /**
// * 关联承运商Id
// */
// @ColumnWidth(20)
// @ExcelProperty("关联承运商Id")
// private String carrierId;
/**
* 关联承运商Id
* 关联承运商名称
*/
@ColumnWidth(20)
@ExcelProperty("关联承运商Id")
private String carrierId;
@ExcelProperty("关联承运商名称")
private String carrierName;
/**
* 车辆年审时间
*/
@ -348,35 +354,35 @@ public class BasicdataVehicleExcel implements Serializable {
@ColumnWidth(20)
@ExcelProperty("GPS型号")
private String gpsModel;
/**
* 预留1
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
/**
* 预留2
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
/**
* 预留3
*/
@ColumnWidth(20)
@ExcelProperty("预留3")
private String reserve3;
/**
* 预留4
*/
@ColumnWidth(20)
@ExcelProperty("预留4")
private String reserve4;
/**
* 预留5
*/
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
// /**
// * 预留1
// */
// @ColumnWidth(20)
// @ExcelProperty("预留1")
// private String reserve1;
// /**
// * 预留2
// */
// @ColumnWidth(20)
// @ExcelProperty("预留2")
// private String reserve2;
// /**
// * 预留3
// */
// @ColumnWidth(20)
// @ExcelProperty("预留3")
// private String reserve3;
// /**
// * 预留4
// */
// @ColumnWidth(20)
// @ExcelProperty("预留4")
// private String reserve4;
// /**
// * 预留5
// */
// @ColumnWidth(20)
// @ExcelProperty("预留5")
// private String reserve5;
}

332
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java

@ -0,0 +1,332 @@
/*
* 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.ExcelIgnore;
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 java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 车辆信息表 Excel实体类
*
* @author lmy
* @since 2023-05-16
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BasicdataVehicleImportExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 车牌号
*/
@ColumnWidth(45)
@ExcelProperty(index = 0,value = "车牌号,必填项:{示例:川A12345}")
private String vehicleNub;
/**
* 车辆来源;1-自有,2-承包,3-外请
*/
@ColumnWidth(45)
@ExcelProperty(index = 1,value ="车辆来源;1-自有,2-承包,3-外请")
private String vehicleSource;
/**
* 是否车头;1-车头,2-挂车
*/
@ColumnWidth(35)
@ExcelProperty(index = 2,value ="是否车头;1-车头,2-挂车")
private String isHead;
/**
* 挂车类型;1-独享,2-共享
*/
@ColumnWidth(32)
@ExcelProperty(index = 3,value ="挂车类型;1-独享,2-共享")
private String trailerType;
/**
* 车辆类型;1-挂车,2-普通货车
*/
@ColumnWidth(150)
@ExcelProperty(index = 4,value ="车辆类型;1-厢式货车;2-箱式挂车;3-平板货车;4-平板挂车;5-高栏车;6-高栏挂车;7-城配面包车;8-城配金杯车")
private String vehicleModel;
/**
* 车厢类型;1-高栏,2-平板,3-箱车
*/
@ColumnWidth(45)
@ExcelProperty(index = 5,value ="车厢类型;1-高栏,2-平板,3-箱车")
private String carType;
/**
* 车长;单位M
*/
@ColumnWidth(25)
@ExcelProperty(index = 6,value ="车长;单位(M)")
private BigDecimal vehicleCommander;
/**
* 外廓高
*/
@ColumnWidth(25)
@ExcelProperty(index = 7,value ="外廓高;单位(M)")
private BigDecimal vehicleHeight;
/**
* 车牌颜色;1-黄色,2-蓝色,3-绿色,4-蓝绿色,5-其他
*/
@ColumnWidth(60)
@ExcelProperty("车牌颜色;1-黄色,2-蓝色,3-绿色,4-蓝绿色,5-其他")
private String licensePlateColor;
/**
* 车身颜色;1-,2-,3-,4-,5-,6-
*/
@ColumnWidth(55)
@ExcelProperty("车身颜色;1-红,2-黄,3-蓝,4-黑,5-白,6-银")
private String vehicleColor;
/**
* 能源类型;1-汽油,2-柴油,3-,4-天然气,5-混合油,6-燃化石油气,7-甲醇
*/
@ColumnWidth(90)
@ExcelProperty("能源类型;1-汽油,2-柴油,3-电,4-天然气,5-混合油,6-燃化石油气,7-甲醇")
private String energyType;
/**
* 车牌类型;1-大型汽车号牌,2-小型汽车号牌
*/
@ColumnWidth(50)
@ExcelProperty("车牌类型;1-大型汽车号牌,2-小型汽车号牌")
private String licensePlateType;
/**
* 车辆总质量;单位T
*/
@ColumnWidth(30)
@ExcelProperty("车辆总质量;单位(T)")
private BigDecimal vehicleQuality;
/**
* 整备质量;单位T
*/
@ColumnWidth(30)
@ExcelProperty("整备质量;单位(T)")
private BigDecimal curbWeight;
/**
* 载荷质量;单位T
*/
@ColumnWidth(30)
@ExcelProperty("载荷质量;单位(T)")
private BigDecimal loadMass;
/**
* 外廓宽;单位M
*/
@ColumnWidth(30)
@ExcelProperty("外廓宽;单位(M)")
private BigDecimal outerWidth;
/**
* 核定体积
*/
@ColumnWidth(30)
@ExcelProperty("核定体积;单位(方)")
private BigDecimal approvedVolume;
/**
* 付款方式;1-现付,2-月付,3-到付
*/
@ColumnWidth(45)
@ExcelProperty(index = 8,value ="付款方式;1-现付,2-月付,3-到付")
private String paymentMethod;
/**
* 车辆所属人
*/
@ColumnWidth(100)
@ExcelProperty("车辆所属人:{示例:张三(绑定司机需先建立司机,司机名称与手机号码保持一致)}")
private String vehicleOwner;
/**
* 车辆所属人手机号
*/
@ColumnWidth(100)
@ExcelProperty(value = "车辆所属人手机号:{示例:156xxxxxxxxx(绑定司机需与司机手机号一致)}")
private String vehicleOwnerPhone;
/**
* 车辆所属人身份证号
*/
@ColumnWidth(65)
@ExcelProperty("车辆所属人身份证号::{示例:510100xxxxxxxxxxxx}")
private String vehicleOwnerCard;
/**
* 品牌型号
*/
@ColumnWidth(20)
@ExcelProperty("品牌型号")
private String vehicleBrand;
/**
* 车辆代号
*/
@ColumnWidth(20)
@ExcelProperty("车辆代号")
private String vehicleCode;
/**
* 发动机型号
*/
@ColumnWidth(20)
@ExcelProperty("发动机型号")
private String engineCode;
/**
* 到期时间
*/
@ColumnWidth(38)
@ExcelProperty(value = "到期时间:{示例:2023/2/28}")
private String expirationTime;
/**
* 道路运输证号
*/
@ColumnWidth(20)
@ExcelProperty("道路运输证号")
private String roadTransport;
/**
* 经营许可证号
*/
@ColumnWidth(20)
@ExcelProperty("经营许可证号")
private String businessLicense;
/**
* 车辆所属单位
*/
@ColumnWidth(40)
@ExcelProperty(value = "车辆所属单位")
private String vehicleUnit;
/**
* 车辆所属单位电话
*/
@ColumnWidth(55)
@ExcelProperty(value = "车辆所属单位电话:{示例:156xxxxxxxxx}")
private String vehicleUnitPhone;
/**
* 关联承运商Id
*/
@ColumnWidth(20)
@ExcelProperty("关联承运商Id")
@ExcelIgnore
private Long carrierId;
/**
* 关联承运商Id
*/
@ColumnWidth(50)
@ExcelProperty("承运商名称")
private String carrierName;
/**
* 车辆年审时间
*/
@ColumnWidth(50)
@ExcelProperty("车辆年审时间:{示例:2023/2/28}")
private String reviewTime;
/**
* 车辆年审有效期
*/
@ColumnWidth(20)
@ExcelProperty("车辆年审有效期")
private Integer reviewValidity;
/**
* 车辆保险开始时间
*/
@ColumnWidth(50)
@ExcelProperty("车辆保险开始时间:{示例:2023/2/28}")
private String insuranceStartTime;
/**
* 车辆保险结束时间
*/
@ColumnWidth(50)
@ExcelProperty("车辆保险结束时间:{示例:2023/2/28}")
private String insuranceEndTime;
/**
* 有无车身广告
*/
@ColumnWidth(20)
@ExcelProperty("有无车身广告")
private String bodyAdvertising;
/**
* 车身广告跟新时间
*/
@ColumnWidth(50)
@ExcelProperty("车身广告更新时间:{示例:2023/2/28}")
private String advertisementsNewTimes;
/**
* 是否有GPS;1-没有,2-
*/
@ColumnWidth(35)
@ExcelProperty("是否有GPS;1-没有,2-有")
private String withGps;
/**
* GPS服务商
*/
@ColumnWidth(20)
@ExcelProperty("GPS服务商")
private String gpsServiceProvider;
/**
* GPS型号
*/
@ColumnWidth(20)
@ExcelProperty("GPS型号")
private String gpsModel;
/**
* 备注
*/
@ColumnWidth(100)
@ExcelProperty("备注")
private String notes;
// /**
// * 预留1
// */
// @ColumnWidth(20)
// @ExcelProperty("预留1")
// private String reserve1;
// /**
// * 预留2
// */
// @ColumnWidth(20)
// @ExcelProperty("预留2")
// private String reserve2;
// /**
// * 预留3
// */
// @ColumnWidth(20)
// @ExcelProperty("预留3")
// private String reserve3;
// /**
// * 预留4
// */
// @ColumnWidth(20)
// @ExcelProperty("预留4")
// private String reserve4;
// /**
// * 预留5
// */
// @ColumnWidth(20)
// @ExcelProperty("预留5")
// private String reserve5;
}

35
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImporter.java

@ -0,0 +1,35 @@
package com.logpm.basicdata.excel;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
import com.logpm.basicdata.service.IBasicdataVehicleService;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import java.util.List;
/**
* @program: LogisticsPlatform-Service
* @description:
* @author: lmy
* @create: 2023-08-09 10:26
**/
@RequiredArgsConstructor
public class BasicdataVehicleImporter implements ExcelImporter<BasicdataVehicleImportExcel> {
private final IBasicdataVehicleService service;
/**
* @param data
*/
@Override
public void save(List<BasicdataVehicleImportExcel> data) {
service.importDriverArtery(data);
}
}

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java

@ -60,4 +60,13 @@ public interface BasicdataDriverArteryMapper extends BaseMapper<BasicdataDriverA
List<BasicdataDriverArteryEntity> findDriverListByName(@Param("driverName") String driverName);
void updateIsdeletedByPhone(@Param("phone") String phone);
/**
* 查询司机信息
* @param vehicleOwner
* @param vehicleOwnerPhone
* @return
*/
BasicdataDriverArteryEntity findDriverListByPhone(@Param("name") String vehicleOwner,@Param("phone") String vehicleOwnerPhone);
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml

@ -163,6 +163,10 @@
where `name` like concat('%',#{driverName},'%')
limit 10
</select>
<select id="findDriverListByPhone" resultType="com.logpm.basicdata.entity.BasicdataDriverArteryEntity">
SELECT id,name,bind_vehicle FROM logpm_basicdata_driver_artery WHERE name = #{name} AND phone = #{phone}
</select>
</mapper>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java

@ -51,7 +51,7 @@ public interface BasicdataVehicleMapper extends BaseMapper<BasicdataVehicleEntit
* @param queryWrapper
* @return
*/
List<BasicdataVehicleExcel> exportBasicdataVehicle(@Param("ew") Wrapper<BasicdataVehicleEntity> queryWrapper);
List<BasicdataVehicleExcel> exportBasicdataVehicle(@Param("ids") List<Long> ids);
List<String> selectPhotoBymasterId(Long id);
/**

67
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml

@ -159,7 +159,72 @@
<select id="exportBasicdataVehicle" resultType="com.logpm.basicdata.excel.BasicdataVehicleExcel">
SELECT * FROM logpm_basicdata_vehicle ${ew.customSqlSegment}
SELECT
lbc.vehicle_nub AS vehicleNub,
lbc.vehicle_source AS vehicleSource,
lbc.is_head AS isHead,
lbc.trailer_type AS trailerType,
lbc.vehicle_model AS vehicleModel,
lbc.car_type AS carType,
lbc.vehicle_commander AS vehicleCommander,
lbc.vehicle_height AS vehicleHeight,
lbc.payment_method AS paymentMethod,
lbc.approved_volume AS approvedVolume,
lbc.license_plate_color AS licensePlateColor,
lbc.vehicle_color AS vehicleColor,
lbc.energy_type AS energyType,
lbc.license_plate_type AS licensePlateType,
lbc.notes AS notes,
GROUP_CONCAT(DISTINCT lbda.name) AS vehicleOwner,
lbc.vehicle_brand ASvehicleBrand,
lbc.vehicle_code AS vehicleCode,
lbc.engine_code AS engineCode,
lbc.vehicle_quality AS vehicleQuality,
lbc.curb_weight AS curbWeight,
lbc.load_mass AS loadMass,
lbc.outer_width AS outerWidth,
lbc.expiration_time AS expirationTime,
lbc.road_transport AS roadTransport,
lbc.business_license AS businessLicense,
lbc.vehicle_unit AS vehicleUnit,
lbc.vehicle_unit_phone AS vehicleUnitPhone,
GROUP_CONCAT(DISTINCT lbda.phone) AS vehicleOwnerPhone,
lbc.vehicle_owner_card AS vehicleOwnerCard,
lbc.driving_license_photo,
lbc.driving_license_photo_back,
lbc.license_photo,
lbc.vehicle_photo,
lbc.vehicle_rear_photo,
lbc.road_transport_photo,
lbc.vehicle_people_photo,
lbc.insurance_card_photo,
lbc.carrier_id,
lbc.review_time AS reviewTime,
lbc.review_validity AS reviewValidity,
lbc.insurance_start_time AS insuranceStartTime,
lbc.insurance_end_time AS insuranceEndTime,
lbc.body_advertising AS bodyAdvertising,
lbc.advertisements_new_times AS advertisementsNewTimes,
lbc.vehicle_parking_company AS vehicleParkingCompany,
lbc.with_gps AS withGps,
lbc.gps_service_provider AS gpsServiceProvider,
lbc.gps_model AS gpsModel,
lbc.carrier_name AS carrierName
FROM
logpm_basicdata_vehicle AS lbc
LEFT JOIN logpm_basicdata_drivermiddle AS lbd ON lbc.id = lbd.brand_id
LEFT JOIN logpm_basicdata_driver_artery AS lbda ON lbd.driver_id = lbda.id
<where>
is_deleted = 0
<if test="ids != null and ids != ''">
and id in
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
GROUP BY
lbc.id
</select>
<select id="selectPhotoBymasterId" resultType="java.lang.String">
SELECT

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java

@ -21,6 +21,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.BasicdataVehicleImportExcel;
import com.logpm.basicdata.vo.BasicdataVehicleVO;
import org.springblade.core.mp.base.BaseService;
@ -46,10 +47,10 @@ public interface IBasicdataVehicleService extends BaseService<BasicdataVehicleEn
/**
* 导出数据
*
* @param queryWrapper
* @param ids
* @return
*/
List<BasicdataVehicleExcel> exportBasicdataVehicle(Wrapper<BasicdataVehicleEntity> queryWrapper);
List<BasicdataVehicleExcel> exportBasicdataVehicle(String ids);
/**
* 查询历史照片
*
@ -86,4 +87,9 @@ public interface IBasicdataVehicleService extends BaseService<BasicdataVehicleEn
List<BasicdataVehicleEntity> findCarListByName(String carNumber);
/**
* 车辆信息导入
* @param data
*/
void importDriverArtery(List<BasicdataVehicleImportExcel> data);
}

110
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java

@ -16,16 +16,21 @@
*/
package com.logpm.basicdata.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.entity.BasicDelineMiddleEntity;
import com.logpm.basicdata.dto.BasicdataVehicleDTO;
import com.logpm.basicdata.entity.BasicdataCarrierEntity;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
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.mapper.BasicdataDriverArteryMapper;
import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper;
import com.logpm.basicdata.mapper.BasicdataVehicleMapper;
@ -34,10 +39,14 @@ import com.logpm.basicdata.service.IBasicdataVehicleService;
import com.logpm.basicdata.vo.BasicdataVehicleVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.utils.PhoneCheckUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
@ -69,11 +78,9 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
@Override
public List<BasicdataVehicleExcel> exportBasicdataVehicle(Wrapper<BasicdataVehicleEntity> queryWrapper) {
List<BasicdataVehicleExcel> basicdataVehicleList = baseMapper.exportBasicdataVehicle(queryWrapper);
//basicdataVehicleList.forEach(basicdataVehicle -> {
// basicdataVehicle.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataVehicle.getType()));
//});
public List<BasicdataVehicleExcel> exportBasicdataVehicle(String ids) {
List<BasicdataVehicleExcel> basicdataVehicleList = baseMapper.exportBasicdataVehicle(Func.toLongList(ids));
return basicdataVehicleList;
}
@ -151,4 +158,97 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
return baseMapper.findCarListByName(carNumber);
}
/**
* @param data
*/
@Override
@Transactional
public void importDriverArtery(List<BasicdataVehicleImportExcel> data) {
String method = "#############BasicdataVehicleServiceImpl.importDriverArtery";
log.info("车辆模板导入信息>>>>",data);
try {
boolean flag = false;
List<BasicdataDrivermiddleEntity>drivermiddleEntities = new ArrayList<>();
//对导入数据进行处理
for (BasicdataVehicleImportExcel datum : data) {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = null;
BasicdataVehicleEntity entity = this.getOne(Wrappers.<BasicdataVehicleEntity>query().lambda().eq(BasicdataVehicleEntity::getVehicleNub, datum.getVehicleNub()));
if (Func.isNotEmpty(entity)){
continue;
}
// if (Func.isNotBlank(datum.getDemonstrate())){
// //查询是否是模板示例
// if ("是".equals(datum.getDemonstrate())){
// continue;
// }
// }
//查询模板信息是否合法
//车牌号是否合法
if (Func.isEmpty(datum.getVehicleNub())){
//车牌号为空
throw new ServiceException("请填写车牌号!");
}
//查看是否填写了电话号码,如果填写了电话号码进行校验号码是否有效
if (Func.isNotEmpty(datum.getVehicleUnitPhone())){
//车辆所属单位电话校验
flag = PhoneCheckUtil.checkPhone(datum.getVehicleUnitPhone());
}
if (Func.isNotEmpty(datum.getVehicleOwnerPhone())){
//车辆所属人电话校验
flag = PhoneCheckUtil.checkPhone(datum.getVehicleOwnerPhone());
//进行关系司机绑定
//查询是否存在司机
if (!StringUtil.isBlank(datum.getVehicleOwner())){
BasicdataDriverArteryEntity driverArteryEntity = basicdataDriverArteryMapper.findDriverListByPhone(datum.getVehicleOwner().trim(),datum.getVehicleOwnerPhone().trim());
if (BeanUtil.isEmpty(driverArteryEntity)) {
log.info(method+ "查询到司机信息,进行绑定!>>>:{}",driverArteryEntity.getName());
log.info(method+ "查询到司机信息,进行绑定!>>>:{}",driverArteryEntity.getPhone());
//绑定用户
basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setDriverId(driverArteryEntity.getId());;
}
}
}
if (!flag){
throw new ServiceException("请填写正确手机号码!");
}
if (Func.isNotEmpty(datum.getCarrierName())){
//存在承运商,进行承运商的校验
//找到数据库内的承运商
List<BasicdataCarrierEntity> basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.<BasicdataCarrierEntity>lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName, datum.getCarrierName()));
if (ObjectUtils.isEmpty(basicdataCarrierEntities)) {
// log.error("未找到承运商");
// continue;
throw new ServiceException("未找到承运商!");
} else {
datum.setCarrierId(basicdataCarrierEntities.get(0).getId());
datum.setCarrierName(basicdataCarrierEntities.get(0).getCarrierName());
}
}
BasicdataVehicleEntity vehicleEntity = Func.copy(datum, BasicdataVehicleEntity.class);
vehicleEntity.setCarrierId(datum.getCarrierId().toString());
vehicleEntity.setInsuranceStartTime(datum.getInsuranceStartTime());
vehicleEntity.setInsuranceEndTime(datum.getInsuranceEndTime());
this.save(vehicleEntity);
if (Func.isNotEmpty(basicdataDrivermiddleEntity)){
basicdataDrivermiddleEntity.setBrandId(vehicleEntity.getId());
drivermiddleEntities.add(basicdataDrivermiddleEntity);
}
}
if (drivermiddleEntities.size() > 0){
basicdataDrivermiddleService.saveBatch(drivermiddleEntities);
}
}catch (Exception e){
throw new RuntimeException("导入失败");
}
}
}

Loading…
Cancel
Save