[AppleScript] 纯文本查看 复制代码
/**
* 支付控制层
* @author Administrator
*
*/
@RestController
@RequestMapping("/pay")
public class PayController {
@Reference
private WeixinPayService weixinPayService;
@Reference
private SeckillOrderService seckillOrderService;
/**
* 生成二维码
* @return
*/
@RequestMapping("/createNative")
public Map createNative(){
//获取当前用户
String
userId=SecurityContextHolder.getContext().getAuthentication().getName();
//到 redis 查询秒杀订单
TbSeckillOrder seckillOrder =
seckillOrderService.searchOrderFromRedisByUserId(userId);
//判断秒杀订单存在
if(seckillOrder!=null){
long fen= (long)(seckillOrder.getMoney().doubleValue()*100);//金额(分)
return weixinPayService.createNative(seckillOrder.getId()+"",+fen+"");
}else{
return new HashMap();
}
}
}