Browse Source

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

zouxuan 6 years ago
parent
commit
0754943afb

+ 3 - 0
src/main/java/com/ym/mec/collectfee/CollectFeeServerApplication.java

@@ -9,6 +9,8 @@ import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import java.util.TimeZone;
+
 @SpringBootApplication
 @MapperScan("com.ym.mec.collectfee.dao")
 @ComponentScan(basePackages="com.ym.mec.collectfee")
@@ -20,6 +22,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 public class CollectFeeServerApplication {
 
 	public static void main(String[] args) {
+		TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
 		SpringApplication.run(CollectFeeServerApplication.class, args);
 	}
 	

+ 10 - 5
src/main/java/com/ym/mec/collectfee/controller/YqPayController.java

@@ -122,7 +122,7 @@ public class YqPayController extends BaseController {
 
         School school = schoolService.get(order.getClassId());
         String notifyUrl = "http://47.99.212.176:9000/yqpay/notify"; //异步通知地址
-        String returnUrl = "http://pay.dayaedu.com/login?schoolId=" + school.getId() + "&classId=" + order.getClassId() + "&cityId=" + school.getCityId();//支付后返回页面
+        String returnUrl = "http://pay.dayaedu.com/#/login?schoolId=" + school.getId() + "&classId=" + order.getClassId() + "&cityId=" + school.getCityId();//支付后返回页面
         String payUrl = "https://qyfapi.95epay.com/api/api/hPay/toPayHtml";//支付跳转页
         String payChannels = "{\"weChatPay\":true,\"weChatPayMobile\":false,\"aliPay\":true,\"fastpayXy\":true,\"aliPayMobile\":false,\"balancePay\":false}";//支付方式配置
 
@@ -220,6 +220,9 @@ public class YqPayController extends BaseController {
 
         //classType 小课1 大课2
         Integer buyCount = mecCourse4json.getBuyCount();
+        if (buyCount <= 0) {
+            return failed("购买次数不能小于1");
+        }
         BigDecimal amount = new BigDecimal("0"); //课程总价
         String remark = "";
         List<MecCourse> pickCourses = new ArrayList<>();
@@ -240,11 +243,11 @@ public class YqPayController extends BaseController {
         }
 
         School school = schoolService.get(pickCourses.get(0).getClassId());
-        if (school ==null){
+        if (school == null) {
             return failed("报名学校不存在");
         }
         String notifyUrl = "http://47.99.212.176:9000/yqpay/notify"; //异步通知地址
-        String returnUrl = "http://pay.dayaedu.com/login?schoolId=" + school.getId() + "&classId=" + pickCourses.get(0).getClassId() + "&cityId=" + school.getCityId();//支付后返回页面
+        String returnUrl = "http://pay.dayaedu.com/#/login?schoolId=" + school.getId() + "&classId=" + pickCourses.get(0).getClassId() + "&cityId=" + school.getCityId();//支付后返回页面
         String payUrl = "https://qyfapi.95epay.com/api/api/hPay/toPayHtml";//支付跳转页
         String payChannels = "{\"weChatPay\":true,\"weChatPayMobile\":false,\"aliPay\":true,\"fastpayXy\":true,\"aliPayMobile\":false,\"balancePay\":false}";//支付方式配置
 
@@ -273,13 +276,15 @@ public class YqPayController extends BaseController {
         List<Map> tempRoutingList = new ArrayList();
         tempRoutingList.add(routingList);
 
-        renewalsService.addRenewalsOrder(renewals, amount, orderNo, pickCourses, routingMerNo,account.getId(), remark);
+        renewalsService.addRenewalsOrder(renewals, amount, orderNo, pickCourses, routingMerNo, account.getId(), remark);
 
         /*订单信息*/
         String orderBody = "大雅乐盟培训课程";
         /*订单标题*/
         String orderSubject = "培训订单";
 
+        //测试用
+        amount = new BigDecimal("2");
         Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
         resultMap.put("sellerNo", "0021677"); //收款商户号
         resultMap.put("payChannels", payChannels); //支付方式
@@ -419,7 +424,7 @@ public class YqPayController extends BaseController {
      */
     @PostMapping("/notify")
     public Msg notify(@ModelAttribute Msg msg) throws Exception {
-//        log.info(msg.toString());
+//        log.info(msg.toString());K
         Map<String, Object> rqMap = new LinkedHashMap<String, Object>();
         rqMap.put("code", msg.getCode());
         rqMap.put("msg", msg.getMsg());