master:客户管理功能完善;
parent
e3cc4ec69d
commit
adaa6e2090
|
|
@ -6,9 +6,11 @@ import com.ruoyi.common.core.controller.XktBaseController;
|
|||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusAddOverPriceVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusFuzzyResVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusPageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusVO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusAddOverPriceDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageResDTO;
|
||||
|
|
@ -43,6 +45,13 @@ public class StoreCustomerController extends XktBaseController {
|
|||
return R.ok(BeanUtil.copyToList(storeCusService.fuzzyQueryList(storeId, cusName), StoreCusFuzzyResVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "查询档口客户列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public R<Page<StoreCusPageResDTO>> selectPage(@Validated @RequestBody StoreCusPageVO pageVO) {
|
||||
return R.ok(storeCusService.selectPage(BeanUtil.toBean(pageVO, StoreCusPageDTO.class)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "新增档口客户", httpMethod = "POST", response = R.class)
|
||||
@Log(title = "新增档口客户", businessType = BusinessType.INSERT)
|
||||
|
|
@ -75,10 +84,12 @@ public class StoreCustomerController extends XktBaseController {
|
|||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "查询档口客户列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public R<Page<StoreCusPageResDTO>> selectPage(@Validated @RequestBody StoreCusPageVO pageVO) {
|
||||
return R.ok(storeCusService.selectPage(BeanUtil.toBean(pageVO, StoreCusPageDTO.class)));
|
||||
@Log(title = "修改大小码加价", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation(value = "修改大小码加价", httpMethod = "PUT", response = R.class)
|
||||
@PutMapping("/add-over-price")
|
||||
public R<Integer> updateAddOverPrice(@Validated @RequestBody StoreCusAddOverPriceVO addOverPriceVO) {
|
||||
return R.ok(storeCusService.updateAddOverPrice(BeanUtil.toBean(addOverPriceVO, StoreCusAddOverPriceDTO.class)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,15 +3,21 @@ package com.ruoyi.web.controller.xkt;
|
|||
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.Page;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProd.StoreProdPageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProdColorPrice.StoreProdColorPricePageVO;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeProdColorPrice.StoreProdColorPriceVO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPricePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProduct.StoreProdPageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProduct.StoreProdPageResDTO;
|
||||
import com.ruoyi.xkt.service.IStoreProductColorPriceService;
|
||||
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 org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -35,4 +41,11 @@ public class StoreProductColorPriceController extends XktBaseController {
|
|||
return R.ok(BeanUtil.copyToList(prodColorPriceService.getColorPriceByStoreProdId(storeId, storeProdId), StoreProdColorPriceVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "获取商品颜色价格列表", httpMethod = "POST", response = R.class)
|
||||
@PostMapping("/page")
|
||||
public R<Page<StoreProdColorPriceResDTO>> page(@Validated @RequestBody StoreProdColorPricePageVO pageVO) {
|
||||
return R.ok(prodColorPriceService.page(BeanUtil.toBean(pageVO, StoreProdColorPricePageDTO.class)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ public class StoreProductController extends XktBaseController {
|
|||
return R.ok(storeProdService.update(storeProdId, BeanUtil.toBean(storeProdVO, StoreProdDTO.class)));
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@Log(title = "修改档口商品状态", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation(value = "修改档口商品状态", httpMethod = "PUT", response = R.class)
|
||||
|
|
|
|||
|
|
@ -71,10 +71,10 @@ public class StoreSaleController extends XktBaseController {
|
|||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "查询档口销售出库详情", httpMethod = "GET", response = R.class)
|
||||
@ApiOperation(value = "查询档口销售出库明细", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/{storeSaleId}")
|
||||
public R<StoreSaleVO> getInfo(@PathVariable("storeSaleId") Long storeSaleId) {
|
||||
return R.ok(BeanUtil.toBean(storeSaleService.selectStoreSaleByStoreSaleId(storeSaleId), StoreSaleVO.class));
|
||||
public R<StoreSaleResVO> getInfo(@PathVariable("storeSaleId") Long storeSaleId) {
|
||||
return R.ok(BeanUtil.toBean(storeSaleService.selectStoreSaleByStoreSaleId(storeSaleId), StoreSaleResVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
|
|
@ -104,8 +104,8 @@ public class StoreSaleController extends XktBaseController {
|
|||
@Log(title = "修改备注", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation(value = "修改备注", httpMethod = "PUT", response = R.class)
|
||||
@PutMapping("/memo")
|
||||
public R<Integer> updateMemo(@Validated @RequestBody StoreSaleUpdateMemoVO updateMemoVO) {
|
||||
return R.ok(storeSaleService.updateMemo(BeanUtil.toBean(updateMemoVO, StoreSaleUpdateMemoDTO.class)));
|
||||
public R<Integer> updateRemark(@Validated @RequestBody StoreSaleUpdateMemoVO updateMemoVO) {
|
||||
return R.ok(storeSaleService.updateRemark(BeanUtil.toBean(updateMemoVO, StoreSaleUpdateMemoDTO.class)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ import java.util.List;
|
|||
public class StoreCusProdBatchDiscountVO {
|
||||
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
private Long storeId;
|
||||
@NotNull(message = "业务类型不能为空!")
|
||||
@ApiModelProperty(value = "业务类型:true:新增客户定价 false:批量减价、批量优惠")
|
||||
@ApiModelProperty(value = "业务类型:true:新增客户定价 false:批量减价、批量优惠", required = true)
|
||||
private Boolean isInsert;
|
||||
@NotNull(message = "优惠列表不能为空!")
|
||||
@Valid
|
||||
|
|
@ -34,10 +34,10 @@ public class StoreCusProdBatchDiscountVO {
|
|||
@Data
|
||||
public static class DiscountItemVO {
|
||||
@NotNull(message = "档口商品ID不能为空!")
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
@ApiModelProperty(value = "档口商品ID", required = true)
|
||||
private Long storeProdId;
|
||||
@NotNull(message = "档口商品颜色ID不能为空!")
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
@ApiModelProperty(value = "档口商品颜色ID", required = true)
|
||||
private Long storeProdColorId;
|
||||
@NotNull(message = "优惠金额不能为空!")
|
||||
@ApiModelProperty(value = "优惠金额", required = true)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeCusProdDiscount;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -13,6 +14,7 @@ import javax.validation.constraints.NotNull;
|
|||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "新增或修改档口客户优惠")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreCusProdDiscountVO {
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeCustomer;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
public class StoreCusAddOverPriceVO {
|
||||
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
private Long storeId;
|
||||
@NotNull(message = "档口客户ID不可为空!")
|
||||
@ApiModelProperty(value = "档口客户ID", required = true)
|
||||
private Long storeCusId;
|
||||
@NotNull(message = "是否大小码加价不为空!")
|
||||
@ApiModelProperty(value = "是否大小码加价", required = true)
|
||||
private Integer addOverPrice;
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ public class StoreProdResVO {
|
|||
@ApiModelProperty(value = "档口颜色价格列表")
|
||||
private List<StoreProdColorPriceVO> priceList;
|
||||
@ApiModelProperty(value = "档口商品尺码列表")
|
||||
private List<StoreProdColorSizeVO> sizeList;
|
||||
private List<StoreProdSizeVO> sizeList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
private StoreProdSvcVO svc;
|
||||
@ApiModelProperty(value = "详情内容")
|
||||
|
|
@ -73,12 +73,7 @@ public class StoreProdResVO {
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Valid
|
||||
public static class StoreProdColorSizeVO {
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
public static class StoreProdSizeVO {
|
||||
@ApiModelProperty(value = "商品尺码", required = true)
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
private Integer size;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProdColorPrice;
|
||||
|
||||
import com.ruoyi.web.controller.xkt.vo.BasePageVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class StoreProdColorPricePageVO extends BasePageVO {
|
||||
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "商品状态[1未发布,2在售,3尾货,4已下架,5已删除]", required = true)
|
||||
@NotNull(message = "商品状态不能为空")
|
||||
private List<Integer> prodStatusList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeSale;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreSaleResVO {
|
||||
|
||||
@ApiModelProperty(value = "是否为返单:true 是返单 false 不是返单")
|
||||
private Boolean refund;
|
||||
@ApiModelProperty(value = "storeSaleId")
|
||||
private Long storeSaleId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口客户ID")
|
||||
private Long storeCusId;
|
||||
@ApiModelProperty(value = "档口客户名称")
|
||||
private String storeCusName;
|
||||
@ApiModelProperty(value = "销售类型(销售 1、退货 2、销售/退货 3)")
|
||||
private Integer saleType;
|
||||
@ApiModelProperty(value = "支付方式(1支付宝、2微信、3现金、4欠款)")
|
||||
private Integer payWay;
|
||||
@ApiModelProperty(value = "结款状态(已结清、欠款) SETTLED、DEBT")
|
||||
private Integer paymentStatus;
|
||||
@ApiModelProperty(value = "抹零金额")
|
||||
private BigDecimal roundOff;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
@ApiModelProperty(value = "销售详情列表")
|
||||
private List<SaleDetailVO> detailList;
|
||||
|
||||
@Data
|
||||
public static class SaleDetailVO {
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口商品颜色尺码ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "颜色")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
private Integer size;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "销售条码")
|
||||
private String sns;
|
||||
@ApiModelProperty(value = "销售单价")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty(value = "给客户优惠后单价")
|
||||
private BigDecimal discountedPrice;
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(value = "总金额")
|
||||
private BigDecimal amount;
|
||||
@ApiModelProperty(value = "其它优惠")
|
||||
private BigDecimal otherDiscount;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
|
|
@ -23,6 +24,7 @@ public class StoreSaleUpdateMemoVO {
|
|||
private Long storeSaleId;
|
||||
@NotBlank(message = "备注不能为空!")
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Size(min = 0, max = 100, message = "备注不能超过100字!")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -20,6 +21,8 @@ public class StoreCusProdDiscPageResDTO {
|
|||
private Long storeCusProdDiscId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口客户ID")
|
||||
|
|
@ -28,6 +31,10 @@ public class StoreCusProdDiscPageResDTO {
|
|||
private String storeCusName;
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "颜色")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "价格")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty(value = "优惠金额")
|
||||
private Integer discount;
|
||||
@ApiModelProperty("更新时间")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.ruoyi.xkt.dto.storeCustomer;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
public class StoreCusAddOverPriceDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口客户ID")
|
||||
private Long storeCusId;
|
||||
@ApiModelProperty(value = "是否大小码加价")
|
||||
private Integer addOverPrice;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.ruoyi.xkt.dto.storeProdColorPrice;
|
||||
|
||||
import com.ruoyi.system.domain.dto.BasePageDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class StoreProdColorPricePageDTO extends BasePageDTO {
|
||||
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "商品状态[1未发布,2在售,3尾货,4已下架,5已删除]", required = true)
|
||||
private List<Integer> prodStatusList;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -21,6 +21,8 @@ public class StoreProdColorPriceResDTO {
|
|||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package com.ruoyi.xkt.dto.storeProdColorSize;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
public class StoreProdSizeDTO {
|
||||
|
||||
@ApiModelProperty(value = "商品尺码")
|
||||
private Integer size;
|
||||
@ApiModelProperty(value = "是否是标准尺码")
|
||||
private Integer standard;
|
||||
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
|||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
|
||||
import com.ruoyi.xkt.dto.storeProductFile.StoreProdFileResDTO;
|
||||
|
|
@ -64,7 +65,7 @@ public class StoreProdResDTO {
|
|||
@ApiModelProperty(value = "档口颜色列表")
|
||||
private List<StoreProdColorDTO> colorList;
|
||||
@ApiModelProperty(value = "档口商品尺码列表")
|
||||
private List<StoreProdColorSizeDTO> sizeList;
|
||||
private List<StoreProdSizeDTO> sizeList;
|
||||
@ApiModelProperty(value = "档口颜色价格列表")
|
||||
private List<StoreProdColorPriceSimpleDTO> priceList;
|
||||
@ApiModelProperty(value = "档口服务承诺")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.ruoyi.xkt.dto.storeSale;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreSaleResDTO {
|
||||
|
||||
@ApiModelProperty(value = "是否为返单:true 是返单 false 不是返单")
|
||||
private Boolean refund;
|
||||
@ApiModelProperty(value = "storeSaleId")
|
||||
private Long storeSaleId;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口客户ID")
|
||||
private Long storeCusId;
|
||||
@ApiModelProperty(value = "档口客户名称")
|
||||
private String storeCusName;
|
||||
@ApiModelProperty(value = "销售类型(销售 1、退货 2、销售/退货 3)")
|
||||
private Integer saleType;
|
||||
@ApiModelProperty(value = "支付方式(1支付宝、2微信、3现金、4欠款)")
|
||||
private Integer payWay;
|
||||
@ApiModelProperty(value = "结款状态(已结清、欠款) SETTLED、DEBT")
|
||||
private Integer paymentStatus;
|
||||
@ApiModelProperty(value = "抹零金额")
|
||||
private BigDecimal roundOff;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
@ApiModelProperty(value = "销售详情列表")
|
||||
private List<SSDetailDTO> detailList;
|
||||
|
||||
@Data
|
||||
public static class SSDetailDTO {
|
||||
@ApiModelProperty(value = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口商品颜色尺码ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "颜色")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
private Integer size;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
@ApiModelProperty(value = "销售条码")
|
||||
private String sns;
|
||||
@ApiModelProperty(value = "销售单价")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty(value = "给客户优惠后单价")
|
||||
private BigDecimal discountedPrice;
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(value = "总金额")
|
||||
private BigDecimal amount;
|
||||
@ApiModelProperty(value = "其它优惠")
|
||||
private BigDecimal otherDiscount;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,12 @@ import java.util.List;
|
|||
*/
|
||||
public interface StoreCustomerProductDiscountMapper extends BaseMapper<StoreCustomerProductDiscount> {
|
||||
|
||||
/**
|
||||
* 档口客户优惠分页
|
||||
*
|
||||
* @param pageDTO 分页入参
|
||||
* @return List<StoreCusProdDiscPageResDTO>
|
||||
*/
|
||||
List<StoreCusProdDiscPageResDTO> selectDiscPage(StoreCusProdDiscPageDTO pageDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.xkt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.StoreProductColorPrice;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPricePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdMinPriceDTO;
|
||||
|
|
@ -39,4 +40,10 @@ public interface StoreProductColorPriceMapper extends BaseMapper<StoreProductCol
|
|||
*/
|
||||
List<StoreProdMinPriceDTO> selectStoreProdMinPriceList(@Param("storeProdIdList") List<String> storeProdIdList);
|
||||
|
||||
/**
|
||||
* 获取档口颜色价格分页
|
||||
* @param pageDTO 入参
|
||||
* @return List<StoreProdColorPriceResDTO>
|
||||
*/
|
||||
List<StoreProdColorPriceResDTO> selectPricePage(StoreProdColorPricePageDTO pageDTO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.xkt.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.StoreProductColorSize;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdSizeDTO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -24,6 +25,6 @@ public interface StoreProductColorSizeMapper extends BaseMapper<StoreProductColo
|
|||
* @param storeProdId 档口商品ID
|
||||
* @return List<StoreProdColorSizeDTO>
|
||||
*/
|
||||
List<StoreProdColorSizeDTO> selectListByStoreProdId(Long storeProdId);
|
||||
List<StoreProdSizeDTO> selectListByStoreProdId(Long storeProdId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusFuzzyResDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -63,4 +60,11 @@ public interface IStoreCustomerService {
|
|||
*/
|
||||
List<StoreCusFuzzyResDTO> fuzzyQueryList(Long storeId, String cusName);
|
||||
|
||||
/**
|
||||
* 更改是否大小码加价
|
||||
*
|
||||
* @param addOverPriceDTO 入参
|
||||
* @return Integer
|
||||
*/
|
||||
Integer updateAddOverPrice(StoreCusAddOverPriceDTO addOverPriceDTO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPricePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -13,4 +15,13 @@ import java.util.List;
|
|||
public interface IStoreProductColorPriceService {
|
||||
|
||||
List<StoreProdColorPriceResDTO> getColorPriceByStoreProdId(Long storeId, Long storeProdId);
|
||||
|
||||
/**
|
||||
* 查询档口商品颜色价格分页
|
||||
*
|
||||
* @param pageDTO 入参
|
||||
* @return Page<StoreProdColorPriceResDTO>
|
||||
*/
|
||||
Page<StoreProdColorPriceResDTO> page(StoreProdColorPricePageDTO pageDTO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public interface IStoreSaleService {
|
|||
* @param storeSaleId 档口销售出库主键
|
||||
* @return 档口销售出库
|
||||
*/
|
||||
public StoreSaleDTO selectStoreSaleByStoreSaleId(Long storeSaleId);
|
||||
StoreSaleResDTO selectStoreSaleByStoreSaleId(Long storeSaleId);
|
||||
|
||||
/**
|
||||
* 新增档口销售出库
|
||||
|
|
@ -28,7 +28,7 @@ public interface IStoreSaleService {
|
|||
* @param storeSaleDTO 档口销售出库
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreSale(StoreSaleDTO storeSaleDTO);
|
||||
int insertStoreSale(StoreSaleDTO storeSaleDTO);
|
||||
|
||||
/**
|
||||
* 修改档口销售出库
|
||||
|
|
@ -36,7 +36,7 @@ public interface IStoreSaleService {
|
|||
* @param storeSaleDTO 档口销售出库
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreSale(StoreSaleDTO storeSaleDTO);
|
||||
int updateStoreSale(StoreSaleDTO storeSaleDTO);
|
||||
|
||||
/**
|
||||
* 删除档口销售出库信息
|
||||
|
|
@ -44,7 +44,7 @@ public interface IStoreSaleService {
|
|||
* @param storeSaleId 档口销售出库主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreSaleByStoreSaleId(Long storeSaleId);
|
||||
int deleteStoreSaleByStoreSaleId(Long storeSaleId);
|
||||
|
||||
/**
|
||||
* 获取当前档口客户的销售业绩
|
||||
|
|
@ -89,7 +89,7 @@ public interface IStoreSaleService {
|
|||
* @param updateMemoDTO 入参
|
||||
* @return Integer
|
||||
*/
|
||||
Integer updateMemo(StoreSaleUpdateMemoDTO updateMemoDTO);
|
||||
Integer updateRemark(StoreSaleUpdateMemoDTO updateMemoDTO);
|
||||
|
||||
/**
|
||||
* 导出销售出库列表
|
||||
|
|
|
|||
|
|
@ -63,20 +63,20 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
if (ObjectUtils.isNotEmpty(storeCusList) && storeCusList.size() > 1) {
|
||||
throw new ServiceException("客户名称重复,请修改客户名称!", HttpStatus.ERROR);
|
||||
}
|
||||
// 若存在,则取第一个;若不存在,则新增
|
||||
StoreCustomer storeCus = CollectionUtils.isNotEmpty(storeCusList) ? storeCusList.get(0) : this.createStoreCustomer(cusProdDisDTO);
|
||||
this.storeCusMapper.updateById(storeCus);
|
||||
// 获取当前档口客户已有的优惠
|
||||
List<StoreCustomerProductDiscount> cusProdDisList = Optional.ofNullable(cusProdDiscMapper.selectList(new LambdaQueryWrapper<StoreCustomerProductDiscount>()
|
||||
List<StoreCustomerProductDiscount> cusProdDiscList = Optional.ofNullable(cusProdDiscMapper.selectList(new LambdaQueryWrapper<StoreCustomerProductDiscount>()
|
||||
.eq(StoreCustomerProductDiscount::getStoreCusName, cusProdDisDTO.getStoreCusName()).eq(StoreCustomerProductDiscount::getDelFlag, Constants.UNDELETED)
|
||||
.eq(StoreCustomerProductDiscount::getStoreId, cusProdDisDTO.getStoreId()))).orElse(new ArrayList<>());
|
||||
// 已存在优惠但优惠额度低于当前优惠,则更新该部分优惠
|
||||
List<StoreCustomerProductDiscount> updateList = cusProdDisList.stream()
|
||||
List<StoreCustomerProductDiscount> updateList = cusProdDiscList.stream()
|
||||
// 找到所有优惠低于当前优惠额度的列表
|
||||
.filter(x -> cusProdDisDTO.getAllProductDiscount().compareTo(ObjectUtils.defaultIfNull(x.getDiscount(), 0)) > 0)
|
||||
// 更新最新的优惠
|
||||
.peek(x -> x.setDiscount(cusProdDisDTO.getAllProductDiscount())).collect(Collectors.toList());
|
||||
// 已有优惠的id
|
||||
List<Long> existDiscountProdColorIdList = cusProdDisList.stream().map(StoreCustomerProductDiscount::getStoreProdColorId).collect(Collectors.toList());
|
||||
List<Long> existDiscountProdColorIdList = cusProdDiscList.stream().map(StoreCustomerProductDiscount::getStoreProdColorId).collect(Collectors.toList());
|
||||
// 档口所有的商品
|
||||
List<StoreProductColor> storeProdColorList = this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
|
||||
.eq(StoreProductColor::getStoreId, cusProdDisDTO.getStoreId()).eq(StoreProductColor::getDelFlag, Constants.UNDELETED));
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ import com.ruoyi.common.core.page.Page;
|
|||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.xkt.domain.StoreCustomer;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusFuzzyResDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageResDTO;
|
||||
import com.ruoyi.xkt.dto.storeCustomer.*;
|
||||
import com.ruoyi.xkt.mapper.StoreCustomerMapper;
|
||||
import com.ruoyi.xkt.service.IStoreCustomerService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -59,6 +56,23 @@ public class StoreCustomerServiceImpl implements IStoreCustomerService {
|
|||
.map(x -> BeanUtil.toBean(x, StoreCusFuzzyResDTO.class).setStoreCusId(x.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改是否大小码加价
|
||||
*
|
||||
* @param addOverPriceDTO 入参
|
||||
* @return Integer
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer updateAddOverPrice(StoreCusAddOverPriceDTO addOverPriceDTO) {
|
||||
StoreCustomer storeCus = Optional.ofNullable(this.storeCusMapper.selectOne(new LambdaQueryWrapper<StoreCustomer>()
|
||||
.eq(StoreCustomer::getStoreId, addOverPriceDTO.getStoreId()).eq(StoreCustomer::getId, addOverPriceDTO.getStoreCusId())
|
||||
.eq(StoreCustomer::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("档口客户不存在!", HttpStatus.ERROR));
|
||||
storeCus.setAddOverPrice(addOverPriceDTO.getAddOverPrice());
|
||||
return this.storeCusMapper.updateById(storeCus);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int create(StoreCusDTO storeCusDTO) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPricePageDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO;
|
||||
import com.ruoyi.xkt.mapper.StoreProductColorPriceMapper;
|
||||
import com.ruoyi.xkt.service.IStoreProductColorPriceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -34,4 +39,19 @@ public class StoreProductColorPriceServiceImpl implements IStoreProductColorPric
|
|||
return this.prodColorPriceMapper.selectListByStoreProdIdAndStoreId(storeProdId, storeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询档口商品颜色价格分页
|
||||
*
|
||||
* @param pageDTO 入参
|
||||
* @return Page<StoreProdColorPriceResDTO>
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Page<StoreProdColorPriceResDTO> page(StoreProdColorPricePageDTO pageDTO) {
|
||||
PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize());
|
||||
List<StoreProdColorPriceResDTO> list = this.prodColorPriceMapper.selectPricePage(pageDTO);
|
||||
return CollectionUtils.isEmpty(list) ? Page.empty(pageDTO.getPageSize(), pageDTO.getPageNum())
|
||||
: Page.convert(new PageInfo<>(list));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
|
|||
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceSimpleDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdSizeDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
|
||||
import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
|
||||
import com.ruoyi.xkt.dto.storeProduct.*;
|
||||
|
|
@ -126,7 +127,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 档口当前商品颜色列表
|
||||
List<StoreProdColorDTO> colorList = this.storeProdColorMapper.selectListByStoreProdId(storeProdId);
|
||||
// 档口商品颜色尺码列表
|
||||
List<StoreProdColorSizeDTO> sizeList = this.storeProdColorSizeMapper.selectListByStoreProdId(storeProdId);
|
||||
List<StoreProdSizeDTO> sizeList = this.storeProdColorSizeMapper.selectListByStoreProdId(storeProdId);
|
||||
// 档口颜色价格列表
|
||||
List<StoreProdColorPriceSimpleDTO> priceList = this.storeProdColorPriceMapper.selectListByStoreProdId(storeProdId);
|
||||
// 档口商品详情
|
||||
|
|
@ -215,7 +216,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
.setRecommendWeight(0L).setSaleWeight(0L).setPopularityWeight(0L);
|
||||
int count = this.storeProdMapper.insert(storeProd);
|
||||
// 新增档口商品颜色相关
|
||||
this.createProdColor(createDTO, storeProd);
|
||||
this.createProdColor(createDTO, storeProd.getId(), storeProd.getStoreId());
|
||||
// 新增档口商品其它属性
|
||||
this.createOtherProperties(createDTO, storeProd);
|
||||
// 立即发布 将商品同步到 ES 商品文档,并将商品主图同步到 以图搜款服务中
|
||||
|
|
@ -270,7 +271,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 档口工艺信息的del_flag置为2
|
||||
this.storeProdProcMapper.updateDelFlagByStoreProdId(storeProdId);
|
||||
// 更新档口商品颜色价格及尺码等
|
||||
this.updateColorRelation(updateDTO, storeProdId, storeProd.getStoreId());
|
||||
this.updateColorRelation(updateDTO, storeProd.getId(), storeProd.getStoreId());
|
||||
// 处理更新逻辑
|
||||
this.updateOtherProperties(updateDTO, storeProd);
|
||||
// 只有在售和尾货状态,更新ES 信息 及 图搜
|
||||
|
|
@ -288,6 +289,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
return count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新商品其它属性
|
||||
*
|
||||
|
|
@ -350,6 +352,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
color.setDelFlag(Constants.DELETED);
|
||||
}
|
||||
});
|
||||
this.storeProdColorMapper.updateById(prodColorList);
|
||||
// 非新增颜色价格map
|
||||
Map<Long, BigDecimal> existColorPriceMap = updateDTO.getColorPriceList().stream().filter(x -> ObjectUtils.isNotEmpty(x.getStoreColorId()))
|
||||
.collect(Collectors.toMap(StoreProdDTO.SPCColorPriceDTO::getStoreColorId, StoreProdDTO.SPCColorPriceDTO::getPrice));
|
||||
|
|
@ -384,16 +387,20 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
List<StoreProdDTO.SPCColorPriceDTO> newColorPriceList = updateDTO.getColorPriceList().stream()
|
||||
.filter(x -> !existColorIdList.contains(x.getStoreColorId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(newColorPriceList)) {
|
||||
// 新增的档口商品颜色
|
||||
List<StoreProductColor> tempColorList = new ArrayList<>();
|
||||
newColorPriceList.forEach(newColorPrice -> {
|
||||
Long storeColorId = storeColorMap.get(newColorPrice.getColorName());
|
||||
prodColorList.add(new StoreProductColor().setStoreProdId(storeProdId).setStoreColorId(storeColorMap.get(newColorPrice.getColorName()))
|
||||
tempColorList.add(new StoreProductColor().setStoreProdId(storeProdId).setStoreColorId(storeColorMap.get(newColorPrice.getColorName()))
|
||||
.setColorName(newColorPrice.getColorName()).setOrderNum(newColorPrice.getOrderNum()).setStoreId(storeId));
|
||||
storeColorPriceList.add(new StoreProductColorPrice().setStoreColorId(storeColorId).setPrice(newColorPrice.getPrice()).setStoreProdId(storeProdId));
|
||||
updateDTO.getSizeList().forEach(size -> storeColorSizeList.add(new StoreProductColorSize().setStoreColorId(storeColorId).setSize(size.getSize())
|
||||
.setStoreProdId(storeProdId).setStandard(size.getStandard())));
|
||||
});
|
||||
this.storeProdColorMapper.insert(tempColorList);
|
||||
// 设置了档口商品全部优惠的客户,新增商品优惠
|
||||
this.createStoreCusDiscount(tempColorList, storeProdId);
|
||||
}
|
||||
this.storeProdColorMapper.insertOrUpdate(prodColorList);
|
||||
this.storeProdColorPriceMapper.insertOrUpdate(storeColorPriceList);
|
||||
this.storeProdColorSizeMapper.insertOrUpdate(storeColorSizeList);
|
||||
}
|
||||
|
|
@ -437,9 +444,10 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
* 新增档口商品颜色等
|
||||
*
|
||||
* @param createDTO 入参
|
||||
* @param storeProd 档口商品
|
||||
* @param storeProdId 档口商品ID
|
||||
* @param storeId 档口ID
|
||||
*/
|
||||
private void createProdColor(StoreProdDTO createDTO, StoreProduct storeProd) {
|
||||
private void createProdColor(StoreProdDTO createDTO, Long storeProdId, Long storeId) {
|
||||
// 处理档口所有颜色
|
||||
Map<String, Long> storeColorMap = createDTO.getAllColorList().stream().filter(x -> ObjectUtils.isNotEmpty(x.getStoreColorId()))
|
||||
.collect(Collectors.toMap(StoreColorDTO::getColorName, StoreColorDTO::getStoreColorId));
|
||||
|
|
@ -454,17 +462,19 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||
createDTO.getColorPriceList().forEach(colorPrice -> {
|
||||
prodColorList.add(new StoreProductColor().setStoreProdId(storeProd.getId()).setStoreColorId(storeColorMap.get(colorPrice.getColorName()))
|
||||
.setColorName(colorPrice.getColorName()).setOrderNum(colorPrice.getOrderNum()).setStoreId(storeProd.getStoreId()));
|
||||
prodColorPriceList.add(new StoreProductColorPrice().setStoreProdId(storeProd.getId()).setPrice(colorPrice.getPrice())
|
||||
prodColorList.add(new StoreProductColor().setStoreProdId(storeProdId).setStoreColorId(storeColorMap.get(colorPrice.getColorName()))
|
||||
.setColorName(colorPrice.getColorName()).setOrderNum(colorPrice.getOrderNum()).setStoreId(storeId));
|
||||
prodColorPriceList.add(new StoreProductColorPrice().setStoreProdId(storeProdId).setPrice(colorPrice.getPrice())
|
||||
.setStoreColorId(storeColorMap.get(colorPrice.getColorName())));
|
||||
prodColorSizeList.addAll(createDTO.getSizeList().stream().map(x -> new StoreProductColorSize().setSize(x.getSize()).setStoreProdId(storeProd.getId())
|
||||
prodColorSizeList.addAll(createDTO.getSizeList().stream().map(x -> new StoreProductColorSize().setSize(x.getSize()).setStoreProdId(storeProdId)
|
||||
.setStandard(x.getStandard()).setStoreColorId(storeColorMap.get(colorPrice.getColorName())))
|
||||
.collect(Collectors.toList()));
|
||||
});
|
||||
this.storeProdColorPriceMapper.insert(prodColorPriceList);
|
||||
this.storeProdColorSizeMapper.insert(prodColorSizeList);
|
||||
this.storeProdColorMapper.insert(prodColorList);
|
||||
// 设置了档口商品全部优惠的客户,新增商品优惠
|
||||
this.createStoreCusDiscount(prodColorList, storeProdId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -733,18 +743,8 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public StoreProdPCResDTO getPCInfo(Long storeProdId) {
|
||||
|
||||
// TODO 去掉
|
||||
// TODO 去掉
|
||||
// TODO 去掉
|
||||
// TODO 去掉
|
||||
|
||||
final Long userId = 1L;
|
||||
|
||||
|
||||
// 商品基础信息
|
||||
StoreProdPCResDTO prodInfoDTO = ObjectUtils.defaultIfNull(this.storeProdMapper.selectPCProdInfo(storeProdId, 1L), new StoreProdPCResDTO());
|
||||
// StoreProdPCResDTO prodInfoDTO = ObjectUtils.defaultIfNull(this.storeProdMapper.selectPCProdInfo(storeProdId, SecurityUtils.getUserId()), new StoreProdPCResDTO());
|
||||
StoreProdPCResDTO prodInfoDTO = ObjectUtils.defaultIfNull(this.storeProdMapper.selectPCProdInfo(storeProdId, SecurityUtils.getUserIdSafe()), new StoreProdPCResDTO());
|
||||
// 获取商品的属性
|
||||
StoreProductCategoryAttribute cateAttr = this.storeProdCateAttrMapper.selectOne(new LambdaQueryWrapper<StoreProductCategoryAttribute>()
|
||||
.eq(StoreProductCategoryAttribute::getStoreProdId, storeProdId).eq(StoreProductCategoryAttribute::getDelFlag, Constants.UNDELETED));
|
||||
|
|
@ -808,6 +808,27 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
return countList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 给设置了所有商品优惠的客户创建优惠
|
||||
*
|
||||
* @param colorList 档口商品颜色列表
|
||||
* @param storeProdId 档口商品ID
|
||||
*/
|
||||
private void createStoreCusDiscount(List<StoreProductColor> colorList, Long storeProdId) {
|
||||
// 档口给那些客户设置了所有商品优惠
|
||||
List<StoreCustomer> existCusDiscList = this.storeCusMapper.selectList(new LambdaQueryWrapper<StoreCustomer>()
|
||||
.isNotNull(StoreCustomer::getAllProdDiscount).eq(StoreCustomer::getDelFlag, UNDELETED));
|
||||
if (CollectionUtils.isEmpty(existCusDiscList)) {
|
||||
return;
|
||||
}
|
||||
List<StoreCustomerProductDiscount> cusDiscList = new ArrayList<>();
|
||||
// 为这些客户绑定商品优惠
|
||||
colorList.forEach(color -> existCusDiscList.forEach(storeCus -> cusDiscList.add(new StoreCustomerProductDiscount()
|
||||
.setDiscount(storeCus.getAllProdDiscount()).setStoreId(storeCus.getStoreId()).setStoreProdId(storeProdId)
|
||||
.setStoreCusId(storeCus.getId()).setStoreCusName(storeCus.getCusName()).setStoreProdColorId(color.getId()))));
|
||||
this.storeCusProdDiscMapper.insert(cusDiscList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前商品的sku列表
|
||||
|
|
@ -1003,29 +1024,6 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
System.out.println("bulkResponse.items() = " + bulkResponse.items());
|
||||
}
|
||||
|
||||
/**
|
||||
* 给设置了所有商品优惠的客户创建优惠
|
||||
*
|
||||
* @param colorList 档口商品颜色列表
|
||||
* @param storeProd 档口商品
|
||||
*/
|
||||
private void createStoreCusDiscount(List<StoreProductColor> colorList, StoreProduct storeProd) {
|
||||
if (CollectionUtils.isEmpty(colorList)) {
|
||||
return;
|
||||
}
|
||||
// 档口给那些客户设置了所有商品优惠
|
||||
List<StoreCustomer> existCusDiscList = this.storeCusMapper.selectList(new LambdaQueryWrapper<StoreCustomer>()
|
||||
.isNotNull(StoreCustomer::getAllProdDiscount).eq(StoreCustomer::getDelFlag, UNDELETED));
|
||||
if (CollectionUtils.isNotEmpty(existCusDiscList)) {
|
||||
List<StoreCustomerProductDiscount> cusDiscList = new ArrayList<>();
|
||||
// 为这些客户绑定商品优惠
|
||||
colorList.forEach(color -> existCusDiscList.forEach(storeCus -> cusDiscList.add(new StoreCustomerProductDiscount()
|
||||
.setDiscount(storeCus.getAllProdDiscount()).setStoreId(storeCus.getStoreId()).setStoreProdId(storeProd.getId())
|
||||
.setStoreCusId(storeCus.getId()).setStoreCusName(storeCus.getCusName()).setStoreProdColorId(color.getId()))));
|
||||
this.storeCusProdDiscMapper.insert(cusDiscList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜图服务同步商品
|
||||
*
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
.orElseThrow(() -> new ServiceException("档口客户不存在!", HttpStatus.ERROR));
|
||||
// 当前时间
|
||||
Date nowDate = Date.from(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
// 往前推60天
|
||||
// 往前推多少天
|
||||
Date pastDate = Date.from(LocalDate.now().minusDays(days).atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
// 查询当前档口客户在这段时间内的销售业绩情况
|
||||
List<StoreSale> saleList = this.storeSaleMapper.selectList(new LambdaQueryWrapper<StoreSale>()
|
||||
|
|
@ -184,7 +184,7 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer updateMemo(StoreSaleUpdateMemoDTO updateMemoDTO) {
|
||||
public Integer updateRemark(StoreSaleUpdateMemoDTO updateMemoDTO) {
|
||||
StoreSale storeSale = Optional.ofNullable(this.storeSaleMapper.selectOne(new LambdaQueryWrapper<StoreSale>()
|
||||
.eq(StoreSale::getId, updateMemoDTO.getStoreSaleId()).eq(StoreSale::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("没有找到对应的销售出库单!", HttpStatus.ERROR));
|
||||
|
|
@ -346,7 +346,7 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public StoreSaleDTO selectStoreSaleByStoreSaleId(Long storeSaleId) {
|
||||
public StoreSaleResDTO selectStoreSaleByStoreSaleId(Long storeSaleId) {
|
||||
StoreSale storeSale = Optional.ofNullable(this.storeSaleMapper.selectOne(new LambdaQueryWrapper<StoreSale>()
|
||||
.eq(StoreSale::getId, storeSaleId).eq(StoreSale::getDelFlag, Constants.UNDELETED)))
|
||||
.orElseThrow(() -> new ServiceException("档口销售出库订单不存在!", HttpStatus.ERROR));
|
||||
|
|
@ -354,11 +354,11 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
if (!SecurityUtils.isAdmin() && !SecurityUtils.isStoreManagerOrSub(storeSale.getStoreId())) {
|
||||
throw new ServiceException("当前用户非档口管理者或子账号,无权限操作!", HttpStatus.ERROR);
|
||||
}
|
||||
StoreSaleDTO storeSaleDTO = BeanUtil.toBean(storeSale, StoreSaleDTO.class);
|
||||
StoreSaleResDTO storeSaleDTO = BeanUtil.toBean(storeSale, StoreSaleResDTO.class);
|
||||
// 查询销售出库明细
|
||||
List<StoreSaleDetail> saleDetailList = this.storeSaleDetailMapper.selectList(new LambdaQueryWrapper<StoreSaleDetail>()
|
||||
.eq(StoreSaleDetail::getStoreSaleId, storeSaleId).eq(StoreSaleDetail::getDelFlag, Constants.UNDELETED));
|
||||
storeSaleDTO.setDetailList(saleDetailList.stream().map(x -> BeanUtil.toBean(x, StoreSaleDTO.SaleDetailVO.class)).collect(Collectors.toList()));
|
||||
storeSaleDTO.setDetailList(saleDetailList.stream().map(x -> BeanUtil.toBean(x, StoreSaleResDTO.SSDetailDTO.class)).collect(Collectors.toList()));
|
||||
return storeSaleDTO;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
|
||||
<select id="selectDiscPage" resultType="com.ruoyi.xkt.dto.storeCusProdDiscount.StoreCusProdDiscPageResDTO">
|
||||
SELECT
|
||||
SELECT DISTINCT
|
||||
scpd.id AS storeCusProdDiscId,
|
||||
sp.prod_art_num AS prodArtNum,
|
||||
scpd.store_id AS storeId,
|
||||
|
|
@ -104,15 +104,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
scpd.store_cus_id AS storeCusId,
|
||||
scpd.store_cus_name AS storeCusName,
|
||||
scpd.store_prod_color_id AS storeProdColorId,
|
||||
spc.color_name,
|
||||
spcp.price,
|
||||
scpd.discount,
|
||||
scpd.update_time
|
||||
FROM
|
||||
store_customer_product_discount scpd
|
||||
LEFT JOIN store_product sp ON scpd.store_prod_id = sp.id
|
||||
LEFT JOIN store_product_color spc ON scpd.store_prod_color_id = spc.id
|
||||
LEFT 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
|
||||
scpd.del_flag = 0 AND scpd.store_id = #{storeId}
|
||||
<if test="cusName != null and cusName != ''"> AND scpd.store_cus_name = #{cusName}</if>
|
||||
<if test="prodArtNum != null and prodArtNum != ''"> AND sp.prod_art_num like concat('%', #{prodArtNum}, '%')</if>
|
||||
ORDER BY
|
||||
scpd.store_cus_id,
|
||||
scpd.store_prod_id,
|
||||
scpd.store_prod_color_id
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,4 +52,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
spcp.store_prod_id
|
||||
</select>
|
||||
|
||||
<select id="selectPricePage" resultType="com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceResDTO">
|
||||
SELECT DISTINCT
|
||||
spc.id AS storeProdColorId,
|
||||
sp.store_id,
|
||||
spcp.store_prod_id,
|
||||
spcp.store_color_id,
|
||||
sp.prod_art_num,
|
||||
spc.color_name,
|
||||
spcp.price,
|
||||
sp.over_price
|
||||
FROM
|
||||
store_product_color_price spcp
|
||||
LEFT JOIN store_product sp ON spcp.store_prod_id = sp.id
|
||||
LEFT JOIN store_product_color spc ON spcp.store_prod_id = spc.store_prod_id
|
||||
AND spcp.store_color_id = spc.store_color_id
|
||||
WHERE
|
||||
spcp.del_flag = 0 AND sp.store_id = #{storeId}
|
||||
<if test="prodArtNum != null and prodArtNum != ''">
|
||||
AND sp.prod_art_num like concat('%', #{prodArtNum}, '%')
|
||||
</if>
|
||||
<if test="prodStatusList != null and prodStatusList.size() > 0">
|
||||
AND sp.prod_status IN
|
||||
<foreach item="item" collection="prodStatusList" separator="," open="(" close=")" index="">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY
|
||||
spcp.store_prod_id,
|
||||
spcp.store_color_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -8,16 +8,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
UPDATE store_product_color_size SET del_flag = 2 WHERE store_prod_id = #{storeProdId}
|
||||
</update>
|
||||
|
||||
<select id="selectListByStoreProdId" parameterType="Long" resultType="com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO">
|
||||
SELECT
|
||||
id AS storeProdColorSizeId,
|
||||
store_color_id,
|
||||
size,
|
||||
standard
|
||||
<select id="selectListByStoreProdId" parameterType="Long" resultType="com.ruoyi.xkt.dto.storeProdColorSize.StoreProdSizeDTO">
|
||||
SELECT DISTINCT
|
||||
spcs.size,
|
||||
spcs.standard
|
||||
FROM
|
||||
store_product_color_size
|
||||
store_product_color_size spcs
|
||||
WHERE
|
||||
del_flag = 0 AND store_prod_id = #{storeProdId}
|
||||
spcs.del_flag = 0
|
||||
AND spcs.store_prod_id = #{storeProdId}
|
||||
ORDER BY
|
||||
spcs.size
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
spdd.del_flag = 0 AND spdd.store_id = #{storeId}
|
||||
<if test="prodArtNum != null and prodArtNum != ''"> and spdd.prod_art_num = #{prodArtNum}</if>
|
||||
<if test="storeFactoryId != null "> and sf.id = #{storeFactoryId}</if>
|
||||
<if test="remark != null and remark != ''"> and menu_name like concat('%', #{menuName}, '%')</if>
|
||||
<if test="remark != null and remark != ''"> and sf.remark like concat('%', #{remark}, '%')</if>
|
||||
<if test="emergency != null "> and spdd.emergency = #{emergency}</if>
|
||||
<if test="demandStatus != null "> and spd.demand_status = #{demandStatus}</if>
|
||||
ORDER BY
|
||||
|
|
|
|||
Loading…
Reference in New Issue