Commit 315f36e6 by Lizh

参照ts迁移商品分页查询page接口

parent 43164dcf
......@@ -311,6 +311,12 @@ public class CustomProductInfoSnakeDTO extends PageRequest {
@Schema(description = "工厂 ID 列表")
private List<Integer> factoryIds;
/**
* 工厂 ID(单值,用于分页查询过滤 — 通过 product_factory_rel 表查询,对齐 TS factory_id)
*/
@Schema(description = "工厂 ID(分页过滤用,通过关联表过滤)")
private Integer factory_id;
/** 以下为ERP 专用查询字段 */
@Schema(description = "DIY 模板 SKU 筛选(ERP)")
private String diySku;
......
......@@ -65,8 +65,8 @@ public enum CustomProductInfoStatusEnum {
return Arrays.stream(values())
.map(e -> {
Map<String, Object> map = new HashMap<>();
map.put("code", e.code);
map.put("label", e.label);
map.put("status", e.code);
map.put("remark", e.label);
return map;
})
.collect(Collectors.toList());
......
......@@ -5,9 +5,10 @@ import com.jomalls.custom.app.dto.AddBlackListDTO;
import com.jomalls.custom.app.dto.BindDiyUserDTO;
import com.jomalls.custom.app.dto.CustomProductInfoSnakeDTO;
import com.jomalls.custom.app.dto.CustomProductInfoUpdateSnakeDTO;
import com.jomalls.custom.app.vo.CraftCenterVO;
import com.jomalls.custom.app.vo.CustomProductInfoSnakeVO;
import com.jomalls.custom.app.vo.CustomProductInfoVO;
import com.jomalls.custom.app.vo.DbDiyVO;
import com.jomalls.custom.app.vo.DbDiySnakeVO;
import java.util.List;
......@@ -19,7 +20,7 @@ import java.util.List;
*/
public interface CustomProductInfoService {
IPage<CustomProductInfoVO> pageList(CustomProductInfoSnakeDTO param);
IPage<CustomProductInfoSnakeVO> pageList(CustomProductInfoSnakeDTO param);
/**
* 组合创建商品(SKU 生成 + 事务内写入主表及所有子表)
......@@ -74,7 +75,7 @@ public interface CustomProductInfoService {
* @param id 商品 ID
* @return DIY 模板列表
*/
List<DbDiyVO> getBindsDiyById(Integer id);
List<DbDiySnakeVO> getBindsDiyById(Integer id);
/**
* 获取商品绑定的 DIY 用户 ID 列表
......@@ -93,12 +94,14 @@ public interface CustomProductInfoService {
List<Integer> getBlackListById(Integer id);
/**
* 获取商品绑定的工艺 ID 列表
* 获取商品绑定的工艺列表
* <p>
* 对齐 TS getCraftById → getCraftByProductId,返回完整工艺实体而非仅 ID。
*
* @param id 商品 ID
* @return 工艺 ID 列表
* @return 工艺实体列表
*/
List<Long> getCraftById(Integer id);
List<CraftCenterVO> getCraftById(Integer id);
// ==================== ERP 专用接口(对齐 TS) ====================
......@@ -112,5 +115,5 @@ public interface CustomProductInfoService {
/**
* ERP 获取绑定 DIY(对齐 TS getBindsDiyByIdAndUserMark)
*/
List<DbDiyVO> getErpBindsDiyById(Integer id, String userMark, String namespace);
List<DbDiySnakeVO> getBindsDiyByIdAndUserMark(Integer id, String userMark, String namespace);
}
......@@ -2,7 +2,7 @@ package com.jomalls.custom.app.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jomalls.custom.app.vo.DbDiyPageVO;
import com.jomalls.custom.app.vo.DbDiyVO;
import com.jomalls.custom.app.vo.DbDiySnakeVO;
import java.util.List;
......@@ -17,10 +17,10 @@ public interface DbDiyService {
/**
* 列表查询接口
*
* @param dbDiyVO 条件model
* @param dbDiySnakeVO 条件model
* @return list集合
*/
List<DbDiyVO> list(DbDiyVO dbDiyVO);
List<DbDiySnakeVO> list(DbDiySnakeVO dbDiySnakeVO);
/**
* 根据条件查询分页列表接口
......@@ -28,7 +28,7 @@ public interface DbDiyService {
* @param dbDiyPageVO 分页入参model
* @return 分页对象
*/
IPage<DbDiyVO> pageList(DbDiyPageVO dbDiyPageVO);
IPage<DbDiySnakeVO> pageList(DbDiyPageVO dbDiyPageVO);
/**
* 根据id查询详情
......@@ -36,21 +36,21 @@ public interface DbDiyService {
* @param id 主键
* @return 实体model
*/
DbDiyVO info(Integer id);
DbDiySnakeVO info(Integer id);
/**
* 保存对象
*
* @param dbDiyVO 保存对象
* @param dbDiySnakeVO 保存对象
*/
void save(DbDiyVO dbDiyVO);
void save(DbDiySnakeVO dbDiySnakeVO);
/**
* 根据id修改对象
*
* @param dbDiyVO 修改对象
* @param dbDiySnakeVO 修改对象
*/
void updateById(DbDiyVO dbDiyVO);
void updateById(DbDiySnakeVO dbDiySnakeVO);
/**
* 根据主键ID进行删除
......
package com.jomalls.custom.app.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jomalls.custom.app.vo.LogCustomProductPageVO;
import com.jomalls.custom.app.vo.LogCustomProductVO;
import com.jomalls.custom.app.vo.LogCustomProductSnakeVO;
import java.util.List;
......@@ -15,49 +13,13 @@ import java.util.List;
public interface LogCustomProductService {
/**
* 列表查询接口
* 根据商品 ID 查询日志列表(对齐 TS list 方法)
* <p>
* 按 product_id 查询所有日志记录,按 id 降序排序。
*
* @param logCustomProductVO 条件model
* @return list集合
* @param productId 商品 ID
* @return 日志列表
*/
List<LogCustomProductVO> list(LogCustomProductVO logCustomProductVO);
/**
* 根据条件查询分页列表接口
*
* @param logCustomProductPageVO 分页入参model
* @return 分页对象
*/
IPage<LogCustomProductVO> pageList(LogCustomProductPageVO logCustomProductPageVO);
/**
* 根据id查询详情
*
* @param id 主键
* @return 实体model
*/
LogCustomProductVO info(Integer id);
/**
* 保存对象
*
* @param logCustomProductVO 保存对象
*/
void save(LogCustomProductVO logCustomProductVO);
/**
* 根据id修改对象
*
* @param logCustomProductVO 修改对象
*/
void updateById(LogCustomProductVO logCustomProductVO);
/**
* 根据主键ID进行删除
*
* @param id 主键
*/
void deleteById(Integer id);
List<LogCustomProductSnakeVO> getListByProductId(Integer productId);
}
......@@ -7,7 +7,7 @@ import com.jomalls.custom.app.service.DbDiyService;
import com.jomalls.custom.app.utils.BeanMapper;
import com.jomalls.custom.app.utils.CustomAsserts;
import com.jomalls.custom.app.vo.DbDiyPageVO;
import com.jomalls.custom.app.vo.DbDiyVO;
import com.jomalls.custom.app.vo.DbDiySnakeVO;
import com.jomalls.custom.dal.entity.DbDiyEntity;
import com.jomalls.custom.domain.service.DbDiyDomainService;
import lombok.extern.slf4j.Slf4j;
......@@ -37,34 +37,34 @@ public class DbDiyServiceImpl implements DbDiyService {
}
@Override
public List<DbDiyVO> list(DbDiyVO dbDiyVO) {
public List<DbDiySnakeVO> list(DbDiySnakeVO dbDiySnakeVO) {
QueryWrapper<DbDiyEntity> queryWrapper = new QueryWrapper<>();
// TODO 根据业务条件组装入参
List<DbDiyEntity> list = dbDiyDomainService.list(queryWrapper);
return list.stream().map(e -> BeanMapper.mapper().convert(e, DbDiyVO.class)).collect(Collectors.toList());
return list.stream().map(e -> BeanMapper.mapper().convert(e, DbDiySnakeVO.class)).collect(Collectors.toList());
}
@Override
public IPage<DbDiyVO> pageList(DbDiyPageVO dbDiyPageVO) {
public IPage<DbDiySnakeVO> pageList(DbDiyPageVO dbDiyPageVO) {
CustomAsserts.nonNull(dbDiyPageVO, "分页查询参数不能为空");
QueryWrapper<DbDiyEntity> queryWrapper = new QueryWrapper<>();
// TODO 根据业务条件组装入参
IPage<DbDiyEntity> page = dbDiyDomainService.selectPage(queryWrapper, dbDiyPageVO);
return page.convert(e -> BeanMapper.mapper().convert(e, DbDiyVO.class));
return page.convert(e -> BeanMapper.mapper().convert(e, DbDiySnakeVO.class));
}
@Override
public DbDiyVO info(Integer id) {
public DbDiySnakeVO info(Integer id) {
CustomAsserts.nonNull(id, "主键id不能为空");
DbDiyEntity dbDiy = dbDiyDomainService.getById(id);
return BeanMapper.mapper().convert(dbDiy, DbDiyVO.class);
return BeanMapper.mapper().convert(dbDiy, DbDiySnakeVO.class);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void save(DbDiyVO dbDiyVO) {
CustomAsserts.nonNull(dbDiyVO, "实体对象不能为空");
DbDiyEntity dbDiyEntity = BeanMapper.mapper().convert(dbDiyVO, DbDiyEntity.class);
public void save(DbDiySnakeVO dbDiySnakeVO) {
CustomAsserts.nonNull(dbDiySnakeVO, "实体对象不能为空");
DbDiyEntity dbDiyEntity = BeanMapper.mapper().convert(dbDiySnakeVO, DbDiyEntity.class);
try {
dbDiyDomainService.save(dbDiyEntity);
} catch (DuplicateKeyException e) {
......@@ -75,9 +75,9 @@ public class DbDiyServiceImpl implements DbDiyService {
@Transactional(rollbackFor = Exception.class)
@Override
public void updateById(DbDiyVO dbDiyVO) {
CustomAsserts.nonNull(dbDiyVO, "实体对象不能为空");
DbDiyEntity dbDiy = BeanMapper.mapper().convert(dbDiyVO, DbDiyEntity.class);
public void updateById(DbDiySnakeVO dbDiySnakeVO) {
CustomAsserts.nonNull(dbDiySnakeVO, "实体对象不能为空");
DbDiyEntity dbDiy = BeanMapper.mapper().convert(dbDiySnakeVO, DbDiyEntity.class);
try {
dbDiyDomainService.updateById(dbDiy);
} catch (DuplicateKeyException e) {
......
package com.jomalls.custom.app.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jomalls.custom.app.exception.ServiceException;
import com.jomalls.custom.app.vo.LogCustomProductPageVO;
import com.jomalls.custom.app.vo.LogCustomProductVO;
import com.jomalls.custom.app.vo.LogCustomProductSnakeVO;
import com.jomalls.custom.app.service.LogCustomProductService;
import com.jomalls.custom.app.utils.BeanMapper;
import com.jomalls.custom.app.utils.CustomAsserts;
import com.jomalls.custom.dal.entity.LogCustomProductEntity;
import com.jomalls.custom.domain.service.LogCustomProductDomainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
......@@ -31,66 +25,20 @@ public class LogCustomProductServiceImpl implements LogCustomProductService {
private final LogCustomProductDomainService logCustomProductDomainService;
@Autowired
public LogCustomProductServiceImpl(LogCustomProductDomainService logCustomProductDomainService) {
this.logCustomProductDomainService = logCustomProductDomainService;
}
@Override
public List<LogCustomProductVO> list(LogCustomProductVO logCustomProductVO) {
QueryWrapper<LogCustomProductEntity> queryWrapper = new QueryWrapper<>();
// TODO 根据业务条件组装入参
List<LogCustomProductEntity> list = logCustomProductDomainService.list(queryWrapper);
return list.stream().map(e -> BeanMapper.mapper().convert(e, LogCustomProductVO.class)).collect(Collectors.toList());
public List<LogCustomProductSnakeVO> getListByProductId(Integer productId) {
CustomAsserts.nonNull(productId, "商品 ID 不能为空");
// 按 product_id 查询所有日志,按 id 降序排列
List<LogCustomProductEntity> logs = logCustomProductDomainService.list(
new QueryWrapper<LogCustomProductEntity>()
.eq("product_id", productId)
.orderByDesc("id"));
return logs.stream()
.map(e -> BeanMapper.snakeCase().convert(e, LogCustomProductSnakeVO.class))
.collect(Collectors.toList());
}
@Override
public IPage<LogCustomProductVO> pageList(LogCustomProductPageVO logCustomProductPageVO) {
CustomAsserts.nonNull(logCustomProductPageVO, "分页查询参数不能为空");
QueryWrapper<LogCustomProductEntity> queryWrapper = new QueryWrapper<>();
// TODO 根据业务条件组装入参
IPage<LogCustomProductEntity> page = logCustomProductDomainService.selectPage(queryWrapper, logCustomProductPageVO);
return page.convert(e -> BeanMapper.mapper().convert(e, LogCustomProductVO.class));
}
@Override
public LogCustomProductVO info(Integer id) {
CustomAsserts.nonNull(id, "主键id不能为空");
LogCustomProductEntity logCustomProduct = logCustomProductDomainService.getById(id);
return BeanMapper.mapper().convert(logCustomProduct, LogCustomProductVO.class);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void save(LogCustomProductVO logCustomProductVO) {
CustomAsserts.nonNull(logCustomProductVO, "实体对象不能为空");
LogCustomProductEntity logCustomProductEntity = BeanMapper.mapper().convert(logCustomProductVO, LogCustomProductEntity.class);
try {
logCustomProductDomainService.save(logCustomProductEntity);
} catch (DuplicateKeyException e) {
log.info("[ LogCustomProductServiceImpl save ] 实体对象唯一约束重复,请调整后再试!", e);
throw new ServiceException("实体对象唯一约束重复,请调整后再试!");
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public void updateById(LogCustomProductVO logCustomProductVO) {
CustomAsserts.nonNull(logCustomProductVO, "实体对象不能为空");
LogCustomProductEntity logCustomProduct = BeanMapper.mapper().convert(logCustomProductVO, LogCustomProductEntity.class);
try {
logCustomProductDomainService.updateById(logCustomProduct);
} catch (DuplicateKeyException e) {
log.info("[ LogCustomProductServiceImpl updateById ] 实体对象唯一约束重复,请调整后再试!", e);
throw new ServiceException("实体对象唯一约束重复,请调整后再试!");
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public void deleteById(Integer id) {
CustomAsserts.nonNull(id, "主键id不能为空");
logCustomProductDomainService.removeById(id);
}
}
package com.jomalls.custom.app.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 工艺中心 VO
* <p>
* 对齐 TS 项目 {@code CraftCenter} 实体字段。
*
* @author Lizh
* @date 2026-06-11
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "工艺中心")
public class CraftCenterVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "工艺编号")
private Long id;
@Schema(description = "工艺名称")
private String craftName;
@Schema(description = "工艺英文名称")
private String craftEnName;
@Schema(description = "工艺类型")
private String craftType;
@Schema(description = "工艺编码")
private String craftCode;
@Schema(description = "币种")
private String currencyCode;
@Schema(description = "工艺成本")
private String craftCost;
@Schema(description = "其他面的价格")
private String otherSideCost;
@Schema(description = "是否启用")
private Boolean craftEnable;
@Schema(description = "是否在ERP显示")
private Boolean erpDisplay;
@Schema(description = "国家代码")
private String countryCode;
@Schema(description = "创建时间")
private Date createTime;
@Schema(description = "修改时间")
private Date updateTime;
}
package com.jomalls.custom.app.vo;
import com.jomalls.custom.page.PageRequest;
import io.swagger.v3.core.util.Json;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
......@@ -22,7 +21,7 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "VO")
public class DbDiyVO implements Serializable {
public class DbDiySnakeVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
......@@ -48,7 +47,7 @@ public class DbDiyVO implements Serializable {
* 英文名称
*/
@Schema(description = "英文名称")
private String enName;
private String en_name;
/**
* 排序
......@@ -60,13 +59,13 @@ public class DbDiyVO implements Serializable {
* diy主图
*/
@Schema(description = "diy主图")
private String imgUrl;
private String img_url;
/**
* 图片集合,逗号分割
*/
@Schema(description = "图片集合,逗号分割")
private String imgArr;
private String img_arr;
/**
* 编码
......@@ -90,13 +89,13 @@ public class DbDiyVO implements Serializable {
* 1 svgToJpg 2 svgToSvg 3 svgToTiff 4 svgToPng 4 5 psdToJpg
*/
@Schema(description = "1 svgToJpg 2 svgToSvg 3 svgToTiff 4 svgToPng 4 5 psdToJpg")
private Integer scImgType;
private Integer sc_img_type;
/**
* 是否立即生成尺码 0 不生成 1 立即生成全部尺码
*/
@Schema(description = "是否立即生成尺码 0 不生成 1 立即生成全部尺码")
private Integer chimaNowRender;
private Integer chima_now_render;
/**
* 状态 1 服务器渲染 2 前台渲染
......@@ -108,25 +107,37 @@ public class DbDiyVO implements Serializable {
* DbDiy 父级值 可以用于绑定
*/
@Schema(description = "DbDiy 父级值 可以用于绑定")
private Integer parentId;
private Integer parent_id;
/**
* 默认值 选择的产品
*/
@Schema(description = "默认值 选择的产品")
private Integer default_diy_id;
/**
* 存放的user ids
*/
@Schema(description = "存放的user ids")
private String userIds;
private String user_ids;
/**
* 不允许查看的用户
*/
@Schema(description = "不允许查看的用户")
private String banUserIds;
private String ban_user_ids;
/**
* diy分类ID
*/
@Schema(description = "diy分类ID")
private Integer typeId;
private Integer type_id;
/**
* 工厂/供应商id
*/
@Schema(description = "工厂/供应商id")
private Integer factory_id;
/**
* 状态 0 已下架 1 已上架 20 待上架 40 建模完成 50 多变体完善 60 产前测试 70 建模中 75 待确认 80 待分派 85 打板中 90 待审核 9 软删除
......@@ -138,25 +149,7 @@ public class DbDiyVO implements Serializable {
*
*/
@Schema(description = "")
private Date createDate;
/**
* 默认值 选择的产品
*/
@Schema(description = "默认值 选择的产品")
private Integer defaultDiyId;
/**
* 工厂/供应商id
*/
@Schema(description = "工厂/供应商id")
private Integer factoryId;
/**
* 印花类型 0满印 1局部印
*/
@Schema(description = "印花类型 0满印 1局部印")
private Integer printType;
private Date create_date;
/**
* 材质
......@@ -165,28 +158,10 @@ public class DbDiyVO implements Serializable {
private String material;
/**
* 工艺id
*/
@Schema(description = "工艺id")
private Long craftId;
/**
* 最低价格
*/
@Schema(description = "最低价格")
private BigDecimal minPrice;
/**
* 最高价格
*/
@Schema(description = "最高价格")
private BigDecimal maxPrice;
/**
* 图片是否创建缩略图 1已创建 0未创建(临时字段)
*/
@Schema(description = "图片是否创建缩略图 1已创建 0未创建(临时字段)")
private Boolean pictureStatus;
private Boolean picture_status;
/**
* 备注信息
......@@ -204,49 +179,49 @@ public class DbDiyVO implements Serializable {
* 审核人id
*/
@Schema(description = "审核人id")
private Integer auditId;
private Integer audit_id;
/**
* 审核人名称
*/
@Schema(description = "审核人名称")
private String auditName;
private String audit_name;
/**
* 审核时间
*/
@Schema(description = "审核时间")
private Date auditDate;
private Date audit_date;
/**
* 上架时间
*/
@Schema(description = "上架时间")
private Date shelfDate;
private Date shelf_date;
/**
* 关联信息模板ID
*/
@Schema(description = "关联信息模板ID")
private Integer templateId;
private Integer template_id;
/**
* 关联信息模板类别ID
*/
@Schema(description = "关联信息模板类别ID")
private Integer categoryId;
private Integer category_id;
/**
* 分派人ID
*/
@Schema(description = "分派人ID")
private Integer allocationId;
private Integer allocation_id;
/**
* 分派人名称
*/
@Schema(description = "分派人名称")
private String allocationName;
private String allocation_name;
/**
* 是否加急处理 0否 1是
......@@ -258,19 +233,31 @@ public class DbDiyVO implements Serializable {
* 绑定模型id集合
*/
@Schema(description = "绑定模型id集合")
private String bindDiyIds;
private String bind_diy_ids;
/**
* 是否被绑定
*/
@Schema(description = "是否被绑定")
private Boolean isBind;
private Boolean is_bind;
/**
* 模备注
*/
@Schema(description = "模备注")
private String diy_remark;
/**
* 是否新版模
*/
@Schema(description = "是否新版模")
private Boolean new_standard;
/**
* 是否由美国生产 默认为false
*/
@Schema(description = "是否由美国生产 默认为false")
private Boolean usaMade;
private Boolean usa_made;
/**
* 厂商
......@@ -282,7 +269,13 @@ public class DbDiyVO implements Serializable {
* 款号
*/
@Schema(description = "款号")
private String styleNum;
private String style_num;
/**
* 印花类型 0满印 1局部印
*/
@Schema(description = "印花类型 0满印 1局部印")
private Integer printType;
/**
* 模类型 0公模 1私模
......@@ -294,34 +287,39 @@ public class DbDiyVO implements Serializable {
* 生产终端
*/
@Schema(description = "生产终端")
private String productionClient;
private String production_client;
/**
* erp的颜色尺码
*/
@Schema(description = "erp的颜色尺码")
private Json erpSkuProperties;
private Json erp_sku_properties;
/**
* 推送需求的人
*/
@Schema(description = "推送需求的人")
private String pushUser;
private String push_user;
/**
* 是否新版模
* 最低价格
*/
@Schema(description = "是否新版模")
private Boolean newStandard;
@Schema(description = "最低价格")
private BigDecimal min_price;
/**
* 模备注
* 最高价格
*/
@Schema(description = "模备注")
private String diyRemark;
@Schema(description = "最高价格")
private BigDecimal max_price;
@Schema(description = "效果图列表")
private List<DbDiyXiaoguotuVO> xiaoguotuList;
/**
* 工艺id
*/
@Schema(description = "工艺id")
private Long craft_id;
@Schema(description = "效果图列表")
private List<DbDiyXiaoguotuSnakeVO> xiaoguotuList;
}
......@@ -20,7 +20,7 @@ import java.io.Serializable;
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "DIY 效果图")
public class DbDiyXiaoguotuVO implements Serializable {
public class DbDiyXiaoguotuSnakeVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
......@@ -35,13 +35,13 @@ public class DbDiyXiaoguotuVO implements Serializable {
private Integer idx;
@Schema(description = "效果图主图")
private String imgUrl;
private String img_url;
@Schema(description = "PSD 链接")
private String psdUrl;
private String psd_url;
@Schema(description = "颜色 ID")
private Integer colorId;
private Integer color_id;
@Schema(description = "宽度")
private Float width;
......@@ -53,7 +53,7 @@ public class DbDiyXiaoguotuVO implements Serializable {
private Integer dpi;
@Schema(description = "关联的 DIY 模板 ID")
private Integer diyId;
private Integer diy_id;
@Schema(description = "状态:1 正常 0 禁用")
private Integer status;
......
......@@ -21,7 +21,7 @@ import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "VO")
public class LogCustomProductVO implements Serializable {
public class LogCustomProductSnakeVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
......@@ -35,19 +35,19 @@ public class LogCustomProductVO implements Serializable {
* 商品id(custom_product_info表id)
*/
@Schema(description = "商品id(custom_product_info表id)")
private Integer productId;
private Integer product_id;
/**
* 操作人id
*/
@Schema(description = "操作人id")
private Integer employeeId;
private Integer employee_id;
/**
* 操作人账号
*/
@Schema(description = "操作人账号")
private String employeeAccount;
private String employee_account;
/**
* 操作描述
......@@ -59,7 +59,7 @@ public class LogCustomProductVO implements Serializable {
* 创建时间
*/
@Schema(description = "创建时间")
private Date createTime;
private Date create_time;
}
package com.jomalls.custom.dal.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 工艺中心实体
* <p>
* 对齐 TS 项目 {@code CraftCenter} 实体(craft_center 表)。
*
* @author Lizh
* @date 2026-06-11
*/
@Data
@TableName("craft_center")
public class CraftCenterEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** 工艺编号 */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 工艺名称 */
@TableField("craft_name")
private String craftName;
/** 工艺英文名称 */
@TableField("craft_en_name")
private String craftEnName;
/** 工艺类型 */
@TableField("craft_type")
private String craftType;
/** 工艺编码 */
@TableField("craft_code")
private String craftCode;
/** 币种 */
@TableField("currency_code")
private String currencyCode;
/** 工艺成本 */
@TableField("craft_cost")
private String craftCost;
/** 其他面的价格 */
@TableField("other_side_cost")
private String otherSideCost;
/** 是否启用(1启用,0未启用) */
@TableField("craft_enable")
private Boolean craftEnable;
/** 是否在ERP显示 */
@TableField("erp_display")
private Boolean erpDisplay;
/** 国家代码 */
@TableField("country_code")
private String countryCode;
/** 创建时间 */
@TableField("create_time")
private Date createTime;
/** 修改时间 */
@TableField("update_time")
private Date updateTime;
}
package com.jomalls.custom.dal.mapper;
import com.jomalls.custom.dal.entity.CraftCenterEntity;
import com.jomalls.custom.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 工艺中心 Mapper
*
* @author Lizh
* @date 2026-06-11
*/
@Mapper
public interface CraftCenterMapper extends BaseMapper<CraftCenterEntity> {
}
......@@ -35,4 +35,15 @@ public interface CustomProductInfoMapper extends BaseMapper<CustomProductInfoEnt
* @return 符合条件的商品 ID 列表(已去重)
*/
List<Integer> selectIdsByErpPermission(@Param("userId") Integer userId);
/**
* 查询无任何 diy_user 绑定的商品 ID 列表
* <p>
* 对齐 TS page diyUserId=-1 时的原生 SQL(TS:287-295)。
* 使用 LEFT JOIN + WHERE IS NULL 语义:
* 找到所有在 custom_product_diy_user_rel 表中无关联记录的商品。
*
* @return 无绑定的商品 ID 列表(已去重)
*/
List<Integer> selectIdsWithoutDiyUserBind();
}
package com.jomalls.custom.domain.service;
import com.jomalls.custom.dal.entity.CraftCenterEntity;
import com.jomalls.custom.service.IBaseService;
/**
* 工艺中心 Domain Service 接口
*
* @author Lizh
* @date 2026-06-11
*/
public interface CraftCenterDomainService extends IBaseService<CraftCenterEntity> {
}
......@@ -28,5 +28,14 @@ public interface CustomProductInfoDomainService extends IBaseService<CustomProdu
* @return 符合条件的商品 ID 列表(已去重)
*/
List<Integer> selectIdsByErpPermission(Integer userId);
/**
* 查询无任何 diy_user 绑定的商品 ID 列表
* <p>
* LEFT JOIN + WHERE IS NULL,对齐 TS page diyUserId=-1 逻辑。
*
* @return 无绑定的商品 ID 列表(已去重)
*/
List<Integer> selectIdsWithoutDiyUserBind();
}
package com.jomalls.custom.domain.service.impl;
import com.jomalls.custom.dal.mapper.CraftCenterMapper;
import com.jomalls.custom.dal.entity.CraftCenterEntity;
import com.jomalls.custom.domain.service.CraftCenterDomainService;
import com.jomalls.custom.service.impl.BaseServiceImpl;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 工艺中心 Domain Service 实现
*
* @author Lizh
* @date 2026-06-11
*/
@Service
public class CraftCenterDomainServiceImpl
extends BaseServiceImpl<CraftCenterMapper, CraftCenterEntity>
implements CraftCenterDomainService {
@Autowired
public CraftCenterDomainServiceImpl(SqlSessionFactory sqlSessionFactory) {
super(sqlSessionFactory);
}
}
......@@ -35,4 +35,9 @@ public class CustomProductInfoDomainServiceImpl extends BaseServiceImpl<CustomPr
public List<Integer> selectIdsByErpPermission(Integer userId) {
return baseMapper.selectIdsByErpPermission(userId);
}
@Override
public List<Integer> selectIdsWithoutDiyUserBind() {
return baseMapper.selectIdsWithoutDiyUserBind();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jomalls.custom.dal.mapper.CraftCenterMapper">
<resultMap type="com.jomalls.custom.dal.entity.CraftCenterEntity" id="craftCenterMap">
<result property="id" column="id"/>
<result property="craftName" column="craft_name"/>
<result property="craftEnName" column="craft_en_name"/>
<result property="craftType" column="craft_type"/>
<result property="craftCode" column="craft_code"/>
<result property="currencyCode" column="currency_code"/>
<result property="craftCost" column="craft_cost"/>
<result property="otherSideCost" column="other_side_cost"/>
<result property="craftEnable" column="craft_enable"/>
<result property="erpDisplay" column="erp_display"/>
<result property="countryCode" column="country_code"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="tableColumns">
id,
craft_name,
craft_en_name,
craft_type,
craft_code,
currency_code,
craft_cost,
other_side_cost,
craft_enable,
erp_display,
country_code,
create_time,
update_time
</sql>
<!-- 批量插入 -->
<insert id="insertBatchSomeColumn">
INSERT INTO craft_center (craft_name, craft_en_name, craft_type, craft_code, currency_code, craft_cost, other_side_cost, craft_enable, erp_display, country_code, create_time, update_time) VALUES
<foreach collection="list" item="item" separator=",">
(#{item.craftName}, #{item.craftEnName}, #{item.craftType}, #{item.craftCode}, #{item.currencyCode}, #{item.craftCost}, #{item.otherSideCost}, #{item.craftEnable}, #{item.erpDisplay}, #{item.countryCode}, #{item.createTime}, #{item.updateTime})
</foreach>
</insert>
</mapper>
......@@ -105,6 +105,17 @@
AND (rel.diy_user_id = #{userId} OR rel.diy_user_id IS NULL)
</select>
<!-- 查询无任何 diy_user 绑定的商品 ID 列表 -->
<!-- 对齐 TS page 中的原生 SQL(TS:287-295)
LEFT JOIN + WHERE IS NULL 语义:
找到所有 custom_product_diy_user_rel 表中无关联记录的商品 -->
<select id="selectIdsWithoutDiyUserBind" resultType="java.lang.Integer">
SELECT DISTINCT info.id
FROM custom_product_info info
LEFT JOIN custom_product_diy_user_rel rel ON rel.product_id = info.id
WHERE rel.diy_user_id IS NULL
</select>
<!-- 批量插入 -->
<insert id="insertBatchSomeColumn">
INSERT INTO custom_product_info (sku, title, name, img_url, category_id, weight, purchasing_min, factory_price, sales_price, sales_price_max, status, property1_cate_id, property2_cate_id, property3_cate_id, property1_enname, property2_enname, property3_enname, color_images, material, print_type, product_no, origin_code, origin_name_cn, origin_name_en, currency_code, currency_name, product_type, factory_id, factory_code, processing, create_time, update_time, sort, diy_id, diy_sku) VALUES
......
package com.jomalls.custom.integrate.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -20,7 +21,7 @@ import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "商品分类")
public class BaseCategoryInfoModel implements Serializable {
public class CategoryInfoModel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
......@@ -53,6 +54,9 @@ public class BaseCategoryInfoModel implements Serializable {
private Boolean leaf;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private Boolean publicData;
}
......@@ -16,7 +16,7 @@ import java.util.List;
* @date 2026-06-08
*/
@Data
public class BasePropertyModel implements Serializable {
public class PropertyModel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
......@@ -47,7 +47,7 @@ public class BasePropertyModel implements Serializable {
/** 属性值列表 */
@JsonProperty("valueList")
private List<BasePropertyValueModel> valueList;
private List<PropertyValueModel> valueList;
/** 是否公共数据 */
private Boolean publicData;
......
......@@ -12,7 +12,7 @@ import java.io.Serializable;
* @date 2026-06-08
*/
@Data
public class BasePropertyValueModel implements Serializable {
public class PropertyValueModel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
......
......@@ -2,8 +2,8 @@ package com.jomalls.custom.integrate.service;
import com.jomalls.custom.enums.CodeEnum;
import com.jomalls.custom.integrate.client.RemoteApiClient;
import com.jomalls.custom.integrate.model.BaseCategoryInfoModel;
import com.jomalls.custom.integrate.model.BasePropertyModel;
import com.jomalls.custom.integrate.model.CategoryInfoModel;
import com.jomalls.custom.integrate.model.PropertyModel;
import com.jomalls.custom.integrate.model.SaasAdminApiResponseModel;
import com.jomalls.custom.security.LoginUser;
import com.jomalls.custom.security.SecurityUtils;
......@@ -67,27 +67,27 @@ public class SaasAdminService {
* @param ids 属性 ID,逗号分隔(如 "1,2,3")
* @return 属性列表,包含 valueList 和 skuProperty 等字段
*/
public List<BasePropertyModel> getPropertyByIds(String ids) {
public List<PropertyModel> getPropertyByIds(String ids) {
if (!StringUtils.hasText(ids)) {
return Collections.emptyList();
}
try {
String url = adminBaseUrl + GET_PROPERTY_BY_IDS_URL + "?ids=" + ids;
ResponseEntity<SaasAdminApiResponseModel<List<BasePropertyModel>>> response = remoteApiClient.get(
ResponseEntity<SaasAdminApiResponseModel<List<PropertyModel>>> response = remoteApiClient.get(
url,
new ParameterizedTypeReference<>() {},
getHeader());
if (response != null && response.getBody() != null) {
log.debug("[ BasePropertyService ] getByIds 成功, ids={}, 返回 {} 条", ids, response.toString());
SaasAdminApiResponseModel<List<BasePropertyModel>> responseBody = response.getBody();
log.debug("[ SaasAdminService ] getByIds 成功, ids={}, 返回: {}", ids, response.toString());
SaasAdminApiResponseModel<List<PropertyModel>> responseBody = response.getBody();
if (responseBody.getCode() == CodeEnum.SUCCESS.getCode()) {
return responseBody.getData();
}
}
log.warn("[ BasePropertyService ] getByIds 返回空, ids={}", ids);
log.warn("[ SaasAdminService ] getByIds 返回空, ids={}", ids);
return Collections.emptyList();
} catch (Exception e) {
log.error("[ BasePropertyService ] getByIds 调用失败, ids={}", ids, e);
log.error("[ SaasAdminService ] getByIds 调用失败, ids={}", ids, e);
return Collections.emptyList();
}
}
......@@ -96,9 +96,9 @@ public class SaasAdminService {
* <p>
* 对齐 TS {@code getTree()}
*/
public List<BaseCategoryInfoModel> getTree() {
public List<CategoryInfoModel> getTree() {
try {
ResponseEntity<List<BaseCategoryInfoModel>> response = remoteApiClient.get(
ResponseEntity<List<CategoryInfoModel>> response = remoteApiClient.get(
adminBaseUrl + GET_TREE_URL,
new ParameterizedTypeReference<>() {},
getHeader());
......@@ -106,7 +106,7 @@ public class SaasAdminService {
return response.getBody();
}
} catch (Exception e) {
log.error("[ BaseCategoryInfoService ] getTree 调用失败", e);
log.error("[ SaasAdminService ] getTree 调用失败", e);
}
return Collections.emptyList();
}
......@@ -116,13 +116,13 @@ public class SaasAdminService {
* <p>
* 对齐 TS {@code getByIds(ids)}
*/
public List<BaseCategoryInfoModel> getByIds(String ids) {
public List<CategoryInfoModel> getByIds(String ids) {
if (ids == null || ids.isEmpty()) {
return Collections.emptyList();
}
try {
String url = adminBaseUrl + GET_BY_IDS_URL + "?ids=" + ids;
ResponseEntity<List<BaseCategoryInfoModel>> response = remoteApiClient.get(
ResponseEntity<List<CategoryInfoModel>> response = remoteApiClient.get(
url,
new ParameterizedTypeReference<>() {},
getHeader());
......@@ -130,7 +130,7 @@ public class SaasAdminService {
return response.getBody();
}
} catch (Exception e) {
log.error("[ BaseCategoryInfoService ] getByIds 调用失败, ids={}", ids, e);
log.error("[ SaasAdminService ] getByIds 调用失败, ids={}", ids, e);
}
return Collections.emptyList();
}
......@@ -140,9 +140,9 @@ public class SaasAdminService {
* <p>
* 对齐 TS {@code treeList()}
*/
public List<BaseCategoryInfoModel> treeList() {
public List<CategoryInfoModel> treeList() {
try {
ResponseEntity<List<BaseCategoryInfoModel>> response = remoteApiClient.get(
ResponseEntity<List<CategoryInfoModel>> response = remoteApiClient.get(
adminBaseUrl + GET_TREE_URL,
new ParameterizedTypeReference<>() {},
getHeader());
......@@ -150,7 +150,7 @@ public class SaasAdminService {
return response.getBody();
}
} catch (Exception e) {
log.error("[ BaseCategoryInfoService ] treeList 调用失败", e);
log.error("[ SaasAdminService ] treeList 调用失败", e);
}
return Collections.emptyList();
}
......@@ -160,19 +160,19 @@ public class SaasAdminService {
* <p>
* 对齐 TS {@code getById(id)}
*/
public BaseCategoryInfoModel getById(Integer id) {
public CategoryInfoModel getById(Integer id) {
if (id == null) {
return null;
}
try {
String url = adminBaseUrl + GET_BY_ID_URL + "?id=" + id;
ResponseEntity<BaseCategoryInfoModel> response = remoteApiClient.get(
url, BaseCategoryInfoModel.class, null);
ResponseEntity<CategoryInfoModel> response = remoteApiClient.get(
url, CategoryInfoModel.class, null);
if (response != null) {
return response.getBody();
}
} catch (Exception e) {
log.error("[ BaseCategoryInfoService ] getById 调用失败, id={}", id, e);
log.error("[ SaasAdminService ] getById 调用失败, id={}", id, e);
}
return null;
}
......@@ -182,17 +182,21 @@ public class SaasAdminService {
* <p>
* 对齐 TS {@code allList()}
*/
public List<BaseCategoryInfoModel> getAllList() {
public List<CategoryInfoModel> getAllList() {
try {
ResponseEntity<List<BaseCategoryInfoModel>> response = remoteApiClient.get(
ResponseEntity<SaasAdminApiResponseModel<List<CategoryInfoModel>>> response = remoteApiClient.get(
adminBaseUrl + GET_ALL_LIST_URL,
new ParameterizedTypeReference<>() {},
getHeader());
if (response != null && response.getBody() != null) {
return response.getBody();
log.debug("[ SaasAdminService ] getAllList 成功, 返回: {}", response.toString());
SaasAdminApiResponseModel<List<CategoryInfoModel>> responseBody = response.getBody();
if (responseBody.getCode() == CodeEnum.SUCCESS.getCode()) {
return responseBody.getData();
}
}
} catch (Exception e) {
log.error("[ BaseCategoryInfoService ] getAllList 调用失败", e);
log.error("[ SaasAdminService ] getAllList 调用失败", e);
}
return Collections.emptyList();
}
......
......@@ -59,8 +59,8 @@ public class SecurityInterceptor implements HandlerInterceptor {
return true;
} else {
log.warn("用户[{}]token已过期,请求URI: {}", loginUser.getUsername(), request.getRequestURI());
throw new InvalidTokenException(CodeEnum.UNAUTHORIZED.getCode(), "未登录或登录已过期");
}
return false;
}
/**
......
......@@ -9,7 +9,8 @@ import com.jomalls.custom.app.enums.CustomProductInfoStatusEnum;
import com.jomalls.custom.app.service.CustomProductInfoService;
import com.jomalls.custom.app.vo.CustomProductInfoSnakeVO;
import com.jomalls.custom.app.vo.CustomProductInfoVO;
import com.jomalls.custom.app.vo.DbDiyVO;
import com.jomalls.custom.app.vo.CraftCenterVO;
import com.jomalls.custom.app.vo.DbDiySnakeVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -37,12 +38,6 @@ public class CustomProductInfoController {
@Autowired
private CustomProductInfoService customProductInfoService;
@Operation(summary = "分页列表接口", description = "根据条件查询分页列表接口")
@RequestMapping(value = "/page", method = RequestMethod.POST)
public IPage<CustomProductInfoVO> pageList(@RequestBody CustomProductInfoSnakeDTO param) {
return customProductInfoService.pageList(param);
}
@Operation(summary = "创建商品", description = "创建商品")
@PostMapping("/create")
public void create(@RequestBody @Valid CustomProductInfoSnakeDTO dto) {
......@@ -64,6 +59,12 @@ public class CustomProductInfoController {
return customProductInfoService.getByIdOrSku(id, sku, namespace);
}
@Operation(summary = "分页列表接口", description = "根据条件查询分页列表接口")
@RequestMapping(value = "/page", method = RequestMethod.POST)
public IPage<CustomProductInfoSnakeVO> pageList(@RequestBody CustomProductInfoSnakeDTO param) {
return customProductInfoService.pageList(param);
}
@Operation(summary = "获取状态列表", description = "返回所有商品状态枚举")
@GetMapping("/getStatusList")
public List<Map<String, Object>> getStatusList() {
......@@ -81,7 +82,7 @@ public class CustomProductInfoController {
@Operation(summary = "获取绑定的模型", description = "获取商品绑定的 DIY 模板列表")
@GetMapping("/getBindsDiyById")
public List<DbDiyVO> getBindsDiyById(@Parameter(description = "商品 ID") @RequestParam Integer id) {
public List<DbDiySnakeVO> getBindsDiyById(@Parameter(description = "商品 ID") @RequestParam Integer id) {
return customProductInfoService.getBindsDiyById(id);
}
......@@ -109,13 +110,12 @@ public class CustomProductInfoController {
customProductInfoService.addBlackList(dto);
}
@Operation(summary = "获取绑定的工艺", description = "获取商品绑定的工艺 ID 列表")
@Operation(summary = "获取绑定的工艺", description = "获取商品绑定的工艺实体列表")
@GetMapping("/getCraftById")
public List<Long> getCraftById(@Parameter(description = "商品 ID") @RequestParam Integer id) {
public List<CraftCenterVO> getCraftById(@Parameter(description = "商品 ID") @RequestParam Integer id) {
return customProductInfoService.getCraftById(id);
}
// ==================== ERP 专用端点(对齐 TS ApiCustomProductInfoController) ====================
@Operation(summary = "ERP 分页查询", description = "包含黑名单过滤、用户折扣等 ERP 特定逻辑")
@PostMapping("/erpPage")
......@@ -125,10 +125,10 @@ public class CustomProductInfoController {
@Operation(summary = "ERP 获取绑定 DIY", description = "获取商品绑定的 DIY 模板(含效果图),支持按 userMark/namespace 过滤")
@GetMapping("/getErpBindsDiyById")
public List<DbDiyVO> getErpBindsDiyById(
public List<DbDiySnakeVO> getBindsDiyByIdAndUserMark(
@Parameter(description = "商品 ID") @RequestParam Integer id,
@Parameter(description = "用户标识") @RequestParam(required = false) String userMark,
@Parameter(description = "命名空间") @RequestParam(required = false) String namespace) {
return customProductInfoService.getErpBindsDiyById(id, userMark, namespace);
return customProductInfoService.getBindsDiyByIdAndUserMark(id, userMark, namespace);
}
}
......@@ -3,7 +3,7 @@ package com.jomalls.custom.webapp.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jomalls.custom.app.service.DbDiyService;
import com.jomalls.custom.app.vo.DbDiyPageVO;
import com.jomalls.custom.app.vo.DbDiyVO;
import com.jomalls.custom.app.vo.DbDiySnakeVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -33,13 +33,13 @@ public class DbDiyController {
/**
* 列表查询接口
*
* @param dbDiyVO 条件model
* @param dbDiySnakeVO 条件model
* @return list集合
*/
@Operation(summary = "列表查询接口", description = "根据条件查询列表接口(不分页)")
@RequestMapping(value = "/list", method = RequestMethod.POST)
public List<DbDiyVO> list(@RequestBody DbDiyVO dbDiyVO) {
return dbDiyService.list(dbDiyVO);
public List<DbDiySnakeVO> list(@RequestBody DbDiySnakeVO dbDiySnakeVO) {
return dbDiyService.list(dbDiySnakeVO);
}
/**
......@@ -50,7 +50,7 @@ public class DbDiyController {
*/
@Operation(summary = "分页列表接口", description = "根据条件查询分页列表接口")
@RequestMapping(value = "/pageList", method = RequestMethod.POST)
public IPage<DbDiyVO> pageList(@RequestBody DbDiyPageVO dbDiyPageVO) {
public IPage<DbDiySnakeVO> pageList(@RequestBody DbDiyPageVO dbDiyPageVO) {
return dbDiyService.pageList(dbDiyPageVO);
}
......@@ -63,31 +63,31 @@ public class DbDiyController {
*/
@Operation(summary = "根据主键id查询详情", description = "根据主键id查询详情")
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
public DbDiyVO info(@Parameter(description = "主键id", required = true) @PathVariable("id") Integer id) {
public DbDiySnakeVO info(@Parameter(description = "主键id", required = true) @PathVariable("id") Integer id) {
return dbDiyService.info(id);
}
/**
* 保存对象
*
* @param dbDiyVO 保存对象
* @param dbDiySnakeVO 保存对象
*/
@Operation(summary = "保存对象", description = "保存对象")
@RequestMapping(value = "/save", method = RequestMethod.POST)
public void save(@RequestBody @Valid DbDiyVO dbDiyVO) {
dbDiyService.save(dbDiyVO);
public void save(@RequestBody @Valid DbDiySnakeVO dbDiySnakeVO) {
dbDiyService.save(dbDiySnakeVO);
}
/**
* 根据id修改对象
*
* @param dbDiyVO 修改对象
* @param dbDiySnakeVO 修改对象
*/
@Operation(summary = "根据id修改对象", description = "根据id修改对象")
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
public void updateById(@RequestBody DbDiyVO dbDiyVO) {
dbDiyService.updateById(dbDiyVO);
public void updateById(@RequestBody DbDiySnakeVO dbDiySnakeVO) {
dbDiyService.updateById(dbDiySnakeVO);
}
/**
......
package com.jomalls.custom.webapp.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jomalls.custom.app.vo.LogCustomProductPageVO;
import com.jomalls.custom.app.vo.LogCustomProductVO;
import com.jomalls.custom.app.service.LogCustomProductService;
import com.jomalls.custom.app.vo.LogCustomProductSnakeVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author Lizh
* @version 0.01
* @description: Controller
* @version 0.02
* @description: 商品日志 Controller(对齐 TS ApiProductLogController)
* @date 2026-05-29 11:43:04
*/
@Slf4j
@RestController
@Tag(name = "/logCustomProduct", description = "Controller")
@RequestMapping("/logCustomProduct")
@Tag(name = "/api/v2/product/log", description = "商品日志接口")
@RequestMapping("/api/v2/product/log")
public class LogCustomProductController {
@Autowired
private LogCustomProductService logCustomProductService;
/**
* 列表查询接口
* 根据商品 ID 获取日志列表(对齐 TS getListByProductId)
*
* @param logCustomProductVO 条件model
* @return list集合
* @param id 商品 ID
* @return 日志列表,按创建时间降序
*/
@Operation(summary = "列表查询接口", description = "根据条件查询列表接口(不分页)")
@RequestMapping(value = "/list", method = RequestMethod.POST)
public List<LogCustomProductVO> list(@RequestBody LogCustomProductVO logCustomProductVO) {
return logCustomProductService.list(logCustomProductVO);
}
/**
* 根据条件查询分页列表接口
*
* @param logCustomProductPageVO 分页入参model
* @return 分页对象
*/
@Operation(summary = "分页列表接口", description = "根据条件查询分页列表接口")
@RequestMapping(value = "/pageList", method = RequestMethod.POST)
public IPage<LogCustomProductVO> pageList(@RequestBody LogCustomProductPageVO logCustomProductPageVO) {
return logCustomProductService.pageList(logCustomProductPageVO);
}
/**
* 根据主键id查询详情
*
* @param id 主键
* @return 实体model
*/
@Operation(summary = "根据主键id查询详情", description = "根据主键id查询详情")
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
public LogCustomProductVO info(@Parameter(description = "主键id", required = true) @PathVariable("id") Integer id) {
return logCustomProductService.info(id);
}
/**
* 保存对象
*
* @param logCustomProductVO 保存对象
*/
@Operation(summary = "保存对象", description = "保存对象")
@RequestMapping(value = "/save", method = RequestMethod.POST)
public void save(@RequestBody @Valid LogCustomProductVO logCustomProductVO) {
logCustomProductService.save(logCustomProductVO);
}
/**
* 根据id修改对象
*
* @param logCustomProductVO 修改对象
*/
@Operation(summary = "根据id修改对象", description = "根据id修改对象")
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
public void updateById(@RequestBody LogCustomProductVO logCustomProductVO) {
logCustomProductService.updateById(logCustomProductVO);
}
/**
* 根据主键id进行删除
*
* @param id 主键
*/
@Operation(summary = "根据主键id进行删除", description = "根据主键id进行删除")
@RequestMapping(value = "/deleteById/{id}", method = RequestMethod.DELETE)
public void deleteById(@Parameter(description = "主键id", required = true) @PathVariable("id") Integer id) {
logCustomProductService.deleteById(id);
@Operation(summary = "根据商品 ID 获取日志列表", description = "根据商品 ID 查询所有操作日志,按时间降序排列")
@GetMapping("/getByProductId")
public List<LogCustomProductSnakeVO> getListByProductId(@Parameter(description = "商品 ID") @RequestParam Integer id) {
return logCustomProductService.getListByProductId(id);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment