| 
														
															@@ -1,7 +1,6 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 package com.ym.mec.teacher.controller; 
														 | 
														
														 | 
														
															 package com.ym.mec.teacher.controller; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import io.swagger.annotations.Api; 
														 | 
														
														 | 
														
															 import io.swagger.annotations.Api; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import io.swagger.annotations.ApiOperation; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.io.IOException; 
														 | 
														
														 | 
														
															 import java.io.IOException; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.math.BigDecimal; 
														 | 
														
														 | 
														
															 import java.math.BigDecimal; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -11,14 +10,12 @@ import java.util.HashMap; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.LinkedHashMap; 
														 | 
														
														 | 
														
															 import java.util.LinkedHashMap; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.List; 
														 | 
														
														 | 
														
															 import java.util.List; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.Map; 
														 | 
														
														 | 
														
															 import java.util.Map; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import java.util.Objects; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import javax.servlet.http.HttpServletResponse; 
														 | 
														
														 | 
														
															 import javax.servlet.http.HttpServletResponse; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.slf4j.Logger; 
														 | 
														
														 | 
														
															 import org.slf4j.Logger; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.slf4j.LoggerFactory; 
														 | 
														
														 | 
														
															 import org.slf4j.LoggerFactory; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
														
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import org.springframework.http.HttpStatus; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.web.bind.annotation.GetMapping; 
														 | 
														
														 | 
														
															 import org.springframework.web.bind.annotation.GetMapping; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.web.bind.annotation.ModelAttribute; 
														 | 
														
														 | 
														
															 import org.springframework.web.bind.annotation.ModelAttribute; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.web.bind.annotation.PostMapping; 
														 | 
														
														 | 
														
															 import org.springframework.web.bind.annotation.PostMapping; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -26,14 +23,12 @@ import org.springframework.web.bind.annotation.RequestMapping; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.web.bind.annotation.RestController; 
														 | 
														
														 | 
														
															 import org.springframework.web.bind.annotation.RestController; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.alibaba.fastjson.JSON; 
														 | 
														
														 | 
														
															 import com.alibaba.fastjson.JSON; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.auth.api.entity.SysUser; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.dao.SysConfigDao; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.dao.SysConfigDao; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.dao.TenantPaymentOrderDao; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.dao.TenantPaymentOrderDao; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.entity.TenantPaymentOrder; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.entity.TenantPaymentOrder; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.enums.DealStatusEnum; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.enums.DealStatusEnum; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.service.TenantPaymentOrderService; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.service.TenantPaymentOrderService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.common.controller.BaseController; 
														 | 
														
														 | 
														
															 import com.ym.mec.common.controller.BaseController; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.thirdparty.adapay.NotifyEvent; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.thirdparty.yqpay.Msg; 
														 | 
														
														 | 
														
															 import com.ym.mec.thirdparty.yqpay.Msg; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.thirdparty.yqpay.YqPayFeignService; 
														 | 
														
														 | 
														
															 import com.ym.mec.thirdparty.yqpay.YqPayFeignService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -97,43 +92,6 @@ public class TeacherOrderController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		return msg; 
														 | 
														
														 | 
														
															 		return msg; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	@PostMapping("/adaNotify") 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	public void adaNotify(@ModelAttribute NotifyEvent notifyEvent) throws Exception { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		logger.info(notifyEvent.toString()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		if (notifyEvent.getType().equals("payment.success") && notifyEvent.getType().equals("payment.failed")) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			return; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		} 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		Map<String, String> notifyMap = JSON.parseObject(notifyEvent.getData(), Map.class); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		// 支付中订单存在,更新状态 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		if (notifyMap.size() > 0) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			String tradeState = notifyEvent.getType().equals("payment.success") ? "1" : "0"; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			notifyMap.put("tradeState", tradeState); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			notifyMap.put("totalMoney", notifyMap.get("pay_amt")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			notifyMap.put("merOrderNo", notifyMap.get("order_no")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			notifyMap.put("merOrderNo", notifyMap.get("order_no")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			notifyMap.put("remarks", notifyMap.get("description")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			DealStatusEnum status = tradeState.equals("1") ? DealStatusEnum.SUCCESS : DealStatusEnum.FAILED; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			TenantPaymentOrder order = tenantPaymentOrderDao.findOrderByOrderNo(notifyMap.get("merMerOrderNo")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			if (order == null || !order.getStatus().equals(DealStatusEnum.ING)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-				return; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			} 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			if (status.equals(DealStatusEnum.SUCCESS)) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-				order.setPayTime(new Date()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			} else { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-				order.setMemo(notifyMap.get("remarks")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			} 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			order.setStatus(status); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			order.setTransNo(notifyMap.get("orderNo")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			order.setPaymentBusinessChannel(notifyMap.get("channelType")); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			order.setActualAmount(new BigDecimal(notifyMap.get("payAmount"))); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-			tenantPaymentOrderService.paymentForCallback(order); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		} 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	} 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	@GetMapping("/setSuccessStatus") 
														 | 
														
														 | 
														
															 	@GetMapping("/setSuccessStatus") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	public void setSuccessStatus() throws Exception { 
														 | 
														
														 | 
														
															 	public void setSuccessStatus() throws Exception { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		List<TenantPaymentOrder> payingOrders = tenantPaymentOrderDao.findOrdersByStatus(DealStatusEnum.ING, "YQPAY"); 
														 | 
														
														 | 
														
															 		List<TenantPaymentOrder> payingOrders = tenantPaymentOrderDao.findOrdersByStatus(DealStatusEnum.ING, "YQPAY"); 
														 |