| 
					
				 | 
			
			
				@@ -1639,7 +1639,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //类型1支付回调 类型2货到付款 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public synchronized String payConfirm(Integer type,Long orderId,String payCode,String tradeNo,String bankTransactionId,String bankSerialNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public synchronized String  payConfirm(Integer type,Long orderId,String payCode,String tradeNo,String bankTransactionId,String bankSerialNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //支付订单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             FsStoreOrder order=null; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3276,6 +3276,63 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .put("prescribe",prescribe); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public R getMyStoreOrderByIdOrOrderCode(Long orderId, String orderCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FsStoreOrder order; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(orderCode != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            order=orderService.selectFsStoreOrderByOrderCode(orderCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            order=orderService.selectFsStoreOrderById(orderId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        order.setUserPhone(ParseUtils.parsePhone(order.getUserPhone())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        order.setUserAddress(ParseUtils.parseIdCard(order.getUserAddress())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<FsStoreOrderItemVO> list=itemService.selectFsStoreOrderItemListByOrderId(orderId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Calendar calendar = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        calendar.setTime(order.getCreateTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String json=configService.selectConfigByKey("store.config"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        StoreConfig config=JSONUtil.toBean(json,StoreConfig.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        calendar.add(Calendar.MINUTE,config.getUnPayTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SimpleDateFormat format = new   SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String payLimitTime = format.format(calendar.getTime() ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FsPrescribe prescribe=null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(order.getPrescribeId()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            prescribe=prescribeService.selectFsPrescribeById(order.getPrescribeId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //处理是否可以申请售后 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Integer isAfterSales=0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(order.getStatus().equals(OrderInfoEnum.STATUS_3.getValue())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //已完成订单 如果是私域用户就不允许售后 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(ObjectUtil.isNotNull(order.getCompanyId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                isAfterSales=0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                isAfterSales=1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (order.getFinishTime() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (config.getStoreAfterSalesDay() != null && config.getStoreAfterSalesDay() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //判断完成时间是否超过指定时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Calendar calendarAfterSales = new GregorianCalendar(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        calendarAfterSales.setTime(order.getFinishTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        calendarAfterSales.add(calendarAfterSales.DATE, config.getStoreAfterSalesDay()); //把日期往后增加一天,整数  往后推,负数往前移动 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (calendarAfterSales.getTime().getTime() < new Date().getTime()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            isAfterSales = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        else if(order.getStatus()==1||order.getStatus()==2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            isAfterSales=1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//        Integer payment = paymentService.selectFsStorePaymentByOrderIdExists(order.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return R.ok().put("isAfterSales",isAfterSales) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .put("order",order) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .put("items",list) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .put("payLimitTime",payLimitTime) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                .put("showCancelOrder", (payment==null?0:payment) != 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .put("prescribe",prescribe); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public R editPayType(FsStoreOrderPayParam param) { 
			 |