@ -23,6 +23,8 @@ import jnpf.base.controller.BillRuleController;
import jnpf.base.entity.ProvinceEntity ;
import jnpf.base.mapper.ProvinceMapper ;
import jnpf.config.ConfigValueUtil ;
import jnpf.contractfile.entity.ContractFileEntity ;
import jnpf.contractfile.service.ContractFileService ;
import jnpf.customer.entity.CustomerEntity ;
import jnpf.customer.mapper.CustomerVMapper ;
import jnpf.exception.DataException ;
@ -838,19 +840,89 @@ if (pMap!=null&&pMap.size()>0){
}
}
}
}
if ( StringUtil . isNotEmpty ( purchaseorderPagination . getDocumentNo ( ) ) ) {
if ( StringUtil . isNotEmpty ( purchaseorderPagination . getCreatorTime ( ) ) ) {
List < String > PoundDateList = purchaseorderPagination . getCreatorTime ( ) ;
Long fir = Long . valueOf ( PoundDateList . get ( 0 ) ) ;
Long sec = Long . valueOf ( PoundDateList . get ( 1 ) ) ;
purchaseorderPagination . setStartDate ( new Date ( fir ) ) ;
purchaseorderPagination . setEndDate ( DateUtil . stringToDate ( DateUtil . daFormatYmd ( sec ) + " 23:59:59" ) ) ;
}
if ( StringUtil . isEmpty ( purchaseorderPagination . getSidx ( ) ) ) {
purchaseorderPagination . setSidx ( "CREATOR_TIME" ) ;
purchaseorderPagination . setSort ( "DESC" ) ;
} else {
try {
String sidx = purchaseorderPagination . getSidx ( ) ;
PoundlistEntity poundlistEntity = new PoundlistEntity ( ) ;
Field declaredField = poundlistEntity . getClass ( ) . getDeclaredField ( sidx ) ;
declaredField . setAccessible ( true ) ;
String value = declaredField . getAnnotation ( TableField . class ) . value ( ) ;
purchaseorderPagination . setSidx ( value ) ;
} catch ( NoSuchFieldException e ) {
e . printStackTrace ( ) ;
}
}
Page < PurchaseorderitemEntity > page = new Page < > ( purchaseorderPagination . getCurrentPage ( ) , purchaseorderPagination . getPageSize ( ) ) ;
IPage < PurchaseorderitemEntity > iPage = purchaseorderitemMapper . queryByKeyword ( page , purchaseorderPagination ) ;
return purchaseorderPagination . setData ( iPage . getRecords ( ) , iPage . getTotal ( ) ) ;
/ * if ( StringUtil . isNotEmpty ( purchaseorderPagination . getDocumentNo ( ) ) ) {
purchaseorderNum + + ;
purchaseorderQueryWrapper . lambda ( ) . like ( PurchaseorderitemEntity : : getDocumentNo , purchaseorderPagination . getDocumentNo ( ) ) ;
}
}
if ( StringUtil . isNotEmpty ( purchaseorderPagination . getStatus ( ) ) ) {
purchaseorderNum + + ;
purchaseorderQueryWrapper . lambda ( ) . like ( PurchaseorderitemEntity : : getStatus , purchaseorderPagination . getStatus ( ) ) ;
}
if ( StringUtil . isNotEmpty ( purchaseorderPagination . getCreatorTime ( ) ) ) {
purchaseorderNum + + ;
List < String > PoundDateList = purchaseorderPagination . getCreatorTime ( ) ;
Long fir = Long . valueOf ( PoundDateList . get ( 0 ) ) ;
Long sec = Long . valueOf ( PoundDateList . get ( 1 ) ) ;
purchaseorderQueryWrapper . lambda ( ) . ge ( PurchaseorderitemEntity : : getCreatorTime , new Date ( fir ) )
. le ( PurchaseorderitemEntity : : getCreatorTime , DateUtil . stringToDate ( DateUtil . daFormatYmd ( sec ) + " 23:59:59" ) ) ;
}
if ( StringUtil . isNotEmpty ( purchaseorderPagination . getPurchaseName ( ) ) ) {
QueryWrapper < ContractFileEntity > contractFileQueryWrapper = new QueryWrapper < > ( ) ;
contractFileQueryWrapper . lambda ( ) . like ( ContractFileEntity : : getContractName , purchaseorderPagination . getPurchaseName ( ) ) ;
contractFileQueryWrapper . lambda ( ) . select ( ContractFileEntity : : getId ) ;
List < String > customerIdList = contractFileService . listObjs ( contractFileQueryWrapper ) . stream ( ) . map ( o - > ( String ) o ) . collect ( Collectors . toList ( ) ) ;
purchaseorderNum + + ;
if ( customerIdList . size ( ) > 0 ) {
purchaseorderQueryWrapper . lambda ( ) . in ( PurchaseorderitemEntity : : getContractCode , customerIdList ) ;
} else {
purchaseorderQueryWrapper . lambda ( ) . eq ( PurchaseorderitemEntity : : getContractCode , purchaseorderPagination . getPurchaseName ( ) ) ;
}
}
if ( StringUtil . isNotEmpty ( purchaseorderPagination . getSupplierName ( ) ) ) {
QueryWrapper < SupplierEntity > customerQueryWrapper = new QueryWrapper < > ( ) ;
customerQueryWrapper . lambda ( ) . like ( SupplierEntity : : getSupplierName , purchaseorderPagination . getSupplierName ( ) ) ;
customerQueryWrapper . lambda ( ) . select ( SupplierEntity : : getId ) ;
List < String > customerIdList = supplierService . listObjs ( customerQueryWrapper ) . stream ( ) . map ( o - > ( String ) o ) . collect ( Collectors . toList ( ) ) ;
purchaseorderNum + + ;
if ( customerIdList . size ( ) > 0 ) {
purchaseorderQueryWrapper . lambda ( ) . in ( PurchaseorderitemEntity : : getSupplierId , customerIdList ) ;
} else {
purchaseorderQueryWrapper . lambda ( ) . eq ( PurchaseorderitemEntity : : getSupplierId , purchaseorderPagination . getSupplierName ( ) ) ;
}
}
if ( AllIdList . size ( ) > 0 ) {
purchaseorderQueryWrapper . lambda ( ) . in ( PurchaseorderitemEntity : : getId , AllIdList ) ;
}
//排序
if ( StringUtil . isEmpty ( purchaseorderPagination . getSidx ( ) ) ) {
purchaseorderQueryWrapper . lambda ( ) . orderByDesc ( PurchaseorderitemEntity : : getId ) ;
purchaseorderQueryWrapper . lambda ( ) . orderByDesc ( PurchaseorderitemEntity : : getId ) ;
} else {
try {
String sidx = purchaseorderPagination . getSidx ( ) ;
@ -864,13 +936,13 @@ if (pMap!=null&&pMap.size()>0){
}
}
if ( ( total > 0 & & AllIdList . size ( ) > 0 ) | | total = = 0 ) {
Page < PurchaseorderitemEntity > page = new Page < > ( purchaseorderPagination . getCurrentPage ( ) , purchaseorderPagination . getPageSize ( ) ) ;
IPage < PurchaseorderitemEntity > userIPage = this . page ( page , purchaseorderQueryWrapper ) ;
return purchaseorderPagination . setData ( userIPage . getRecords ( ) , userIPage . getTotal ( ) ) ;
Page < PurchaseorderitemEntity > page = new Page < > ( purchaseorderPagination . getCurrentPage ( ) , purchaseorderPagination . getPageSize ( ) ) ;
IPage < PurchaseorderitemEntity > userIPage = this . page ( page , purchaseorderQueryWrapper ) ;
return purchaseorderPagination . setData ( userIPage . getRecords ( ) , userIPage . getTotal ( ) ) ;
} else {
List < PurchaseorderitemEntity > list = new ArrayList ( ) ;
return purchaseorderPagination . setData ( list , list . size ( ) ) ;
}
} * /
}
@Override
public List < PurchaseorderitemEntity > getTypeList ( PurchaseorderPagination purchaseorderPagination , String dataType ) {