Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

# Conflicts:
#	mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java
yonge 5 năm trước cách đây
mục cha
commit
773a0ada8b

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -25,7 +25,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/v2/api-docs","/studentOrder/notify","/code/*","/register/*","/musicGroup/test","/studentOrder/executePayment").permitAll().anyRequest().authenticated().and().httpBasic();
+				.authorizeRequests().antMatchers("/v2/api-docs","/code/*","/register/*","/studentOrder/*").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 6 - 43
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -54,47 +54,6 @@ public class StudentOrderController extends BaseController {
     @Autowired
     private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
 
-//    @PostMapping("/notify")
-//    public String notify(@ModelAttribute NotifyMsg notifyMsg) {
-//        //       ArrayList<SysAccount> sysAccounts = new ArrayList<>();
-////       Map<String,String[]> msg = request.getParameterMap();
-////        for (Map.Entry<String, String[]> stringObjectEntry : msg.entrySet()) {
-////            SysAccount sysAccount = new SysAccount();
-////            String KeyVal = "Key:" + stringObjectEntry.getKey() + " val:" + stringObjectEntry.getValue().toString();
-////            log.warn(KeyVal);
-////            sysAccount.setMerNo(stringObjectEntry.getKey());
-////            sysAccount.setChannel(request.getParameter(stringObjectEntry.getKey()));
-////            sysAccounts.add(sysAccount);
-////        }
-//        //sysAccountDao.batchInsert(sysAccounts);
-//
-//        // "SUCCESS";
-//        //
-//        //不是成功和失败的通知
-//        if (!notifyMsg.getStatus().equals("TRADE_SUCCESS") && !notifyMsg.getStatus().equals("TRADE_CLOSED")) {
-//            return "SUCCESS";
-//        }
-//
-//        StudentPaymentOrder order = studentPaymentOrderService.findOrderByOrderNo(notifyMsg.getMerOrderId().substring(4));
-//        if (order != null && !order.getStatus().equals(DealStatusEnum.ING)) { //订单状态不是在支付中
-//            return "SUCCESS";
-//        }
-//        DealStatusEnum status = notifyMsg.getStatus().equals("TRADE_SUCCESS") ? DealStatusEnum.SUCCESS : DealStatusEnum.FAilED;
-//
-//        order.setStatus(status);
-//        order.setTransNo(notifyMsg.getSeqId());
-//        order.setPaymentBusinessChannel(notifyMsg.getTargetSys());
-//        order.setPayTime(notifyMsg.getPayTime());
-//        if (order.getType().equals(OrderTypeEnum.APPLY)) { //报名订单
-//            studentRegistrationService.updateApplyOrder(order);
-//        } else if (order.getType().equals(OrderTypeEnum.SMALL_CLASS_TO_BUY)) {
-//            vipGroupService.orderCallback(order);
-//        } else if (order.getType().equals(OrderTypeEnum.RENEW)) {
-//            musicGroupService.renewForCallback(order);
-//        }
-//        return "SUCCESS";
-//    }
-
     @PostMapping("/notify")
     public Msg notify(@ModelAttribute Msg msg) throws Exception {
         logger.info(msg.toString());
@@ -360,7 +319,7 @@ public class StudentOrderController extends BaseController {
 
     }
 
-    @Scheduled(cron = "0/30 * * * * ?")
+    //@Scheduled(cron = "0/30 * * * * ?")
     public void setSuccessStatus() throws Exception {
         List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
 
@@ -376,7 +335,11 @@ public class StudentOrderController extends BaseController {
             String channelType = rpMap.get("channelType").equals("1") ? "WXPay" : (rpMap.get("channelType").equals("2") ? "Alipay" : "quickPay");
             rpMap.put("channelType", channelType);
             if (Arrays.asList(statusArr).contains(rpMap.get("tradeState"))) {
-                updateOrder(rpMap); //更新订单
+                try {
+                    updateOrder(rpMap); //更新订单
+                }catch (Exception e){
+                    continue;
+                }
             }
         }
 

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java

@@ -70,6 +70,6 @@ public class SchoolController extends BaseController {
     @ApiOperation(value = "获取教师vip课教学点")
     @GetMapping("/findVipSchoolByTeacher")
     public Object findVipSchoolByTeacher(@ApiParam(value = "教师编号", required = true) Integer userId){
-        return succeed(schoolService.findVipSchoolByTeacher(userId, null));
+        return succeed(schoolService.findVipSchoolByTeacher(userId,null));
     }
 }