提交 7640851c authored 作者: huningning's avatar huningning

Merge remote-tracking branch 'origin/v5.5_settlement_20231011' into v5.5_settlement_20231011

......@@ -154,15 +154,7 @@ public class OrderChildVO {
@ApiModelProperty(value = "总运费(元)", example = "1.23")
private BigDecimal totalFreight;
public BigDecimal getTotalFreight() {
BigDecimal totalFreight = freightPrice.multiply(weight);
if (unloadNet != null){
totalFreight = freightPrice.multiply(unloadNet.compareTo(loadNet) < 0? unloadNet : loadNet);
BigDecimal dif = unloadNet.subtract(weight);
if (dif.compareTo(BigDecimal.ZERO) < 0){
totalFreight = totalFreight.add(lossPrice.multiply(dif));
}
}
return totalFreight.setScale(2, RoundingMode.HALF_UP);
return freightPrice.multiply(weight).setScale(2, RoundingMode.HALF_UP);
}
}
\ No newline at end of file
......@@ -91,6 +91,8 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
poundAuditDetail.setRemark(param.getRemark());
poundAuditDetail.setId(null);
BigDecimal dif = param.getLoadNet().subtract(orderChild.getLoadNet());
Integer type = OrderChildLogEnum.Type.POUND_AUDIT.getCode();
if(Objects.equals(param.getStatus(), OrderChildPoundAuditEnum.Status.REJECT.getCode())){
type = OrderChildLogEnum.Type.POUND_AUDIT_REJECT.getCode();
......@@ -105,8 +107,6 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
orderChild.setUnloadNet(param.getUnloadNet());
}
}
BigDecimal dif = orderChild.getLoadNet().subtract(orderChild.getWeight());
orderChild.setWeight(orderChildWeightCalc(orderChild));
orderChild.setFreight(orderChildFreightCalc(orderChild));
......@@ -163,7 +163,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
* 运费计算
*/
public BigDecimal orderChildFreightCalc(OrderChild orderChild){
BigDecimal totalFreight = orderChild.getFreightPrice().multiply(orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet());
BigDecimal totalFreight = orderChild.getFreightPrice().multiply(orderChild.getWeight());
BigDecimal dif = orderChild.getUnloadNet().subtract(orderChild.getLoadNet());
if (dif.compareTo(BigDecimal.ZERO) < 0){
totalFreight = totalFreight.add(orderChild.getLossPrice().multiply(dif));
......
......@@ -677,6 +677,7 @@ public class OrderChildServiceImpl implements OrderChildService {
orderChild.setUnloadTare(param.getUnloadTare());
orderChild.setUnloadNet(param.getUnloadNet());
orderChild.setUnloadTime(LocalDateTime.now());
orderChild.setWeight(orderChildWeightCalc(orderChild));
orderChild.setPoundStatus(OrderChildPoundAuditEnum.Status.AUDIT.getCode());
orderChild.setFreight(orderChildFreightCalc(orderChild));
......@@ -1198,8 +1199,7 @@ public class OrderChildServiceImpl implements OrderChildService {
private BigDecimal orderChildFreightCalc(OrderChild orderChild){
BigDecimal totalFreight = orderChild.getFreightPrice().multiply(orderChild.getWeight());
if (orderChild.getUnloadNet() != null){
totalFreight = orderChild.getFreightPrice().multiply(orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet());
BigDecimal dif = orderChild.getUnloadNet().subtract(orderChild.getWeight());
BigDecimal dif = orderChild.getUnloadNet().subtract(orderChild.getLoadNet());
if (dif.compareTo(BigDecimal.ZERO) < 0){
totalFreight = totalFreight.add(orderChild.getLossPrice().multiply(dif));
}
......
......@@ -385,7 +385,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
//扣除金额
runningWaterRecord.setTakeOutBalance(caseOutBalance);
//冻结金额
runningWaterRecord.setFrozenBalance(BigDecimal.ZERO);
runningWaterRecord.setFrozenBalance(account.getFrozenBalance());
runningWaterRecord.setOwnerUserNo(ownerCaseOut.getOwnerUserNo());
......@@ -711,8 +711,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
marginAccount.setRelationId(null);
marginAccount.setAlterationBalance(ensureBalance);
marginAccount.setFrozenBalance(ownerAccount.getFrozenBalance().add(ensureBalance));
marginAccount.setUsableBalance(ownerAccount.getUsableBalance().subtract(ensureBalance));
marginAccount.setFrozenBalance(ownerAccount.getFrozenBalance());
marginAccount.setUsableBalance(ownerAccount.getUsableBalance());
marginAccount.setTakeOutBalance(BigDecimal.ZERO);
marginAccount.setAccountBalance(ownerAccount.getAccountBalance());
marginAccount.setOwnerUserNo(userNo);
......@@ -732,8 +732,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
prepaidFreight.setRelationId(null);
prepaidFreight.setAlterationBalance(frozenBalance);
prepaidFreight.setFrozenBalance(ownerAccount.getFrozenBalance().add(frozenBalance));
prepaidFreight.setUsableBalance(ownerAccount.getUsableBalance().subtract(frozenBalance));
prepaidFreight.setFrozenBalance(ownerAccount.getFrozenBalance());
prepaidFreight.setUsableBalance(ownerAccount.getUsableBalance());
prepaidFreight.setTakeOutBalance(BigDecimal.ZERO);
prepaidFreight.setAccountBalance(ownerAccount.getAccountBalance());
prepaidFreight.setOwnerUserNo(userNo);
......@@ -791,7 +791,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
OwnerAccount entity = new OwnerAccount();
entity.setId(account.getId());
entity.setModifiedTime(account.getModifiedTime());
entity.setAccountBalance(runningWaterRecord.getAlterationBalance());
entity.setAccountBalance(BigDecimal.ZERO);
entity.setUsableBalance(runningWaterRecord.getAlterationBalance());
entity.setFrozenBalance(runningWaterRecord.getAlterationBalance());
flag += ownerAccountDao.thawAccount(entity, LocalDateTime.now());
......@@ -811,7 +811,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
prepaidFreight.setRelationId(null);
prepaidFreight.setAlterationBalance(runningWaterRecord.getAlterationBalance());
prepaidFreight.setFrozenBalance(BigDecimal.ZERO);
prepaidFreight.setFrozenBalance(account.getFrozenBalance());
prepaidFreight.setUsableBalance(account.getUsableBalance());
prepaidFreight.setTakeOutBalance(BigDecimal.ZERO);
prepaidFreight.setAccountBalance(account.getAccountBalance());
......@@ -832,7 +832,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
prepaidFreight.setRelationId(null);
prepaidFreight.setAlterationBalance(runningWaterRecord.getAlterationBalance());
prepaidFreight.setFrozenBalance(BigDecimal.ZERO);
prepaidFreight.setFrozenBalance(account.getFrozenBalance());
prepaidFreight.setUsableBalance(account.getUsableBalance());
prepaidFreight.setTakeOutBalance(BigDecimal.ZERO);
prepaidFreight.setAccountBalance(account.getAccountBalance());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论