| | |
| | | List<JhyOrder> addressExist = jhyOrderMapper.selectJhyOrderListByStatus(StrUtil.split("1,2", ','), orderDto.getUserId()); |
| | | if (CollUtil.isNotEmpty(addressExist)) { |
| | | for (JhyOrder order : addressExist) { |
| | | String orderAddr = order.getArea() + order.getAddress() + order.getUnitName() + order.getHouseNumber(); |
| | | String orderAddr = order.getArea() |
| | | + order.getAddress() |
| | | + (StrUtil.isEmpty(order.getUnitName())?"":order.getUnitName()) |
| | | + (StrUtil.isEmpty(order.getHouseNumber())?"":order.getHouseNumber()); |
| | | |
| | | if (orderAddr.equals(addressInfo.getAddressArea() + addressInfo.getDetailAddress() + addressInfo.getHouseName() + addressInfo.getUnitName() + addressInfo.getHouseNumber())) { |
| | | if (orderAddr.equals(addressInfo.getAddressArea() |
| | | + addressInfo.getDetailAddress() |
| | | + (StrUtil.isEmpty(addressInfo.getHouseName())?"":addressInfo.getHouseName()) |
| | | + (StrUtil.isEmpty(addressInfo.getUnitName())?"":addressInfo.getUnitName()) |
| | | + (StrUtil.isEmpty(addressInfo.getHouseNumber())?"":addressInfo.getHouseNumber()))) { |
| | | throw new RestException(-3, "同一地址仅能有一单在进行中"); |
| | | } |
| | | } |
| | |
| | | |
| | | BigDecimal total = BigDecimal.ZERO; |
| | | for (JhyOrderItems item : items) { |
| | | item.setPrice(item.getPrice().multiply(BigDecimal.valueOf(40))); |
| | | item.setPrice(item.getPrice().multiply(BigDecimal.valueOf(Constants.PRICE_SCORE_EXCHANGE))); |
| | | total = total.add(StrUtil.isNotBlank(item.getScore()) ? new BigDecimal(item.getScore()) : BigDecimal.ZERO); |
| | | } |
| | | |
| | |
| | | orderItems.setItemType(item.getId()); |
| | | orderItems.setTitle(environmentalInfo.getTitle()); |
| | | orderItems.setPrice(new BigDecimal(environmentalInfo.getPrice())); |
| | | BigDecimal total = orderItems.getPrice().multiply(BigDecimal.valueOf(40)).multiply(weight); |
| | | BigDecimal total = orderItems.getPrice().multiply(BigDecimal.valueOf(Constants.PRICE_SCORE_EXCHANGE)).multiply(weight); |
| | | orderItems.setScore(total.setScale(0, BigDecimal.ROUND_DOWN).toString()); |
| | | orderItems.setWeight(weight); |
| | | jhyOrderItemsMapper.insert(orderItems); |
| | |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public List<JhyInfo> findJhyInfoInRange(Long addressId) { |
| | | return jhyInfoMapper.selectJhyInfoListInAddressRange(addressId); |
| | | } |
| | | } |