提交 9b6ae2a5 authored 作者: huyufan's avatar huyufan

司机端无接单位置上报

上级 10610328
...@@ -2,8 +2,10 @@ package com.clx.performance.controller.app; ...@@ -2,8 +2,10 @@ package com.clx.performance.controller.app;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.OrderGoodsMapper; import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.app.OrderGoodsListPageParam; import com.clx.performance.param.app.OrderGoodsListPageParam;
import com.clx.performance.service.OrderGoodsService; import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.service.OrderGoodsTruckBindService;
import com.clx.performance.vo.app.OrderGoodsAPPVO; import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.pc.OrderGoodsVO; import com.clx.performance.vo.pc.OrderGoodsVO;
import com.msl.common.base.PageData; import com.msl.common.base.PageData;
...@@ -16,6 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -16,6 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* @ClassName GoodsOrderController * @ClassName GoodsOrderController
* @Description * @Description
...@@ -37,6 +41,9 @@ public class AppGoodsOrderController { ...@@ -37,6 +41,9 @@ public class AppGoodsOrderController {
@Autowired @Autowired
OrderGoodsMapper orderGoodsMapper; OrderGoodsMapper orderGoodsMapper;
@Autowired
OrderGoodsTruckBindService orderGoodsTruckBindService;
@ApiOperation(value = "查看货单详情", notes = "<br>By:胡宇帆") @ApiOperation(value = "查看货单详情", notes = "<br>By:胡宇帆")
@GetMapping("/getOrderGoodsInfo") @GetMapping("/getOrderGoodsInfo")
...@@ -55,10 +62,9 @@ public class AppGoodsOrderController { ...@@ -55,10 +62,9 @@ public class AppGoodsOrderController {
} }
// @ApiOperation(value = "专属货单", notes = "<br>By:胡宇帆") @ApiOperation(value = "司机端无接单位置上报", notes = "<br>By:胡宇帆")
// @PostMapping("/exclusiveOrderGoodsList") @GetMapping("/getCancelOrderGoods")
// @UnitCovert(param = false) public Result<List<OrderGoods>> getCancelOrderGoods(@RequestParam(value = "userNo") Long userNo) {
// public Result<List<OrderGoodsVO>> exclusiveOrderGoodsList(@Validated @RequestBody OrderGoodsListParam orderGoodsListParam) { return Result.ok(orderGoodsTruckBindService.getCancelOrderGoods(userNo));
// return Result.ok(orderGoodsService.openOrderPageGoodsList(orderGoodsListParam)); }
// }
} }
...@@ -196,15 +196,5 @@ public class GoodsOrderController { ...@@ -196,15 +196,5 @@ public class GoodsOrderController {
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "司机端无接单位置上报", notes = "<br>By:胡宇帆")
@GetMapping("/getCancelOrderGoods")
public Result<List<OrderGoods>> getCancelOrderGoods(@RequestParam(value = "truckNo") String truckNo) {
LocalDateTime now = LocalDateTime.now();
return Result.ok(orderGoodsTruckBindService.getCancelOrderGoods(truckNo,
DateUtils.formatDateTime(now.plusDays(-3), "yyyy-MM-dd HH:mm:ss").get(),
DateUtils.formatDateTime(now, "yyyy-MM-dd HH:mm:ss").get()
)
);
}
} }
...@@ -38,6 +38,8 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int ...@@ -38,6 +38,8 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int
void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus); void updateOrderGoodsReduceWeightAndStatus(Integer id, BigDecimal orderChildWeight, Integer orderGoodsStatus);
void updateOrderGoodsWeightResidueAndAlreadyAndStatus(Integer id, BigDecimal alreadyTransportWeight,BigDecimal residueTransportWeight,Integer orderGoodsStatus);
IPage<OrderGoodsAPPVO> openOrderPageGoodsList(OrderGoodsListPageParam orderGoodsListPageParam); IPage<OrderGoodsAPPVO> openOrderPageGoodsList(OrderGoodsListPageParam orderGoodsListPageParam);
IPage<OrderGoodsAPPVO> exclusiveOrderPageGoodsList(OrderGoodsListPageParam orderGoodsListPageParam, List<String> orderGoodsNoList); IPage<OrderGoodsAPPVO> exclusiveOrderPageGoodsList(OrderGoodsListPageParam orderGoodsListPageParam, List<String> orderGoodsNoList);
......
...@@ -48,7 +48,7 @@ public interface OrderGoodsTruckBindDao extends BaseDao<OrderGoodsTruckBindMappe ...@@ -48,7 +48,7 @@ public interface OrderGoodsTruckBindDao extends BaseDao<OrderGoodsTruckBindMappe
List<OrderGoodsTruckBind> selectCancelRecord(String orderGoodsNo, List<String> truckList); List<OrderGoodsTruckBind> selectCancelRecord(String orderGoodsNo, List<String> truckList);
List<OrderGoodsTruckBind> getCancelOrderGoods(String truckNo, String beginTime, String endTime); List<OrderGoodsTruckBind> getCancelOrderGoods(List<String> truckList, String beginTime, String endTime);
void deleteByOrderGoods(String orderGoodsNo); void deleteByOrderGoods(String orderGoodsNo);
} }
...@@ -78,6 +78,11 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, ...@@ -78,6 +78,11 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
baseMapper.updateOrderGoodsWeightAndStatus(id, orderChildWeight, orderGoodsStatus); baseMapper.updateOrderGoodsWeightAndStatus(id, orderChildWeight, orderGoodsStatus);
} }
@Override
public void updateOrderGoodsWeightResidueAndAlreadyAndStatus(Integer id, BigDecimal alreadyTransportWeight,BigDecimal residueTransportWeight,Integer orderGoodsStatus) {
baseMapper.updateOrderGoodsWeightResidueAndAlreadyAndStatus(id, alreadyTransportWeight, residueTransportWeight, orderGoodsStatus);
}
@Override @Override
public IPage<OrderGoodsAPPVO> openOrderPageGoodsList(OrderGoodsListPageParam param) { public IPage<OrderGoodsAPPVO> openOrderPageGoodsList(OrderGoodsListPageParam param) {
Page<OrderGoodsAPPVO> page = Page.of(param.getPage(), param.getPageSize()); Page<OrderGoodsAPPVO> page = Page.of(param.getPage(), param.getPageSize());
......
...@@ -157,8 +157,8 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM ...@@ -157,8 +157,8 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM
} }
@Override @Override
public List<OrderGoodsTruckBind> getCancelOrderGoods(String truckNo, String beginTime, String endTime) { public List<OrderGoodsTruckBind> getCancelOrderGoods(List<String> truckList, String beginTime, String endTime) {
return baseMapper.selectList(lQrWrapper().eq(OrderGoodsTruckBind::getTruckNo, truckNo) return baseMapper.selectList(lQrWrapper().in(OrderGoodsTruckBind::getTruckNo, truckList)
.eq(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.CANCEL.getCode()) .eq(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.CANCEL.getCode())
.le(OrderGoodsTruckBind::getCreateTime, endTime) .le(OrderGoodsTruckBind::getCreateTime, endTime)
.ge(OrderGoodsTruckBind::getCreateTime, beginTime) .ge(OrderGoodsTruckBind::getCreateTime, beginTime)
......
...@@ -42,6 +42,14 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> { ...@@ -42,6 +42,14 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
" where id = #{id}") " where id = #{id}")
void updateOrderGoodsWeightAndStatus(@Param("id") Integer id, @Param("weight") BigDecimal orderChildWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus); void updateOrderGoodsWeightAndStatus(@Param("id") Integer id, @Param("weight") BigDecimal orderChildWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus);
@Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{residueTransportWeight}," +
" already_transport_weight = already_transport_weight+#{alreadyTransportWeight}," +
"order_goods_status = #{orderGoodsStatus} " +
" where id = #{id}")
void updateOrderGoodsWeightResidueAndAlreadyAndStatus(@Param("id") Integer id, @Param("alreadyTransportWeight") BigDecimal alreadyTransportWeight, @Param("residueTransportWeight") BigDecimal residueTransportWeight,@Param("orderGoodsStatus") Integer orderGoodsStatus);
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "openOrderPageGoodsList") @SelectProvider(type = OrderGoodsSqlProvider.class, method = "openOrderPageGoodsList")
IPage<OrderGoodsAPPVO> openOrderPageGoodsList(Page<OrderGoodsAPPVO> page); IPage<OrderGoodsAPPVO> openOrderPageGoodsList(Page<OrderGoodsAPPVO> page);
......
...@@ -8,5 +8,5 @@ public interface OrderGoodsTruckBindService { ...@@ -8,5 +8,5 @@ public interface OrderGoodsTruckBindService {
List<Integer> getTrucksByOrderGoodsNo(String orderGoodsNo); List<Integer> getTrucksByOrderGoodsNo(String orderGoodsNo);
List<OrderGoods> getCancelOrderGoods(String truckNo, String beginTime, String endTime); List<OrderGoods> getCancelOrderGoods(Long userNo);
} }
...@@ -288,11 +288,20 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -288,11 +288,20 @@ public class OrderChildServiceImpl implements OrderChildService {
orderChild.setTruckModel(driverTruckInfo.getModel()); orderChild.setTruckModel(driverTruckInfo.getModel());
Integer overWeight = orderInfo.getOverWeight(); Integer overWeight = orderInfo.getOverWeight();
if(Objects.equals(overWeight,OrderGoodsOverWeightEnum.NO.getCode())){ if(Objects.equals(overWeight,OrderGoodsOverWeightEnum.NO.getCode())){
if (orderGoods.getResidueTransportWeight().compareTo(new BigDecimal(33)) < 0) {
orderChild.setWeight(orderGoods.getResidueTransportWeight());
} else {
orderChild.setWeight(new BigDecimal(33)); orderChild.setWeight(new BigDecimal(33));
}else{ }
} else{
if (orderGoods.getResidueTransportWeight().compareTo(new BigDecimal(50)) < 0) {
orderChild.setWeight(orderGoods.getResidueTransportWeight());
} else {
orderChild.setWeight(new BigDecimal(50)); orderChild.setWeight(new BigDecimal(50));
} }
}
//orderChild.setWeight(orderChild.getTruckLoad()); //orderChild.setWeight(orderChild.getTruckLoad());
orderChild.setFreight(orderChildFreightCalc(orderChild)); orderChild.setFreight(orderChildFreightCalc(orderChild));
orderChild.setPayTime(now); orderChild.setPayTime(now);
......
...@@ -132,6 +132,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -132,6 +132,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
//当前订单已经取消或完结 //当前订单已经取消或完结
} else { } else {
orderGoodsDao.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), orderChildWeight, orderGoodsStatus); orderGoodsDao.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), orderChildWeight, orderGoodsStatus);
} }
...@@ -458,7 +459,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -458,7 +459,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
Integer orderGoodsStatus = OrderGoodsStatusEnum.Status.CANCEL.getCode(); Integer orderGoodsStatus = OrderGoodsStatusEnum.Status.CANCEL.getCode();
switch (cancelOperateType) { switch (cancelOperateType) {
case 1: case 1:
orderChildList = orderChildDao.selectResidueWeightByOrderGoodsNo(orderGoods.getOrderGoodsNo(), null); orderChildList = orderChildDao.selectResidueWeightByOrderGoodsNo(orderGoods.getOrderGoodsNo(), OrderChildEnum.Status.DRIVER_CANCEL.getCode());
if (CollectionUtils.isNotEmpty(orderChildList)) { if (CollectionUtils.isNotEmpty(orderChildList)) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "当前货单已产生运单"); throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "当前货单已产生运单");
} }
......
...@@ -3,14 +3,21 @@ package com.clx.performance.service.impl; ...@@ -3,14 +3,21 @@ package com.clx.performance.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.clx.performance.dao.OrderGoodsDao; import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.dao.OrderGoodsTruckBindDao; import com.clx.performance.dao.OrderGoodsTruckBindDao;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
import com.clx.performance.model.OrderGoodsTruckBind; import com.clx.performance.model.OrderGoodsTruckBind;
import com.clx.performance.service.OrderGoodsTruckBindService; import com.clx.performance.service.OrderGoodsTruckBindService;
import com.clx.user.feign.TruckFeign;
import com.clx.user.vo.app.driver.truck.DriverTruckAppVo;
import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -24,6 +31,7 @@ public class OrderGoodsTruckBindServiceImpl implements OrderGoodsTruckBindServic ...@@ -24,6 +31,7 @@ public class OrderGoodsTruckBindServiceImpl implements OrderGoodsTruckBindServic
private final OrderGoodsDao orderGoodsDao; private final OrderGoodsDao orderGoodsDao;
private final TruckFeign truckFeign;
@Override @Override
public List<Integer> getTrucksByOrderGoodsNo(String orderGoodsNo) { public List<Integer> getTrucksByOrderGoodsNo(String orderGoodsNo) {
...@@ -31,8 +39,18 @@ public class OrderGoodsTruckBindServiceImpl implements OrderGoodsTruckBindServic ...@@ -31,8 +39,18 @@ public class OrderGoodsTruckBindServiceImpl implements OrderGoodsTruckBindServic
} }
@Override @Override
public List<OrderGoods> getCancelOrderGoods(String truckNo, String beginTime, String endTime) { public List<OrderGoods> getCancelOrderGoods(Long userNo) {
List<OrderGoodsTruckBind> list = orderGoodsTruckBindDao.getCancelOrderGoods(truckNo, beginTime, endTime); Result<List<DriverTruckAppVo>> result = truckFeign.driverTruckList(userNo);
if (!result.succeed() || CollectionUtil.isEmpty(result.getData())) {
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND);
}
List<String> truckList = result.getData().stream().map(DriverTruckAppVo::getTruckNo).collect(Collectors.toList());
LocalDateTime now = LocalDateTime.now();
List<OrderGoodsTruckBind> list = orderGoodsTruckBindDao.getCancelOrderGoods(truckList,
DateUtils.formatDateTime(now.plusDays(-3), "yyyy-MM-dd HH:mm:ss").get(),
DateUtils.formatDateTime(now, "yyyy-MM-dd HH:mm:ss").get());
if (CollectionUtil.isEmpty(list)) { if (CollectionUtil.isEmpty(list)) {
return null; return null;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论