|
|
@ -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,14 +371,34 @@ 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (null!=a.getSupplierBiddingId()&&!"".equals(a.getSupplierBiddingId())){
|
|
|
|
List<SupplierCompanyDO> supplierCompanyDO =new ArrayList<>();
|
|
|
|
List<SupplierCompanyDO> supplierCompanyDO = supplierCompanyService.listByIds(JSON.parseArray(a.getSupplierBiddingId(), Long.class));
|
|
|
|
if (a.getIsWin()==null){
|
|
|
|
if (null!=supplierCompanyDO){
|
|
|
|
if (null!=a.getSupplierBiddingId()&&!"".equals(a.getSupplierBiddingId())){
|
|
|
|
a.setBiddingSupplierName(supplierCompanyDO.stream().map(SupplierCompanyDO::getCompanyAme).collect(Collectors.toList()).stream().collect(Collectors.joining(",")));
|
|
|
|
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.setIsWin(1);
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
if (a.getSupplierList()!=null){
|
|
|
|
a.setIsWin(2);
|
|
|
|
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
|
|
|
|