提交 84f77a31 authored 作者: huningning's avatar huningning

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

...@@ -49,7 +49,15 @@ public class OrderChildFreightInfoVO { ...@@ -49,7 +49,15 @@ public class OrderChildFreightInfoVO {
@ApiModelProperty(value = "总运费(元)", example = "1.23") @ApiModelProperty(value = "总运费(元)", example = "1.23")
private BigDecimal totalFreight; private BigDecimal totalFreight;
public BigDecimal getTotalFreight() { public BigDecimal getTotalFreight() {
return freightPrice.multiply(weight).setScale(2, RoundingMode.HALF_UP); 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);
} }
@ApiModelProperty(value = "亏吨扣款(元)", example = "1.23") @ApiModelProperty(value = "亏吨扣款(元)", example = "1.23")
......
...@@ -154,7 +154,15 @@ public class OrderChildVO { ...@@ -154,7 +154,15 @@ 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() {
return freightPrice.multiply(weight).setScale(2, RoundingMode.HALF_UP); 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);
} }
} }
\ No newline at end of file
...@@ -64,6 +64,7 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -64,6 +64,7 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
.set(OrderChild::getUnloadTime, item.getUnloadTime()) .set(OrderChild::getUnloadTime, item.getUnloadTime())
.set(OrderChild::getPoundStatus, item.getPoundStatus()) .set(OrderChild::getPoundStatus, item.getPoundStatus())
.set(OrderChild::getWeight, item.getWeight())
.set(OrderChild::getFreight, item.getFreight()) .set(OrderChild::getFreight, item.getFreight())
.set(OrderChild::getStatus, item.getStatus()) .set(OrderChild::getStatus, item.getStatus())
); );
......
...@@ -40,7 +40,7 @@ public interface OwnerAccountMapper extends BaseMapper<OwnerAccount> { ...@@ -40,7 +40,7 @@ public interface OwnerAccountMapper extends BaseMapper<OwnerAccount> {
) )
Integer subAccount(@Param("account") OwnerAccount account, @Param("now") String now); Integer subAccount(@Param("account") OwnerAccount account, @Param("now") String now);
@Update("update owner_account set frozen_balance = frozen_balance - #{account.frozenBalance}," + @Update("update owner_account set frozen_balance = frozen_balance - #{account.frozenBalance}, account_balance = account_balance - #{account.accountBalance}," +
"modified_time=#{now}" "modified_time=#{now}"
+ "where id = #{account.id} and modified_time = #{account.modifiedTime}" + "where id = #{account.id} and modified_time = #{account.modifiedTime}"
) )
......
...@@ -156,20 +156,17 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer ...@@ -156,20 +156,17 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
* 运单拉运吨数计算 * 运单拉运吨数计算
*/ */
public BigDecimal orderChildWeightCalc(OrderChild orderChild){ public BigDecimal orderChildWeightCalc(OrderChild orderChild){
if (orderChild.getLoadNet() == null) {return orderChild.getTruckLoad();} return orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet();
else {return orderChild.getLoadNet();}
} }
/** /**
* 运费计算 * 运费计算
*/ */
public BigDecimal orderChildFreightCalc(OrderChild orderChild){ public BigDecimal orderChildFreightCalc(OrderChild orderChild){
BigDecimal totalFreight = orderChild.getFreightPrice().multiply(orderChild.getWeight()); BigDecimal totalFreight = orderChild.getFreightPrice().multiply(orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet());
if (orderChild.getUnloadNet() != null){ 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));
}
} }
return totalFreight.setScale(0, RoundingMode.HALF_UP); return totalFreight.setScale(0, RoundingMode.HALF_UP);
......
...@@ -1281,13 +1281,15 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -1281,13 +1281,15 @@ public class OrderChildServiceImpl implements OrderChildService {
carrierOrderChildDetailVO.setChildLogs(orderChildLogStruct.convert(orderChildLog)); carrierOrderChildDetailVO.setChildLogs(orderChildLogStruct.convert(orderChildLog));
//应付运费 //应付运费
BigDecimal payableFreight=BigDecimal.ZERO; BigDecimal payableFreight = orderChild.getFreightPrice().multiply(orderChild.getWeight());
if(Objects.nonNull(orderChild.getLoadNet())){ if (orderChild.getUnloadNet() != null){
payableFreight = orderChild.getLoadNet() payableFreight = orderChild.getFreightPrice()
.multiply(orderChild.getFreightPrice()) .multiply(orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet())
.setScale(0,BigDecimal.ROUND_HALF_UP); .setScale(0,BigDecimal.ROUND_HALF_UP);
} }
//亏吨扣款(元) //亏吨扣款(元)
BigDecimal lossDeduction=BigDecimal.ZERO; BigDecimal lossDeduction=BigDecimal.ZERO;
if(Objects.nonNull(orderChild.getLoadNet()) && Objects.nonNull(orderChild.getUnloadNet())){ if(Objects.nonNull(orderChild.getLoadNet()) && Objects.nonNull(orderChild.getUnloadNet())){
......
...@@ -183,11 +183,11 @@ public class OwnerAccountServiceImpl implements OwnerAccountService { ...@@ -183,11 +183,11 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
//账户余额 //账户余额
runningWaterRecord.setAccountBalance(account.getAccountBalance()); runningWaterRecord.setAccountBalance(account.getAccountBalance());
//冻结金额 //冻结金额
runningWaterRecord.setFrozenBalance(account.getFrozenBalance().add(caseOutBalance)); runningWaterRecord.setFrozenBalance(account.getFrozenBalance());
//扣除金额 //扣除金额
runningWaterRecord.setTakeOutBalance(BigDecimal.ZERO); runningWaterRecord.setTakeOutBalance(BigDecimal.ZERO);
//可用余额 //可用余额
runningWaterRecord.setUsableBalance(account.getUsableBalance().subtract(caseOutBalance)); runningWaterRecord.setUsableBalance(account.getUsableBalance());
runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo()); runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo());
runningWaterRecord.setAccountType(param.getAccountType()); runningWaterRecord.setAccountType(param.getAccountType());
...@@ -363,10 +363,11 @@ public class OwnerAccountServiceImpl implements OwnerAccountService { ...@@ -363,10 +363,11 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
OwnerAccount account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(ownerCaseOut.getOwnerUserNo(), ownerCaseOut.getAccountType()); OwnerAccount account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(ownerCaseOut.getOwnerUserNo(), ownerCaseOut.getAccountType());
OwnerAccount update = new OwnerAccount(); OwnerAccount update = new OwnerAccount();
update.setFrozenBalance(caseOutBalance); update.setFrozenBalance(caseOutBalance);
update.setAccountBalance(caseOutBalance);
update.setId(account.getId()); update.setId(account.getId());
update.setModifiedTime(account.getModifiedTime()); update.setModifiedTime(account.getModifiedTime());
Integer flag = ownerAccountDao.updateOwnerAccountForConfirm(update); Integer flag = ownerAccountDao.updateOwnerAccountForConfirm(update);
if (flag > 0) { if (flag != null && flag > 0) {
account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(ownerCaseOut.getOwnerUserNo(), ownerCaseOut.getAccountType()); account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(ownerCaseOut.getOwnerUserNo(), ownerCaseOut.getAccountType());
//插入提现成功流水 //插入提现成功流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord(); OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论