| | |
| | | import com.yami.trading.service.c2c.C2cPaymentMethodService; |
| | | import com.yami.trading.service.syspara.SysparaService; |
| | | import com.yami.trading.service.user.UserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | return resultObject; |
| | | } |
| | | |
| | | @ApiOperation("校验是否设置支付方式") |
| | | @GetMapping(action + "payMethodCheck.action") |
| | | public Object payMethodCheck(HttpServletRequest request) { |
| | | String order_no = request.getParameter("order_no"); |
| | | Result resultObject = new Result(); |
| | | |
| | | try { |
| | | String partyId = SecurityUtils.getCurrentUserId(); |
| | | if (null == partyId) { |
| | | throw new BusinessException("请重新登录"); |
| | | } |
| | | C2cOrder order = this.c2cOrderService.get(order_no); |
| | | if (null == order) { |
| | | throw new BusinessException("订单不存在"); |
| | | } |
| | | if (order.getMethodType() == 0) { |
| | | throw new BusinessException("订单已提交,请等待商家设置收款方式"); |
| | | } |
| | | resultObject.setCode(0); |
| | | } catch (BusinessException e) { |
| | | resultObject.setCode(1); |
| | | resultObject.setMsg(e.getMessage()); |
| | | log.error("error: {}", e.getMessage()); |
| | | } catch (Throwable t) { |
| | | resultObject.setCode(1); |
| | | //resultObject.setMsg("程序错误"); |
| | | resultObject.setMsg(t.getMessage()); |
| | | log.error("error:", t); |
| | | } |
| | | return resultObject; |
| | | } |
| | | |
| | | @RequestMapping(action + "pay_finish.action") |
| | | public Object pay_finish(HttpServletRequest request) { |
| | | String order_no = request.getParameter("order_no"); |