更新一汽丰田费用
parent
b465423508
commit
4c8e54f725
|
|
@ -8,6 +8,7 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
|
@ -1074,20 +1075,9 @@ public class DefaultOrderManager extends DefaultBaseManager implements
|
|||
public void availableTransOrderSB(List<Long> ids, Boolean equipment,
|
||||
String userName) {
|
||||
Long startTime = System.currentTimeMillis();
|
||||
// int i=1;//九江
|
||||
// int j=1;//非九江
|
||||
Order o = commonDao.get(Order.class, ids.get(0));
|
||||
Boolean is_yqft=Boolean.FALSE;
|
||||
if(o.getConsignor().getCode().equals("YQFT")){
|
||||
System.out.println("===生成一汽丰田费用===="+new Date());
|
||||
createYQFT_JJFee(o);
|
||||
createYQFT_FJJFee(o);
|
||||
is_yqft=Boolean.TRUE;
|
||||
System.out.println("===生成一汽丰田费用结束===="+new Date());
|
||||
}
|
||||
for (Long id : ids) {
|
||||
Order order = commonDao.get(Order.class, id);
|
||||
System.out.println(order.getRelateBill3()+"===生效===="+new Date());
|
||||
if (order.getStatus().equals("INPUT")
|
||||
|| order.getStatus().equals("CHECKED")
|
||||
|| order.getStatus().equals("AVAILABLE")) {
|
||||
|
|
@ -1102,28 +1092,22 @@ public class DefaultOrderManager extends DefaultBaseManager implements
|
|||
order.setVolume(DoubleUtils.formatByPrecision(
|
||||
order.getVolumeTwo(), 7));
|
||||
}
|
||||
System.out.println("===1===="+new Date());
|
||||
|
||||
orderPrescription(order);
|
||||
System.out.println("===2===="+new Date());
|
||||
publishEdiServerAvailableOrder(order);
|
||||
System.out.println("===3===="+new Date());
|
||||
if (order.getCash() > 0) {
|
||||
FeeType ft = getFeeType(SysCodeValue.YS_FYKM);
|
||||
feeManager.createFee(id, BillObjectType.ORDER, ft, "CASH",
|
||||
0, userName);
|
||||
}
|
||||
System.out.println("===4===="+new Date());
|
||||
if (order.getFee11() > 0) {
|
||||
feeManager.saveInputFee(id, BillObjectType.ORDER, null,
|
||||
"代收运费", order.getFee11());
|
||||
}
|
||||
System.out.println("===6===="+new Date());
|
||||
if(!is_yqft){
|
||||
createCusFee(order);
|
||||
feeManager.refreshBillFee(order.getId(), BillObjectType.ORDER,
|
||||
Boolean.TRUE);
|
||||
}
|
||||
System.out.println("===7===="+new Date());
|
||||
|
||||
if (!equipment) {
|
||||
operationHisManager.storeOperationHis(order.getId(), order
|
||||
.getRelateBill3(), null, null, "订单管理-订单维护",
|
||||
|
|
@ -1134,7 +1118,6 @@ public class DefaultOrderManager extends DefaultBaseManager implements
|
|||
order.getQuantity(), order.getWeight(),
|
||||
order.getVolume(), 0, order
|
||||
.getDescription(), "TMS");
|
||||
System.out.println("===1===="+new Date());
|
||||
}
|
||||
// if (order.getContractor().isBeSale()) {
|
||||
// List<Legs> legs = this.commonDao.findByQuery(
|
||||
|
|
@ -8592,46 +8575,10 @@ public class DefaultOrderManager extends DefaultBaseManager implements
|
|||
|
||||
}
|
||||
|
||||
void createYQFT_JJFee(Order order) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
List<Order> orders = commonDao
|
||||
.findByQuery(" from Order o where o.consignor.id=:id and to_char(o.planFromDate,'yyyy-MM-dd')=:planFromDate and o.toCityCountiy.name='九江市' ",
|
||||
new String[] { "id", "planFromDate" },
|
||||
new Object[] { order.getConsignor().getId(),
|
||||
sdf.format(order.getPlanFromDate()) });
|
||||
double ysf = 1500.00 / orders.size();
|
||||
for (Order o : orders) {
|
||||
feeManager.saveInputFee(o.getId(), BillObjectType.ORDER,
|
||||
null, "运输费", ysf);
|
||||
feeManager.refreshBillFee(o.getId(), BillObjectType.ORDER,
|
||||
Boolean.TRUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void createYQFT_FJJFee(Order order) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
List<Order> orders = commonDao
|
||||
.findByQuery(" from Order o where o.consignor.id=:id and to_char(o.planFromDate,'yyyy-MM-dd')=:planFromDate and o.toCityCountiy.name!='九江市' ",
|
||||
new String[] { "id", "planFromDate" },
|
||||
new Object[] { order.getConsignor().getId(),
|
||||
sdf.format(order.getPlanFromDate()) });
|
||||
double ysf = 900.00 / orders.size();
|
||||
for (Order o : orders) {
|
||||
feeManager.saveInputFee(o.getId(), BillObjectType.ORDER,
|
||||
null, "运输费", ysf);
|
||||
feeManager.refreshBillFee(o.getId(), BillObjectType.ORDER,
|
||||
Boolean.TRUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void createYQFTFee(Order order) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
createhhFTFee(order);
|
||||
/*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
System.out.println("===费用结算"+i+++"==="+new Date());
|
||||
if (order.getToCityCountiy().getName().equals("九江市")) {
|
||||
|
|
@ -8688,7 +8635,7 @@ public class DefaultOrderManager extends DefaultBaseManager implements
|
|||
System.out.println("5==="+i+++"==="+new Date());
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void createYCCQFee(Order order) {
|
||||
|
|
@ -8919,11 +8866,8 @@ public class DefaultOrderManager extends DefaultBaseManager implements
|
|||
|
||||
void createhhFTFee(Order order) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String province = "";
|
||||
if (order.getExtends1() != null) {
|
||||
|
||||
} else {
|
||||
throw new BusinessException("计费车型不能为空,请维护!");
|
||||
if (order.getExtends1() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 总体积
|
||||
|
|
@ -8934,12 +8878,24 @@ public class DefaultOrderManager extends DefaultBaseManager implements
|
|||
new Object[] { order.getConsignor().getId(),
|
||||
sdf.format(order.getPlanFromDate()),
|
||||
order.getExtends1().getId() }).get(0);
|
||||
|
||||
double price = Double.parseDouble(order.getExtends1().getDescription());// 车型价格
|
||||
|
||||
double ysf = price / zvolume * order.getVolume();
|
||||
feeManager.saveInputFee(order.getId(), BillObjectType.ORDER, null,
|
||||
"运输费", ysf);
|
||||
// 车型单价
|
||||
double price = Double.parseDouble(order.getExtends1().getDescription());
|
||||
//订单体积
|
||||
double volumeOrder = order.getVolume();
|
||||
|
||||
// 将double值转换为BigDecimal对象进行精确计算
|
||||
BigDecimal priceBD = new BigDecimal(Double.toString(price));
|
||||
BigDecimal zvolumeBD = new BigDecimal(Double.toString(zvolume));
|
||||
BigDecimal volumeOrderBD = new BigDecimal(Double.toString(volumeOrder));
|
||||
|
||||
// 进行计算,先做除法再做乘法;price / zvolume * order.getVolume();
|
||||
BigDecimal resultBD = priceBD.divide(zvolumeBD, BigDecimal.ROUND_HALF_UP) .multiply(volumeOrderBD);
|
||||
|
||||
//将结果转换回double
|
||||
double ysf = resultBD.doubleValue();
|
||||
|
||||
feeManager.saveInputFee(order.getId(), BillObjectType.ORDER, null,"运输费", ysf);
|
||||
|
||||
}
|
||||
|
||||
public void createFee(double zj, double volume, Order order) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<columns>
|
||||
<column id="vehicleType.id" title="vehicleType.id" visible="false" horizonAlign="center" verticalAlign="middle"/>
|
||||
<column id="vehicleType.name" title="vehicleType.name" visible="true" horizonAlign="center" verticalAlign="middle"/>
|
||||
<column id="vehicleType.description" title="vehicleType.description" visible="true" horizonAlign="center" verticalAlign="middle"/>
|
||||
<column id="vehicleType.description" title="单价" visible="true" horizonAlign="center" verticalAlign="middle"/>
|
||||
<column id="vehicleType.disabled" title="vehicleType.disabled" visible="true" horizonAlign="center" verticalAlign="middle" format="booleanFormat" formatParam="disabled" sortType="ASC"/>
|
||||
</columns>
|
||||
<buttons>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue