Merge remote-tracking branch 'origin/master'
commit
b9e1f6a0b4
@ -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,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,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,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…
Reference in New Issue