|  |  | 
 |  |  |                 if (ids.size() == 1) { | 
 |  |  |                     ContractHoldOrderEntity holdOrderEntity = contractHoldOrderDao.selectById(ids.get(0)); | 
 |  |  |  | 
 |  |  |                     // 判断仓位类型是否逐仓 | 
 |  |  |                     if (holdOrderEntity.getPositionType() == ContractEntrustOrderEntity.POSITION_TYPE_ADD) { | 
 |  |  |                         // 逐仓平仓 | 
 |  |  |                         cancelHoldOrderMethod(holdOrderEntity); | 
 |  |  |                     if (holdOrderEntity != null) { | 
 |  |  |                         // 判断仓位类型是否逐仓 | 
 |  |  |                         if (holdOrderEntity.getPositionType() == ContractEntrustOrderEntity.POSITION_TYPE_ADD) { | 
 |  |  |                             // 逐仓平仓 | 
 |  |  |                             cancelHoldOrderMethod(holdOrderEntity); | 
 |  |  |                         } else { | 
 |  |  |                             // 全仓模式平仓 | 
 |  |  |                             closingWholeOrder(holdOrderEntity); | 
 |  |  |                         } | 
 |  |  |                     } else { | 
 |  |  |                         // 全仓模式平仓 | 
 |  |  |                         closingWholeOrder(holdOrderEntity); | 
 |  |  |                         log.info("持仓订单为空: {}", ids.get(0)); | 
 |  |  |                     } | 
 |  |  |                 } else { | 
 |  |  |                     List<ContractHoldOrderEntity> holdOrderEntities = contractHoldOrderDao.selectBatchIds(ids); |