|
|
|
@ -22,6 +22,7 @@ import com.dxhy.erp.service.InvoiceAuthService; |
|
|
|
|
import com.dxhy.erp.service.TDxInvoiceReimburseService; |
|
|
|
|
import com.dxhy.erp.utils.CheckUtils; |
|
|
|
|
import com.dxhy.erp.utils.DateUtil; |
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
|
import com.google.common.collect.Maps; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
@ -346,11 +347,14 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, |
|
|
|
|
fplxList.add("14"); |
|
|
|
|
fplxList.add("31"); |
|
|
|
|
fplxList.add("32"); |
|
|
|
|
List<ZDATA> exitList = Lists.newArrayList(); |
|
|
|
|
List<String> notExit = Lists.newArrayList(); |
|
|
|
|
for (ZDATA zdata1 : zdata) { |
|
|
|
|
log.info("zdata1.getZFPHM()===>{}", zdata1.getZFPHM()); |
|
|
|
|
String collect = fplxList.stream().collect(Collectors.joining(",")); |
|
|
|
|
if (!collect.contains(convertFpzldm(zdata1.getZFPLX()))) { |
|
|
|
|
log.info("非增值税先不处理:{}", JSON.toJSONString(zdata1)); |
|
|
|
|
exitList.add(zdata1); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
String fphm = zdata1.getZFPHM(); |
|
|
|
@ -369,16 +373,18 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, |
|
|
|
|
//没法区分来源是不是销项发票
|
|
|
|
|
TdxSaleRecordInvoice tdxSaleRecordInvoice = tdxSaleRecordInvoiceDao.selectByUuid(uuid); |
|
|
|
|
if (recordInvoiceByUuid == null && tDxInvoiceReimburse == null && tdxSaleRecordInvoice == null) { |
|
|
|
|
errorMsg.append("发票号码:" + zdata1.getZFPHM()); |
|
|
|
|
notExit.add(zdata1.getZFPHM()); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
exitList.add(zdata1); |
|
|
|
|
} |
|
|
|
|
if (errorMsg.length() > 1) { |
|
|
|
|
es.setZMESSAGE(errorMsg.toString() + "不存在"); |
|
|
|
|
es.setZTYPE("E"); |
|
|
|
|
return es; |
|
|
|
|
} |
|
|
|
|
log.info("zdata={}",zdata); |
|
|
|
|
for (ZDATA zdata1 : zdata) { |
|
|
|
|
// if (errorMsg.length() > 1) {
|
|
|
|
|
// es.setZMESSAGE(errorMsg.toString() + "不存在");
|
|
|
|
|
// es.setZTYPE("E");
|
|
|
|
|
// return es;
|
|
|
|
|
// }
|
|
|
|
|
log.info("exitList={}",exitList); |
|
|
|
|
for (ZDATA zdata1 : exitList) { |
|
|
|
|
//成功或者失败标识
|
|
|
|
|
boolean flag = false; |
|
|
|
|
log.info("zdata1.getZFPHM():{}", zdata1.getZFPHM()); |
|
|
|
@ -441,10 +447,17 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, |
|
|
|
|
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1,uuid); |
|
|
|
|
tdxSaleRecordInvoiceDao.update(null,updateWrapper); |
|
|
|
|
} |
|
|
|
|
zdataresp.setPROMSG(promsg.toString()); |
|
|
|
|
zdataresp.setPROTYP("S"); |
|
|
|
|
es.setZMESSAGE("处理成功"); |
|
|
|
|
es.setZdata(zdataresp); |
|
|
|
|
//判断是否有底账库不存在发票
|
|
|
|
|
if(notExit.size()>0){ |
|
|
|
|
es.setZTYPE("E"); |
|
|
|
|
errorMsg.append("发票号码:").append(notExit).append("不存在,其余成功"); |
|
|
|
|
es.setZMESSAGE(errorMsg.toString()); |
|
|
|
|
}else { |
|
|
|
|
es.setZMESSAGE("处理成功"); |
|
|
|
|
zdataresp.setPROMSG(promsg.toString()); |
|
|
|
|
zdataresp.setPROTYP("S"); |
|
|
|
|
es.setZdata(zdataresp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return es; |
|
|
|
|
} |
|
|
|
|