|
|
|
@ -10,6 +10,7 @@ import com.dxhy.common.datasource.config.DynamicContextHolder; |
|
|
|
|
import com.dxhy.common.enums.FplxEnum; |
|
|
|
|
import com.dxhy.common.enums.ReturnCodeEnum; |
|
|
|
|
import com.dxhy.common.service.impl.MpBaseServiceImpl; |
|
|
|
|
import com.dxhy.common.util.StringHelper; |
|
|
|
|
import com.dxhy.common.util.pojo.Authorize; |
|
|
|
|
import com.dxhy.common.util.pojo.GlobalInfo; |
|
|
|
|
import com.dxhy.erp.dao.*; |
|
|
|
@ -341,7 +342,15 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, |
|
|
|
|
fplxList.add("31"); |
|
|
|
|
fplxList.add("32"); |
|
|
|
|
for(ZDATA zdata1:zdata){ |
|
|
|
|
String uuid = zdata1.getZFPDM()+zdata1.getZFPHM(); |
|
|
|
|
log.info("zdata1.getZFPHM()===>{}",zdata1.getZFPHM().length()); |
|
|
|
|
|
|
|
|
|
String fphm = zdata1.getZFPHM(); |
|
|
|
|
if (StringHelper.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){ |
|
|
|
|
fphm = fphm.substring(fphm.length() - 8); |
|
|
|
|
log.info("非全电但是号码"); |
|
|
|
|
} |
|
|
|
|
log.info("发票号码{}",fphm); |
|
|
|
|
String uuid = zdata1.getZFPDM()+fphm; |
|
|
|
|
zdata1.setZFPLX(convertFpzldm(zdata1.getZFPLX())); |
|
|
|
|
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid); |
|
|
|
|
//查询票池
|
|
|
|
@ -363,12 +372,16 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, |
|
|
|
|
for(ZDATA zdata1:zdata){ |
|
|
|
|
//成功或者失败标识
|
|
|
|
|
boolean flag = false; |
|
|
|
|
String uuid = zdata1.getZFPDM()+zdata1.getZFPHM(); |
|
|
|
|
//销项标识
|
|
|
|
|
String xxbs = zdata1.getXXBS(); |
|
|
|
|
log.info("xxbs==>{}",xxbs); |
|
|
|
|
log.info("zdata1.getZFPHM(){}",zdata1.getZFPHM().length()); |
|
|
|
|
String fphm = zdata1.getZFPHM(); |
|
|
|
|
if (StringHelper.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){ |
|
|
|
|
fphm = fphm.substring(fphm.length() - 8); |
|
|
|
|
log.info("非全电但是号码"); |
|
|
|
|
} |
|
|
|
|
log.info("发票号码{}",fphm); |
|
|
|
|
String uuid = zdata1.getZFPDM()+fphm; |
|
|
|
|
DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ); |
|
|
|
|
if(fplxList.contains(zdata1.getZFPLX()) && !"X".equals(xxbs)){ |
|
|
|
|
if(fplxList.contains(zdata1.getZFPLX())){ |
|
|
|
|
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid); |
|
|
|
|
if(recordInvoiceByUuid!=null){ |
|
|
|
|
UpdateWrapper updateWrapper = new UpdateWrapper(); |
|
|
|
@ -424,20 +437,17 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, |
|
|
|
|
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE); |
|
|
|
|
tDxInvoiceReimburseService.getBaseMapper().update(null,updateWrapper); |
|
|
|
|
} |
|
|
|
|
if ("X".equals(xxbs)){ |
|
|
|
|
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE); |
|
|
|
|
UpdateWrapper updateWrapper = new UpdateWrapper(); |
|
|
|
|
updateWrapper.set("sn_voucher_number",zdata1.getBELNR()); |
|
|
|
|
updateWrapper.set("posting_time",zdata1.getBUDAT()); |
|
|
|
|
updateWrapper.set("account_period",zdata1.getBUDAT().substring(0,7)); |
|
|
|
|
updateWrapper.set("bzdh",zdata1.getZBZDH()); |
|
|
|
|
updateWrapper.set("inaccount_status",zdata1.getZYWZT()); |
|
|
|
|
updateWrapper.set("comp_code",zdata1.getZGSDM()); |
|
|
|
|
updateWrapper.set("bzr",zdata1.getZJBRT()); |
|
|
|
|
updateWrapper.eq("uuid",uuid); |
|
|
|
|
tdxSaleRecordInvoiceDao.update(null,updateWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE); |
|
|
|
|
UpdateWrapper updateWrapper = new UpdateWrapper(); |
|
|
|
|
updateWrapper.set("sn_voucher_number",zdata1.getBELNR()); |
|
|
|
|
updateWrapper.set("posting_time",zdata1.getBUDAT()); |
|
|
|
|
updateWrapper.set("account_period",zdata1.getBUDAT().substring(0,7)); |
|
|
|
|
updateWrapper.set("bzdh",zdata1.getZBZDH()); |
|
|
|
|
updateWrapper.set("inaccount_status",zdata1.getZYWZT()); |
|
|
|
|
updateWrapper.set("comp_code",zdata1.getZGSDM()); |
|
|
|
|
updateWrapper.set("bzr",zdata1.getZJBRT()); |
|
|
|
|
updateWrapper.eq("uuid",uuid); |
|
|
|
|
tdxSaleRecordInvoiceDao.update(null,updateWrapper); |
|
|
|
|
if(!flag){ |
|
|
|
|
promsg.append("票据号码:"+zdata1.getZFPHM()+"绑定成功! "); |
|
|
|
|
} |
|
|
|
|