@ -141,6 +141,7 @@ public class BaseInvoiceController extends AbstractController {
String businessCode = ( String ) map . get ( "businessCode" ) ;
String qsr = ( String ) map . get ( "qsr" ) ;
String rzhr = ( String ) map . get ( "rzhr" ) ;
String taxRate = ( String ) map . get ( "taxRate" ) ;
String inAccountStatus = ( String ) map . get ( "inAccountStatus" ) ;
int curr = ( int ) map . get ( "curr" ) ;
int size = ( int ) map . get ( "size" ) ;
@ -203,6 +204,13 @@ public class BaseInvoiceController extends AbstractController {
gfshList = UserInfoUtil . getGfshAll ( getUserInfo ( ) . getOrg ( ) ) ;
}
pramsMap . put ( "gfsh" , gfshList ) ;
boolean flag = checkList ( gfshList ) ;
if ( flag ) {
pramsMap . put ( "sign" , "88" ) ;
log . info ( "登陆账号无税号" ) ;
}
//所属组织
// List<String> companyCodeList = new ArrayList<>();
// if (StringUtils.isNotBlank(companyCode)){
@ -218,6 +226,12 @@ public class BaseInvoiceController extends AbstractController {
pramsMap . put ( "companyCode" , companyCode ) ;
}
if ( ! StringUtils . isNotBlank ( taxRate ) & & ! "99" . equals ( taxRate ) ) {
List < String > rates = new ArrayList < > ( ) ;
rates = convertRates ( taxRate , rates ) ;
pramsMap . put ( "taxRate" , rates ) ;
}
if ( ! StringHelper . isBlank ( invoiceType ) ) {
if ( ! "99" . equals ( invoiceType ) ) {
pramsMap . put ( "invoiceType" , invoiceType ) ;
@ -496,6 +510,7 @@ public class BaseInvoiceController extends AbstractController {
String suspendStatus = ( String ) map . get ( "suspendStastus" ) ;
String suspendDate = ( String ) map . get ( "suspendDate" ) ;
String bzr = ( String ) map . get ( "bzr" ) ;
String taxRate = ( String ) map . get ( "taxRate" ) ;
if ( StringUtils . isNotEmpty ( suspendDate ) & & suspendDate . length ( ) > 7 ) {
suspendDate = suspendDate . substring ( 0 , 7 ) ;
}
@ -559,6 +574,12 @@ public class BaseInvoiceController extends AbstractController {
if ( ! StringUtils . isNotBlank ( gfsh ) ) {
pramsMap . put ( "sign" , "88" ) ;
}
if ( ! StringUtils . isNotBlank ( taxRate ) & & ! "99" . equals ( taxRate ) ) {
List < String > rates = new ArrayList < > ( ) ;
rates = convertRates ( taxRate , rates ) ;
pramsMap . put ( "taxRate" , rates ) ;
}
List < String > gfshList = new ArrayList < > ( ) ;
if ( ! "99" . equals ( gfsh ) & & StringUtils . isNotBlank ( gfsh ) ) {
gfshList . add ( gfsh ) ;
@ -570,6 +591,14 @@ public class BaseInvoiceController extends AbstractController {
}
pramsMap . put ( "gfsh" , gfshList ) ;
boolean flag = checkList ( gfshList ) ;
log . info ( "gfshList.size(){}" , gfshList . size ( ) ) ;
if ( flag ) {
pramsMap . put ( "sign" , "88" ) ;
log . info ( "登陆账号无税号" ) ;
}
//所属组织
// List<String> companyCodeList = new ArrayList<>();
// if (StringUtils.isNotBlank(companyCode) && !"99".equals(companyCode)){
@ -679,6 +708,75 @@ public class BaseInvoiceController extends AbstractController {
}
private List < String > convertRates ( String taxRate , List < String > rates ) {
switch ( taxRate ) {
case "0" :
rates . add ( "0" ) ;
break ;
case "1.5" :
rates . add ( "1.5" ) ;
break ;
case "2" :
rates . add ( "2" ) ;
rates . add ( "0.02" ) ;
break ;
case "3" :
rates . add ( "3" ) ;
rates . add ( "0.03" ) ;
break ;
case "5" :
rates . add ( "5" ) ;
rates . add ( "0.05" ) ;
break ;
case "6" :
rates . add ( "6" ) ;
rates . add ( "0.06" ) ;
break ;
case "9" :
rates . add ( "9" ) ;
rates . add ( "0.09" ) ;
break ;
case "10" :
rates . add ( "10" ) ;
rates . add ( "0.10" ) ;
break ;
case "13" :
rates . add ( "13" ) ;
rates . add ( "0.13" ) ;
break ;
case "16" :
rates . add ( "16" ) ;
rates . add ( "0.16" ) ;
break ;
case "17" :
rates . add ( "17" ) ;
rates . add ( "0.17" ) ;
break ;
default :
break ;
}
return rates ;
}
public boolean checkList ( List < String > list ) {
boolean flag = false ;
if ( list = = null | | list . isEmpty ( ) ) {
flag = true ;
} else {
String s = list . toString ( ) . replace ( "[" , "" ) . replace ( "]" , "" ) ;
if ( StringHelper . isBlank ( s ) ) {
flag = true ;
}
if ( StringHelper . isNotBlank ( s ) & & s . contains ( "," ) ) {
String replace = s . replace ( "," , "" ) ;
if ( StringHelper . isBlank ( replace ) ) {
flag = true ;
}
}
}
return flag ;
}
/ * *
* 智能勾选查询 qsfs 默认传9
*