farm模块-更新
This commit is contained in:
@@ -89,7 +89,7 @@ public class IndicatorNameController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得指标名称分页")
|
||||
@Operation(summary = "获得指标名称全量")
|
||||
@PreAuthorize("@ss.hasPermission('farm:indicator-name:query')")
|
||||
public CommonResult<List<IndicatorNameRespVO>> getIndicatorNameList(@Valid IndicatorNamePageReqVO pageReqVO) {
|
||||
List<IndicatorNameDO> pageResult = indicatorNameService.getIndicatorNameList(pageReqVO);
|
||||
|
||||
@@ -58,8 +58,7 @@ public class ProductManagementController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除商品管理") @Parameter(name = "id", description = "编号", required = true)
|
||||
|
||||
public CommonResult<Boolean> deleteProductManagement(@RequestParam("id") String id) {
|
||||
productManagementService.deleteProductManagement(id);
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.*;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 商品管理 Response VO")
|
||||
@@ -32,9 +33,9 @@ public class ProductManagementRespVO {
|
||||
@ExcelProperty("单位")
|
||||
private String packingUnit;
|
||||
|
||||
@Schema(description = "商品图片")
|
||||
@Schema(description = "商品图片列表")
|
||||
@ExcelProperty("商品图片")
|
||||
private String image;
|
||||
private List<String> imageList;
|
||||
|
||||
@Schema(description = "商品介绍")
|
||||
@ExcelProperty("商品介绍")
|
||||
@@ -52,13 +53,13 @@ public class ProductManagementRespVO {
|
||||
@ExcelProperty("商标名称")
|
||||
private String brandName;
|
||||
|
||||
@Schema(description = "商标图片")
|
||||
@Schema(description = "商标图片列表")
|
||||
@ExcelProperty("商标图片")
|
||||
private String brandImage;
|
||||
private List<String> brandImageList;
|
||||
|
||||
@Schema(description = "商品认证")
|
||||
@Schema(description = "商品认证列表")
|
||||
@ExcelProperty("商品认证")
|
||||
private String brandAuthentication;
|
||||
private List<String> brandAuthentication;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
@@ -79,6 +80,7 @@ public class ProductManagementRespVO {
|
||||
@Schema(description = "地块", example = "王五")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.farm.controller.admin.productmanagement.vo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 商品管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProductManagementSaveReqVO {
|
||||
@@ -22,8 +24,8 @@ public class ProductManagementSaveReqVO {
|
||||
@Schema(description = "单位")
|
||||
private String packingUnit;
|
||||
|
||||
@Schema(description = "商品图片")
|
||||
private String image;
|
||||
@Schema(description = "商品图片列表")
|
||||
private List<String> imageList;
|
||||
|
||||
@Schema(description = "商品介绍")
|
||||
private String introduce;
|
||||
@@ -37,11 +39,11 @@ public class ProductManagementSaveReqVO {
|
||||
@Schema(description = "商标名称", example = "李四")
|
||||
private String brandName;
|
||||
|
||||
@Schema(description = "商标图片")
|
||||
private String brandImage;
|
||||
@Schema(description = "商标图片列表")
|
||||
private List<String> brandImageList;
|
||||
|
||||
@Schema(description = "商品认证")
|
||||
private String brandAuthentication;
|
||||
@Schema(description = "商品认证列表")
|
||||
private List<String> brandAuthentication;
|
||||
|
||||
@Schema(description = "基地id", example = "19830")
|
||||
private String baseId;
|
||||
@@ -54,6 +56,7 @@ public class ProductManagementSaveReqVO {
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Long tenantId;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.farm.framework.util.ImageCollectionUtil;
|
||||
import cn.iocoder.yudao.module.farm.framework.util.StringCollectionUtil;
|
||||
|
||||
/**
|
||||
* 商品管理 DO
|
||||
@@ -84,10 +85,19 @@ public class ProductManagementDO extends BaseDO {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> brandImageList;
|
||||
|
||||
/**
|
||||
* 商品认证
|
||||
* 商品认证(数据库存储为逗号分隔的字符串)
|
||||
*/
|
||||
@TableField(value = "brand_authentication")
|
||||
private String brandAuthentication;
|
||||
|
||||
/**
|
||||
* 商品认证集合(业务层使用)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> brandAuthenticationList;
|
||||
|
||||
/**
|
||||
* 基地id
|
||||
*/
|
||||
@@ -142,4 +152,22 @@ public class ProductManagementDO extends BaseDO {
|
||||
this.brandImageList = brandImageList;
|
||||
this.brandImage = ImageCollectionUtil.toDatabaseString(brandImageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品认证集合
|
||||
*/
|
||||
public List<String> getBrandAuthenticationList() {
|
||||
if (brandAuthenticationList == null) {
|
||||
brandAuthenticationList = StringCollectionUtil.toStringList(this.brandAuthentication);
|
||||
}
|
||||
return brandAuthenticationList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置商品认证集合
|
||||
*/
|
||||
public void setBrandAuthenticationList(List<String> brandAuthenticationList) {
|
||||
this.brandAuthenticationList = brandAuthenticationList;
|
||||
this.brandAuthentication = StringCollectionUtil.toDatabaseString(brandAuthenticationList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ private void validateProductManagementExists(String id) {
|
||||
// 触发图片集合转换,确保返回的DO对象包含转换后的图片集合
|
||||
productManagement.getImageList();
|
||||
productManagement.getBrandImageList();
|
||||
productManagement.getBrandAuthenticationList();
|
||||
}
|
||||
return productManagement;
|
||||
}
|
||||
@@ -97,6 +98,7 @@ private void validateProductManagementExists(String id) {
|
||||
if (productManagement != null) {
|
||||
productManagement.getImageList();
|
||||
productManagement.getBrandImageList();
|
||||
productManagement.getBrandAuthenticationList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user