提交子表内容

pull/1/head
tengxi 1 year ago
parent 16f3d1ad61
commit 4f1c38bcec

@ -92,6 +92,10 @@ public interface ErrorCodeConstants {
ErrorCode PRODUCT_MODIFICATION_NOT_EXISTS = new ErrorCode(1003004029, "批量修改单不存在");
ErrorCode PRODUCT_BOM_NOT_EXISTS = new ErrorCode(1003004030, "商品BOM管理不存在");
ErrorCode PRODUCT_LNVENTORY_UNIT_NOT_EXISTS = new ErrorCode(1003004031, "商品表库存单位不存在");
ErrorCode PRODUCT_MODIFICATION_ITEM0_NOT_EXISTS = new ErrorCode(1003004032, "批量修改单商品不存在");
ErrorCode PRODUCT_PARAMETER_VALUE_NOT_EXISTS = new ErrorCode(1003004033, "商品参数值不存在");
ErrorCode PRODUCT_BUSINESS_NOT_EXISTS = new ErrorCode(1003004034, "商品表和业务线关联关系不存在");
ErrorCode PRODUCT_LABEL_ID_NOT_EXISTS = new ErrorCode(1003004035, "商品标签关联关系不存在");
/**
* 使 1-005-000-000
*/

@ -1,5 +1,6 @@
package com.yunxi.scm.module.xxjj.controller.admin.product;
import com.yunxi.scm.module.xxjj.dal.mysql.product.ProductMapper;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -8,7 +9,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
@ -36,6 +36,8 @@ public class ProductController {
@Resource
private ProductService productService;
@Resource
private ProductMapper productMapper;
@PostMapping("/create")
@Operation(summary = "创建商品")
@ -107,4 +109,14 @@ public class ProductController {
return success(ProductConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/productUpdateStatus")
@Operation(summary = "改状态")
@PreAuthorize("@ss.hasPermission('xxjj:product:query1')")
public String productUpdateStatus(@Valid @RequestBody ProductUpdateReqVO updateReqVO) {
ProductDO productDO=productService.getProduct(updateReqVO.getId());
productDO.setProductStatus(updateReqVO.getProductStatus());
productMapper.updateById(productDO);
return "修改成功";
}
}

@ -300,6 +300,9 @@ public class ProductBaseVO {
@Schema(description = "生命周期")
private String lifeCycle;
@Schema(description = "送货选择")
private String deliverMode;
@Schema(description = "销售状态")
private String salesStatus;

@ -260,6 +260,9 @@ public class ProductExcelVO {
@ExcelProperty("质检比例")
private String qualityInspectionRatio;
@Schema(description = "送货选择")
private String deliverMode;
@ExcelProperty("质检频次")
private String qualityInspectionFrequency;

@ -225,6 +225,9 @@ public class ProductExportReqVO {
@Schema(description = "存储温度下限")
private String storageTemperatureDown;
@Schema(description = "送货选择")
private String deliverMode;
@Schema(description = "存储温度上限")
private String storageTemperatureUpper;

@ -222,6 +222,9 @@ public class ProductPageReqVO extends PageParam {
@Schema(description = "层数/板(存储)")
private String storageBoxBoardNum;
@Schema(description = "送货选择")
private String deliverMode;
@Schema(description = "温层(存储)(1:常温 2:恒温 3:冷藏 4:冷冻)")
private String storageTemperature;

@ -0,0 +1,102 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.common.pojo.CommonResult;
import static com.yunxi.scm.framework.common.pojo.CommonResult.success;
import com.yunxi.scm.framework.excel.core.util.ExcelUtils;
import com.yunxi.scm.framework.operatelog.core.annotations.OperateLog;
import static com.yunxi.scm.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productbusiness.ProductBusinessDO;
import com.yunxi.scm.module.xxjj.convert.productbusiness.ProductBusinessConvert;
import com.yunxi.scm.module.xxjj.service.productbusiness.ProductBusinessService;
@Tag(name = "管理后台 - 商品表和业务线关联关系")
@RestController
@RequestMapping("/xxjj/product-business")
@Validated
public class ProductBusinessController {
@Resource
private ProductBusinessService productBusinessService;
@PostMapping("/create")
@Operation(summary = "创建商品表和业务线关联关系")
@PreAuthorize("@ss.hasPermission('xxjj:product-business:create')")
public CommonResult<Long> createProductBusiness(@Valid @RequestBody ProductBusinessCreateReqVO createReqVO) {
return success(productBusinessService.createProductBusiness(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新商品表和业务线关联关系")
@PreAuthorize("@ss.hasPermission('xxjj:product-business:update')")
public CommonResult<Boolean> updateProductBusiness(@Valid @RequestBody ProductBusinessUpdateReqVO updateReqVO) {
productBusinessService.updateProductBusiness(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除商品表和业务线关联关系")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('xxjj:product-business:delete')")
public CommonResult<Boolean> deleteProductBusiness(@RequestParam("id") Long id) {
productBusinessService.deleteProductBusiness(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得商品表和业务线关联关系")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('xxjj:product-business:query')")
public CommonResult<ProductBusinessRespVO> getProductBusiness(@RequestParam("id") Long id) {
ProductBusinessDO productBusiness = productBusinessService.getProductBusiness(id);
return success(ProductBusinessConvert.INSTANCE.convert(productBusiness));
}
@GetMapping("/list")
@Operation(summary = "获得商品表和业务线关联关系列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('xxjj:product-business:query')")
public CommonResult<List<ProductBusinessRespVO>> getProductBusinessList(@RequestParam("ids") Collection<Long> ids) {
List<ProductBusinessDO> list = productBusinessService.getProductBusinessList(ids);
return success(ProductBusinessConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得商品表和业务线关联关系分页")
@PreAuthorize("@ss.hasPermission('xxjj:product-business:query')")
public CommonResult<PageResult<ProductBusinessRespVO>> getProductBusinessPage(@Valid ProductBusinessPageReqVO pageVO) {
PageResult<ProductBusinessDO> pageResult = productBusinessService.getProductBusinessPage(pageVO);
return success(ProductBusinessConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出商品表和业务线关联关系 Excel")
@PreAuthorize("@ss.hasPermission('xxjj:product-business:export')")
@OperateLog(type = EXPORT)
public void exportProductBusinessExcel(@Valid ProductBusinessExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ProductBusinessDO> list = productBusinessService.getProductBusinessList(exportReqVO);
// 导出 Excel
List<ProductBusinessExcelVO> datas = ProductBusinessConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "商品表和业务线关联关系.xls", "数据", ProductBusinessExcelVO.class, datas);
}
}

@ -0,0 +1,25 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* 线 Base VO VO 使
* VO Swagger
*/
@Data
public class ProductBusinessBaseVO {
@Schema(description = "业务id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6024")
@NotNull(message = "业务id不能为空")
private Long productId;
@Schema(description = "业务线id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27659")
@NotNull(message = "业务线id不能为空")
private Long businessLineId;
}

@ -0,0 +1,14 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 商品表和业务线关联关系创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductBusinessCreateReqVO extends ProductBusinessBaseVO {
}

@ -0,0 +1,31 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 线 Excel VO
*
* @author
*/
@Data
public class ProductBusinessExcelVO {
@ExcelProperty("主键id")
private Long id;
@ExcelProperty("业务id")
private Long productId;
@ExcelProperty("业务线id")
private Long businessLineId;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,26 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品表和业务线关联关系 Excel 导出 Request VO参数和 ProductBusinessPageReqVO 是一致的")
@Data
public class ProductBusinessExportReqVO {
@Schema(description = "业务id", example = "6024")
private Long productId;
@Schema(description = "业务线id", example = "27659")
private Long businessLineId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,28 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品表和业务线关联关系分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductBusinessPageReqVO extends PageParam {
@Schema(description = "业务id", example = "6024")
private Long productId;
@Schema(description = "业务线id", example = "27659")
private Long businessLineId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,19 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 商品表和业务线关联关系 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductBusinessRespVO extends ProductBusinessBaseVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9153")
private Long id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

@ -0,0 +1,18 @@
package com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 商品表和业务线关联关系更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductBusinessUpdateReqVO extends ProductBusinessBaseVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9153")
@NotNull(message = "主键id不能为空")
private Long id;
}

@ -0,0 +1,102 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.common.pojo.CommonResult;
import static com.yunxi.scm.framework.common.pojo.CommonResult.success;
import com.yunxi.scm.framework.excel.core.util.ExcelUtils;
import com.yunxi.scm.framework.operatelog.core.annotations.OperateLog;
import static com.yunxi.scm.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productlabelid.ProductLabelIdDO;
import com.yunxi.scm.module.xxjj.convert.productlabelid.ProductLabelIdConvert;
import com.yunxi.scm.module.xxjj.service.productlabelid.ProductLabelIdService;
@Tag(name = "管理后台 - 商品标签关联关系")
@RestController
@RequestMapping("/xxjj/product-label-id")
@Validated
public class ProductLabelIdController {
@Resource
private ProductLabelIdService productLabelIdService;
@PostMapping("/create")
@Operation(summary = "创建商品标签关联关系")
@PreAuthorize("@ss.hasPermission('xxjj:product-label-id:create')")
public CommonResult<Long> createProductLabelId(@Valid @RequestBody ProductLabelIdCreateReqVO createReqVO) {
return success(productLabelIdService.createProductLabelId(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新商品标签关联关系")
@PreAuthorize("@ss.hasPermission('xxjj:product-label-id:update')")
public CommonResult<Boolean> updateProductLabelId(@Valid @RequestBody ProductLabelIdUpdateReqVO updateReqVO) {
productLabelIdService.updateProductLabelId(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除商品标签关联关系")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('xxjj:product-label-id:delete')")
public CommonResult<Boolean> deleteProductLabelId(@RequestParam("id") Long id) {
productLabelIdService.deleteProductLabelId(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得商品标签关联关系")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('xxjj:product-label-id:query')")
public CommonResult<ProductLabelIdRespVO> getProductLabelId(@RequestParam("id") Long id) {
ProductLabelIdDO productLabelId = productLabelIdService.getProductLabelId(id);
return success(ProductLabelIdConvert.INSTANCE.convert(productLabelId));
}
@GetMapping("/list")
@Operation(summary = "获得商品标签关联关系列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('xxjj:product-label-id:query')")
public CommonResult<List<ProductLabelIdRespVO>> getProductLabelIdList(@RequestParam("ids") Collection<Long> ids) {
List<ProductLabelIdDO> list = productLabelIdService.getProductLabelIdList(ids);
return success(ProductLabelIdConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得商品标签关联关系分页")
@PreAuthorize("@ss.hasPermission('xxjj:product-label-id:query')")
public CommonResult<PageResult<ProductLabelIdRespVO>> getProductLabelIdPage(@Valid ProductLabelIdPageReqVO pageVO) {
PageResult<ProductLabelIdDO> pageResult = productLabelIdService.getProductLabelIdPage(pageVO);
return success(ProductLabelIdConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出商品标签关联关系 Excel")
@PreAuthorize("@ss.hasPermission('xxjj:product-label-id:export')")
@OperateLog(type = EXPORT)
public void exportProductLabelIdExcel(@Valid ProductLabelIdExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ProductLabelIdDO> list = productLabelIdService.getProductLabelIdList(exportReqVO);
// 导出 Excel
List<ProductLabelIdExcelVO> datas = ProductLabelIdConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "商品标签关联关系.xls", "数据", ProductLabelIdExcelVO.class, datas);
}
}

@ -0,0 +1,23 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class ProductLabelIdBaseVO {
@Schema(description = "商品id", example = "23915")
private Long productId;
@Schema(description = "标签id", example = "19298")
private Long labelId;
}

@ -0,0 +1,14 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 商品标签关联关系创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductLabelIdCreateReqVO extends ProductLabelIdBaseVO {
}

@ -0,0 +1,31 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class ProductLabelIdExcelVO {
@ExcelProperty("编号")
private Long id;
@ExcelProperty("商品id")
private Long productId;
@ExcelProperty("标签id")
private Long labelId;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,26 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品标签关联关系 Excel 导出 Request VO参数和 ProductLabelIdPageReqVO 是一致的")
@Data
public class ProductLabelIdExportReqVO {
@Schema(description = "商品id", example = "23915")
private Long productId;
@Schema(description = "标签id", example = "19298")
private Long labelId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,28 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品标签关联关系分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductLabelIdPageReqVO extends PageParam {
@Schema(description = "商品id", example = "23915")
private Long productId;
@Schema(description = "标签id", example = "19298")
private Long labelId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,19 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 商品标签关联关系 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductLabelIdRespVO extends ProductLabelIdBaseVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15723")
private Long id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

@ -0,0 +1,18 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 商品标签关联关系更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductLabelIdUpdateReqVO extends ProductLabelIdBaseVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15723")
@NotNull(message = "编号不能为空")
private Long id;
}

@ -0,0 +1,102 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.common.pojo.CommonResult;
import static com.yunxi.scm.framework.common.pojo.CommonResult.success;
import com.yunxi.scm.framework.excel.core.util.ExcelUtils;
import com.yunxi.scm.framework.operatelog.core.annotations.OperateLog;
import static com.yunxi.scm.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productmodificationitem0.ProductModificationItem0DO;
import com.yunxi.scm.module.xxjj.convert.productmodificationitem0.ProductModificationItem0Convert;
import com.yunxi.scm.module.xxjj.service.productmodificationitem0.ProductModificationItem0Service;
@Tag(name = "管理后台 - 批量修改单商品")
@RestController
@RequestMapping("/xxjj/product-modification-item0")
@Validated
public class ProductModificationItem0Controller {
@Resource
private ProductModificationItem0Service productModificationItem0Service;
@PostMapping("/create")
@Operation(summary = "创建批量修改单商品")
@PreAuthorize("@ss.hasPermission('xxjj:product-modification-item0:create')")
public CommonResult<Long> createProductModificationItem0(@Valid @RequestBody ProductModificationItem0CreateReqVO createReqVO) {
return success(productModificationItem0Service.createProductModificationItem0(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新批量修改单商品")
@PreAuthorize("@ss.hasPermission('xxjj:product-modification-item0:update')")
public CommonResult<Boolean> updateProductModificationItem0(@Valid @RequestBody ProductModificationItem0UpdateReqVO updateReqVO) {
productModificationItem0Service.updateProductModificationItem0(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除批量修改单商品")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('xxjj:product-modification-item0:delete')")
public CommonResult<Boolean> deleteProductModificationItem0(@RequestParam("id") Long id) {
productModificationItem0Service.deleteProductModificationItem0(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得批量修改单商品")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('xxjj:product-modification-item0:query')")
public CommonResult<ProductModificationItem0RespVO> getProductModificationItem0(@RequestParam("id") Long id) {
ProductModificationItem0DO productModificationItem0 = productModificationItem0Service.getProductModificationItem0(id);
return success(ProductModificationItem0Convert.INSTANCE.convert(productModificationItem0));
}
@GetMapping("/list")
@Operation(summary = "获得批量修改单商品列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('xxjj:product-modification-item0:query')")
public CommonResult<List<ProductModificationItem0RespVO>> getProductModificationItem0List(@RequestParam("ids") Collection<Long> ids) {
List<ProductModificationItem0DO> list = productModificationItem0Service.getProductModificationItem0List(ids);
return success(ProductModificationItem0Convert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得批量修改单商品分页")
@PreAuthorize("@ss.hasPermission('xxjj:product-modification-item0:query')")
public CommonResult<PageResult<ProductModificationItem0RespVO>> getProductModificationItem0Page(@Valid ProductModificationItem0PageReqVO pageVO) {
PageResult<ProductModificationItem0DO> pageResult = productModificationItem0Service.getProductModificationItem0Page(pageVO);
return success(ProductModificationItem0Convert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出批量修改单商品 Excel")
@PreAuthorize("@ss.hasPermission('xxjj:product-modification-item0:export')")
@OperateLog(type = EXPORT)
public void exportProductModificationItem0Excel(@Valid ProductModificationItem0ExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ProductModificationItem0DO> list = productModificationItem0Service.getProductModificationItem0List(exportReqVO);
// 导出 Excel
List<ProductModificationItem0ExcelVO> datas = ProductModificationItem0Convert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "批量修改单商品.xls", "数据", ProductModificationItem0ExcelVO.class, datas);
}
}

@ -0,0 +1,20 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class ProductModificationItem0BaseVO {
@Schema(description = "商品id", example = "23297")
private Long productId;
}

@ -0,0 +1,14 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 批量修改单商品创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductModificationItem0CreateReqVO extends ProductModificationItem0BaseVO {
}

@ -0,0 +1,28 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class ProductModificationItem0ExcelVO {
@ExcelProperty("编号")
private Long id;
@ExcelProperty("商品id")
private Long productId;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,23 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 批量修改单商品 Excel 导出 Request VO参数和 ProductModificationItem0PageReqVO 是一致的")
@Data
public class ProductModificationItem0ExportReqVO {
@Schema(description = "商品id", example = "23297")
private Long productId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,25 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 批量修改单商品分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductModificationItem0PageReqVO extends PageParam {
@Schema(description = "商品id", example = "23297")
private Long productId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,19 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 批量修改单商品 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductModificationItem0RespVO extends ProductModificationItem0BaseVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31088")
private Long id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

@ -0,0 +1,18 @@
package com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 批量修改单商品更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductModificationItem0UpdateReqVO extends ProductModificationItem0BaseVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31088")
@NotNull(message = "编号不能为空")
private Long id;
}

@ -0,0 +1,102 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.common.pojo.CommonResult;
import static com.yunxi.scm.framework.common.pojo.CommonResult.success;
import com.yunxi.scm.framework.excel.core.util.ExcelUtils;
import com.yunxi.scm.framework.operatelog.core.annotations.OperateLog;
import static com.yunxi.scm.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productparametervalue.ProductParameterValueDO;
import com.yunxi.scm.module.xxjj.convert.productparametervalue.ProductParameterValueConvert;
import com.yunxi.scm.module.xxjj.service.productparametervalue.ProductParameterValueService;
@Tag(name = "管理后台 - 商品参数值")
@RestController
@RequestMapping("/xxjj/product-parameter-value")
@Validated
public class ProductParameterValueController {
@Resource
private ProductParameterValueService productParameterValueService;
@PostMapping("/create")
@Operation(summary = "创建商品参数值")
@PreAuthorize("@ss.hasPermission('xxjj:product-parameter-value:create')")
public CommonResult<Long> createProductParameterValue(@Valid @RequestBody ProductParameterValueCreateReqVO createReqVO) {
return success(productParameterValueService.createProductParameterValue(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新商品参数值")
@PreAuthorize("@ss.hasPermission('xxjj:product-parameter-value:update')")
public CommonResult<Boolean> updateProductParameterValue(@Valid @RequestBody ProductParameterValueUpdateReqVO updateReqVO) {
productParameterValueService.updateProductParameterValue(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除商品参数值")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('xxjj:product-parameter-value:delete')")
public CommonResult<Boolean> deleteProductParameterValue(@RequestParam("id") Long id) {
productParameterValueService.deleteProductParameterValue(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得商品参数值")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('xxjj:product-parameter-value:query')")
public CommonResult<ProductParameterValueRespVO> getProductParameterValue(@RequestParam("id") Long id) {
ProductParameterValueDO productParameterValue = productParameterValueService.getProductParameterValue(id);
return success(ProductParameterValueConvert.INSTANCE.convert(productParameterValue));
}
@GetMapping("/list")
@Operation(summary = "获得商品参数值列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('xxjj:product-parameter-value:query')")
public CommonResult<List<ProductParameterValueRespVO>> getProductParameterValueList(@RequestParam("ids") Collection<Long> ids) {
List<ProductParameterValueDO> list = productParameterValueService.getProductParameterValueList(ids);
return success(ProductParameterValueConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得商品参数值分页")
@PreAuthorize("@ss.hasPermission('xxjj:product-parameter-value:query')")
public CommonResult<PageResult<ProductParameterValueRespVO>> getProductParameterValuePage(@Valid ProductParameterValuePageReqVO pageVO) {
PageResult<ProductParameterValueDO> pageResult = productParameterValueService.getProductParameterValuePage(pageVO);
return success(ProductParameterValueConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出商品参数值 Excel")
@PreAuthorize("@ss.hasPermission('xxjj:product-parameter-value:export')")
@OperateLog(type = EXPORT)
public void exportProductParameterValueExcel(@Valid ProductParameterValueExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ProductParameterValueDO> list = productParameterValueService.getProductParameterValueList(exportReqVO);
// 导出 Excel
List<ProductParameterValueExcelVO> datas = ProductParameterValueConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "商品参数值.xls", "数据", ProductParameterValueExcelVO.class, datas);
}
}

@ -0,0 +1,23 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class ProductParameterValueBaseVO {
@Schema(description = "主表ID", example = "2958")
private Long parameterId;
@Schema(description = "参数值", example = "李四")
private String parameterName;
}

@ -0,0 +1,14 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 商品参数值创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductParameterValueCreateReqVO extends ProductParameterValueBaseVO {
}

@ -0,0 +1,31 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class ProductParameterValueExcelVO {
@ExcelProperty("ID")
private Long id;
@ExcelProperty("主表ID")
private Long parameterId;
@ExcelProperty("参数值")
private String parameterName;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,26 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品参数值 Excel 导出 Request VO参数和 ProductParameterValuePageReqVO 是一致的")
@Data
public class ProductParameterValueExportReqVO {
@Schema(description = "主表ID", example = "2958")
private Long parameterId;
@Schema(description = "参数值", example = "李四")
private String parameterName;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,28 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品参数值分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductParameterValuePageReqVO extends PageParam {
@Schema(description = "主表ID", example = "2958")
private Long parameterId;
@Schema(description = "参数值", example = "李四")
private String parameterName;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,19 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 商品参数值 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductParameterValueRespVO extends ProductParameterValueBaseVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29318")
private Long id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

@ -0,0 +1,18 @@
package com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 商品参数值更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductParameterValueUpdateReqVO extends ProductParameterValueBaseVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29318")
@NotNull(message = "ID不能为空")
private Long id;
}

@ -0,0 +1,34 @@
package com.yunxi.scm.module.xxjj.convert.productbusiness;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productbusiness.ProductBusinessDO;
/**
* 线 Convert
*
* @author
*/
@Mapper
public interface ProductBusinessConvert {
ProductBusinessConvert INSTANCE = Mappers.getMapper(ProductBusinessConvert.class);
ProductBusinessDO convert(ProductBusinessCreateReqVO bean);
ProductBusinessDO convert(ProductBusinessUpdateReqVO bean);
ProductBusinessRespVO convert(ProductBusinessDO bean);
List<ProductBusinessRespVO> convertList(List<ProductBusinessDO> list);
PageResult<ProductBusinessRespVO> convertPage(PageResult<ProductBusinessDO> page);
List<ProductBusinessExcelVO> convertList02(List<ProductBusinessDO> list);
}

@ -0,0 +1,34 @@
package com.yunxi.scm.module.xxjj.convert.productlabelid;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productlabelid.ProductLabelIdDO;
/**
* Convert
*
* @author
*/
@Mapper
public interface ProductLabelIdConvert {
ProductLabelIdConvert INSTANCE = Mappers.getMapper(ProductLabelIdConvert.class);
ProductLabelIdDO convert(ProductLabelIdCreateReqVO bean);
ProductLabelIdDO convert(ProductLabelIdUpdateReqVO bean);
ProductLabelIdRespVO convert(ProductLabelIdDO bean);
List<ProductLabelIdRespVO> convertList(List<ProductLabelIdDO> list);
PageResult<ProductLabelIdRespVO> convertPage(PageResult<ProductLabelIdDO> page);
List<ProductLabelIdExcelVO> convertList02(List<ProductLabelIdDO> list);
}

@ -0,0 +1,34 @@
package com.yunxi.scm.module.xxjj.convert.productmodificationitem0;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productmodificationitem0.ProductModificationItem0DO;
/**
* Convert
*
* @author
*/
@Mapper
public interface ProductModificationItem0Convert {
ProductModificationItem0Convert INSTANCE = Mappers.getMapper(ProductModificationItem0Convert.class);
ProductModificationItem0DO convert(ProductModificationItem0CreateReqVO bean);
ProductModificationItem0DO convert(ProductModificationItem0UpdateReqVO bean);
ProductModificationItem0RespVO convert(ProductModificationItem0DO bean);
List<ProductModificationItem0RespVO> convertList(List<ProductModificationItem0DO> list);
PageResult<ProductModificationItem0RespVO> convertPage(PageResult<ProductModificationItem0DO> page);
List<ProductModificationItem0ExcelVO> convertList02(List<ProductModificationItem0DO> list);
}

@ -0,0 +1,34 @@
package com.yunxi.scm.module.xxjj.convert.productparametervalue;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productparametervalue.ProductParameterValueDO;
/**
* Convert
*
* @author
*/
@Mapper
public interface ProductParameterValueConvert {
ProductParameterValueConvert INSTANCE = Mappers.getMapper(ProductParameterValueConvert.class);
ProductParameterValueDO convert(ProductParameterValueCreateReqVO bean);
ProductParameterValueDO convert(ProductParameterValueUpdateReqVO bean);
ProductParameterValueRespVO convert(ProductParameterValueDO bean);
List<ProductParameterValueRespVO> convertList(List<ProductParameterValueDO> list);
PageResult<ProductParameterValueRespVO> convertPage(PageResult<ProductParameterValueDO> page);
List<ProductParameterValueExcelVO> convertList02(List<ProductParameterValueDO> list);
}

@ -434,6 +434,9 @@ public class ProductDO extends BaseDO {
@Schema(description = "销售状态")
private String salesStatus;
@Schema(description = "送货选择")
private String deliverMode;
//首选供应商
@TableField(exist = false)
private String supplierName;

@ -0,0 +1,39 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.productbusiness;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
/**
* 线 DO
*
* @author
*/
@TableName("xxjj_product_business")
@KeySequence("xxjj_product_business_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductBusinessDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long productId;
/**
* 线id
*/
private Long businessLineId;
}

@ -0,0 +1,39 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.productlabelid;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("xxjj_product_label_id")
@KeySequence("xxjj_product_label_id_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductLabelIdDO extends BaseDO {
/**
*
*/
@TableId
private Long id;
/**
* id
*/
private Long productId;
/**
* id
*/
private Long labelId;
}

@ -0,0 +1,35 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.productmodificationitem0;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("xxjj_product_modification_item0")
@KeySequence("xxjj_product_modification_item0_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductModificationItem0DO extends BaseDO {
/**
*
*/
@TableId
private Long id;
/**
* id
*/
private Long productId;
}

@ -0,0 +1,39 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.productparametervalue;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("xxjj_product_parameter_value")
@KeySequence("xxjj_product_parameter_value_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductParameterValueDO extends BaseDO {
/**
* ID
*/
@TableId
private Long id;
/**
* ID
*/
private Long parameterId;
/**
*
*/
private String parameterName;
}

@ -0,0 +1,36 @@
package com.yunxi.scm.module.xxjj.dal.mysql.productbusiness;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.scm.module.xxjj.dal.dataobject.productbusiness.ProductBusinessDO;
import org.apache.ibatis.annotations.Mapper;
import com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo.*;
/**
* 线 Mapper
*
* @author
*/
@Mapper
public interface ProductBusinessMapper extends BaseMapperX<ProductBusinessDO> {
default PageResult<ProductBusinessDO> selectPage(ProductBusinessPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProductBusinessDO>()
.eqIfPresent(ProductBusinessDO::getProductId, reqVO.getProductId())
.eqIfPresent(ProductBusinessDO::getBusinessLineId, reqVO.getBusinessLineId())
.betweenIfPresent(ProductBusinessDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductBusinessDO::getId));
}
default List<ProductBusinessDO> selectList(ProductBusinessExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ProductBusinessDO>()
.eqIfPresent(ProductBusinessDO::getProductId, reqVO.getProductId())
.eqIfPresent(ProductBusinessDO::getBusinessLineId, reqVO.getBusinessLineId())
.betweenIfPresent(ProductBusinessDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductBusinessDO::getId));
}
}

@ -0,0 +1,36 @@
package com.yunxi.scm.module.xxjj.dal.mysql.productlabelid;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.scm.module.xxjj.dal.dataobject.productlabelid.ProductLabelIdDO;
import org.apache.ibatis.annotations.Mapper;
import com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ProductLabelIdMapper extends BaseMapperX<ProductLabelIdDO> {
default PageResult<ProductLabelIdDO> selectPage(ProductLabelIdPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProductLabelIdDO>()
.eqIfPresent(ProductLabelIdDO::getProductId, reqVO.getProductId())
.eqIfPresent(ProductLabelIdDO::getLabelId, reqVO.getLabelId())
.betweenIfPresent(ProductLabelIdDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductLabelIdDO::getId));
}
default List<ProductLabelIdDO> selectList(ProductLabelIdExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ProductLabelIdDO>()
.eqIfPresent(ProductLabelIdDO::getProductId, reqVO.getProductId())
.eqIfPresent(ProductLabelIdDO::getLabelId, reqVO.getLabelId())
.betweenIfPresent(ProductLabelIdDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductLabelIdDO::getId));
}
}

@ -0,0 +1,34 @@
package com.yunxi.scm.module.xxjj.dal.mysql.productmodificationitem0;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.scm.module.xxjj.dal.dataobject.productmodificationitem0.ProductModificationItem0DO;
import org.apache.ibatis.annotations.Mapper;
import com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ProductModificationItem0Mapper extends BaseMapperX<ProductModificationItem0DO> {
default PageResult<ProductModificationItem0DO> selectPage(ProductModificationItem0PageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProductModificationItem0DO>()
.eqIfPresent(ProductModificationItem0DO::getProductId, reqVO.getProductId())
.betweenIfPresent(ProductModificationItem0DO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductModificationItem0DO::getId));
}
default List<ProductModificationItem0DO> selectList(ProductModificationItem0ExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ProductModificationItem0DO>()
.eqIfPresent(ProductModificationItem0DO::getProductId, reqVO.getProductId())
.betweenIfPresent(ProductModificationItem0DO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductModificationItem0DO::getId));
}
}

@ -0,0 +1,36 @@
package com.yunxi.scm.module.xxjj.dal.mysql.productparametervalue;
import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.scm.module.xxjj.dal.dataobject.productparametervalue.ProductParameterValueDO;
import org.apache.ibatis.annotations.Mapper;
import com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ProductParameterValueMapper extends BaseMapperX<ProductParameterValueDO> {
default PageResult<ProductParameterValueDO> selectPage(ProductParameterValuePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProductParameterValueDO>()
.eqIfPresent(ProductParameterValueDO::getParameterId, reqVO.getParameterId())
.likeIfPresent(ProductParameterValueDO::getParameterName, reqVO.getParameterName())
.betweenIfPresent(ProductParameterValueDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductParameterValueDO::getId));
}
default List<ProductParameterValueDO> selectList(ProductParameterValueExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ProductParameterValueDO>()
.eqIfPresent(ProductParameterValueDO::getParameterId, reqVO.getParameterId())
.likeIfPresent(ProductParameterValueDO::getParameterName, reqVO.getParameterName())
.betweenIfPresent(ProductParameterValueDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProductParameterValueDO::getId));
}
}

@ -0,0 +1,70 @@
package com.yunxi.scm.module.xxjj.service.productbusiness;
import java.util.*;
import javax.validation.*;
import com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productbusiness.ProductBusinessDO;
import com.yunxi.scm.framework.common.pojo.PageResult;
/**
* 线 Service
*
* @author
*/
public interface ProductBusinessService {
/**
* 线
*
* @param createReqVO
* @return
*/
Long createProductBusiness(@Valid ProductBusinessCreateReqVO createReqVO);
/**
* 线
*
* @param updateReqVO
*/
void updateProductBusiness(@Valid ProductBusinessUpdateReqVO updateReqVO);
/**
* 线
*
* @param id
*/
void deleteProductBusiness(Long id);
/**
* 线
*
* @param id
* @return 线
*/
ProductBusinessDO getProductBusiness(Long id);
/**
* 线
*
* @param ids
* @return 线
*/
List<ProductBusinessDO> getProductBusinessList(Collection<Long> ids);
/**
* 线
*
* @param pageReqVO
* @return 线
*/
PageResult<ProductBusinessDO> getProductBusinessPage(ProductBusinessPageReqVO pageReqVO);
/**
* 线, Excel
*
* @param exportReqVO
* @return 线
*/
List<ProductBusinessDO> getProductBusinessList(ProductBusinessExportReqVO exportReqVO);
}

@ -0,0 +1,82 @@
package com.yunxi.scm.module.xxjj.service.productbusiness;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productbusiness.ProductBusinessDO;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.module.xxjj.convert.productbusiness.ProductBusinessConvert;
import com.yunxi.scm.module.xxjj.dal.mysql.productbusiness.ProductBusinessMapper;
import static com.yunxi.scm.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
/**
* 线 Service
*
* @author
*/
@Service
@Validated
public class ProductBusinessServiceImpl implements ProductBusinessService {
@Resource
private ProductBusinessMapper productBusinessMapper;
@Override
public Long createProductBusiness(ProductBusinessCreateReqVO createReqVO) {
// 插入
ProductBusinessDO productBusiness = ProductBusinessConvert.INSTANCE.convert(createReqVO);
productBusinessMapper.insert(productBusiness);
// 返回
return productBusiness.getId();
}
@Override
public void updateProductBusiness(ProductBusinessUpdateReqVO updateReqVO) {
// 校验存在
validateProductBusinessExists(updateReqVO.getId());
// 更新
ProductBusinessDO updateObj = ProductBusinessConvert.INSTANCE.convert(updateReqVO);
productBusinessMapper.updateById(updateObj);
}
@Override
public void deleteProductBusiness(Long id) {
// 校验存在
validateProductBusinessExists(id);
// 删除
productBusinessMapper.deleteById(id);
}
private void validateProductBusinessExists(Long id) {
if (productBusinessMapper.selectById(id) == null) {
throw exception(PRODUCT_BUSINESS_NOT_EXISTS);
}
}
@Override
public ProductBusinessDO getProductBusiness(Long id) {
return productBusinessMapper.selectById(id);
}
@Override
public List<ProductBusinessDO> getProductBusinessList(Collection<Long> ids) {
return productBusinessMapper.selectBatchIds(ids);
}
@Override
public PageResult<ProductBusinessDO> getProductBusinessPage(ProductBusinessPageReqVO pageReqVO) {
return productBusinessMapper.selectPage(pageReqVO);
}
@Override
public List<ProductBusinessDO> getProductBusinessList(ProductBusinessExportReqVO exportReqVO) {
return productBusinessMapper.selectList(exportReqVO);
}
}

@ -0,0 +1,70 @@
package com.yunxi.scm.module.xxjj.service.productlabelid;
import java.util.*;
import javax.validation.*;
import com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productlabelid.ProductLabelIdDO;
import com.yunxi.scm.framework.common.pojo.PageResult;
/**
* Service
*
* @author
*/
public interface ProductLabelIdService {
/**
*
*
* @param createReqVO
* @return
*/
Long createProductLabelId(@Valid ProductLabelIdCreateReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateProductLabelId(@Valid ProductLabelIdUpdateReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteProductLabelId(Long id);
/**
*
*
* @param id
* @return
*/
ProductLabelIdDO getProductLabelId(Long id);
/**
*
*
* @param ids
* @return
*/
List<ProductLabelIdDO> getProductLabelIdList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<ProductLabelIdDO> getProductLabelIdPage(ProductLabelIdPageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<ProductLabelIdDO> getProductLabelIdList(ProductLabelIdExportReqVO exportReqVO);
}

@ -0,0 +1,82 @@
package com.yunxi.scm.module.xxjj.service.productlabelid;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productlabelid.ProductLabelIdDO;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.module.xxjj.convert.productlabelid.ProductLabelIdConvert;
import com.yunxi.scm.module.xxjj.dal.mysql.productlabelid.ProductLabelIdMapper;
import static com.yunxi.scm.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class ProductLabelIdServiceImpl implements ProductLabelIdService {
@Resource
private ProductLabelIdMapper productLabelIdMapper;
@Override
public Long createProductLabelId(ProductLabelIdCreateReqVO createReqVO) {
// 插入
ProductLabelIdDO productLabelId = ProductLabelIdConvert.INSTANCE.convert(createReqVO);
productLabelIdMapper.insert(productLabelId);
// 返回
return productLabelId.getId();
}
@Override
public void updateProductLabelId(ProductLabelIdUpdateReqVO updateReqVO) {
// 校验存在
validateProductLabelIdExists(updateReqVO.getId());
// 更新
ProductLabelIdDO updateObj = ProductLabelIdConvert.INSTANCE.convert(updateReqVO);
productLabelIdMapper.updateById(updateObj);
}
@Override
public void deleteProductLabelId(Long id) {
// 校验存在
validateProductLabelIdExists(id);
// 删除
productLabelIdMapper.deleteById(id);
}
private void validateProductLabelIdExists(Long id) {
if (productLabelIdMapper.selectById(id) == null) {
throw exception(PRODUCT_LABEL_ID_NOT_EXISTS);
}
}
@Override
public ProductLabelIdDO getProductLabelId(Long id) {
return productLabelIdMapper.selectById(id);
}
@Override
public List<ProductLabelIdDO> getProductLabelIdList(Collection<Long> ids) {
return productLabelIdMapper.selectBatchIds(ids);
}
@Override
public PageResult<ProductLabelIdDO> getProductLabelIdPage(ProductLabelIdPageReqVO pageReqVO) {
return productLabelIdMapper.selectPage(pageReqVO);
}
@Override
public List<ProductLabelIdDO> getProductLabelIdList(ProductLabelIdExportReqVO exportReqVO) {
return productLabelIdMapper.selectList(exportReqVO);
}
}

@ -0,0 +1,70 @@
package com.yunxi.scm.module.xxjj.service.productmodificationitem0;
import java.util.*;
import javax.validation.*;
import com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productmodificationitem0.ProductModificationItem0DO;
import com.yunxi.scm.framework.common.pojo.PageResult;
/**
* Service
*
* @author
*/
public interface ProductModificationItem0Service {
/**
*
*
* @param createReqVO
* @return
*/
Long createProductModificationItem0(@Valid ProductModificationItem0CreateReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateProductModificationItem0(@Valid ProductModificationItem0UpdateReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteProductModificationItem0(Long id);
/**
*
*
* @param id
* @return
*/
ProductModificationItem0DO getProductModificationItem0(Long id);
/**
*
*
* @param ids
* @return
*/
List<ProductModificationItem0DO> getProductModificationItem0List(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<ProductModificationItem0DO> getProductModificationItem0Page(ProductModificationItem0PageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<ProductModificationItem0DO> getProductModificationItem0List(ProductModificationItem0ExportReqVO exportReqVO);
}

@ -0,0 +1,82 @@
package com.yunxi.scm.module.xxjj.service.productmodificationitem0;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productmodificationitem0.ProductModificationItem0DO;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.module.xxjj.convert.productmodificationitem0.ProductModificationItem0Convert;
import com.yunxi.scm.module.xxjj.dal.mysql.productmodificationitem0.ProductModificationItem0Mapper;
import static com.yunxi.scm.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class ProductModificationItem0ServiceImpl implements ProductModificationItem0Service {
@Resource
private ProductModificationItem0Mapper productModificationItem0Mapper;
@Override
public Long createProductModificationItem0(ProductModificationItem0CreateReqVO createReqVO) {
// 插入
ProductModificationItem0DO productModificationItem0 = ProductModificationItem0Convert.INSTANCE.convert(createReqVO);
productModificationItem0Mapper.insert(productModificationItem0);
// 返回
return productModificationItem0.getId();
}
@Override
public void updateProductModificationItem0(ProductModificationItem0UpdateReqVO updateReqVO) {
// 校验存在
validateProductModificationItem0Exists(updateReqVO.getId());
// 更新
ProductModificationItem0DO updateObj = ProductModificationItem0Convert.INSTANCE.convert(updateReqVO);
productModificationItem0Mapper.updateById(updateObj);
}
@Override
public void deleteProductModificationItem0(Long id) {
// 校验存在
validateProductModificationItem0Exists(id);
// 删除
productModificationItem0Mapper.deleteById(id);
}
private void validateProductModificationItem0Exists(Long id) {
if (productModificationItem0Mapper.selectById(id) == null) {
throw exception(PRODUCT_MODIFICATION_ITEM0_NOT_EXISTS);
}
}
@Override
public ProductModificationItem0DO getProductModificationItem0(Long id) {
return productModificationItem0Mapper.selectById(id);
}
@Override
public List<ProductModificationItem0DO> getProductModificationItem0List(Collection<Long> ids) {
return productModificationItem0Mapper.selectBatchIds(ids);
}
@Override
public PageResult<ProductModificationItem0DO> getProductModificationItem0Page(ProductModificationItem0PageReqVO pageReqVO) {
return productModificationItem0Mapper.selectPage(pageReqVO);
}
@Override
public List<ProductModificationItem0DO> getProductModificationItem0List(ProductModificationItem0ExportReqVO exportReqVO) {
return productModificationItem0Mapper.selectList(exportReqVO);
}
}

@ -0,0 +1,70 @@
package com.yunxi.scm.module.xxjj.service.productparametervalue;
import java.util.*;
import javax.validation.*;
import com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productparametervalue.ProductParameterValueDO;
import com.yunxi.scm.framework.common.pojo.PageResult;
/**
* Service
*
* @author
*/
public interface ProductParameterValueService {
/**
*
*
* @param createReqVO
* @return
*/
Long createProductParameterValue(@Valid ProductParameterValueCreateReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateProductParameterValue(@Valid ProductParameterValueUpdateReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteProductParameterValue(Long id);
/**
*
*
* @param id
* @return
*/
ProductParameterValueDO getProductParameterValue(Long id);
/**
*
*
* @param ids
* @return
*/
List<ProductParameterValueDO> getProductParameterValueList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<ProductParameterValueDO> getProductParameterValuePage(ProductParameterValuePageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<ProductParameterValueDO> getProductParameterValueList(ProductParameterValueExportReqVO exportReqVO);
}

@ -0,0 +1,82 @@
package com.yunxi.scm.module.xxjj.service.productparametervalue;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productparametervalue.ProductParameterValueDO;
import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.module.xxjj.convert.productparametervalue.ProductParameterValueConvert;
import com.yunxi.scm.module.xxjj.dal.mysql.productparametervalue.ProductParameterValueMapper;
import static com.yunxi.scm.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class ProductParameterValueServiceImpl implements ProductParameterValueService {
@Resource
private ProductParameterValueMapper productParameterValueMapper;
@Override
public Long createProductParameterValue(ProductParameterValueCreateReqVO createReqVO) {
// 插入
ProductParameterValueDO productParameterValue = ProductParameterValueConvert.INSTANCE.convert(createReqVO);
productParameterValueMapper.insert(productParameterValue);
// 返回
return productParameterValue.getId();
}
@Override
public void updateProductParameterValue(ProductParameterValueUpdateReqVO updateReqVO) {
// 校验存在
validateProductParameterValueExists(updateReqVO.getId());
// 更新
ProductParameterValueDO updateObj = ProductParameterValueConvert.INSTANCE.convert(updateReqVO);
productParameterValueMapper.updateById(updateObj);
}
@Override
public void deleteProductParameterValue(Long id) {
// 校验存在
validateProductParameterValueExists(id);
// 删除
productParameterValueMapper.deleteById(id);
}
private void validateProductParameterValueExists(Long id) {
if (productParameterValueMapper.selectById(id) == null) {
throw exception(PRODUCT_PARAMETER_VALUE_NOT_EXISTS);
}
}
@Override
public ProductParameterValueDO getProductParameterValue(Long id) {
return productParameterValueMapper.selectById(id);
}
@Override
public List<ProductParameterValueDO> getProductParameterValueList(Collection<Long> ids) {
return productParameterValueMapper.selectBatchIds(ids);
}
@Override
public PageResult<ProductParameterValueDO> getProductParameterValuePage(ProductParameterValuePageReqVO pageReqVO) {
return productParameterValueMapper.selectPage(pageReqVO);
}
@Override
public List<ProductParameterValueDO> getProductParameterValueList(ProductParameterValueExportReqVO exportReqVO) {
return productParameterValueMapper.selectList(exportReqVO);
}
}

@ -0,0 +1,12 @@
<?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.yunxi.scm.module.xxjj.dal.mysql.productbusiness.ProductBusinessMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,12 @@
<?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.yunxi.scm.module.xxjj.dal.mysql.productlabelid.ProductLabelIdMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,12 @@
<?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.yunxi.scm.module.xxjj.dal.mysql.productmodificationitem0.ProductModificationItem0Mapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,12 @@
<?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.yunxi.scm.module.xxjj.dal.mysql.productparametervalue.ProductParameterValueMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,167 @@
package com.yunxi.scm.module.xxjj.service.productbusiness;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import javax.annotation.Resource;
import com.yunxi.scm.framework.test.core.ut.BaseDbUnitTest;
import com.yunxi.scm.module.xxjj.controller.admin.productbusiness.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productbusiness.ProductBusinessDO;
import com.yunxi.scm.module.xxjj.dal.mysql.productbusiness.ProductBusinessMapper;
import com.yunxi.scm.framework.common.pojo.PageResult;
import javax.annotation.Resource;
import org.springframework.context.annotation.Import;
import java.util.*;
import java.time.LocalDateTime;
import static cn.hutool.core.util.RandomUtil.*;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
import static com.yunxi.scm.framework.test.core.util.AssertUtils.*;
import static com.yunxi.scm.framework.test.core.util.RandomUtils.*;
import static com.yunxi.scm.framework.common.util.date.LocalDateTimeUtils.*;
import static com.yunxi.scm.framework.common.util.object.ObjectUtils.*;
import static com.yunxi.scm.framework.common.util.date.DateUtils.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;
/**
* {@link ProductBusinessServiceImpl}
*
* @author
*/
@Import(ProductBusinessServiceImpl.class)
public class ProductBusinessServiceImplTest extends BaseDbUnitTest {
@Resource
private ProductBusinessServiceImpl productBusinessService;
@Resource
private ProductBusinessMapper productBusinessMapper;
@Test
public void testCreateProductBusiness_success() {
// 准备参数
ProductBusinessCreateReqVO reqVO = randomPojo(ProductBusinessCreateReqVO.class);
// 调用
Long productBusinessId = productBusinessService.createProductBusiness(reqVO);
// 断言
assertNotNull(productBusinessId);
// 校验记录的属性是否正确
ProductBusinessDO productBusiness = productBusinessMapper.selectById(productBusinessId);
assertPojoEquals(reqVO, productBusiness);
}
@Test
public void testUpdateProductBusiness_success() {
// mock 数据
ProductBusinessDO dbProductBusiness = randomPojo(ProductBusinessDO.class);
productBusinessMapper.insert(dbProductBusiness);// @Sql: 先插入出一条存在的数据
// 准备参数
ProductBusinessUpdateReqVO reqVO = randomPojo(ProductBusinessUpdateReqVO.class, o -> {
o.setId(dbProductBusiness.getId()); // 设置更新的 ID
});
// 调用
productBusinessService.updateProductBusiness(reqVO);
// 校验是否更新正确
ProductBusinessDO productBusiness = productBusinessMapper.selectById(reqVO.getId()); // 获取最新的
assertPojoEquals(reqVO, productBusiness);
}
@Test
public void testUpdateProductBusiness_notExists() {
// 准备参数
ProductBusinessUpdateReqVO reqVO = randomPojo(ProductBusinessUpdateReqVO.class);
// 调用, 并断言异常
assertServiceException(() -> productBusinessService.updateProductBusiness(reqVO), PRODUCT_BUSINESS_NOT_EXISTS);
}
@Test
public void testDeleteProductBusiness_success() {
// mock 数据
ProductBusinessDO dbProductBusiness = randomPojo(ProductBusinessDO.class);
productBusinessMapper.insert(dbProductBusiness);// @Sql: 先插入出一条存在的数据
// 准备参数
Long id = dbProductBusiness.getId();
// 调用
productBusinessService.deleteProductBusiness(id);
// 校验数据不存在了
assertNull(productBusinessMapper.selectById(id));
}
@Test
public void testDeleteProductBusiness_notExists() {
// 准备参数
Long id = randomLongId();
// 调用, 并断言异常
assertServiceException(() -> productBusinessService.deleteProductBusiness(id), PRODUCT_BUSINESS_NOT_EXISTS);
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductBusinessPage() {
// mock 数据
ProductBusinessDO dbProductBusiness = randomPojo(ProductBusinessDO.class, o -> { // 等会查询到
o.setProductId(null);
o.setBusinessLineId(null);
o.setCreateTime(null);
});
productBusinessMapper.insert(dbProductBusiness);
// 测试 productId 不匹配
productBusinessMapper.insert(cloneIgnoreId(dbProductBusiness, o -> o.setProductId(null)));
// 测试 businessLineId 不匹配
productBusinessMapper.insert(cloneIgnoreId(dbProductBusiness, o -> o.setBusinessLineId(null)));
// 测试 createTime 不匹配
productBusinessMapper.insert(cloneIgnoreId(dbProductBusiness, o -> o.setCreateTime(null)));
// 准备参数
ProductBusinessPageReqVO reqVO = new ProductBusinessPageReqVO();
reqVO.setProductId(null);
reqVO.setBusinessLineId(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
PageResult<ProductBusinessDO> pageResult = productBusinessService.getProductBusinessPage(reqVO);
// 断言
assertEquals(1, pageResult.getTotal());
assertEquals(1, pageResult.getList().size());
assertPojoEquals(dbProductBusiness, pageResult.getList().get(0));
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductBusinessList() {
// mock 数据
ProductBusinessDO dbProductBusiness = randomPojo(ProductBusinessDO.class, o -> { // 等会查询到
o.setProductId(null);
o.setBusinessLineId(null);
o.setCreateTime(null);
});
productBusinessMapper.insert(dbProductBusiness);
// 测试 productId 不匹配
productBusinessMapper.insert(cloneIgnoreId(dbProductBusiness, o -> o.setProductId(null)));
// 测试 businessLineId 不匹配
productBusinessMapper.insert(cloneIgnoreId(dbProductBusiness, o -> o.setBusinessLineId(null)));
// 测试 createTime 不匹配
productBusinessMapper.insert(cloneIgnoreId(dbProductBusiness, o -> o.setCreateTime(null)));
// 准备参数
ProductBusinessExportReqVO reqVO = new ProductBusinessExportReqVO();
reqVO.setProductId(null);
reqVO.setBusinessLineId(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
List<ProductBusinessDO> list = productBusinessService.getProductBusinessList(reqVO);
// 断言
assertEquals(1, list.size());
assertPojoEquals(dbProductBusiness, list.get(0));
}
}

@ -0,0 +1,167 @@
package com.yunxi.scm.module.xxjj.service.productlabelid;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import javax.annotation.Resource;
import com.yunxi.scm.framework.test.core.ut.BaseDbUnitTest;
import com.yunxi.scm.module.xxjj.controller.admin.productlabelid.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productlabelid.ProductLabelIdDO;
import com.yunxi.scm.module.xxjj.dal.mysql.productlabelid.ProductLabelIdMapper;
import com.yunxi.scm.framework.common.pojo.PageResult;
import javax.annotation.Resource;
import org.springframework.context.annotation.Import;
import java.util.*;
import java.time.LocalDateTime;
import static cn.hutool.core.util.RandomUtil.*;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
import static com.yunxi.scm.framework.test.core.util.AssertUtils.*;
import static com.yunxi.scm.framework.test.core.util.RandomUtils.*;
import static com.yunxi.scm.framework.common.util.date.LocalDateTimeUtils.*;
import static com.yunxi.scm.framework.common.util.object.ObjectUtils.*;
import static com.yunxi.scm.framework.common.util.date.DateUtils.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;
/**
* {@link ProductLabelIdServiceImpl}
*
* @author
*/
@Import(ProductLabelIdServiceImpl.class)
public class ProductLabelIdServiceImplTest extends BaseDbUnitTest {
@Resource
private ProductLabelIdServiceImpl productLabelIdService;
@Resource
private ProductLabelIdMapper productLabelIdMapper;
@Test
public void testCreateProductLabelId_success() {
// 准备参数
ProductLabelIdCreateReqVO reqVO = randomPojo(ProductLabelIdCreateReqVO.class);
// 调用
Long productLabelIdId = productLabelIdService.createProductLabelId(reqVO);
// 断言
assertNotNull(productLabelIdId);
// 校验记录的属性是否正确
ProductLabelIdDO productLabelId = productLabelIdMapper.selectById(productLabelIdId);
assertPojoEquals(reqVO, productLabelId);
}
@Test
public void testUpdateProductLabelId_success() {
// mock 数据
ProductLabelIdDO dbProductLabelId = randomPojo(ProductLabelIdDO.class);
productLabelIdMapper.insert(dbProductLabelId);// @Sql: 先插入出一条存在的数据
// 准备参数
ProductLabelIdUpdateReqVO reqVO = randomPojo(ProductLabelIdUpdateReqVO.class, o -> {
o.setId(dbProductLabelId.getId()); // 设置更新的 ID
});
// 调用
productLabelIdService.updateProductLabelId(reqVO);
// 校验是否更新正确
ProductLabelIdDO productLabelId = productLabelIdMapper.selectById(reqVO.getId()); // 获取最新的
assertPojoEquals(reqVO, productLabelId);
}
@Test
public void testUpdateProductLabelId_notExists() {
// 准备参数
ProductLabelIdUpdateReqVO reqVO = randomPojo(ProductLabelIdUpdateReqVO.class);
// 调用, 并断言异常
assertServiceException(() -> productLabelIdService.updateProductLabelId(reqVO), PRODUCT_LABEL_ID_NOT_EXISTS);
}
@Test
public void testDeleteProductLabelId_success() {
// mock 数据
ProductLabelIdDO dbProductLabelId = randomPojo(ProductLabelIdDO.class);
productLabelIdMapper.insert(dbProductLabelId);// @Sql: 先插入出一条存在的数据
// 准备参数
Long id = dbProductLabelId.getId();
// 调用
productLabelIdService.deleteProductLabelId(id);
// 校验数据不存在了
assertNull(productLabelIdMapper.selectById(id));
}
@Test
public void testDeleteProductLabelId_notExists() {
// 准备参数
Long id = randomLongId();
// 调用, 并断言异常
assertServiceException(() -> productLabelIdService.deleteProductLabelId(id), PRODUCT_LABEL_ID_NOT_EXISTS);
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductLabelIdPage() {
// mock 数据
ProductLabelIdDO dbProductLabelId = randomPojo(ProductLabelIdDO.class, o -> { // 等会查询到
o.setProductId(null);
o.setLabelId(null);
o.setCreateTime(null);
});
productLabelIdMapper.insert(dbProductLabelId);
// 测试 productId 不匹配
productLabelIdMapper.insert(cloneIgnoreId(dbProductLabelId, o -> o.setProductId(null)));
// 测试 labelId 不匹配
productLabelIdMapper.insert(cloneIgnoreId(dbProductLabelId, o -> o.setLabelId(null)));
// 测试 createTime 不匹配
productLabelIdMapper.insert(cloneIgnoreId(dbProductLabelId, o -> o.setCreateTime(null)));
// 准备参数
ProductLabelIdPageReqVO reqVO = new ProductLabelIdPageReqVO();
reqVO.setProductId(null);
reqVO.setLabelId(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
PageResult<ProductLabelIdDO> pageResult = productLabelIdService.getProductLabelIdPage(reqVO);
// 断言
assertEquals(1, pageResult.getTotal());
assertEquals(1, pageResult.getList().size());
assertPojoEquals(dbProductLabelId, pageResult.getList().get(0));
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductLabelIdList() {
// mock 数据
ProductLabelIdDO dbProductLabelId = randomPojo(ProductLabelIdDO.class, o -> { // 等会查询到
o.setProductId(null);
o.setLabelId(null);
o.setCreateTime(null);
});
productLabelIdMapper.insert(dbProductLabelId);
// 测试 productId 不匹配
productLabelIdMapper.insert(cloneIgnoreId(dbProductLabelId, o -> o.setProductId(null)));
// 测试 labelId 不匹配
productLabelIdMapper.insert(cloneIgnoreId(dbProductLabelId, o -> o.setLabelId(null)));
// 测试 createTime 不匹配
productLabelIdMapper.insert(cloneIgnoreId(dbProductLabelId, o -> o.setCreateTime(null)));
// 准备参数
ProductLabelIdExportReqVO reqVO = new ProductLabelIdExportReqVO();
reqVO.setProductId(null);
reqVO.setLabelId(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
List<ProductLabelIdDO> list = productLabelIdService.getProductLabelIdList(reqVO);
// 断言
assertEquals(1, list.size());
assertPojoEquals(dbProductLabelId, list.get(0));
}
}

@ -0,0 +1,159 @@
package com.yunxi.scm.module.xxjj.service.productmodificationitem0;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import javax.annotation.Resource;
import com.yunxi.scm.framework.test.core.ut.BaseDbUnitTest;
import com.yunxi.scm.module.xxjj.controller.admin.productmodificationitem0.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productmodificationitem0.ProductModificationItem0DO;
import com.yunxi.scm.module.xxjj.dal.mysql.productmodificationitem0.ProductModificationItem0Mapper;
import com.yunxi.scm.framework.common.pojo.PageResult;
import javax.annotation.Resource;
import org.springframework.context.annotation.Import;
import java.util.*;
import java.time.LocalDateTime;
import static cn.hutool.core.util.RandomUtil.*;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
import static com.yunxi.scm.framework.test.core.util.AssertUtils.*;
import static com.yunxi.scm.framework.test.core.util.RandomUtils.*;
import static com.yunxi.scm.framework.common.util.date.LocalDateTimeUtils.*;
import static com.yunxi.scm.framework.common.util.object.ObjectUtils.*;
import static com.yunxi.scm.framework.common.util.date.DateUtils.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;
/**
* {@link ProductModificationItem0ServiceImpl}
*
* @author
*/
@Import(ProductModificationItem0ServiceImpl.class)
public class ProductModificationItem0ServiceImplTest extends BaseDbUnitTest {
@Resource
private ProductModificationItem0ServiceImpl productModificationItem0Service;
@Resource
private ProductModificationItem0Mapper productModificationItem0Mapper;
@Test
public void testCreateProductModificationItem0_success() {
// 准备参数
ProductModificationItem0CreateReqVO reqVO = randomPojo(ProductModificationItem0CreateReqVO.class);
// 调用
Long productModificationItem0Id = productModificationItem0Service.createProductModificationItem0(reqVO);
// 断言
assertNotNull(productModificationItem0Id);
// 校验记录的属性是否正确
ProductModificationItem0DO productModificationItem0 = productModificationItem0Mapper.selectById(productModificationItem0Id);
assertPojoEquals(reqVO, productModificationItem0);
}
@Test
public void testUpdateProductModificationItem0_success() {
// mock 数据
ProductModificationItem0DO dbProductModificationItem0 = randomPojo(ProductModificationItem0DO.class);
productModificationItem0Mapper.insert(dbProductModificationItem0);// @Sql: 先插入出一条存在的数据
// 准备参数
ProductModificationItem0UpdateReqVO reqVO = randomPojo(ProductModificationItem0UpdateReqVO.class, o -> {
o.setId(dbProductModificationItem0.getId()); // 设置更新的 ID
});
// 调用
productModificationItem0Service.updateProductModificationItem0(reqVO);
// 校验是否更新正确
ProductModificationItem0DO productModificationItem0 = productModificationItem0Mapper.selectById(reqVO.getId()); // 获取最新的
assertPojoEquals(reqVO, productModificationItem0);
}
@Test
public void testUpdateProductModificationItem0_notExists() {
// 准备参数
ProductModificationItem0UpdateReqVO reqVO = randomPojo(ProductModificationItem0UpdateReqVO.class);
// 调用, 并断言异常
assertServiceException(() -> productModificationItem0Service.updateProductModificationItem0(reqVO), PRODUCT_MODIFICATION_ITEM0_NOT_EXISTS);
}
@Test
public void testDeleteProductModificationItem0_success() {
// mock 数据
ProductModificationItem0DO dbProductModificationItem0 = randomPojo(ProductModificationItem0DO.class);
productModificationItem0Mapper.insert(dbProductModificationItem0);// @Sql: 先插入出一条存在的数据
// 准备参数
Long id = dbProductModificationItem0.getId();
// 调用
productModificationItem0Service.deleteProductModificationItem0(id);
// 校验数据不存在了
assertNull(productModificationItem0Mapper.selectById(id));
}
@Test
public void testDeleteProductModificationItem0_notExists() {
// 准备参数
Long id = randomLongId();
// 调用, 并断言异常
assertServiceException(() -> productModificationItem0Service.deleteProductModificationItem0(id), PRODUCT_MODIFICATION_ITEM0_NOT_EXISTS);
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductModificationItem0Page() {
// mock 数据
ProductModificationItem0DO dbProductModificationItem0 = randomPojo(ProductModificationItem0DO.class, o -> { // 等会查询到
o.setProductId(null);
o.setCreateTime(null);
});
productModificationItem0Mapper.insert(dbProductModificationItem0);
// 测试 productId 不匹配
productModificationItem0Mapper.insert(cloneIgnoreId(dbProductModificationItem0, o -> o.setProductId(null)));
// 测试 createTime 不匹配
productModificationItem0Mapper.insert(cloneIgnoreId(dbProductModificationItem0, o -> o.setCreateTime(null)));
// 准备参数
ProductModificationItem0PageReqVO reqVO = new ProductModificationItem0PageReqVO();
reqVO.setProductId(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
PageResult<ProductModificationItem0DO> pageResult = productModificationItem0Service.getProductModificationItem0Page(reqVO);
// 断言
assertEquals(1, pageResult.getTotal());
assertEquals(1, pageResult.getList().size());
assertPojoEquals(dbProductModificationItem0, pageResult.getList().get(0));
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductModificationItem0List() {
// mock 数据
ProductModificationItem0DO dbProductModificationItem0 = randomPojo(ProductModificationItem0DO.class, o -> { // 等会查询到
o.setProductId(null);
o.setCreateTime(null);
});
productModificationItem0Mapper.insert(dbProductModificationItem0);
// 测试 productId 不匹配
productModificationItem0Mapper.insert(cloneIgnoreId(dbProductModificationItem0, o -> o.setProductId(null)));
// 测试 createTime 不匹配
productModificationItem0Mapper.insert(cloneIgnoreId(dbProductModificationItem0, o -> o.setCreateTime(null)));
// 准备参数
ProductModificationItem0ExportReqVO reqVO = new ProductModificationItem0ExportReqVO();
reqVO.setProductId(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
List<ProductModificationItem0DO> list = productModificationItem0Service.getProductModificationItem0List(reqVO);
// 断言
assertEquals(1, list.size());
assertPojoEquals(dbProductModificationItem0, list.get(0));
}
}

@ -0,0 +1,167 @@
package com.yunxi.scm.module.xxjj.service.productparametervalue;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import javax.annotation.Resource;
import com.yunxi.scm.framework.test.core.ut.BaseDbUnitTest;
import com.yunxi.scm.module.xxjj.controller.admin.productparametervalue.vo.*;
import com.yunxi.scm.module.xxjj.dal.dataobject.productparametervalue.ProductParameterValueDO;
import com.yunxi.scm.module.xxjj.dal.mysql.productparametervalue.ProductParameterValueMapper;
import com.yunxi.scm.framework.common.pojo.PageResult;
import javax.annotation.Resource;
import org.springframework.context.annotation.Import;
import java.util.*;
import java.time.LocalDateTime;
import static cn.hutool.core.util.RandomUtil.*;
import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*;
import static com.yunxi.scm.framework.test.core.util.AssertUtils.*;
import static com.yunxi.scm.framework.test.core.util.RandomUtils.*;
import static com.yunxi.scm.framework.common.util.date.LocalDateTimeUtils.*;
import static com.yunxi.scm.framework.common.util.object.ObjectUtils.*;
import static com.yunxi.scm.framework.common.util.date.DateUtils.*;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;
/**
* {@link ProductParameterValueServiceImpl}
*
* @author
*/
@Import(ProductParameterValueServiceImpl.class)
public class ProductParameterValueServiceImplTest extends BaseDbUnitTest {
@Resource
private ProductParameterValueServiceImpl productParameterValueService;
@Resource
private ProductParameterValueMapper productParameterValueMapper;
@Test
public void testCreateProductParameterValue_success() {
// 准备参数
ProductParameterValueCreateReqVO reqVO = randomPojo(ProductParameterValueCreateReqVO.class);
// 调用
Long productParameterValueId = productParameterValueService.createProductParameterValue(reqVO);
// 断言
assertNotNull(productParameterValueId);
// 校验记录的属性是否正确
ProductParameterValueDO productParameterValue = productParameterValueMapper.selectById(productParameterValueId);
assertPojoEquals(reqVO, productParameterValue);
}
@Test
public void testUpdateProductParameterValue_success() {
// mock 数据
ProductParameterValueDO dbProductParameterValue = randomPojo(ProductParameterValueDO.class);
productParameterValueMapper.insert(dbProductParameterValue);// @Sql: 先插入出一条存在的数据
// 准备参数
ProductParameterValueUpdateReqVO reqVO = randomPojo(ProductParameterValueUpdateReqVO.class, o -> {
o.setId(dbProductParameterValue.getId()); // 设置更新的 ID
});
// 调用
productParameterValueService.updateProductParameterValue(reqVO);
// 校验是否更新正确
ProductParameterValueDO productParameterValue = productParameterValueMapper.selectById(reqVO.getId()); // 获取最新的
assertPojoEquals(reqVO, productParameterValue);
}
@Test
public void testUpdateProductParameterValue_notExists() {
// 准备参数
ProductParameterValueUpdateReqVO reqVO = randomPojo(ProductParameterValueUpdateReqVO.class);
// 调用, 并断言异常
assertServiceException(() -> productParameterValueService.updateProductParameterValue(reqVO), PRODUCT_PARAMETER_VALUE_NOT_EXISTS);
}
@Test
public void testDeleteProductParameterValue_success() {
// mock 数据
ProductParameterValueDO dbProductParameterValue = randomPojo(ProductParameterValueDO.class);
productParameterValueMapper.insert(dbProductParameterValue);// @Sql: 先插入出一条存在的数据
// 准备参数
Long id = dbProductParameterValue.getId();
// 调用
productParameterValueService.deleteProductParameterValue(id);
// 校验数据不存在了
assertNull(productParameterValueMapper.selectById(id));
}
@Test
public void testDeleteProductParameterValue_notExists() {
// 准备参数
Long id = randomLongId();
// 调用, 并断言异常
assertServiceException(() -> productParameterValueService.deleteProductParameterValue(id), PRODUCT_PARAMETER_VALUE_NOT_EXISTS);
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductParameterValuePage() {
// mock 数据
ProductParameterValueDO dbProductParameterValue = randomPojo(ProductParameterValueDO.class, o -> { // 等会查询到
o.setParameterId(null);
o.setParameterName(null);
o.setCreateTime(null);
});
productParameterValueMapper.insert(dbProductParameterValue);
// 测试 parameterId 不匹配
productParameterValueMapper.insert(cloneIgnoreId(dbProductParameterValue, o -> o.setParameterId(null)));
// 测试 parameterName 不匹配
productParameterValueMapper.insert(cloneIgnoreId(dbProductParameterValue, o -> o.setParameterName(null)));
// 测试 createTime 不匹配
productParameterValueMapper.insert(cloneIgnoreId(dbProductParameterValue, o -> o.setCreateTime(null)));
// 准备参数
ProductParameterValuePageReqVO reqVO = new ProductParameterValuePageReqVO();
reqVO.setParameterId(null);
reqVO.setParameterName(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
PageResult<ProductParameterValueDO> pageResult = productParameterValueService.getProductParameterValuePage(reqVO);
// 断言
assertEquals(1, pageResult.getTotal());
assertEquals(1, pageResult.getList().size());
assertPojoEquals(dbProductParameterValue, pageResult.getList().get(0));
}
@Test
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
public void testGetProductParameterValueList() {
// mock 数据
ProductParameterValueDO dbProductParameterValue = randomPojo(ProductParameterValueDO.class, o -> { // 等会查询到
o.setParameterId(null);
o.setParameterName(null);
o.setCreateTime(null);
});
productParameterValueMapper.insert(dbProductParameterValue);
// 测试 parameterId 不匹配
productParameterValueMapper.insert(cloneIgnoreId(dbProductParameterValue, o -> o.setParameterId(null)));
// 测试 parameterName 不匹配
productParameterValueMapper.insert(cloneIgnoreId(dbProductParameterValue, o -> o.setParameterName(null)));
// 测试 createTime 不匹配
productParameterValueMapper.insert(cloneIgnoreId(dbProductParameterValue, o -> o.setCreateTime(null)));
// 准备参数
ProductParameterValueExportReqVO reqVO = new ProductParameterValueExportReqVO();
reqVO.setParameterId(null);
reqVO.setParameterName(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
// 调用
List<ProductParameterValueDO> list = productParameterValueService.getProductParameterValueList(reqVO);
// 断言
assertEquals(1, list.size());
assertPojoEquals(dbProductParameterValue, list.get(0));
}
}

@ -122,4 +122,9 @@ export const exportProduct = async (params) => {
// 查询商品列表
export const getProductPage1 = async (params) => {
return await request.get({ url: `/xxjj/product/productPage`, params })
}
// 修改状态
export const productUpdateStatuss = async (params) => {
return await request.get({ url: `/xxjj/product/productUpdateStatus`, params })
}

@ -0,0 +1,49 @@
import request from '@/config/axios'
export interface ProductLnventoryUnitVO {
id: number
productUnitName: string
prouctId: number
conversionRules1: string
conversionRules2: string
packagingBarcode: string
dimensionalUnit: string
sizeInformation1: object
sizeInformation2: object
sizeInformation3: object
volumeInformation: object
volumeInformationUnit: string
weight: string
grossWeight: object
net weight: object
}
// 查询商品表库存单位列表
export const getProductLnventoryUnitPage = async (params) => {
return await request.get({ url: `/xxjj/product-lnventory-unit/page`, params })
}
// 查询商品表库存单位详情
export const getProductLnventoryUnit = async (id: number) => {
return await request.get({ url: `/xxjj/product-lnventory-unit/get?id=` + id })
}
// 新增商品表库存单位
export const createProductLnventoryUnit = async (data: ProductLnventoryUnitVO) => {
return await request.post({ url: `/xxjj/product-lnventory-unit/create`, data })
}
// 修改商品表库存单位
export const updateProductLnventoryUnit = async (data: ProductLnventoryUnitVO) => {
return await request.put({ url: `/xxjj/product-lnventory-unit/update`, data })
}
// 删除商品表库存单位
export const deleteProductLnventoryUnit = async (id: number) => {
return await request.delete({ url: `/xxjj/product-lnventory-unit/delete?id=` + id })
}
// 导出商品表库存单位 Excel
export const exportProductLnventoryUnit = async (params) => {
return await request.download({ url: `/xxjj/product-lnventory-unit/export-excel`, params })
}

@ -122,4 +122,4 @@ export const getBusinessCustom = async (params) => {
// 修改状态
export const updateStatus = async (params) => {
return await request.get({ url: `/xxjj/subject-basic/updateStatus`, params })
}
}

@ -239,6 +239,7 @@ export enum DICT_TYPE {
LIFE_CYCLE = 'life_cycle' ,//生命周期
SALES_STATUS = 'sales_status', //商品表销售状态
DELIVETRY_TYPE = 'delivery_type', //配送方式
order_main_unit_id = 'order_main_unit_id', //订货主单位
// ============= CONTRACT 模块=================
CONTRACT_STATUS = 'contract_status', // 合同状态

@ -0,0 +1,185 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<!-- 搜索工作栏 -->
<el-row>
<el-col :span="24">
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-row>
<el-col :span="21">
<el-form-item label="" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入业务线名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<!-- <el-button type="primary" link :icon="Filter" @click="doShowDrawerFilterA(true)"></el-button> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
</el-row>
<el-row>
<el-col :span="24" style="margin: 10px 0px;">
<!-- 列表 -->
<el-table v-loading="loading" :data="list" :border="true" :stripe="true" :show-overflow-tooltip="true"
class="xy-table" @selection-change="handleSelectionChange" >
<el-table-column fixed type="selection" width="40px" />
<el-table-column label="业务线名称" fixed align="center" prop="name" width="150px"/>
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.BUSINESS_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CLASS_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="描述" align="center" prop="description" width="200px"/>
<el-table-column
label="更新时间"
align="center"
prop="updateTime"
:formatter="dateFormatter"
width="150px"
/>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts" name="BusinessWarehouse">
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import * as BusinessWarehouseApi from '@/api/xxjj/businessWarehouse'
const message = useMessage() //
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
businessCode: null,
name: null,
businessSimple: null,
businessLogo: null,
parentId: null,
type: null,
status: null,
institutionNum: null,
employeeNum: null,
industry: null,
city: null,
establishDate: [],
belongUserId: null,
brandName: null,
phone: null,
diffFlag: null,
fax: null,
url: null,
description: null,
createTime: []
})
const queryFormRef = ref() //
const multipleSelection = ref()
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await BusinessWarehouseApi.getBusinessWarehousePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
const emit = defineEmits(['success']) // success
const submitForm = async () => {
console.log('4444444', multipleSelection);
if(multipleSelection.value == undefined || multipleSelection.value.length < 1){
message.error(t('common.createSuccess'))
return
}
//
formLoading.value = true
try {
dialogVisible.value = false
//
emit('confirm', multipleSelection);
} finally {
formLoading.value = false
}
}
/** 打开弹窗 */
const open = async () => {
getList()
dialogVisible.value = true
dialogTitle.value = t('action.' + 'create')
formType.value = 'create'
//
}
defineExpose({ open }) // open
</script>
<style lang="scss">
.xy-table thead {
color: #1D2129;
}
.xy-table thead th.el-table__cell {
background-color: #F7F8FA;
}
.xy-table.is-scrolling-left th.el-table-fixed-column--left {
background-color: #F7F8FA;
}
</style>

@ -0,0 +1,155 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<!-- 搜索工作栏 -->
<el-row>
<el-col :span="24">
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-row>
<el-col :span="21">
<el-form-item label="" prop="brandName">
<el-input v-model="queryParams.brandName" placeholder="请输入品牌" clearable @keyup.enter="handleQuery"
class="!w-240px" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 搜索
</el-button>
<el-button @click="resetQuery">
<Icon icon="ep:refresh" class="mr-5px" /> 重置
</el-button>
<!-- <el-button type="primary" link :icon="Filter" @click="doShowDrawerFilterA(true)"></el-button> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
</el-row>
<el-row>
<el-col :span="24" style="margin: 10px 0px;">
<!-- 列表 -->
<el-table v-loading="loading" :data="list" :border="true" :stripe="true" :show-overflow-tooltip="true"
class="xy-table" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40px" />
<el-table-column label="品牌序号(id)" fixed align="center" prop="id" width="150px" />
<el-table-column label="品牌名称" fixed align="center" prop="brandName" width="150px" />
<el-table-column label="状态" align="center" prop="brandStatus" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.UNIT_STATUS" :value="scope.row.brandStatus" />
</template>
</el-table-column>
<el-table-column label="描述" align="center" prop="description" width="200px" />
<el-table-column label="更新时间" align="center" prop="updateTime" :formatter="dateFormatter" width="150px" />
</el-table>
<!-- 分页 -->
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
@pagination="getList" />
</el-col>
</el-row>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts" name="ProductBrandList">
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProductBrandApi from '@/api/xxjj/productBrand'
const message = useMessage() //
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: null,
brandName: null,
brandPic: null,
brandType: null,
brandDescription: null,
brandStatus: null,
createTime: [],
updateTime: [],
source: null
})
const queryFormRef = ref() //
const multipleSelection = ref()
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProductBrandApi.getProductBrandPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
const emit = defineEmits(['success']) // success
const submitForm = async () => {
if (multipleSelection.value == undefined || multipleSelection.value.length < 1) {
message.error(t('common.createSuccess'))
return
}
//
formLoading.value = true
try {
dialogVisible.value = false
//
emit('confirm', multipleSelection);
} finally {
formLoading.value = false
}
}
/** 打开弹窗 */
const open = async () => {
getList()
dialogVisible.value = true
dialogTitle.value = t('action.' + 'create')
formType.value = 'create'
//
}
defineExpose({ open }) // open
</script>
<style lang="scss">
.xy-table thead {
color: #1D2129;
}
.xy-table thead th.el-table__cell {
background-color: #F7F8FA;
}
.xy-table.is-scrolling-left th.el-table-fixed-column--left {
background-color: #F7F8FA;
}
</style>

@ -0,0 +1,151 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<!-- 搜索工作栏 -->
<el-row>
<el-col :span="24">
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-row>
<el-col :span="21">
<el-form-item label="" prop="brandName">
<el-input v-model="queryParams.brandName" placeholder="请输入品牌" clearable @keyup.enter="handleQuery"
class="!w-240px" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 搜索
</el-button>
<el-button @click="resetQuery">
<Icon icon="ep:refresh" class="mr-5px" /> 重置
</el-button>
<!-- <el-button type="primary" link :icon="Filter" @click="doShowDrawerFilterA(true)"></el-button> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
</el-row>
<el-row>
<el-col :span="24" style="margin: 10px 0px;">
<!-- 列表 -->
<el-table v-loading="loading" :data="list" :border="true" :stripe="true" :show-overflow-tooltip="true"
class="xy-table" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40px" />
<el-table-column label="标签(id)" fixed align="center" prop="id" width="150px" />
<el-table-column label="标签名称" fixed align="center" prop="labelName" width="150px" />
<el-table-column label="标签描述" align="center" prop="remark" width="200px" />
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="150px" />
</el-table>
<!-- 分页 -->
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
@pagination="getList" />
</el-col>
</el-row>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts" name="ProductLabelList">
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProductLabelApi from '@/api/xxjj/productLabel'
const message = useMessage() //
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: null,
labelName: null,
remark: null,
unionNum: null,
labelStatus: null,
sort: null,
brandStatus: null,
createTime: [],
updateTime: [],
})
const queryFormRef = ref() //
const multipleSelection = ref()
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProductLabelApi.getProductLabelPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
const emit = defineEmits(['success']) // success
const submitForm = async () => {
if (multipleSelection.value == undefined || multipleSelection.value.length < 1) {
message.error(t('common.createSuccess'))
return
}
//
formLoading.value = true
try {
dialogVisible.value = false
//
emit('confirm', multipleSelection);
} finally {
formLoading.value = false
}
}
/** 打开弹窗 */
const open = async () => {
getList()
dialogVisible.value = true
dialogTitle.value = t('action.' + 'create')
formType.value = 'create'
//
}
defineExpose({ open }) // open
</script>
<style lang="scss">
.xy-table thead {
color: #1D2129;
}
.xy-table thead th.el-table__cell {
background-color: #F7F8FA;
}
.xy-table.is-scrolling-left th.el-table-fixed-column--left {
background-color: #F7F8FA;
}
</style>

@ -49,7 +49,7 @@
<el-row>
<el-col :span="24">
<el-form-item>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['xxjj:product:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新建商品
</el-button>
@ -79,7 +79,7 @@
<el-col :span="24" style="margin: 10px 0px;">
<el-table v-loading="loading" :data="list" :border="true" :stripe="true" :show-overflow-tooltip="true"
class="xy-table" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40px" />
<el-table-column fixed label="商品名称" prop="name" sortable width="250px">
<template #default="scope">
@ -112,7 +112,7 @@
<el-table-column label="商品规格" align="center" prop="spec" width="150px" />
<el-table-column label="首选供应商" align="center" prop="supplierName" width="150px" sortable/>
<el-table-column label="商品条码" align="center" prop="barCode" width="150px" sortable/>
<el-table-column label="配送方式" align="center" prop="deliveryType" width="150px" sortable>
<template #default="scope">
<dict-tag :type="DICT_TYPE.DELIVETRY_TYPE" :value="scope.row.deliveryType" />
@ -160,16 +160,41 @@
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150px" fixed="right">
<el-table-column label="操作" align="center" width="200px" fixed="right">
<template #default="scope">
<el-button link type="primary" @click="openForm('update', scope.row.id)"
v-hasPermi="['xxjj:product:update']">
编辑
</el-button>
<el-button link type="primary" @click="openFormInfo(scope.row.id)" >
详情
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['xxjj:product:delete']">
删除
</el-button>
<el-button link type="danger" @click="handleEditStatus(scope.row.id, 1)" v-if="scope.row.customerStatus == 1">
提交
</el-button>
<el-button link type="danger" @click="handleEditStatus(scope.row.id, 2)" v-if="scope.row.customerStatus == 2">
审核
</el-button>
<el-button link type="danger" @click="handleEditStatus(scope.row.id, 3)" v-if="scope.row.customerStatus == 3">
核准
</el-button>
<el-button link type="danger" @click="handleEditStatus(scope.row.id, 4)" v-if="scope.row.customerStatus == 4">
启用
</el-button>
<el-button link type="danger" @click="handleEditStatus(scope.row.id, 5)" v-if="scope.row.customerStatus == 5">
禁用
</el-button>
<el-button link type="danger" @click="handleEditStatus(scope.row.id, 6)" v-if="scope.row.customerStatus == 6">
关闭
</el-button>
</template>
</el-table-column>
</el-table>
@ -300,6 +325,7 @@ let queryParams: any = reactive({
reservedFields4: null,
reservedFields5: null,
reservedFields6: null,
deliverMode: null,
createTime: [],
updateTime: [],
})
@ -339,16 +365,24 @@ const resetQuery = () => {
const formRef = ref()
const router = useRouter()
const openForm = (type: string, id?: number) => {
// router.push({ path: '/customer/product-add' })
// formRef.value.open(type, id)
router.push({
path: '/product/product-add',
path: '/shangpingzhongxin/shangp/product-add',
query: {
type: type,
id: id
}
})
}
/** 详情 */
const openFormInfo = (id?: number) => {
router.push({
path: '/shangpingzhongxin/shangp/product-details',
query: {
id: id
}
})
}
/** 删除按钮操作 */
@ -364,6 +398,17 @@ const handleDelete = async (id: number) => {
} catch { }
}
const handleEditStatus = async (id: number, status: number) => {
try {
let param = {id: id,customerStatus: status};
ProductApi.productUpdateStatuss(param)
// message.success('')
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
@ -408,4 +453,4 @@ onMounted(() => {
.xy-table.is-scrolling-left th.el-table-fixed-column--left {
background-color: #F7F8FA;
}
</style>
</style>

File diff suppressed because it is too large Load Diff

@ -124,15 +124,265 @@
<script setup lang="ts" name="ProductDetails">
import InfoProduct from './src/InfoProduct.vue'
// import InfoQualification from './src/InfoQualification.vue'
// import InfoFinancial from './src/InfoFinancial.vue'
// import InfoContract from './src/InfoContract.vue'
// import InfoSaleOrder from './src/InfoSaleOrder.vue'
// import InfoSettlement from './src/InfoSettlement.vue'
// import InfoOperationRecords from './src/InfoOperationRecords.vue'
// import InfoLogging from './src/InfoLogging.vue'
import * as ProductApi from '@/api/xxjj/product'
const activeTabN = ref('tabN1')
const formData:any = ref({
id: undefined,
photo: undefined,
code: undefined,
name: undefined,
productStatus: undefined,
calssifyName: undefined,
productType: undefined,
shortName: undefined,
barCode: undefined,
boxSurfaceNum: undefined,
spec: undefined,
inventoryType: undefined,
brandId: undefined,
area: undefined,
productTypeId: undefined,
areaCategory: undefined,
dangerousFlag: undefined,
importedFlag: undefined,
firstSupplierId: undefined,
settlementEntity: undefined,
outputTaxRate: undefined,
inputTaxRate: undefined,
deliveryType: undefined,
manyUnitFlag: undefined,
inventoryUnitId: undefined,
orderMainUnitId: undefined,
orderOtherUnitId: undefined,
salesMainUnitId: undefined,
salesOtherUnitId: undefined,
operateUnitId: undefined,
pricingUnitId: undefined,
purchaseOrderQuantityDown: undefined,
purchaseOrderQuantityUpper: undefined,
purchaseOrderMultiple: undefined,
purchaseInitialAmount: undefined,
purchaseAllowOverchargingRatio: undefined,
purchaseOrderStart: undefined,
purchaseOrderEnd: undefined,
purchaseMode: undefined,
salesOrderQuantityDown: undefined,
salesOrderQuantityUpper: undefined,
salesOrderMultiple: undefined,
salesInitialAmount: undefined,
salesAllowOverchargingRatio: undefined,
salesStart: undefined,
salesEnd: undefined,
salesModeStart: undefined,
salesMode: undefined,
deliverGoodsDate: undefined,
delayNum: undefined,
safetyStock: undefined,
inventoryDayDown: undefined,
inventoryDayUpper: undefined,
inventoryDown: undefined,
inventoryUpper: undefined,
fixedReplenishmentQuantity: undefined,
availableInventory: undefined,
transitInventory: undefined,
manageInventory: undefined,
fromInventory: undefined,
manageBatches: undefined,
transportStoreyBoardNum: undefined,
transportBoxStoreyNum: undefined,
transportBoxBoardNum: undefined,
transportTemperature: undefined,
transportTemperatureDown: undefined,
transportTemperatureUpper: undefined,
storageStoreyBoardNum: undefined,
storageBoxStoreyNum: undefined,
storageBoxBoardNum: undefined,
storageTemperature: undefined,
storageTemperatureDown: undefined,
storageTemperatureUpper: undefined,
qualityInspectionRatio: undefined,
qualityInspectionFrequency: undefined,
qualityInspectionReport: undefined,
qualityInspectionReportStart: undefined,
qualityInspectionReportEnd: undefined,
qualityControl: undefined,
qualityInspectionStandards: undefined,
remark: undefined,
reservedFields1: undefined,
reservedFields2: undefined,
reservedFields3: undefined,
reservedFields4: undefined,
reservedFields5: undefined,
reservedFields6: undefined,
// brandId: undefined,
brandName: undefined,
deliverMode: undefined,
productbarndList:[],
productLnventoryUnitList:[
{
id: null,
productUnitName: null,
prouctId: null,
conversionRules1: null,
conversionRules2: null,
packagingBarcode: null,
dimensionalUnit: null,
sizeInformation1: null,
sizeInformation2: null,
sizeInformation3: null,
volumeInformation: null,
volumeInformationUnit: null,
weight: null,
grossWeight: null,
netweight: null
},
],
productLabelList:[],
businessWarehouseDOList: []
})
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
photo: undefined,
code: undefined,
name: undefined,
productStatus: undefined,
calssifyName: undefined,
productType: undefined,
shortName: undefined,
barCode: undefined,
boxSurfaceNum: undefined,
spec: undefined,
inventoryType: undefined,
brandId: undefined,
area: undefined,
productTypeId: undefined,
areaCategory: undefined,
dangerousFlag: undefined,
importedFlag: undefined,
firstSupplierId: undefined,
settlementEntity: undefined,
outputTaxRate: undefined,
inputTaxRate: undefined,
deliveryType: undefined,
manyUnitFlag: undefined,
inventoryUnitId: undefined,
orderMainUnitId: undefined,
orderOtherUnitId: undefined,
salesMainUnitId: undefined,
salesOtherUnitId: undefined,
operateUnitId: undefined,
pricingUnitId: undefined,
purchaseOrderQuantityDown: undefined,
purchaseOrderQuantityUpper: undefined,
purchaseOrderMultiple: undefined,
purchaseInitialAmount: undefined,
purchaseAllowOverchargingRatio: undefined,
purchaseOrderStart: undefined,
purchaseOrderEnd: undefined,
purchaseMode: undefined,
salesOrderQuantityDown: undefined,
salesOrderQuantityUpper: undefined,
salesOrderMultiple: undefined,
salesInitialAmount: undefined,
salesAllowOverchargingRatio: undefined,
salesStart: undefined,
salesEnd: undefined,
salesModeStart: undefined,
salesMode: undefined,
deliverGoodsDate: undefined,
delayNum: undefined,
safetyStock: undefined,
inventoryDayDown: undefined,
inventoryDayUpper: undefined,
inventoryDown: undefined,
inventoryUpper: undefined,
fixedReplenishmentQuantity: undefined,
availableInventory: undefined,
transitInventory: undefined,
manageInventory: undefined,
fromInventory: undefined,
manageBatches: undefined,
transportStoreyBoardNum: undefined,
transportBoxStoreyNum: undefined,
transportBoxBoardNum: undefined,
transportTemperature: undefined,
transportTemperatureDown: undefined,
transportTemperatureUpper: undefined,
storageStoreyBoardNum: undefined,
storageBoxStoreyNum: undefined,
storageBoxBoardNum: undefined,
storageTemperature: undefined,
storageTemperatureDown: undefined,
storageTemperatureUpper: undefined,
qualityInspectionRatio: undefined,
qualityInspectionFrequency: undefined,
qualityInspectionReport: undefined,
qualityInspectionReportStart: undefined,
qualityInspectionReportEnd: undefined,
qualityControl: undefined,
qualityInspectionStandards: undefined,
remark: undefined,
reservedFields1: undefined,
reservedFields2: undefined,
reservedFields3: undefined,
reservedFields4: undefined,
reservedFields5: undefined,
reservedFields6: undefined,
// brandId: undefined,
brandName: undefined,
deliverMode: undefined,
productbarndList:[],
productLnventoryUnitList:[
{
id: null,
productUnitName: null,
prouctId: null,
conversionRules1: null,
conversionRules2: null,
packagingBarcode: null,
dimensionalUnit: null,
sizeInformation1: null,
sizeInformation2: null,
sizeInformation3: null,
volumeInformation: null,
volumeInformationUnit: null,
weight: null,
grossWeight: null,
netweight: null
},
],
productLabelList:[],
businessWarehouseDOList: []
}
}
const route = useRoute() //
/** 初始化 */
onMounted(async() => {
const id:any = route.query.id
//
if (id) {
try {
formData.value = await ProductApi.getProduct(id)
debugger
} finally {
}
}else{
}
})
</script>
<style lang="scss">

@ -84,7 +84,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配送方式" prop="deliveryType">
<el-form-item label="配送方式" prop="deliveryType">
<el-select v-model="queryParams.deliveryType" placeholder="请选择" style="width: 100%;">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.DELIVERY_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
@ -129,7 +129,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="开售时间" prop="salesStart">
@ -140,7 +140,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">

Loading…
Cancel
Save