Commit 268e666b by liuyang

2024-09-25

1.修改金额小数2位数
parent 1a6727a2
......@@ -147,7 +147,7 @@ public class ServiceHGCW002 extends ServiceBase {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw003.getTotalPriceIncluding());
}
valueAddedTax = totalContractPriceIncluding.subtract(totalContractPriceExcluding);
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW002.setTotalContractPriceExcluding(new BigDecimal(decimalFormat.format(totalContractPriceExcluding)));
HGCW002.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
HGCW002.setValueAddedTax(new BigDecimal(decimalFormat.format(valueAddedTax)));
......
......@@ -178,7 +178,7 @@ public class ServiceHGCW003 extends ServiceBase {
List<Map> resultRows = inInfo.getBlock("result1").getRows();
List<HGCW003> hgcw003List = new ArrayList<>();
BigDecimal taxPoints = NumberUtils.toBigDecimal(inInfo.getString("taxPoints"));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
......
......@@ -197,7 +197,7 @@ public class ServiceHGCW010 extends ServiceBase {
}
//获取相应的数据
List<HGCW011> hgcw011List = HGCWTools.HgCw011.mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
if (CollectionUtils.isNotEmpty(hgcw011List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
......
......@@ -84,7 +84,7 @@ public class ServiceHGCW010D extends ServiceEPBase {
}
//获取相应的数据
List<HGCW011> hgcw011List = mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
if (CollectionUtils.isNotEmpty(hgcw011List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
......
......@@ -83,7 +83,7 @@ public class ServiceHGCW010E extends ServiceEPBase {
}
//获取相应的数据
List<HGCW011> hgcw011List = mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
if (CollectionUtils.isNotEmpty(hgcw011List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
......
......@@ -270,7 +270,7 @@ public class ServiceHGCW012 extends ServiceBase {
}
//获取相应的数据
List<HGCW013> hgcw013List = HGCWTools.HgCw013.mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
if (CollectionUtils.isNotEmpty(hgcw013List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
......@@ -474,7 +474,7 @@ public class ServiceHGCW012 extends ServiceBase {
}
//获取相应的数据
List<HGCW013> hgcw013List = HGCWTools.HgCw013.mapTofList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
if (CollectionUtils.isNotEmpty(hgcw013List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
......
......@@ -179,7 +179,7 @@ public class ServiceHGCW014 extends ServiceBase {
}
//获取相应的数据
List<HGCW015> hgcw015List = HGCWTools.HgCw015.mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
if (CollectionUtils.isNotEmpty(hgcw015List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
......
......@@ -174,7 +174,7 @@ public class ServiceHGCW016 extends ServiceBase {
}
//获取相应的数据
List<HGCW017> hgcw017List = HGCWTools.HgCw017.mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
if (CollectionUtils.isNotEmpty(hgcw017List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
......
......@@ -354,7 +354,7 @@ public class HGCWTools {
}
BigDecimal totalAmount = HgCw011.sumSettlementNumber(Collections.singletonList(contractNumber)); //获取累计开票金额
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW002 hgcw002 = results.get(0);
BigDecimal remaining = hgcw002.getTotalContractPriceIncluding();
//获取销售合同金额和补充协议金额
......@@ -432,7 +432,7 @@ public class HGCWTools {
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的结算单!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW006 hgcw006 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(hgcw006.getRemainingAmount().subtract(deductionAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
......@@ -513,7 +513,7 @@ public class HGCWTools {
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的结算单!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW008 hgcw008 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(hgcw008.getRemainingAmount().subtract(deductionAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
......@@ -549,7 +549,7 @@ public class HGCWTools {
List<String> stringList = cw008List.stream().map(HGCW008::getSettlementNumber).collect(Collectors.toList());
BigDecimal totalAmount = HgCw011.sumSettlementNumber(stringList); //获取累计开票金额
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW002 hgcw002 = hgcw002s.get(0);
BigDecimal remaining = hgcw002.getTotalContractPriceIncluding();
//获取销售合同金额和补充协议金额
......@@ -605,7 +605,7 @@ public class HGCWTools {
BigDecimal totalAmount08 = cw008List.stream().map(HGCW008::getThisPriceTax).reduce(BigDecimal.ZERO,BigDecimal::add);
//获取销售开票累计开票金额
BigDecimal totalAmount11 =hgcw011List.size() == 0 ? BigDecimal.ZERO : hgcw011List.stream().map(HGCW011::getTotalContractPriceIncluding).reduce(BigDecimal.ZERO,BigDecimal::add);
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
//合同总金额-(累计开票金额+本次来票金额)
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(remaining.subtract(deductionAmount.add(totalAmount08.add(totalAmount11)))));
......@@ -692,7 +692,7 @@ public class HGCWTools {
*/
public static void calculateAmount(String settlementNumber){
AssertUtils.isNull(settlementNumber, "结算单号不能为空!");
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
List<HGCW008> HGCW008List = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);}
});
......@@ -824,7 +824,7 @@ public class HGCWTools {
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的销售开票记录!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW010 HGCW010 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(HGCW010.getRemainingAmount().subtract(cutAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
......@@ -849,7 +849,7 @@ public class HGCWTools {
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的销售开票记录!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW010 HGCW010 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(HGCW010.getRemainingAmount().subtract(cutAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
......@@ -963,7 +963,7 @@ public class HGCWTools {
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的采购收票记录!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW012 HGCW012 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(HGCW012.getRemainingAmount().subtract(cutAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
......@@ -1093,7 +1093,7 @@ public class HGCWTools {
}
public static void countTaxAmount(List<Map> rows,HGCW012 hgcw012,Map<String, BigDecimal> rowMap) {
DecimalFormat decimalFormat = new DecimalFormat("#.000");
DecimalFormat decimalFormat = new DecimalFormat("#.00");
StringBuffer settlementNumber = new StringBuffer();
BigDecimal thisAmount = BigDecimal.ZERO;
BigDecimal taxPoints = new BigDecimal("13"); // 假设这是以整数形式给出的税率,比如17表示17%
......
Markdown is supported
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