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