| | |
| | | private ComBatteryCommodityOrderBargainRecordMapper orderBargainRecordMapper; |
| | | @Value("${min.app.isTest}") |
| | | private Boolean isTest; |
| | | @Value("${min.app.isRefundTest}") |
| | | private Boolean isRefundTest; |
| | | @Value("${min.app.appid}") |
| | | private String appid; |
| | | @Value("${min.app.payKey}") |
| | | private String payKey; |
| | | @Value("${min.app.mchId}") |
| | | private String mchId; |
| | | @Value("${min.app.currencyNotifyUrl}") |
| | | private String currencyNotifyUrl; |
| | | // @Value("${min.app.currencyNotifyUrl}") |
| | | // private String currencyNotifyUrl; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | |
| | | return R.fail("该商品库存不足,无法下单"); |
| | | } |
| | | //查询用户信息 |
| | | SysUser user = userMapper.selectById(orderDto.getUserId()); |
| | | SysUser user = userMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId,orderDto.getUserId())); |
| | | if(user == null){ |
| | | return R.fail("未查询到用户信息"); |
| | | } |
| | |
| | | ComBatteryCommodityOrder commodityOrder = getCreateOrder(commodity,userAddress,user,commoditySpecs,orderDto,nowDate,commodityActivity); |
| | | Map<String,Object> resultMap = new HashMap<>(2); |
| | | if(commodityOrderMapper.insert(commodityOrder) > 0){ |
| | | //更新活动商品库存 |
| | | commodityActivity.setCommoditySaleNum(commodityActivity.getCommoditySaleNum() + orderDto.getCount()); |
| | | commodityActivityMapper.updateById(commodityActivity); |
| | | //更新商品库存 |
| | | commoditySpecs.setStock(commoditySpecs.getStock() - orderDto.getCount()); |
| | | commoditySpecsMapper.updateById(commoditySpecs); |
| | |
| | | money = BigDecimal.valueOf(0.01); |
| | | } |
| | | // 调用wx支付 |
| | | result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_ACTIVITY_PAY_NOTIFY_URL |
| | | , remark, openId, orderNo, money,type); |
| | | // result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_ACTIVITY_PAY_NOTIFY_URL |
| | | // , remark, openId, orderNo, money,type); |
| | | log.info("用户购买商品微信支付返回参数:" + result); |
| | | return result; |
| | | } |