package com.itheima.pinda.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.pinda.DTO.transportline.TransportLineDto;
import com.itheima.pinda.DTO.transportline.TransportLineTypeDto;
import com.itheima.pinda.DTO.transportline.TransportTripsDto;
import com.itheima.pinda.DTO.transportline.TransportTripsTruckDriverDto;
import com.itheima.pinda.authority.api.OrgApi;
import com.itheima.pinda.authority.api.UserApi;
import com.itheima.pinda.authority.entity.auth.User;
import com.itheima.pinda.authority.entity.core.Org;
import com.itheima.pinda.authority.enumeration.common.StaticStation;
import com.itheima.pinda.authority.enumeration.core.OrgType;
import com.itheima.pinda.base.R;
import com.itheima.pinda.common.utils.Constant;
import com.itheima.pinda.common.utils.PageResponse;
import com.itheima.pinda.common.utils.Result;
import com.itheima.pinda.DTO.angency.FleetDto;
import com.itheima.pinda.DTO.base.GoodsTypeDto;
import com.itheima.pinda.DTO.truck.TruckDto;
import com.itheima.pinda.DTO.truck.TruckLicenseDto;
import com.itheima.pinda.DTO.truck.TruckTypeDto;
import com.itheima.pinda.DTO.user.TruckDriverDto;
import com.itheima.pinda.DTO.user.TruckDriverLicenseDto;
import com.itheima.pinda.feign.agency.FleetFeign;
import com.itheima.pinda.feign.common.GoodsTypeFeign;
import com.itheima.pinda.feign.transportline.TransportLineFeign;
import com.itheima.pinda.feign.transportline.TransportLineTypeFeign;
import com.itheima.pinda.feign.transportline.TransportTripsFeign;
import com.itheima.pinda.feign.truck.TruckFeign;
import com.itheima.pinda.feign.truck.TruckLicenseFeign;
import com.itheima.pinda.feign.truck.TruckTypeFeign;
import com.itheima.pinda.feign.user.DriverFeign;
import com.itheima.pinda.future.PdCompletableFuture;
import com.itheima.pinda.util.BeanUtil;
import com.itheima.pinda.vo.base.angency.AgencySimpleVo;
import com.itheima.pinda.vo.base.angency.AgencyVo;
import com.itheima.pinda.vo.base.businessHall.GoodsTypeVo;
import com.itheima.pinda.vo.base.transforCenter.business.*;
import com.itheima.pinda.vo.base.userCenter.SysUserVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.java.Log;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
* 转运中心管理-业务信息管理
*/
@RestController
@RequestMapping("transfor-center/bussiness")
@Api(tags = "转运中心管理-业务信息管理")
@Log
public class TransforCenterBusinessController {
@Autowired
private TruckTypeFeign truckTypeFeign;
@Autowired
private GoodsTypeFeign goodsTypeFeign;
@Autowired
private TransportLineTypeFeign transportLineTypeFeign;
@Autowired
private FleetFeign fleetFeign;
@Autowired
private OrgApi orgApi;
@Autowired
private TruckFeign truckFeign;
@Autowired
private TruckLicenseFeign truckLicenseFeign;
@Autowired
private TransportLineFeign transportLineFeign;
@Autowired
private TransportTripsFeign transportTripsFeign;
@Autowired
private UserApi userApi;
@Autowired
private DriverFeign driverFeign;
@ApiOperation(value = "添加车辆类型")
@PostMapping("/truckType")
public TruckTypeVo saveTruckType(@RequestBody TruckTypeVo vo) {
TruckTypeDto dto = new TruckTypeDto();
BeanUtils.copyProperties(vo, dto);
if (vo.getGoodsTypes() != null) {
dto.setGoodsTypeIds(vo.getGoodsTypes().stream().map(goodsTypeVo -> goodsTypeVo.getId()).collect(Collectors.toList()));
}
TruckTypeDto resultDto = truckTypeFeign.saveTruckType(dto);
BeanUtils.copyProperties(resultDto, vo);
return vo;
}
@ApiOperation(value = "更新车辆类型")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "车辆类型id", required = true, example = "1", paramType = "{path}")
})
@PutMapping("/truckType/{id}")
public TruckTypeVo updateTruckType(@PathVariable(name = "id") String id, @RequestBody TruckTypeVo vo) {
vo.setId(id);
TruckTypeDto dto = new TruckTypeDto();
BeanUtils.copyProperties(vo, dto);
if (vo.getGoodsTypes() != null) {
dto.setGoodsTypeIds(vo.getGoodsTypes().stream().map(goodsTypeVo -> goodsTypeVo.getId()).collect(Collectors.toList()));
}
TruckTypeDto resultDto = truckTypeFeign.update(id, dto);
BeanUtils.copyProperties(resultDto, vo);
return vo;
}
@ApiOperation(value = "获取车辆类型分页数据")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "页码", required = true, example = "1"),
@ApiImplicitParam(name = "pageSize", value = "页尺寸", required = true, example = "10"),
@ApiImplicitParam(name = "name", value = "车辆类型名称"),
@ApiImplicitParam(name = "allowableLoad", value = "车型载重"),
@ApiImplicitParam(name = "allowableVolume", value = "车型体积")
})
@GetMapping("/truckType/page")
public PageResponse<TruckTypeVo> findTruckTypeByPage(@RequestParam(name = "page") Integer page,
@RequestParam(name = "pageSize") Integer pageSize,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "allowableLoad", required = false) BigDecimal allowableLoad,
@RequestParam(name = "allowableVolume", required = false) BigDecimal allowableVolume) {
// TODO: 2020/1/8 载重与体积查询条件,是否使用基于该值的上下区间浮动查询
PageResponse<TruckTypeDto> truckTypeDtoPage = truckTypeFeign.findByPage(page, pageSize, name, allowableLoad, allowableVolume);
Set<String> goodsTypeSet = new HashSet<>();
List<TruckTypeDto> truckTypeDtoList = truckTypeDtoPage.getItems();
truckTypeDtoList.forEach(dto -> {
if (dto.getGoodsTypeIds() != null) {
goodsTypeSet.addAll(dto.getGoodsTypeIds());
}
});
//处理货物类型数据
CompletableFuture<Map> goodsTypeFuture = null;
if (goodsTypeSet.size() > 0) {
goodsTypeFuture = PdCompletableFuture.goodsTypeMapFuture(goodsTypeFeign, goodsTypeSet);
CompletableFuture.allOf(goodsTypeFuture).join();
}
CompletableFuture<Map> finalGoodsTypeFuture = goodsTypeFuture;
List<TruckTypeVo> truckTypeVoList = truckTypeDtoList.stream().map(dto -> {
TruckTypeVo vo = new TruckTypeVo();
BeanUtils.copyProperties(dto, vo);
try {
if (dto.getGoodsTypeIds() != null) {
List<GoodsTypeVo> goodsTypeVoList = new ArrayList<>();
for (String goodsTypeId : dto.getGoodsTypeIds()) {
goodsTypeVoList.add(finalGoodsTypeFuture == null ? null : (GoodsTypeVo) finalGoodsTypeFuture.get().get(goodsTypeId));
}
vo.setGoodsTypes(goodsTypeVoList);
}
} catch (Exception e) {
// TODO: 2020/1/2 此处异常处理依赖于业务是否为弱关系,如强关系,则返回错误
e.printStackTrace();
}
return vo;
}).collect(Collectors.toList());
return PageResponse.<TruckTypeVo>builder().items(truckTypeVoList).page(page).pagesize(page
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本品达物流TMS运输管理系统基于Java开发,包含574个文件,包括Java源代码、XML配置文件、YAML配置文件、PNG图片、Dockerfile、LICENSE文件、Markdown文档、JPG图片、TXT文本文件和DRL规则文件。系统实现了运输作业的全流程管理,包括订单管理、配载作业、调度分配、行车管理、GPS车辆定位系统、车辆管理、线路管理、车次管理、人员管理、数据报表和基本信息维护等功能,界面友好,功能完善,适合用于运输公司的运输管理。
资源推荐
资源详情
资源评论
收起资源包目录
基于Java的品达物流TMS运输管理系统设计源码 (579个子文件)
Dockerfile 222B
orderAmountCalc.drl 3KB
TransforCenterBusinessController.java 65KB
MailingController.java 49KB
JedisUtil.java 45KB
CargoController.java 29KB
CourierController.java 28KB
BeanUtil.java 21KB
TaskOrderClassifyServiceImpl.java 21KB
HttpRequestUtil.java 18KB
BusinessHallController.java 16KB
TaskRoutePlanningServiceImpl.java 16KB
AgencyController.java 14KB
PdCompletableFuture.java 13KB
ScheduleJobLogController.java 11KB
EntCoordSyncJob.java 9KB
TaskTripsSchedulingServiceImpl.java 9KB
OrderController.java 9KB
GoodsTypeController.java 9KB
ObjectAccessUtils.java 9KB
ObjectAccessUtils.java 9KB
ConfigurationSupport.java 9KB
ConfigurationSupport.java 9KB
ConfigurationSupport.java 9KB
ConfigurationSupport.java 9KB
BusinessOperationServiceImpl.java 9KB
OrderServiceImpl.java 8KB
CommonController.java 8KB
ConfigurationSupport.java 8KB
DruidServiceImpl.java 8KB
TransportTaskController.java 8KB
ConfigurationSupport.java 8KB
TruckTypeController.java 7KB
TransportOrderController.java 7KB
AddressBookController.java 7KB
TransportOrderController.java 6KB
AnalysisRoutePlanningDTO.java 6KB
CargoTranTaskDTO.java 6KB
ScheduleJobServiceImpl.java 6KB
BeanUtil.java 6KB
TransportLineController.java 6KB
PdCompletableFuture.java 6KB
IdWorker.java 6KB
IdCardUtils.java 6KB
WebManagerApplication.java 6KB
ScopeController.java 5KB
PickupDispatchTaskController.java 5KB
TransportTaskController.java 5KB
DriverController.java 5KB
ScheduleJobController.java 5KB
FieldAccessDescriptor.java 5KB
PickupDispatchDTO.java 5KB
FieldAccessDescriptor.java 5KB
TransportLineTypeController.java 5KB
TransportTripsController.java 5KB
UserController.java 5KB
AgencyController.java 5KB
BaiduMapUtils.java 5KB
PickupDispatchDetailDTO.java 5KB
ScheduleUtils.java 5KB
OrderController.java 5KB
TruckController.java 5KB
PdCompletableFuture.java 5KB
CustomerOrderDTO.java 4KB
FleetController.java 4KB
OrderLocusController.java 4KB
PdCompletableFuture.java 4KB
Constant.java 4KB
PickupDispatchTaskController.java 4KB
PropertyGenius.java 4KB
TaskTransportVo.java 4KB
DriverJobController.java 4KB
TransportOrderTaskServiceImpl.java 4KB
AddressBookController.java 4KB
OrderLocusController.java 4KB
CargoController.java 4KB
TaskPickupDispatchServiceImpl.java 4KB
CacheLineServiceImpl.java 4KB
PdTransportTripsTruckDriverServiceImpl.java 4KB
J2cacheController.java 4KB
TruckLocationController.java 4KB
TaskTransportDTO.java 3KB
OrderVo.java 3KB
CargoController.java 3KB
PdTransportLineServiceImpl.java 3KB
PdTruckDriverServiceImpl.java 3KB
NettyServerHandler.java 3KB
WebManagerServiceImpl.java 3KB
CacheMethodInterceptor.java 3KB
AbstractCacheAnnotationProcessor.java 3KB
PdTransportLineTypeServiceImpl.java 3KB
PdTruckServiceImpl.java 3KB
MetaObject.java 3KB
TransportOrderServiceImpl.java 3KB
UserCenterController.java 3KB
TaskTransportServiceImpl.java 3KB
DriverJobServiceImpl.java 3KB
DriverJobController.java 3KB
TaskPickupDispatchDTO.java 3KB
CachesAnnotationProcessor.java 3KB
共 579 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
沐知全栈开发
- 粉丝: 5810
- 资源: 5217
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 计算机网络四次实验报告
- (175549404)基于微信小程序的十二神鹿点餐(外卖小程序)(毕业设计,包括数据库,源码,教程).zip
- (179941432)基于MATLAB车牌识别系统【GUI含界面】.zip
- (179941434)基于MATLAB车牌识别系统【含界面GUI】.zip
- (178021462)基于Javaweb+ssm的医院在线挂号系统的设计与实现.zip
- (178047214)基于springboot图书管理系统.zip
- 张郅奇 的Python学习过程
- (23775420)欧姆龙PLC CP1H-E CP1L-E CJ2M CP1E 以太网通讯.zip
- (174590622)计算机课程设计-IP数据包解析
- (175550824)泛海三江全系调试软件PCSet-All2.0.3 1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功