master:档口销售出库功能完善;
parent
adaa6e2090
commit
8807c870a8
|
|
@ -77,7 +77,6 @@ public class StoreProductController extends XktBaseController {
|
|||
return R.ok(BeanUtil.toBean(storeProdService.selectStoreProductByStoreProdId(storeProdId), StoreProdResVO.class));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "PC获取档口商品详细信息", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/pc/detail/{storeProdId}")
|
||||
public R<StoreProdPCResVO> getPCInfo(@PathVariable("storeProdId") Long storeProdId) {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,12 @@ public class StoreSaleController extends XktBaseController {
|
|||
|
||||
final IStoreSaleService storeSaleService;
|
||||
|
||||
|
||||
// TODO 提醒杰、销售明细 增加 支付方式显示
|
||||
// TODO 提醒杰、销售明细 增加 支付方式显示
|
||||
// TODO 提醒杰、销售明细 增加 支付方式显示
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "根据当前客户查询最近的销售业绩,以及欠款金额", httpMethod = "GET", response = R.class)
|
||||
@GetMapping("/cus-overall")
|
||||
|
|
@ -63,7 +69,7 @@ public class StoreSaleController extends XktBaseController {
|
|||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@Log(title = "修改档口销售出库", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "返单后,更新档口销售出库", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation(value = "返单后,更新档口销售出库", httpMethod = "PUT", response = R.class)
|
||||
@PutMapping
|
||||
public R<Integer> edit(@Validated @RequestBody StoreSaleVO storeSaleVO) {
|
||||
|
|
@ -74,7 +80,7 @@ public class StoreSaleController extends XktBaseController {
|
|||
@ApiOperation(value = "查询档口销售出库明细", httpMethod = "GET", response = R.class)
|
||||
@GetMapping(value = "/{storeSaleId}")
|
||||
public R<StoreSaleResVO> getInfo(@PathVariable("storeSaleId") Long storeSaleId) {
|
||||
return R.ok(BeanUtil.toBean(storeSaleService.selectStoreSaleByStoreSaleId(storeSaleId), StoreSaleResVO.class));
|
||||
return R.ok(BeanUtil.toBean(storeSaleService.selectByStoreSaleId(storeSaleId), StoreSaleResVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
|
|
@ -93,7 +99,7 @@ public class StoreSaleController extends XktBaseController {
|
|||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')||@ss.hasSupplierSubRole()")
|
||||
@ApiOperation(value = "删除档口销售出库", httpMethod = "PUT", response = R.class)
|
||||
@ApiOperation(value = "删除档口销售出库", httpMethod = "DELETE", response = R.class)
|
||||
@Log(title = "删除档口销售出库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{storeSaleId}")
|
||||
public R<Integer> remove(@PathVariable Long storeSaleId) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package com.ruoyi.web.controller.xkt.vo.storePordColor;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
|
|
@ -25,6 +28,8 @@ public class StoreProdColorResVO {
|
|||
private String prodCateName;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "生产成本")
|
||||
private BigDecimal producePrice;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orderNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.web.controller.xkt.vo.storeProdStorage;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.web.controller.xkt.vo.BasePageVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -14,6 +15,7 @@ import java.util.Date;
|
|||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel(value = "入库单列表查询入参")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class StoreProdStoragePageVO extends BasePageVO {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeProdStorage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ import java.util.List;
|
|||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel(value = "新增商品入库")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreProdStorageVO {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeSale;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -13,6 +14,7 @@ import java.util.List;
|
|||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel(value = "导出销售出库")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreSaleExportVO {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeSale;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -20,6 +22,8 @@ public class StoreSaleResVO {
|
|||
private Boolean refund;
|
||||
@ApiModelProperty(value = "storeSaleId")
|
||||
private Long storeSaleId;
|
||||
@ApiModelProperty(value = "单据编号")
|
||||
private String code;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口客户ID")
|
||||
|
|
@ -30,12 +34,19 @@ public class StoreSaleResVO {
|
|||
private Integer saleType;
|
||||
@ApiModelProperty(value = "支付方式(1支付宝、2微信、3现金、4欠款)")
|
||||
private Integer payWay;
|
||||
@ApiModelProperty(value = "结款状态(已结清、欠款) SETTLED、DEBT")
|
||||
@ApiModelProperty(value = "结款状态(1 已结清、2 欠款)")
|
||||
private Integer paymentStatus;
|
||||
@ApiModelProperty(value = "抹零金额")
|
||||
private BigDecimal roundOff;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "销售时间")
|
||||
private Date createTime;
|
||||
@ApiModelProperty(value = "销售数量")
|
||||
private Integer saleQuantity;
|
||||
@ApiModelProperty(value = "退货数量")
|
||||
private Integer refundQuantity;
|
||||
@ApiModelProperty(value = "销售金额")
|
||||
private BigDecimal amount;
|
||||
@ApiModelProperty(value = "销售详情列表")
|
||||
private List<SaleDetailVO> detailList;
|
||||
|
||||
|
|
@ -45,6 +56,8 @@ public class StoreSaleResVO {
|
|||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口商品颜色尺码ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "销售类型(销售 1、退货 2)")
|
||||
private Integer saleType;
|
||||
@ApiModelProperty(value = "颜色")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeSale;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import java.util.List;
|
|||
* @version v1.0
|
||||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@ApiModel(value = "新增或编辑销售出库")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreSaleVO {
|
||||
|
|
@ -39,7 +41,7 @@ public class StoreSaleVO {
|
|||
@NotNull(message = "支付方式不能为空!")
|
||||
@ApiModelProperty(value = "支付方式(1支付宝、2微信、3现金、4欠款)", required = true)
|
||||
private Integer payWay;
|
||||
@ApiModelProperty(value = "结款状态(已结清、欠款) SETTLED、DEBT")
|
||||
@ApiModelProperty(value = "结款状态 1 已结清 2 欠款")
|
||||
private Integer paymentStatus;
|
||||
@ApiModelProperty(value = "抹零金额")
|
||||
private BigDecimal roundOff;
|
||||
|
|
@ -62,6 +64,9 @@ public class StoreSaleVO {
|
|||
private String colorName;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
private Integer size;
|
||||
@ApiModelProperty(value = "销售类型(销售 1、退货 2)", required = true)
|
||||
@NotNull(message = "销售类型不能为空!")
|
||||
private Integer saleType;
|
||||
@ApiModelProperty(value = "商品货号", required = true)
|
||||
@NotBlank(message = "商品货号不能为空!")
|
||||
private String prodArtNum;
|
||||
|
|
|
|||
|
|
@ -29,5 +29,7 @@ public class StoreTodaySaleVO {
|
|||
private BigDecimal refundAmount;
|
||||
@ApiModelProperty(value = "总金额")
|
||||
private BigDecimal amount;
|
||||
@ApiModelProperty(value = "总数量")
|
||||
private Integer quantity;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class StoreProduct extends XktBaseEntity {
|
|||
* 生产价格
|
||||
*/
|
||||
@Excel(name = "生产价格")
|
||||
private Integer producePrice;
|
||||
private BigDecimal producePrice;
|
||||
|
||||
/**
|
||||
* 大小码加价
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
|
||||
/**
|
||||
* 档口商品颜色的尺码对象 store_product_color_size
|
||||
* 条码规则 5位档口ID + 8位 store_product_color_size.id + 8位 nextBarcode
|
||||
* eg: 100010000000100000001
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
|
|
@ -26,31 +28,30 @@ public class StoreProductColorSize extends XktBaseEntity {
|
|||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 档口颜色ID
|
||||
*/
|
||||
@Excel(name = "档口颜色ID")
|
||||
private Long storeColorId;
|
||||
|
||||
/**
|
||||
* 档口商品ID
|
||||
*/
|
||||
@Excel(name = "档口商品ID")
|
||||
private Long storeProdId;
|
||||
|
||||
/**
|
||||
* 商品尺码
|
||||
*/
|
||||
@Excel(name = "商品尺码")
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 档口商品颜色尺码的前缀
|
||||
*/
|
||||
@Excel(name = "档口商品颜色尺码的前缀")
|
||||
private String barcodePrefix;
|
||||
|
||||
/**
|
||||
* 下一个编号
|
||||
*/
|
||||
private Integer nextBarcode;
|
||||
/**
|
||||
* 是否是标准尺码(0不是 1是)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -84,12 +84,11 @@ public class StoreSale extends XktBaseEntity {
|
|||
*/
|
||||
private BigDecimal roundOff;
|
||||
/**
|
||||
* 支付方式(支付宝、微信、现金、欠款)
|
||||
* 支付方式(1 支付宝、 2 微信、 3 现金、4 欠款)
|
||||
*/
|
||||
@Excel(name = "支付方式", readConverterExp = "支=付宝、微信、现金、欠款")
|
||||
private Integer payWay;
|
||||
/**
|
||||
* 结款状态(已结清、欠款) SETTLED、DEBT
|
||||
* 结款状态(1已结清、2欠款)
|
||||
*/
|
||||
private Integer paymentStatus;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ public class StoreSaleDetail extends XktBaseEntity {
|
|||
*/
|
||||
private Integer size;
|
||||
/**
|
||||
* 销售类型(1销售、2退货、3销售/退货)
|
||||
* 销售类型(1销售、2退货)
|
||||
*/
|
||||
@Excel(name = "销售类型", readConverterExp = "普=通销售、销售退货")
|
||||
@Excel(name = "销售类型", readConverterExp = "1 销售 2 退货 ")
|
||||
private Integer saleType;
|
||||
/**
|
||||
* 商品货号
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ public class StoreSaleRefundRecord extends XktBaseEntity {
|
|||
*/
|
||||
private String storeCusName;
|
||||
/**
|
||||
* 销售类型(普通销售、销售退货、普通销售/销售退货)GENERAL_SALE SALE_REFUND SALE_AND_REFUND
|
||||
* 销售类型(1 销售、2 退货、3 销售/退货)
|
||||
*/
|
||||
@Excel(name = "销售类型")
|
||||
private String saleType;
|
||||
private Integer saleType;
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
|
|
@ -77,14 +77,13 @@ public class StoreSaleRefundRecord extends XktBaseEntity {
|
|||
@Excel(name = "总金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 支付方式(支付宝、微信、现金、欠款)
|
||||
* 支付方式(1 支付宝、 2 微信、 3 现金、4 欠款)
|
||||
*/
|
||||
@Excel(name = "支付方式", readConverterExp = "支=付宝、微信、现金、欠款")
|
||||
private String payWay;
|
||||
private Integer payWay;
|
||||
/**
|
||||
* 结款状态(已结清、欠款) SETTLED、DEBT
|
||||
* 结款状态(1已结清、2欠款)
|
||||
*/
|
||||
private String paymentStatus;
|
||||
private Integer paymentStatus;
|
||||
/**
|
||||
* 操作人ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ public class StoreSaleRefundRecordDetail extends XktBaseEntity {
|
|||
*/
|
||||
private Integer size;
|
||||
/**
|
||||
* 销售类型(普通销售、销售退货)
|
||||
* 销售类型(1 销售、2 退货)
|
||||
*/
|
||||
@Excel(name = "销售类型", readConverterExp = "普=通销售、销售退货")
|
||||
private String saleType;
|
||||
@Excel(name = "销售类型")
|
||||
private Integer saleType;
|
||||
/**
|
||||
* 商品货号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,5 +31,7 @@ public class StoreTodaySaleDTO {
|
|||
private BigDecimal refundAmount;
|
||||
@ApiModelProperty(value = "总金额")
|
||||
private BigDecimal amount;
|
||||
@ApiModelProperty(value = "总数量")
|
||||
private Integer quantity;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
|
|
@ -27,6 +29,8 @@ public class StoreProdColorResDTO {
|
|||
private String prodCateName;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "生产成本")
|
||||
private BigDecimal producePrice;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orderNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -47,6 +48,8 @@ public class StoreSaleDTO {
|
|||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "颜色")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "销售类型(销售 1、退货 2)")
|
||||
private Integer saleType;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
private Integer size;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.ruoyi.xkt.dto.storeSale;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -20,6 +22,8 @@ public class StoreSaleResDTO {
|
|||
private Boolean refund;
|
||||
@ApiModelProperty(value = "storeSaleId")
|
||||
private Long storeSaleId;
|
||||
@ApiModelProperty(value = "单据编号")
|
||||
private String code;
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "档口客户ID")
|
||||
|
|
@ -30,12 +34,19 @@ public class StoreSaleResDTO {
|
|||
private Integer saleType;
|
||||
@ApiModelProperty(value = "支付方式(1支付宝、2微信、3现金、4欠款)")
|
||||
private Integer payWay;
|
||||
@ApiModelProperty(value = "结款状态(已结清、欠款) SETTLED、DEBT")
|
||||
@ApiModelProperty(value = "结款状态(1 已结清、2 欠款)")
|
||||
private Integer paymentStatus;
|
||||
@ApiModelProperty(value = "抹零金额")
|
||||
private BigDecimal roundOff;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "销售时间")
|
||||
private Date createTime;
|
||||
@ApiModelProperty(value = "销售数量")
|
||||
private Integer saleQuantity;
|
||||
@ApiModelProperty(value = "退货数量")
|
||||
private Integer refundQuantity;
|
||||
@ApiModelProperty(value = "销售金额")
|
||||
private BigDecimal amount;
|
||||
@ApiModelProperty(value = "销售详情列表")
|
||||
private List<SSDetailDTO> detailList;
|
||||
|
||||
|
|
@ -45,6 +56,8 @@ public class StoreSaleResDTO {
|
|||
private Long storeProdId;
|
||||
@ApiModelProperty(value = "档口商品颜色尺码ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "销售类型(销售 1、退货 2)")
|
||||
private Integer saleType;
|
||||
@ApiModelProperty(value = "颜色")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* @author liujiang
|
||||
* @version v1.0
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ import java.util.List;
|
|||
*/
|
||||
public interface StoreSaleMapper extends BaseMapper<StoreSale> {
|
||||
|
||||
/**
|
||||
* 分页
|
||||
* @param pageDTO 入参
|
||||
* @return
|
||||
*/
|
||||
List<StoreSalePageResDTO> selectPage(StoreSalePageDTO pageDTO);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public interface IStoreSaleService {
|
|||
* @param storeSaleId 档口销售出库主键
|
||||
* @return 档口销售出库
|
||||
*/
|
||||
StoreSaleResDTO selectStoreSaleByStoreSaleId(Long storeSaleId);
|
||||
StoreSaleResDTO selectByStoreSaleId(Long storeSaleId);
|
||||
|
||||
/**
|
||||
* 新增档口销售出库
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.ruoyi.xkt.dto.storeProductStock.StoreProdStockDTO;
|
|||
import com.ruoyi.xkt.dto.storeSale.*;
|
||||
import com.ruoyi.xkt.enums.EVoucherSequenceType;
|
||||
import com.ruoyi.xkt.enums.PaymentStatus;
|
||||
import com.ruoyi.xkt.enums.SaleType;
|
||||
import com.ruoyi.xkt.mapper.*;
|
||||
import com.ruoyi.xkt.service.IStoreProductStockService;
|
||||
import com.ruoyi.xkt.service.IStoreSaleService;
|
||||
|
|
@ -117,12 +118,9 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
|
||||
/**
|
||||
* 清除店铺顾客债务信息
|
||||
* <p>
|
||||
* 该方法旨在根据提供的店铺销售支付状态信息来清除或更新店铺顾客的债务记录
|
||||
* 它通常在完成销售交易、债务偿还或其他需要调整顾客债务的情况下调用
|
||||
*
|
||||
* @param payStatusDTO 包含店铺销售支付状态的DTO对象,用于确定是否需要清除顾客债务
|
||||
* @return 返回一个整数,表示受影响的债务记录数量或状态更新结果
|
||||
* @param payStatusDTO 入参
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
|
|
@ -165,15 +163,18 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
if (CollectionUtils.isEmpty(saleDetailList)) {
|
||||
return new StoreTodaySaleDTO();
|
||||
}
|
||||
Integer saleQuantity = saleDetailList.stream().filter(x -> x.getQuantity() > 0).mapToInt(StoreSaleDetail::getQuantity).sum();
|
||||
BigDecimal saleAmount = saleDetailList.stream().filter(x -> x.getQuantity() > 0)
|
||||
Integer saleQuantity = saleDetailList.stream().filter(x -> Objects.equals(x.getSaleType(), SaleType.GENERAL_SALE.getValue()))
|
||||
.map(x -> ObjectUtils.defaultIfNull(x.getQuantity(), 0)).reduce(0, Integer::sum);
|
||||
BigDecimal saleAmount = saleDetailList.stream().filter(x -> Objects.equals(x.getSaleType(), SaleType.GENERAL_SALE.getValue()))
|
||||
.map(x -> ObjectUtils.defaultIfNull(x.getAmount(), BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
Integer refundQuantity = saleDetailList.stream().filter(x -> x.getQuantity() < 0).mapToInt(StoreSaleDetail::getQuantity).sum();
|
||||
BigDecimal refundAmount = saleDetailList.stream().filter(x -> x.getQuantity() < 0)
|
||||
Integer refundQuantity = saleDetailList.stream().filter(x -> Objects.equals(x.getSaleType(), SaleType.SALE_REFUND.getValue()))
|
||||
.map(x -> ObjectUtils.defaultIfNull(x.getQuantity(), 0)).reduce(0, Integer::sum);
|
||||
BigDecimal refundAmount = saleDetailList.stream().filter(x -> Objects.equals(x.getSaleType(), SaleType.SALE_REFUND.getValue()))
|
||||
.map(x -> ObjectUtils.defaultIfNull(x.getAmount(), BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal amount = saleDetailList.stream().map(x -> ObjectUtils.defaultIfNull(x.getAmount(), BigDecimal.ZERO)).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
Integer quantity = saleDetailList.stream().map(x -> ObjectUtils.defaultIfNull(x.getQuantity(), 0)).reduce(0, Integer::sum);
|
||||
return new StoreTodaySaleDTO().setStoreId(storeId).setSaleQuantity(saleQuantity).setSaleAmount(saleAmount)
|
||||
.setRefundQuantity(refundQuantity).setRefundAmount(refundAmount).setAmount(amount);
|
||||
.setRefundQuantity(refundQuantity).setRefundAmount(refundAmount).setAmount(amount).setQuantity(quantity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -252,12 +253,15 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// 属性赋值
|
||||
storeSale.setCode(code).setVoucherDate(voucherDate).setQuantity(quantity).setAmount(amount).setRoundOff(ObjectUtils.defaultIfNull(storeSaleDTO.getRoundOff(), BigDecimal.ZERO))
|
||||
.setSaleQuantity(saleQuantity).setRefundQuantity(refundQuantity).setOperatorId(loginUser.getUserId()).setOperatorName(loginUser.getUsername());
|
||||
.setSaleQuantity(saleQuantity).setRefundQuantity(refundQuantity).setOperatorId(loginUser.getUserId()).setOperatorName(loginUser.getUsername()).setCreateBy(loginUser.getUsername());
|
||||
int count = storeSaleMapper.insert(storeSale);
|
||||
// 处理订单明细
|
||||
List<StoreSaleDetail> saleDetailList = storeSaleDTO.getDetailList().stream().map(x -> BeanUtil.toBean(x, StoreSaleDetail.class)
|
||||
.setSaleType(storeSaleDTO.getSaleType()).setStoreSaleId(storeSale.getId()).setStoreId(storeSale.getStoreId()).setVoucherDate(voucherDate))
|
||||
.collect(Collectors.toList());
|
||||
List<StoreSaleDetail> saleDetailList = storeSaleDTO.getDetailList().stream().map(x -> {
|
||||
StoreSaleDetail saleDetail = BeanUtil.toBean(x, StoreSaleDetail.class).setStoreSaleId(storeSale.getId())
|
||||
.setStoreId(storeSale.getStoreId()).setVoucherDate(voucherDate);
|
||||
saleDetail.setCreateBy(loginUser.getUsername());
|
||||
return saleDetail;
|
||||
}).collect(Collectors.toList());
|
||||
this.storeSaleDetailMapper.insert(saleDetailList);
|
||||
// 先汇总当前这笔订单商品明细的销售数量,包括销售及退货 key: prodArtNum + storeProdId + storeProdColorId + colorName, value: map(key:size,value:count)
|
||||
Map<String, Map<Integer, Integer>> saleCountMap = storeSaleDTO.getDetailList().stream().collect(Collectors
|
||||
|
|
@ -279,6 +283,7 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
@Override
|
||||
@Transactional
|
||||
public int updateStoreSale(StoreSaleDTO storeSaleDTO) {
|
||||
Optional.ofNullable(storeSaleDTO.getStoreSaleId()).orElseThrow(() -> new ServiceException("storeSaleId不能为空!", HttpStatus.ERROR));
|
||||
// 用户是否为档口管理者或子账户
|
||||
if (!SecurityUtils.isAdmin() && !SecurityUtils.isStoreManagerOrSub(storeSaleDTO.getStoreId())) {
|
||||
throw new ServiceException("当前用户非档口管理者或子账号,无权限操作!", HttpStatus.ERROR);
|
||||
|
|
@ -321,7 +326,7 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
this.storeSaleDetailMapper.updateById(saleDetailList.stream().peek(x -> x.setDelFlag(Constants.DELETED)).collect(Collectors.toList()));
|
||||
// 再新增档口销售出库明细数据
|
||||
List<StoreSaleDetail> detailList = storeSaleDTO.getDetailList().stream().map(x -> BeanUtil.toBean(x, StoreSaleDetail.class)
|
||||
.setSaleType(storeSaleDTO.getSaleType()).setStoreSaleId(storeSale.getId()).setStoreId(storeSale.getStoreId()).setVoucherDate(voucherDate))
|
||||
.setStoreSaleId(storeSale.getId()).setStoreId(storeSale.getStoreId()).setVoucherDate(voucherDate))
|
||||
.collect(Collectors.toList());
|
||||
this.storeSaleDetailMapper.insert(detailList);
|
||||
// 汇总编辑的存货总数量
|
||||
|
|
@ -346,7 +351,7 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
|
|||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public StoreSaleResDTO selectStoreSaleByStoreSaleId(Long storeSaleId) {
|
||||
public StoreSaleResDTO selectByStoreSaleId(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));
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
spc.store_color_id AS storeColorId,
|
||||
sp.prod_art_num AS prodArtNum,
|
||||
spc.color_name AS colorName,
|
||||
sp.produce_price AS producePrice,
|
||||
spc.order_num AS orderNum
|
||||
FROM
|
||||
store_product_color spc
|
||||
|
|
|
|||
Loading…
Reference in New Issue