| | |
| | | @PostMapping(value = "/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result add(@RequestBody GbzAddDto gbzAddDto) { |
| | | String status = redisUtils.getString("bea_order_status"); |
| | | if (!"1".equals(status)) { |
| | | return Result.fail("无法购买"); |
| | | // String status = redisUtils.getString("bea_order_status"); |
| | | // if ("1".equals(status)) { |
| | | // return Result.fail("无法购买"); |
| | | // } |
| | | |
| | | String start = redisUtils.getString("bea_start"); |
| | | if ("2".equals(start)) { |
| | | return Result.fail("暂无法购买"); |
| | | } |
| | | |
| | | if (gbzAddDto.getCount() < 10) { |
| | | return Result.fail("最少购买数量为10个"); |
| | | } |
| | | |
| | | String total = redisUtils.getString("bea_coin_total"); |
| | | |
| | | MemberEntity loginUser = LoginUserUtils.getAppLoginUser(); |
| | | BigDecimal price = new BigDecimal(redisUtils.getString("bea_order_new_price")); |
| | | BigDecimal amount = BigDecimal.valueOf(gbzAddDto.getCount()).multiply(price); |
| | |
| | | |
| | | |
| | | String remain = redisUtils.getString("bea_coin_total"); |
| | | priceVo.setRemainCnt(88888); |
| | | priceVo.setRemainCnt(Integer.parseInt(remain)); |
| | | |
| | | BigDecimal totalAmount = gbzOrderDao.selectOrderTotalAmount(LoginUserUtils.getAppLoginUser().getId()); |
| | | priceVo.setTotalAmount(totalAmount); |