如题所述:前端的代码如下
//修改订单状态
export function updatOrderStatus(id,status){
const data={
id,
status
}
return request({
url:"/business/orderInfo/updateState",
method:"post",
data:data
})
}
传递如图
后端处理代码如下:
@ApiOperation("订单管理-修改订单状态")
@ApiImplicitParams({
@ApiImplicitParam(name="id",value = "主键id",required = true,dataType = "Integer"),
@ApiImplicitParam(name="status",value = "状态0进行1结束",required = true,dataType = "Integer")
})
// @Log(title = "订单管理-订单列表", businessType = BusinessType.OTHER)
@PostMapping("/updateState")
public AjaxResult updateState(Integer id,Integer status) {
System.out.println("更改订单编号:"+id+"\n");
System.out.println("更改订单状态:"+status+"\n");
if(Objects.isNull(id)){
return AjaxResult.error("输入主键id");
}
if(Objects.isNull(status)){
return AjaxResult.error("输入状态");
}
BOrderInfo bOrderInfo=new BOrderInfo();
bOrderInfo.setId(id);
bOrderInfo.setStatus(status);
System.out.println("更改订单状态:"+bOrderInfo.toString()+"\n");
orderInfoServiceImpl.update(bOrderInfo);
return AjaxResult.success();
}
后端打印结果如下:
请问,哪里出现问题?