fix:配件合同費用分攤報錯處理

This commit is contained in:
ljw 2024-09-29 21:53:45 +08:00
parent 8d91b96515
commit f7c690b4f1
2 changed files with 18 additions and 15 deletions

View File

@ -407,12 +407,15 @@ public class SalesOrderPJEdit extends AbstractBillPlugIn implements Plugin, Befo
for (Integer i : seq) {
BigDecimal safobamount = (BigDecimal) model.getValue("yem_safobamount", i);
BigDecimal calc = BigDecimalUtils.div(safobamount, amount, 12).multiply(sumedamount).setScale(2, RoundingMode.HALF_UP);
String yemBilltype = (String) model.getValue("yem_billtype.billno");
if (i == seq.size() - 1 && ("yem_es_salesorder_nmpj".equals(yemBilltype)||"yem_es_salesorder_PJ".equals(yemBilltype))) {
model.setValue("yem_totalamount", sumedamount.subtract(excludeLastRow), i);
} else {
model.setValue("yem_totalamount", calc, i);
excludeLastRow = excludeLastRow.add(calc);
DynamicObject yemBilltype = (DynamicObject) model.getValue("yem_billtype");
String number = yemBilltype.getString("number");
if ( ("yem_es_salesorder_nmpj".equals(number)||"yem_es_salesorder_PJ".equals(number))) {
if (i == seq.size() - 1) {
model.setValue("yem_totalamount", sumedamount.subtract(excludeLastRow), i);
} else {
model.setValue("yem_totalamount", calc, i);
excludeLastRow = excludeLastRow.add(calc);
}
}
}
}

View File

@ -20,17 +20,17 @@ public class Application {
cosmic.setWebPath("D:/Cosine/Comics_Debug/Comics_YXZG/YXZG-server/webapp");
////152
cosmic.setClusterNumber("yxzg-topview-dev");
cosmic.setTenantNumber("yxzg-topview-dev");
cosmic.setServerIP("10.64.112.152");
cosmic.setFileServerPathIPAndPort("", "");
cosmic.setConfigUrl("10.64.112.152:2181", "zookeeper", "Cosmic@5092");
// cosmic.setClusterNumber("yxzg-topview-dev");
// cosmic.setTenantNumber("yxzg-topview-dev");
// cosmic.setServerIP("10.64.112.152");
// cosmic.setFileServerPathIPAndPort("", "");
// cosmic.setConfigUrl("10.64.112.152:2181", "zookeeper", "Cosmic@5092");
System.setProperty("mq.debug.queue.tag", "wrxtest");
////134
// cosmic.setClusterNumber("yxzg-prod");
// cosmic.setTenantNumber("yxzg-prod");
// cosmic.setServerIP("10.64.111.134");
// cosmic.setConfigUrl("10.64.111.134:2181","zookeeper","d@f*g:SGVsbG8==U4HRwjlqTOp0p9b60T+T8D2fQ8ThQgJLu/qgfLyLgknPa2RwYXNzd29yZA==");
cosmic.setClusterNumber("yxzg-prod");
cosmic.setTenantNumber("yxzg-prod");
cosmic.setServerIP("10.64.111.134");
cosmic.setConfigUrl("10.64.111.134:2181","zookeeper","d@f*g:SGVsbG8==U4HRwjlqTOp0p9b60T+T8D2fQ8ThQgJLu/qgfLyLgknPa2RwYXNzd29yZA==");
cosmic.setStartWithQing(false);
cosmic.start();