未验证 提交 61f0b67a 编写于 作者: Z ZQKC 提交者: GitHub

Merge pull request #47 from ZQKC/master

修复扩分区工单
......@@ -45,7 +45,7 @@ public interface OrderService {
* @date 19/6/23
* @return Result
*/
Result modifyOrderPartition(OrderPartitionDO orderPartitionDO, String operator);
Result modifyOrderPartition(OrderPartitionDO orderPartitionDO, String operator, boolean admin);
/**
* 查询Topic工单
......
......@@ -72,6 +72,9 @@ public class JmxServiceImpl implements JmxService {
List<Attribute> attributeValueList = null;
try {
attributeValueList = connection.getAttributes(new ObjectName(mbean.getObjectName()), properties).asList();
} catch (InstanceNotFoundException e) {
logger.warn("getSpecifiedBrokerMetricsFromJmx@JmxServiceImpl, get metrics fail, objectName:{}.", mbean.getObjectName(), e);
continue;
} catch (Exception e) {
logger.error("getSpecifiedBrokerMetricsFromJmx@JmxServiceImpl, get metrics fail, objectName:{}.", mbean.getObjectName(), e);
continue;
......
......@@ -51,7 +51,7 @@ public class OrderServiceImpl implements OrderService {
if (orderPartitionDO != null) {
orderPartitionDO.setOrderStatus(OrderStatusEnum.CANCELLED.getCode());
}
return modifyOrderPartition(orderPartitionDO, operator);
return modifyOrderPartition(orderPartitionDO, operator, false);
}
return new Result(StatusCode.PARAM_ERROR, "order type illegal");
}
......@@ -74,10 +74,10 @@ public class OrderServiceImpl implements OrderService {
}
@Override
public Result modifyOrderPartition(OrderPartitionDO newOrderPartitionDO, String operator) {
public Result modifyOrderPartition(OrderPartitionDO newOrderPartitionDO, String operator, boolean admin) {
if (newOrderPartitionDO == null) {
return new Result(StatusCode.PARAM_ERROR, "param illegal, order not exist");
} else if (!newOrderPartitionDO.getApplicant().equals(operator)) {
} else if (!admin && !newOrderPartitionDO.getApplicant().equals(operator)) {
return new Result(StatusCode.PARAM_ERROR, "without authority to cancel the order");
}
OrderPartitionDO oldOrderPartitionDO = orderPartitionDao.getById(newOrderPartitionDO.getId());
......
......@@ -325,9 +325,9 @@ public class OrderController {
orderPartitionDO.setApprover(username);
orderPartitionDO.setOpinion(reqObj.getApprovalOpinions());
orderPartitionDO.setOrderStatus(reqObj.getOrderStatus());
result = orderService.modifyOrderPartition(orderPartitionDO, username);
result = orderService.modifyOrderPartition(orderPartitionDO, username, true);
if (!StatusCode.SUCCESS.equals(result.getCode())) {
return new Result(StatusCode.OPERATION_ERROR, "create topic success, but update order status failed, err:" + result.getMessage());
return new Result(StatusCode.OPERATION_ERROR, "expand topic success, but update order status failed, err:" + result.getMessage());
}
return new Result();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册