Commit f1482e70 by giaogiao

添加商家驳回理由

parent 6f267d1b
......@@ -152,7 +152,7 @@ public class McStrokeController extends BaseController {
@RequiresPermissions("merchant:order:edit")
public ApiResult<Boolean> cancel(@Validated @RequestBody StrokeCancelParam strokeCancelParam) throws Exception {
boolean flag = strokeService.cancel(strokeCancelParam.getId());
boolean flag = strokeService.cancel(strokeCancelParam.getId(),strokeCancelParam.getRefusalReason());
return ApiResult.result(flag);
}
......
......@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
......@@ -26,5 +27,8 @@ public class StrokeCancelParam extends BaseEntity {
@ApiModelProperty("主键ID")
private Long id;
@NotBlank(message = "商家驳回理由不能为空")
@ApiModelProperty("商家驳回理由")
private String refusalReason;
}
......@@ -174,4 +174,8 @@ public class Stroke extends BaseEntity {
@ApiModelProperty("付款渠道,0-线下渠道,1-线上渠道")
private Integer paymentChannel;
@NotBlank(message = "商家驳回理由不能为空")
@ApiModelProperty("商家驳回理由")
private String refusalReason;
}
......@@ -41,7 +41,7 @@ public interface StrokeService extends BaseService<Stroke> {
boolean updateStroke(Stroke stroke) throws Exception;
boolean cancel(Long id) throws Exception;
boolean cancel(Long id, String refusalReason) throws Exception;
/**
* 删除
......
......@@ -69,11 +69,12 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
}
@Override
public boolean cancel(Long id) throws Exception {
public boolean cancel(Long id, String refusalReason) throws Exception {
// 修改订单状态为取消
Stroke stroke = new Stroke();
stroke.setId(id)
.setRefusalReason(refusalReason)
.setStatus(StrokeStatusEnum.CANCEL.getCode())
.setUpdateTime(new Timestamp(System.currentTimeMillis()));
boolean b = super.updateById(stroke);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment