diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigApi.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigApi.java index b72cfea4b..79492e80c 100644 --- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigApi.java +++ b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigApi.java @@ -24,4 +24,5 @@ public interface ApiConfigApi { * */ CommonResult getConfigKey( String key); + String getConfigKeyValue( String key); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigImpl.java index 58e2186ad..31595375f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/config/ApiConfigImpl.java @@ -50,4 +50,16 @@ public class ApiConfigImpl implements ApiConfigApi{ } return success(config.getValue()); } + + @Override + public String getConfigKeyValue(String key) { + ConfigDO config = configService.getConfigByKey(key); + if (config == null) { + return null; + } + if (!config.getVisible()) { + throw exception(ErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_VISIBLE); + } + return config.getValue(); + } } diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/CreateOrderRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/CreateOrderRequest.java index 42636003e..9e9b5b330 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/CreateOrderRequest.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/CreateOrderRequest.java @@ -40,10 +40,10 @@ public class CreateOrderRequest implements Serializable { private Integer shippingType; @Schema(description = "收货地址id") - private Integer addressId; + private Long addressId; @Schema(description = "优惠券编号") - private Integer couponId; + private Long couponId; @Schema(description = "支付类型:weixin-微信支付,yue-余额支付,alipay-支付宝支付") @NotBlank(message = "支付类型不能为空") diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/OrderComputedPriceRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/OrderComputedPriceRequest.java index 92650b4db..83590a4d6 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/OrderComputedPriceRequest.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/order/OrderComputedPriceRequest.java @@ -32,10 +32,10 @@ public class OrderComputedPriceRequest { private String preOrderNo; @Schema(description = "地址id") - private Integer addressId; + private Long addressId; @Schema(description = "优惠券id") - private Integer couponId; + private Long couponId; @Schema(description = "快递类型: 1-快递配送,2-到店自提") @NotNull(message = "快递类型不能为空") diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/StoreProductAttrValueAddRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/StoreProductAttrValueAddRequest.java index b6787e820..85ee696f5 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/StoreProductAttrValueAddRequest.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/StoreProductAttrValueAddRequest.java @@ -72,6 +72,9 @@ public class StoreProductAttrValueAddRequest implements Serializable { @DecimalMin(value = "0", message = "原价不能小于0") private BigDecimal otPrice; + @Schema(description= "商品条码(一维码)") + private String barCode; + @Schema(description= "重量", required = true) @NotNull(message = "规格属性重量不能为空") @DecimalMin(value = "0", message = "重量不能小于0") diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/product/AttrValueResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/product/AttrValueResponse.java index 69261c33c..5fad979cd 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/product/AttrValueResponse.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/product/AttrValueResponse.java @@ -54,6 +54,9 @@ public class AttrValueResponse implements Serializable { @Schema(description= "原价") private BigDecimal otPrice; + @Schema(description= "商品条码(一维码)") + private String barCode; + @Schema(description= "重量") private BigDecimal weight; diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/vo/order/OrderInfoVo.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/vo/order/OrderInfoVo.java index 06cd6a8f7..ce6a82caa 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/vo/order/OrderInfoVo.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/vo/order/OrderInfoVo.java @@ -45,7 +45,7 @@ public class OrderInfoVo { private BigDecimal payFee; @Schema(description = "地址id") - private Integer addressId; + private Long addressId; @Schema(description = "收货人姓名(前端用)") private String realName; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java index 5a037a619..b535a5a8b 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java @@ -48,4 +48,7 @@ public class ShippingTemplatesFreeRespVO implements Serializable { @NotNull(message = "请填写包邮金额") @DecimalMin(value = "0", message = "包邮金额不能低于0") private BigDecimal price; + + @Schema(description = "分组唯一值", required = true) + private String uniqid; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java index 07e9f152a..2dbd2744c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java @@ -34,7 +34,8 @@ public class ShippingTemplatesNoDeliveryRespVO implements Serializable { @NotNull(message = "请选择城市") private String cityId; - + @Schema(description = "分组唯一值", required = true) + private String uniqid; @Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4") private String provinceId; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java index d02fb3fd7..4bd4be343 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java @@ -55,4 +55,7 @@ public class ShippingTemplatesRegionRespVO implements Serializable { @DecimalMin(value = "0.1", message = "续件运费金额不能低于0.1") private BigDecimal renewalPrice; + @Schema(description = "分组唯一值", required = true) + private String uniqid; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesReqVO.java index 0bfe99592..6c1394473 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesReqVO.java @@ -57,7 +57,7 @@ public class ShippingTemplatesReqVO implements Serializable { private Boolean noDelivery; @Schema(description = "指定不送设置", required = true) - private List shippingTemplatesNoDeliveryRespVOS; + private ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS; @Schema(description = "排序", example = "0") @NotNull(message = "排序数字必须填写") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java index 90184ac0c..8a38f241e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesDO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.shop.dal.dataobject.express; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java index c43abbdc1..8dcbcb291 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java @@ -45,5 +45,10 @@ public class ShippingTemplatesNoDeliveryDO implements Serializable { private Integer provinceId; + /** + * 分组唯一值 + */ + private String uniqid; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java index 91d6e49a7..efcf7d02c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java @@ -43,6 +43,11 @@ public class ShippingTemplatesRegionDO implements Serializable { */ private Integer cityId; + /** + * 分组唯一值 + */ + private String uniqid; + private Integer provinceId; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/order/StoreOrder.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/order/StoreOrder.java index 5b95330b7..d9bbd7e5e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/order/StoreOrder.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/order/StoreOrder.java @@ -74,7 +74,7 @@ public class StoreOrder implements Serializable { private BigDecimal deductionPrice; @Schema(description = "优惠券id") - private Integer couponId; + private Long couponId; @Schema(description = "优惠券金额") private BigDecimal couponPrice; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java index ba98b4d93..a911950b4 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/ShippingTemplatesNoDeliveryService.java @@ -25,7 +25,7 @@ import java.util.List; @Validated public interface ShippingTemplatesNoDeliveryService extends IService { - void saveAll(List shippingTemplatesFreeRespVOList, Integer id); + void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesFreeRespVOList, Integer id); List getListGroup(Integer tempId); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java index 726d42337..aaf34226f 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesNoDeliveryServiceImpl.java @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliver import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.codec.digest.DigestUtils; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -36,22 +37,22 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl shippingTemplatesNoDeliveryRespVOS, Integer tempId) { + public void saveAll(ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVOS, Integer tempId) { ArrayList shippingTemplatesNoDeliveryDOS = new ArrayList<>(); delete(tempId); - for (ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO : shippingTemplatesNoDeliveryRespVOS) { - if(shippingTemplatesNoDeliveryRespVO.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVO.getCityId().equals("0")){ - cityIdList = getCityIdList(); - }else{ - cityIdList = StrUtils.stringToArray(shippingTemplatesNoDeliveryRespVO.getCityId()); - } - for (Integer cityId: cityIdList) { - ShippingTemplatesNoDeliveryDO shippingTemplatesNoDeliveryDO = new ShippingTemplatesNoDeliveryDO(); - shippingTemplatesNoDeliveryDO.setCityId(cityId); - shippingTemplatesNoDeliveryDO.setTempId(tempId); - shippingTemplatesNoDeliveryDOS.add(shippingTemplatesNoDeliveryDO); - } + String uniqueKey = DigestUtils.md5Hex(shippingTemplatesNoDeliveryRespVOS.toString()); + if(shippingTemplatesNoDeliveryRespVOS.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVOS.getCityId().equals("0")){ + cityIdList = getCityIdList(); + }else{ + cityIdList = StrUtils.stringToArray(shippingTemplatesNoDeliveryRespVOS.getCityId()); + } + for (Integer cityId: cityIdList) { + ShippingTemplatesNoDeliveryDO shippingTemplatesNoDeliveryDO = new ShippingTemplatesNoDeliveryDO(); + shippingTemplatesNoDeliveryDO.setCityId(cityId); + shippingTemplatesNoDeliveryDO.setUniqid(uniqueKey); + shippingTemplatesNoDeliveryDO.setTempId(tempId); + shippingTemplatesNoDeliveryDOS.add(shippingTemplatesNoDeliveryDO); } //批量保存模板数据 saveBatch(shippingTemplatesNoDeliveryDOS); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java index dbacf1fce..1ddad2340 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesRegionServiceImpl.java @@ -78,6 +78,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl shippingTemplatesNoDeliveryRespVOList = request.getShippingTemplatesNoDeliveryRespVOS(); - if(null != shippingTemplatesNoDeliveryRespVOList && shippingTemplatesNoDeliveryRespVOList.size() > 0){ - shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVOList, shippingTemplatesDO.getId()); + ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO = request.getShippingTemplatesNoDeliveryRespVOS(); + if(!ObjectUtil.isNull(shippingTemplatesNoDeliveryRespVO)){ + shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVO, shippingTemplatesDO.getId()); } - return true; } @@ -169,9 +168,9 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl shippingTemplatesNoDeliveryRespVOList = request.getShippingTemplatesNoDeliveryRespVOS(); - if(CollUtil.isNotEmpty(shippingTemplatesNoDeliveryRespVOList)){ - shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVOList, shippingTemplatesDO.getId()); + ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO= request.getShippingTemplatesNoDeliveryRespVOS(); + if(ObjectUtil.isNotNull(shippingTemplatesNoDeliveryRespVO)){ + shippingTemplatesNoDeliveryService.saveAll(shippingTemplatesNoDeliveryRespVO, shippingTemplatesDO.getId()); } return true; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java index 536346d02..9879a8370 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java @@ -6,7 +6,9 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.module.member.api.address.AddressApi; +import cn.iocoder.yudao.module.member.api.address.UserAddressApi; import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO; +import cn.iocoder.yudao.module.member.api.address.dto.UserAddressRespDTO; 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.constants.PayConstants; @@ -19,14 +21,21 @@ import cn.iocoder.yudao.module.shop.constants.SysConfigConstants; import cn.iocoder.yudao.module.shop.convert.order.StoreOrderConvert; import cn.iocoder.yudao.module.shop.convert.order.StoreOrderOneConvert; import cn.iocoder.yudao.module.shop.dal.dataobject.cat.StoreCart; +import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO; +import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesFreeDO; +import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesRegionDO; import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder; import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrderInfo; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProductAttrValue; +import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesMapper; import cn.iocoder.yudao.module.shop.dal.mysql.order.StoreOrderMapper; import cn.iocoder.yudao.module.shop.request.order.*; import cn.iocoder.yudao.module.shop.request.product.StoreProductReplyAddRequest; import cn.iocoder.yudao.module.shop.response.order.*; +import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesFreeService; +import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesRegionService; +import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesService; import cn.iocoder.yudao.module.shop.service.order.OrderService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderInfoService; import cn.iocoder.yudao.module.shop.service.order.StoreOrderService; @@ -110,16 +119,18 @@ public class OrderServiceImpl implements OrderService { @Autowired private AddressApi addressApi; + @Autowired + private UserAddressApi userAddressApi; -// @Autowired -// private ShippingTemplatesApi shippingTemplatesApi; -// -// @Autowired -// private ShippingTemplatesFreeApi shippingTemplatesFreeApi; -// -// @Autowired -// private ShippingTemplatesRegionApi shippingTemplatesRegionApi; + @Autowired + private ShippingTemplatesService shippingTemplatesApi; + + @Autowired + private ShippingTemplatesFreeService shippingTemplatesFreeApi; + + @Autowired + private ShippingTemplatesRegionService shippingTemplatesRegionApi; @Autowired private StoreProductService storeProductService; @@ -601,116 +612,116 @@ public class OrderServiceImpl implements OrderService { /** * 计算订单运费 */ - private void getFreightFee(OrderInfoVo orderInfoVo, AddressRespDTO userAddress) { -// // 判断是否满额包邮 type=1按件数 2按重量 3按体积 -// // 全场满额包邮开关 -// String postageSwitchString = apiConfigApi.getConfigKey(SysConfigConstants.STORE_FEE_POSTAGE_SWITCH).toString(); -// // 全场满额包邮金额 -// String storeFreePostageString = apiConfigApi.getConfigKey(SysConfigConstants.STORE_FEE_POSTAGE).toString(); -// BigDecimal storePostage = BigDecimal.ZERO; -// if (postageSwitchString.equals("true") && (storeFreePostageString.equals("0") || orderInfoVo.getProTotalFee().compareTo(new BigDecimal(storeFreePostageString)) >= 0)) { -// storePostage = BigDecimal.ZERO; -// } else if (ObjectUtil.isNull(userAddress) || userAddress.getCityId() <= 0) { -// // 用户地址不存在,默认运费为0元 -// storePostage = BigDecimal.ZERO; -// } else { -// // 有用户地址的情况下 -// // 运费根据商品计算 -// Map proMap = new HashMap<>(); -// orderInfoVo.getOrderDetailList().forEach(e -> { -// Integer proId = e.getProductId(); -// if (proMap.containsKey(proId)) { -// MyRecord record = proMap.get(proId); -// record.set("totalPrice", record.getBigDecimal("totalPrice").add(e.getPrice().multiply(BigDecimal.valueOf(e.getPayNum())))); -// record.set("totalNum", record.getInt("totalNum") + e.getPayNum()); -// BigDecimal weight = e.getWeight().multiply(BigDecimal.valueOf(e.getPayNum())); -// record.set("weight", record.getBigDecimal("weight").add(weight)); -// BigDecimal volume = e.getVolume().multiply(BigDecimal.valueOf(e.getPayNum())); -// record.set("volume", record.getBigDecimal("volume").add(volume)); -// } else { -// MyRecord record = new MyRecord(); -// record.set("totalPrice", e.getPrice().multiply(BigDecimal.valueOf(e.getPayNum()))); -// record.set("totalNum", e.getPayNum()); -// record.set("tempId", e.getTempId()); -// record.set("proId", proId); -// BigDecimal weight = e.getWeight().multiply(BigDecimal.valueOf(e.getPayNum())); -// record.set("weight", weight); -// BigDecimal volume = e.getVolume().multiply(BigDecimal.valueOf(e.getPayNum())); -// record.set("volume", volume); -// -// proMap.put(proId, record); -// } -// }); -// -// // 指定包邮(单品运费模板)> 指定区域配送(单品运费模板) -// int cityId = userAddress.getCityId(); -// -// for (Map.Entry m : proMap.entrySet()) { -// MyRecord value = m.getValue(); -// Integer tempId = value.getInt("tempId"); -// ShippingTemplatesDO shippingTemplatesDO = shippingTemplatesApi.getById(tempId); -// if (shippingTemplatesDO.getAppoint()) {// 指定包邮 -// // 判断是否在指定包邮区域内 -// // 必须满足件数 + 金额 才能包邮 -// ShippingTemplatesFreeDO shippingTemplatesFree = shippingTemplatesFreeApi.getByTempIdAndCityId(tempId, cityId); -// if (ObjectUtil.isNotNull(shippingTemplatesFree)) { // 在包邮区域内 -// BigDecimal freeNum = shippingTemplatesFree.getNumber(); -// BigDecimal multiply = value.getBigDecimal("totalPrice"); -// if (new BigDecimal(value.getInt("totalNum")).compareTo(freeNum) >= 0 && multiply.compareTo(shippingTemplatesFree.getPrice()) >= 0) { -// // 满足件数 + 金额 = 包邮 -// continue; -// } -// } -// } -// // 不满足指定包邮条件,走指定区域配送 -// ShippingTemplatesRegionDO shippingTemplatesRegion = shippingTemplatesRegionApi.getByTempIdAndCityId(tempId, cityId); -// if (ObjectUtil.isNull(shippingTemplatesRegion)) { -// throw new ServiceException("计算运费时,未找到全国运费配置"); -// } -// -// // 判断计费方式:件数、重量、体积 -// switch (shippingTemplatesDO.getType()) { -// case 1: // 件数 -// // 判断件数是否超过首件 -// Integer num = value.getInt("totalNum"); -// if (num <= shippingTemplatesRegion.getFirst().intValue()) { -// storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()); -// } else {// 超过首件的需要计算续件 -// int renewalNum = num - shippingTemplatesRegion.getFirst().intValue(); -// // 剩余件数/续件 = 需要计算的续件费用的次数 -// BigDecimal divide = new BigDecimal(renewalNum).divide(shippingTemplatesRegion.getRenewal(), 0, BigDecimal.ROUND_UP); -// BigDecimal renewalPrice = shippingTemplatesRegion.getRenewalPrice().multiply(divide); -// storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()).add(renewalPrice); -// } -// break; -// case 2: // 重量 -// BigDecimal weight = value.getBigDecimal("weight"); -// if (weight.compareTo(shippingTemplatesRegion.getFirst()) <= 0) { -// storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()); -// } else {// 超过首件的需要计算续件 -// BigDecimal renewalNum = weight.subtract(shippingTemplatesRegion.getFirst()); -// // 剩余件数/续件 = 需要计算的续件费用的次数 -// BigDecimal divide = renewalNum.divide(shippingTemplatesRegion.getRenewal(), 0, BigDecimal.ROUND_UP); -// BigDecimal renewalPrice = shippingTemplatesRegion.getRenewalPrice().multiply(divide); -// storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()).add(renewalPrice); -// } -// break; -// case 3: // 体积 -// BigDecimal volume = value.getBigDecimal("volume"); -// if (volume.compareTo(shippingTemplatesRegion.getFirst()) <= 0) { -// storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()); -// } else {// 超过首件的需要计算续件 -// BigDecimal renewalNum = volume.subtract(shippingTemplatesRegion.getFirst()); -// // 剩余件数/续件 = 需要计算的续件费用的次数 -// BigDecimal divide = renewalNum.divide(shippingTemplatesRegion.getRenewal(), 0, BigDecimal.ROUND_UP); -// BigDecimal renewalPrice = shippingTemplatesRegion.getRenewalPrice().multiply(divide); -// storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()).add(renewalPrice); -// } -// break; -// } -// } -// } -// orderInfoVo.setFreightFee(storePostage); + private void getFreightFee(OrderInfoVo orderInfoVo, UserAddressRespDTO userAddress) { + // 判断是否满额包邮 type=1按件数 2按重量 3按体积 + // 全场满额包邮开关 + String postageSwitchString = apiConfigApi.getConfigKey(SysConfigConstants.STORE_FEE_POSTAGE_SWITCH).toString(); + // 全场满额包邮金额 + String storeFreePostageString = apiConfigApi.getConfigKey(SysConfigConstants.STORE_FEE_POSTAGE).toString(); + BigDecimal storePostage = BigDecimal.ZERO; + if (postageSwitchString.equals("true") && (storeFreePostageString.equals("0") || orderInfoVo.getProTotalFee().compareTo(new BigDecimal(storeFreePostageString)) >= 0)) { + storePostage = BigDecimal.ZERO; + } else if (ObjectUtil.isNull(userAddress) || userAddress.getCityId() <= 0) { + // 用户地址不存在,默认运费为0元 + storePostage = BigDecimal.ZERO; + } else { + // 有用户地址的情况下 + // 运费根据商品计算 + Map proMap = new HashMap<>(); + orderInfoVo.getOrderDetailList().forEach(e -> { + Integer proId = e.getProductId(); + if (proMap.containsKey(proId)) { + MyRecord record = proMap.get(proId); + record.set("totalPrice", record.getBigDecimal("totalPrice").add(e.getPrice().multiply(BigDecimal.valueOf(e.getPayNum())))); + record.set("totalNum", record.getInt("totalNum") + e.getPayNum()); + BigDecimal weight = e.getWeight().multiply(BigDecimal.valueOf(e.getPayNum())); + record.set("weight", record.getBigDecimal("weight").add(weight)); + BigDecimal volume = e.getVolume().multiply(BigDecimal.valueOf(e.getPayNum())); + record.set("volume", record.getBigDecimal("volume").add(volume)); + } else { + MyRecord record = new MyRecord(); + record.set("totalPrice", e.getPrice().multiply(BigDecimal.valueOf(e.getPayNum()))); + record.set("totalNum", e.getPayNum()); + record.set("tempId", e.getTempId()); + record.set("proId", proId); + BigDecimal weight = e.getWeight().multiply(BigDecimal.valueOf(e.getPayNum())); + record.set("weight", weight); + BigDecimal volume = e.getVolume().multiply(BigDecimal.valueOf(e.getPayNum())); + record.set("volume", volume); + + proMap.put(proId, record); + } + }); + + // 指定包邮(单品运费模板)> 指定区域配送(单品运费模板) + int cityId = userAddress.getCityId(); + + for (Map.Entry m : proMap.entrySet()) { + MyRecord value = m.getValue(); + Integer tempId = value.getInt("tempId"); + ShippingTemplatesDO shippingTemplatesDO = shippingTemplatesApi.getById(tempId); + if (shippingTemplatesDO.getAppoint()) {// 指定包邮 + // 判断是否在指定包邮区域内 + // 必须满足件数 + 金额 才能包邮 + ShippingTemplatesFreeDO shippingTemplatesFree = shippingTemplatesFreeApi.getByTempIdAndCityId(tempId, cityId); + if (ObjectUtil.isNotNull(shippingTemplatesFree)) { // 在包邮区域内 + BigDecimal freeNum = shippingTemplatesFree.getNumber(); + BigDecimal multiply = value.getBigDecimal("totalPrice"); + if (new BigDecimal(value.getInt("totalNum")).compareTo(freeNum) >= 0 && multiply.compareTo(shippingTemplatesFree.getPrice()) >= 0) { + // 满足件数 + 金额 = 包邮 + continue; + } + } + } + // 不满足指定包邮条件,走指定区域配送 + ShippingTemplatesRegionDO shippingTemplatesRegion = shippingTemplatesRegionApi.getByTempIdAndCityId(tempId, cityId); + if (ObjectUtil.isNull(shippingTemplatesRegion)) { + throw new ServiceException("计算运费时,未找到全国运费配置"); + } + + // 判断计费方式:件数、重量、体积 + switch (shippingTemplatesDO.getType()) { + case 1: // 件数 + // 判断件数是否超过首件 + Integer num = value.getInt("totalNum"); + if (num <= shippingTemplatesRegion.getFirst().intValue()) { + storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()); + } else {// 超过首件的需要计算续件 + int renewalNum = num - shippingTemplatesRegion.getFirst().intValue(); + // 剩余件数/续件 = 需要计算的续件费用的次数 + BigDecimal divide = new BigDecimal(renewalNum).divide(shippingTemplatesRegion.getRenewal(), 0, BigDecimal.ROUND_UP); + BigDecimal renewalPrice = shippingTemplatesRegion.getRenewalPrice().multiply(divide); + storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()).add(renewalPrice); + } + break; + case 2: // 重量 + BigDecimal weight = value.getBigDecimal("weight"); + if (weight.compareTo(shippingTemplatesRegion.getFirst()) <= 0) { + storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()); + } else {// 超过首件的需要计算续件 + BigDecimal renewalNum = weight.subtract(shippingTemplatesRegion.getFirst()); + // 剩余件数/续件 = 需要计算的续件费用的次数 + BigDecimal divide = renewalNum.divide(shippingTemplatesRegion.getRenewal(), 0, BigDecimal.ROUND_UP); + BigDecimal renewalPrice = shippingTemplatesRegion.getRenewalPrice().multiply(divide); + storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()).add(renewalPrice); + } + break; + case 3: // 体积 + BigDecimal volume = value.getBigDecimal("volume"); + if (volume.compareTo(shippingTemplatesRegion.getFirst()) <= 0) { + storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()); + } else {// 超过首件的需要计算续件 + BigDecimal renewalNum = volume.subtract(shippingTemplatesRegion.getFirst()); + // 剩余件数/续件 = 需要计算的续件费用的次数 + BigDecimal divide = renewalNum.divide(shippingTemplatesRegion.getRenewal(), 0, BigDecimal.ROUND_UP); + BigDecimal renewalPrice = shippingTemplatesRegion.getRenewalPrice().multiply(divide); + storePostage = storePostage.add(shippingTemplatesRegion.getFirstPrice()).add(renewalPrice); + } + break; + } + } + } + orderInfoVo.setFreightFee(storePostage); } /** @@ -740,22 +751,22 @@ public class OrderServiceImpl implements OrderService { int orderProNum = orderInfoVo.getOrderDetailList().stream().mapToInt(OrderInfoDetailVo::getPayNum).sum(); orderInfoVo.setOrderProNum(orderProNum); // 获取默认地址 - AddressRespDTO userAddress = addressApi.getDefaultByUid(user.getId()); + UserAddressRespDTO userAddress = userAddressApi.getDefaultByUid(user.getId()); if (ObjectUtil.isNotNull(userAddress)) { // 计算运费 getFreightFee(orderInfoVo, userAddress); orderInfoVo.setAddressId(userAddress.getId()); - orderInfoVo.setRealName(userAddress.getName()); - orderInfoVo.setPhone(userAddress.getMobile()); + orderInfoVo.setRealName(userAddress.getRealName()); + orderInfoVo.setPhone(userAddress.getPhone()); orderInfoVo.setProvince(userAddress.getProvince()); orderInfoVo.setCity(userAddress.getCity()); orderInfoVo.setDistrict(userAddress.getDistrict()); - orderInfoVo.setDetail(userAddress.getDetailAddress()); + orderInfoVo.setDetail(userAddress.getDetail()); } else { orderInfoVo.setFreightFee(BigDecimal.ZERO); } // 实际支付金额 - orderInfoVo.setPayFee(orderInfoVo.getProTotalFee().add(orderInfoVo.getFreightFee())); + orderInfoVo.setPayFee(orderInfoVo.getProTotalFee().add(BigDecimal.ZERO)); //用户剩余积分 //用户剩余经验 // 缓存订单 @@ -1033,7 +1044,7 @@ public class OrderServiceImpl implements OrderService { // 快递配送,无地址 priceResponse.setFreightFee(BigDecimal.ZERO); } else {// 快递配送,有地址 - AddressRespDTO userAddress = addressApi.getById(request.getAddressId()); + UserAddressRespDTO userAddress = userAddressApi.getById(request.getAddressId()); if (ObjectUtil.isNull(userAddress)) { priceResponse.setFreightFee(BigDecimal.ZERO); } else { @@ -1041,7 +1052,7 @@ public class OrderServiceImpl implements OrderService { priceResponse.setFreightFee(orderInfoVo.getFreightFee()); } } - // 计算优惠券金额 + // 计算优惠券金额 现在不开启优惠卷功能 // if (orderInfoVo.getProTotalFee().compareTo(storeCouponUser.getMoney()) <= 0) { // priceResponse.setCouponFee(orderInfoVo.getProTotalFee()); @@ -1056,6 +1067,7 @@ public class OrderServiceImpl implements OrderService { // priceResponse.setCouponFee(storeCouponUser.getMoney()); // } + priceResponse.setProTotalFee(orderInfoVo.getProTotalFee()); // 积分部分 // 使用积分 @@ -1118,13 +1130,13 @@ public class OrderServiceImpl implements OrderService { String userAddressStr = ""; if (orderRequest.getShippingType() == 1) { // 快递配送 if (orderRequest.getAddressId() <= 0) throw new ServiceException("请选择收货地址"); - AddressRespDTO userAddress = addressApi.getById(orderRequest.getAddressId()); - if (ObjectUtil.isNull(userAddress) || userAddress.getDeleted()) { + UserAddressRespDTO userAddress = userAddressApi.getById(orderRequest.getAddressId()); + if (ObjectUtil.isNull(userAddress)) { throw new ServiceException("收货地址有误"); } - orderRequest.setRealName(userAddress.getName()); - orderRequest.setPhone(userAddress.getMobile()); - userAddressStr = userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getDetailAddress(); + orderRequest.setRealName(userAddress.getRealName()); + orderRequest.setPhone(userAddress.getPhone()); + userAddressStr = userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getDetail(); }else if (orderRequest.getShippingType() == 2) { // 到店自提 if (StringUtils.isBlank(orderRequest.getRealName()) || StringUtils.isBlank(orderRequest.getPhone())) { throw new ServiceException("请填写姓名和电话"); @@ -1249,7 +1261,7 @@ public class OrderServiceImpl implements OrderService { storeOrder.setStoreId(orderRequest.getStoreId()); } storeOrder.setTotalNum(orderInfoVo.getOrderProNum()); - storeOrder.setCouponId(Optional.ofNullable(orderRequest.getCouponId()).orElse(0)); + storeOrder.setCouponId(Optional.ofNullable(orderRequest.getCouponId()).orElse(0L)); // 订单总价 BigDecimal totalPrice = computedOrderPriceResponse.getProTotalFee().add(computedOrderPriceResponse.getFreightFee()); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java index 50a96210e..0169f12e2 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java @@ -62,14 +62,16 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { RechargeOrderDO updateObj = RechargeOrderConvert.INSTANCE.convert(updateReqVO); rechargeOrderMapper.updateById(updateObj); } + @Override public void updateRechargeOrderStatus(RechargeOrderUpdateReqVO updateReqVO) { // 校验存在 validateRechargeOrderExists(updateReqVO.getId()); // 更新 - RechargeOrderDO updateObj = RechargeOrderConvert.INSTANCE.convert(updateReqVO); + RechargeOrderDO updateObj = RechargeOrderConvert.INSTANCE.convert(updateReqVO); rechargeOrderMapper.updateById(updateObj); } + @Override public void deleteRechargeOrder(Long id) { // 校验存在 @@ -97,7 +99,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { @Override public PageResult getRechargeOrderPage(RechargeOrderPageReqVO pageReqVO) { Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - rechargeOrderMapper.findListPage(page,pageReqVO); + rechargeOrderMapper.findListPage(page, pageReqVO); return new PageResult<>(page.getRecords(), page.getTotal()); } @@ -148,23 +150,22 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { public MemberHeadResponse memberHeadInfo() { MemberHeadResponse response = new MemberHeadResponse(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - if(loginUser!=null){ - List orderDOS = rechargeOrderMapper.selectList(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId())); - if (!CollectionUtils.isEmpty(orderDOS)) { - BigDecimal amount = new BigDecimal("0"); - for (RechargeOrderDO orderDO : orderDOS) { - amount = amount.add(orderDO.getPayPrice()); - } - if (amount.compareTo(new BigDecimal("640")) < 0) { - response.setGrade("普通会员"); - response.setIntegral(amount.stripTrailingZeros().toPlainString() + "/" + "640"); - } else if (amount.compareTo(new BigDecimal("640")) >= 0) { - response.setGrade("高级会员"); - response.setIntegral(amount.stripTrailingZeros().toPlainString() + "/" + "1040"); - } else { - response.setGrade("中级会员"); - response.setIntegral(amount.stripTrailingZeros().toPlainString() + "/" + "1040"); - } + Assert.notNull(loginUser, "登录失效,请重新登录!"); + List orderDOS = rechargeOrderMapper.selectList(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId()).eq(RechargeOrderDO::getPaid, 1)); + if (!CollectionUtils.isEmpty(orderDOS)) { + BigDecimal amount = new BigDecimal("0"); + for (RechargeOrderDO orderDO : orderDOS) { + amount = amount.add(orderDO.getPayPrice()); + } + if (amount.compareTo(new BigDecimal("640")) < 0) { + response.setGrade("普通会员"); + response.setIntegral(amount.stripTrailingZeros().toPlainString() + "/" + "640"); + } else if (amount.compareTo(new BigDecimal("1040")) >= 0) { + response.setGrade("高级会员"); + response.setIntegral(amount.stripTrailingZeros().toPlainString() + "/" + "1040"); + } else { + response.setGrade("中级会员"); + response.setIntegral(amount.stripTrailingZeros().toPlainString() + "/" + "1040"); } } return response; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtil.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtil.java index 051b9d4d7..6918fa04c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtil.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/utils/OrderUtil.java @@ -106,13 +106,13 @@ public class OrderUtil { payType = payType.toLowerCase(); switch (payType){ case PayConstants.PAY_TYPE_WE_CHAT: - result = apiConfigApi.getConfigKey(SysConfigConstants.CONFIG_PAY_WEIXIN_OPEN).equals("1"); + result = apiConfigApi.getConfigKeyValue(SysConfigConstants.CONFIG_PAY_WEIXIN_OPEN).equals("1"); break; case PayConstants.PAY_TYPE_YUE: - result = (apiConfigApi.getConfigKey(SysConfigConstants.CONFIG_YUE_PAY_STATUS).equals("1")); + result = (apiConfigApi.getConfigKeyValue(SysConfigConstants.CONFIG_YUE_PAY_STATUS).equals("1")); break; case PayConstants.PAY_TYPE_ALI_PAY: - result = (apiConfigApi.getConfigKey(SysConfigConstants.CONFIG_ALI_PAY_STATUS).equals("1")); + result = (apiConfigApi.getConfigKeyValue(SysConfigConstants.CONFIG_ALI_PAY_STATUS).equals("1")); break; } return result; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml index d27a6d8f0..76ef60c67 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml @@ -3,6 +3,6 @@ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml index 06da0e77c..680a2f38a 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml @@ -3,6 +3,6 @@ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml index d31a41ad7..063f68943 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml @@ -3,6 +3,6 @@ diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApi.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApi.java index 93597ec02..299335702 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApi.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApi.java @@ -19,7 +19,7 @@ public interface AddressApi { AddressRespDTO getAddress(Long id, Long userId); - AddressRespDTO getById(Integer addressId); + AddressRespDTO getById(Long addressId); /** * 获取默认地址 diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/UserAddressApi.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/UserAddressApi.java new file mode 100644 index 000000000..aa41dfa41 --- /dev/null +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/UserAddressApi.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.member.api.address; + +import cn.iocoder.yudao.module.member.api.address.dto.UserAddressRespDTO; + +/** + * @Title:UserAddressApi + * @Description: TODO + * @author: tangqian + * @date: 2023/5/24 14:39 + * @version: V1.0.0 + */ +public interface UserAddressApi { + + UserAddressRespDTO getById(Long addressId); + + /** + * 获取默认地址 + * @return UserAddress + */ + UserAddressRespDTO getDefaultByUid(Long uid); +} diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/dto/UserAddressRespDTO.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/dto/UserAddressRespDTO.java new file mode 100644 index 000000000..0c9e9aa20 --- /dev/null +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/address/dto/UserAddressRespDTO.java @@ -0,0 +1,41 @@ +package cn.iocoder.yudao.module.member.api.address.dto; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +/** + * @Title:UserAddressRespDTO + * @Description: TODO + * @author: tangqian + * @date: 2023/5/24 14:46 + * @version: V1.0.0 + */ +@Data +public class UserAddressRespDTO { + private Long id; + + private Long userId; + + private String realName; + + private String phone; + + private String province; + + private String city; + + private Integer cityId; + + private String district; + + private String detail; + + private Integer postCode; + + private String longitude; + + private String latitude; + + private Boolean isDefault; +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApiImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApiImpl.java index e0d9ce97a..06f679c26 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApiImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/address/AddressApiImpl.java @@ -36,7 +36,7 @@ public class AddressApiImpl implements AddressApi { } @Override - public AddressRespDTO getById(Integer addressId) { + public AddressRespDTO getById(Long addressId) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(AddressDO::getId, addressId); return AddressConvert.INSTANCE.convert02(addressMapper.selectOne(lambdaQueryWrapper)); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/address/UserAddressApiImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/address/UserAddressApiImpl.java new file mode 100644 index 000000000..1ede49b52 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/address/UserAddressApiImpl.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.member.api.address; + +import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO; +import cn.iocoder.yudao.module.member.api.address.dto.UserAddressRespDTO; +import cn.iocoder.yudao.module.member.convert.address.AddressConvert; +import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; +import cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddress; +import cn.iocoder.yudao.module.member.dal.mysql.address.UserAddressMapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * @Title:UserAddressApiImpl + * @Description: TODO + * @author: tangqian + * @date: 2023/5/24 14:40 + * @version: V1.0.0 + */ +@Service +@Validated +public class UserAddressApiImpl implements UserAddressApi{ + @Autowired + private UserAddressMapper addressMapper; + @Override + public UserAddressRespDTO getById(Long addressId) { + UserAddressRespDTO respDTO = new UserAddressRespDTO(); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(UserAddress::getId, addressId); + UserAddress userAddress = addressMapper.selectOne(lambdaQueryWrapper); + BeanUtils.copyProperties(userAddress,respDTO); + return respDTO; + } + + @Override + public UserAddressRespDTO getDefaultByUid(Long uid) { + UserAddressRespDTO respDTO = new UserAddressRespDTO(); + LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(UserAddress::getIsDefault, true); + lambdaQueryWrapper.eq(UserAddress::getUserId, uid); + UserAddress userAddress = addressMapper.selectOne(lambdaQueryWrapper); + if (null != userAddress) { + BeanUtils.copyProperties(userAddress,respDTO); + } + return respDTO; + } +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java index c165524dd..abb82eedb 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java @@ -134,7 +134,7 @@ public class MemberUserApiImpl implements MemberUserApi { throw new ServiceException("用户信息不存在!"); } - if (user.getStatus() == 0) { + if (user.getStatus() == 1) { throw new ServiceException("用户已经被禁用!"); } return user; diff --git a/yudao-ui-admin/.env.dev b/yudao-ui-admin/.env.dev index 69f30e8ff..0e883e135 100644 --- a/yudao-ui-admin/.env.dev +++ b/yudao-ui-admin/.env.dev @@ -6,7 +6,7 @@ VUE_APP_TITLE = 创盈商户管理系统 # 芋道管理系统/开发环境 #VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api' -VUE_APP_BASE_API = 'http://192.168.1.188:48080' +VUE_APP_BASE_API = 'http://api.cyywl.top' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/yudao-ui-admin/src/views/mall/product/store/creatStore/index.vue b/yudao-ui-admin/src/views/mall/product/store/creatStore/index.vue index 0bb99361a..568b00ab2 100644 --- a/yudao-ui-admin/src/views/mall/product/store/creatStore/index.vue +++ b/yudao-ui-admin/src/views/mall/product/store/creatStore/index.vue @@ -355,7 +355,7 @@ const defaultObj = { isGood: false, isHot: false, isBest: false, - tempId: '111', + tempId: '', attrValue: [{ image: '', price: 0, @@ -819,7 +819,7 @@ export default { // 运费模板; getShippingList() { shippingTemplatesList(this.tempData).then(res => { - this.shippingList = res.list + this.shippingList = res.data.list }) }, showInput(item) { diff --git a/yudao-ui-admin/src/views/mall/product/store/index.vue b/yudao-ui-admin/src/views/mall/product/store/index.vue index c7bf4ad9c..ff41e3f39 100644 --- a/yudao-ui-admin/src/views/mall/product/store/index.vue +++ b/yudao-ui-admin/src/views/mall/product/store/index.vue @@ -59,13 +59,11 @@ /> =8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/clipboard": { + "version": "2.0.11", + "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz", + "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", + "dependencies": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" + }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/encode-utf8": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/encode-utf8/-/encode-utf8-1.0.3.tgz", + "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==" + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", + "dependencies": { + "delegate": "^3.1.2" + } + }, + "node_modules/html-to-image": { + "version": "1.11.11", + "resolved": "https://registry.npmmirror.com/html-to-image/-/html-to-image-1.11.11.tgz", + "integrity": "sha512-9gux8QhvjRO/erSnDPv28noDZcPZmYE7e1vFsBLKLlRlKDSqNJYebj6Qz1TGd5lsRV+X+xYyjCKjuZdABinWjA==" + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/qrcode": { + "version": "1.5.3", + "resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.3.tgz", + "integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==", + "dependencies": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/select": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", + "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + } + }, "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, "clipboard": { "version": "2.0.11", "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz", @@ -14,11 +358,68 @@ "tiny-emitter": "^2.0.0" } }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, "delegate": { "version": "3.2.0", "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" }, + "dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "encode-utf8": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/encode-utf8/-/encode-utf8-1.0.3.tgz", + "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, "good-listener": { "version": "1.2.2", "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", @@ -27,15 +428,155 @@ "delegate": "^3.1.2" } }, + "html-to-image": { + "version": "1.11.11", + "resolved": "https://registry.npmmirror.com/html-to-image/-/html-to-image-1.11.11.tgz", + "integrity": "sha512-9gux8QhvjRO/erSnDPv28noDZcPZmYE7e1vFsBLKLlRlKDSqNJYebj6Qz1TGd5lsRV+X+xYyjCKjuZdABinWjA==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==" + }, + "qrcode": { + "version": "1.5.3", + "resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.3.tgz", + "integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==", + "requires": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, "select": { "version": "1.1.2", "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, "tiny-emitter": { "version": "2.1.0", "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } } diff --git a/yudao-ui-app/package.json b/yudao-ui-app/package.json index cef075c4f..e147ae429 100644 --- a/yudao-ui-app/package.json +++ b/yudao-ui-app/package.json @@ -10,6 +10,8 @@ "author": "", "license": "ISC", "dependencies": { - "clipboard": "^2.0.11" + "clipboard": "^2.0.11", + "html-to-image": "^1.11.11", + "qrcode": "^1.5.3" } } diff --git a/yudao-ui-app/pages/goods_cashier/index.vue b/yudao-ui-app/pages/goods_cashier/index.vue index c426e95b8..0af7ecaff 100644 --- a/yudao-ui-app/pages/goods_cashier/index.vue +++ b/yudao-ui-app/pages/goods_cashier/index.vue @@ -251,22 +251,9 @@ if (!that.orderId) return that.$util.Tips({ title: '请选择要支付的订单' }); - if (paytype == 'yue' && parseFloat(number) < parseFloat(that.payPriceShow)) return that.$util.Tips({ - title: `余额不足` - }); uni.showLoading({ title: `支付中` }); - if (paytype == 'friend' && that.orderId) { - uni.hideLoading(); - return uni.navigateTo({ - url: '/pages/users/payment_on_behalf/index?order_id=' + that.orderId + '&spread=' + - this.$store.state.app.uid, - success: res => {}, - fail: () => {}, - complete: () => {} - }); - } orderPay({ uni: that.orderId, paytype: paytype, diff --git a/yudao-ui-app/pages/user/index.vue b/yudao-ui-app/pages/user/index.vue index 50d88ab18..8ed53f4f3 100644 --- a/yudao-ui-app/pages/user/index.vue +++ b/yudao-ui-app/pages/user/index.vue @@ -92,7 +92,7 @@ + @click="jumpPage('/pages/users/user_spread_code/index')"> @@ -255,8 +255,8 @@ }) }, kefuClick() { - if (tenantInfo.wxKfUrl) { - location.href = tenantInfo.wxKfUrl + if (this.tenantInfo.wxKfUrl) { + location.href = this.tenantInfo.wxKfUrl } }, getOrderData() { diff --git a/yudao-ui-app/pages/users/user_spread_code/index.vue b/yudao-ui-app/pages/users/user_spread_code/index.vue index 8ac65370c..f4cb63f5e 100644 --- a/yudao-ui-app/pages/users/user_spread_code/index.vue +++ b/yudao-ui-app/pages/users/user_spread_code/index.vue @@ -1,430 +1,222 @@ - diff --git a/yudao-ui-app/static/images/spread_bg.png b/yudao-ui-app/static/images/spread_bg.png new file mode 100644 index 000000000..381e2787a Binary files /dev/null and b/yudao-ui-app/static/images/spread_bg.png differ