Commit e7b10a615d0b359b0669bf0540e78a818c248e34
1 parent
b5b4731b
根据公司展示车辆
Showing
13 changed files
with
92 additions
and
29 deletions
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMatchHandlerMapper.java
| ... | ... | @@ -7,6 +7,7 @@ import com.trash.garbage.pojo.vo.DispatchDriverVo; |
| 7 | 7 | import org.apache.ibatis.annotations.Param; |
| 8 | 8 | |
| 9 | 9 | import java.util.List; |
| 10 | +import java.util.Set; | |
| 10 | 11 | |
| 11 | 12 | /** |
| 12 | 13 | * @author 20412 |
| ... | ... | @@ -16,7 +17,7 @@ import java.util.List; |
| 16 | 17 | */ |
| 17 | 18 | public interface GarOrderMatchHandlerMapper extends BaseMapper<GarOrderMatchHandler> { |
| 18 | 19 | |
| 19 | - List<DispatchDriverVo> queryDriverListWithDispatchStatus(@Param("orderId") String orderId, @Param("companyId") Long id); | |
| 20 | + List<DispatchDriverVo> queryDriverListWithDispatchStatus(@Param("orderId") String orderId, @Param("companyId") Long id,@Param("containerVolumees") Set<String> containerVolumees); | |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderCar.java
| 1 | 1 | package com.trash.garbage.pojo.domain; |
| 2 | 2 | |
| 3 | -import com.baomidou.mybatisplus.annotation.*; | |
| 3 | +import com.baomidou.mybatisplus.annotation.FieldFill; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.Data; | |
| 4 | 8 | |
| 5 | 9 | import java.io.Serializable; |
| 6 | 10 | import java.util.Date; |
| 7 | -import lombok.Data; | |
| 8 | 11 | |
| 9 | 12 | /** |
| 10 | 13 | * 订单车辆信息 |
| ... | ... | @@ -57,6 +60,10 @@ public class GarOrderCar implements Serializable { |
| 57 | 60 | */ |
| 58 | 61 | @TableField(fill = FieldFill.INSERT_UPDATE) |
| 59 | 62 | private String garUpdateBy; |
| 63 | + /**车辆ID*/ | |
| 64 | + private Integer carId; | |
| 65 | + /**车辆容积*/ | |
| 66 | + private String containerVolume; | |
| 60 | 67 | |
| 61 | 68 | /** |
| 62 | 69 | * |
| ... | ... | @@ -66,6 +73,8 @@ public class GarOrderCar implements Serializable { |
| 66 | 73 | @TableField(exist = false) |
| 67 | 74 | private static final long serialVersionUID = 1L; |
| 68 | 75 | |
| 76 | + | |
| 77 | + | |
| 69 | 78 | public String getGarId() { |
| 70 | 79 | return garId; |
| 71 | 80 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderDto.java
| ... | ... | @@ -106,6 +106,8 @@ public class OrderDto { |
| 106 | 106 | private Integer id; |
| 107 | 107 | private String garOrderCarType; |
| 108 | 108 | |
| 109 | + private String containerVolume; | |
| 110 | + | |
| 109 | 111 | public Integer getGarOrderCarNumber() { |
| 110 | 112 | return garOrderCarNumber; |
| 111 | 113 | } |
| ... | ... | @@ -141,8 +143,13 @@ public class OrderDto { |
| 141 | 143 | this.id = id; |
| 142 | 144 | } |
| 143 | 145 | |
| 146 | + public String getContainerVolume() { | |
| 147 | + return containerVolume; | |
| 148 | + } | |
| 144 | 149 | |
| 145 | - | |
| 150 | + public void setContainerVolume(String containerVolume) { | |
| 151 | + this.containerVolume = containerVolume; | |
| 152 | + } | |
| 146 | 153 | } |
| 147 | 154 | |
| 148 | 155 | public List<CarInfo> getGarCarInfoList() { | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderCarService.java
| 1 | 1 | package com.trash.garbage.service; |
| 2 | 2 | |
| 3 | -import com.trash.garbage.pojo.domain.GarOrderCar; | |
| 4 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | +import com.trash.garbage.pojo.domain.GarOrderCar; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 5 | 7 | |
| 6 | 8 | /** |
| 7 | 9 | * @author 20412 |
| ... | ... | @@ -9,5 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService; |
| 9 | 11 | * @createDate 2024-01-09 14:26:09 |
| 10 | 12 | */ |
| 11 | 13 | public interface GarOrderCarService extends IService<GarOrderCar> { |
| 12 | - | |
| 14 | + List<GarOrderCar> queryByOrderId(String orderId); | |
| 13 | 15 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderMatchHandlerService.java
| 1 | 1 | package com.trash.garbage.service; |
| 2 | 2 | |
| 3 | -import com.trash.garbage.pojo.domain.GarOrderMatchHandler; | |
| 4 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | +import com.trash.garbage.pojo.domain.GarOrderMatchHandler; | |
| 5 | 5 | import com.trash.garbage.pojo.vo.DispatchDriverVo; |
| 6 | -import org.apache.ibatis.annotations.Param; | |
| 7 | 6 | |
| 8 | 7 | import java.util.List; |
| 8 | +import java.util.Set; | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * @author 20412 |
| ... | ... | @@ -14,5 +14,5 @@ import java.util.List; |
| 14 | 14 | */ |
| 15 | 15 | public interface GarOrderMatchHandlerService extends IService<GarOrderMatchHandler> { |
| 16 | 16 | |
| 17 | - List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, Long companyId); | |
| 17 | + List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, Long companyId, Set<String> containerVolumees); | |
| 18 | 18 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderCarServiceImpl.java
| 1 | 1 | package com.trash.garbage.service.impl; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 3 | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 4 | 5 | import com.trash.garbage.pojo.domain.GarOrderCar; |
| 5 | 6 | import com.trash.garbage.service.GarOrderCarService; |
| 6 | 7 | import com.trash.garbage.mapper.GarOrderCarMapper; |
| 7 | 8 | import org.springframework.stereotype.Service; |
| 8 | 9 | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 9 | 12 | /** |
| 10 | -* @author 20412 | |
| 11 | -* @description 针对表【gar_order_car(订单车辆信息)】的数据库操作Service实现 | |
| 12 | -* @createDate 2024-01-09 14:26:09 | |
| 13 | -*/ | |
| 13 | + * @author 20412 | |
| 14 | + * @description 针对表【gar_order_car(订单车辆信息)】的数据库操作Service实现 | |
| 15 | + * @createDate 2024-01-09 14:26:09 | |
| 16 | + */ | |
| 14 | 17 | @Service |
| 15 | 18 | public class GarOrderCarServiceImpl extends ServiceImpl<GarOrderCarMapper, GarOrderCar> |
| 16 | - implements GarOrderCarService{ | |
| 19 | + implements GarOrderCarService { | |
| 17 | 20 | |
| 21 | + @Override | |
| 22 | + public List<GarOrderCar> queryByOrderId(String orderId) { | |
| 23 | + LambdaQueryWrapper<GarOrderCar> wrapper = new LambdaQueryWrapper<>(); | |
| 24 | + wrapper.eq(GarOrderCar::getGarOrderId, orderId); | |
| 25 | + return list(wrapper); | |
| 26 | + } | |
| 18 | 27 | } |
| 19 | 28 | |
| 20 | 29 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderMatchHandlerServiceImpl.java
| ... | ... | @@ -8,6 +8,7 @@ import com.trash.garbage.service.GarOrderMatchHandlerService; |
| 8 | 8 | import org.springframework.stereotype.Service; |
| 9 | 9 | |
| 10 | 10 | import java.util.List; |
| 11 | +import java.util.Set; | |
| 11 | 12 | |
| 12 | 13 | /** |
| 13 | 14 | * @author 20412 |
| ... | ... | @@ -19,8 +20,8 @@ public class GarOrderMatchHandlerServiceImpl extends ServiceImpl<GarOrderMatchHa |
| 19 | 20 | implements GarOrderMatchHandlerService { |
| 20 | 21 | |
| 21 | 22 | @Override |
| 22 | - public List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, Long id) { | |
| 23 | - return baseMapper.queryDriverListWithDispatchStatus(orderId, id); | |
| 23 | + public List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, Long id, Set<String> containerVolumees) { | |
| 24 | + return baseMapper.queryDriverListWithDispatchStatus(orderId, id,containerVolumees); | |
| 24 | 25 | } |
| 25 | 26 | } |
| 26 | 27 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
| ... | ... | @@ -106,6 +106,8 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 106 | 106 | GarOrderCar car = new GarOrderCar(); |
| 107 | 107 | car.setGarOrderCarType(carInfo.getGarOrderCarType()); |
| 108 | 108 | car.setGarOrderId(order.getGarOrderId()); |
| 109 | + car.setCarId(carInfo.getId()); | |
| 110 | + car.setContainerVolume(carInfo.getContainerVolume()); | |
| 109 | 111 | car.setGarOrderCarUserType(GlobalStatus.GarOrderStatus.PLAN_CAR_TYPE.getValue()); |
| 110 | 112 | garOrderCars.add(car); |
| 111 | 113 | } |
| ... | ... | @@ -486,6 +488,8 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 486 | 488 | GarOrderCar car = new GarOrderCar(); |
| 487 | 489 | car.setGarOrderCarType(carInfo.getGarOrderCarType()); |
| 488 | 490 | car.setGarOrderId(dto.getGarOrderId()); |
| 491 | + car.setContainerVolume(carInfo.getContainerVolume()); | |
| 492 | + car.setCarId(carInfo.getId()); | |
| 489 | 493 | car.setGarOrderCarUserType(GlobalStatus.GarOrderStatus.REAL_CAR_TYPE.getValue()); |
| 490 | 494 | garOrderCars.add(car); |
| 491 | 495 | } |
| ... | ... | @@ -817,8 +821,18 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 817 | 821 | TransportationEnterprise enterprise = new TransportationEnterprise(); |
| 818 | 822 | enterprise.setServicePhone(tel); |
| 819 | 823 | List<TransportationEnterprise> enterprises = transportationEnterpriseService.selectTransportationEnterpriseList(enterprise); |
| 824 | + if(CollectionUtils.isEmpty(enterprises)){ | |
| 825 | + return Collections.emptyList(); | |
| 826 | + } | |
| 827 | + | |
| 828 | + List<GarOrderCar> garOrderCars = garOrderCarService.queryByOrderId(orderId); | |
| 829 | + if(CollectionUtils.isEmpty(garOrderCars)){ | |
| 830 | + return Collections.emptyList(); | |
| 831 | + } | |
| 832 | + | |
| 833 | + Set<String> containerVolumees = garOrderCars.stream().map(GarOrderCar::getContainerVolume).collect(Collectors.toSet()); | |
| 820 | 834 | // 选中的司机 |
| 821 | - List<DispatchDriverVo> voList = handlerService.queryDriverListWithDispatchStatus(orderId, enterprises.get(0).getId()); | |
| 835 | + List<DispatchDriverVo> voList = handlerService.queryDriverListWithDispatchStatus(orderId, enterprises.get(0).getId(),containerVolumees); | |
| 822 | 836 | return voList; |
| 823 | 837 | } |
| 824 | 838 | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderMatchHandlerMapper.xml
| ... | ... | @@ -58,6 +58,9 @@ |
| 58 | 58 | LEFT JOIN gar_order_match_handler gar ON gar.gar_order_handler_tel = driver.phoneNo |
| 59 | 59 | AND gar.gar_order_id = #{orderId} AND gar.gar_handler_car_code = car.car_code |
| 60 | 60 | WHERE |
| 61 | - driver.company_id = #{companyId} | |
| 61 | + driver.company_id = #{companyId} and container_volume in | |
| 62 | + <foreach collection="containerVolumees" item="item" open="(" close=")" separator=","> | |
| 63 | + #{item} | |
| 64 | + </foreach> | |
| 62 | 65 | </select> |
| 63 | 66 | </mapper> | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/mapper/CarInfoMapper.java
| 1 | 1 | package com.trash.carInfo.mapper; |
| 2 | 2 | |
| 3 | -import java.util.List; | |
| 4 | - | |
| 5 | 3 | import com.trash.carInfo.domain.CarDriverRelation; |
| 6 | 4 | import com.trash.carInfo.domain.CarInfo; |
| 7 | 5 | import com.trash.carInfo.domain.vo.CarInfoVo; |
| 6 | +import org.apache.ibatis.annotations.Param; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 8 | 9 | |
| 9 | 10 | /** |
| 10 | 11 | * 运输车辆管理Mapper接口 |
| ... | ... | @@ -30,6 +31,8 @@ public interface CarInfoMapper |
| 30 | 31 | */ |
| 31 | 32 | List<CarInfoVo> selectCarInfoList(CarInfoVo carInfo); |
| 32 | 33 | |
| 34 | + List<CarInfoVo> selectByCompanyId(@Param("companyId") Long companyId); | |
| 35 | + | |
| 33 | 36 | /** |
| 34 | 37 | * 新增运输车辆管理 |
| 35 | 38 | * | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/service/ICarInfoService.java
| 1 | 1 | package com.trash.carInfo.service; |
| 2 | 2 | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.util.List; | |
| 5 | 3 | import com.trash.carInfo.domain.CarInfo; |
| 6 | 4 | import com.trash.carInfo.domain.vo.CarInfoVo; |
| 7 | 5 | import org.springframework.web.multipart.MultipartFile; |
| 8 | 6 | |
| 7 | +import java.io.IOException; | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 9 | 10 | /** |
| 10 | 11 | * 运输车辆管理Service接口 |
| 11 | 12 | * |
| ... | ... | @@ -30,6 +31,8 @@ public interface ICarInfoService |
| 30 | 31 | */ |
| 31 | 32 | List<CarInfoVo> selectCarInfoList(CarInfoVo carInfo); |
| 32 | 33 | |
| 34 | + List<CarInfoVo> selectByCompanyId(Long companyId); | |
| 35 | + | |
| 33 | 36 | /** |
| 34 | 37 | * 新增运输车辆管理 |
| 35 | 38 | * | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/service/impl/CarInfoServiceImpl.java
| 1 | 1 | package com.trash.carInfo.service.impl; |
| 2 | 2 | |
| 3 | -import java.io.IOException; | |
| 4 | -import java.util.List; | |
| 5 | - | |
| 6 | 3 | import com.trash.carInfo.domain.CarDriverRelation; |
| 4 | +import com.trash.carInfo.domain.CarInfo; | |
| 7 | 5 | import com.trash.carInfo.domain.vo.CarInfoVo; |
| 6 | +import com.trash.carInfo.mapper.CarInfoMapper; | |
| 7 | +import com.trash.carInfo.service.ICarInfoService; | |
| 8 | 8 | import com.trash.common.config.trashConfig; |
| 9 | 9 | import com.trash.common.utils.DateUtils; |
| 10 | 10 | import com.trash.common.utils.SecurityUtils; |
| 11 | -import com.trash.enterprise.domain.TransportationEnterprise; | |
| 12 | 11 | import com.trash.enterprise.mapper.TransportationEnterpriseMapper; |
| 13 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 13 | import org.springframework.stereotype.Service; |
| 15 | -import com.trash.carInfo.mapper.CarInfoMapper; | |
| 16 | -import com.trash.carInfo.domain.CarInfo; | |
| 17 | -import com.trash.carInfo.service.ICarInfoService; | |
| 18 | 14 | import org.springframework.transaction.annotation.Transactional; |
| 19 | 15 | import org.springframework.web.multipart.MultipartFile; |
| 20 | 16 | |
| 17 | +import java.io.IOException; | |
| 18 | +import java.util.List; | |
| 19 | + | |
| 21 | 20 | import static com.trash.common.utils.file.FileUploadUtils.upload; |
| 22 | 21 | |
| 23 | 22 | /** |
| ... | ... | @@ -59,6 +58,11 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 59 | 58 | return carInfoMapper.selectCarInfoList(carInfo); |
| 60 | 59 | } |
| 61 | 60 | |
| 61 | + @Override | |
| 62 | + public List<CarInfoVo> selectByCompanyId(Long companyId) { | |
| 63 | + return carInfoMapper.selectByCompanyId(companyId); | |
| 64 | + } | |
| 65 | + | |
| 62 | 66 | /** |
| 63 | 67 | * 新增运输车辆管理 |
| 64 | 68 | * | ... | ... |
trash-unit/src/main/resources/mapper/unit/CarInfoMapper.xml
| ... | ... | @@ -149,6 +149,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 149 | 149 | <include refid="selectCarInfoVo"/> |
| 150 | 150 | where id = #{id} |
| 151 | 151 | </select> |
| 152 | + | |
| 153 | + | |
| 154 | + <select id="selectByCompanyId" parameterType="Long" resultMap="CarInfoVoResult"> | |
| 155 | + <include refid="selectCarInfoForCompanyVo"/> | |
| 156 | + where car.company_id=#{companyId} | |
| 157 | + </select> | |
| 158 | + | |
| 152 | 159 | |
| 153 | 160 | <insert id="insertCarInfo" parameterType="CarInfo" useGeneratedKeys="true" keyProperty="id"> |
| 154 | 161 | insert into car_info | ... | ... |