mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 20:22:12 +08:00
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user