|
|
@@ -68,7 +68,7 @@ public class TransferUtils {
|
|
|
invAccountOp.setCardName(outAccountCard.getBankName());
|
|
|
invAccountOp.setProfit(entry.getKey());
|
|
|
invAccountOp.setAccountOperateId(operateId);
|
|
|
- invAccountOp.setMoney(new BigDecimal(String.valueOf(entry.getValue())).multiply(new BigDecimal(applyAmount)).divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP).negate().toString());
|
|
|
+ invAccountOp.setMoney(new BigDecimal(String.valueOf(entry.getValue())).multiply(new BigDecimal(applyAmount)).divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP).toString());
|
|
|
list.add(invAccountOp);
|
|
|
}
|
|
|
}
|
|
|
@@ -80,20 +80,14 @@ public class TransferUtils {
|
|
|
* 转账成功后添加支出账户操作信息
|
|
|
*/
|
|
|
public static InvAccountOperate insertOutAccountOperate(InvAccountExcel insAccountExcel) {
|
|
|
- JSONObject outProfit1 = insAccountExcel.getOutProfit();
|
|
|
//支出公司
|
|
|
InvAccountOperate insAccountOperate = new InvAccountOperate();
|
|
|
InvAccountOperate operate = operate(insAccountExcel, insAccountOperate);
|
|
|
operate.setRevenueOutlay("1");
|
|
|
- JSONObject outProfit = insAccountExcel.getOutProfit();
|
|
|
- for (Map.Entry<String, Object> entry : outProfit.entrySet()) {
|
|
|
- outProfit.put(entry.getKey(), new BigDecimal(String.valueOf(entry.getValue())).negate().toString());
|
|
|
- }
|
|
|
- operate.setOutProfit(outProfit);
|
|
|
+ operate.setOutProfit(insAccountExcel.getOutProfit());
|
|
|
operate.setCreateTime(LocalDateTime.now());
|
|
|
operate.setRemark(insAccountExcel.getRemark());
|
|
|
operate.setOutCardNum(insAccountExcel.getOutCardNum());
|
|
|
- insAccountExcel.setOutProfit(outProfit1);
|
|
|
return operate;
|
|
|
}
|
|
|
|
|
|
@@ -227,11 +221,8 @@ public class TransferUtils {
|
|
|
for (Map.Entry<String, Object> entry : entProfit.entrySet()) {
|
|
|
entAmount = entAmount.add(new BigDecimal(entry.getValue().toString()));
|
|
|
}
|
|
|
- if (!String.valueOf(outAmount).equals("100")) {
|
|
|
- throw new SystemException("支出金额未完全分配");
|
|
|
- }
|
|
|
- if (!String.valueOf(entAmount).equals("100")) {
|
|
|
- throw new SystemException("收入金额未完全分配");
|
|
|
+ if (!(new BigDecimal(String.valueOf(entAmount)).add(new BigDecimal(String.valueOf(outAmount)))).toString().equals("0")) {
|
|
|
+ throw new SystemException("金额未完全分配");
|
|
|
}
|
|
|
return true;
|
|
|
}
|