feat:供应商管理代码生成

This commit is contained in:
FCL
2025-12-04 08:58:02 +08:00
parent be89a965d8
commit ae0f0d79c5
39 changed files with 2170 additions and 0 deletions

View File

@@ -166,6 +166,11 @@ public interface ErrorCodeConstants {
/*================================= office 办公 1_032_250_000 ~ 1_032_299_999 ==================================*/
ErrorCode SUPPLIER_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商不存在");
ErrorCode SUPPLIER_PROPERTIES_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商属性不存在");
ErrorCode SUPPLIER_EVALUATION_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价不存在");
ErrorCode SUPPLIER_EVALUATION_AT_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价关系不存在");
/*================================= dzj 大质检 1_032_300_000 ~ 1_032_349_999 ==================================*/

View File

@@ -0,0 +1,119 @@
package com.zt.plat.module.qms.office.supplier.controller.admin;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.qms.office.supplier.controller.vo.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
import com.zt.plat.module.qms.office.supplier.service.SupplierService;
@Tag(name = "管理后台 - 供应商")
@RestController
@RequestMapping("/qms/supplier")
@Validated
@FileUploadController(source = "qms.supplier")
public class SupplierController extends AbstractFileUploadController implements BusinessControllerMarker{
static {
FileUploadController annotation = SupplierController.class.getAnnotation(FileUploadController.class);
if (annotation != null) {
setFileUploadInfo(annotation);
}
}
@Resource
private SupplierService supplierService;
@PostMapping("/create")
@Operation(summary = "创建供应商")
@PreAuthorize("@ss.hasPermission('qms:supplier:create')")
public CommonResult<SupplierRespVO> createSupplier(@Valid @RequestBody SupplierSaveReqVO createReqVO) {
return success(supplierService.createSupplier(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新供应商")
@PreAuthorize("@ss.hasPermission('qms:supplier:update')")
public CommonResult<Boolean> updateSupplier(@Valid @RequestBody SupplierSaveReqVO updateReqVO) {
supplierService.updateSupplier(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除供应商")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('qms:supplier:delete')")
public CommonResult<Boolean> deleteSupplier(@RequestParam("id") Long id) {
supplierService.deleteSupplier(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除供应商")
@PreAuthorize("@ss.hasPermission('qms:supplier:delete')")
public CommonResult<Boolean> deleteSupplierList(@RequestBody BatchDeleteReqVO req) {
supplierService.deleteSupplierListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得供应商")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
public CommonResult<SupplierRespVO> getSupplier(@RequestParam("id") Long id) {
SupplierDO supplier = supplierService.getSupplier(id);
return success(BeanUtils.toBean(supplier, SupplierRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得供应商分页")
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
public CommonResult<PageResult<SupplierRespVO>> getSupplierPage(@Valid SupplierPageReqVO pageReqVO) {
PageResult<SupplierDO> pageResult = supplierService.getSupplierPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, SupplierRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出供应商 Excel")
@PreAuthorize("@ss.hasPermission('qms:supplier:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportSupplierExcel(@Valid SupplierPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<SupplierDO> list = supplierService.getSupplierPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "供应商.xls", "数据", SupplierRespVO.class,
BeanUtils.toBean(list, SupplierRespVO.class));
}
}

View File

@@ -0,0 +1,118 @@
package com.zt.plat.module.qms.office.supplier.controller.admin;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationAtService;
@Tag(name = "管理后台 - 供应商评价关系")
@RestController
@RequestMapping("/qms/supplier-evaluation-at")
@Validated
@FileUploadController(source = "qms.supplierevaluationat")
public class SupplierEvaluationAtController extends AbstractFileUploadController implements BusinessControllerMarker{
static {
FileUploadController annotation = SupplierEvaluationAtController.class.getAnnotation(FileUploadController.class);
if (annotation != null) {
setFileUploadInfo(annotation);
}
}
@Resource
private SupplierEvaluationAtService supplierEvaluationAtService;
@PostMapping("/create")
@Operation(summary = "创建供应商评价关系")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:create')")
public CommonResult<SupplierEvaluationAtRespVO> createSupplierEvaluationAt(@Valid @RequestBody SupplierEvaluationAtSaveReqVO createReqVO) {
return success(supplierEvaluationAtService.createSupplierEvaluationAt(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新供应商评价关系")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:update')")
public CommonResult<Boolean> updateSupplierEvaluationAt(@Valid @RequestBody SupplierEvaluationAtSaveReqVO updateReqVO) {
supplierEvaluationAtService.updateSupplierEvaluationAt(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除供应商评价关系")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:delete')")
public CommonResult<Boolean> deleteSupplierEvaluationAt(@RequestParam("id") Long id) {
supplierEvaluationAtService.deleteSupplierEvaluationAt(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除供应商评价关系")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:delete')")
public CommonResult<Boolean> deleteSupplierEvaluationAtList(@RequestBody BatchDeleteReqVO req) {
supplierEvaluationAtService.deleteSupplierEvaluationAtListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得供应商评价关系")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:query')")
public CommonResult<SupplierEvaluationAtRespVO> getSupplierEvaluationAt(@RequestParam("id") Long id) {
SupplierEvaluationAtDO supplierEvaluationAt = supplierEvaluationAtService.getSupplierEvaluationAt(id);
return success(BeanUtils.toBean(supplierEvaluationAt, SupplierEvaluationAtRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得供应商评价关系分页")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:query')")
public CommonResult<PageResult<SupplierEvaluationAtRespVO>> getSupplierEvaluationAtPage(@Valid SupplierEvaluationAtPageReqVO pageReqVO) {
PageResult<SupplierEvaluationAtDO> pageResult = supplierEvaluationAtService.getSupplierEvaluationAtPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, SupplierEvaluationAtRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出供应商评价关系 Excel")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportSupplierEvaluationAtExcel(@Valid SupplierEvaluationAtPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<SupplierEvaluationAtDO> list = supplierEvaluationAtService.getSupplierEvaluationAtPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "供应商评价关系.xls", "数据", SupplierEvaluationAtRespVO.class,
BeanUtils.toBean(list, SupplierEvaluationAtRespVO.class));
}
}

View File

@@ -0,0 +1,118 @@
package com.zt.plat.module.qms.office.supplier.controller.admin;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationService;
@Tag(name = "管理后台 - 供应商评价")
@RestController
@RequestMapping("/qms/supplier-evaluation")
@Validated
@FileUploadController(source = "qms.supplierevaluation")
public class SupplierEvaluationController extends AbstractFileUploadController implements BusinessControllerMarker{
static {
FileUploadController annotation = SupplierEvaluationController.class.getAnnotation(FileUploadController.class);
if (annotation != null) {
setFileUploadInfo(annotation);
}
}
@Resource
private SupplierEvaluationService supplierEvaluationService;
@PostMapping("/create")
@Operation(summary = "创建供应商评价")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:create')")
public CommonResult<SupplierEvaluationRespVO> createSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) {
return success(supplierEvaluationService.createSupplierEvaluation(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新供应商评价")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:update')")
public CommonResult<Boolean> updateSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO updateReqVO) {
supplierEvaluationService.updateSupplierEvaluation(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除供应商评价")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
public CommonResult<Boolean> deleteSupplierEvaluation(@RequestParam("id") Long id) {
supplierEvaluationService.deleteSupplierEvaluation(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除供应商评价")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
public CommonResult<Boolean> deleteSupplierEvaluationList(@RequestBody BatchDeleteReqVO req) {
supplierEvaluationService.deleteSupplierEvaluationListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得供应商评价")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
public CommonResult<SupplierEvaluationRespVO> getSupplierEvaluation(@RequestParam("id") Long id) {
SupplierEvaluationDO supplierEvaluation = supplierEvaluationService.getSupplierEvaluation(id);
return success(BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得供应商评价分页")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
public CommonResult<PageResult<SupplierEvaluationRespVO>> getSupplierEvaluationPage(@Valid SupplierEvaluationPageReqVO pageReqVO) {
PageResult<SupplierEvaluationDO> pageResult = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, SupplierEvaluationRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出供应商评价 Excel")
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportSupplierEvaluationExcel(@Valid SupplierEvaluationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<SupplierEvaluationDO> list = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "供应商评价.xls", "数据", SupplierEvaluationRespVO.class,
BeanUtils.toBean(list, SupplierEvaluationRespVO.class));
}
}

View File

@@ -0,0 +1,118 @@
package com.zt.plat.module.qms.office.supplier.controller.admin;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
import com.zt.plat.module.qms.office.supplier.service.SupplierPropertiesService;
@Tag(name = "管理后台 - 供应商属性")
@RestController
@RequestMapping("/qms/supplier-properties")
@Validated
@FileUploadController(source = "qms.supplierproperties")
public class SupplierPropertiesController extends AbstractFileUploadController implements BusinessControllerMarker{
static {
FileUploadController annotation = SupplierPropertiesController.class.getAnnotation(FileUploadController.class);
if (annotation != null) {
setFileUploadInfo(annotation);
}
}
@Resource
private SupplierPropertiesService supplierPropertiesService;
@PostMapping("/create")
@Operation(summary = "创建供应商属性")
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')")
public CommonResult<SupplierPropertiesRespVO> createSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO createReqVO) {
return success(supplierPropertiesService.createSupplierProperties(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新供应商属性")
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')")
public CommonResult<Boolean> updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) {
supplierPropertiesService.updateSupplierProperties(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除供应商属性")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')")
public CommonResult<Boolean> deleteSupplierProperties(@RequestParam("id") Long id) {
supplierPropertiesService.deleteSupplierProperties(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除供应商属性")
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')")
public CommonResult<Boolean> deleteSupplierPropertiesList(@RequestBody BatchDeleteReqVO req) {
supplierPropertiesService.deleteSupplierPropertiesListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得供应商属性")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
public CommonResult<SupplierPropertiesRespVO> getSupplierProperties(@RequestParam("id") Long id) {
SupplierPropertiesDO supplierProperties = supplierPropertiesService.getSupplierProperties(id);
return success(BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得供应商属性分页")
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
public CommonResult<PageResult<SupplierPropertiesRespVO>> getSupplierPropertiesPage(@Valid SupplierPropertiesPageReqVO pageReqVO) {
PageResult<SupplierPropertiesDO> pageResult = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, SupplierPropertiesRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出供应商属性 Excel")
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportSupplierPropertiesExcel(@Valid SupplierPropertiesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<SupplierPropertiesDO> list = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "供应商属性.xls", "数据", SupplierPropertiesRespVO.class,
BeanUtils.toBean(list, SupplierPropertiesRespVO.class));
}
}

View File

@@ -0,0 +1,34 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 供应商评价关系分页 Request VO")
@Data
public class SupplierEvaluationAtPageReqVO extends PageParam {
@Schema(description = "评价id", example = "6160")
private Long supplierEvaluationId;
@Schema(description = "目标对象id", example = "24374")
private Long targetId;
@Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", example = "2")
private String targetType;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,42 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 供应商评价关系 Response VO")
@Data
@ExcelIgnoreUnannotated
public class SupplierEvaluationAtRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2684")
@ExcelProperty("ID")
private Long id;
@Schema(description = "评价id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160")
@ExcelProperty("评价id")
private Long supplierEvaluationId;
@Schema(description = "目标对象id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24374")
@ExcelProperty("目标对象id")
private Long targetId;
@Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等")
private String targetType;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,32 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 供应商评价关系新增/修改 Request VO")
@Data
public class SupplierEvaluationAtSaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2684")
private Long id;
@Schema(description = "评价id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160")
@NotNull(message = "评价id不能为空")
private Long supplierEvaluationId;
@Schema(description = "目标对象id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24374")
@NotNull(message = "目标对象id不能为空")
private Long targetId;
@Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等不能为空")
private String targetType;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,53 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 供应商评价分页 Request VO")
@Data
public class SupplierEvaluationPageReqVO extends PageParam {
@Schema(description = "供应商ID", example = "3346")
private Long supplierId;
@Schema(description = "表单模板id", example = "32304")
private Long formId;
@Schema(description = "评价内容")
private String content;
@Schema(description = "评价结论")
private String conclusion;
@Schema(description = "评价人")
private String evaluator;
@Schema(description = "评价人id", example = "25943")
private Long evaluatorId;
@Schema(description = "评价日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] evaluationDate;
@Schema(description = "流程审批状态", example = "2")
private String flowStatus;
@Schema(description = "流程实例id", example = "24931")
private String flowInstanceId;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,66 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 供应商评价 Response VO")
@Data
@ExcelIgnoreUnannotated
public class SupplierEvaluationRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31678")
@ExcelProperty("主键")
private Long id;
@Schema(description = "供应商ID", example = "3346")
@ExcelProperty("供应商ID")
private Long supplierId;
@Schema(description = "表单模板id", example = "32304")
@ExcelProperty("表单模板id")
private Long formId;
@Schema(description = "评价内容")
@ExcelProperty("评价内容")
private String content;
@Schema(description = "评价结论")
@ExcelProperty("评价结论")
private String conclusion;
@Schema(description = "评价人")
@ExcelProperty("评价人")
private String evaluator;
@Schema(description = "评价人id", example = "25943")
@ExcelProperty("评价人id")
private Long evaluatorId;
@Schema(description = "评价日期")
@ExcelProperty("评价日期")
private LocalDateTime evaluationDate;
@Schema(description = "流程审批状态", example = "2")
@ExcelProperty("流程审批状态")
private String flowStatus;
@Schema(description = "流程实例id", example = "24931")
@ExcelProperty("流程实例id")
private String flowInstanceId;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,48 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 供应商评价新增/修改 Request VO")
@Data
public class SupplierEvaluationSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31678")
private Long id;
@Schema(description = "供应商ID", example = "3346")
private Long supplierId;
@Schema(description = "表单模板id", example = "32304")
private Long formId;
@Schema(description = "评价内容")
private String content;
@Schema(description = "评价结论")
private String conclusion;
@Schema(description = "评价人")
private String evaluator;
@Schema(description = "评价人id", example = "25943")
private Long evaluatorId;
@Schema(description = "评价日期")
private LocalDateTime evaluationDate;
@Schema(description = "流程审批状态", example = "2")
private String flowStatus;
@Schema(description = "流程实例id", example = "24931")
private String flowInstanceId;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,49 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 供应商分页 Request VO")
@Data
public class SupplierPageReqVO extends PageParam {
@Schema(description = "供应商名称", example = "张三")
private String name;
@Schema(description = "编号")
private String code;
@Schema(description = "类型", example = "1")
private String type;
@Schema(description = "地址")
private String address;
@Schema(description = "联系人")
private String contact;
@Schema(description = "电话")
private String mobile;
@Schema(description = "经营范围")
private String businessScope;
@Schema(description = "禁用标识")
private String cancelFlag;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,50 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 供应商属性分页 Request VO")
@Data
public class SupplierPropertiesPageReqVO extends PageParam {
@Schema(description = "供应商ID", example = "31214")
private Long supplierId;
@Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1")
private String businessType;
@Schema(description = "业务编码")
private String businessCode;
@Schema(description = "子业务编码")
private String subitemCode;
@Schema(description = "名称", example = "王五")
private String name;
@Schema(description = "有效期开始")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] startDate;
@Schema(description = "有效期截止")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] endDate;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,59 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 供应商属性 Response VO")
@Data
@ExcelIgnoreUnannotated
public class SupplierPropertiesRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22878")
@ExcelProperty("主键")
private Long id;
@Schema(description = "供应商ID", example = "31214")
@ExcelProperty("供应商ID")
private Long supplierId;
@Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1")
@ExcelProperty("业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等")
private String businessType;
@Schema(description = "业务编码")
@ExcelProperty("业务编码")
private String businessCode;
@Schema(description = "子业务编码")
@ExcelProperty("子业务编码")
private String subitemCode;
@Schema(description = "名称", example = "王五")
@ExcelProperty("名称")
private String name;
@Schema(description = "有效期开始")
@ExcelProperty("有效期开始")
private LocalDateTime startDate;
@Schema(description = "有效期截止")
@ExcelProperty("有效期截止")
private LocalDateTime endDate;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 供应商属性新增/修改 Request VO")
@Data
public class SupplierPropertiesSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22878")
private Long id;
@Schema(description = "供应商ID", example = "31214")
private Long supplierId;
@Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1")
private String businessType;
@Schema(description = "业务编码")
private String businessCode;
@Schema(description = "子业务编码")
private String subitemCode;
@Schema(description = "名称", example = "王五")
private String name;
@Schema(description = "有效期开始")
private LocalDateTime startDate;
@Schema(description = "有效期截止")
private LocalDateTime endDate;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,62 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 供应商 Response VO")
@Data
@ExcelIgnoreUnannotated
public class SupplierRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15586")
@ExcelProperty("主键")
private Long id;
@Schema(description = "供应商名称", example = "张三")
@ExcelProperty("供应商名称")
private String name;
@Schema(description = "编号")
@ExcelProperty("编号")
private String code;
@Schema(description = "类型", example = "1")
@ExcelProperty("类型")
private String type;
@Schema(description = "地址")
@ExcelProperty("地址")
private String address;
@Schema(description = "联系人")
@ExcelProperty("联系人")
private String contact;
@Schema(description = "电话")
@ExcelProperty("电话")
private String mobile;
@Schema(description = "经营范围")
@ExcelProperty("经营范围")
private String businessScope;
@Schema(description = "禁用标识")
@ExcelProperty("禁用标识")
private String cancelFlag;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Schema(description = "管理后台 - 供应商新增/修改 Request VO")
@Data
public class SupplierSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15586")
private Long id;
@Schema(description = "供应商名称", example = "张三")
private String name;
@Schema(description = "编号")
private String code;
@Schema(description = "类型", example = "1")
private String type;
@Schema(description = "地址")
private String address;
@Schema(description = "联系人")
private String contact;
@Schema(description = "电话")
private String mobile;
@Schema(description = "经营范围")
private String businessScope;
@Schema(description = "禁用标识")
private String cancelFlag;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,81 @@
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
import lombok.*;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 供应商 DO
*
* @author 后台管理
*/
@TableName("t_splr")
@KeySequence("t_splr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class SupplierDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 供应商名称
*/
@TableField("NAME")
private String name;
/**
* 编号
*/
@TableField("CD")
private String code;
/**
* 类型
*/
@TableField("TP")
private String type;
/**
* 地址
*/
@TableField("ADR")
private String address;
/**
* 联系人
*/
@TableField("CTCT")
private String contact;
/**
* 电话
*/
@TableField("MOB")
private String mobile;
/**
* 经营范围
*/
@TableField("BSN_SCO")
private String businessScope;
//禁用标识
@TableField("CNL_FLG")
private String cancelFlag;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")
private String systemDepartmentCode;
/**
* 备注
*/
@TableField("RMK")
private String remark;
}

View File

@@ -0,0 +1,57 @@
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
import lombok.*;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 供应商评价关系 DO
*
* @author 后台管理
*/
@TableName("t_splr_evl_at")
@KeySequence("t_splr_evl_at_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class SupplierEvaluationAtDO extends BusinessBaseDO {
/**
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 评价id
*/
@TableField("SPLR_EVL_ID")
private Long supplierEvaluationId;
/**
* 目标对象id
*/
@TableField("TGT_ID")
private Long targetId;
/**
* 目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等
*/
@TableField("TGT_TP")
private String targetType;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")
private String systemDepartmentCode;
/**
* 备注
*/
@TableField("RMK")
private String remark;
}

View File

@@ -0,0 +1,90 @@
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
import lombok.*;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 供应商评价 DO
*
* @author 后台管理
*/
@TableName("t_splr_evl")
@KeySequence("t_splr_evl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class SupplierEvaluationDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 供应商ID
*/
@TableField("SPLR_ID")
private Long supplierId;
/**
* 表单模板id
*/
@TableField("FORM_ID")
private Long formId;
/**
* 评价内容
*/
@TableField("CNTT")
private String content;
/**
* 评价结论
*/
@TableField("CNCL")
private String conclusion;
/**
* 评价人
*/
@TableField("EVLR")
private String evaluator;
/**
* 评价人id
*/
@TableField("EVLR_ID")
private Long evaluatorId;
/**
* 评价日期
*/
@TableField("EVL_DT")
private LocalDateTime evaluationDate;
/**
* 流程审批状态
*/
@TableField("FLW_STS")
private String flowStatus;
/**
* 流程实例id
*/
@TableField("FLW_INSC_ID")
private String flowInstanceId;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")
private String systemDepartmentCode;
/**
* 备注
*/
@TableField("RMK")
private String remark;
}

View File

@@ -0,0 +1,81 @@
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
import lombok.*;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 供应商属性 DO
*
* @author 后台管理
*/
@TableName("t_splr_prps")
@KeySequence("t_splr_prps_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class SupplierPropertiesDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 供应商ID
*/
@TableField("SPLR_ID")
private Long supplierId;
/**
* 业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等
*/
@TableField("BSN_TP")
private String businessType;
/**
* 业务编码
*/
@TableField("BSN_CD")
private String businessCode;
/**
* 子业务编码
*/
@TableField("SUB_CD")
private String subitemCode;
/**
* 名称
*/
@TableField("NAME")
private String name;
/**
* 有效期开始
*/
@TableField("STRT_DT")
private LocalDateTime startDate;
/**
* 有效期截止
*/
@TableField("END_DT")
private LocalDateTime endDate;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")
private String systemDepartmentCode;
/**
* 备注
*/
@TableField("RMK")
private String remark;
}

View File

@@ -0,0 +1,29 @@
package com.zt.plat.module.qms.office.supplier.dal.mapper;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
* 供应商评价关系 Mapper
*
* @author 后台管理
*/
@Mapper
public interface SupplierEvaluationAtMapper extends BaseMapperX<SupplierEvaluationAtDO> {
default PageResult<SupplierEvaluationAtDO> selectPage(SupplierEvaluationAtPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierEvaluationAtDO>()
.eqIfPresent(SupplierEvaluationAtDO::getSupplierEvaluationId, reqVO.getSupplierEvaluationId())
.eqIfPresent(SupplierEvaluationAtDO::getTargetId, reqVO.getTargetId())
.eqIfPresent(SupplierEvaluationAtDO::getTargetType, reqVO.getTargetType())
.eqIfPresent(SupplierEvaluationAtDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(SupplierEvaluationAtDO::getRemark, reqVO.getRemark())
.betweenIfPresent(SupplierEvaluationAtDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SupplierEvaluationAtDO::getId));
}
}

View File

@@ -0,0 +1,35 @@
package com.zt.plat.module.qms.office.supplier.dal.mapper;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
* 供应商评价 Mapper
*
* @author 后台管理
*/
@Mapper
public interface SupplierEvaluationMapper extends BaseMapperX<SupplierEvaluationDO> {
default PageResult<SupplierEvaluationDO> selectPage(SupplierEvaluationPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierEvaluationDO>()
.eqIfPresent(SupplierEvaluationDO::getSupplierId, reqVO.getSupplierId())
.eqIfPresent(SupplierEvaluationDO::getFormId, reqVO.getFormId())
.eqIfPresent(SupplierEvaluationDO::getContent, reqVO.getContent())
.eqIfPresent(SupplierEvaluationDO::getConclusion, reqVO.getConclusion())
.eqIfPresent(SupplierEvaluationDO::getEvaluator, reqVO.getEvaluator())
.eqIfPresent(SupplierEvaluationDO::getEvaluatorId, reqVO.getEvaluatorId())
.betweenIfPresent(SupplierEvaluationDO::getEvaluationDate, reqVO.getEvaluationDate())
.eqIfPresent(SupplierEvaluationDO::getFlowStatus, reqVO.getFlowStatus())
.eqIfPresent(SupplierEvaluationDO::getFlowInstanceId, reqVO.getFlowInstanceId())
.eqIfPresent(SupplierEvaluationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(SupplierEvaluationDO::getRemark, reqVO.getRemark())
.betweenIfPresent(SupplierEvaluationDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SupplierEvaluationDO::getId));
}
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.qms.office.supplier.dal.mapper;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
* 供应商 Mapper
*
* @author 后台管理
*/
@Mapper
public interface SupplierMapper extends BaseMapperX<SupplierDO> {
default PageResult<SupplierDO> selectPage(SupplierPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierDO>()
.likeIfPresent(SupplierDO::getName, reqVO.getName())
.eqIfPresent(SupplierDO::getCode, reqVO.getCode())
.eqIfPresent(SupplierDO::getType, reqVO.getType())
.eqIfPresent(SupplierDO::getAddress, reqVO.getAddress())
.eqIfPresent(SupplierDO::getContact, reqVO.getContact())
.eqIfPresent(SupplierDO::getMobile, reqVO.getMobile())
.eqIfPresent(SupplierDO::getBusinessScope, reqVO.getBusinessScope())
.eqIfPresent(SupplierDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(SupplierDO::getRemark, reqVO.getRemark())
.betweenIfPresent(SupplierDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SupplierDO::getId));
}
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.qms.office.supplier.dal.mapper;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
* 供应商属性 Mapper
*
* @author 后台管理
*/
@Mapper
public interface SupplierPropertiesMapper extends BaseMapperX<SupplierPropertiesDO> {
default PageResult<SupplierPropertiesDO> selectPage(SupplierPropertiesPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierPropertiesDO>()
.eqIfPresent(SupplierPropertiesDO::getSupplierId, reqVO.getSupplierId())
.eqIfPresent(SupplierPropertiesDO::getBusinessType, reqVO.getBusinessType())
.eqIfPresent(SupplierPropertiesDO::getBusinessCode, reqVO.getBusinessCode())
.eqIfPresent(SupplierPropertiesDO::getSubitemCode, reqVO.getSubitemCode())
.likeIfPresent(SupplierPropertiesDO::getName, reqVO.getName())
.betweenIfPresent(SupplierPropertiesDO::getStartDate, reqVO.getStartDate())
.betweenIfPresent(SupplierPropertiesDO::getEndDate, reqVO.getEndDate())
.eqIfPresent(SupplierPropertiesDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(SupplierPropertiesDO::getRemark, reqVO.getRemark())
.betweenIfPresent(SupplierPropertiesDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SupplierPropertiesDO::getId));
}
}

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.qms.office.supplier.service;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO;
import jakarta.validation.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
import com.zt.plat.framework.common.pojo.PageResult;
/**
* 供应商评价关系 Service 接口
*
* @author 后台管理
*/
public interface SupplierEvaluationAtService {
/**
* 创建供应商评价关系
*
* @param createReqVO 创建信息
* @return 编号
*/
SupplierEvaluationAtRespVO createSupplierEvaluationAt(@Valid SupplierEvaluationAtSaveReqVO createReqVO);
/**
* 更新供应商评价关系
*
* @param updateReqVO 更新信息
*/
void updateSupplierEvaluationAt(@Valid SupplierEvaluationAtSaveReqVO updateReqVO);
/**
* 删除供应商评价关系
*
* @param id 编号
*/
void deleteSupplierEvaluationAt(Long id);
/**
* 批量删除供应商评价关系
*
* @param ids 编号
*/
void deleteSupplierEvaluationAtListByIds(List<Long> ids);
/**
* 获得供应商评价关系
*
* @param id 编号
* @return 供应商评价关系
*/
SupplierEvaluationAtDO getSupplierEvaluationAt(Long id);
/**
* 获得供应商评价关系分页
*
* @param pageReqVO 分页查询
* @return 供应商评价关系分页
*/
PageResult<SupplierEvaluationAtDO> getSupplierEvaluationAtPage(SupplierEvaluationAtPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,92 @@
package com.zt.plat.module.qms.office.supplier.service;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationAtMapper;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
/**
* 供应商评价关系 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class SupplierEvaluationAtServiceImpl implements SupplierEvaluationAtService {
@Resource
private SupplierEvaluationAtMapper supplierEvaluationAtMapper;
@Override
public SupplierEvaluationAtRespVO createSupplierEvaluationAt(SupplierEvaluationAtSaveReqVO createReqVO) {
// 插入
SupplierEvaluationAtDO supplierEvaluationAt = BeanUtils.toBean(createReqVO, SupplierEvaluationAtDO.class);
supplierEvaluationAtMapper.insert(supplierEvaluationAt);
// 返回
return BeanUtils.toBean(supplierEvaluationAt, SupplierEvaluationAtRespVO.class);
}
@Override
public void updateSupplierEvaluationAt(SupplierEvaluationAtSaveReqVO updateReqVO) {
// 校验存在
validateSupplierEvaluationAtExists(updateReqVO.getId());
// 更新
SupplierEvaluationAtDO updateObj = BeanUtils.toBean(updateReqVO, SupplierEvaluationAtDO.class);
supplierEvaluationAtMapper.updateById(updateObj);
}
@Override
public void deleteSupplierEvaluationAt(Long id) {
// 校验存在
validateSupplierEvaluationAtExists(id);
// 删除
supplierEvaluationAtMapper.deleteById(id);
}
@Override
public void deleteSupplierEvaluationAtListByIds(List<Long> ids) {
// 校验存在
validateSupplierEvaluationAtExists(ids);
// 删除
supplierEvaluationAtMapper.deleteByIds(ids);
}
private void validateSupplierEvaluationAtExists(List<Long> ids) {
List<SupplierEvaluationAtDO> list = supplierEvaluationAtMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(SUPPLIER_EVALUATION_AT_NOT_EXISTS);
}
}
private void validateSupplierEvaluationAtExists(Long id) {
if (supplierEvaluationAtMapper.selectById(id) == null) {
throw exception(SUPPLIER_EVALUATION_AT_NOT_EXISTS);
}
}
@Override
public SupplierEvaluationAtDO getSupplierEvaluationAt(Long id) {
return supplierEvaluationAtMapper.selectById(id);
}
@Override
public PageResult<SupplierEvaluationAtDO> getSupplierEvaluationAtPage(SupplierEvaluationAtPageReqVO pageReqVO) {
return supplierEvaluationAtMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.qms.office.supplier.service;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
import jakarta.validation.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
import com.zt.plat.framework.common.pojo.PageResult;
/**
* 供应商评价 Service 接口
*
* @author 后台管理
*/
public interface SupplierEvaluationService {
/**
* 创建供应商评价
*
* @param createReqVO 创建信息
* @return 编号
*/
SupplierEvaluationRespVO createSupplierEvaluation(@Valid SupplierEvaluationSaveReqVO createReqVO);
/**
* 更新供应商评价
*
* @param updateReqVO 更新信息
*/
void updateSupplierEvaluation(@Valid SupplierEvaluationSaveReqVO updateReqVO);
/**
* 删除供应商评价
*
* @param id 编号
*/
void deleteSupplierEvaluation(Long id);
/**
* 批量删除供应商评价
*
* @param ids 编号
*/
void deleteSupplierEvaluationListByIds(List<Long> ids);
/**
* 获得供应商评价
*
* @param id 编号
* @return 供应商评价
*/
SupplierEvaluationDO getSupplierEvaluation(Long id);
/**
* 获得供应商评价分页
*
* @param pageReqVO 分页查询
* @return 供应商评价分页
*/
PageResult<SupplierEvaluationDO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,92 @@
package com.zt.plat.module.qms.office.supplier.service;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationMapper;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
/**
* 供应商评价 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class SupplierEvaluationServiceImpl implements SupplierEvaluationService {
@Resource
private SupplierEvaluationMapper supplierEvaluationMapper;
@Override
public SupplierEvaluationRespVO createSupplierEvaluation(SupplierEvaluationSaveReqVO createReqVO) {
// 插入
SupplierEvaluationDO supplierEvaluation = BeanUtils.toBean(createReqVO, SupplierEvaluationDO.class);
supplierEvaluationMapper.insert(supplierEvaluation);
// 返回
return BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class);
}
@Override
public void updateSupplierEvaluation(SupplierEvaluationSaveReqVO updateReqVO) {
// 校验存在
validateSupplierEvaluationExists(updateReqVO.getId());
// 更新
SupplierEvaluationDO updateObj = BeanUtils.toBean(updateReqVO, SupplierEvaluationDO.class);
supplierEvaluationMapper.updateById(updateObj);
}
@Override
public void deleteSupplierEvaluation(Long id) {
// 校验存在
validateSupplierEvaluationExists(id);
// 删除
supplierEvaluationMapper.deleteById(id);
}
@Override
public void deleteSupplierEvaluationListByIds(List<Long> ids) {
// 校验存在
validateSupplierEvaluationExists(ids);
// 删除
supplierEvaluationMapper.deleteByIds(ids);
}
private void validateSupplierEvaluationExists(List<Long> ids) {
List<SupplierEvaluationDO> list = supplierEvaluationMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(SUPPLIER_EVALUATION_NOT_EXISTS);
}
}
private void validateSupplierEvaluationExists(Long id) {
if (supplierEvaluationMapper.selectById(id) == null) {
throw exception(SUPPLIER_EVALUATION_NOT_EXISTS);
}
}
@Override
public SupplierEvaluationDO getSupplierEvaluation(Long id) {
return supplierEvaluationMapper.selectById(id);
}
@Override
public PageResult<SupplierEvaluationDO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO) {
return supplierEvaluationMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.qms.office.supplier.service;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO;
import jakarta.validation.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
import com.zt.plat.framework.common.pojo.PageResult;
/**
* 供应商属性 Service 接口
*
* @author 后台管理
*/
public interface SupplierPropertiesService {
/**
* 创建供应商属性
*
* @param createReqVO 创建信息
* @return 编号
*/
SupplierPropertiesRespVO createSupplierProperties(@Valid SupplierPropertiesSaveReqVO createReqVO);
/**
* 更新供应商属性
*
* @param updateReqVO 更新信息
*/
void updateSupplierProperties(@Valid SupplierPropertiesSaveReqVO updateReqVO);
/**
* 删除供应商属性
*
* @param id 编号
*/
void deleteSupplierProperties(Long id);
/**
* 批量删除供应商属性
*
* @param ids 编号
*/
void deleteSupplierPropertiesListByIds(List<Long> ids);
/**
* 获得供应商属性
*
* @param id 编号
* @return 供应商属性
*/
SupplierPropertiesDO getSupplierProperties(Long id);
/**
* 获得供应商属性分页
*
* @param pageReqVO 分页查询
* @return 供应商属性分页
*/
PageResult<SupplierPropertiesDO> getSupplierPropertiesPage(SupplierPropertiesPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,92 @@
package com.zt.plat.module.qms.office.supplier.service;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierPropertiesMapper;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
/**
* 供应商属性 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class SupplierPropertiesServiceImpl implements SupplierPropertiesService {
@Resource
private SupplierPropertiesMapper supplierPropertiesMapper;
@Override
public SupplierPropertiesRespVO createSupplierProperties(SupplierPropertiesSaveReqVO createReqVO) {
// 插入
SupplierPropertiesDO supplierProperties = BeanUtils.toBean(createReqVO, SupplierPropertiesDO.class);
supplierPropertiesMapper.insert(supplierProperties);
// 返回
return BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class);
}
@Override
public void updateSupplierProperties(SupplierPropertiesSaveReqVO updateReqVO) {
// 校验存在
validateSupplierPropertiesExists(updateReqVO.getId());
// 更新
SupplierPropertiesDO updateObj = BeanUtils.toBean(updateReqVO, SupplierPropertiesDO.class);
supplierPropertiesMapper.updateById(updateObj);
}
@Override
public void deleteSupplierProperties(Long id) {
// 校验存在
validateSupplierPropertiesExists(id);
// 删除
supplierPropertiesMapper.deleteById(id);
}
@Override
public void deleteSupplierPropertiesListByIds(List<Long> ids) {
// 校验存在
validateSupplierPropertiesExists(ids);
// 删除
supplierPropertiesMapper.deleteByIds(ids);
}
private void validateSupplierPropertiesExists(List<Long> ids) {
List<SupplierPropertiesDO> list = supplierPropertiesMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(SUPPLIER_PROPERTIES_NOT_EXISTS);
}
}
private void validateSupplierPropertiesExists(Long id) {
if (supplierPropertiesMapper.selectById(id) == null) {
throw exception(SUPPLIER_PROPERTIES_NOT_EXISTS);
}
}
@Override
public SupplierPropertiesDO getSupplierProperties(Long id) {
return supplierPropertiesMapper.selectById(id);
}
@Override
public PageResult<SupplierPropertiesDO> getSupplierPropertiesPage(SupplierPropertiesPageReqVO pageReqVO) {
return supplierPropertiesMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,64 @@
package com.zt.plat.module.qms.office.supplier.service;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
import jakarta.validation.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
import com.zt.plat.framework.common.pojo.PageResult;
/**
* 供应商 Service 接口
*
* @author 后台管理
*/
public interface SupplierService {
/**
* 创建供应商
*
* @param createReqVO 创建信息
* @return 编号
*/
SupplierRespVO createSupplier(@Valid SupplierSaveReqVO createReqVO);
/**
* 更新供应商
*
* @param updateReqVO 更新信息
*/
void updateSupplier(@Valid SupplierSaveReqVO updateReqVO);
/**
* 删除供应商
*
* @param id 编号
*/
void deleteSupplier(Long id);
/**
* 批量删除供应商
*
* @param ids 编号
*/
void deleteSupplierListByIds(List<Long> ids);
/**
* 获得供应商
*
* @param id 编号
* @return 供应商
*/
SupplierDO getSupplier(Long id);
/**
* 获得供应商分页
*
* @param pageReqVO 分页查询
* @return 供应商分页
*/
PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,92 @@
package com.zt.plat.module.qms.office.supplier.service;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierMapper;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
/**
* 供应商 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class SupplierServiceImpl implements SupplierService {
@Resource
private SupplierMapper supplierMapper;
@Override
public SupplierRespVO createSupplier(SupplierSaveReqVO createReqVO) {
// 插入
SupplierDO supplier = BeanUtils.toBean(createReqVO, SupplierDO.class);
supplierMapper.insert(supplier);
// 返回
return BeanUtils.toBean(supplier, SupplierRespVO.class);
}
@Override
public void updateSupplier(SupplierSaveReqVO updateReqVO) {
// 校验存在
validateSupplierExists(updateReqVO.getId());
// 更新
SupplierDO updateObj = BeanUtils.toBean(updateReqVO, SupplierDO.class);
supplierMapper.updateById(updateObj);
}
@Override
public void deleteSupplier(Long id) {
// 校验存在
validateSupplierExists(id);
// 删除
supplierMapper.deleteById(id);
}
@Override
public void deleteSupplierListByIds(List<Long> ids) {
// 校验存在
validateSupplierExists(ids);
// 删除
supplierMapper.deleteByIds(ids);
}
private void validateSupplierExists(List<Long> ids) {
List<SupplierDO> list = supplierMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(SUPPLIER_NOT_EXISTS);
}
}
private void validateSupplierExists(Long id) {
if (supplierMapper.selectById(id) == null) {
throw exception(SUPPLIER_NOT_EXISTS);
}
}
@Override
public SupplierDO getSupplier(Long id) {
return supplierMapper.selectById(id);
}
@Override
public PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO) {
return supplierMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationAtMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierPropertiesMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>