|  | @@ -257,19 +257,21 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
 | 
	
		
			
				|  |  |          StudentPaymentOrder studentPaymentOrder = null;
 | 
	
		
			
				|  |  |          if(StringUtils.isNotEmpty(orderNo1)){
 | 
	
		
			
				|  |  |              studentPaymentOrder = studentPaymentOrderService.findOrderByOrderNo(orderNo1);
 | 
	
		
			
				|  |  | -            if(studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS){
 | 
	
		
			
				|  |  | -                throw new BizException("该订单已支付");
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            //关闭老订单
 | 
	
		
			
				|  |  | -            if(studentPaymentOrder.getBalancePaymentAmount() != null){
 | 
	
		
			
				|  |  | -                studentGoodsSell.setIsUseBalancePayment(true);
 | 
	
		
			
				|  |  | -            }else {
 | 
	
		
			
				|  |  | -                studentGoodsSell.setIsUseBalancePayment(false);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
 | 
	
		
			
				|  |  | -            studentPaymentOrderService.update(studentPaymentOrder);
 | 
	
		
			
				|  |  | -            if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
 | 
	
		
			
				|  |  | -                sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
 | 
	
		
			
				|  |  | +            if(studentPaymentOrder != null){
 | 
	
		
			
				|  |  | +                if(studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS){
 | 
	
		
			
				|  |  | +                    throw new BizException("该订单已支付");
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                //关闭老订单
 | 
	
		
			
				|  |  | +                if(studentPaymentOrder.getBalancePaymentAmount() != null){
 | 
	
		
			
				|  |  | +                    studentGoodsSell.setIsUseBalancePayment(true);
 | 
	
		
			
				|  |  | +                }else {
 | 
	
		
			
				|  |  | +                    studentGoodsSell.setIsUseBalancePayment(false);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
 | 
	
		
			
				|  |  | +                studentPaymentOrderService.update(studentPaymentOrder);
 | 
	
		
			
				|  |  | +                if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
 | 
	
		
			
				|  |  | +                    sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          studentGoodsSellDao.update(studentGoodsSell);
 |