提交 f5456fb6 authored 作者: huyufan's avatar huyufan

Merge remote-tracking branch 'origin/v5.7_break_contract_reverse_20231020' into test

......@@ -56,6 +56,7 @@ public enum OrderChildLogEnum {
OWNER(1, "货主"),
PLATFORM(2, "承运"),
DRIVER(3, "司机"),
ARTIFICIAL(4, "客服"),
;
......
package com.clx.performance.vo.pc;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.math.BigDecimal;
import java.util.List;
/**
* @ClassName OrderChildBussInfoVO
* @Description
* @Author kavin
* @Date 2023/9/24 17:41
* @Version 1.0
*/
@ApiModel(description = "司机取消运单-运单详情")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DriverCancelOrderChildInfo {
@ApiModelProperty(value = "取消原因")
private String cancelRemark;
@ApiModelProperty(value = "取消详细原因")
private String cancelDetail;
@ApiModelProperty(value = "图片集合")
private List<String> imageList;
}
......@@ -15,6 +15,7 @@ import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.service.IntegralMqService;
import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.OrderChildService;
import com.clx.performance.service.OrderGoodsTruckBindService;
import com.clx.performance.service.breakcontract.BreakContractSettlementOwnerService;
......@@ -59,6 +60,8 @@ public class OrderCancelComponent implements InitializingBean {
private final IntegralMqService integralMqService;
private final OrderChildLogService orderChildLogService;
public void ownerProcess(OrderCancelParam param) {
String orderNo = param.getOrderNo();
List<OrderGoods> orderGoodsList = null;
......@@ -122,6 +125,10 @@ public class OrderCancelComponent implements InitializingBean {
//释放车辆
driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1);
childNoList.add(orderChild.getChildNo());
orderChildLogService.saveOrderChildLog(orderChild.getChildNo(),
OrderChildEnum.Status.OWNER_CANCEL.getCode(), OrderChildEnum.Status.OWNER_CANCEL.getName(),
OrderChildLogEnum.CreateType.OWNER.getCode(), 0L, OrderChildLogEnum.CreateType.OWNER.getMsg()
);
}
Map<String, List<OrderChild>> orderChildMap = new HashMap<>();
......
......@@ -91,6 +91,12 @@ public class CarrierOrderChildController {
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "司机取消运单-运单详情", notes = "<br>By:胡宇帆")
@GetMapping("/driverCancelOrderChildInfo")
public Result<DriverCancelOrderChildInfo> driverCancelOrderChildInfo(@NotBlank(message = "运单编号不能为空") String orderChildNo) {
return Result.ok(orderChildService.driverCancelOrderChildInfo(orderChildNo));
}
//模拟
@GetMapping("/orderChildExpect")
public void getMonitorOrerChildListsByParam() {
......
......@@ -80,4 +80,5 @@ public interface OrderChildService {
void orderChildFinish(String childNo);
DriverCancelOrderChildInfo driverCancelOrderChildInfo(String orderChildNo);
}
......@@ -21,6 +21,7 @@ import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.service.OrderCancelService;
import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.OrderGoodsTruckBindService;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.breakcontract.BreakContractSettlementOwnerService;
......@@ -73,6 +74,8 @@ public class OrderCancelServiceImpl implements OrderCancelService {
private final OrderCancelComponent orderCancelComponent;
private final OrderChildLogService orderChildLogService;
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -122,6 +125,10 @@ public class OrderCancelServiceImpl implements OrderCancelService {
//释放车辆
driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1);
childNoList.add(orderChild.getChildNo());
orderChildLogService.saveOrderChildLog(orderChild.getChildNo(),
OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), OrderChildEnum.Status.PLATFORM_CANCEL.getName(),
OrderChildLogEnum.CreateType.PLATFORM.getCode(), 0L, OrderChildLogEnum.CreateType.PLATFORM.getMsg()
);
}
if (CollectionUtil.isNotEmpty(childNoList)) {
......@@ -696,6 +703,11 @@ public class OrderCancelServiceImpl implements OrderCancelService {
orderChildDao.updateEntityByKey(update);
orderCancelComponent.backFillTonnageForArtificial(orderChild.getOrderGoodsNo(), orderChild.getWeight());
orderChildLogService.saveOrderChildLog(orderChild.getChildNo(),
OrderChildEnum.Status.ARTIFICIAL_CANCEL.getCode(), OrderChildEnum.Status.ARTIFICIAL_CANCEL.getName(),
OrderChildLogEnum.CreateType.ARTIFICIAL.getCode(), 0L, OrderChildLogEnum.CreateType.ARTIFICIAL.getMsg()
);
}
@Override
......
......@@ -1224,6 +1224,19 @@ public class OrderChildServiceImpl implements OrderChildService {
}
@Override
public DriverCancelOrderChildInfo driverCancelOrderChildInfo(String orderChildNo) {
DriverCancelOrderChildInfo result = new DriverCancelOrderChildInfo();
List<OrderChildImage> images = orderChildImageDao.getImages(orderChildNo, OrderChildImage.Type.DRIVER_CANCEL.getCode());
OrderChild orderChild = orderChildDao.getByChildNo(orderChildNo).orElseThrow(PerformanceResultEnum.ORDER_CHILD_NO_FOUND);
result.setCancelDetail(orderChild.getCancelDetail());
result.setCancelRemark(orderChild.getCancelRemark());
if (CollectionUtils.isNotEmpty(images)) {
result.setImageList(images.stream().map(OrderChildImage::getImage).collect(Collectors.toList()));
}
return result;
}
/**
* 生成计费单
*/
......
......@@ -30,10 +30,7 @@ import com.clx.performance.param.app.OrderGoodsListPageParam;
import com.clx.performance.param.pc.OrderGoodsCancelParam;
import com.clx.performance.param.pc.UpdateEditOrderGoodsParam;
import com.clx.performance.param.pc.UpdateOrderGoodsPriceParam;
import com.clx.performance.service.IntegralMqService;
import com.clx.performance.service.OrderChildService;
import com.clx.performance.service.OrderGoodsLogService;
import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.service.*;
import com.clx.performance.struct.OrderGoodsStruct;
import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.feign.OrderGoodsFeignVO;
......@@ -105,6 +102,8 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
private final IntegralMqService integralMqService;
private final OrderChildLogService orderChildLogService;
@Override
public OrderGoodsVO getOrderGoodsInfoByOrderGoodsNoForPC(String orderGoodsNo) {
OrderGoodsVO orderGoodsVO = orderGoodsDao.getOrderGoodsInfoByOrderGoodsNoForPC(orderGoodsNo).map(orderGoodsStruct::convert).get();
......@@ -527,6 +526,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1);
childNoList.add(orderChild.getChildNo());
sum = sum.add(orderChild.getWeight());
orderChildLogService.saveOrderChildLog(orderChild.getChildNo(),
OrderChildEnum.Status.OWNER_CANCEL.getCode(), OrderChildEnum.Status.OWNER_CANCEL.getName(),
OrderChildLogEnum.CreateType.OWNER.getCode(), 0L, OrderChildLogEnum.CreateType.OWNER.getMsg()
);
}
orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), "系统取消",
......@@ -574,6 +577,10 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
driverService.updateOrderStatus(orderChild.getDriverUserNo(), DriverInfoEnum.DriverStatus.NO.getCode(), orderChild.getTruckId(), 1);
childNoList.add(orderChild.getChildNo());
sum = sum.add(orderChild.getWeight());
orderChildLogService.saveOrderChildLog(orderChild.getChildNo(),
OrderChildEnum.Status.OWNER_CANCEL.getCode(), OrderChildEnum.Status.OWNER_CANCEL.getName(),
OrderChildLogEnum.CreateType.OWNER.getCode(), 0L, OrderChildLogEnum.CreateType.OWNER.getMsg()
);
}
orderChildDao.batchUpdateOrderChildStatus(
OrderChildEnum.Status.PLATFORM_CANCEL.getCode(),"系统取消",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论