|  | @@ -8,7 +8,9 @@ import com.hwrj.cloud.portal.model.UmsMember;
 | 
	
		
			
				|  |  |  import com.hwrj.cloud.portal.service.OmsOrderPayService;
 | 
	
		
			
				|  |  |  import com.hwrj.cloud.portal.service.UmsMemberService;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.scheduling.annotation.Async;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | +import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.util.Date;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -38,20 +40,31 @@ public class OmsOrderPayServiceImpl implements OmsOrderPayService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | +    @Transactional
 | 
	
		
			
				|  |  |      public void update(String valueOf) {
 | 
	
		
			
				|  |  | +        long start=System.currentTimeMillis();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          OmsOrderPay omsOrderPay = omsOrderPayMapper.selectByPrimaryKey(valueOf);
 | 
	
		
			
				|  |  | -        omsOrderPay.setStatus(1);
 | 
	
		
			
				|  |  | -        omsOrderPay.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | -        omsOrderPayMapper.updateByPrimaryKeySelective(omsOrderPay);
 | 
	
		
			
				|  |  | -        Long orderId = omsOrderPay.getOrderId();
 | 
	
		
			
				|  |  | -        OmsOrder order =new OmsOrder();
 | 
	
		
			
				|  |  | -        order.setId(orderId);
 | 
	
		
			
				|  |  | -        //设置为微信支付
 | 
	
		
			
				|  |  | -        order.setPayType(2);
 | 
	
		
			
				|  |  | -        //设置为待发货
 | 
	
		
			
				|  |  | -        order.setStatus(1);
 | 
	
		
			
				|  |  | -        //设置支付时间
 | 
	
		
			
				|  |  | -        order.setPaymentTime(new Date());
 | 
	
		
			
				|  |  | -        omsOrderMapper.updateByPrimaryKeySelective(order);
 | 
	
		
			
				|  |  | +        if(omsOrderPay.getStatus().intValue()!=1){
 | 
	
		
			
				|  |  | +            long onr=System.currentTimeMillis();
 | 
	
		
			
				|  |  | +            System.out.println("查询>>>>>>>>>>>>>>:"+(onr-start)/1000+":秒");
 | 
	
		
			
				|  |  | +            omsOrderPay.setStatus(1);
 | 
	
		
			
				|  |  | +            omsOrderPay.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | +            omsOrderPayMapper.updateByPrimaryKeySelective(omsOrderPay);
 | 
	
		
			
				|  |  | +            long two=System.currentTimeMillis();
 | 
	
		
			
				|  |  | +            System.out.println("更新1>>>>>>>>>>>>>>:"+(two-onr)/1000+":秒");
 | 
	
		
			
				|  |  | +            Long orderId = omsOrderPay.getOrderId();
 | 
	
		
			
				|  |  | +            OmsOrder order =new OmsOrder();
 | 
	
		
			
				|  |  | +            order.setId(orderId);
 | 
	
		
			
				|  |  | +            //设置为微信支付
 | 
	
		
			
				|  |  | +            order.setPayType(2);
 | 
	
		
			
				|  |  | +            //设置为待发货
 | 
	
		
			
				|  |  | +            order.setStatus(1);
 | 
	
		
			
				|  |  | +            //设置支付时间
 | 
	
		
			
				|  |  | +            order.setPaymentTime(new Date());
 | 
	
		
			
				|  |  | +            omsOrderMapper.updateByPrimaryKeySelective(order);
 | 
	
		
			
				|  |  | +            long tree=System.currentTimeMillis();
 | 
	
		
			
				|  |  | +            System.out.println("更新2>>>>>>>>>>>>>>:"+(tree-two)/1000+":秒");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 |