|
@@ -701,14 +701,31 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
//查询费用表
|
|
|
FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>().eq("order_id", orderInfo1.getId())
|
|
|
.eq("delete_flag", "0"));
|
|
|
- //货主发运次数+1,计算累计支付运费
|
|
|
+ //查询货主
|
|
|
HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
|
|
|
.eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
|
|
|
+ //货主是公司
|
|
|
+ if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
|
|
|
+ //计算公司累计支付运费
|
|
|
+ HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
|
|
|
+ if(hyCompanyInfo != null){
|
|
|
+ Double d = hyCompanyInfo.getAccumulatedFreight();
|
|
|
+ hyCompanyInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
|
|
|
+ companyInfoService.updateById(hyCompanyInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //货主是个人
|
|
|
+ else{
|
|
|
+ //计算货主累计支付运费
|
|
|
+ if (hyCargoOwnerInfo != null) {
|
|
|
+ Double d = hyCargoOwnerInfo.getAccumulatedFreight();
|
|
|
+ hyCargoOwnerInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //货主发运次数+1
|
|
|
if (hyCargoOwnerInfo != null) {
|
|
|
Long count = hyCargoOwnerInfo.getShipmentsNumber() + 1;
|
|
|
hyCargoOwnerInfo.setShipmentsNumber(count);
|
|
|
- Double d = hyCargoOwnerInfo.getAccumulatedFreight();
|
|
|
- hyCargoOwnerInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
|
|
|
cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
|
|
|
}
|
|
|
}
|
|
@@ -972,13 +989,27 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
}
|
|
|
}
|
|
|
hyFreezingMoneyInfoService.insert(hyFreezingMoneyInfo);
|
|
|
- //计算货主累计支付运费
|
|
|
- HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
|
|
|
- .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
|
|
|
- if (hyCargoOwnerInfo != null) {
|
|
|
- Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
|
|
|
- hyCargoOwnerInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
|
|
|
- cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
|
|
|
+ //货主是公司
|
|
|
+ if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
|
|
|
+ //计算公司累计支付运费
|
|
|
+ HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
|
|
|
+ if(hyCompanyInfo != null){
|
|
|
+ Double d3 = hyCompanyInfo.getAccumulatedFreight();
|
|
|
+ hyCompanyInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
|
|
|
+ companyInfoService.updateById(hyCompanyInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //货主是个人
|
|
|
+ else{
|
|
|
+ //查询货主
|
|
|
+ HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
|
|
|
+ .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
|
|
|
+ //计算货主累计支付运费
|
|
|
+ if (hyCargoOwnerInfo != null) {
|
|
|
+ Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
|
|
|
+ hyCargoOwnerInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
|
|
|
+ cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
freightInfoService.insert(freightInfo);
|
|
@@ -1117,14 +1148,31 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
hyCargoOwnerCapitalInfoService.insert(hyCargoOwnerCapitalInfo);
|
|
|
}
|
|
|
hyFreezingMoneyInfoService.insert(hyFreezingMoneyInfo);
|
|
|
- //货主发运次数+1,计算累计支付运费
|
|
|
+ //查询货主
|
|
|
HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
|
|
|
.eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
|
|
|
+ //货主是公司
|
|
|
+ if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
|
|
|
+ //计算公司累计支付运费
|
|
|
+ HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
|
|
|
+ if(hyCompanyInfo != null){
|
|
|
+ Double d3 = hyCompanyInfo.getAccumulatedFreight();
|
|
|
+ hyCompanyInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
|
|
|
+ companyInfoService.updateById(hyCompanyInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //货主是个人
|
|
|
+ else{
|
|
|
+ //计算货主累计支付运费
|
|
|
+ if (hyCargoOwnerInfo != null) {
|
|
|
+ Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
|
|
|
+ hyCargoOwnerInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //货主发运次数+1
|
|
|
if (hyCargoOwnerInfo != null) {
|
|
|
Long count = hyCargoOwnerInfo.getShipmentsNumber() + 1;
|
|
|
hyCargoOwnerInfo.setShipmentsNumber(count);
|
|
|
- Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
|
|
|
- hyCargoOwnerInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
|
|
|
cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
|
|
|
}
|
|
|
}
|