@ -3,6 +3,7 @@ package com.spring.modules.quotation.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper ;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper ;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl ;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl ;
import com.spring.common.utils.Constant ;
import com.spring.common.utils.Constant ;
import com.spring.modules.base.entity.PlmPropertiesItemAvailable ;
import com.spring.modules.quotation.entity.PriceCheckProperties ;
import com.spring.modules.quotation.entity.PriceCheckProperties ;
import com.spring.modules.quotation.mapper.PriceCheckPropertiesMapper ;
import com.spring.modules.quotation.mapper.PriceCheckPropertiesMapper ;
import com.spring.modules.quotation.mapper.QuotationInformationMapper ;
import com.spring.modules.quotation.mapper.QuotationInformationMapper ;
@ -27,7 +28,7 @@ public class PriceCheckPropertiesServiceImpl extends ServiceImpl<PriceCheckPrope
private QuotationInformationMapper quotationInformationMapper ;
private QuotationInformationMapper quotationInformationMapper ;
@Override
@Override
public List < PriceCheckPropertiesVo > searchPriceCheckPropertiesList ( PriceCheckProperties properties ) {
public List < PriceCheckPropertiesVo > searchPriceCheckPropertiesList ( PriceCheckProperties properties ) {
return quotationInformationMapper . searchPriceCheckPropertiesVo ( properties . getSite ( ) , properties . getQuotationNo ( ) ) ;
return quotationInformationMapper . searchPriceCheckPropertiesVo ( properties . getSite ( ) , properties . getQuotationNo ( ) , Constant . QUOTATION_CODE_NO ) ;
}
}
@Override
@Override
@ -58,4 +59,31 @@ public class PriceCheckPropertiesServiceImpl extends ServiceImpl<PriceCheckPrope
saveBatch ( propertiesList ) ;
saveBatch ( propertiesList ) ;
}
}
}
}
@Override
public List < PriceCheckProperties > searchPriceCheckPropertiesItemList ( PriceCheckPropertiesVo testProperties ) {
return quotationInformationMapper . searchPriceCheckPropertiesItemList ( testProperties . getSite ( ) ,
Constant . QUOTATION_CODE_TYPE , testProperties . getItemNo ( ) , testProperties . getItemDesc ( ) , testProperties . getList ( ) . stream ( ) . map ( PlmPropertiesItemAvailable : : getItemNo ) . collect ( Collectors . toList ( ) ) ) ;
}
@Override
@Transactional
public void savePriceCheckPropertiesItem ( List < PriceCheckProperties > list ) {
if ( list = = null | | list . isEmpty ( ) ) {
throw new RuntimeException ( "至少选择一条询价属性" ) ;
}
saveBatch ( list ) ;
}
@Override
@Transactional
public void removePriceCheckPropertiesItem ( List < PriceCheckProperties > list ) {
if ( list = = null | | list . isEmpty ( ) ) {
throw new RuntimeException ( "至少选择一条询价属性" ) ;
}
lambdaUpdate ( ) . eq ( PriceCheckProperties : : getQuotationNo , list . get ( 0 ) . getQuotationNo ( ) )
. eq ( PriceCheckProperties : : getSite , list . get ( 0 ) . getSite ( ) )
. in ( PriceCheckProperties : : getItemNo , list . stream ( ) . map ( PriceCheckProperties : : getItemNo ) . collect ( Collectors . toList ( ) ) )
. remove ( ) ;
}
}
}