parent
16f3d1ad61
commit
4f1c38bcec
@ -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,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,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,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,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,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,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,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,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);
|
||||
|
||||
}
|
@ -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,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));
|
||||
}
|
||||
|
||||
}
|
@ -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 })
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue