feature:用友回写支持逗号分割

reBack
路明慧 11 months ago
parent b3e494ed7b
commit 5c151a08ff
  1. 38
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/impl/YyOrderServiceImpl.java

@ -295,20 +295,34 @@ public class YyOrderServiceImpl implements OrderService {
DynamicContextHolder.push(ConfigureConstant.MAIN); DynamicContextHolder.push(ConfigureConstant.MAIN);
tInvoiceInvmapMapper.deleteBackMsg(fphm); tInvoiceInvmapMapper.deleteBackMsg(fphm);
for (NewTable newTable : newTableList) { for (NewTable newTable : newTableList) {
DynamicContextHolder.push(nsrsbh); //判断是否存在逗号
List<InvoiceBpmmap> ddbhList = yyOrderMapper.getDdbh(newTable.getCDLCode()); log.debug("cdlCode:{}", newTable.getCDLCode());
log.debug("查询到中间表信息:{}", JSON.toJSONString(ddbhList)); List<String> ddhList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(ddbhList)) { if (newTable.getCDLCode().contains(",") || newTable.getCDLCode().contains(",")){
for (InvoiceBpmmap invoiceBpmmap : ddbhList) { String[] ddhs = newTable.getCDLCode().replace(",", ",").split(",");
NewTable newTableFull = new NewTable(); ddhList = Arrays.asList(ddhs);
BeanUtil.copyProperties(newTable, newTableFull); }else {
newTableFull.setBpmNo(invoiceBpmmap.getBpmno()); ddhList.add(newTable.getCDLCode());
newTableFull.setBpmlsNo(invoiceBpmmap.getBpmlsno()); }
DynamicContextHolder.push(ConfigureConstant.MAIN); log.debug("cdlCodeList:{}", JSON.toJSONString(ddhList));
count += tInvoiceInvmapMapper.insertBackMsg(newTableFull); for (String cdlCode : ddhList) {
} DynamicContextHolder.push(nsrsbh);
List<InvoiceBpmmap> ddbhList = yyOrderMapper.getDdbh(cdlCode);
log.debug("查询到中间表信息:{}", JSON.toJSONString(ddbhList));
if (CollectionUtils.isNotEmpty(ddbhList)) {
for (InvoiceBpmmap invoiceBpmmap : ddbhList) {
NewTable newTableFull = new NewTable();
BeanUtil.copyProperties(newTable, newTableFull);
newTableFull.setBpmNo(invoiceBpmmap.getBpmno());
newTableFull.setBpmlsNo(invoiceBpmmap.getBpmlsno());
newTableFull.setCDLCode(cdlCode);
DynamicContextHolder.push(ConfigureConstant.MAIN);
count += tInvoiceInvmapMapper.insertBackMsg(newTableFull);
}
}
} }
} }
return count; return count;

Loading…
Cancel
Save