提交 bad0cb89 authored 作者: 刘海泉's avatar 刘海泉

增加页面接口

上级 bb6adcc0
......@@ -3,9 +3,11 @@ package com.clx.performance.controller.pc;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.param.pc.DealExceptionReportParam;
import com.clx.performance.param.pc.PageExceptionReportParam;
import com.clx.performance.param.pc.TransferDriverBreakContractParam;
import com.clx.performance.service.OrderChildExceptionReportService;
import com.clx.performance.vo.pc.OrderChildExceptionReportVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -40,6 +42,7 @@ public class OrderChildExceptionReportController {
@Operation(summary = "异常上报分页列表", description = "<br>By:刘海泉")
@PostMapping(value = "pageExceptionReport")
@UnitCovert(param = false)
public Result<PageData<OrderChildExceptionReportVO>> pageExceptionReport(@RequestBody @Validated PageExceptionReportParam param) {
Page<OrderChildExceptionReportVO> page = orderChildExceptionReportService.pageExceptionReport(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
......@@ -62,4 +65,15 @@ public class OrderChildExceptionReportController {
return Result.ok(orderChildExceptionReportService.getExceptionReport(id));
}
@Operation(summary = "转司机违约", description = "<br>By:刘海泉")
@PostMapping(value = "transferDriverBreakContract")
public Result<Object> transferDriverBreakContract(@RequestBody @Validated TransferDriverBreakContractParam param) {
orderChildExceptionReportService.transferDriverBreakContract(param);
return Result.ok();
}
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.open.sdk.request.action.*;
import com.clx.performance.param.pc.DealExceptionReportParam;
import com.clx.performance.param.pc.PageExceptionReportParam;
import com.clx.performance.param.pc.TransferDriverBreakContractParam;
import com.clx.performance.vo.pc.OrderChildExceptionReportVO;
import com.msl.common.result.Result;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
......@@ -33,4 +34,6 @@ public interface OrderChildExceptionReportService {
SXSSFWorkbook exportExceptionReport(PageExceptionReportParam param);
OrderChildExceptionReportVO getExceptionReport(Integer id);
void transferDriverBreakContract(TransferDriverBreakContractParam param);
}
......@@ -20,6 +20,7 @@ import com.clx.performance.model.OrderChildExceptionReport;
import com.clx.performance.model.OrderChildExceptionReportDealLog;
import com.clx.performance.param.pc.DealExceptionReportParam;
import com.clx.performance.param.pc.PageExceptionReportParam;
import com.clx.performance.param.pc.TransferDriverBreakContractParam;
import com.clx.performance.service.OrderChildExceptionReportService;
import com.clx.performance.struct.OrderChildExceptionReportStruct;
import com.clx.performance.utils.LocalDateTimeUtils;
......@@ -330,4 +331,21 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
}
return vo;
}
@Override
public void transferDriverBreakContract(TransferDriverBreakContractParam param) {
OrderChildExceptionReport report = orderChildExceptionReportDao.getEntityByKey(param.getId()).orElseThrow(
ResultEnum.DATA_NOT_FIND);
if(Objects.equals(report.getStatus(),CarrierExceptionReportEnum.Status.PROCESSED.getCode())
&& Objects.equals(report.getDealResult(),ExceptionReportEnum.DealResult.CARRIER_BREAK_CONTRACT.getCode())){
throw new ServiceSystemException(ResultEnum.DATA_ERROR);
}
//@TODO 创建司机违约记录
report.setTransferDriverBreakContract(1);
orderChildExceptionReportDao.updateEntityByKey(report);
}
}
package com.clx.performance.param.pc;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
/**
* @ClassName TransferDriverBreakContractParam
* @Description
* @Author kavin
* @Date 2024/10/23 14:39
* @Version 1.0
*/
@Getter
@Setter
public class TransferDriverBreakContractParam {
@NotNull(message = "异常记录ID不能为空")
@Schema(description = "异常记录ID")
private Integer id;
@NotBlank(message = "违约原因不能为空")
@Schema(description = "违约原因")
private String reason;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论