Merge remote-tracking branch 'origin/master'

new
Agoni 1 year ago
commit b9e1f6a0b4

@ -16,4 +16,5 @@ public interface ErrorCodeConstants {
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(200600, "客户公司不存在"); ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(200600, "客户公司不存在");
ErrorCode EXPENSE_CLAIM_NOT_EXISTS = new ErrorCode(200700, "报销单不存在"); ErrorCode EXPENSE_CLAIM_NOT_EXISTS = new ErrorCode(200700, "报销单不存在");
ErrorCode SUPPLIER_COMPANY_NOT_EXISTS = new ErrorCode(202300, "供应商信息不存在"); ErrorCode SUPPLIER_COMPANY_NOT_EXISTS = new ErrorCode(202300, "供应商信息不存在");
ErrorCode QUOTATION_SHEET_NOT_EXISTS = new ErrorCode(202400, "报价单不存在");
} }

@ -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<Long> createQuotationSheet(@Valid @RequestBody QuotationSheetCreateReqVO createReqVO) {
return success(quotationSheetService.createQuotationSheet(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新报价单")
@PreAuthorize("@ss.hasPermission('bs:quotation-sheet:update')")
public CommonResult<Boolean> 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<Boolean> 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<QuotationSheetRespVO> 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<List<QuotationSheetRespVO>> getQuotationSheetList(@RequestParam("ids") Collection<Long> ids) {
List<QuotationSheetDO> list = quotationSheetService.getQuotationSheetList(ids);
return success(QuotationSheetConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得报价单分页")
@PreAuthorize("@ss.hasPermission('bs:quotation-sheet:query')")
public CommonResult<PageResult<QuotationSheetRespVO>> getQuotationSheetPage(@Valid QuotationSheetPageReqVO pageVO) {
PageResult<QuotationSheetDO> 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<QuotationSheetDO> list = quotationSheetService.getQuotationSheetList(exportReqVO);
// 导出 Excel
List<QuotationSheetExcelVO> datas = QuotationSheetConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "报价单.xls", "数据", QuotationSheetExcelVO.class, datas);
}
}

@ -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;
}

@ -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 {
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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<QuotationSheetRespVO> convertList(List<QuotationSheetDO> list);
PageResult<QuotationSheetRespVO> convertPage(PageResult<QuotationSheetDO> page);
List<QuotationSheetExcelVO> convertList02(List<QuotationSheetDO> list);
}

@ -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;
}

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.bs.dal.dataobject.suppliercompany; 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 lombok.*;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -14,7 +16,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
* *
* @author * @author
*/ */
@TableName("bs_supplier_company") @TableName(value = "bs_supplier_company", autoResultMap = true)
@KeySequence("bs_supplier_company_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @KeySequence("bs_supplier_company_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ -96,6 +98,7 @@ public class SupplierCompanyDO extends BaseDO {
/** /**
* *
*/ */
private String files; @TableField(typeHandler = JacksonTypeHandler.class)
private List<ImageVo> files;
} }

@ -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<QuotationSheetDO> {
default PageResult<QuotationSheetDO> selectPage(QuotationSheetPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<QuotationSheetDO>()
.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<QuotationSheetDO> selectList(QuotationSheetExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<QuotationSheetDO>()
.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));
}
}

@ -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<QuotationSheetDO> getQuotationSheetList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<QuotationSheetDO> getQuotationSheetPage(QuotationSheetPageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<QuotationSheetDO> getQuotationSheetList(QuotationSheetExportReqVO exportReqVO);
}

@ -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<QuotationSheetDO> getQuotationSheetList(Collection<Long> ids) {
return quotationSheetMapper.selectBatchIds(ids);
}
@Override
public PageResult<QuotationSheetDO> getQuotationSheetPage(QuotationSheetPageReqVO pageReqVO) {
return quotationSheetMapper.selectPage(pageReqVO);
}
@Override
public List<QuotationSheetDO> getQuotationSheetList(QuotationSheetExportReqVO exportReqVO) {
return quotationSheetMapper.selectList(exportReqVO);
}
}
Loading…
Cancel
Save