| | |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.alipay.AlipayProperties; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.service.AlipayService; |
| | | import com.kidgrow.oprationcenter.service.ISaasClientPayService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private AlipayProperties alipayProperties; |
| | | @Autowired |
| | | private ISaasClientPayService saasClientPayService; |
| | | @Autowired |
| | | private AlipayService alipayService; |
| | | |
| | | @ApiOperation(value = "调用预支付的接口,生成二维码") |
| | | @PostMapping("/precreate") |
| | |
| | | if (requestMap.get("trade_status").equals("TRADE_SUCCESS")) { |
| | | log.error("wwwwwwwwwww"); |
| | | //更新状态 out_trade_no |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("out_trade_no", requestMap.get("out_trade_no")); |
| | | queryWrapper.eq("pay_status", 0); |
| | | List<SaasClientPay> list = saasClientPayService.list(queryWrapper); |
| | | if (!list.isEmpty()) { |
| | | SaasClientPay saasClientPay = list.get(0); |
| | | saasClientPay.setPayTime(DateUtils.parseDate(requestMap.get("gmt_payment"))); |
| | | saasClientPay.setPayStatus(2); |
| | | saasClientPay.setTradeNo(requestMap.get("trade_no")); |
| | | boolean b = saasClientPayService.saveOrUpdate(saasClientPay); |
| | | } |
| | | log.error("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); |
| | | System.out.println("异步通知 " + Instant.now()); |
| | | return alipayService.notify(requestMap); |
| | | }else { |
| | | return "fail"; |
| | | } |
| | | log.error("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); |
| | | System.out.println("异步通知 " + Instant.now()); |
| | | } else { |
| | | System.out.println("验签失败"); |
| | | return "fail"; |
| | | } |
| | | return "success"; |
| | | } |
| | | |
| | | @ApiOperation(value = "订单支付成功后同步返回地址") |