diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ExpressMapper.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ExpressMapper.java new file mode 100644 index 000000000..90979affb --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/express/ExpressMapper.java @@ -0,0 +1,10 @@ +package cn.iocoder.yudao.module.shop.dal.mysql.express; + +import cn.iocoder.yudao.module.shop.dal.dataobject.express.ExpressDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ExpressMapper extends BaseMapper { + +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ExpressService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ExpressService.java new file mode 100644 index 000000000..8e579b951 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ExpressService.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.shop.service.express; + +import cn.iocoder.yudao.module.shop.dal.dataobject.express.ExpressDO; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * ExpressService 接口 + * +---------------------------------------------------------------------- + * | CRMEB [ CRMEB赋能开发者,助力企业发展 ] + * +---------------------------------------------------------------------- + * | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. + * +---------------------------------------------------------------------- + * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 + * +---------------------------------------------------------------------- + * | Author: CRMEB Team + * +---------------------------------------------------------------------- + */ +@Service +@Validated +public interface ExpressService { + + /** + * 查询快递公司 + * @param code 快递公司编号 + * @return ExpressDO + */ + ExpressDO getByCode(String code); + +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ExpressServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ExpressServiceImpl.java new file mode 100644 index 000000000..4d71df0b3 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ExpressServiceImpl.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.shop.service.express.impl; + + +import cn.iocoder.yudao.module.shop.dal.dataobject.express.ExpressDO; +import cn.iocoder.yudao.module.shop.dal.mysql.express.ExpressMapper; +import cn.iocoder.yudao.module.shop.service.express.ExpressService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +@Service +public class ExpressServiceImpl implements ExpressService { + + @Resource + private ExpressMapper dao; + /** + * 查询快递公司 + * @param code 快递公司编号 + */ + @Override + public ExpressDO getByCode(String code) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(ExpressDO::getCode, code); + ExpressDO expressDO = dao.selectOne(lqw); + return expressDO; + } +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java index c2e98567e..fa46ed6af 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java @@ -13,8 +13,10 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.pay.properties.AliPayProperties; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; +import cn.iocoder.yudao.module.shop.dal.dataobject.express.ExpressDO; import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; @@ -31,6 +33,8 @@ import cn.iocoder.yudao.module.shop.request.order.StoreOrderSendRequest; import cn.iocoder.yudao.module.shop.request.order.StoreOrderUpdatePriceRequest; import cn.iocoder.yudao.module.shop.response.member.InitOrderResponse; import cn.iocoder.yudao.module.shop.response.order.*; +import cn.iocoder.yudao.module.shop.service.express.ExpressService; +import cn.iocoder.yudao.module.shop.service.onepass.OnePassService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderInfoService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderRefundService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderService; @@ -43,6 +47,7 @@ import cn.iocoder.yudao.module.shop.utils.RedisUtil; import cn.iocoder.yudao.module.shop.vo.order.LogisticsResultVo; import cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram; import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo; +import cn.iocoder.yudao.module.shop.vo.product.MyRecord; import com.alipay.api.AlipayApiException; import com.alipay.api.internal.util.AlipaySignature; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -124,6 +129,15 @@ public class StoreOrderServiceImpl extends ServiceImpl { updateById(storeOrder); @@ -1488,6 +1502,56 @@ public class StoreOrderServiceImpl extends ServiceImpl orderIdList = new ArrayList<>(); +// orderIdList.add(storeOrder.getId()); +// HashMap> orderInfoMap = StoreOrderInfoService.getMapInId(orderIdList); +// if (orderInfoMap.isEmpty() || !orderInfoMap.containsKey(storeOrder.getId())) { +// throw new ServiceException("没有找到购买的商品信息"); +// } +// List productNameList = new ArrayList<>(); +// for (StoreOrderInfoOldVo storeOrderInfoVo : orderInfoMap.get(storeOrder.getId())) { +// productNameList.add(storeOrderInfoVo.getInfo().getProductName()); +// } +// +// record.set("cargo", String.join(",", productNameList));// 物品名称 +// if (express.getPartnerId()) { +// record.set("partner_id", express.getAccount());// 电子面单月结账号(部分快递公司必选) +// } +// if (express.getPartnerKey()) { +// record.set("partner_key", express.getPassword());// 电子面单密码(部分快递公司必选) +// } +// if (express.getNet()) { +// record.set("net", express.getNetName());// 收件网点名称(部分快递公司必选) +// } +// +// MyRecord myRecord = onePassService.expressDump(record); +// storeOrder.setDeliveryId(myRecord.getStr("kuaidinum")); +// } /** * 校验快递发货参数 */ @@ -1498,7 +1562,7 @@ public class StoreOrderServiceImpl extends ServiceImpl