diff --git a/yudao-module-bs/yudao-module-bs-api/src/main/java/cn/iocoder/yudao/module/bs/enums/ErrorCodeConstants.java b/yudao-module-bs/yudao-module-bs-api/src/main/java/cn/iocoder/yudao/module/bs/enums/ErrorCodeConstants.java index 98b27b8c..fb6f1741 100644 --- a/yudao-module-bs/yudao-module-bs-api/src/main/java/cn/iocoder/yudao/module/bs/enums/ErrorCodeConstants.java +++ b/yudao-module-bs/yudao-module-bs-api/src/main/java/cn/iocoder/yudao/module/bs/enums/ErrorCodeConstants.java @@ -16,4 +16,5 @@ public interface ErrorCodeConstants { ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(200600, "客户公司不存在"); ErrorCode EXPENSE_CLAIM_NOT_EXISTS = new ErrorCode(200700, "报销单不存在"); ErrorCode SUPPLIER_COMPANY_NOT_EXISTS = new ErrorCode(202300, "供应商信息不存在"); + ErrorCode QUOTATION_SHEET_NOT_EXISTS = new ErrorCode(202400, "报价单不存在"); } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/QuotationSheetController.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/QuotationSheetController.java new file mode 100644 index 00000000..40b847d1 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/QuotationSheetController.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet; + +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 cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo.*; +import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet.QuotationSheetDO; +import cn.iocoder.yudao.module.bs.convert.quotationsheet.QuotationSheetConvert; +import cn.iocoder.yudao.module.bs.service.quotationsheet.QuotationSheetService; + +@Tag(name = "管理后台 - 报价单") +@RestController +@RequestMapping("/bs/quotation-sheet") +@Validated +public class QuotationSheetController { + + @Resource + private QuotationSheetService quotationSheetService; + + @PostMapping("/create") + @Operation(summary = "创建报价单") + @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:create')") + public CommonResult createQuotationSheet(@Valid @RequestBody QuotationSheetCreateReqVO createReqVO) { + return success(quotationSheetService.createQuotationSheet(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新报价单") + @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:update')") + public CommonResult updateQuotationSheet(@Valid @RequestBody QuotationSheetUpdateReqVO updateReqVO) { + quotationSheetService.updateQuotationSheet(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除报价单") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:delete')") + public CommonResult deleteQuotationSheet(@RequestParam("id") Long id) { + quotationSheetService.deleteQuotationSheet(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得报价单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:query')") + public CommonResult getQuotationSheet(@RequestParam("id") Long id) { + QuotationSheetDO quotationSheet = quotationSheetService.getQuotationSheet(id); + return success(QuotationSheetConvert.INSTANCE.convert(quotationSheet)); + } + + @GetMapping("/list") + @Operation(summary = "获得报价单列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:query')") + public CommonResult> getQuotationSheetList(@RequestParam("ids") Collection ids) { + List list = quotationSheetService.getQuotationSheetList(ids); + return success(QuotationSheetConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得报价单分页") + @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:query')") + public CommonResult> getQuotationSheetPage(@Valid QuotationSheetPageReqVO pageVO) { + PageResult pageResult = quotationSheetService.getQuotationSheetPage(pageVO); + return success(QuotationSheetConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出报价单 Excel") + @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:export')") + @OperateLog(type = EXPORT) + public void exportQuotationSheetExcel(@Valid QuotationSheetExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = quotationSheetService.getQuotationSheetList(exportReqVO); + // 导出 Excel + List datas = QuotationSheetConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "报价单.xls", "数据", QuotationSheetExcelVO.class, datas); + } + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetBaseVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetBaseVO.java new file mode 100644 index 00000000..3e1e78f2 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetBaseVO.java @@ -0,0 +1,109 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import javax.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * 报价单 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class QuotationSheetBaseVO { + + @Schema(description = "备注", example = "你猜") + private String remark; + + @Schema(description = "附件") + private String files; + + @Schema(description = "报价编号") + private String number; + + @Schema(description = "类别(企业内部招标、开放式招标)", example = "2") + private Integer type; + + @Schema(description = "产品名称", example = "张三") + private String productName; + + @Schema(description = "报价截止时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime cutoffTime; + + @Schema(description = "项目id", example = "17259") + private Long projectId; + + @Schema(description = "项目名称", example = "李四") + private String projectName; + + @Schema(description = "发布状态", example = "2") + private Integer releaseStatus; + + @Schema(description = "报价状态", example = "1") + private Integer quotationStatus; + + @Schema(description = "状态", example = "2") + private Integer status; + + @Schema(description = "创建采购单审批流程实例的编号", example = "11202") + private Long processInstanceId; + + @Schema(description = "审核进度") + private Integer auditProgress; + + @Schema(description = "采购进度") + private Integer procurementSchedule; + + @Schema(description = "产品数量") + private Integer productQuantity; + + @Schema(description = "采购类别", example = "11171") + private Long purchasingCategoriesId; + + @Schema(description = "开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime beginTime; + + @Schema(description = "结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime endTime; + + @Schema(description = "采购部门", example = "1979") + private Long sectionId; + + @Schema(description = "交付地址") + private String deliveryAddress; + + @Schema(description = "交付联系人") + private String deliverer; + + @Schema(description = "交付联系人电话") + private String deliveryPhone; + + @Schema(description = "采购内容") + private String purchaseContent; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime applyTime; + + @Schema(description = "申请人") + private Long applicant; + + @Schema(description = "物料id集合") + private String materialIdList; + + @Schema(description = "申请人部门id", example = "10907") + private Long deptId; + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetCreateReqVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetCreateReqVO.java new file mode 100644 index 00000000..d5291f74 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.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 QuotationSheetCreateReqVO extends QuotationSheetBaseVO { + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetExcelVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetExcelVO.java new file mode 100644 index 00000000..4f158c04 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetExcelVO.java @@ -0,0 +1,110 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 报价单 Excel VO + * + * @author 芋道源码 + */ +@Data +public class QuotationSheetExcelVO { + + @ExcelProperty("主键") + private Long id; + + @ExcelProperty("备注") + private String remark; + + @ExcelProperty("附件") + private String files; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty("报价编号") + private String number; + + @ExcelProperty("类别(企业内部招标、开放式招标)") + private Integer type; + + @ExcelProperty("产品名称") + private String productName; + + @ExcelProperty("报价截止时间") + private LocalDateTime cutoffTime; + + @ExcelProperty("项目id") + private Long projectId; + + @ExcelProperty("项目名称") + private String projectName; + + @ExcelProperty("发布状态") + private Integer releaseStatus; + + @ExcelProperty("报价状态") + private Integer quotationStatus; + + @ExcelProperty("状态") + private Integer status; + + @ExcelProperty("创建采购单审批流程实例的编号") + private Long processInstanceId; + + @ExcelProperty("审核进度") + private Integer auditProgress; + + @ExcelProperty("采购进度") + private Integer procurementSchedule; + + @ExcelProperty("产品数量") + private Integer productQuantity; + + @ExcelProperty("采购类别") + private Long purchasingCategoriesId; + + @ExcelProperty("开始时间") + private LocalDateTime beginTime; + + @ExcelProperty("结束时间") + private LocalDateTime endTime; + + @ExcelProperty("采购部门") + private Long sectionId; + + @ExcelProperty("交付地址") + private String deliveryAddress; + + @ExcelProperty("交付联系人") + private String deliverer; + + @ExcelProperty("交付联系人电话") + private String deliveryPhone; + + @ExcelProperty("采购内容") + private String purchaseContent; + + @ExcelProperty("申请时间") + private LocalDateTime applyTime; + + @ExcelProperty("申请人") + private Long applicant; + + @ExcelProperty("物料id集合") + private String materialIdList; + + @ExcelProperty("申请人部门id") + private Long deptId; + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetExportReqVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetExportReqVO.java new file mode 100644 index 00000000..5bff3ba8 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetExportReqVO.java @@ -0,0 +1,105 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 报价单 Excel 导出 Request VO,参数和 QuotationSheetPageReqVO 是一致的") +@Data +public class QuotationSheetExportReqVO { + + @Schema(description = "备注", example = "你猜") + private String remark; + + @Schema(description = "附件") + private String files; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "报价编号") + private String number; + + @Schema(description = "类别(企业内部招标、开放式招标)", example = "2") + private Integer type; + + @Schema(description = "产品名称", example = "张三") + private String productName; + + @Schema(description = "报价截止时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] cutoffTime; + + @Schema(description = "项目id", example = "17259") + private Long projectId; + + @Schema(description = "项目名称", example = "李四") + private String projectName; + + @Schema(description = "发布状态", example = "2") + private Integer releaseStatus; + + @Schema(description = "报价状态", example = "1") + private Integer quotationStatus; + + @Schema(description = "状态", example = "2") + private Integer status; + + @Schema(description = "创建采购单审批流程实例的编号", example = "11202") + private Long processInstanceId; + + @Schema(description = "审核进度") + private Integer auditProgress; + + @Schema(description = "采购进度") + private Integer procurementSchedule; + + @Schema(description = "产品数量") + private Integer productQuantity; + + @Schema(description = "采购类别", example = "11171") + private Long purchasingCategoriesId; + + @Schema(description = "开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] beginTime; + + @Schema(description = "结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] endTime; + + @Schema(description = "采购部门", example = "1979") + private Long sectionId; + + @Schema(description = "交付地址") + private String deliveryAddress; + + @Schema(description = "交付联系人") + private String deliverer; + + @Schema(description = "交付联系人电话") + private String deliveryPhone; + + @Schema(description = "采购内容") + private String purchaseContent; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] applyTime; + + @Schema(description = "申请人") + private Long applicant; + + @Schema(description = "物料id集合") + private String materialIdList; + + @Schema(description = "申请人部门id", example = "10907") + private Long deptId; + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetPageReqVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetPageReqVO.java new file mode 100644 index 00000000..0616e31b --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetPageReqVO.java @@ -0,0 +1,107 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.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 QuotationSheetPageReqVO extends PageParam { + + @Schema(description = "备注", example = "你猜") + private String remark; + + @Schema(description = "附件") + private String files; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "报价编号") + private String number; + + @Schema(description = "类别(企业内部招标、开放式招标)", example = "2") + private Integer type; + + @Schema(description = "产品名称", example = "张三") + private String productName; + + @Schema(description = "报价截止时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] cutoffTime; + + @Schema(description = "项目id", example = "17259") + private Long projectId; + + @Schema(description = "项目名称", example = "李四") + private String projectName; + + @Schema(description = "发布状态", example = "2") + private Integer releaseStatus; + + @Schema(description = "报价状态", example = "1") + private Integer quotationStatus; + + @Schema(description = "状态", example = "2") + private Integer status; + + @Schema(description = "创建采购单审批流程实例的编号", example = "11202") + private Long processInstanceId; + + @Schema(description = "审核进度") + private Integer auditProgress; + + @Schema(description = "采购进度") + private Integer procurementSchedule; + + @Schema(description = "产品数量") + private Integer productQuantity; + + @Schema(description = "采购类别", example = "11171") + private Long purchasingCategoriesId; + + @Schema(description = "开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] beginTime; + + @Schema(description = "结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] endTime; + + @Schema(description = "采购部门", example = "1979") + private Long sectionId; + + @Schema(description = "交付地址") + private String deliveryAddress; + + @Schema(description = "交付联系人") + private String deliverer; + + @Schema(description = "交付联系人电话") + private String deliveryPhone; + + @Schema(description = "采购内容") + private String purchaseContent; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] applyTime; + + @Schema(description = "申请人") + private Long applicant; + + @Schema(description = "物料id集合") + private String materialIdList; + + @Schema(description = "申请人部门id", example = "10907") + private Long deptId; + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetRespVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetRespVO.java new file mode 100644 index 00000000..825bc375 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.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 QuotationSheetRespVO extends QuotationSheetBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28772") + private Long id; + + @Schema(description = "创建时间") + private LocalDateTime createTime; + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetUpdateReqVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetUpdateReqVO.java new file mode 100644 index 00000000..5ac69c27 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/quotationsheet/vo/QuotationSheetUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.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 QuotationSheetUpdateReqVO extends QuotationSheetBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28772") + @NotNull(message = "主键不能为空") + private Long id; + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/convert/quotationsheet/QuotationSheetConvert.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/convert/quotationsheet/QuotationSheetConvert.java new file mode 100644 index 00000000..75ed8f35 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/convert/quotationsheet/QuotationSheetConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.bs.convert.quotationsheet; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo.*; +import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet.QuotationSheetDO; + +/** + * 报价单 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface QuotationSheetConvert { + + QuotationSheetConvert INSTANCE = Mappers.getMapper(QuotationSheetConvert.class); + + QuotationSheetDO convert(QuotationSheetCreateReqVO bean); + + QuotationSheetDO convert(QuotationSheetUpdateReqVO bean); + + QuotationSheetRespVO convert(QuotationSheetDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/quotationsheet/QuotationSheetDO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/quotationsheet/QuotationSheetDO.java new file mode 100644 index 00000000..104ab184 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/quotationsheet/QuotationSheetDO.java @@ -0,0 +1,143 @@ +package cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 报价单 DO + * + * @author 芋道源码 + */ +@TableName("bs_quotation_sheet") +@KeySequence("bs_quotation_sheet_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class QuotationSheetDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 备注 + */ + private String remark; + /** + * 附件 + */ + private String files; + /** + * 报价编号 + */ + private String number; + /** + * 类别(企业内部招标、开放式招标) + */ + private Integer type; + /** + * 产品名称 + */ + private String productName; + /** + * 报价截止时间 + */ + private LocalDateTime cutoffTime; + /** + * 项目id + */ + private Long projectId; + /** + * 项目名称 + */ + private String projectName; + /** + * 发布状态 + */ + private Integer releaseStatus; + /** + * 报价状态 + */ + private Integer quotationStatus; + /** + * 状态 + */ + private Integer status; + /** + * 创建采购单审批流程实例的编号 + */ + private Long processInstanceId; + /** + * 审核进度 + */ + private Integer auditProgress; + /** + * 采购进度 + */ + private Integer procurementSchedule; + /** + * 产品数量 + */ + private Integer productQuantity; + /** + * 采购类别 + */ + private Long purchasingCategoriesId; + /** + * 开始时间 + */ + private LocalDateTime beginTime; + /** + * 结束时间 + */ + private LocalDateTime endTime; + /** + * 采购部门 + */ + private Long sectionId; + /** + * 交付地址 + */ + private String deliveryAddress; + /** + * 交付联系人 + */ + private String deliverer; + /** + * 交付联系人电话 + */ + private String deliveryPhone; + /** + * 采购内容 + */ + private String purchaseContent; + /** + * 申请时间 + */ + private LocalDateTime applyTime; + /** + * 申请人 + */ + private Long applicant; + /** + * 物料id集合 + */ + private String materialIdList; + /** + * 申请人部门id + */ + private Long deptId; + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/suppliercompany/SupplierCompanyDO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/suppliercompany/SupplierCompanyDO.java index 37092e42..bf871a3b 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/suppliercompany/SupplierCompanyDO.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/suppliercompany/SupplierCompanyDO.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.bs.dal.dataobject.suppliercompany; +import cn.iocoder.yudao.framework.common.pojo.ImageVo; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.*; import java.util.*; import java.time.LocalDateTime; @@ -14,7 +16,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; * * @author 芋道源码 */ -@TableName("bs_supplier_company") +@TableName(value = "bs_supplier_company", autoResultMap = true) @KeySequence("bs_supplier_company_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @@ -96,6 +98,7 @@ public class SupplierCompanyDO extends BaseDO { /** * 附件 */ - private String files; + @TableField(typeHandler = JacksonTypeHandler.class) + private List files; } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/mysql/quotationsheet/QuotationSheetMapper.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/mysql/quotationsheet/QuotationSheetMapper.java new file mode 100644 index 00000000..6adcfa6f --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/mysql/quotationsheet/QuotationSheetMapper.java @@ -0,0 +1,86 @@ +package cn.iocoder.yudao.module.bs.dal.mysql.quotationsheet; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet.QuotationSheetDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo.*; + +/** + * 报价单 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface QuotationSheetMapper extends BaseMapperX { + + default PageResult selectPage(QuotationSheetPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(QuotationSheetDO::getRemark, reqVO.getRemark()) + .eqIfPresent(QuotationSheetDO::getFiles, reqVO.getFiles()) + .betweenIfPresent(QuotationSheetDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(QuotationSheetDO::getNumber, reqVO.getNumber()) + .eqIfPresent(QuotationSheetDO::getType, reqVO.getType()) + .likeIfPresent(QuotationSheetDO::getProductName, reqVO.getProductName()) + .betweenIfPresent(QuotationSheetDO::getCutoffTime, reqVO.getCutoffTime()) + .eqIfPresent(QuotationSheetDO::getProjectId, reqVO.getProjectId()) + .likeIfPresent(QuotationSheetDO::getProjectName, reqVO.getProjectName()) + .eqIfPresent(QuotationSheetDO::getReleaseStatus, reqVO.getReleaseStatus()) + .eqIfPresent(QuotationSheetDO::getQuotationStatus, reqVO.getQuotationStatus()) + .eqIfPresent(QuotationSheetDO::getStatus, reqVO.getStatus()) + .eqIfPresent(QuotationSheetDO::getProcessInstanceId, reqVO.getProcessInstanceId()) + .eqIfPresent(QuotationSheetDO::getAuditProgress, reqVO.getAuditProgress()) + .eqIfPresent(QuotationSheetDO::getProcurementSchedule, reqVO.getProcurementSchedule()) + .eqIfPresent(QuotationSheetDO::getProductQuantity, reqVO.getProductQuantity()) + .eqIfPresent(QuotationSheetDO::getPurchasingCategoriesId, reqVO.getPurchasingCategoriesId()) + .betweenIfPresent(QuotationSheetDO::getBeginTime, reqVO.getBeginTime()) + .betweenIfPresent(QuotationSheetDO::getEndTime, reqVO.getEndTime()) + .eqIfPresent(QuotationSheetDO::getSectionId, reqVO.getSectionId()) + .eqIfPresent(QuotationSheetDO::getDeliveryAddress, reqVO.getDeliveryAddress()) + .eqIfPresent(QuotationSheetDO::getDeliverer, reqVO.getDeliverer()) + .eqIfPresent(QuotationSheetDO::getDeliveryPhone, reqVO.getDeliveryPhone()) + .eqIfPresent(QuotationSheetDO::getPurchaseContent, reqVO.getPurchaseContent()) + .betweenIfPresent(QuotationSheetDO::getApplyTime, reqVO.getApplyTime()) + .eqIfPresent(QuotationSheetDO::getApplicant, reqVO.getApplicant()) + .eqIfPresent(QuotationSheetDO::getMaterialIdList, reqVO.getMaterialIdList()) + .eqIfPresent(QuotationSheetDO::getDeptId, reqVO.getDeptId()) + .orderByDesc(QuotationSheetDO::getId)); + } + + default List selectList(QuotationSheetExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(QuotationSheetDO::getRemark, reqVO.getRemark()) + .eqIfPresent(QuotationSheetDO::getFiles, reqVO.getFiles()) + .betweenIfPresent(QuotationSheetDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(QuotationSheetDO::getNumber, reqVO.getNumber()) + .eqIfPresent(QuotationSheetDO::getType, reqVO.getType()) + .likeIfPresent(QuotationSheetDO::getProductName, reqVO.getProductName()) + .betweenIfPresent(QuotationSheetDO::getCutoffTime, reqVO.getCutoffTime()) + .eqIfPresent(QuotationSheetDO::getProjectId, reqVO.getProjectId()) + .likeIfPresent(QuotationSheetDO::getProjectName, reqVO.getProjectName()) + .eqIfPresent(QuotationSheetDO::getReleaseStatus, reqVO.getReleaseStatus()) + .eqIfPresent(QuotationSheetDO::getQuotationStatus, reqVO.getQuotationStatus()) + .eqIfPresent(QuotationSheetDO::getStatus, reqVO.getStatus()) + .eqIfPresent(QuotationSheetDO::getProcessInstanceId, reqVO.getProcessInstanceId()) + .eqIfPresent(QuotationSheetDO::getAuditProgress, reqVO.getAuditProgress()) + .eqIfPresent(QuotationSheetDO::getProcurementSchedule, reqVO.getProcurementSchedule()) + .eqIfPresent(QuotationSheetDO::getProductQuantity, reqVO.getProductQuantity()) + .eqIfPresent(QuotationSheetDO::getPurchasingCategoriesId, reqVO.getPurchasingCategoriesId()) + .betweenIfPresent(QuotationSheetDO::getBeginTime, reqVO.getBeginTime()) + .betweenIfPresent(QuotationSheetDO::getEndTime, reqVO.getEndTime()) + .eqIfPresent(QuotationSheetDO::getSectionId, reqVO.getSectionId()) + .eqIfPresent(QuotationSheetDO::getDeliveryAddress, reqVO.getDeliveryAddress()) + .eqIfPresent(QuotationSheetDO::getDeliverer, reqVO.getDeliverer()) + .eqIfPresent(QuotationSheetDO::getDeliveryPhone, reqVO.getDeliveryPhone()) + .eqIfPresent(QuotationSheetDO::getPurchaseContent, reqVO.getPurchaseContent()) + .betweenIfPresent(QuotationSheetDO::getApplyTime, reqVO.getApplyTime()) + .eqIfPresent(QuotationSheetDO::getApplicant, reqVO.getApplicant()) + .eqIfPresent(QuotationSheetDO::getMaterialIdList, reqVO.getMaterialIdList()) + .eqIfPresent(QuotationSheetDO::getDeptId, reqVO.getDeptId()) + .orderByDesc(QuotationSheetDO::getId)); + } + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetService.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetService.java new file mode 100644 index 00000000..2b0c8217 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.bs.service.quotationsheet; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo.*; +import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet.QuotationSheetDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 报价单 Service 接口 + * + * @author 芋道源码 + */ +public interface QuotationSheetService { + + /** + * 创建报价单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createQuotationSheet(@Valid QuotationSheetCreateReqVO createReqVO); + + /** + * 更新报价单 + * + * @param updateReqVO 更新信息 + */ + void updateQuotationSheet(@Valid QuotationSheetUpdateReqVO updateReqVO); + + /** + * 删除报价单 + * + * @param id 编号 + */ + void deleteQuotationSheet(Long id); + + /** + * 获得报价单 + * + * @param id 编号 + * @return 报价单 + */ + QuotationSheetDO getQuotationSheet(Long id); + + /** + * 获得报价单列表 + * + * @param ids 编号 + * @return 报价单列表 + */ + List getQuotationSheetList(Collection ids); + + /** + * 获得报价单分页 + * + * @param pageReqVO 分页查询 + * @return 报价单分页 + */ + PageResult getQuotationSheetPage(QuotationSheetPageReqVO pageReqVO); + + /** + * 获得报价单列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 报价单列表 + */ + List getQuotationSheetList(QuotationSheetExportReqVO exportReqVO); + +} diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetServiceImpl.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetServiceImpl.java new file mode 100644 index 00000000..422185d5 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/quotationsheet/QuotationSheetServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.bs.service.quotationsheet; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.bs.controller.admin.quotationsheet.vo.*; +import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet.QuotationSheetDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.bs.convert.quotationsheet.QuotationSheetConvert; +import cn.iocoder.yudao.module.bs.dal.mysql.quotationsheet.QuotationSheetMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.*; + +/** + * 报价单 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class QuotationSheetServiceImpl implements QuotationSheetService { + + @Resource + private QuotationSheetMapper quotationSheetMapper; + + @Override + public Long createQuotationSheet(QuotationSheetCreateReqVO createReqVO) { + // 插入 + QuotationSheetDO quotationSheet = QuotationSheetConvert.INSTANCE.convert(createReqVO); + quotationSheetMapper.insert(quotationSheet); + // 返回 + return quotationSheet.getId(); + } + + @Override + public void updateQuotationSheet(QuotationSheetUpdateReqVO updateReqVO) { + // 校验存在 + validateQuotationSheetExists(updateReqVO.getId()); + // 更新 + QuotationSheetDO updateObj = QuotationSheetConvert.INSTANCE.convert(updateReqVO); + quotationSheetMapper.updateById(updateObj); + } + + @Override + public void deleteQuotationSheet(Long id) { + // 校验存在 + validateQuotationSheetExists(id); + // 删除 + quotationSheetMapper.deleteById(id); + } + + private void validateQuotationSheetExists(Long id) { + if (quotationSheetMapper.selectById(id) == null) { + throw exception(QUOTATION_SHEET_NOT_EXISTS); + } + } + + @Override + public QuotationSheetDO getQuotationSheet(Long id) { + return quotationSheetMapper.selectById(id); + } + + @Override + public List getQuotationSheetList(Collection ids) { + return quotationSheetMapper.selectBatchIds(ids); + } + + @Override + public PageResult getQuotationSheetPage(QuotationSheetPageReqVO pageReqVO) { + return quotationSheetMapper.selectPage(pageReqVO); + } + + @Override + public List getQuotationSheetList(QuotationSheetExportReqVO exportReqVO) { + return quotationSheetMapper.selectList(exportReqVO); + } + +}