@ -16,6 +16,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j ;
import org.apache.dubbo.config.annotation.DubboReference ;
import org.apache.seata.spring.annotation.GlobalTransactional ;
import org.dromara.common.core.constant.DataConstants ;
import org.dromara.common.core.enums.BusinessStatusEnum ;
import org.dromara.common.core.enums.OAStatusEnum ;
import org.dromara.common.core.exception.ServiceException ;
@ -129,7 +130,7 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
MPJLambdaWrapper < ErpContractInfo > infoLqw = JoinWrappers . lambda ( ErpContractInfo . class )
. selectAll ( ErpContractInfo . class )
. eq ( contractId ! = null , ErpContractInfo : : getContractId , contractId )
. eq ( "t.del_flag" , "0" ) ;
. eq ( "t.del_flag" , DataConstants . DEL_FLAG_NORMAL ) ;
List < ErpContractInfoVo > infoList = baseMapper . selectCustomErpContractInfoVoList ( infoLqw , true ) ;
ErpContractInfoVo contractInfoVo = infoList . isEmpty ( ) ? null : infoList . get ( 0 ) ;
if ( contractInfoVo = = null ) {
@ -138,7 +139,7 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
MPJLambdaWrapper < ErpContractMaterial > lqw = JoinWrappers . lambda ( ErpContractMaterial . class )
. selectAll ( ErpContractMaterial . class )
. eq ( contractId ! = null , ErpContractMaterial : : getContractId , contractId )
. eq ( "t.del_flag" , "0" ) ;
. eq ( "t.del_flag" , DataConstants . DEL_FLAG_NORMAL ) ;
List < ErpContractMaterialVo > contractMaterialList = contractMaterialMapper
. selectCustomErpContractMaterialVoList ( lqw ) ;
for ( int i = 0 ; i < contractMaterialList . size ( ) ; i + + ) {
@ -149,7 +150,7 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
MPJLambdaWrapper < ErpContractPaymentMethod > paymentLqw = JoinWrappers . lambda ( ErpContractPaymentMethod . class )
. selectAll ( ErpContractPaymentMethod . class )
. eq ( contractId ! = null , ErpContractPaymentMethod : : getContractId , contractId )
. eq ( ErpContractPaymentMethod : : getDelFlag , "0" ) ;
. eq ( ErpContractPaymentMethod : : getDelFlag , DataConstants . DEL_FLAG_NORMAL ) ;
List < ErpContractPaymentMethodVo > contractPaymentMethodList = contractPaymentMethodMapper . selectCustomErpContractPaymentMethodVoList ( paymentLqw ) ;
contractInfoVo . setContractPaymentMethodList ( contractPaymentMethodList ) ;
// 查询关联的付款账户并格式化为付款账户信息字符串
@ -239,50 +240,41 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
private MPJLambdaWrapper < ErpContractInfo > buildQueryWrapper ( ErpContractInfoBo bo ) {
MPJLambdaWrapper < ErpContractInfo > lqw = JoinWrappers . lambda ( ErpContractInfo . class )
. selectAll ( ErpContractInfo . class )
. eq ( StringUtils . isNotBlank ( bo . getContractFlag ( ) ) , ErpContractInfo : : getContractFlag ,
bo . getContractFlag ( ) )
. eq ( StringUtils . isNotBlank ( bo . getContractCode ( ) ) , ErpContractInfo : : getContractCode ,
bo . getContractCode ( ) )
. eq ( StringUtils . isNotBlank ( bo . getCustomerContractCode ( ) ) , ErpContractInfo : : getCustomerContractCode ,
bo . getCustomerContractCode ( ) )
. like ( StringUtils . isNotBlank ( bo . getContractName ( ) ) , ErpContractInfo : : getContractName ,
bo . getContractName ( ) )
. eq ( StringUtils . isNotBlank ( bo . getContractCategory ( ) ) , ErpContractInfo : : getContractCategory ,
bo . getContractCategory ( ) )
. eq ( StringUtils . isNotBlank ( bo . getContractType ( ) ) , ErpContractInfo : : getContractType ,
bo . getContractType ( ) )
. eq ( StringUtils . isNotBlank ( bo . getBusinessDirection ( ) ) , ErpContractInfo : : getBusinessDirection ,
bo . getBusinessDirection ( ) )
. eq ( bo . getContractDeptId ( ) ! = null , ErpContractInfo : : getContractDeptId , bo . getContractDeptId ( ) )
. eq ( bo . getContractDate ( ) ! = null , ErpContractInfo : : getContractDate , bo . getContractDate ( ) )
. eq ( StringUtils . isNotBlank ( bo . getContractTerritorialFlag ( ) ) , ErpContractInfo : : getContractTerritorialFlag , bo . getContractTerritorialFlag ( ) )
. eq ( StringUtils . isNotBlank ( bo . getContractTerritorialCountry ( ) ) , ErpContractInfo : : getContractTerritorialCountry , bo . getContractTerritorialCountry ( ) )
. eq ( StringUtils . isNotBlank ( bo . getSettlementCurrency ( ) ) , ErpContractInfo : : getSettlementCurrency , bo . getSettlementCurrency ( ) )
. eq ( bo . getRmbExchangeRate ( ) ! = null , ErpContractInfo : : getRmbExchangeRate , bo . getRmbExchangeRate ( ) )
. apply ( StringUtils . isNotBlank ( bo . getOneCustomerName ( ) ) ,
"c1.customer_name LIKE CONCAT('%', {0}, '%')" , bo . getOneCustomerName ( ) )
. eq ( bo . getTotalPrice ( ) ! = null , ErpContractInfo : : getTotalPrice , bo . getTotalPrice ( ) )
. eq ( StringUtils . isNotBlank ( bo . getContractStatus ( ) ) , ErpContractInfo : : getContractStatus ,
bo . getContractStatus ( ) )
. eq ( StringUtils . isNotBlank ( bo . getFlowStatus ( ) ) , ErpContractInfo : : getFlowStatus , bo . getFlowStatus ( ) )
. eq ( bo . getTemplateId ( ) ! = null , ErpContractInfo : : getTemplateId , bo . getTemplateId ( ) )
. eq ( StringUtils . isNotBlank ( bo . getOssId ( ) ) , ErpContractInfo : : getOssId , bo . getOssId ( ) )
. eq ( StringUtils . isNotBlank ( bo . getPaymentMethod ( ) ) , ErpContractInfo : : getPaymentMethod ,
bo . getPaymentMethod ( ) )
. eq ( bo . getSignatureAppendix ( ) ! = null , ErpContractInfo : : getSignatureAppendix , bo . getSignatureAppendix ( ) )
. eq ( bo . getTaxRate ( ) ! = null , ErpContractInfo : : getTaxRate , bo . getTaxRate ( ) )
. eq ( StringUtils . isNotBlank ( bo . getActiveFlag ( ) ) , ErpContractInfo : : getActiveFlag , bo . getActiveFlag ( ) )
. eq ( bo . getContractManagerId ( ) ! = null , ErpContractInfo : : getContractManagerId , bo . getContractManagerId ( ) )
. eq ( StringUtils . isNotBlank ( bo . getCapitalizedAmount ( ) ) , ErpContractInfo : : getCapitalizedAmount ,
bo . getCapitalizedAmount ( ) )
. eq ( StringUtils . isNotBlank ( bo . getContractTemplateFlag ( ) ) , ErpContractInfo : : getContractTemplateFlag ,
bo . getContractTemplateFlag ( ) )
. eq ( StringUtils . isNotBlank ( bo . getIsFrameworkContract ( ) ) , ErpContractInfo : : getIsFrameworkContract , bo . getIsFrameworkContract ( ) )
. eq ( bo . getFrameworkContractId ( ) ! = null , ErpContractInfo : : getFrameworkContractId , bo . getFrameworkContractId ( ) )
. eq ( bo . getFrameworkValidPeriod ( ) ! = null , ErpContractInfo : : getFrameworkValidPeriod , bo . getFrameworkValidPeriod ( ) )
. eq ( "t.del_flag" , "0" )
. eq ( "t.active_flag" , "1" ) ;
. selectAll ( ErpContractInfo . class ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getContractFlag ( ) ) , ErpContractInfo : : getContractFlag , bo . getContractFlag ( ) ) ;
lqw . like ( StringUtils . isNotBlank ( bo . getContractCode ( ) ) , ErpContractInfo : : getContractCode , bo . getContractCode ( ) ) ;
lqw . like ( StringUtils . isNotBlank ( bo . getCustomerContractCode ( ) ) , ErpContractInfo : : getCustomerContractCode , bo . getCustomerContractCode ( ) ) ;
lqw . like ( StringUtils . isNotBlank ( bo . getContractName ( ) ) , ErpContractInfo : : getContractName , bo . getContractName ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getContractCategory ( ) ) , ErpContractInfo : : getContractCategory , bo . getContractCategory ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getContractType ( ) ) , ErpContractInfo : : getContractType , bo . getContractType ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getBusinessDirection ( ) ) , ErpContractInfo : : getBusinessDirection , bo . getBusinessDirection ( ) ) ;
lqw . eq ( bo . getContractDeptId ( ) ! = null , ErpContractInfo : : getContractDeptId , bo . getContractDeptId ( ) ) ;
lqw . eq ( bo . getContractDate ( ) ! = null , ErpContractInfo : : getContractDate , bo . getContractDate ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getContractTerritorialFlag ( ) ) , ErpContractInfo : : getContractTerritorialFlag , bo . getContractTerritorialFlag ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getContractTerritorialCountry ( ) ) , ErpContractInfo : : getContractTerritorialCountry , bo . getContractTerritorialCountry ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getSettlementCurrency ( ) ) , ErpContractInfo : : getSettlementCurrency , bo . getSettlementCurrency ( ) ) ;
lqw . eq ( bo . getRmbExchangeRate ( ) ! = null , ErpContractInfo : : getRmbExchangeRate , bo . getRmbExchangeRate ( ) ) ;
if ( StringUtils . isNotBlank ( bo . getOneCustomerName ( ) ) ) {
lqw . apply ( "c1.customer_name LIKE CONCAT('%', {0}, '%')" , bo . getOneCustomerName ( ) ) ;
}
lqw . eq ( bo . getTotalPrice ( ) ! = null , ErpContractInfo : : getTotalPrice , bo . getTotalPrice ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getContractStatus ( ) ) , ErpContractInfo : : getContractStatus , bo . getContractStatus ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getFlowStatus ( ) ) , ErpContractInfo : : getFlowStatus , bo . getFlowStatus ( ) ) ;
lqw . eq ( bo . getTemplateId ( ) ! = null , ErpContractInfo : : getTemplateId , bo . getTemplateId ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getOssId ( ) ) , ErpContractInfo : : getOssId , bo . getOssId ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getPaymentMethod ( ) ) , ErpContractInfo : : getPaymentMethod , bo . getPaymentMethod ( ) ) ;
lqw . eq ( bo . getSignatureAppendix ( ) ! = null , ErpContractInfo : : getSignatureAppendix , bo . getSignatureAppendix ( ) ) ;
lqw . eq ( bo . getTaxRate ( ) ! = null , ErpContractInfo : : getTaxRate , bo . getTaxRate ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getActiveFlag ( ) ) , ErpContractInfo : : getActiveFlag , bo . getActiveFlag ( ) ) ;
lqw . eq ( bo . getContractManagerId ( ) ! = null , ErpContractInfo : : getContractManagerId , bo . getContractManagerId ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getCapitalizedAmount ( ) ) , ErpContractInfo : : getCapitalizedAmount , bo . getCapitalizedAmount ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getContractTemplateFlag ( ) ) , ErpContractInfo : : getContractTemplateFlag , bo . getContractTemplateFlag ( ) ) ;
lqw . eq ( StringUtils . isNotBlank ( bo . getIsFrameworkContract ( ) ) , ErpContractInfo : : getIsFrameworkContract , bo . getIsFrameworkContract ( ) ) ;
lqw . eq ( bo . getFrameworkContractId ( ) ! = null , ErpContractInfo : : getFrameworkContractId , bo . getFrameworkContractId ( ) ) ;
lqw . eq ( bo . getFrameworkValidPeriod ( ) ! = null , ErpContractInfo : : getFrameworkValidPeriod , bo . getFrameworkValidPeriod ( ) ) ;
lqw . eq ( "t.del_flag" , DataConstants . DEL_FLAG_NORMAL ) ;
lqw . eq ( "t.active_flag" , DataConstants . ACTIVE_FLAG_YES ) ;
applyContractDataScope ( lqw ) ;
return lqw ;
}
@ -432,7 +424,7 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
MPJLambdaWrapper < ErpContractPaymentMethod > paymentLqw = JoinWrappers . lambda ( ErpContractPaymentMethod . class )
. selectAll ( ErpContractPaymentMethod . class )
. eq ( bo . getContractId ( ) ! = null , ErpContractPaymentMethod : : getContractId , bo . getContractId ( ) )
. eq ( ErpContractPaymentMethod : : getDelFlag , "0" ) ;
. eq ( ErpContractPaymentMethod : : getDelFlag , DataConstants . DEL_FLAG_NORMAL ) ;
List < ErpContractPaymentMethodVo > oldPaymentList = contractPaymentMethodMapper . selectCustomErpContractPaymentMethodVoList ( paymentLqw ) ;
if ( contractPaymentMethodList ! = null & & ! contractPaymentMethodList . isEmpty ( ) ) {
Set < Long > newPaymentMethodIds = new HashSet < > ( ) ;
@ -502,7 +494,7 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
if ( entity ! = null & & StringUtils . isNotBlank ( entity . getContractCode ( ) ) ) {
LambdaQueryWrapper < ErpContractInfo > lqw = new LambdaQueryWrapper < ErpContractInfo > ( )
. eq ( ErpContractInfo : : getContractCode , entity . getContractCode ( ) )
. eq ( ErpContractInfo : : getDelFlag , "0" )
. eq ( ErpContractInfo : : getDelFlag , DataConstants . DEL_FLAG_NORMAL )
. ne ( entity . getContractId ( ) ! = null , ErpContractInfo : : getContractId , entity . getContractId ( ) ) ;
Long cnt = baseMapper . selectCount ( lqw ) ;
if ( cnt ! = null & & cnt > 0 ) {