商品模块代码提交
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.czg.product.dto;
|
||||
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品耗材绑定
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
public class ProdConsBindDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@NotNull(message = "商品id不能为空", groups = DefaultGroup.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 耗材列表
|
||||
*/
|
||||
private List<ProdConsRelationDTO> consList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.czg.product.dto;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商品耗材绑定关系
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
public class ProdConsRelationDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@NotNull(message = "商品id不能为空", groups = DefaultGroup.class)
|
||||
private Long productId;
|
||||
/**
|
||||
* 耗材id
|
||||
*/
|
||||
@NotNull(message = "耗材id不能为空", groups = DefaultGroup.class)
|
||||
private Long consInfoId;
|
||||
/**
|
||||
* 单位消耗值
|
||||
*/
|
||||
@NotNull(message = "使用数量不能为空", groups = DefaultGroup.class)
|
||||
private BigDecimal surplusStock;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商品耗材绑定关系
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Table("tb_prod_cons_relation")
|
||||
public class ProdConsRelation implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 耗材id
|
||||
*/
|
||||
private Long consInfoId;
|
||||
/**
|
||||
* 单位消耗值
|
||||
*/
|
||||
private BigDecimal surplusStock;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 耗材副单位编辑入参
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
public class ConsSubUnitParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotNull(message = "ID不能为空", groups = DefaultGroup.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 耗材分组id
|
||||
*/
|
||||
@NotNull(message = "副单位不能为空", groups = InsertGroup.class)
|
||||
private String conUnitTwo;
|
||||
/**
|
||||
* 转换数量 (等同于多少主单位)
|
||||
*/
|
||||
@NotNull(message = "转换数量不能为空", groups = InsertGroup.class)
|
||||
private BigDecimal conUnitTwoConvert;
|
||||
/**
|
||||
* 默认入库单位
|
||||
*/
|
||||
@NotNull(message = "默认入库单位不能为空", groups = InsertGroup.class)
|
||||
private String defaultUnit;
|
||||
/**
|
||||
* 修改标志 add-新增 delete-删除
|
||||
*/
|
||||
@NotNull(message = "修改标志不能为空", groups = DefaultGroup.class)
|
||||
private String modifyFlag;
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.czg.product.service;
|
||||
|
||||
import com.czg.product.dto.ConsInfoDTO;
|
||||
import com.czg.product.entity.ConsInfo;
|
||||
import com.czg.product.param.ConsSubUnitParam;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
@@ -32,4 +33,6 @@ public interface ConsInfoService extends IService<ConsInfo> {
|
||||
|
||||
boolean onOffConsInfo(Long id, Integer isStock);
|
||||
|
||||
void modifySubUnit(ConsSubUnitParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.czg.product.service;
|
||||
|
||||
import com.czg.product.dto.ProdConsBindDTO;
|
||||
import com.czg.product.dto.ProdConsRelationDTO;
|
||||
import com.czg.product.entity.ProdConsRelation;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品耗材绑定关系
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
public interface ProdConsRelationService extends IService<ProdConsRelation> {
|
||||
|
||||
List<ProdConsRelationDTO> getProdConsRelationList(ProdConsRelationDTO param);
|
||||
|
||||
boolean saveProdConsRelation(ProdConsBindDTO dto);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user