商品模块代码提交
This commit is contained in:
@@ -9,6 +9,7 @@ import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Null;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -20,6 +21,8 @@ import java.time.LocalDateTime;
|
||||
*/
|
||||
@Data
|
||||
public class ShopProdUnitDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.czg.product.dto;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
public class ShopVendorDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Null(message = "ID必须为空", groups = InsertGroup.class)
|
||||
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺Id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空", groups = DefaultGroup.class)
|
||||
@Min(value = 1, message = "排序值不能小于1", groups = DefaultGroup.class)
|
||||
@Max(value = Integer.MAX_VALUE, message = "排序值不能大于" + Integer.MAX_VALUE, groups = DefaultGroup.class)
|
||||
private Integer sort;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
@NotBlank(message = "供应商名称不能为空", groups = DefaultGroup.class)
|
||||
private String name;
|
||||
/**
|
||||
* 联系人名字
|
||||
*/
|
||||
private String contactName;
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
private String telephone;
|
||||
/**
|
||||
* 结算周期(日)
|
||||
*/
|
||||
private Integer period;
|
||||
/**
|
||||
* 供应商地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tip;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 最后一次交易时间(主要做排序)
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastTransactTime;
|
||||
/**
|
||||
* 逻辑删除 1-是 0-否
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private Integer isDel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.czg.product.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Table("tb_shop_vendor")
|
||||
public class ShopVendor implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺Id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 联系人名字
|
||||
*/
|
||||
private String contactName;
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
private String telephone;
|
||||
/**
|
||||
* 结算周期(日)
|
||||
*/
|
||||
private Integer period;
|
||||
/**
|
||||
* 供应商地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tip;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 最后一次交易时间(主要做排序)
|
||||
*/
|
||||
private LocalDateTime lastTransactTime;
|
||||
/**
|
||||
* 逻辑删除 1-是 0-否
|
||||
*/
|
||||
private Integer isDel;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.czg.product.service;
|
||||
|
||||
import com.czg.product.dto.ShopVendorDTO;
|
||||
import com.czg.product.entity.ShopVendor;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
public interface ShopVendorService extends IService<ShopVendor> {
|
||||
Page<ShopVendorDTO> getShopVendorPage(ShopVendorDTO param);
|
||||
|
||||
List<ShopVendorDTO> getShopVendorList(ShopVendorDTO param);
|
||||
|
||||
ShopVendorDTO getShopVendorById(Long id);
|
||||
|
||||
boolean addShopVendor(ShopVendorDTO dto);
|
||||
|
||||
boolean updateShopVendor(ShopVendorDTO dto);
|
||||
|
||||
boolean deleteShopVendor(Long id);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user