报价单

new
Agoni 1 year ago
parent 6795c5cb50
commit 6fc3a3587a

@ -18,6 +18,13 @@
</description> </description>
<dependencies> <dependencies>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-bpm-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency> <dependency>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId> <artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
@ -61,6 +68,12 @@
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId> <artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-bpm-api</artifactId>
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -114,9 +114,26 @@ public class QuotationSheetController {
@PostMapping("/approvalBidding") @PostMapping("/approvalBidding")
@Operation(summary = "中标审批发起接口") @Operation(summary = "中标审批发起接口")
@PreAuthorize("@ss.hasPermission('bs:quotation-sheet:approvalBidding')") // @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:approvalBidding')")
public CommonResult<String> approvalBidding(@Valid QuotationSheetPageReqVO pageVO) { public CommonResult<String> approvalBidding(QuotationSheetPageReqVO pageVO) {
return success(quotationSheetService.approvalBidding(pageVO)); return success(quotationSheetService.approvalBidding(pageVO));
} }
@PutMapping("/releaseFlag")
@Operation(summary = "是否流标")
@PreAuthorize("@ss.hasPermission('bs:quotation-sheet:releaseFlag')")
public CommonResult<Boolean> releaseFlag( @RequestBody QuotationSheetUpdateReqVO updateReqVO) {
updateReqVO.setIsWin(3);
quotationSheetService.updateQuotationReleaseFlag(updateReqVO);
return success(true);
}
@GetMapping("/tendereeQuery")
@Operation(summary = "报价单中标管理列表接口")
@PreAuthorize("@ss.hasPermission('bs:quotation-sheet:tendereeQuery')")
public CommonResult<PageResult<QuotationSheetRespVO>> tendereeQuery(@Valid QuotationSheetPageReqVO pageVO) {
PageResult<QuotationSheetDO> pageResult = quotationSheetService.tendereeQuery(pageVO);
return success(QuotationSheetConvert.INSTANCE.convertPage(pageResult));
}
} }

@ -104,4 +104,7 @@ public class QuotationSheetBaseVO {
@Schema(description = "申请人部门id", example = "10907") @Schema(description = "申请人部门id", example = "10907")
private Long deptId; private Long deptId;
@Schema(description = "采购预算")
private String money;
} }

@ -105,4 +105,7 @@ public class QuotationSheetExcelVO {
@ExcelProperty("申请人部门id") @ExcelProperty("申请人部门id")
private Long deptId; private Long deptId;
@Schema(description = "采购预算")
private String money;
} }

@ -19,6 +19,9 @@ public class QuotationSheetPageReqVO extends PageParam {
@Schema(description = "备注", example = "你猜") @Schema(description = "备注", example = "你猜")
private String remark; private String remark;
@Schema(description = "id")
private Long id;
@Schema(description = "附件", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "附件", requiredMode = Schema.RequiredMode.REQUIRED)
private List<ImageVo> files; private List<ImageVo> files;
@ -108,6 +111,8 @@ public class QuotationSheetPageReqVO extends PageParam {
@Schema(description = "申请人部门id", example = "10907") @Schema(description = "申请人部门id", example = "10907")
private Long deptId; private Long deptId;
private Integer isWin;
@Schema(description = "供应商中标id集合发起审批的时候添加此参数") @Schema(description = "供应商中标id集合发起审批的时候添加此参数")
private List<Long> approvalBiddingIdList; private List<Long> approvalBiddingIdList;

@ -41,6 +41,15 @@ public class QuotationSheetRespVO extends QuotationSheetBaseVO {
@Schema(description = "是否中标") @Schema(description = "是否中标")
private Integer isWin; private Integer isWin;
@Schema(description = "采购预算")
private String money;
/**
*
*/
@Schema(description = "中标审批状态")
private Integer biddingStatus;
/** /**
* id * id
*/ */
@ -49,4 +58,10 @@ public class QuotationSheetRespVO extends QuotationSheetBaseVO {
@Schema(description = "中标供应商名称") @Schema(description = "中标供应商名称")
private String biddingSupplierName; private String biddingSupplierName;
/**
*
*/
private Long tenantId;
private String tenantName;
} }

@ -23,4 +23,6 @@ public class QuotationSheetUpdateReqVO extends QuotationSheetBaseVO {
@NotEmpty(message = "物料不能为空") @NotEmpty(message = "物料不能为空")
private List<QuotationSheetDetailDO> quotationDetails; private List<QuotationSheetDetailDO> quotationDetails;
@Schema(description = "是否中标")
private Integer isWin;
} }

@ -22,25 +22,21 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
public class QuotationSheetBiddingBaseVO { public class QuotationSheetBiddingBaseVO {
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "状态不能为空")
private Integer status; private Integer status;
@Schema(description = "备注", example = "随便") @Schema(description = "备注", example = "随便")
private String remark; private String remark;
@Schema(description = "物料明细", example = "27461") @Schema(description = "物料明细", example = "27461")
@NotNull(message = "物料明细不能为空")
private Long quotationDetailId; private Long quotationDetailId;
@Schema(description = "物料编码") @Schema(description = "物料编码")
@NotBlank(message = "物料编码不能为空")
private String materialCode; private String materialCode;
@Schema(description = "物料id", example = "18066") @Schema(description = "物料id", example = "18066")
private Long materialId; private Long materialId;
@Schema(description = "物料名称", example = "芋艿") @Schema(description = "物料名称", example = "芋艿")
@NotBlank(message = "物料名称不能为空")
private String materialName; private String materialName;
@Schema(description = "供应商id", example = "2920") @Schema(description = "供应商id", example = "2920")
@ -51,9 +47,11 @@ public class QuotationSheetBiddingBaseVO {
private String companyName; private String companyName;
@Schema(description = "产品单价", example = "32067") @Schema(description = "产品单价", example = "32067")
@NotNull(message = "供应商不能为空")
private BigDecimal productPrice; private BigDecimal productPrice;
@Schema(description = "产品模具费") @Schema(description = "产品模具费")
@NotNull(message = "供应商不能为空")
private BigDecimal moldCost; private BigDecimal moldCost;
@Schema(description = "报价时间") @Schema(description = "报价时间")

@ -165,7 +165,6 @@ public class QuotationSheetDO extends TenantBaseDO {
@TableField(exist = false) @TableField(exist = false)
private List<QuotationSheetDetailDO> quotationDetails; private List<QuotationSheetDetailDO> quotationDetails;
@TableField(exist = false)
private Integer isWin; private Integer isWin;
/** /**
* id * id
@ -183,4 +182,10 @@ public class QuotationSheetDO extends TenantBaseDO {
*/ */
@TableField(exist = false) @TableField(exist = false)
private List<QuotationSheetBiddingDO> quotationSheetBiddingDOList; private List<QuotationSheetBiddingDO> quotationSheetBiddingDOList;
/**
*
*/
private Integer biddingStatus;
private String money;
} }

@ -117,4 +117,7 @@ public class SupplierCompanyDO extends TenantBaseDO {
@TableField(typeHandler = JacksonTypeHandler.class) @TableField(typeHandler = JacksonTypeHandler.class)
private List<ImageVo> files; private List<ImageVo> files;
@TableField(exist = false)
private Integer isWin;
} }

@ -50,6 +50,40 @@ public interface QuotationSheetMapper extends BaseMapperX<QuotationSheetDO> {
.likeIfPresent(QuotationSheetDO::getSupplierBiddingId, reqVO.getSupplierBiddingId()) .likeIfPresent(QuotationSheetDO::getSupplierBiddingId, reqVO.getSupplierBiddingId())
.orderByDesc(QuotationSheetDO::getId)); .orderByDesc(QuotationSheetDO::getId));
} }
default PageResult<QuotationSheetDO> selectPages(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())
.likeIfPresent(QuotationSheetDO::getSupplierIdAll,reqVO.getSupplierCompanyId())
.eqIfPresent(QuotationSheetDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(QuotationSheetDO::getSupplierBiddingId, reqVO.getSupplierBiddingId())
.isNull(QuotationSheetDO::getIsWin)
.orderByDesc(QuotationSheetDO::getId));
}
default List<QuotationSheetDO> selectList(QuotationSheetExportReqVO reqVO) { default List<QuotationSheetDO> selectList(QuotationSheetExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<QuotationSheetDO>() return selectList(new LambdaQueryWrapperX<QuotationSheetDO>()

@ -33,6 +33,7 @@ public interface QuotationSheetService extends MPJBaseService<QuotationSheetDO>
* @param updateReqVO * @param updateReqVO
*/ */
void updateQuotationSheet(@Valid QuotationSheetUpdateReqVO updateReqVO); void updateQuotationSheet(@Valid QuotationSheetUpdateReqVO updateReqVO);
void updateQuotationReleaseFlag( QuotationSheetUpdateReqVO updateReqVO);
/** /**
* *
@ -86,4 +87,11 @@ public interface QuotationSheetService extends MPJBaseService<QuotationSheetDO>
* @return * @return
*/ */
String approvalBidding(QuotationSheetPageReqVO pageVO); String approvalBidding(QuotationSheetPageReqVO pageVO);
/**
*
* @param pageVO
* @return
*/
PageResult<QuotationSheetDO> tendereeQuery(QuotationSheetPageReqVO pageVO);
} }

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapplytrip.ExpenseApplyTripDO; import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapplytrip.ExpenseApplyTripDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.materiel.MaterielDO; import cn.iocoder.yudao.module.bs.dal.dataobject.materiel.MaterielDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO; import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
@ -24,6 +25,8 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.util.*; import java.util.*;
@ -69,6 +72,9 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
@Resource @Resource
private QuotationSheetBiddingService quotationSheetBiddingService; private QuotationSheetBiddingService quotationSheetBiddingService;
@Resource
private BpmProcessInstanceApi processInstanceApi;
@Resource @Resource
private DeptApi deptApi; private DeptApi deptApi;
@ -115,6 +121,17 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
} }
} }
@Override
public void updateQuotationReleaseFlag( QuotationSheetUpdateReqVO updateReqVO) {
// 校验存在
validateQuotationSheetExists(updateReqVO.getId());
// 更新
// QuotationSheetDO updateObj = QuotationSheetConvert.INSTANCE.convert(updateReqVO);
QuotationSheetDO quotationSheetDO = this.getById(updateReqVO.getId());
quotationSheetDO.setIsWin(3);
saveOrUpdate(quotationSheetDO);
}
@Override @Override
public void deleteQuotationSheet(Long id) { public void deleteQuotationSheet(Long id) {
// 校验存在 // 校验存在
@ -151,7 +168,17 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
} }
if (quotationSheetDO.getIsWin()==null){
if (null!=quotationSheetDO.getSupplierBiddingId()&&!"".equals(quotationSheetDO.getSupplierBiddingId())){
List<SupplierCompanyDO> supplierCompanyDO = supplierCompanyService.listByIds(JSON.parseArray(quotationSheetDO.getSupplierBiddingId(), Long.class));
if (null!=supplierCompanyDO){
quotationSheetDO.setBiddingSupplierName(supplierCompanyDO.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(",")));
}
quotationSheetDO.setIsWin(1);
}else {
quotationSheetDO.setIsWin(2);
}
}
quotationSheetDO.setSupplierList(supplierCompanyService.listByIds(JSON.parseArray(quotationSheetDO.getSupplierIdAll(),Long.class))); quotationSheetDO.setSupplierList(supplierCompanyService.listByIds(JSON.parseArray(quotationSheetDO.getSupplierIdAll(),Long.class)));
quotationSheetDO.setQuotationDetails(quotationSheetDetailDOList); quotationSheetDO.setQuotationDetails(quotationSheetDetailDOList);
return quotationSheetDO; return quotationSheetDO;
@ -215,7 +242,36 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
String collect = supplierCompanyDOList.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(",")); String collect = supplierCompanyDOList.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(","));
a.setSupplierNameList(collect); a.setSupplierNameList(collect);
} }
List<SupplierCompanyDO> supplierCompanyDO =new ArrayList<>();
if (a.getIsWin()==null){
if (null!=a.getSupplierBiddingId()&&!"".equals(a.getSupplierBiddingId())){
supplierCompanyDO = supplierCompanyService.listByIds(JSON.parseArray(a.getSupplierBiddingId(), Long.class));
if (null!=supplierCompanyDO){
a.setBiddingSupplierName(supplierCompanyDO.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(",")));
}
a.setIsWin(1);
}else {
a.setIsWin(2);
}
}
a.setSupplierList(supplierCompanyDOList); a.setSupplierList(supplierCompanyDOList);
if (a.getSupplierList()!=null){
if (supplierCompanyDO.size()>0){
Map<Long, SupplierCompanyDO> map3= supplierCompanyDO.stream().collect(Collectors.toMap(SupplierCompanyDO::getId, x ->x));
a.getSupplierList().forEach(s->{
if (map3!=null &&map3.size()>0){
SupplierCompanyDO supplierCompanyDO1 = map3.get(s.getId());
if (null!=supplierCompanyDO1){
s.setIsWin(1);
}else {
s.setIsWin(2);
}
}
});
}
}
a.setQuotationDetails(quotationSheetDetailDOList); a.setQuotationDetails(quotationSheetDetailDOList);
}); });
} }
@ -269,6 +325,7 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
@Override @Override
public PageResult<QuotationSheetDO> getQuotationSheetPageBidding(QuotationSheetPageReqVO pageVO) { public PageResult<QuotationSheetDO> getQuotationSheetPageBidding(QuotationSheetPageReqVO pageVO) {
pageVO.setStatus(2);
PageResult<QuotationSheetDO> sheetDOPageResult = quotationSheetMapper.selectPage(pageVO); PageResult<QuotationSheetDO> sheetDOPageResult = quotationSheetMapper.selectPage(pageVO);
if (sheetDOPageResult.getList()!=null&&sheetDOPageResult.getList().size()>0){ if (sheetDOPageResult.getList()!=null&&sheetDOPageResult.getList().size()>0){
List<MaterielDO> materielDOList = materielService.list(new QueryWrapper<MaterielDO>().eq("tenant_id",sheetDOPageResult.getList().get(0).getTenantId())); List<MaterielDO> materielDOList = materielService.list(new QueryWrapper<MaterielDO>().eq("tenant_id",sheetDOPageResult.getList().get(0).getTenantId()));
@ -314,8 +371,10 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
String collect = supplierCompanyDOList.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(",")); String collect = supplierCompanyDOList.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(","));
a.setSupplierNameList(collect); a.setSupplierNameList(collect);
} }
List<SupplierCompanyDO> supplierCompanyDO =new ArrayList<>();
if (a.getIsWin()==null){
if (null!=a.getSupplierBiddingId()&&!"".equals(a.getSupplierBiddingId())){ if (null!=a.getSupplierBiddingId()&&!"".equals(a.getSupplierBiddingId())){
List<SupplierCompanyDO> supplierCompanyDO = supplierCompanyService.listByIds(JSON.parseArray(a.getSupplierBiddingId(), Long.class)); supplierCompanyDO = supplierCompanyService.listByIds(JSON.parseArray(a.getSupplierBiddingId(), Long.class));
if (null!=supplierCompanyDO){ if (null!=supplierCompanyDO){
a.setBiddingSupplierName(supplierCompanyDO.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(","))); a.setBiddingSupplierName(supplierCompanyDO.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(",")));
} }
@ -323,6 +382,24 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
}else { }else {
a.setIsWin(2); a.setIsWin(2);
} }
}
if (a.getSupplierList()!=null){
if (supplierCompanyDO.size()>0){
Map<Long, SupplierCompanyDO> map3= supplierCompanyDO.stream().collect(Collectors.toMap(SupplierCompanyDO::getId, x ->x));
a.getSupplierList().forEach(s->{
if (map3!=null &&map3.size()>0){
SupplierCompanyDO supplierCompanyDO1 = map3.get(s.getId());
if (null!=supplierCompanyDO1){
s.setIsWin(1);
}else {
s.setIsWin(2);
}
}
});
}
}
a.setSupplierList(supplierCompanyDOList); a.setSupplierList(supplierCompanyDOList);
a.setQuotationDetails(quotationSheetDetailDOList); a.setQuotationDetails(quotationSheetDetailDOList);
}); });
@ -335,6 +412,13 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
return null; return null;
} }
@Override
public PageResult<QuotationSheetDO> tendereeQuery(QuotationSheetPageReqVO pageVO) {
pageVO.setStatus(2);
PageResult<QuotationSheetDO> sheetDOPageResult = quotationSheetMapper.selectPages(pageVO);
return sheetDOPageResult;
}
/** /**
* *
* @return * @return

Loading…
Cancel
Save