✨ ERP:【销售订单】初始化
parent
ebd9222764
commit
6e005f46d9
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.enums.sale;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 销售订单的状态枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum ErpSaleOrderStatusEnum implements IntArrayValuable {
|
||||||
|
|
||||||
|
AUDIT_NONE(0, "未审核"),
|
||||||
|
AUDIT_PASS(10, "已审核"),
|
||||||
|
SALE_PART(20, "部分销售"),
|
||||||
|
SALE_ALL(21, "完成销售"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpSaleOrderStatusEnum::getStatus).toArray();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 状态名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 销售订单分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ErpSaleOrderPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "销售单编号", example = "XS001")
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
@Schema(description = "客户编号", example = "1724")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@Schema(description = "下单时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] orderTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "销售状态", example = "2")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpSalesOrderItemDO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 销售订单新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpSaleOrderSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17386")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "销售单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "XS001")
|
||||||
|
@NotEmpty(message = "销售单编号不能为空")
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1724")
|
||||||
|
@NotNull(message = "客户编号不能为空")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@Schema(description = "下单时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "下单时间不能为空")
|
||||||
|
private LocalDateTime orderTime;
|
||||||
|
|
||||||
|
@Schema(description = "销售员编号数组")
|
||||||
|
private String salePersonIds;
|
||||||
|
|
||||||
|
@Schema(description = "合计价格,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "26094")
|
||||||
|
@NotNull(message = "合计价格,单位:元不能为空")
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
@Schema(description = "优惠率,百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "99.88")
|
||||||
|
@NotNull(message = "优惠率,百分比不能为空")
|
||||||
|
private BigDecimal discountPercent;
|
||||||
|
|
||||||
|
@Schema(description = "优惠金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "4452")
|
||||||
|
@NotNull(message = "优惠金额,单位:元不能为空")
|
||||||
|
private BigDecimal discountPrice;
|
||||||
|
|
||||||
|
// TODO 芋艿:后面删除
|
||||||
|
// @Schema(description = "支付金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "32240")
|
||||||
|
// @NotNull(message = "支付金额,单位:元不能为空")
|
||||||
|
// private BigDecimal payPrice;
|
||||||
|
|
||||||
|
@Schema(description = "定金金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "7127")
|
||||||
|
@NotNull(message = "定金金额,单位:元不能为空")
|
||||||
|
private BigDecimal depositPrice;
|
||||||
|
|
||||||
|
@Schema(description = "附件地址", example = "https://www.iocoder.cn")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "结算账户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31189")
|
||||||
|
@NotNull(message = "结算账户编号不能为空")
|
||||||
|
private Long accountId;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
// TODO 芋艿:后面删除
|
||||||
|
// @Schema(description = "销售状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
// @NotNull(message = "销售状态不能为空")
|
||||||
|
// private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "ERP 销售订单明细列表")
|
||||||
|
private List<ErpSalesOrderItemDO> salesOrderItems;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.sale;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order.ErpSaleOrderPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpSaleOrderDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 销售订单 Mapper
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ErpSaleOrderMapper extends BaseMapperX<ErpSaleOrderDO> {
|
||||||
|
|
||||||
|
default PageResult<ErpSaleOrderDO> selectPage(ErpSaleOrderPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpSaleOrderDO>()
|
||||||
|
.likeIfPresent(ErpSaleOrderDO::getNo, reqVO.getNo())
|
||||||
|
.eqIfPresent(ErpSaleOrderDO::getCustomerId, reqVO.getCustomerId())
|
||||||
|
.betweenIfPresent(ErpSaleOrderDO::getOrderTime, reqVO.getOrderTime())
|
||||||
|
.eqIfPresent(ErpSaleOrderDO::getDescription, reqVO.getDescription())
|
||||||
|
.eqIfPresent(ErpSaleOrderDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(ErpSaleOrderDO::getCreator, reqVO.getCreator())
|
||||||
|
.orderByDesc(ErpSaleOrderDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.sale;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpSalesOrderItemDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 销售订单明细 Mapper
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ErpSalesOrderItemMapper extends BaseMapperX<ErpSalesOrderItemDO> {
|
||||||
|
|
||||||
|
default List<ErpSalesOrderItemDO> selectListById(Long id) {
|
||||||
|
return selectList(ErpSalesOrderItemDO::getId, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int deleteById(Long id) {
|
||||||
|
return delete(ErpSalesOrderItemDO::getId, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.sale;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order.ErpSaleOrderPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order.ErpSaleOrderSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpSaleOrderDO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 销售订单 Service 接口
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public interface ErpSaleOrderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建ERP 销售订单
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createSaleOrder(@Valid ErpSaleOrderSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新ERP 销售订单
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateSaleOrder(@Valid ErpSaleOrderSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除ERP 销售订单
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteSaleOrder(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP 销售订单
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return ERP 销售订单
|
||||||
|
*/
|
||||||
|
ErpSaleOrderDO getSaleOrder(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP 销售订单分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return ERP 销售订单分页
|
||||||
|
*/
|
||||||
|
PageResult<ErpSaleOrderDO> getSaleOrderPage(ErpSaleOrderPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue