62 changed files with 2024 additions and 70 deletions
@ -0,0 +1,101 @@ |
|||||
|
package com.qs.serve.modules.bms.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuRegion; |
||||
|
import com.qs.serve.modules.bms.service.BmsSkuRegionService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 基础档案 sku销售区域 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-17 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("bms/skuRegion") |
||||
|
public class BmsSkuRegionController { |
||||
|
|
||||
|
private BmsSkuRegionService bmsSkuRegionService; |
||||
|
|
||||
|
/** |
||||
|
* 翻页查询 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
@PreAuthorize("hasRole('bms:skuRegion:query')") |
||||
|
public R<PageVo<BmsSkuRegion>> getPage(BmsSkuRegion param){ |
||||
|
PageUtil.startPage(); |
||||
|
LambdaQueryWrapper<BmsSkuRegion> skuRegionWrapper = new LambdaQueryWrapper<>(param); |
||||
|
List<BmsSkuRegion> list = bmsSkuRegionService.list(skuRegionWrapper); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/getById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "sku销售区域", biz = BizType.QUERY) |
||||
|
@PreAuthorize("hasRole('bms:skuRegion:query')") |
||||
|
public R<BmsSkuRegion> getById(@PathVariable("id") String id){ |
||||
|
BmsSkuRegion bmsSkuRegion = bmsSkuRegionService.getById(id); |
||||
|
return R.ok(bmsSkuRegion); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据ID更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
@SysLog(module = SystemModule.BASE, title = "sku销售区域", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('bms:skuRegion:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid BmsSkuRegion param){ |
||||
|
boolean result = bmsSkuRegionService.updateById(param); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增sku销售区域 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.BASE, title = "sku销售区域", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('bms:skuRegion:insert')") |
||||
|
public R<?> save(@RequestBody @Valid BmsSkuRegion param){ |
||||
|
boolean result = bmsSkuRegionService.save(param); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除sku销售区域 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "sku销售区域", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('bms:skuRegion:delete')") |
||||
|
public R<?> deleteById(@PathVariable("id") String id){ |
||||
|
boolean result = bmsSkuRegionService.removeById(id); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,105 @@ |
|||||
|
package com.qs.serve.modules.bms.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.modules.bms.entity.bo.BmsSkuSupplierBo; |
||||
|
import com.qs.serve.modules.bms.entity.bo.BmsSkuSupplierBo2; |
||||
|
import com.qs.serve.modules.bms.entity.vo.BmsSkuSupplierVo; |
||||
|
import com.qs.serve.modules.goods.entity.GoodsSku; |
||||
|
import com.qs.serve.modules.goods.service.GoodsSkuService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuSupplier; |
||||
|
import com.qs.serve.modules.bms.service.BmsSkuSupplierService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 基础档案 sku供应商关联 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-17 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("bms/skuSupplier") |
||||
|
public class BmsSkuSupplierController { |
||||
|
|
||||
|
private BmsSkuSupplierService bmsSkuSupplierService; |
||||
|
private GoodsSkuService goodsSkuService; |
||||
|
|
||||
|
/** |
||||
|
* 翻页查询 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
@PreAuthorize("hasRole('bms:skuSupplier:query')") |
||||
|
public R<PageVo<BmsSkuSupplierVo>> getPage(BmsSkuSupplier param){ |
||||
|
PageUtil.startPage(); |
||||
|
List<BmsSkuSupplierVo> list = bmsSkuSupplierService.selectList(param); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 供应商可购指定商品(购买设置等级优先级最高) |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/update4Sku") |
||||
|
@SysLog(module = SystemModule.BASE, title = "sku供应商关联", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('bms:skuSupplier:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid BmsSkuSupplierBo param){ |
||||
|
LambdaQueryWrapper<BmsSkuSupplier> lqw = new LambdaQueryWrapper<>(); |
||||
|
lqw.eq(BmsSkuSupplier::getSupplierId,param.getSupplierId()); |
||||
|
lqw.eq(BmsSkuSupplier::getSkuId,param.getSkuId()); |
||||
|
BmsSkuSupplier skuSupplier = bmsSkuSupplierService.getOne(lqw,false); |
||||
|
if(skuSupplier==null){ |
||||
|
GoodsSku goodsSku = goodsSkuService.getById(param.getSkuId()); |
||||
|
skuSupplier = CopierUtil.copy(param,new BmsSkuSupplier()); |
||||
|
skuSupplier.setSpuId(goodsSku.getSpuId()); |
||||
|
bmsSkuSupplierService.save(skuSupplier); |
||||
|
}else { |
||||
|
skuSupplier.setBanStatus(param.getBanStatus()); |
||||
|
bmsSkuSupplierService.updateById(skuSupplier); |
||||
|
} |
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 供应商可购指定商品(购买设置等级比区域设置高) |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/update4Spu") |
||||
|
@SysLog(module = SystemModule.BASE, title = "sku供应商关联", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('bms:skuSupplier:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid BmsSkuSupplierBo2 param){ |
||||
|
LambdaQueryWrapper<BmsSkuSupplier> lqw = new LambdaQueryWrapper<>(); |
||||
|
lqw.eq(BmsSkuSupplier::getSupplierId,param.getSupplierId()); |
||||
|
lqw.eq(BmsSkuSupplier::getSpuId,param.getSpuId()); |
||||
|
lqw.eq(BmsSkuSupplier::getSkuId,0); |
||||
|
BmsSkuSupplier skuSupplier = bmsSkuSupplierService.getOne(lqw,false); |
||||
|
if(skuSupplier==null){ |
||||
|
skuSupplier = CopierUtil.copy(param,new BmsSkuSupplier()); |
||||
|
skuSupplier.setSkuId(0L); |
||||
|
bmsSkuSupplierService.save(skuSupplier); |
||||
|
}else { |
||||
|
skuSupplier.setBanStatus(param.getBanStatus()); |
||||
|
bmsSkuSupplierService.updateById(skuSupplier); |
||||
|
} |
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,78 @@ |
|||||
|
package com.qs.serve.modules.bms.entity; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* sku销售区域 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("bms_sku_region") |
||||
|
public class BmsSkuRegion implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 商品Id */ |
||||
|
@NotNull(message = "商品Id不能为空") |
||||
|
private Long spuId; |
||||
|
|
||||
|
/** skuId */ |
||||
|
@NotNull(message = "skuId不能为空") |
||||
|
private Long skuId; |
||||
|
|
||||
|
/** 区域ID */ |
||||
|
@NotNull(message = "区域ID不能为空") |
||||
|
private Long regionId; |
||||
|
|
||||
|
/** 类型:0->正常;1->禁售 */ |
||||
|
private Integer typeFlag; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,79 @@ |
|||||
|
package com.qs.serve.modules.bms.entity; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* sku供应商关联 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("bms_sku_supplier") |
||||
|
public class BmsSkuSupplier implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 商品id */ |
||||
|
@NotNull(message = "商品id不能为空") |
||||
|
private Long spuId; |
||||
|
|
||||
|
/** skuId */ |
||||
|
@NotNull(message = "skuId不能为空") |
||||
|
private Long skuId; |
||||
|
|
||||
|
/** 供应商id */ |
||||
|
@NotNull(message = "供应商id不能为空") |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** 禁售状态 */ |
||||
|
@NotNull(message = "禁售状态不能为空") |
||||
|
private Integer banStatus; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
} |
||||
|
|
@ -1,4 +1,4 @@ |
|||||
package com.qs.serve.modules.bms.entity.vo; |
package com.qs.serve.modules.bms.entity.bo; |
||||
|
|
||||
import lombok.Data; |
import lombok.Data; |
||||
import org.hibernate.validator.constraints.Length; |
import org.hibernate.validator.constraints.Length; |
@ -0,0 +1,26 @@ |
|||||
|
package com.qs.serve.modules.bms.entity.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2022/10/17 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BmsSkuSupplierBo { |
||||
|
|
||||
|
/** skuId */ |
||||
|
@NotNull(message = "skuId不能为空") |
||||
|
private Long skuId; |
||||
|
|
||||
|
/** 供应商id */ |
||||
|
@NotNull(message = "供应商id不能为空") |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** 禁售状态 0可售 1禁售 */ |
||||
|
@NotNull(message = "禁售状态不能为空") |
||||
|
private Integer banStatus; |
||||
|
|
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.qs.serve.modules.bms.entity.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2022/10/17 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BmsSkuSupplierBo2 { |
||||
|
|
||||
|
/** 商品Id */ |
||||
|
@NotNull(message = "skuId不能为空") |
||||
|
private Long spuId; |
||||
|
|
||||
|
/** 供应商id */ |
||||
|
@NotNull(message = "供应商id不能为空") |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** 禁售状态 0可售 1禁售 */ |
||||
|
@NotNull(message = "禁售状态不能为空") |
||||
|
private Integer banStatus; |
||||
|
|
||||
|
} |
@ -1,4 +1,4 @@ |
|||||
package com.qs.serve.modules.bms.entity.vo; |
package com.qs.serve.modules.bms.entity.bo; |
||||
|
|
||||
import lombok.Data; |
import lombok.Data; |
||||
import org.hibernate.validator.constraints.Length; |
import org.hibernate.validator.constraints.Length; |
@ -0,0 +1,26 @@ |
|||||
|
package com.qs.serve.modules.bms.entity.vo; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuSupplier; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2022/10/17 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BmsSkuSupplierVo extends BmsSkuSupplier { |
||||
|
|
||||
|
/** 规格编码*/ |
||||
|
private String skuCode; |
||||
|
|
||||
|
/** 商品编码 */ |
||||
|
private String spuCode; |
||||
|
|
||||
|
/** 规格值 */ |
||||
|
private String specInfos; |
||||
|
|
||||
|
/** 商品标题 */ |
||||
|
private String spuTitle; |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.bms.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuRegion; |
||||
|
|
||||
|
/** |
||||
|
* sku销售区域 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-17 |
||||
|
*/ |
||||
|
public interface BmsSkuRegionMapper extends BaseMapper<BmsSkuRegion> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.bms.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuSupplier; |
||||
|
import com.qs.serve.modules.bms.entity.vo.BmsSkuSupplierVo; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* sku供应商关联 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-17 |
||||
|
*/ |
||||
|
public interface BmsSkuSupplierMapper extends BaseMapper<BmsSkuSupplier> { |
||||
|
|
||||
|
@InterceptorIgnore(tenantLine = "1") |
||||
|
List<BmsSkuSupplierVo> selectList2(@Param("query") BmsSkuSupplier skuSupplier); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.bms.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuRegion; |
||||
|
|
||||
|
/** |
||||
|
* sku销售区域 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-17 |
||||
|
*/ |
||||
|
public interface BmsSkuRegionService extends IService<BmsSkuRegion> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,19 @@ |
|||||
|
package com.qs.serve.modules.bms.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuSupplier; |
||||
|
import com.qs.serve.modules.bms.entity.vo.BmsSkuSupplierVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* sku供应商关联 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-17 |
||||
|
*/ |
||||
|
public interface BmsSkuSupplierService extends IService<BmsSkuSupplier> { |
||||
|
|
||||
|
List<BmsSkuSupplierVo> selectList(BmsSkuSupplier skuSupplier); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.bms.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuRegion; |
||||
|
import com.qs.serve.modules.bms.service.BmsSkuRegionService; |
||||
|
import com.qs.serve.modules.bms.mapper.BmsSkuRegionMapper; |
||||
|
|
||||
|
/** |
||||
|
* sku销售区域 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-17 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class BmsSkuRegionServiceImpl extends ServiceImpl<BmsSkuRegionMapper,BmsSkuRegion> implements BmsSkuRegionService { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.bms.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuSupplier; |
||||
|
|
||||
|
/** |
||||
|
* sku供应商关联 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-17 |
||||
|
*/ |
||||
|
public interface BmsSkuSupplierService extends IService<BmsSkuSupplier> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,29 @@ |
|||||
|
package com.qs.serve.modules.bms.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import com.qs.serve.modules.bms.entity.vo.BmsSkuSupplierVo; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSkuSupplier; |
||||
|
import com.qs.serve.modules.bms.service.BmsSkuSupplierService; |
||||
|
import com.qs.serve.modules.bms.mapper.BmsSkuSupplierMapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* sku供应商关联 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-17 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class BmsSkuSupplierServiceImpl extends ServiceImpl<BmsSkuSupplierMapper,BmsSkuSupplier> implements BmsSkuSupplierService { |
||||
|
|
||||
|
@Override |
||||
|
public List<BmsSkuSupplierVo> selectList(BmsSkuSupplier skuSupplier) { |
||||
|
return baseMapper.selectList2(skuSupplier); |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,103 @@ |
|||||
|
package com.qs.serve.modules.oms.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.oms.entity.OmsOrder; |
||||
|
import com.qs.serve.modules.oms.service.OmsOrderService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 订单模块 订单 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("oms/order") |
||||
|
public class OmsOrderController { |
||||
|
|
||||
|
private OmsOrderService omsOrderService; |
||||
|
|
||||
|
/** |
||||
|
* 翻页查询 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
@PreAuthorize("hasRole('oms:order:query')") |
||||
|
public R<PageVo<OmsOrder>> getPage(OmsOrder param){ |
||||
|
PageUtil.startPage(); |
||||
|
LambdaQueryWrapper<OmsOrder> orderWrapper = new LambdaQueryWrapper<>(param); |
||||
|
List<OmsOrder> list = omsOrderService.list(orderWrapper); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/getById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单", biz = BizType.QUERY) |
||||
|
@PreAuthorize("hasRole('oms:order:query')") |
||||
|
public R<OmsOrder> getById(@PathVariable("id") String id){ |
||||
|
OmsOrder omsOrder = omsOrderService.getById(id); |
||||
|
return R.ok(omsOrder); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 根据ID更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('oms:order:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid OmsOrder param){ |
||||
|
boolean result = omsOrderService.updateById(param); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增订单 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('oms:order:insert')") |
||||
|
public R<?> save(@RequestBody @Valid OmsOrder param){ |
||||
|
boolean result = omsOrderService.save(param); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除订单 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('oms:order:delete')") |
||||
|
public R<?> deleteById(@PathVariable("id") String id){ |
||||
|
boolean result = omsOrderService.removeById(id); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,103 @@ |
|||||
|
package com.qs.serve.modules.oms.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.oms.entity.OmsOrderItem; |
||||
|
import com.qs.serve.modules.oms.service.OmsOrderItemService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 订单模块 订单明细 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("oms/orderItem") |
||||
|
public class OmsOrderItemController { |
||||
|
|
||||
|
private OmsOrderItemService omsOrderItemService; |
||||
|
|
||||
|
/** |
||||
|
* 翻页查询 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
@PreAuthorize("hasRole('oms:orderItem:query')") |
||||
|
public R<PageVo<OmsOrderItem>> getPage(OmsOrderItem param){ |
||||
|
PageUtil.startPage(); |
||||
|
LambdaQueryWrapper<OmsOrderItem> orderItemWrapper = new LambdaQueryWrapper<>(param); |
||||
|
List<OmsOrderItem> list = omsOrderItemService.list(orderItemWrapper); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/getById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单明细", biz = BizType.QUERY) |
||||
|
@PreAuthorize("hasRole('oms:orderItem:query')") |
||||
|
public R<OmsOrderItem> getById(@PathVariable("id") String id){ |
||||
|
OmsOrderItem omsOrderItem = omsOrderItemService.getById(id); |
||||
|
return R.ok(omsOrderItem); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 根据ID更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单明细", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('oms:orderItem:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid OmsOrderItem param){ |
||||
|
boolean result = omsOrderItemService.updateById(param); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增订单明细 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单明细", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('oms:orderItem:insert')") |
||||
|
public R<?> save(@RequestBody @Valid OmsOrderItem param){ |
||||
|
boolean result = omsOrderItemService.save(param); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除订单明细 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单明细", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('oms:orderItem:delete')") |
||||
|
public R<?> deleteById(@PathVariable("id") String id){ |
||||
|
boolean result = omsOrderItemService.removeById(id); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,101 @@ |
|||||
|
package com.qs.serve.modules.oms.controller.api; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.modules.oms.entity.OmsOrder; |
||||
|
import com.qs.serve.modules.oms.entity.bo.OmsConfirmOrderBo; |
||||
|
import com.qs.serve.modules.oms.entity.vo.OmsConfirmOrderVo; |
||||
|
import com.qs.serve.modules.oms.service.OmsOrderService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* API订单模块 订单 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/api/order") |
||||
|
public class OmsOrderApi { |
||||
|
|
||||
|
private OmsOrderService omsOrderService; |
||||
|
|
||||
|
/** |
||||
|
* 创建确认订单 |
||||
|
* @param confirmOrder |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/generateConfirmOrder") |
||||
|
public R<OmsConfirmOrderVo> generateConfirmOrder(@RequestBody @Valid OmsConfirmOrderBo confirmOrder){ |
||||
|
return R.ok(omsOrderService.generateConfirmOrder(confirmOrder)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 翻页查询 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
public R<PageVo<OmsOrder>> getPage(OmsOrder param){ |
||||
|
PageUtil.startPage(); |
||||
|
LambdaQueryWrapper<OmsOrder> orderWrapper = new LambdaQueryWrapper<>(param); |
||||
|
List<OmsOrder> list = omsOrderService.list(orderWrapper); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/getById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单", biz = BizType.QUERY) |
||||
|
@PreAuthorize("hasRole('oms:order:query')") |
||||
|
public R<OmsOrder> getById(@PathVariable("id") String id){ |
||||
|
OmsOrder omsOrder = omsOrderService.getById(id); |
||||
|
return R.ok(omsOrder); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 新增订单 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('oms:order:insert')") |
||||
|
public R<?> save(@RequestBody @Valid OmsOrder param){ |
||||
|
boolean result = omsOrderService.save(param); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除订单 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{id}") |
||||
|
@SysLog(module = SystemModule.BASE, title = "订单", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('oms:order:delete')") |
||||
|
public R<?> deleteById(@PathVariable("id") String id){ |
||||
|
boolean result = omsOrderService.removeById(id); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,130 @@ |
|||||
|
package com.qs.serve.modules.oms.controller.api; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.modules.bms.service.BmsSupplierUserService; |
||||
|
import com.qs.serve.modules.goods.entity.GoodsSku; |
||||
|
import com.qs.serve.modules.goods.entity.GoodsSkuSpecValue; |
||||
|
import com.qs.serve.modules.goods.entity.GoodsSpu; |
||||
|
import com.qs.serve.modules.goods.entity.vo.GoodsSkuSpecValueVo; |
||||
|
import com.qs.serve.modules.goods.service.GoodsSkuService; |
||||
|
import com.qs.serve.modules.goods.service.GoodsSkuSpecValueService; |
||||
|
import com.qs.serve.modules.goods.service.GoodsSpuService; |
||||
|
import com.qs.serve.modules.oms.entity.OmsShoppingCart; |
||||
|
import com.qs.serve.modules.oms.entity.bo.OmsShoppingCartSaveBo; |
||||
|
import com.qs.serve.modules.oms.entity.bo.OmsShoppingCartUpdateBo; |
||||
|
import com.qs.serve.modules.oms.service.OmsShoppingCartService; |
||||
|
import com.qs.serve.modules.wx.entity.WxUser; |
||||
|
import com.qs.serve.modules.wx.service.WxUserService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* API订单模块 购物车 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("api/shoppingCart") |
||||
|
public class OmsShoppingCartApi { |
||||
|
|
||||
|
private OmsShoppingCartService omsShoppingCartService; |
||||
|
private GoodsSkuSpecValueService goodsSkuSpecValueService; |
||||
|
private BmsSupplierUserService bmsSupplierUserService; |
||||
|
private GoodsSpuService goodsSpuService; |
||||
|
private GoodsSkuService goodsSkuService; |
||||
|
private WxUserService wxUserService; |
||||
|
|
||||
|
/** |
||||
|
* 翻页查询 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
public R<PageVo<OmsShoppingCart>> getPage(OmsShoppingCart param){ |
||||
|
if(bmsSupplierUserService.checkWxUserSupplier(param.getSupplierId())){ |
||||
|
return R.error("请选择有效的客户"); |
||||
|
} |
||||
|
WxUser wxUser = wxUserService.getCurrentWxUser(true); |
||||
|
if(wxUser==null){ |
||||
|
return R.byEmptyList(); |
||||
|
} |
||||
|
LambdaQueryWrapper<OmsShoppingCart> shoppingCartWrapper = new LambdaQueryWrapper<>(param); |
||||
|
shoppingCartWrapper.eq(OmsShoppingCart::getUserId,wxUser.getSysUserId()); |
||||
|
PageUtil.startPage(); |
||||
|
List<OmsShoppingCart> list = omsShoppingCartService.list(shoppingCartWrapper); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 根据ID更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
public R<?> updateById(@RequestBody @Valid OmsShoppingCartUpdateBo param){ |
||||
|
OmsShoppingCart shoppingCart = omsShoppingCartService.getById(param.getCartId()); |
||||
|
if(bmsSupplierUserService.checkWxUserSupplier(shoppingCart.getSupplierId(),shoppingCart.getUserId())){ |
||||
|
return R.error("未授权"); |
||||
|
} |
||||
|
shoppingCart.setQuantity(param.getQuantity()); |
||||
|
omsShoppingCartService.updateById(shoppingCart); |
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增购物车 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
public R<?> save(@RequestBody @Valid OmsShoppingCartSaveBo param){ |
||||
|
if(bmsSupplierUserService.checkWxUserSupplier(param.getSupplierId())){ |
||||
|
return R.error("未授权"); |
||||
|
} |
||||
|
OmsShoppingCart shoppingCart = CopierUtil.copy(param,new OmsShoppingCart()); |
||||
|
WxUser wxUser = wxUserService.getCurrentWxUser(true); |
||||
|
shoppingCart.setUserId(wxUser.getSysUserId()); |
||||
|
GoodsSpu goodsSpu = goodsSpuService.getById(shoppingCart.getSpuId()); |
||||
|
shoppingCart.setSpuName(goodsSpu.getName()); |
||||
|
GoodsSku goodsSku = goodsSkuService.getById(shoppingCart.getSkuId()); |
||||
|
shoppingCart.setPicUrl(goodsSku.getPicUrl()); |
||||
|
List<GoodsSkuSpecValueVo> skuSpecValues = goodsSkuSpecValueService.listSpecValueBySkuId(goodsSku.getId()); |
||||
|
String specInfo = skuSpecValues.stream().map(GoodsSkuSpecValueVo::getSpecValue).collect(Collectors.joining(";")); |
||||
|
shoppingCart.setSpecInfo(specInfo); |
||||
|
omsShoppingCartService.save(shoppingCart); |
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除购物车 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{id}") |
||||
|
public R<?> deleteById(@PathVariable("id") String id){ |
||||
|
OmsShoppingCart shoppingCart = omsShoppingCartService.getById(id); |
||||
|
if(bmsSupplierUserService.checkWxUserSupplier(shoppingCart.getSupplierId(),shoppingCart.getUserId())){ |
||||
|
return R.error("未授权"); |
||||
|
} |
||||
|
omsShoppingCartService.removeById(id); |
||||
|
return R.error(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,144 @@ |
|||||
|
package com.qs.serve.modules.oms.entity; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 订单 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("oms_order") |
||||
|
public class OmsOrder implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 订单号 */ |
||||
|
@NotBlank(message = "订单号不能为空") |
||||
|
@Length(max = 20,message = "订单号长度不能超过20字") |
||||
|
private String orderSn; |
||||
|
|
||||
|
/** 供应商ID */ |
||||
|
@NotNull(message = "供应商ID不能为空") |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** 供应商编码 */ |
||||
|
@NotBlank(message = "供应商编码不能为空") |
||||
|
@Length(max = 20,message = "供应商编码长度不能超过20字") |
||||
|
private String supplierCode; |
||||
|
|
||||
|
/** 供应商名称 */ |
||||
|
@NotBlank(message = "供应商名称不能为空") |
||||
|
@Length(max = 30,message = "供应商名称长度不能超过30字") |
||||
|
private String supplierName; |
||||
|
|
||||
|
/** 供应商收货地址id */ |
||||
|
@NotNull(message = "供应商收货地址id不能为空") |
||||
|
private Long supplierAddrId; |
||||
|
|
||||
|
/** 审核状态 */ |
||||
|
@NotNull(message = "审核状态不能为空") |
||||
|
private Integer checkState; |
||||
|
|
||||
|
/** 审核人 */ |
||||
|
@Length(max = 32,message = "审核人长度不能超过32字") |
||||
|
private String checkUserId; |
||||
|
|
||||
|
/** 审核时间 */ |
||||
|
@Length(max = 0,message = "审核时间长度不能超过0字") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime checkTime; |
||||
|
|
||||
|
/** 成本中心id */ |
||||
|
private Long costCenterId; |
||||
|
|
||||
|
/** 成本中心编码 */ |
||||
|
@Length(max = 20,message = "成本中心编码长度不能超过20字") |
||||
|
private String costCenterCode; |
||||
|
|
||||
|
/** 成本中心名称 */ |
||||
|
@Length(max = 20,message = "成本中心名称长度不能超过20字") |
||||
|
private String costCenterName; |
||||
|
|
||||
|
/** 品牌ID */ |
||||
|
@NotNull(message = "品牌ID不能为空") |
||||
|
private Long brandId; |
||||
|
|
||||
|
/** 制单人id */ |
||||
|
@Length(max = 32,message = "制单人id长度不能超过32字") |
||||
|
private String userId; |
||||
|
|
||||
|
/** 制单人名称 */ |
||||
|
@Length(max = 20,message = "制单人名称长度不能超过20字") |
||||
|
private String userName; |
||||
|
|
||||
|
/** 制单人ERP编码 */ |
||||
|
@Length(max = 32,message = "制单人ERP编码长度不能超过32字") |
||||
|
private String userCode; |
||||
|
|
||||
|
/** 制单人手机号 */ |
||||
|
@Length(max = 255,message = "制单人手机号长度不能超过255字") |
||||
|
private String userPhone; |
||||
|
|
||||
|
/** 发票类型:0->普通发票;1->增值税发票; */ |
||||
|
private Integer billType; |
||||
|
|
||||
|
/** 是否加急 */ |
||||
|
private Integer urgentFlag; |
||||
|
|
||||
|
/** 订单状态 */ |
||||
|
private Integer status; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,117 @@ |
|||||
|
package com.qs.serve.modules.oms.entity; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 订单明细 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("oms_order_item") |
||||
|
public class OmsOrderItem implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 订单id */ |
||||
|
private Long orderId; |
||||
|
|
||||
|
/** 订单sn */ |
||||
|
@Length(max = 32,message = "订单sn长度不能超过32字") |
||||
|
private String orderSn; |
||||
|
|
||||
|
/** 商品id */ |
||||
|
private Long spuId; |
||||
|
|
||||
|
/** 商品编码 */ |
||||
|
@Length(max = 20,message = "商品编码长度不能超过20字") |
||||
|
private String spuCode; |
||||
|
|
||||
|
/** 商品名称 */ |
||||
|
@Length(max = 30,message = "商品名称长度不能超过30字") |
||||
|
private String spuTitle; |
||||
|
|
||||
|
/** skuId */ |
||||
|
private Long skuId; |
||||
|
|
||||
|
/** sku编码 */ |
||||
|
@Length(max = 20,message = "sku编码长度不能超过20字") |
||||
|
private String skuCode; |
||||
|
|
||||
|
/** sku单位 */ |
||||
|
@Length(max = 20,message = "sku单位长度不能超过20字") |
||||
|
private String skuUnit; |
||||
|
|
||||
|
/** sku图片 */ |
||||
|
@Length(max = 255,message = "sku图片长度不能超过255字") |
||||
|
private String skuImg; |
||||
|
|
||||
|
/** 规格值 */ |
||||
|
@Length(max = 255,message = "规格值长度不能超过255字") |
||||
|
private String specValues; |
||||
|
|
||||
|
/** 数量 */ |
||||
|
private Integer quantity; |
||||
|
|
||||
|
/** 销售价 */ |
||||
|
private BigDecimal salesPrice; |
||||
|
|
||||
|
/** 客户价 */ |
||||
|
private BigDecimal cusPrice; |
||||
|
|
||||
|
/** 市场价 */ |
||||
|
private BigDecimal marketPrice; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 最后更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 所属租户 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 逻辑删除标记(0:显示;1:隐藏) */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,105 @@ |
|||||
|
package com.qs.serve.modules.oms.entity; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 购物车 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("oms_shopping_cart") |
||||
|
public class OmsShoppingCart implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 下单人 */ |
||||
|
@NotBlank(message = "下单人不能为空") |
||||
|
@Length(max = 32,message = "下单人长度不能超过32字") |
||||
|
private String userId; |
||||
|
|
||||
|
/** 商品SPU */ |
||||
|
@NotBlank(message = "商品SPU不能为空") |
||||
|
@Length(max = 32,message = "商品SPU长度不能超过32字") |
||||
|
private Long spuId; |
||||
|
|
||||
|
/** 商品SKU */ |
||||
|
@NotBlank(message = "商品SKU不能为空") |
||||
|
@Length(max = 32,message = "商品SKU长度不能超过32字") |
||||
|
private Long skuId; |
||||
|
|
||||
|
/** 供应商ID */ |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** 数量 */ |
||||
|
@NotNull(message = "数量不能为空") |
||||
|
private Integer quantity; |
||||
|
|
||||
|
/** 加入时的spu名字 */ |
||||
|
@Length(max = 200,message = "加入时的spu名字长度不能超过200字") |
||||
|
private String spuName; |
||||
|
|
||||
|
/** 加入时价格 */ |
||||
|
private BigDecimal addPrice; |
||||
|
|
||||
|
/** 加入时的规格信息 */ |
||||
|
@Length(max = 200,message = "加入时的规格信息长度不能超过200字") |
||||
|
private String specInfo; |
||||
|
|
||||
|
/** 图片 */ |
||||
|
@Length(max = 500,message = "图片长度不能超过500字") |
||||
|
private String picUrl; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 最后更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 所属租户 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 逻辑删除标记(0:显示;1:隐藏) */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,46 @@ |
|||||
|
package com.qs.serve.modules.oms.entity.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.util.List; |
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2022/10/14 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OmsConfirmOrderBo { |
||||
|
|
||||
|
/** |
||||
|
* 供应商id |
||||
|
*/ |
||||
|
@NotNull |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** |
||||
|
* 订单类型:0->普通订单; |
||||
|
*/ |
||||
|
@NotNull |
||||
|
private Integer orderType; |
||||
|
|
||||
|
/** |
||||
|
* 立即购买或非普通订单 |
||||
|
*/ |
||||
|
private Long skuId; |
||||
|
|
||||
|
/** |
||||
|
* 数量(立即购买或非普通订单) |
||||
|
*/ |
||||
|
private Integer quantity; |
||||
|
|
||||
|
/** |
||||
|
* 购物车ID(购物车方式下单) |
||||
|
*/ |
||||
|
private List<Long> shoppingCartIds; |
||||
|
|
||||
|
/** |
||||
|
* todo 促销活动id列表 |
||||
|
*/ |
||||
|
private List<Long> promotionIds; |
||||
|
|
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package com.qs.serve.modules.oms.entity.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2022/10/14 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OmsShoppingCartSaveBo { |
||||
|
|
||||
|
/** 供应商ID */ |
||||
|
@NotNull(message = "供应商不能为空") |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** 商品SPU */ |
||||
|
@NotBlank(message = "商品SPU不能为空") |
||||
|
@Length(max = 32,message = "商品SPU长度不能超过32字") |
||||
|
private Long spuId; |
||||
|
|
||||
|
/** 商品SKU */ |
||||
|
@NotBlank(message = "商品SKU不能为空") |
||||
|
@Length(max = 32,message = "商品SKU长度不能超过32字") |
||||
|
private Long skuId; |
||||
|
|
||||
|
/** 数量 */ |
||||
|
@NotNull(message = "数量不能为空") |
||||
|
private Integer quantity; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 加入时价格 */ |
||||
|
private BigDecimal addPrice; |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.qs.serve.modules.oms.entity.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2022/10/14 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OmsShoppingCartUpdateBo { |
||||
|
|
||||
|
/** |
||||
|
* 购物车id |
||||
|
*/ |
||||
|
@NotNull |
||||
|
private Long cartId; |
||||
|
|
||||
|
/** |
||||
|
* 数量 |
||||
|
*/ |
||||
|
@Min(value = 1,message = "数量不能为空") |
||||
|
private Integer quantity; |
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.qs.serve.modules.oms.entity.dto; |
||||
|
|
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 金额相关封装 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Getter |
||||
|
@Setter |
||||
|
public class OmsCalcAmount { |
||||
|
|
||||
|
public OmsCalcAmount(){ |
||||
|
totalAmount = new BigDecimal(0); |
||||
|
promotionAmount = new BigDecimal(0); |
||||
|
payAmount = new BigDecimal(0); |
||||
|
couponAmount = new BigDecimal(0); |
||||
|
//freightAmount = new BigDecimal(0);
|
||||
|
//freightInsAmount = new BigDecimal(0);
|
||||
|
//integralAmount = new BigDecimal(0);
|
||||
|
} |
||||
|
|
||||
|
/** 订单商品总金额(未减折扣) */ |
||||
|
private BigDecimal totalAmount; |
||||
|
|
||||
|
/**总优惠券(指sku总优惠)*/ |
||||
|
private BigDecimal couponAmount; |
||||
|
|
||||
|
/** 总促销优化金额(指活动促销价、满减、阶梯价) */ |
||||
|
private BigDecimal promotionAmount; |
||||
|
|
||||
|
/** 应付金额 */ |
||||
|
private BigDecimal payAmount; |
||||
|
|
||||
|
//总运费
|
||||
|
//private BigDecimal freightAmount;
|
||||
|
//总运费险费用
|
||||
|
//private BigDecimal freightInsAmount;
|
||||
|
//总积分优惠
|
||||
|
//private BigDecimal integralAmount;
|
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.qs.serve.modules.oms.entity.vo; |
||||
|
|
||||
|
import com.qs.serve.modules.bms.entity.BmsSupplier; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSupplierAddress; |
||||
|
import com.qs.serve.modules.oms.entity.OmsShoppingCart; |
||||
|
import com.qs.serve.modules.oms.entity.dto.OmsCalcAmount; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2022/10/14 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OmsConfirmOrderVo { |
||||
|
|
||||
|
/** 购物车列表 */ |
||||
|
private List<?> shoppingCarts; |
||||
|
|
||||
|
/** 默认地址 */ |
||||
|
private Object defaultAddress; |
||||
|
|
||||
|
/** 合计信息 */ |
||||
|
private OmsCalcAmount amountInfo; |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.oms.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.oms.entity.OmsOrderItem; |
||||
|
|
||||
|
/** |
||||
|
* 订单明细 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-14 |
||||
|
*/ |
||||
|
public interface OmsOrderItemMapper extends BaseMapper<OmsOrderItem> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.oms.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.oms.entity.OmsOrder; |
||||
|
|
||||
|
/** |
||||
|
* 订单 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-14 |
||||
|
*/ |
||||
|
public interface OmsOrderMapper extends BaseMapper<OmsOrder> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.oms.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.oms.entity.OmsShoppingCart; |
||||
|
|
||||
|
/** |
||||
|
* 购物车 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-14 |
||||
|
*/ |
||||
|
public interface OmsShoppingCartMapper extends BaseMapper<OmsShoppingCart> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.oms.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.oms.entity.OmsOrderItem; |
||||
|
|
||||
|
/** |
||||
|
* 订单明细 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-14 |
||||
|
*/ |
||||
|
public interface OmsOrderItemService extends IService<OmsOrderItem> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
package com.qs.serve.modules.oms.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.oms.entity.OmsOrder; |
||||
|
import com.qs.serve.modules.oms.entity.bo.OmsConfirmOrderBo; |
||||
|
import com.qs.serve.modules.oms.entity.vo.OmsConfirmOrderVo; |
||||
|
|
||||
|
/** |
||||
|
* 订单 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-14 |
||||
|
*/ |
||||
|
public interface OmsOrderService extends IService<OmsOrder> { |
||||
|
|
||||
|
/** |
||||
|
* 创建确认订单 |
||||
|
* @param confirmOrder |
||||
|
* @return |
||||
|
*/ |
||||
|
OmsConfirmOrderVo generateConfirmOrder(OmsConfirmOrderBo confirmOrder); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
package com.qs.serve.modules.oms.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.oms.entity.OmsShoppingCart; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 购物车 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2022-10-14 |
||||
|
*/ |
||||
|
public interface OmsShoppingCartService extends IService<OmsShoppingCart> { |
||||
|
|
||||
|
List<OmsShoppingCart> listByIds(List<Long> ids,Long supplierId); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.oms.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.oms.entity.OmsOrderItem; |
||||
|
import com.qs.serve.modules.oms.service.OmsOrderItemService; |
||||
|
import com.qs.serve.modules.oms.mapper.OmsOrderItemMapper; |
||||
|
|
||||
|
/** |
||||
|
* 订单明细 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class OmsOrderItemServiceImpl extends ServiceImpl<OmsOrderItemMapper,OmsOrderItem> implements OmsOrderItemService { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,39 @@ |
|||||
|
package com.qs.serve.modules.oms.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import com.qs.serve.modules.oms.entity.OmsShoppingCart; |
||||
|
import com.qs.serve.modules.oms.entity.bo.OmsConfirmOrderBo; |
||||
|
import com.qs.serve.modules.oms.entity.vo.OmsConfirmOrderVo; |
||||
|
import com.qs.serve.modules.oms.service.OmsShoppingCartService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.oms.entity.OmsOrder; |
||||
|
import com.qs.serve.modules.oms.service.OmsOrderService; |
||||
|
import com.qs.serve.modules.oms.mapper.OmsOrderMapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 订单 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper,OmsOrder> implements OmsOrderService { |
||||
|
|
||||
|
private OmsShoppingCartService omsShoppingCartService; |
||||
|
|
||||
|
@Override |
||||
|
public OmsConfirmOrderVo generateConfirmOrder(OmsConfirmOrderBo confirmOrder) { |
||||
|
List<OmsShoppingCart> shoppingCarts = omsShoppingCartService.listByIds(confirmOrder.getShoppingCartIds(),confirmOrder.getSupplierId()); |
||||
|
|
||||
|
//检验库存
|
||||
|
//计算供应商折扣
|
||||
|
//计算是否有活动优惠
|
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
package com.qs.serve.modules.oms.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.oms.entity.OmsShoppingCart; |
||||
|
import com.qs.serve.modules.oms.service.OmsShoppingCartService; |
||||
|
import com.qs.serve.modules.oms.mapper.OmsShoppingCartMapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 购物车 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2022-10-14 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class OmsShoppingCartServiceImpl extends ServiceImpl<OmsShoppingCartMapper,OmsShoppingCart> implements OmsShoppingCartService { |
||||
|
|
||||
|
@Override |
||||
|
public List<OmsShoppingCart> listByIds(List<Long> ids, Long supplierId) { |
||||
|
LambdaQueryWrapper<OmsShoppingCart> lqw = new LambdaQueryWrapper<>(); |
||||
|
lqw.in(OmsShoppingCart::getId,ids); |
||||
|
lqw.eq(OmsShoppingCart::getSupplierId,supplierId); |
||||
|
return this.list(lqw); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,62 @@ |
|||||
|
<?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="com.qs.serve.modules.bms.mapper.BmsSkuSupplierMapper"> |
||||
|
|
||||
|
<resultMap id="bmsSkuSupplierMap" type="com.qs.serve.modules.bms.entity.BmsSkuSupplier" > |
||||
|
<result property="id" column="id"/> |
||||
|
<result property="spuId" column="spu_id"/> |
||||
|
<result property="skuId" column="sku_id"/> |
||||
|
<result property="supplierId" column="supplier_id"/> |
||||
|
<result property="banStatus" column="ban_status"/> |
||||
|
<result property="createTime" column="create_time"/> |
||||
|
<result property="createBy" column="create_by"/> |
||||
|
<result property="updateTime" column="update_time"/> |
||||
|
<result property="updateBy" column="update_by"/> |
||||
|
<result property="tenantId" column="tenant_id"/> |
||||
|
<result property="delFlag" column="del_flag"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="bmsSkuSupplierSql"> |
||||
|
bms_sku_supplier.`id`, |
||||
|
bms_sku_supplier.`spu_id`, |
||||
|
bms_sku_supplier.`sku_id`, |
||||
|
bms_sku_supplier.`supplier_id`, |
||||
|
bms_sku_supplier.`ban_status`, |
||||
|
bms_sku_supplier.`create_time`, |
||||
|
bms_sku_supplier.`create_by`, |
||||
|
bms_sku_supplier.`update_time`, |
||||
|
bms_sku_supplier.`update_by`, |
||||
|
bms_sku_supplier.`tenant_id`, |
||||
|
bms_sku_supplier.`del_flag` </sql> |
||||
|
|
||||
|
<select id="selectList2" parameterType="com.qs.serve.modules.bms.entity.BmsSkuSupplier" resultMap="bmsSkuSupplierMap"> |
||||
|
SELECT |
||||
|
`goods_sku`.spec_infos AS specInfos, |
||||
|
`goods_sku`.`sku_code` AS skuCode, |
||||
|
`goods_spu`.`name` AS spuTitle, |
||||
|
`goods_spu`.spu_code AS spuCode, |
||||
|
`bms_supplier`.`name` AS supplierName, |
||||
|
`bms_supplier`.`code` AS supplierCode, |
||||
|
<include refid="bmsSkuSupplierSql"/> |
||||
|
FROM `bms_sku_supplier` `bms_sku_supplier` |
||||
|
LEFT JOIN `goods_sku` `goods_sku` ON `bms_sku_supplier`.sku_id = `goods_sku`.`id` |
||||
|
LEFT JOIN `goods_spu` `goods_spu` ON `bms_sku_supplier`.spu_id = `goods_spu`.id |
||||
|
LEFT JOIN `bms_supplier` `bms_supplier` ON `bms_sku_supplier`.supplier_id = `bms_supplier`.`id`; |
||||
|
<where> |
||||
|
<if test="query.id != null"> and `bms_sku_supplier`.`id` = #{query.id}</if> |
||||
|
<if test="query.spuId != null"> and `bms_sku_supplier`.`spu_id` = #{query.spuId}</if> |
||||
|
<if test="query.skuId != null"> and `bms_sku_supplier`.`sku_id` = #{query.skuId}</if> |
||||
|
<if test="query.supplierId != null"> and `bms_sku_supplier`.`supplier_id` = #{query.supplierId}</if> |
||||
|
<if test="query.banStatus != null"> and `bms_sku_supplier`.`ban_status` = #{query.banStatus}</if> |
||||
|
<if test="query.createTime != null"> and `bms_sku_supplier`.`create_time` = #{query.createTime}</if> |
||||
|
<if test="query.createBy != null and query.createBy != ''"> and `bms_sku_supplier`.`create_by` = #{query.createBy}</if> |
||||
|
<if test="query.updateTime != null"> and `bms_sku_supplier`.`update_time` = #{query.updateTime}</if> |
||||
|
<if test="query.updateBy != null and query.updateBy != ''"> and `bms_sku_supplier`.`update_by` = #{query.updateBy}</if> |
||||
|
<if test="query.tenantId != null and query.tenantId != ''"> and `bms_sku_supplier`.`tenant_id` = #{query.tenantId}</if> |
||||
|
<if test="query.delFlag != null"> and `bms_sku_supplier`.`del_flag` = #{query.delFlag}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue