Browse Source

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

training
caoyizhong 1 year ago
parent
commit
9fac0fb89d
  1. 16
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java
  2. 30
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDriverArteryImporter.java
  3. 177
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDriverArteryImproterExcel.java
  4. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml
  5. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java
  6. 19
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java

16
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java

@ -23,6 +23,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.excel.BasicdataDriverArteryExcel;
import com.logpm.basicdata.excel.BasicdataDriverArteryImporter;
import com.logpm.basicdata.excel.BasicdataDriverArteryImproterExcel;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
import com.logpm.basicdata.service.IBasicdataVehicleService;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
@ -45,6 +47,7 @@ import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
@ -207,4 +210,17 @@ public class BasicdataDriverArteryController extends BladeController {
ExcelUtil.export(response, "司机信息表数据" + DateUtil.time(), "司机信息表数据表", list, BasicdataDriverArteryExcel.class);
}
/**
* 导入司机信息
*/
@PostMapping("import-stockArticle")
@ApiOperationSupport(order = 12)
@ApiOperation(value = "导入司机信息", notes = "传入excel")
public R importDriverArteryEntry(MultipartFile file) {
log.info("传入>>>>>>>{}",file);
BasicdataDriverArteryImporter basicdataDriverArteryImporter = new BasicdataDriverArteryImporter(basicdataDriverArteryService);
ExcelUtil.save(file,basicdataDriverArteryImporter, BasicdataDriverArteryImproterExcel.class);
return R.success("操作成功");
}
}

30
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDriverArteryImporter.java

@ -0,0 +1,30 @@
package com.logpm.basicdata.excel;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
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 BasicdataDriverArteryImporter implements ExcelImporter<BasicdataDriverArteryImproterExcel> {
private final IBasicdataDriverArteryService service;
@Override
public void save(List<BasicdataDriverArteryImproterExcel> data) {
service.importDriverArtery(data);
}
}

177
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDriverArteryImproterExcel.java

@ -0,0 +1,177 @@
/*
* 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 java.io.Serializable;
/**
* 司机信息表 Excel实体类
*
* @author lmy
* @since 2023-05-15
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BasicdataDriverArteryImproterExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 司机姓名
*/
@ColumnWidth(40)
@ExcelProperty("司机姓名")
private String name;
/**
* 司机手机号码
*/
@ColumnWidth(40)
@ExcelProperty("司机手机号码")
private String phone;
/**
* 车辆信息
*/
@ColumnWidth(40)
@ExcelProperty("车辆信息")
private String bindVehicles;
/**
* 司机类型;1-自有,2-加盟,3-外调,4-临调
*/
@ColumnWidth(40)
@ExcelProperty("司机类型;1-自有,2-加盟,3-外调,4-临调")
private Integer type;
/**
* 职务类型;1-干线,2-配送
*/
@ColumnWidth(40)
@ExcelProperty("职务类型;1-干线,2-配送")
private Integer jobType;
/**
* 准驾车型;1-A1,2-A2,3-A3,4-B1,5-B2,6-C1,7-C2
*/
@ColumnWidth(40)
@ExcelProperty("准驾车型;1-A1,2-A2,3-A3,4-B1,5-B2,6-C1,7-C2")
private Integer drivingType;
/**
* 合同开始时间
*/
@ColumnWidth(40)
@ExcelProperty("合同开始时间")
private String contractStartTime;
/**
* 合同结束时间
*/
@ColumnWidth(40)
@ExcelProperty("合同结束时间")
private String contractEndTime;
/**
* 身份证号
*/
@ColumnWidth(40)
@ExcelProperty("身份证号")
private String idCard;
/**
* 性别
*/
@ColumnWidth(40)
@ExcelProperty("性别")
private Integer gender;
/**
* 居住地址
*/
@ColumnWidth(40)
@ExcelProperty("居住地址")
private String residentialAddress;
/**
* 银行类型;1-工商银行,2-建设银行,3-农业银行,4-邮政银行,5-中国银行,6-交通银行,7-其他
*/
@ColumnWidth(40)
@ExcelProperty("银行类型;1-工商银行,2-建设银行,3-农业银行,4-邮政银行,5-中国银行,6-交通银行,7-其他")
private Integer bankType;
/**
* 银行卡号
*/
@ColumnWidth(40)
@ExcelProperty("银行卡号")
private String bankCardNub;
/**
* 驾驶证号
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证号")
private String driverLicenseNub;
/**
* 驾驶证发证机关
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证发证机关")
private String driverLicenseOrgan;
/**
* 驾驶证起始日期
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证起始日期")
private String driverLicenseStartTime;
/**
* 驾驶证到期日期
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证到期日期")
private String driverLicenseEndTime;
/**
* 从业资格证编号
*/
@ColumnWidth(40)
@ExcelProperty("从业资格证编号")
private String employeeQualificationNub;
/**
* 道路经营许可证号
*/
@ColumnWidth(40)
@ExcelProperty("道路经营许可证号")
private String roadOperationLicenseNub;
/**
* 运输协议
*/
@ColumnWidth(40)
@ExcelProperty("运输协议")
private String transportationAgreement;
/**
* 备注
*/
@ColumnWidth(40)
@ExcelProperty("备注")
private String notes;
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml

@ -378,9 +378,9 @@
ldsa.description_goods descriptionGoods,
CONCAT(ldsa.consignee_person, '(', ldsa.consignee_mobile, ')') consigneePerson,
CONCAT(lwug.position_code, '(', SUM(lwug.num), ')') positionInfo,
GROUP_CONCAT( lwtg.tray_code SEPARATOR ',' ) trayCode,
GROUP_CONCAT( lwug.create_user SEPARATOR ',' ) upUser,
GROUP_CONCAT( lwug.create_time SEPARATOR ',' ) upTime,
GROUP_CONCAT( lwtg.tray_code SEPARATOR '' ) trayCode,
GROUP_CONCAT( lwug.create_user SEPARATOR '' ) upUser,
GROUP_CONCAT( lwug.create_time SEPARATOR '、') upTime,
SUM(lwug.num) num
FROM logpm_distribution_stock_article ldsa
JOIN logpm_warehouse_updown_goods lwug ON lwug.association_id = ldsa.id

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

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.excel.BasicdataDriverArteryExcel;
import com.logpm.basicdata.excel.BasicdataDriverArteryImproterExcel;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
import org.springblade.core.mp.base.BaseService;
@ -68,4 +69,5 @@ public interface IBasicdataDriverArteryService extends BaseService<BasicdataDriv
*/
List<BasicdataDriverArteryVO> getDriverList();
void importDriverArtery(List<BasicdataDriverArteryImproterExcel> data);
}

19
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java

@ -22,11 +22,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.entity.BasicDelineMiddleEntity;
import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.excel.BasicdataDriverArteryExcel;
import com.logpm.basicdata.excel.BasicdataDriverArteryImproterExcel;
import com.logpm.basicdata.excel.BasicdataGoodsAreaExcel;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper;
import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper;
@ -45,6 +44,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -131,4 +131,15 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
}
return basicdataDriverArteryVOS;
}
@Override
public void importDriverArtery(List<BasicdataDriverArteryImproterExcel> data) {
ArrayList<BasicdataDriverArteryEntity> arrayList = new ArrayList<>();
for (BasicdataDriverArteryImproterExcel datum : data) {
BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class);
log.info("复制后>>>>>>>>>>>>{}",copy);
arrayList.add(copy);
}
this.saveBatch(arrayList);
}
}

Loading…
Cancel
Save