商品管理
parent
dece26fce7
commit
3f213a4ae6
|
@ -69,7 +69,15 @@ public class AreaUtils {
|
|||
public static Area getArea(Integer id) {
|
||||
return areas.get(id);
|
||||
}
|
||||
|
||||
public static void getAreaId(List<Integer> ids, AreaTypeEnum areaTypeEnum, List<Area> areaList) {
|
||||
areaList.forEach(areas -> {
|
||||
if(areaTypeEnum.getType().equals(areas.getType())){
|
||||
ids.add(areas.getId());
|
||||
}else{
|
||||
getAreaId(ids,areaTypeEnum,areas.getChildren());
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 格式化区域
|
||||
*
|
||||
|
@ -116,4 +124,11 @@ public class AreaUtils {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Integer> ids = new ArrayList<Integer>();
|
||||
|
||||
getAreaId(ids,AreaTypeEnum.DISTRICT,AreaUtils.getArea(Area.ID_CHINA).getChildren());
|
||||
System.out.println(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
|
|
|
@ -75,5 +75,9 @@
|
|||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-ip</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,12 +1,12 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesSearchReqVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesService;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesReqVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesSearchReqVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@ -1,8 +1,8 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesFreeService;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesFreeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
|
@ -1,8 +1,8 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesNoDeliveryService;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
|
@ -1,8 +1,8 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesRegionService;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesRegionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express.vo;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express.vo;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express.vo;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
@ -1,16 +1,12 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express.vo;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -37,12 +33,13 @@ public class ShippingTemplatesReqVO implements Serializable {
|
|||
|
||||
@Schema(description = "模板名称", required = true)
|
||||
@NotBlank(message = "模板名称必须填写")
|
||||
@Length(max = 200, message = "模板名称不能超过200个字符")
|
||||
@Size(max = 200, message = "模板名称不能超过200个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "计费方式 1(按件数), 2(按重量),3(按体积)", example = "1", required = true)
|
||||
@NotNull(message = "计费方式必须选择")
|
||||
@Range(min = 1, max = 3, message = "计费方式选择区间 1(按件数), 2(按重量),3(按体积)")
|
||||
@Max(value = 3,message = "计费方式选择区间 1(按件数), 2(按重量),3(按体积)")
|
||||
@Min(value = 1,message = "计费方式选择区间 1(按件数), 2(按重量),3(按体积)")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "配送区域及运费", required = true)
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.product.controller.admin.express.vo;
|
||||
package cn.iocoder.yudao.module.shop.controller.admin.express.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.module.product.dal.dataobject.express;
|
||||
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;
|
||||
|
@ -24,7 +25,7 @@ import lombok.experimental.Accessors;
|
|||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("eb_shipping_templates")
|
||||
public class ShippingTemplatesDO extends TenantBaseDO {
|
||||
public class ShippingTemplatesDO extends BaseDO {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.product.dal.dataobject.express;
|
||||
package cn.iocoder.yudao.module.shop.dal.dataobject.express;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.product.dal.dataobject.express;
|
||||
package cn.iocoder.yudao.module.shop.dal.dataobject.express;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.product.dal.dataobject.express;
|
||||
package cn.iocoder.yudao.module.shop.dal.dataobject.express;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,8 +1,8 @@
|
|||
package cn.iocoder.yudao.module.product.dal.mysql.express;
|
||||
package cn.iocoder.yudao.module.shop.dal.mysql.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesFreeDO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesFreeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.product.dal.mysql.express;
|
||||
package cn.iocoder.yudao.module.shop.dal.mysql.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package cn.iocoder.yudao.module.product.dal.mysql.express;
|
||||
package cn.iocoder.yudao.module.shop.dal.mysql.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesNoDeliveryDO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesNoDeliveryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
|
@ -1,8 +1,8 @@
|
|||
package cn.iocoder.yudao.module.product.dal.mysql.express;
|
||||
package cn.iocoder.yudao.module.shop.dal.mysql.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesRegionDO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesRegionDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.product.service.express;
|
||||
package cn.iocoder.yudao.module.shop.service.express;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesFreeDO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesFreeDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.product.service.express;
|
||||
package cn.iocoder.yudao.module.shop.service.express;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesNoDeliveryDO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesNoDeliveryDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.product.service.express;
|
||||
package cn.iocoder.yudao.module.shop.service.express;
|
||||
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesRegionDO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesRegionDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
|
@ -1,9 +1,9 @@
|
|||
package cn.iocoder.yudao.module.product.service.express;
|
||||
package cn.iocoder.yudao.module.shop.service.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesSearchReqVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesReqVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesSearchReqVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
|
@ -1,16 +1,17 @@
|
|||
package cn.iocoder.yudao.module.product.service.express.impl;
|
||||
package cn.iocoder.yudao.module.shop.service.express.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesFreeDO;
|
||||
import cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesFreeMapper;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesFreeService;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ip.vo.AreaNodeRespVO;
|
||||
import cn.iocoder.yudao.module.system.service.ip.AreaService;
|
||||
import cn.iocoder.yudao.framework.ip.core.Area;
|
||||
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
|
||||
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesFreeDO;
|
||||
import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesFreeMapper;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesFreeService;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -37,8 +38,6 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
|||
@Resource
|
||||
private ShippingTemplatesFreeMapper dao;
|
||||
|
||||
@Autowired
|
||||
private AreaService areaService;
|
||||
|
||||
private List<Integer> cityIdList;
|
||||
|
||||
|
@ -94,7 +93,9 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
|||
*/
|
||||
private List<Integer> getCityIdList() {
|
||||
if(this.cityIdList == null || this.cityIdList.size() < 1){
|
||||
this.cityIdList = areaService.getAreaTree().stream().map(AreaNodeRespVO::getId).collect(Collectors.toList());
|
||||
Area area = AreaUtils.getArea(Area.ID_CHINA);
|
||||
Assert.notNull(area, "获取不到中国");
|
||||
AreaUtils.getAreaId(cityIdList, AreaTypeEnum.DISTRICT,area.getChildren());
|
||||
}
|
||||
return this.cityIdList;
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
package cn.iocoder.yudao.module.product.service.express.impl;
|
||||
package cn.iocoder.yudao.module.shop.service.express.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesNoDeliveryDO;
|
||||
import cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesNoDeliveryMapper;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesNoDeliveryService;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ip.vo.AreaNodeRespVO;
|
||||
import cn.iocoder.yudao.module.system.service.ip.AreaService;
|
||||
import cn.iocoder.yudao.framework.ip.core.Area;
|
||||
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
|
||||
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesNoDeliveryDO;
|
||||
import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliveryMapper;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -25,8 +27,6 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
|||
@Resource
|
||||
private ShippingTemplatesNoDeliveryMapper shippingTemplatesNoDeliveryMapper;
|
||||
|
||||
@Autowired
|
||||
private AreaService areaService;
|
||||
|
||||
private List<Integer> cityIdList;
|
||||
|
||||
|
@ -66,7 +66,9 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
|||
*/
|
||||
private List<Integer> getCityIdList() {
|
||||
if(this.cityIdList == null || this.cityIdList.size() < 1){
|
||||
this.cityIdList = areaService.getAreaTree().stream().map(AreaNodeRespVO::getId).collect(Collectors.toList());
|
||||
Area area = AreaUtils.getArea(Area.ID_CHINA);
|
||||
Assert.notNull(area, "获取不到中国");
|
||||
AreaUtils.getAreaId(cityIdList, AreaTypeEnum.DISTRICT,area.getChildren());
|
||||
}
|
||||
return this.cityIdList;
|
||||
}
|
|
@ -1,16 +1,17 @@
|
|||
package cn.iocoder.yudao.module.product.service.express.impl;
|
||||
package cn.iocoder.yudao.module.shop.service.express.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesRegionDO;
|
||||
import cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesRegionMapper;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesRegionService;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ip.vo.AreaNodeRespVO;
|
||||
import cn.iocoder.yudao.module.system.service.ip.AreaService;
|
||||
import cn.iocoder.yudao.framework.ip.core.Area;
|
||||
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
|
||||
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesRegionDO;
|
||||
import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesRegionMapper;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesRegionService;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -39,8 +40,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
|||
@Resource
|
||||
private ShippingTemplatesRegionMapper dao;
|
||||
|
||||
@Autowired
|
||||
private AreaService areaService;
|
||||
|
||||
|
||||
private List<Integer> cityIdList;
|
||||
|
||||
|
@ -106,7 +106,9 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
|||
*/
|
||||
private List<Integer> getCityIdList() {
|
||||
if(this.cityIdList == null || this.cityIdList.size() < 1){
|
||||
this.cityIdList = areaService.getAreaTree().stream().map(AreaNodeRespVO::getId).collect(Collectors.toList());
|
||||
Area area = AreaUtils.getArea(Area.ID_CHINA);
|
||||
Assert.notNull(area, "获取不到中国");
|
||||
AreaUtils.getAreaId(cityIdList, AreaTypeEnum.DISTRICT,area.getChildren());
|
||||
}
|
||||
return this.cityIdList;
|
||||
}
|
|
@ -1,16 +1,16 @@
|
|||
package cn.iocoder.yudao.module.product.service.express.impl;
|
||||
package cn.iocoder.yudao.module.shop.service.express.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.express.vo.*;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesMapper;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesFreeService;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesNoDeliveryService;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesRegionService;
|
||||
import cn.iocoder.yudao.module.product.service.express.ShippingTemplatesService;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.*;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesMapper;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesFreeService;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesRegionService;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesFreeMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesFreeMapper">
|
||||
|
||||
<select id="getListGroup" resultType="cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesFreeRespVO" parameterType="integer">
|
||||
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO" parameterType="integer">
|
||||
SELECT group_concat(`city_id`) AS city_id, title, `number`, price, uniqid FROM eb_shipping_templates_free where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid` ORDER BY id ASC
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesMapper">
|
||||
|
||||
</mapper>
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesNoDeliveryMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliveryMapper">
|
||||
|
||||
<select id="getList" resultType="cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO" parameterType="integer">
|
||||
<select id="getList" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO" parameterType="integer">
|
||||
SELECT group_concat(`city_id`) AS city_id, temp_id FROM eb_shipping_templates_no_delivery where temp_id = #{tempId, jdbcType=INTEGER} ORDER BY id ASC
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.product.dal.mysql.express.ShippingTemplatesRegionMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesRegionMapper">
|
||||
|
||||
<select id="getListGroup" resultType="cn.iocoder.yudao.module.product.controller.admin.express.vo.ShippingTemplatesRegionRespVO" parameterType="integer">
|
||||
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO" parameterType="integer">
|
||||
SELECT group_concat(`city_id`) AS city_id, title, `first`, first_price, `renewal`, renewal_price, uniqid FROM eb_shipping_templates_region where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid` ORDER BY id ASC
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue