master:处理推广营销;
parent
41b856b3a1
commit
ba28cf41d1
|
|
@ -36,7 +36,7 @@ public class ShoppingCartController extends XktBaseController {
|
|||
/**
|
||||
* 电商卖家添加商品到进货车
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:cart:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:cart:add')")
|
||||
@ApiOperation(value = "电商卖家添加商品到进货车", httpMethod = "POST", response = R.class)
|
||||
@Log(title = "电商卖家添加商品到进货车", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
|
|
@ -47,7 +47,7 @@ public class ShoppingCartController extends XktBaseController {
|
|||
/**
|
||||
* 电商卖家编辑进货车商品
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:store:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:store:edit')")
|
||||
@ApiOperation(value = "电商卖家编辑进货车商品", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "电商卖家编辑进货车商品", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
|
|
@ -58,7 +58,7 @@ public class ShoppingCartController extends XktBaseController {
|
|||
/**
|
||||
* 获取用户进货车列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:cart:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:cart:list')")
|
||||
@ApiOperation(value = "获取用户进货车列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public R<Page<ShopCartPageResDTO>> page(@Validated @RequestBody ShopCartPageVO pageVO) {
|
||||
|
|
@ -68,17 +68,17 @@ public class ShoppingCartController extends XktBaseController {
|
|||
/**
|
||||
* 用户进货车列表点击编辑获取数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:cart:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:cart:list')")
|
||||
@ApiOperation(value = "用户进货车列表点击编辑获取数据", httpMethod = "GET", response = R.class)
|
||||
@GetMapping("/{shoppingCartId}")
|
||||
public R<ShopCartDetailResVO> getInfo(@PathVariable Long shoppingCartId) {
|
||||
return R.ok(BeanUtil.toBean(shopCartService.getInfo(shoppingCartId), ShopCartDetailResVO.class));
|
||||
@GetMapping("/edit/{shoppingCartId}")
|
||||
public R<ShopCartEditDetailResVO> getEditInfo(@PathVariable Long shoppingCartId) {
|
||||
return R.ok(BeanUtil.toBean(shopCartService.getEditInfo(shoppingCartId), ShopCartEditDetailResVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据storeProdId获取进货车详情
|
||||
* 根据shoppingCartId获取详情
|
||||
*/
|
||||
@ApiOperation(value = "根据storeProdId获取进货车详情", httpMethod = "GET", response = R.class)
|
||||
@ApiOperation(value = "根据shoppingCartId获取详情", httpMethod = "GET", response = R.class)
|
||||
@GetMapping("/storeProdId/{storeProdId}")
|
||||
public R<ShopCartResVO> getByStoreProdId(@PathVariable Long storeProdId) {
|
||||
return R.ok(BeanUtil.toBean(shopCartService.getByStoreProdId(storeProdId), ShopCartResVO.class));
|
||||
|
|
@ -88,7 +88,7 @@ public class ShoppingCartController extends XktBaseController {
|
|||
/**
|
||||
* 用户删除进货车商品
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:sale:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:sale:remove')")
|
||||
@ApiOperation(value = "用户进货车列表点击编辑", httpMethod = "DELETE", response = R.class)
|
||||
@Log(title = "用户删除进货车商品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{shoppingCartId}")
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
/**
|
||||
* 销售出库时,新增或修改档口客户优惠
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discount:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:discount:edit')")
|
||||
@ApiOperation(value = "销售出库时,新增或修改档口客户优惠", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "销售出库时,新增或修改档口客户优惠", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
|
|
@ -49,7 +49,7 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
/**
|
||||
* 客户销售管理 批量减价、批量抹零减价、新增客户定价优惠
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discount:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:discount:edit')")
|
||||
@ApiOperation(value = "客户销售管理 批量减价、批量抹零减价、新增客户定价优惠", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "客户销售管理 批量减价、批量抹零减价、新增客户定价优惠", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/batch")
|
||||
|
|
@ -60,7 +60,7 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
/**
|
||||
* 查询客户销售管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:customer:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:customer:list')")
|
||||
@ApiOperation(value = "查询客户销售管理列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public R<Page<StoreCusProdDiscPageResDTO>> selectPage(@Validated @RequestBody StoreCusProdDiscPageVO pageVO) {
|
||||
|
|
@ -70,7 +70,7 @@ public class StoreCustomerProductDiscountController extends XktBaseController {
|
|||
/**
|
||||
* 新增客户销售定价时,根据入参查询是否已存在优惠
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:customer:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:customer:list')")
|
||||
@ApiOperation(value = "新增客户销售定价时,根据入参查询是否已存在优惠", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/exists")
|
||||
public R<List<StoreCusProdDiscExistResDTO>> discountExist(@Validated @RequestBody StoreCusProdDiscExistVO existVO) {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.xkt.domain.StoreProductColorPrice;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProdColorPrice.StoreProdColorPriceVO;
|
||||
import com.ruoyi.xkt.service.IStoreProductColorPriceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -21,71 +21,21 @@ import java.util.List;
|
|||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "档口商品颜色定价")
|
||||
@RestController
|
||||
@RequestMapping("/rest/v1/prod-color-prices")
|
||||
public class StoreProductColorPriceController extends XktBaseController {
|
||||
@Autowired
|
||||
private IStoreProductColorPriceService storeProductColorPriceService;
|
||||
|
||||
final IStoreProductColorPriceService prodColorPriceService;
|
||||
|
||||
/**
|
||||
* 查询档口商品颜色定价列表
|
||||
* 根据storeProdId获取所有颜色分类及定价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:price:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(StoreProductColorPrice storeProductColorPrice) {
|
||||
startPage();
|
||||
List<StoreProductColorPrice> list = storeProductColorPriceService.selectStoreProductColorPriceList(storeProductColorPrice);
|
||||
return getDataTable(list);
|
||||
@ApiOperation(value = "根据storeProdId获取所有颜色分类及定价", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/{storeId}/{storeProdId}")
|
||||
public R<List<StoreProdColorPriceVO>> getColorPriceByStoreProdId(@PathVariable(value = "storeProdId") Long storeProdId, @PathVariable("storeId") Long storeId) {
|
||||
return R.ok(BeanUtil.copyToList(prodColorPriceService.getColorPriceByStoreProdId(storeId, storeProdId), StoreProdColorPriceVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出档口商品颜色定价列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:price:export')")
|
||||
@Log(title = "档口商品颜色定价", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, StoreProductColorPrice storeProductColorPrice) {
|
||||
List<StoreProductColorPrice> list = storeProductColorPriceService.selectStoreProductColorPriceList(storeProductColorPrice);
|
||||
ExcelUtil<StoreProductColorPrice> util = new ExcelUtil<StoreProductColorPrice>(StoreProductColorPrice.class);
|
||||
util.exportExcel(response, list, "档口商品颜色定价数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取档口商品颜色定价详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:price:query')")
|
||||
@GetMapping(value = "/{storeProdColorPriceId}")
|
||||
public R getInfo(@PathVariable("storeProdColorPriceId") Long storeProdColorPriceId) {
|
||||
return success(storeProductColorPriceService.selectStoreProductColorPriceByStoreProdColorPriceId(storeProdColorPriceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口商品颜色定价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:price:add')")
|
||||
@Log(title = "档口商品颜色定价", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R add(@RequestBody StoreProductColorPrice storeProductColorPrice) {
|
||||
return success(storeProductColorPriceService.insertStoreProductColorPrice(storeProductColorPrice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档口商品颜色定价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:price:edit')")
|
||||
@Log(title = "档口商品颜色定价", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R edit(@RequestBody StoreProductColorPrice storeProductColorPrice) {
|
||||
return success(storeProductColorPriceService.updateStoreProductColorPrice(storeProductColorPrice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除档口商品颜色定价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:price:remove')")
|
||||
@Log(title = "档口商品颜色定价", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{storeProdColorPriceIds}")
|
||||
public R remove(@PathVariable Long[] storeProdColorPriceIds) {
|
||||
return success(storeProductColorPriceService.deleteStoreProductColorPriceByStoreProdColorPriceIds(storeProdColorPriceIds));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ public class StoreProductController extends XktBaseController {
|
|||
final IStoreProductService storeProdService;
|
||||
|
||||
/**
|
||||
* 查询档口商品所有的风格
|
||||
* 查询档口商品所有的风格(APP用)
|
||||
*/
|
||||
@ApiOperation(value = "查询档口商品所有的风格", httpMethod = "GET", response = R.class)
|
||||
@ApiOperation(value = "查询档口商品所有的风格(APP用)", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/styles")
|
||||
public R<List<String>> getStyleList() {
|
||||
return R.ok(storeProdService.getStyleList());
|
||||
|
|
@ -166,15 +166,5 @@ public class StoreProductController extends XktBaseController {
|
|||
util.exportExcel(response, list, "档口商品数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档口商品 不要掉不要掉
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:product:edit')")
|
||||
@ApiOperation(value = "修改档口商品", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "档口商品", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/update/{storeProdId}")
|
||||
public R<Integer> update111(@PathVariable Long storeProdId) throws IOException {
|
||||
return R.ok(storeProdService.update111(storeProdId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class AdRoundStoreResVO {
|
|||
@ApiModelProperty(value = "位置枚举的广告轮次列表")
|
||||
private List<ADRSRoundPositionVO> positionList;
|
||||
@ApiModelProperty(value = "已订购的推广轮次记录")
|
||||
private List<ADRSRoundRecordVO> recordList;
|
||||
private List<ADRSRoundRecordVO> boughtRoundList;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
|
@ -72,8 +72,8 @@ public class AdRoundStoreResVO {
|
|||
private Integer typeId;
|
||||
@ApiModelProperty(value = "广告位置 A B C D E")
|
||||
private String position;
|
||||
@ApiModelProperty(value = "推广档口ID")
|
||||
private Long storeId;
|
||||
// @ApiModelProperty(value = "推广档口ID")
|
||||
// private Long storeId;
|
||||
@ApiModelProperty(value = "对象锁符号")
|
||||
private String symbol;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ public class StoreProdSkuResVO {
|
|||
@Data
|
||||
@ApiModel(value = "档口商品SKU")
|
||||
public static class SPColorVO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProdColorPrice;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口商品新增客户定价获取所有的颜色及价格")
|
||||
@Data
|
||||
public class StoreProdColorPriceVO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "档口商品颜色定价")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty(value = "大小码加价")
|
||||
private Integer overPrice;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orderNum;
|
||||
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
@ApiModel("档口商品详情返回数据")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ShopCartDetailResVO {
|
||||
public class ShopCartEditDetailResVO {
|
||||
|
||||
@ApiModelProperty("档口商品ID")
|
||||
private Long storeProdId;
|
||||
|
|
@ -17,6 +17,8 @@ import java.util.List;
|
|||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ShopCartResVO {
|
||||
|
||||
@ApiModelProperty(value = "进货车ID")
|
||||
private Long shoppingCartId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口名称")
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class AdRoundStoreResDTO {
|
|||
@ApiModelProperty(value = "位置枚举的广告轮次列表")
|
||||
private List<ADRSRoundPositionDTO> positionList;
|
||||
@ApiModelProperty(value = "已订购的推广轮次记录")
|
||||
private List<ADRSRoundRecordDTO> recordList;
|
||||
private List<ADRSRoundRecordDTO> boughtRoundList;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
|
@ -76,8 +76,14 @@ public class AdRoundStoreResDTO {
|
|||
private Integer typeId;
|
||||
@ApiModelProperty(value = "广告位置 A B C D E")
|
||||
private String position;
|
||||
@ApiModelProperty(value = "推广档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "投放开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date startTime;
|
||||
@ApiModelProperty(value = "投放结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date endTime;
|
||||
// @ApiModelProperty(value = "推广档口ID")
|
||||
// private Long storeId;
|
||||
@ApiModelProperty(value = "对象锁符号")
|
||||
private String symbol;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ruoyi.xkt.dto.storeProdColorPrice;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("档口商品新增客户定价获取所有的颜色及价格")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StoreProdColorPriceResDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "档口商品颜色定价")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty(value = "大小码加价")
|
||||
private Integer overPrice;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orderNum;
|
||||
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
@ApiModel("档口商品当前颜色")
|
||||
@Data
|
||||
public class StoreProdColorPriceDTO {
|
||||
public class StoreProdColorPriceSimpleDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
|
|
@ -2,8 +2,6 @@ package com.ruoyi.xkt.dto.storeProduct;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdDetail.StoreProdDetailDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
|
||||
import com.ruoyi.xkt.dto.storeProductFile.StoreProdFileResDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import com.ruoyi.xkt.dto.storeColor.StoreColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdDetail.StoreProdDetailDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
|
||||
|
|
@ -15,7 +15,6 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
|
@ -74,7 +73,7 @@ public class StoreProdDTO {
|
|||
@ApiModelProperty(value = "档口商品尺码列表")
|
||||
private List<StoreProdColorSizeDTO> sizeList;
|
||||
@ApiModelProperty(value = "档口价格列表")
|
||||
private List<StoreProdColorPriceDTO> priceList;
|
||||
private List<StoreProdColorPriceSimpleDTO> priceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcDTO svc;
|
||||
@ApiModelProperty(value = "详情内容")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import com.ruoyi.xkt.dto.storeColor.StoreColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdDetail.StoreProdDetailDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
|
||||
|
|
@ -67,7 +67,7 @@ public class StoreProdResDTO {
|
|||
@ApiModelProperty(value = "档口商品尺码列表")
|
||||
private List<StoreProdColorSizeDTO> sizeList;
|
||||
@ApiModelProperty(value = "档口颜色价格列表")
|
||||
private List<StoreProdColorPriceDTO> priceList;
|
||||
private List<StoreProdColorPriceSimpleDTO> priceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcDTO svc;
|
||||
@ApiModelProperty(value = "详情内容")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import java.math.BigDecimal;
|
|||
@Data
|
||||
public class StoreProdSkuDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口商品颜色名称")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ public class StoreProdSkuResDTO {
|
|||
@Data
|
||||
@ApiModel(value = "档口商品SKU")
|
||||
public static class SPColorDTO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.ruoyi.xkt.dto.userShoppingCart;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel("电商卖家进货车数据")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ShopCartResDTO {
|
||||
|
||||
@ApiModelProperty(value = "进货车ID")
|
||||
private Long shoppingCartId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口名称")
|
||||
private String storeName;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "进货车明细列表")
|
||||
List<SCDetailDTO> detailList;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "档口优惠列表")
|
||||
public static class SCDetailDTO {
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
private Integer size;
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
private Integer quantity;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -2,7 +2,9 @@ package com.ruoyi.xkt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.StoreProductColorPrice;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -15,56 +17,18 @@ import java.util.List;
|
|||
*/
|
||||
@Repository
|
||||
public interface StoreProductColorPriceMapper extends BaseMapper<StoreProductColorPrice> {
|
||||
/**
|
||||
* 查询档口商品颜色定价
|
||||
*
|
||||
* @param id 档口商品颜色定价主键
|
||||
* @return 档口商品颜色定价
|
||||
*/
|
||||
public StoreProductColorPrice selectStoreProductColorPriceByStoreProdColorPriceId(Long id);
|
||||
|
||||
/**
|
||||
* 查询档口商品颜色定价列表
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 档口商品颜色定价集合
|
||||
*/
|
||||
public List<StoreProductColorPrice> selectStoreProductColorPriceList(StoreProductColorPrice storeProductColorPrice);
|
||||
|
||||
/**
|
||||
* 新增档口商品颜色定价
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreProductColorPrice(StoreProductColorPrice storeProductColorPrice);
|
||||
|
||||
/**
|
||||
* 修改档口商品颜色定价
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreProductColorPrice(StoreProductColorPrice storeProductColorPrice);
|
||||
|
||||
/**
|
||||
* 删除档口商品颜色定价
|
||||
*
|
||||
* @param id 档口商品颜色定价主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreProductColorPriceByStoreProdColorPriceId(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除档口商品颜色定价
|
||||
*
|
||||
* @param storeProdColorPriceIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreProductColorPriceByStoreProdColorPriceIds(Long[] storeProdColorPriceIds);
|
||||
|
||||
void updateDelFlagByStoreProdId(Long storeProdId);
|
||||
|
||||
List<StoreProdColorPriceDTO> selectListByStoreProdId(Long storeProdId);
|
||||
List<StoreProdColorPriceSimpleDTO> selectListByStoreProdId(Long storeProdId);
|
||||
|
||||
/**
|
||||
* 根据档口商品ID及档口ID获取所有颜色列表及定价
|
||||
*
|
||||
* @param storeProdId 档口商品ID
|
||||
* @param storeId 档口ID
|
||||
* @return List<StoreProdColorPriceResDTO>
|
||||
*/
|
||||
List<StoreProdColorPriceResDTO> selectListByStoreProdIdAndStoreId(@Param("storeProdId") Long storeProdId, @Param("storeId") Long storeId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public interface IShoppingCartService {
|
|||
* @param shoppingCartId 购物车ID
|
||||
* @return ShopCartDetailResDTO
|
||||
*/
|
||||
ShopCartDetailResDTO getInfo(Long shoppingCartId);
|
||||
ShopCartDetailResDTO getEditInfo(Long shoppingCartId);
|
||||
|
||||
/**
|
||||
* 用户编辑进货车商品
|
||||
|
|
@ -58,5 +58,5 @@ public interface IShoppingCartService {
|
|||
* @return ShoppingCartDTO
|
||||
*/
|
||||
ShoppingCartDTO getByStoreProdId(Long storeProdId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.xkt.domain.StoreProductColorPrice;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -11,51 +11,6 @@ import java.util.List;
|
|||
* @date 2025-03-26
|
||||
*/
|
||||
public interface IStoreProductColorPriceService {
|
||||
/**
|
||||
* 查询档口商品颜色定价
|
||||
*
|
||||
* @param storeProdColorPriceId 档口商品颜色定价主键
|
||||
* @return 档口商品颜色定价
|
||||
*/
|
||||
public StoreProductColorPrice selectStoreProductColorPriceByStoreProdColorPriceId(Long storeProdColorPriceId);
|
||||
|
||||
/**
|
||||
* 查询档口商品颜色定价列表
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 档口商品颜色定价集合
|
||||
*/
|
||||
public List<StoreProductColorPrice> selectStoreProductColorPriceList(StoreProductColorPrice storeProductColorPrice);
|
||||
|
||||
/**
|
||||
* 新增档口商品颜色定价
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreProductColorPrice(StoreProductColorPrice storeProductColorPrice);
|
||||
|
||||
/**
|
||||
* 修改档口商品颜色定价
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreProductColorPrice(StoreProductColorPrice storeProductColorPrice);
|
||||
|
||||
/**
|
||||
* 批量删除档口商品颜色定价
|
||||
*
|
||||
* @param storeProdColorPriceIds 需要删除的档口商品颜色定价主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreProductColorPriceByStoreProdColorPriceIds(Long[] storeProdColorPriceIds);
|
||||
|
||||
/**
|
||||
* 删除档口商品颜色定价信息
|
||||
*
|
||||
* @param storeProdColorPriceId 档口商品颜色定价主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreProductColorPriceByStoreProdColorPriceId(Long storeProdColorPriceId);
|
||||
List<StoreProdColorPriceResDTO> getColorPriceByStoreProdId(Long storeId, Long storeProdId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,5 +121,4 @@ public interface IStoreProductService {
|
|||
*/
|
||||
StoreProdSkuResDTO getSkuList(Long storeProdId);
|
||||
|
||||
Integer update111(Long storeProdId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,8 +160,7 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
|
|||
public AdRoundStoreResDTO getStoreAdInfo(final Long storeId,final Long advertId,final Integer showType) {
|
||||
// 获取当前 正在播放 和 待播放的推广轮次
|
||||
List<AdvertRound> advertRoundList = this.advertRoundMapper.selectList(new LambdaQueryWrapper<AdvertRound>()
|
||||
.eq(AdvertRound::getAdvertId, advertId)
|
||||
.eq(AdvertRound::getDelFlag, Constants.UNDELETED)
|
||||
.eq(AdvertRound::getAdvertId, advertId).eq(AdvertRound::getDelFlag, Constants.UNDELETED)
|
||||
.in(AdvertRound::getLaunchStatus, Arrays.asList(AdLaunchStatus.LAUNCHING.getValue(), AdLaunchStatus.UN_LAUNCH.getValue())));
|
||||
if (CollectionUtils.isEmpty(advertRoundList)) {
|
||||
return AdRoundStoreResDTO.builder().build();
|
||||
|
|
@ -184,10 +183,8 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
|
|||
roundIdSet.removeAll(boughtIdSet);
|
||||
List<AdvertRoundRecord> recordList = CollectionUtils.isNotEmpty(roundIdSet)
|
||||
? this.advertRoundRecordMapper.selectRecordList(advertId, storeId, voucherDate, roundIdSet) : new ArrayList<>();
|
||||
|
||||
// 获取已抢购推广位列表
|
||||
AdRoundStoreResDTO roundResDTO = AdRoundStoreResDTO.builder().recordList(this.getStoreBoughtList(storeId, advertRoundList, recordList)).build();
|
||||
|
||||
AdRoundStoreResDTO roundResDTO = AdRoundStoreResDTO.builder().boughtRoundList(this.getStoreBoughtList(storeId, advertRoundList, recordList)).build();
|
||||
// 如果投放类型是:时间范围,则只需要返回每一轮的开始时间和结束时间;如果投放类型是:位置枚举,则需要返回每一个位置的详细情况
|
||||
if (Objects.equals(showType, AdShowType.TIME_RANGE.getValue())) {
|
||||
// 构建当前round基础数据
|
||||
|
|
@ -199,17 +196,7 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
|
|||
// 当前档口购买的推广轮次
|
||||
Map<Integer, AdvertRound> boughtRoundMap = advertRoundList.stream().filter(x -> Objects.equals(x.getStoreId(), storeId))
|
||||
.collect(Collectors.toMap(AdvertRound::getRoundId, Function.identity()));
|
||||
/*// 所有的轮次
|
||||
Set<Integer> roundIdSet = advertRoundList.stream().filter(x -> ObjectUtils.isNotEmpty(x.getPayPrice())).map(AdvertRound::getRoundId).collect(Collectors.toSet());*/
|
||||
// 未购买的轮次 = 所有的轮次 - 已购买轮次
|
||||
// roundIdSet.removeAll(boughtRoundMap.keySet());
|
||||
|
||||
Map<Integer, AdvertRoundRecord> unBoughtRoundMap = recordList.stream().collect(Collectors.toConcurrentMap(AdvertRoundRecord::getRoundId, Function.identity()));
|
||||
// 有未购买轮次,则查找未购买轮次是否有竞价
|
||||
// if (CollectionUtils.isNotEmpty(roundIdSet)) {
|
||||
// List<AdvertRoundRecord> recordList = this.advertRoundRecordMapper.selectRecordList(advertId, storeId, voucherDate, roundIdSet);
|
||||
// Optional.ofNullable(recordList).ifPresent(list -> list.forEach(x -> unBoughtRoundMap.put(x.getRoundId(), x)));
|
||||
// }
|
||||
final Date date = new Date();
|
||||
// 设置当前档口在推广轮次中的数据详情
|
||||
rangeDTOList.forEach(x -> {
|
||||
|
|
@ -234,7 +221,7 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
|
|||
x.setBiddingStatusName(Objects.requireNonNull(AdBiddingStatus.of(unBought.getBiddingStatus())).getLabel());
|
||||
}
|
||||
});
|
||||
return roundResDTO.setTimeRangeList(rangeDTOList);
|
||||
return roundResDTO.setTimeRangeList(rangeDTOList);
|
||||
} else {
|
||||
// 位置枚举
|
||||
|
||||
|
|
@ -366,67 +353,19 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
|
|||
* @return List<AdRoundStoreResDTO.ADRSRoundRecordDTO>
|
||||
*/
|
||||
private List<AdRoundStoreResDTO.ADRSRoundRecordDTO> getStoreBoughtList(Long storeId, List<AdvertRound> advertRoundList, List<AdvertRoundRecord> recordList) {
|
||||
/*// 每一轮最高的出价map
|
||||
Map<Integer, BigDecimal> maxBidMap = advertRoundList.stream()
|
||||
.filter(x -> ObjectUtils.isNotEmpty(x.getPayPrice())).collect(Collectors
|
||||
.groupingBy(AdvertRound::getRoundId, Collectors
|
||||
.mapping(AdvertRound::getPayPrice, Collectors.reducing(BigDecimal.ZERO, BigDecimal::max))));
|
||||
// 先处理 已抢购广告位列表,此处不用管 播放的轮次 统一展示前4轮的结果
|
||||
List<AdRoundStoreResDTO.ADRSRoundRecordDTO> boughtRoundList = advertRoundList.stream()
|
||||
.filter(x -> !Objects.equals(x.getRoundId(), AdRoundType.FIFTH_ROUND.getValue()))
|
||||
.filter(x -> Objects.equals(x.getStoreId(), storeId))
|
||||
.map(x -> BeanUtil.toBean(x, AdRoundStoreResDTO.ADRSRoundRecordDTO.class)
|
||||
.setTypeName(Objects.requireNonNull(AdType.of(x.getTypeId())).getLabel())
|
||||
.setBiddingStatusName(Objects.requireNonNull(AdBiddingStatus.of(x.getBiddingStatus())).getLabel()))
|
||||
.collect(Collectors.toList());
|
||||
// 所有有档口出价的轮次
|
||||
Set<Integer> roundIdSet = advertRoundList.stream().filter(x -> ObjectUtils.isNotEmpty(x.getPayPrice())).map(AdvertRound::getRoundId).collect(Collectors.toSet());
|
||||
Set<Integer> boughtRoundIdSet = boughtRoundList.stream().map(AdRoundStoreResDTO.ADRSRoundRecordDTO::getRoundId).collect(Collectors.toSet());
|
||||
// 抢购记录当前档口未购买的轮次
|
||||
roundIdSet.removeAll(boughtRoundIdSet);
|
||||
// 查询其它轮次是否有购买记录
|
||||
if (CollectionUtils.isEmpty(roundIdSet)) {
|
||||
return boughtRoundList;
|
||||
}
|
||||
List<AdvertRoundRecord> recordList = this.advertRoundRecordMapper.selectRecordList(advertId, storeId, voucherDate, roundIdSet);
|
||||
if (CollectionUtils.isEmpty(recordList)) {
|
||||
return boughtRoundList;
|
||||
}
|
||||
boughtRoundList.addAll(recordList.stream().sorted(Comparator.comparing(AdvertRoundRecord::getBiddingStatus))
|
||||
.map(x -> BeanUtil.toBean(x, AdRoundStoreResDTO.ADRSRoundRecordDTO.class).setTypeName(Objects.requireNonNull(AdType.of(x.getTypeId())).getLabel())
|
||||
.setBiddingStatusName(Objects.requireNonNull(AdBiddingStatus.of(x.getBiddingStatus())).getLabel() + ",最新出价:" + maxBidMap.get(x.getRoundId())))
|
||||
.collect(Collectors.toList()));*/
|
||||
|
||||
|
||||
|
||||
|
||||
// 每一轮最高的出价map
|
||||
Map<Integer, BigDecimal> maxBidMap = advertRoundList.stream().filter(x -> ObjectUtils.isNotEmpty(x.getPayPrice())).collect(Collectors
|
||||
.groupingBy(AdvertRound::getRoundId, Collectors
|
||||
.mapping(AdvertRound::getPayPrice, Collectors.reducing(BigDecimal.ZERO, BigDecimal::max))));
|
||||
|
||||
.groupingBy(AdvertRound::getRoundId, Collectors
|
||||
.mapping(AdvertRound::getPayPrice, Collectors.reducing(BigDecimal.ZERO, BigDecimal::max))));
|
||||
// 先处理 已抢购广告位列表,此处不用管 播放的轮次 统一展示前4轮的结果
|
||||
List<AdRoundStoreResDTO.ADRSRoundRecordDTO> boughtRoundList = advertRoundList.stream().filter(x -> Objects.equals(x.getStoreId(), storeId))
|
||||
.map(x -> BeanUtil.toBean(x, AdRoundStoreResDTO.ADRSRoundRecordDTO.class).setTypeName(Objects.requireNonNull(AdType.of(x.getTypeId())).getLabel())
|
||||
.setBiddingStatusName(Objects.requireNonNull(AdBiddingStatus.of(x.getBiddingStatus())).getLabel()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
|
||||
// 所有有档口出价的轮次
|
||||
// Set<Integer> roundIdSet = advertRoundList.stream().filter(x -> ObjectUtils.isNotEmpty(x.getPayPrice())).map(AdvertRound::getRoundId).collect(Collectors.toSet());
|
||||
|
||||
// Set<Integer> boughtRoundIdSet = boughtRoundList.stream().map(AdRoundStoreResDTO.ADRSRoundRecordDTO::getRoundId).collect(Collectors.toSet());
|
||||
// 抢购记录当前档口未购买的轮次
|
||||
// roundIdSet.removeAll(boughtRoundIdSet);
|
||||
// 查询其它轮次是否有购买记录
|
||||
if (CollectionUtils.isEmpty(recordList)) {
|
||||
return boughtRoundList;
|
||||
}
|
||||
// List<AdvertRoundRecord> recordList = this.advertRoundRecordMapper.selectRecordList(advertId, storeId, voucherDate, unBoughtRoundIdSet);
|
||||
// if (CollectionUtils.isEmpty(recordList)) {
|
||||
// return boughtRoundList;
|
||||
// }
|
||||
boughtRoundList.addAll(recordList.stream().sorted(Comparator.comparing(AdvertRoundRecord::getBiddingStatus))
|
||||
.map(x -> BeanUtil.toBean(x, AdRoundStoreResDTO.ADRSRoundRecordDTO.class).setTypeName(Objects.requireNonNull(AdType.of(x.getTypeId())).getLabel())
|
||||
.setBiddingStatusName(Objects.requireNonNull(AdBiddingStatus.of(x.getBiddingStatus())).getLabel() + ",最新出价:" + maxBidMap.get(x.getRoundId())))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alipay.api.domain.Shop;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
|
@ -66,12 +67,28 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
|
|||
// TODO 判断当前登录用户角色,只有电商卖家才可操作,其它角色不允许操作,直接报错
|
||||
// TODO 判断当前登录用户角色,只有电商卖家才可操作,其它角色不允许操作,直接报错
|
||||
|
||||
|
||||
|
||||
|
||||
// 判断当前商品是否已添加过进货车
|
||||
List<ShoppingCart> existList = this.shopCartMapper.selectList(new LambdaQueryWrapper<ShoppingCart>()
|
||||
/* List<ShoppingCart> existList = this.shopCartMapper.selectList(new LambdaQueryWrapper<ShoppingCart>()
|
||||
.eq(ShoppingCart::getUserId, loginUser.getUserId()).eq(ShoppingCart::getStoreProdId, shoppingCartDTO.getStoreProdId())
|
||||
.eq(ShoppingCart::getDelFlag, Constants.UNDELETED));
|
||||
if (CollectionUtils.isNotEmpty(existList)) {
|
||||
throw new ServiceException("商品已经添加到进货单了,不可重复添加喔!", HttpStatus.ERROR);
|
||||
}*/
|
||||
ShoppingCart exist = this.shopCartMapper.selectOne(new LambdaQueryWrapper<ShoppingCart>()
|
||||
.eq(ShoppingCart::getUserId, loginUser.getUserId()).eq(ShoppingCart::getStoreProdId, shoppingCartDTO.getStoreProdId())
|
||||
.eq(ShoppingCart::getDelFlag, Constants.UNDELETED));
|
||||
if (ObjectUtils.isNotEmpty(exist)) {
|
||||
exist.setDelFlag(DELETED);
|
||||
this.shopCartMapper.updateById(exist);
|
||||
List<ShoppingCartDetail> detailList = this.shopCartDetailMapper.selectList(new LambdaQueryWrapper<ShoppingCartDetail>()
|
||||
.eq(ShoppingCartDetail::getShoppingCartId, exist.getId()).eq(ShoppingCartDetail::getDelFlag, Constants.UNDELETED));
|
||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||
detailList.forEach(x -> x.setDelFlag(DELETED));
|
||||
this.shopCartDetailMapper.updateById(detailList);
|
||||
}
|
||||
}
|
||||
ShoppingCart shoppingCart = BeanUtil.toBean(shoppingCartDTO, ShoppingCart.class).setUserId(loginUser.getUserId());
|
||||
int count = this.shopCartMapper.insert(shoppingCart);
|
||||
|
|
@ -145,7 +162,7 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
|
|||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public ShopCartDetailResDTO getInfo(Long shoppingCartId) {
|
||||
public ShopCartDetailResDTO getEditInfo(Long shoppingCartId) {
|
||||
// 获取当前登录用户
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
ShoppingCart shoppingCart = Optional.ofNullable(this.shopCartMapper.selectOne(new LambdaQueryWrapper<ShoppingCart>()
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.xkt.domain.StoreProductColorPrice;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
import com.ruoyi.xkt.mapper.StoreProductColorPriceMapper;
|
||||
import com.ruoyi.xkt.service.IStoreProductColorPriceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -17,77 +16,22 @@ import java.util.List;
|
|||
* @date 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class StoreProductColorPriceServiceImpl implements IStoreProductColorPriceService {
|
||||
@Autowired
|
||||
private StoreProductColorPriceMapper storeProductColorPriceMapper;
|
||||
|
||||
final StoreProductColorPriceMapper prodColorPriceMapper;
|
||||
|
||||
/**
|
||||
* 查询档口商品颜色定价
|
||||
* 根据档口ID 和 商品ID 获取所有颜色及价格
|
||||
*
|
||||
* @param storeProdColorPriceId 档口商品颜色定价主键
|
||||
* @return 档口商品颜色定价
|
||||
* @param storeId 档口ID
|
||||
* @param storeProdId 档口商品ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public StoreProductColorPrice selectStoreProductColorPriceByStoreProdColorPriceId(Long storeProdColorPriceId) {
|
||||
return storeProductColorPriceMapper.selectStoreProductColorPriceByStoreProdColorPriceId(storeProdColorPriceId);
|
||||
@Transactional(readOnly = true)
|
||||
public List<StoreProdColorPriceResDTO> getColorPriceByStoreProdId(Long storeId, Long storeProdId) {
|
||||
return this.prodColorPriceMapper.selectListByStoreProdIdAndStoreId(storeProdId, storeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询档口商品颜色定价列表
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 档口商品颜色定价
|
||||
*/
|
||||
@Override
|
||||
public List<StoreProductColorPrice> selectStoreProductColorPriceList(StoreProductColorPrice storeProductColorPrice) {
|
||||
return storeProductColorPriceMapper.selectStoreProductColorPriceList(storeProductColorPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增档口商品颜色定价
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertStoreProductColorPrice(StoreProductColorPrice storeProductColorPrice) {
|
||||
storeProductColorPrice.setCreateTime(DateUtils.getNowDate());
|
||||
return storeProductColorPriceMapper.insertStoreProductColorPrice(storeProductColorPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档口商品颜色定价
|
||||
*
|
||||
* @param storeProductColorPrice 档口商品颜色定价
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateStoreProductColorPrice(StoreProductColorPrice storeProductColorPrice) {
|
||||
storeProductColorPrice.setUpdateTime(DateUtils.getNowDate());
|
||||
return storeProductColorPriceMapper.updateStoreProductColorPrice(storeProductColorPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除档口商品颜色定价
|
||||
*
|
||||
* @param storeProdColorPriceIds 需要删除的档口商品颜色定价主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStoreProductColorPriceByStoreProdColorPriceIds(Long[] storeProdColorPriceIds) {
|
||||
return storeProductColorPriceMapper.deleteStoreProductColorPriceByStoreProdColorPriceIds(storeProdColorPriceIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除档口商品颜色定价信息
|
||||
*
|
||||
* @param storeProdColorPriceId 档口商品颜色定价主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStoreProductColorPriceByStoreProdColorPriceId(Long storeProdColorPriceId) {
|
||||
return storeProductColorPriceMapper.deleteStoreProductColorPriceByStoreProdColorPriceId(storeProdColorPriceId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.ruoyi.xkt.dto.es.ESProductDTO;
|
|||
import com.ruoyi.xkt.dto.storeColor.StoreColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdDetail.StoreProdDetailDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
|
||||
|
|
@ -105,7 +105,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 档口商品颜色尺码列表
|
||||
List<StoreProdColorSizeDTO> sizeList = this.storeProdColorSizeMapper.selectListByStoreProdId(storeProdId);
|
||||
// 档口颜色价格列表
|
||||
List<StoreProdColorPriceDTO> priceList = this.storeProdColorPriceMapper.selectListByStoreProdId(storeProdId);
|
||||
List<StoreProdColorPriceSimpleDTO> priceList = this.storeProdColorPriceMapper.selectListByStoreProdId(storeProdId);
|
||||
// 档口商品详情
|
||||
StoreProductDetail prodDetail = this.storeProdDetailMapper.selectByStoreProdId(storeProdId);
|
||||
// 档口服务承诺
|
||||
|
|
@ -497,7 +497,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 档口商品颜色尺码列表
|
||||
List<StoreProdColorSizeDTO> sizeList = this.storeProdColorSizeMapper.selectListByStoreProdId(storeProdId);
|
||||
// 档口颜色价格列表
|
||||
List<StoreProdColorPriceDTO> priceList = this.storeProdColorPriceMapper.selectListByStoreProdId(storeProdId);
|
||||
List<StoreProdColorPriceSimpleDTO> priceList = this.storeProdColorPriceMapper.selectListByStoreProdId(storeProdId);
|
||||
// 档口商品详情
|
||||
StoreProductDetail prodDetail = this.storeProdDetailMapper.selectByStoreProdId(storeProdId);
|
||||
// 档口服务承诺
|
||||
|
|
@ -514,7 +514,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
.setTagList(CollectionUtils.isNotEmpty(tagList) ? tagList.stream().map(DailyProdTag::getTag).distinct().collect(Collectors.toList()) : null)
|
||||
.setCollectProd(ObjectUtils.isNotEmpty(favorite) ? Boolean.TRUE : Boolean.FALSE)
|
||||
.setSpecification(colorList.size() + "色" + sizeList.stream().filter(x -> Objects.equals(x.getStandard(), ProductSizeStatus.STANDARD.getValue())).count() + "码")
|
||||
.setMinPrice(priceList.stream().min(Comparator.comparing(StoreProdColorPriceDTO::getPrice))
|
||||
.setMinPrice(priceList.stream().min(Comparator.comparing(StoreProdColorPriceSimpleDTO::getPrice))
|
||||
.orElseThrow(() -> new ServiceException("获取商品价格失败,请联系客服!", HttpStatus.ERROR)).getPrice())
|
||||
.setDetail(ObjectUtils.isEmpty(prodDetail) ? null : prodDetail.getDetail())
|
||||
.setSvc(ObjectUtils.isEmpty(storeProductSvc) ? null : BeanUtil.toBean(storeProductSvc, StoreProdSvcDTO.class));
|
||||
|
|
@ -554,64 +554,6 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
return BeanUtil.toBean(storeProd, StoreProdSkuResDTO.class).setStoreProdId(storeProdId).setColorList(colorList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer update111(Long storeProdId) {
|
||||
String htmlContent = "<!DOCTYPE html>\n" +
|
||||
"<html lang=\"zh-CN\">\n" +
|
||||
"<head>\n" +
|
||||
" <meta charset=\"UTF-8\">\n" +
|
||||
" <title>富文本示例</title>\n" +
|
||||
"</head>\n" +
|
||||
"<body>\n" +
|
||||
" <h1>美丽的自然风光</h1>\n" +
|
||||
" <p>让我们一起欣赏一些美丽的自然风光照片。</p>\n" +
|
||||
" \n" +
|
||||
" <!-- 第一张图片:日出 -->\n" +
|
||||
" <figure>\n" +
|
||||
" <img src=\"https://example.com/sunrise.jpg\" alt=\"日出的美景\" width=\"800\" height=\"600\">\n" +
|
||||
" <figcaption>图1:清晨的日出,象征着新的开始。</figcaption>\n" +
|
||||
" </figure>\n" +
|
||||
"\n" +
|
||||
" <!-- 文字描述 -->\n" +
|
||||
" <p>每天早晨太阳升起的时候,整个世界仿佛都被赋予了新生。\n" +
|
||||
" 这张照片捕捉了那令人叹为观止的瞬间,当第一缕阳光穿透晨雾,给大地带来了光明和温暖。</p>\n" +
|
||||
"\n" +
|
||||
" <!-- 第二张图片:森林 -->\n" +
|
||||
" <figure>\n" +
|
||||
" <img src=\"https://example.com/forest.jpg\" alt=\"茂密的森林\" width=\"800\" height=\"600\">\n" +
|
||||
" <figcaption>图2:一片宁静祥和的森林景象。</figcaption>\n" +
|
||||
" </figure>\n" +
|
||||
"\n" +
|
||||
" <!-- 文字描述 -->\n" +
|
||||
" <p>走进这片古老的森林,你会感受到一种无与伦比的宁静和平和。\n" +
|
||||
" 树木高耸入云,阳光透过树叶间的缝隙洒落,形成一片片光斑,宛如置身于童话世界中。</p>\n" +
|
||||
"\n" +
|
||||
" <!-- 第三张图片:瀑布 -->\n" +
|
||||
" <figure>\n" +
|
||||
" <img src=\"https://example.com/waterfall.jpg\" alt=\"壮观的瀑布\" width=\"800\" height=\"600\">\n" +
|
||||
" <figcaption>图3:大自然的力量——壮观的瀑布。</figcaption>\n" +
|
||||
" </figure>\n" +
|
||||
"\n" +
|
||||
" <!-- 文字描述 -->\n" +
|
||||
" <p>没有什么能比站在瀑布前更能让人感受到大自然的磅礴力量了。\n" +
|
||||
" 巨大的水体从高处倾泻而下,撞击在岩石上溅起层层白沫,发出雷鸣般的声响,令人心潮澎湃。</p>\n" +
|
||||
"</body>\n" +
|
||||
"</html>";
|
||||
|
||||
StoreProductDetail detail = this.storeProdDetailMapper.selectOne(new LambdaQueryWrapper<StoreProductDetail>()
|
||||
.eq(StoreProductDetail::getStoreProdId, storeProdId));
|
||||
|
||||
// StoreProductDetail detail1 = this.storeProdDetailMapper.selectByStoreProdId(storeProdId);
|
||||
detail.setDetail(htmlContent);
|
||||
this.storeProdDetailMapper.updateById(detail);
|
||||
|
||||
System.err.println(detail.getDetail());
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前商品的sku列表
|
||||
*
|
||||
|
|
@ -745,8 +687,8 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 获取上一级分类的分类ID 及 分类名称
|
||||
ProdCateDTO parCate = this.prodCateMapper.getParentCate(storeProdDTO.getProdCateId());
|
||||
// 获取当前商品的最低价格
|
||||
BigDecimal minPrice = storeProdDTO.getPriceList().stream().min(Comparator.comparing(StoreProdColorPriceDTO::getPrice))
|
||||
.map(StoreProdColorPriceDTO::getPrice).orElseThrow(() -> new ServiceException("商品价格不存在!", HttpStatus.ERROR));
|
||||
BigDecimal minPrice = storeProdDTO.getPriceList().stream().min(Comparator.comparing(StoreProdColorPriceSimpleDTO::getPrice))
|
||||
.map(StoreProdColorPriceSimpleDTO::getPrice).orElseThrow(() -> new ServiceException("商品价格不存在!", HttpStatus.ERROR));
|
||||
// 获取使用季节
|
||||
String season = storeProdDTO.getCateAttrList().stream().filter(x -> Objects.equals(x.getDictType(), "suitable_season"))
|
||||
.map(StoreProdCateAttrDTO::getDictValue).findAny().orElse("");
|
||||
|
|
|
|||
|
|
@ -4,96 +4,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.StoreProductColorPriceMapper">
|
||||
|
||||
<resultMap type="StoreProductColorPrice" id="StoreProductColorPriceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="storeProdColorId" column="store_prod_color_id" />
|
||||
<result property="storeProdId" column="store_prod_id" />
|
||||
<result property="price" column="price" />
|
||||
<result property="version" column="version" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStoreProductColorPriceVo">
|
||||
select id, store_prod_color_id, store_prod_id, price, version, del_flag, create_by, create_time, update_by, update_time from store_product_color_price
|
||||
</sql>
|
||||
|
||||
<select id="selectStoreProductColorPriceList" parameterType="StoreProductColorPrice" resultMap="StoreProductColorPriceResult">
|
||||
<include refid="selectStoreProductColorPriceVo"/>
|
||||
<where>
|
||||
<if test="storeProdColorId != null "> and store_prod_color_id = #{storeProdColorId}</if>
|
||||
<if test="storeProdId != null "> and store_prod_id = #{storeProdId}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="version != null "> and version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStoreProductColorPriceByStoreProdColorPriceId" parameterType="Long" resultMap="StoreProductColorPriceResult">
|
||||
<include refid="selectStoreProductColorPriceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertStoreProductColorPrice" parameterType="StoreProductColorPrice" useGeneratedKeys="true" keyProperty="storeProdColorPriceId">
|
||||
insert into store_product_color_price
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="storeProdColorId != null">store_prod_color_id,</if>
|
||||
<if test="storeProdId != null">store_prod_id,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="storeProdColorId != null">#{storeProdColorId},</if>
|
||||
<if test="storeProdId != null">#{storeProdId},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStoreProductColorPrice" parameterType="StoreProductColorPrice">
|
||||
update store_product_color_price
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="storeProdColorId != null">store_prod_color_id = #{storeProdColorId},</if>
|
||||
<if test="storeProdId != null">store_prod_id = #{storeProdId},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStoreProductColorPriceByStoreProdColorPriceId" parameterType="Long">
|
||||
delete from store_product_color_price where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStoreProductColorPriceByStoreProdColorPriceIds" parameterType="String">
|
||||
delete from store_product_color_price where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDelFlagByStoreProdId" parameterType="Long">
|
||||
UPDATE store_product_color_price SET del_flag = 2 WHERE store_prod_id = #{storeProdId}
|
||||
</update>
|
||||
|
||||
<select id="selectListByStoreProdId" parameterType="Long" resultType="com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO">
|
||||
<select id="selectListByStoreProdId" parameterType="Long" resultType="com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO">
|
||||
SELECT
|
||||
store_color_id AS storeColorId,
|
||||
price
|
||||
|
|
@ -103,6 +18,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
del_flag = 0 AND store_prod_id = #{storeProdId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectListByStoreProdIdAndStoreId" resultType="com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO">
|
||||
SELECT
|
||||
spc.id AS storeProdColorId,
|
||||
spc.store_id,
|
||||
spc.store_color_id,
|
||||
sp.prod_art_num,
|
||||
spc.color_name,
|
||||
spcp.price,
|
||||
sp.over_price,
|
||||
spc.order_num
|
||||
FROM
|
||||
store_product_color spc
|
||||
JOIN store_product sp ON spc.store_prod_id = sp.id
|
||||
JOIN store_product_color_price spcp ON spc.store_prod_id = spcp.store_prod_id
|
||||
AND spc.store_color_id = spcp.store_color_id
|
||||
WHERE
|
||||
spc.store_prod_id = #{storeProdId}
|
||||
AND spc.store_id = #{storeId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -222,6 +222,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectSkuList" resultType="com.ruoyi.xkt.dto.storeProduct.StoreProdSkuDTO" >
|
||||
SELECT
|
||||
spc.id AS storeProdColorId,
|
||||
spc.store_prod_id,
|
||||
spc.store_color_id,
|
||||
spc.color_name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue