md
This commit is contained in:
parent
8bfd328ee6
commit
114a94b37b
@ -11,6 +11,7 @@
|
|||||||
package com.xdadan.erp.emis.service.impl;
|
package com.xdadan.erp.emis.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -485,6 +486,8 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
|||||||
double volumeWeight=0.0D;
|
double volumeWeight=0.0D;
|
||||||
if(!StringUtils.isEmpty(emisTransLine.getMeterRate())) {
|
if(!StringUtils.isEmpty(emisTransLine.getMeterRate())) {
|
||||||
volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate()));
|
volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate()));
|
||||||
|
DecimalFormat df = new DecimalFormat("#.#####");
|
||||||
|
volumeWeight= Double.parseDouble(df.format(volumeWeight));
|
||||||
}else{
|
}else{
|
||||||
volumeWeight=billWeight;
|
volumeWeight=billWeight;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,9 +4,13 @@ import cn.hutool.core.lang.Snowflake;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
public class WaybillHelper {
|
public class WaybillHelper {
|
||||||
|
|
||||||
|
// 5位小数
|
||||||
|
public static DecimalFormat dfCalc = new DecimalFormat("#.#####");
|
||||||
|
|
||||||
public static String genOrderSn(){
|
public static String genOrderSn(){
|
||||||
Snowflake snowflake = IdUtil.getSnowflake(0, 0);
|
Snowflake snowflake = IdUtil.getSnowflake(0, 0);
|
||||||
Long orderId = snowflake.nextId();
|
Long orderId = snowflake.nextId();
|
||||||
@ -55,6 +59,8 @@ public class WaybillHelper {
|
|||||||
setteldWeight=weight;
|
setteldWeight=weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setteldWeight= Double.parseDouble(dfCalc.format(setteldWeight));
|
||||||
|
|
||||||
return setteldWeight;
|
return setteldWeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +114,7 @@ public class WaybillHelper {
|
|||||||
settledFee = fee;
|
settledFee = fee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settledFee= Double.parseDouble(dfCalc.format(settledFee));
|
||||||
return settledFee;
|
return settledFee;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,8 +124,14 @@ public class WaybillHelper {
|
|||||||
// 1.02*10 = 10.2 , 1.11*10 = 11.1
|
// 1.02*10 = 10.2 , 1.11*10 = 11.1
|
||||||
// 0.2
|
// 0.2
|
||||||
|
|
||||||
// double w=calcSettledWeight(1.005D,"2");
|
double m=0.000001D;
|
||||||
double w=calcSettledFee(1.49D,"2");
|
double vw=m*(1000000.0D/5000.0D);
|
||||||
System.out.println(w);
|
double d= Double.parseDouble(dfCalc.format(vw));
|
||||||
|
// get_double = Double.parseDouble(df.format(result_value));
|
||||||
|
// vw 1.005D
|
||||||
|
// double w=calcSettledWeight(vw,"2");
|
||||||
|
// double w=calcSettledFee(1.49D,"2");
|
||||||
|
// System.out.println(w);
|
||||||
|
System.out.println(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user