bms2相关修改;

This commit is contained in:
王奎兴
2026-03-18 23:27:24 +08:00
parent b7115fe3fe
commit 4f879e3d5a
3 changed files with 40 additions and 1 deletions
@@ -67,4 +67,7 @@ public class SKitem {
@ApiModelProperty( "")
private String def65;
}
@ApiModelProperty( "")
private String def75;
}
@@ -474,6 +474,16 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
.map(BmsMakeOutInvoiceItem::getFeeType)
.filter(java.util.Objects::nonNull)
.collect(java.util.stream.Collectors.joining(""));
// 按 createTime 倒序排序并获取第一条记录
BmsMakeOutInvoiceItem firstItem = bmsMakeOutInvoiceItems.stream()
.sorted((a, b) -> {
if (a.getCreateTime() == null) return 1;
if (b.getCreateTime() == null) return -1;
return b.getCreateTime().compareTo(a.getCreateTime());
})
.findFirst()
.orElse(null);
String salesmanId = reconciliation.getSalesmanId();
String customerUserDept = billManageMapper.getCustomerUserDept(salesmanId);
String deptValue = billManageMapper.getDeptValue(customerUserDept);
@@ -517,6 +527,14 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
item.setScomment("业务部:"+appointShipper+feeTypes);
}
}
// 费用类别
String feeType = firstItem.getFeeType();
String serviceItemsCodeNc = billManageMapper.getServiceItemsCodeNc(feeType);
if (serviceItemsCodeNc != null && !serviceItemsCodeNc.isEmpty()) {
item.setDef75(serviceItemsCodeNc);
} else {
item.setDef75("T10");
}
item.setPk_currtype(settlementCurrencyNcCode);
item.setMoney_cr(String.valueOf(totalInvoiceValue));
item.setMoney_bal(String.valueOf(totalInvoiceValue));
@@ -1157,6 +1157,16 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
.map(TmsMakeOutInvoiceItem::getFeeType)
.filter(java.util.Objects::nonNull)
.collect(java.util.stream.Collectors.joining(""));
// 按 createTime 倒序排序并获取第一条记录
TmsMakeOutInvoiceItem firstItem = list.stream()
.sorted((a, b) -> {
if (a.getCreateTime() == null) return 1;
if (b.getCreateTime() == null) return -1;
return b.getCreateTime().compareTo(a.getCreateTime());
})
.findFirst()
.orElse(null);
String salesmanCodeNc=order.getSalesmanCodeNc();
String salesmanId = order.getSalesmanId();
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
@@ -1200,6 +1210,14 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
item.setScomment("业务部:"+appointShipper+feeTypes);
}
}
// 费用类别
String feeType = firstItem.getFeeType();
String serviceItemsCodeNc = reconciliationMapper.getServiceItemsCodeNc(feeType);
if (serviceItemsCodeNc != null && !serviceItemsCodeNc.isEmpty()) {
item.setDef75(serviceItemsCodeNc);
} else {
item.setDef75("T10");
}
item.setPk_currtype(settlementCurrencyNcCode);
item.setMoney_cr(String.valueOf(totalInvoiceValue));
item.setMoney_bal(String.valueOf(totalInvoiceValue));