Revert "fix:"

This reverts commit 32cb30599b.
This commit is contained in:
ljw 2025-01-21 11:32:43 +08:00
parent 32cb30599b
commit 5f956640fa

View File

@ -52,42 +52,22 @@ public class DebCredNewSubmitOp extends AbstractOperationServicePlugIn {
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
super.beforeExecuteOperationTransaction(e);
for (ExtendedDataEntity dataEntity : e.getSelectedRows()) {
DynamicObject dynamicObject = dataEntity.getDataEntity();
DynamicObject billObj = BusinessDataServiceHelper.loadSingle(dynamicObject.getPkValue(), dynamicObject.getDynamicObjectType().getName());
DynamicObject yemCurrency = billObj.getDynamicObject("yem_currency");
getlast(dynamicObject);
if (yemCurrency != null) {
/*
1如果结算币别=美元
 扣减后金额美元=上次美元金额实际+ 配件资金池增加金额-配件资金池扣减金额
 扣减后金额人民币= 上次人民币金额实际
2如果结算币别=人民币
 扣减后金额美元=上次美元金额实际
 扣减后金额人民币= 上次人民币金额实际+ 配件资金池增加金额-配件资金池扣减金额
*/
}
SaveServiceHelper.update(dynamicObject);
DynamicObject billObj = dataEntity.getDataEntity();
getlast(billObj);
}
}
/**
* 计算上次美元金额实际 上次人民币金额实际
*
* 计算上次美元金额实际 上次人民币金额实际
* @param temp
*/
public void getlast(DynamicObject temp) {
public void getlast(DynamicObject temp){
temp = BusinessDataServiceHelper.loadSingle(temp.getPkValue(), temp.getDynamicObjectType().getName());
DynamicObject yemCurrency = temp.getDynamicObject("yem_currency");
//借贷业务类型
DynamicObject yem_credittype = temp.getDynamicObject("yem_credittype");
//集团客户
DynamicObject yem_customer = temp.getDynamicObject("yem_groupcusfields");
//产品类型
DynamicObject yem_bd_products = temp.getDynamicObject("yem_bd_products");
BigDecimal yemAmount = temp.getBigDecimal("yem_amount");//配件资金池增加金额
BigDecimal yemAmountSub = temp.getBigDecimal("yem_amount_sub");//配件资金池扣减金额
QFilter qFilter1 = new QFilter("billstatus", QCP.equals, "C");
qFilter1.and(new QFilter("yem_credittype.id", QCP.equals, yem_credittype.getLong("id")));
qFilter1.and(new QFilter("yem_groupcusfields.id", QCP.equals, yem_customer.getLong("id")));
@ -152,31 +132,10 @@ public class DebCredNewSubmitOp extends AbstractOperationServicePlugIn {
String number = yem_em_replace.getString("number");
if (number.equals("CNY")) {
temp.set("yem_creditrmbamt", bigDecimal);
if (yemCurrency != null) {
String numbers = yemCurrency.getString("number");
if ("CNY".equals(numbers)) {
// temp.set("yem_koujianusd", bigDecimal);
temp.set("yem_koujiancny", bigDecimal.add(yemAmount.subtract(yemAmountSub)));
} else if ("USD".equals(numbers)) {
// temp.set("yem_koujianusd", bigDecimal.add(yemAmount.subtract(yemAmountSub)));
temp.set("yem_koujiancny", bigDecimal);
}
}
}
if (number.equals("USD")) {
temp.set("yem_creditusdamt", bigDecimal);
if (yemCurrency != null) {
String numbers = yemCurrency.getString("number");
if ("CNY".equals(numbers)) {
temp.set("yem_koujianusd", bigDecimal);
// temp.set("yem_koujiancny", bigDecimal.add(yemAmount.subtract(yemAmountSub)));
} else if ("USD".equals(numbers)) {
temp.set("yem_koujianusd", bigDecimal.add(yemAmount.subtract(yemAmountSub)));
// temp.set("yem_koujiancny", bigDecimal);
}
}
}
}
}
}
@ -195,9 +154,8 @@ public class DebCredNewSubmitOp extends AbstractOperationServicePlugIn {
}
}
}
}
SaveServiceHelper.update(temp);
}
}