| | |
| | | for (JhyOrder order : addressExist) { |
| | | String orderAddr = order.getArea() + order.getAddress() + order.getUnitName() + order.getHouseNumber(); |
| | | |
| | | if (orderAddr.equals(addressInfo.getAddressArea() + addressInfo.getDetailAddress() + addressInfo.getUnitName() + addressInfo.getHouseNumber())) { |
| | | if (orderAddr.equals(addressInfo.getAddressArea() + addressInfo.getDetailAddress() + addressInfo.getHouseName() + addressInfo.getUnitName() + addressInfo.getHouseNumber())) { |
| | | throw new RestException(-3, "同一地址仅能有一单在进行中"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | jhyOrder.setAddress(addressInfo.getDetailAddress()); |
| | | jhyOrder.setAddress(addressInfo.getDetailAddress()+addressInfo.getHouseName()); |
| | | jhyOrder.setUnitName(addressInfo.getUnitName()); |
| | | jhyOrder.setHouseNumber(addressInfo.getHouseNumber()); |
| | | jhyOrder.setUsername(addressInfo.getRelaName()); |
| | |
| | | JhyOrder order = jhyOrderMapper.selectByPrimaryKey(confirmDto.getOrderId()); |
| | | AccountInfo jhyAccount = accountMapper.selectAccountInfoByUserId(order.getJhyId()); |
| | | BigDecimal collectScore = StrUtil.isNotBlank(jhyAccount.getCollectScore()) ? new BigDecimal(jhyAccount.getCollectScore()) : BigDecimal.ZERO; |
| | | log.info("===={}======{}====", collectScore, totalScore); |
| | | if (totalScore.compareTo(collectScore) > 0) { |
| | | throw new RestException(-3, "剩余积分不足"); |
| | | } |
| | |
| | | distribService.distribRecord(order.getId(), order.getUserId()); |
| | | // 推荐返利 |
| | | distribService.inviteAddOrderScore(order.getUserId(), order.getId().toString()); |
| | | } catch (RestException e) { |
| | | throw new RestException(e.getMessage()); |
| | | } catch (Exception e) { |
| | | log.error("异常", e); |
| | | throw new RestException("支付失败"); |