mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-04 11:52:07 +08:00
@@ -45,7 +45,7 @@ public interface OrderService {
|
|||||||
* @date 19/6/23
|
* @date 19/6/23
|
||||||
* @return Result
|
* @return Result
|
||||||
*/
|
*/
|
||||||
Result modifyOrderPartition(OrderPartitionDO orderPartitionDO, String operator);
|
Result modifyOrderPartition(OrderPartitionDO orderPartitionDO, String operator, boolean admin);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询Topic工单
|
* 查询Topic工单
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ public class JmxServiceImpl implements JmxService {
|
|||||||
List<Attribute> attributeValueList = null;
|
List<Attribute> attributeValueList = null;
|
||||||
try {
|
try {
|
||||||
attributeValueList = connection.getAttributes(new ObjectName(mbean.getObjectName()), properties).asList();
|
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) {
|
} catch (Exception e) {
|
||||||
logger.error("getSpecifiedBrokerMetricsFromJmx@JmxServiceImpl, get metrics fail, objectName:{}.", mbean.getObjectName(), e);
|
logger.error("getSpecifiedBrokerMetricsFromJmx@JmxServiceImpl, get metrics fail, objectName:{}.", mbean.getObjectName(), e);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
if (orderPartitionDO != null) {
|
if (orderPartitionDO != null) {
|
||||||
orderPartitionDO.setOrderStatus(OrderStatusEnum.CANCELLED.getCode());
|
orderPartitionDO.setOrderStatus(OrderStatusEnum.CANCELLED.getCode());
|
||||||
}
|
}
|
||||||
return modifyOrderPartition(orderPartitionDO, operator);
|
return modifyOrderPartition(orderPartitionDO, operator, false);
|
||||||
}
|
}
|
||||||
return new Result(StatusCode.PARAM_ERROR, "order type illegal");
|
return new Result(StatusCode.PARAM_ERROR, "order type illegal");
|
||||||
}
|
}
|
||||||
@@ -74,10 +74,10 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result modifyOrderPartition(OrderPartitionDO newOrderPartitionDO, String operator) {
|
public Result modifyOrderPartition(OrderPartitionDO newOrderPartitionDO, String operator, boolean admin) {
|
||||||
if (newOrderPartitionDO == null) {
|
if (newOrderPartitionDO == null) {
|
||||||
return new Result(StatusCode.PARAM_ERROR, "param illegal, order not exist");
|
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");
|
return new Result(StatusCode.PARAM_ERROR, "without authority to cancel the order");
|
||||||
}
|
}
|
||||||
OrderPartitionDO oldOrderPartitionDO = orderPartitionDao.getById(newOrderPartitionDO.getId());
|
OrderPartitionDO oldOrderPartitionDO = orderPartitionDao.getById(newOrderPartitionDO.getId());
|
||||||
|
|||||||
@@ -325,9 +325,9 @@ public class OrderController {
|
|||||||
orderPartitionDO.setApprover(username);
|
orderPartitionDO.setApprover(username);
|
||||||
orderPartitionDO.setOpinion(reqObj.getApprovalOpinions());
|
orderPartitionDO.setOpinion(reqObj.getApprovalOpinions());
|
||||||
orderPartitionDO.setOrderStatus(reqObj.getOrderStatus());
|
orderPartitionDO.setOrderStatus(reqObj.getOrderStatus());
|
||||||
result = orderService.modifyOrderPartition(orderPartitionDO, username);
|
result = orderService.modifyOrderPartition(orderPartitionDO, username, true);
|
||||||
if (!StatusCode.SUCCESS.equals(result.getCode())) {
|
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();
|
return new Result();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user