xiaoyong931011
2021-11-22 6c002508ad1de1d5e5c5fc37ee7a42bdabadf6e7
gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java
@@ -100,17 +100,24 @@
        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, "同一地址仅能有一单在进行中");
                }
            }
        }
        jhyOrder.setAddress(addressInfo.getDetailAddress()+addressInfo.getHouseName());
        jhyOrder.setUnitName(addressInfo.getUnitName());
        jhyOrder.setHouseNumber(addressInfo.getHouseNumber());
        jhyOrder.setAddress(addressInfo.getDetailAddress()+(StrUtil.isEmpty(addressInfo.getHouseName())?"":addressInfo.getHouseName()));
        jhyOrder.setUnitName(StrUtil.isEmpty(addressInfo.getUnitName())?"":addressInfo.getUnitName());
        jhyOrder.setHouseNumber(StrUtil.isEmpty(addressInfo.getHouseNumber())?"":addressInfo.getHouseNumber());
        jhyOrder.setUsername(addressInfo.getRelaName());
        jhyOrder.setPhone(addressInfo.getMobilePhone());
        jhyOrder.setLongitude(addressInfo.getLongitude());