Commit 1dc95653 authored by cjl's avatar cjl
Browse files

1、修改double类型为BigDecimal

2、修复sql中大于小于少&出错的问题
parents 6abe4bc8 4afc188b
......@@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -39,10 +40,10 @@ public class AccountHeadService {
if (null != list) {
for (AccountHeadVo4ListEx ah : list) {
if(ah.getChangeamount() != null) {
ah.setChangeamount(Math.abs(ah.getChangeamount()));
ah.setChangeamount(ah.getChangeamount().abs());
}
if(ah.getTotalprice() != null) {
ah.setTotalprice(Math.abs(ah.getTotalprice()));
ah.setTotalprice(ah.getTotalprice().abs());
}
resList.add(ah);
}
......@@ -91,7 +92,7 @@ public class AccountHeadService {
return accountHeadMapper.getMaxId();
}
public Double findAllMoney(Integer supplierId, String type, String mode, String endTime) {
public BigDecimal findAllMoney(Integer supplierId, String type, String mode, String endTime) {
String modeName = "";
if (mode.equals("实际")) {
modeName = "ChangeAmount";
......@@ -107,10 +108,10 @@ public class AccountHeadService {
if (null != list) {
for (AccountHeadVo4ListEx ah : list) {
if(ah.getChangeamount() != null) {
ah.setChangeamount(Math.abs(ah.getChangeamount()));
ah.setChangeamount(ah.getChangeamount().abs());
}
if(ah.getTotalprice() != null) {
ah.setTotalprice(Math.abs(ah.getTotalprice()));
ah.setTotalprice(ah.getTotalprice().abs());
}
resList.add(ah);
}
......
......@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
......@@ -108,13 +109,13 @@ public class AccountItemService {
accountItem.setInoutitemid(tempInsertedJson.getLong("InOutItemId"));
}
if (tempInsertedJson.get("EachAmount") != null && !tempInsertedJson.get("EachAmount").equals("")) {
Double eachAmount = tempInsertedJson.getDouble("EachAmount");
BigDecimal eachAmount = tempInsertedJson.getBigDecimal("EachAmount");
if (listType.equals("付款")) {
eachAmount = 0 - eachAmount;
eachAmount = BigDecimal.ZERO.subtract(eachAmount);
}
accountItem.setEachamount(eachAmount);
} else {
accountItem.setEachamount(0.0);
accountItem.setEachamount(BigDecimal.ZERO);
}
accountItem.setRemark(tempInsertedJson.getString("Remark"));
this.insertAccountItemWithObj(accountItem);
......@@ -139,13 +140,13 @@ public class AccountItemService {
accountItem.setInoutitemid(tempUpdatedJson.getLong("InOutItemId"));
}
if (tempUpdatedJson.get("EachAmount") != null && !tempUpdatedJson.get("EachAmount").equals("")) {
Double eachAmount = tempUpdatedJson.getDouble("EachAmount");
BigDecimal eachAmount = tempUpdatedJson.getBigDecimal("EachAmount");
if (listType.equals("付款")) {
eachAmount = 0 - eachAmount;
eachAmount = BigDecimal.ZERO.subtract(eachAmount);
}
accountItem.setEachamount(eachAmount);
} else {
accountItem.setEachamount(0.0);
accountItem.setEachamount(BigDecimal.ZERO);
}
accountItem.setRemark(tempUpdatedJson.getString("Remark"));
this.updateAccountItemWithObj(accountItem);
......
......@@ -9,7 +9,7 @@
<result column="Number" jdbcType="VARCHAR" property="number" />
<result column="newType" jdbcType="VARCHAR" property="type" />
<result column="supplier" jdbcType="VARCHAR" property="supplierName" />
<result column="ChangeAmount" jdbcType="DOUBLE" property="changeAmount" />
<result column="ChangeAmount" jdbcType="DECIMAL" property="changeAmount" />
<result column="oTime" jdbcType="VARCHAR" property="operTime" />
<result column="AList" jdbcType="VARCHAR" property="aList" />
<result column="AMList" jdbcType="VARCHAR" property="amList" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment