Merge pull request #47 from ZQKC/master

修复扩分区工单
This commit is contained in:
ZQKC
2020-07-30 19:34:56 +08:00
committed by GitHub
4 changed files with 9 additions and 6 deletions

View File

@@ -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工单

View File

@@ -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;

View File

@@ -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());

View File

@@ -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();
} }