This commit is contained in:
linfso 2024-06-20 09:57:35 +08:00
parent b249ea5ffa
commit 14d191d504

View File

@ -68,7 +68,11 @@ public class WaybillHelper {
else if("2".equals(carryType)){ else if("2".equals(carryType)){
int intWeight = (int) Math.floor(weight); int intWeight = (int) Math.floor(weight);
double tHasWeight = weight - (double)intWeight; double tHasWeight = weight - (double)intWeight;
if(tHasWeight == 0.5D){
if(tHasWeight == 0.0D ){
setteldWeight=weight;
}
else if(tHasWeight == 0.5D ){
setteldWeight=weight; setteldWeight=weight;
} }
else if(tHasWeight > 0.5D){ else if(tHasWeight > 0.5D){
@ -128,7 +132,10 @@ public class WaybillHelper {
else if("4".equals(priceType)){ else if("4".equals(priceType)){
int intFee = (int) Math.floor(fee); int intFee = (int) Math.floor(fee);
double tHasFee = fee - (double)intFee; double tHasFee = fee - (double)intFee;
if(tHasFee == 0.5D){ if(tHasFee == 0.0D){
settledFee=fee;
}
else if(tHasFee == 0.5D){
settledFee=fee; settledFee=fee;
} }
else if(tHasFee > 0.5D){ else if(tHasFee > 0.5D){
@ -255,8 +262,8 @@ public class WaybillHelper {
// 6000 167 // 6000 167
// 3333 300 // 3333 300
// 5000 0.1 // 5000 0.1
// float volumeWeight=166.667f; float volumeWeight=5.9f;
// System.out.println(WaybillHelper.calcSettledWeight(volumeWeight,"3")); System.out.println(WaybillHelper.calcSettledWeight(volumeWeight,"2"));
// System.out.println(WaybillHelper.calcSettledWeight(volumeWeight,"4")); // System.out.println(WaybillHelper.calcSettledWeight(volumeWeight,"4"));
// System.out.println(removeUnSeeChar(" Phuc)")); // System.out.println(removeUnSeeChar(" Phuc)"));
@ -269,10 +276,10 @@ public class WaybillHelper {
// //
// String str="T123213\n1231232,"; // String str="T123213\n1231232,";
// str=WaybillHelper.formatQueryValue(str); // str=WaybillHelper.formatQueryValue(str);
String billCode="SF9189239821389"; // String billCode="SF9189239821389";
int len=billCode.length(); // int len=billCode.length();
String mainBillCode=billCode.substring(0,len-4); // String mainBillCode=billCode.substring(0,len-4);
System.out.print(mainBillCode); // System.out.print(mainBillCode);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();