hsf
parent
ce0f24bd7b
commit
778690d8b6
|
|
@ -33,6 +33,8 @@ public class SearchCompanyResult {
|
||||||
* 是否为站点; 0-->否、1-->是
|
* 是否为站点; 0-->否、1-->是
|
||||||
*/
|
*/
|
||||||
private Boolean station;
|
private Boolean station;
|
||||||
|
|
||||||
|
private Integer stationType;
|
||||||
/**
|
/**
|
||||||
* 企业是否开启; 0-->否、1-->是
|
* 企业是否开启; 0-->否、1-->是
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class OrderInfoController {
|
||||||
|| orderCategory == OrderCategory.DuanBoChu
|
|| orderCategory == OrderCategory.DuanBoChu
|
||||||
, "订单类型必须是普通订单、短驳出");
|
, "订单类型必须是普通订单、短驳出");
|
||||||
Integer truckCount = addOrderInfoParam.getTruckCount();
|
Integer truckCount = addOrderInfoParam.getTruckCount();
|
||||||
Assert.isTrue(truckCount != null && truckCount > 0 && truckCount <= 10, "车辆数量必须大于0小于等于10");
|
Assert.isTrue(truckCount != null && truckCount > 0, "车辆数量必须大于0");
|
||||||
Integer estimatedQuantity = addOrderInfoParam.getEstimatedQuantity();
|
Integer estimatedQuantity = addOrderInfoParam.getEstimatedQuantity();
|
||||||
if (estimatedQuantity != null && estimatedQuantity > 0) {
|
if (estimatedQuantity != null && estimatedQuantity > 0) {
|
||||||
addOrderInfoParam.setEstimatedQuantity(estimatedQuantity / truckCount);
|
addOrderInfoParam.setEstimatedQuantity(estimatedQuantity / truckCount);
|
||||||
|
|
|
||||||
|
|
@ -509,11 +509,15 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
if (CollUtil.isEmpty(areaList) && CollUtil.isEmpty(cityList) && CollUtil.isEmpty(cityAreaList)) {
|
if (CollUtil.isEmpty(areaList) && CollUtil.isEmpty(cityList) && CollUtil.isEmpty(cityAreaList)) {
|
||||||
return PageResult.of(pageParam.toPage());
|
return PageResult.of(pageParam.toPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<OrderPagingResult> page = pageParam.toPage();
|
|
||||||
page.addOrder(OrderItem.desc("a.create_time"));
|
|
||||||
QueryWrapper<OrderPagingResult> ew = Wrappers.query();
|
|
||||||
AuditStatus auditStatus = orderPagingSearchParam.getAuditStatus();
|
AuditStatus auditStatus = orderPagingSearchParam.getAuditStatus();
|
||||||
|
Page<OrderPagingResult> page = pageParam.toPage();
|
||||||
|
page.orders().clear(); // 移除所有入参排序
|
||||||
|
if ("2".equals(orderPagingSearchParam.getAuditType()) || auditStatus == AuditStatus.TongGuo) {
|
||||||
|
page.addOrder(OrderItem.desc("a.shi_audit_time"));
|
||||||
|
} else {
|
||||||
|
page.addOrder(OrderItem.desc("a.create_time"));
|
||||||
|
}
|
||||||
|
QueryWrapper<OrderPagingResult> ew = Wrappers.query();
|
||||||
if (Boolean.TRUE.equals(orderPagingSearchParam.getIsCertificatePaging())) {
|
if (Boolean.TRUE.equals(orderPagingSearchParam.getIsCertificatePaging())) {
|
||||||
ew.isNotNull("a.certificate_sn");
|
ew.isNotNull("a.certificate_sn");
|
||||||
}
|
}
|
||||||
|
|
@ -1035,10 +1039,34 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
|
|
||||||
baseMapper.busyDriver(driverId, Boolean.TRUE);
|
baseMapper.busyDriver(driverId, Boolean.TRUE);
|
||||||
baseMapper.busyTruck(truckId, Boolean.TRUE);
|
baseMapper.busyTruck(truckId, Boolean.TRUE);
|
||||||
|
|
||||||
|
// 查询站点企业信息,判断是否为站点且配置了非称重产品
|
||||||
|
Long stationId = orderInfo.getStationId();
|
||||||
|
BizCompanyEntity stationCompany = bizCompanyService.getById(stationId);
|
||||||
|
boolean isStationWithNoWeighGoods = stationCompany != null
|
||||||
|
&& Boolean.TRUE.equals(stationCompany.getStation())
|
||||||
|
&& CollUtil.isNotEmpty(stationCompany.getGoodsIds());
|
||||||
|
|
||||||
|
// 如果是站点且配置了非称重产品,则判断订单产品是否属于非称重产品
|
||||||
|
boolean isNoWeighProductOrder = false;
|
||||||
|
if (isStationWithNoWeighGoods) {
|
||||||
|
// 通过订单的 goodsId 查询 order_goods 表获取 origin_goods_id
|
||||||
|
OrderGoodsEntity orderGoods = orderGoodsService.getById(orderInfo.getGoodsId());
|
||||||
|
if (orderGoods != null) {
|
||||||
|
Long originGoodsId = orderGoods.getOriginGoodsId();
|
||||||
|
// 判断 originGoodsId 是否在企业的非称重产品 goodsIds 集合中
|
||||||
|
isNoWeighProductOrder = stationCompany.getGoodsIds()
|
||||||
|
.contains(originGoodsId.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OrderStatus orderStatus = OrderStatus.QingYunZhong;
|
||||||
|
if (isNoWeighProductOrder) {
|
||||||
|
orderStatus = OrderStatus.YiJinChang;
|
||||||
|
}
|
||||||
this.updateById(new OrderInfoEntity()
|
this.updateById(new OrderInfoEntity()
|
||||||
.setId(orderInfoId)
|
.setId(orderInfoId)
|
||||||
.setCargoPhoto(startTransportOrderParam.getCargoPhoto())
|
.setCargoPhoto(startTransportOrderParam.getCargoPhoto())
|
||||||
.setOrderStatus(OrderStatus.QingYunZhong)
|
.setOrderStatus(orderStatus)
|
||||||
.setTransTime(LocalDateTime.now())
|
.setTransTime(LocalDateTime.now())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue