123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- package com.ydd.app.service.impl;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.ydd.app.dto.OrderValuationDto;
- import com.ydd.app.dto.OrderValuationReq;
- import com.ydd.app.dto.ValuationRes;
- import com.ydd.app.response.OrderValuationResponse;
- import com.ydd.app.service.OpenApiOrderValuationService;
- import com.ydd.app.vo.OrderValuationVo;
- import com.ydd.common.constant.BillingConstant;
- import com.ydd.common.core.domain.ResponseResult;
- import com.ydd.common.enums.DeliveryTypeEnums;
- import com.ydd.common.enums.ResponseResultCodeEnum;
- import com.ydd.common.utils.SnCodeUtils;
- import com.ydd.common.utils.StringUtils;
- import com.ydd.ecloud.core.utils.BigDecimalUtils;
- import com.ydd.module.domain.*;
- import com.ydd.module.dto.*;
- import com.ydd.module.enums.*;
- import com.ydd.module.service.*;
- import lombok.RequiredArgsConstructor;
- import lombok.extern.slf4j.Slf4j;
- import org.apache.commons.collections4.CollectionUtils;
- import org.apache.commons.compress.utils.Lists;
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.math.BigDecimal;
- import java.util.*;
- import java.util.stream.Collectors;
- /**
- * 开放接口-订单计价ServiceImpl
- * @author 叶君翔
- * @date 2022/04/08 15:51
- */
- @Slf4j
- @Service
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- public class OpenApiOrderValuationServiceImpl implements OpenApiOrderValuationService {
- private final IShopService iShopService;
- private final IMemberService iMemberService;
- private final IProductService iProductService;
- private final IPackageCityConfigService iPackageCityConfigService;
- private final IPackageDeliveryService iPackageDeliveryService;
- private final IPackageDiscountService iPackageDiscountService;
- private final IPackageDiscountDetailService iPackageDiscountDetailService;
- private final IPackageCommissionService iPackageCommissionService;
- private final IPackageCommissionDetailService iPackageCommissionDetailService;
- private final IDspDeliveryService iDspDeliveryService;
- private final IShopDeliveryDisableService iShopDeliveryDisableService;
- private final IShopDeliveryService iShopDeliveryService;
- private final IMemberConfigService iMemberConfigService;
- @Override
- public ResponseResult valuation(OrderValuationReq valuationReq) {
- OrderValuationDto valuationDto = new OrderValuationDto();
- // 参数校验
- ResponseResult result = this.validParam(valuationReq, valuationDto);
- if (result.getCode() != ResponseResultCodeEnum.SUCCESS.getCode()) {
- return result;
- }
- Product product = iProductService.getById(valuationReq.getCategoryId());
- if (product == null) {
- return ResponseResult.error(ResponseResultCodeEnum.CATEGORY_NOT_EXIST);
- }
- valuationDto.setProduct(product);
- valuationDto.setOrderSn(SnCodeUtils.createSn());
- valuationDto.setTakeType(0);
- // 开放平台大商户对应的用户
- Member member = iMemberService.getOne(new QueryWrapper<Member>().eq("member_type", MemberTypeEnum.MERCHANT.type).eq("merchant_id", valuationDto.getMerchantId()));
- // 获取最匹配的运力包(门店 > 城市 > 全国)
- Long deliveryPackageId = iPackageCityConfigService.getPackageId(valuationDto.getShopId(), member, null, PackageCityConfigPackageTypeEnum.DELIVERY.type);
- List<Integer> types = Lists.newArrayList();
- PackageDeliveryDto packageDeliveryDto = null;
- if (deliveryPackageId != null) {
- packageDeliveryDto = iPackageDeliveryService.getDeliveryDtoByPackageIdAndDeliveryType(deliveryPackageId);
- List<PackageDeliveryDetailDto> deliveryDetailDtoList = packageDeliveryDto.getPackageDeliveryDetailDtoList();
- if (CollectionUtils.isNotEmpty(deliveryDetailDtoList)) {
- types = deliveryDetailDtoList.stream().map(PackageDeliveryDetailDto::getDeliveryType).collect(Collectors.toList());
- }
- }
- // 获取门店屏蔽运力
- List<Integer> disableDeliveryTypes = iShopDeliveryDisableService.list(new QueryWrapper<ShopDeliveryDisable>()
- .eq("shop_id", valuationDto.getShopId()).eq("deleted", 0))
- .stream().map(ShopDeliveryDisable::getDeliveryType).collect(Collectors.toList());
- if (CollectionUtils.isNotEmpty(disableDeliveryTypes)) {
- types.removeAll(disableDeliveryTypes);
- }
- // 获取可用发单运力
- List<DeliveryInfo> deliveryInfos = this.getDeliveryInfos(valuationDto, types);
- if (CollectionUtils.isEmpty(deliveryInfos)) {
- log.warn("无可用发单运力!");
- return ResponseResult.error(ResponseResultCodeEnum.NO_DELIVERY);
- }
- List<Integer> deliveryTypes = deliveryInfos.stream().map(DspDelivery::getType).collect(Collectors.toList());
- // 获取最匹配的优惠包(门店 > 代理商 > 全国)
- Long discountPackageId = iPackageCityConfigService.getPackageId(valuationDto.getShopId(), member, null, PackageCityConfigPackageTypeEnum.DISCOUNT.type);
- Map<Integer, List<PackageDiscountDetailDto>> packageDiscountMap = new HashMap<>();
- if (discountPackageId != null) {
- List<PackageDiscountDetailDto> discountDetailDtoList = iPackageDiscountDetailService.getDiscountListByPackageIdAndDeliveryType(discountPackageId, deliveryTypes);
- packageDiscountMap = discountDetailDtoList.stream().collect(Collectors.groupingBy(PackageDiscountDetailDto::getDeliveryType));
- }
- // 获取最匹配的佣金包(门店 > 代理商 > 全国)
- Long commissionPackageId = iPackageCityConfigService.getPackageId(valuationDto.getShopId(), member, null, PackageCityConfigPackageTypeEnum.COMMISSION.type);
- Map<Integer, List<PackageCommissionDetailDto>> packageCommissionMap = new HashMap<>();
- if (commissionPackageId != null) {
- List<PackageCommissionDetailDto> commissionDetailDtoList = iPackageCommissionDetailService.getCommissionListByPackageIdAndDeliveryType(commissionPackageId, deliveryTypes);
- packageCommissionMap = commissionDetailDtoList.stream().collect(Collectors.groupingBy(PackageCommissionDetailDto::getDeliveryType));
- }
- // 计价
- List<ValuationRes> list = this.getValuationResList(member, valuationDto, deliveryInfos, packageDeliveryDto, packageDiscountMap, packageCommissionMap);
- // 默认价格优先
- list.sort(Comparator.comparing(ValuationRes::getDeliveryAmount));
- // 运力包发单类型为自定义, 则先按照sort排,再按价格排
- if (packageDeliveryDto != null && PackageDeliveryTypeEnum.CUSTOM.type.equals(packageDeliveryDto.getType())) {
- Collections.sort(list);
- }
- // 处理发单运力
- List<ValuationRes> billList = this.handleBillList(member.getId(), list);
- // 设置发单时长
- if (packageDeliveryDto != null) {
- billList = this.setBillingDuration(packageDeliveryDto, billList);
- }
- // todo: 计价结果缓存到redis, 10分钟有效
- // 数据转换
- List<OrderValuationVo> valuationVos = this.convertResult(billList);
- OrderValuationResponse response = OrderValuationResponse.builder().valuationList(valuationVos).outOrderSn(valuationReq.getOutOrderSn()).build();
- return ResponseResult.success(response);
- }
- private List<OrderValuationVo> convertResult(List<ValuationRes> billList) {
- // todo: 数据转换
- return null;
- }
- private List<ValuationRes> handleBillList(Long memberId, List<ValuationRes> list) {
- // 查询下单设置推荐屏蔽运力
- List<ValuationRes> billList = Lists.newArrayList();
- MemberConfig config = iMemberConfigService.getOne(new QueryWrapper<MemberConfig>().eq("member_id", memberId));
- if (config != null) {
- if (StringUtils.isNotEmpty(config.getBillDeliveryIds())) {
- List<String> billDeliveryIds = Arrays.asList(config.getBillDeliveryIds().split(","));
- // 过滤出商家设置的推荐运力, 计价页面靠前显示
- billList = list.stream().filter(a -> billDeliveryIds.contains(a.getDeliveryId().toString())).collect(Collectors.toList());
- }
- if (StringUtils.isNotEmpty(config.getShieldDeliveryIds())) {
- List<String> shieldDeliveryIds = Arrays.asList(config.getShieldDeliveryIds().split(","));
- // 过滤掉商家设置的屏蔽运力
- list = list.stream().filter(a -> !shieldDeliveryIds.contains(a.getDeliveryId().toString())).collect(Collectors.toList());
- }
- }
- list.removeAll(billList);
- billList.addAll(list);
- // 闪送距离替换
- Optional<ValuationRes> optional = billList.stream().filter(item -> !item.getDeliveryType().equals(DeliveryTypeEnums.SHAN_SONG.getType())).findFirst();
- if (optional.isPresent()) {
- String desc = optional.get().getDesc();
- for (ValuationRes res1 : billList) {
- if (DeliveryTypeEnums.SHAN_SONG.getType().equals(res1.getDeliveryType())) {
- res1.setDesc(desc);
- break;
- }
- }
- }
- return billList;
- }
- private List<ValuationRes> getValuationResList(Member member, OrderValuationDto valuationDto, List<DeliveryInfo> deliveryInfos, PackageDeliveryDto packageDeliveryDto, Map<Integer, List<PackageDiscountDetailDto>> packageDiscountMap, Map<Integer, List<PackageCommissionDetailDto>> packageCommissionMap) {
- List<ValuationRes> valuationResList = Lists.newArrayList();
- for (DeliveryInfo info : deliveryInfos) {
- // 计价
- ValuationRes valuationRes = this.doValuation(valuationDto, info, valuationDto.getMerchantId(), valuationDto.getShopId());
- if (valuationRes == null) {
- continue;
- }
- valuationRes.setPreferredDelivery(info.getPreferredDelivery());
- valuationRes.setOriginalMoney(valuationRes.getDeliveryAmount());
- // 设置排序
- if (packageDeliveryDto != null && PackageDeliveryTypeEnum.CUSTOM.type.equals(packageDeliveryDto.getType())) {
- this.setBillingSort(packageDeliveryDto, valuationRes);
- }
- // 设置优惠
- if (packageDiscountMap.size() > 0) {
- this.setDiscountInfo(packageDiscountMap.get(info.getType()), valuationRes);
- }
- // 设置佣金
- if (packageCommissionMap.size() > 0) {
- this.setCommissionInfo(packageCommissionMap.get(info.getType()), valuationRes);
- }
- valuationRes.setIsMerchant(info.getIsMerchant());
- if (valuationRes.getIsMine() == 0) {
- // 校验余额是否充足
- if (member.getAmount().compareTo(valuationRes.getDeliveryAmount()) >= 0) {
- valuationRes.setIsEnough(StatusEnum.SHOW.status);
- }
- }
- valuationResList.add(valuationRes);
- }
- return valuationResList;
- }
- private ValuationRes doValuation(OrderValuationDto valuationDto, DeliveryInfo info, Long merchantId, Long shopId) {
- // todo: 计价主逻辑
- return null;
- }
- private void setBillingSort(PackageDeliveryDto packageDeliveryDto, ValuationRes valuationRes) {
- List<PackageDeliveryDetailDto> deliveryDetailDtoList = packageDeliveryDto.getPackageDeliveryDetailDtoList();
- if (CollectionUtils.isNotEmpty(deliveryDetailDtoList)) {
- Optional<PackageDeliveryDetailDto> optional = deliveryDetailDtoList.stream().filter(item -> valuationRes.getDeliveryType().equals(item.getDeliveryType())).findFirst();
- if (optional.isPresent()) {
- PackageDeliveryDetailDto packageDeliveryDetailDto = optional.get();
- valuationRes.setSort((packageDeliveryDetailDto.getSort() == null || packageDeliveryDetailDto.getSort() == 0) ? BillingConstant.DEFAULT_BILL_SORT : packageDeliveryDetailDto.getSort());
- }
- }
- }
- private List<ValuationRes> setBillingDuration(PackageDeliveryDto packageDeliveryDto, List<ValuationRes> billList) {
- String billDurationStr = packageDeliveryDto.getBillDurationStr();
- List<PackageDeliveryDetailDto> deliveryDetailList = packageDeliveryDto.getPackageDeliveryDetailDtoList();
- if (StringUtils.isNotEmpty(billDurationStr) && CollectionUtils.isNotEmpty(deliveryDetailList)) {
- String[] split = billDurationStr.split(",");
- if (PackageDeliveryTypeEnum.CUSTOM.type.equals(packageDeliveryDto.getType())) {
- deliveryDetailList = deliveryDetailList.stream().filter(item -> item.getSort() != null && item.getSort() > 0).collect(Collectors.toList());
- deliveryDetailList.sort(Comparator.comparing(PackageDeliveryDetailDto::getSort));
- for (int i = 0; i < deliveryDetailList.size(); i++) {
- PackageDeliveryDetailDto packageDeliveryDetailDto = deliveryDetailList.get(i);
- if (i < split.length) {
- packageDeliveryDetailDto.setBillDuration(Integer.parseInt(split[i]));
- }
- }
- for (ValuationRes valuationRes : billList) {
- int billDuration = BillingConstant.DEFAULT_BILL_DURATION;
- Optional<PackageDeliveryDetailDto> optional = deliveryDetailList.stream().filter(item -> item.getDeliveryType().equals(valuationRes.getDeliveryType())).findAny();
- if (optional.isPresent()) {
- PackageDeliveryDetailDto packageDeliveryDetailDto = optional.get();
- billDuration = packageDeliveryDetailDto.getBillDuration();
- }
- valuationRes.setBillDuration(billDuration == 0 ? BillingConstant.DEFAULT_BILL_DURATION : billDuration);
- }
- } else {
- for (int i = 0; i < billList.size(); i++) {
- ValuationRes valuationRes = billList.get(i);
- int billDuration = BillingConstant.DEFAULT_BILL_DURATION;
- if (i < split.length) {
- billDuration = Integer.parseInt(split[i]);
- }
- valuationRes.setBillDuration(billDuration);
- }
- }
- } else {
- billList = billList.stream().map(valuationRes -> valuationRes.setBillDuration(BillingConstant.DEFAULT_BILL_DURATION)).collect(Collectors.toList());
- }
- return billList;
- }
- private void setCommissionInfo(List<PackageCommissionDetailDto> packageCommissionDetailDtoList, ValuationRes valuationRes) {
- BigDecimal commission = BigDecimal.ZERO;
- if (valuationRes.getIsMine() == 1 || DeliveryTypeEnums.HUO_LA_LA.getType().equals(valuationRes.getDeliveryType())) {
- valuationRes.setCommission(commission);
- return;
- }
- if (CollectionUtils.isNotEmpty(packageCommissionDetailDtoList) && packageCommissionDetailDtoList.size() > 0) {
- PackageCommissionDetailDto packageCommissionDetailDto = packageCommissionDetailDtoList.get(0);
- if (PackageCommissionTypeEnum.RATE.type.equals(packageCommissionDetailDto.getCommissionType())) {
- if (packageCommissionDetailDto.getValue() != null) {
- commission = packageCommissionDetailDto.getValue().multiply(valuationRes.getDeliveryAmount())
- .divide(new BigDecimal("100"), BigDecimal.ROUND_HALF_UP).setScale(6, BigDecimal.ROUND_HALF_UP);
- }
- } else if (PackageDiscountDetailTypeEnum.GRADIENT.type.equals(packageCommissionDetailDto.getCommissionType())) {
- for (PackageCommissionDetailDto item : packageCommissionDetailDtoList) {
- boolean inRange = BigDecimalUtils.inRange(item.getLeftValue(), item.getRightValue(), valuationRes.getDeliveryAmount());
- if (inRange) {
- if (item.getValue() != null) {
- commission = item.getValue();
- }
- break;
- }
- }
- }
- }
- valuationRes.setCommission(commission);
- valuationRes.setDeliveryAmount(commission.add(valuationRes.getDeliveryAmount()));
- }
- private void setDiscountInfo(List<PackageDiscountDetailDto> discountDetailDtoList, ValuationRes valuationRes) {
- if (valuationRes.getIsMine() == 1) {
- return;
- }
- if (CollectionUtils.isNotEmpty(discountDetailDtoList) && discountDetailDtoList.size() > 0) {
- PackageDiscountDetailDto discountDetailDto = discountDetailDtoList.get(0);
- if (PackageDiscountDetailTypeEnum.ZHE_KOU.type.equals(discountDetailDto.getType())) {
- if (discountDetailDto.getValue() != null) {
- BigDecimal discountValue = discountDetailDto.getValue().multiply(valuationRes.getDeliveryAmount())
- .divide(BigDecimal.TEN, BigDecimal.ROUND_HALF_UP).setScale(6, BigDecimal.ROUND_HALF_UP);
- double abs = Math.abs(valuationRes.getDeliveryAmount().subtract(discountValue).doubleValue());
- if (discountDetailDto.getMaxValue() != null) {
- abs = Math.min(abs, discountDetailDto.getMaxValue().doubleValue());
- }
- // 判断是优惠还是提价
- boolean positiveNum = discountValue.subtract(valuationRes.getDeliveryAmount()).compareTo(BigDecimal.ZERO) >= 0;
- if (positiveNum) {
- valuationRes.setDeliveryAmount(valuationRes.getDeliveryAmount().add(new BigDecimal(abs)));
- } else {
- valuationRes.setDeliveryAmount(valuationRes.getDeliveryAmount().subtract(new BigDecimal(abs)));
- }
- valuationRes.setZk(discountDetailDto.getValue());
- }
- } else if (PackageDiscountDetailTypeEnum.GRADIENT.type.equals(discountDetailDto.getType())) {
- for (PackageDiscountDetailDto item : discountDetailDtoList) {
- boolean inRange = BigDecimalUtils.inRange(item.getLeftValue(), item.getRightValue(), valuationRes.getDeliveryAmount());
- if (inRange) {
- if (item.getValue() != null) {
- BigDecimal discountAmount = valuationRes.getDeliveryAmount().subtract(item.getValue());
- valuationRes.setDeliveryAmount(discountAmount.compareTo(BigDecimal.ZERO) > 0 ? discountAmount : BigDecimal.ZERO);
- valuationRes.setMj(item.getValue());
- }
- break;
- }
- }
- }
- }
- }
- private List<DeliveryInfo> getDeliveryInfos(OrderValuationDto valuationDto, List<Integer> types) {
- List<DspDelivery> list = iDspDeliveryService.list(new QueryWrapper<DspDelivery>()
- .isNotNull("parent_id")
- .eq("status", StatusEnum.SHOW.status)
- .eq("deleted", IsDeleteEnum.NORMAL.status)
- .ne("type", DeliveryTypeEnums.HUO_LA_LA.getType())
- .in(CollectionUtils.isNotEmpty(types), "type", types));
- List<DeliveryInfo> infos = Lists.newArrayList();
- List<Integer> deliveryTypes = Arrays.asList(DeliveryTypeEnums.DADA.getType(), DeliveryTypeEnums.DADA_YZ.getType(),
- DeliveryTypeEnums.DWD.getType(), DeliveryTypeEnums.FENG_NIAO.getType(), DeliveryTypeEnums.FENG_NIAO_PT.getType(),
- DeliveryTypeEnums.MEI_TUAN.getType(), DeliveryTypeEnums.SHAN_SONG.getType(), DeliveryTypeEnums.SHUN_FENG.getType());
- List<Long> deliveryIds = list.stream().map(DspDelivery::getId).collect(Collectors.toList());
- Map<String, List<ShopDelivery>> deliveryMap = new HashMap<>();
- if (CollectionUtils.isNotEmpty(deliveryIds)) {
- deliveryMap = iShopDeliveryService.list(new QueryWrapper<ShopDelivery>()
- .eq("merchant_id", valuationDto.getMerchantId())
- .in("delivery_id", deliveryIds)
- .eq("deleted", IsDeleteEnum.NORMAL.status)
- .eq("shop_id", valuationDto.getShopId())
- .eq("bind_status",1))
- .stream()
- .collect(Collectors.groupingBy(item -> item.getDeliveryId() + "-" + item.getMerchantId() + "-" + item.getShopId()));
- }
- for (DspDelivery delivery : list) {
- DeliveryInfo info = new DeliveryInfo();
- BeanUtils.copyProperties(delivery, info);
- if (deliveryTypes.contains(info.getType()) && valuationDto.getMerchantId() != null && valuationDto.getShopId() != null) {
- List<ShopDelivery> shopDeliveries = deliveryMap.get(info.getId() + "-" + valuationDto.getMerchantId() + "-" + valuationDto.getShopId());
- ShopDelivery sd = new ShopDelivery();
- if (CollectionUtils.isNotEmpty(shopDeliveries)) {
- sd = shopDeliveries.get(0);
- }
- if (sd.getThirdShopId() != null && (DeliveryTypeEnums.DADA.getType().equals(info.getType())
- || DeliveryTypeEnums.DADA_YZ.getType().equals(info.getType())
- || DeliveryTypeEnums.SHAN_SONG.getType().equals(info.getType()))) {
- info.setShopId(sd.getThirdShopId());
- }
- if(sd.getThirdShopId() != null && (DeliveryTypeEnums.FENG_NIAO.getType().equals(info.getType())
- || DeliveryTypeEnums.FENG_NIAO_PT.getType().equals(info.getType())
- || DeliveryTypeEnums.MEI_TUAN.getType().equals(info.getType()))) {
- info.setThirdShopId(sd.getThirdShopId());
- }
- }
- info.setIsMine(0);
- infos.add(info);
- }
- return infos;
- }
- private ResponseResult validParam(OrderValuationReq valuationReq, OrderValuationDto valuationDto) {
- ResponseResult result = ResponseResult.success();
- if (StringUtils.isBlank(valuationReq.getShopCode())) {
- if (StringUtils.isBlank(valuationReq.getSendName())) {
- return ResponseResult.error(ResponseResultCodeEnum.FIELD_EMPTY, "发件人名称", null);
- }
- if (StringUtils.isBlank(valuationReq.getSendPhone())) {
- return ResponseResult.error(ResponseResultCodeEnum.FIELD_EMPTY, "发件人联系电话", null);
- }
- if (StringUtils.isBlank(valuationReq.getSendProvinceName())) {
- return ResponseResult.error(ResponseResultCodeEnum.FIELD_EMPTY, "发件人所在省", null);
- }
- if (StringUtils.isBlank(valuationReq.getSendCityName())) {
- return ResponseResult.error(ResponseResultCodeEnum.FIELD_EMPTY, "发件人所在市", null);
- }
- if (StringUtils.isBlank(valuationReq.getSendAddress())) {
- return ResponseResult.error(ResponseResultCodeEnum.FIELD_EMPTY, "发件人详细地址", null);
- }
- if (StringUtils.isBlank(valuationReq.getSendLng())) {
- return ResponseResult.error(ResponseResultCodeEnum.FIELD_EMPTY, "发件人纬度", null);
- }
- if (StringUtils.isBlank(valuationReq.getSendLat())) {
- return ResponseResult.error(ResponseResultCodeEnum.FIELD_EMPTY, "发件人经度", null);
- }
- } else {
- Shop shop = iShopService.getByCode(valuationReq.getShopCode());
- if (shop == null) {
- return ResponseResult.error(ResponseResultCodeEnum.SHOP_NOT_EXIST);
- }
- valuationReq.setSendName(shop.getContactName());
- valuationReq.setSendPhone(shop.getMobile());
- valuationReq.setSendProvinceName(shop.getProvinceName());
- valuationReq.setSendCityName(shop.getCityName());
- valuationReq.setSendDistrictName(shop.getDistrictName());
- valuationReq.setSendAddress(shop.getAddress());
- valuationReq.setSendHouseNumber(shop.getStreet());
- valuationReq.setSendLat(shop.getLat());
- valuationReq.setSendLng(shop.getLng());
- valuationDto.setShopId(shop.getId());
- valuationDto.setShopName(shop.getName());
- valuationDto.setMerchantId(shop.getMerchantId());
- }
- BeanUtils.copyProperties(valuationReq, valuationDto);
- return result;
- }
- }
|