|
@@ -66,6 +66,7 @@ import com.fjhx.sale.entity.purchase.po.EhsdPurchase;
|
|
import com.fjhx.sale.entity.purchase.po.EhsdPurchaseProduct;
|
|
import com.fjhx.sale.entity.purchase.po.EhsdPurchaseProduct;
|
|
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProductVo;
|
|
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProductVo;
|
|
import com.fjhx.sale.entity.sale.vo.SaleQuotationVo;
|
|
import com.fjhx.sale.entity.sale.vo.SaleQuotationVo;
|
|
|
|
+import com.fjhx.sale.entity.statement.vo.ProfitSettlementVo;
|
|
import com.fjhx.sale.mapper.contract.ContractMapper;
|
|
import com.fjhx.sale.mapper.contract.ContractMapper;
|
|
import com.fjhx.sale.service.claim.ClaimContractService;
|
|
import com.fjhx.sale.service.claim.ClaimContractService;
|
|
import com.fjhx.sale.service.contract.*;
|
|
import com.fjhx.sale.service.contract.*;
|
|
@@ -384,109 +385,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
customerService.attributeAssign(list, Contract::getBuyCorporationId, (item, customer) -> {
|
|
customerService.attributeAssign(list, Contract::getBuyCorporationId, (item, customer) -> {
|
|
item.setCustomerName(customer.getName());
|
|
item.setCustomerName(customer.getName());
|
|
});
|
|
});
|
|
-
|
|
+ statisticCommon(list);
|
|
- List<Long> contractIds = list.stream().map(ContractBudgetVo::getContractId).collect(Collectors.toList());
|
|
|
|
- List<EhsdPurchaseProductVo> ehsdAmountList = ehsdPurchaseProductService.getPurchaseByContractId(contractIds);
|
|
|
|
- Map<Long, List<EhsdPurchaseProductVo>> ehsdAmountMap = ehsdAmountList.stream().collect(Collectors.groupingBy(EhsdPurchaseProductVo::getDataResourceId));
|
|
|
|
- for (ContractBudgetVo v : list) {
|
|
|
|
- BigDecimal purchaseAmount = BigDecimal.ZERO;
|
|
|
|
- BigDecimal peritectoidAmount = BigDecimal.ZERO;
|
|
|
|
- BigDecimal accessoriesAmount = BigDecimal.ZERO;
|
|
|
|
- if (StringUtils.isNotEmpty(v.getCurrencyRateJson())) {
|
|
|
|
- List<ContractCurrencyRate> contractCurrencyRates = JSON.parseArray(v.getCurrencyRateJson(), ContractCurrencyRate.class);
|
|
|
|
- Map<String, BigDecimal> map = contractCurrencyRates.stream().collect(Collectors.toMap(ContractCurrencyRate::getType, ContractCurrencyRate::getRate));
|
|
|
|
-
|
|
|
|
- * 处理应付款金额-包材金额-配件金额
|
|
|
|
- */
|
|
|
|
- List<EhsdPurchaseProductVo> pList = ehsdAmountMap.getOrDefault(v.getContractId(), null);
|
|
|
|
- if (CollectionUtils.isNotEmpty(pList)) {
|
|
|
|
- for(EhsdPurchaseProductVo e : pList){
|
|
|
|
-
|
|
|
|
- BigDecimal rate = map.getOrDefault(e.getCurrency(), BigDecimal.ONE);
|
|
|
|
-
|
|
|
|
- BigDecimal money = e.getAmount();
|
|
|
|
-
|
|
|
|
- BigDecimal amount = rate.multiply(money);
|
|
|
|
- purchaseAmount = purchaseAmount.add(amount);
|
|
|
|
- if(ObjectUtil.isNotEmpty(e.getProductCategoryIds())){
|
|
|
|
- if(e.getProductCategoryIds().contains("1685534140512616449")||e.getProductCategoryId()==1685534140512616449L){
|
|
|
|
- peritectoidAmount = peritectoidAmount.add(amount);
|
|
|
|
- }
|
|
|
|
- if(e.getProductCategoryIds().contains("1685534141821239297")||e.getProductCategoryId()==1685534141821239297L){
|
|
|
|
- accessoriesAmount = accessoriesAmount.add(amount);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- v.setEhsdSumAmount(purchaseAmount);
|
|
|
|
- v.setPeritectoidAmount(peritectoidAmount);
|
|
|
|
- v.setAccessoriesAmount(accessoriesAmount);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- v.setExpenditureAmount(v.getTrailerFee() == null ? BigDecimal.ZERO : v.getTrailerFee().multiply(new BigDecimal(map.getOrDefault(v.getTrailerFeeCurrency(), BigDecimal.ONE).toString())).add
|
|
|
|
- (v.getCustomsFee() == null ? BigDecimal.ZERO : v.getCustomsFee().multiply(new BigDecimal(map.getOrDefault(v.getCustomsFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
- (v.getAgencyFee() == null ? BigDecimal.ZERO : v.getAgencyFee().multiply(new BigDecimal(map.getOrDefault(v.getAgencyFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
- (v.getPortMixedFee() == null ? BigDecimal.ZERO : v.getPortMixedFee().multiply(new BigDecimal(map.getOrDefault(v.getPortMixedFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
- (v.getInspectionRedPack() == null ? BigDecimal.ZERO : v.getInspectionRedPack().multiply(new BigDecimal(map.getOrDefault(v.getInspectionRedPackCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
- (v.getCommission() == null ? BigDecimal.ZERO : v.getCommission().multiply(new BigDecimal(map.getOrDefault(v.getCommissionCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
- (v.getOther() == null ? BigDecimal.ZERO : v.getOther().multiply(new BigDecimal(map.getOrDefault(v.getOtherCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
- (v.getEhsdSumAmount() == null ? BigDecimal.ZERO : v.getEhsdSumAmount())
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- handleRefundTax(v);
|
|
|
|
- v.setRmbContractAmount(v.getAmount().multiply(new BigDecimal(map.getOrDefault(v.getCurrency(), BigDecimal.ONE).toString())));
|
|
|
|
-
|
|
|
|
- v.setIncomeAmount(v.getAmount().multiply(new BigDecimal(map.getOrDefault(v.getCurrency(), BigDecimal.ONE).toString())).add(v.getRefundableAmount()));
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- * 处理应付款金额-包材金额-配件金额
|
|
|
|
- */
|
|
|
|
- List<EhsdPurchaseProductVo> pList = ehsdAmountMap.getOrDefault(v.getContractId(), null);
|
|
|
|
- if (CollectionUtils.isNotEmpty(pList)) {
|
|
|
|
- for(EhsdPurchaseProductVo e : pList){
|
|
|
|
-
|
|
|
|
- BigDecimal rate = e.getRate();
|
|
|
|
-
|
|
|
|
- BigDecimal money = e.getAmount();
|
|
|
|
-
|
|
|
|
- BigDecimal amount = rate.multiply(money);
|
|
|
|
- purchaseAmount = purchaseAmount.add(amount);
|
|
|
|
- if(ObjectUtil.isNotEmpty(e.getProductCategoryIds())){
|
|
|
|
- if(e.getProductCategoryIds().contains("1685534140512616449")||e.getProductCategoryId()==1685534140512616449L){
|
|
|
|
- peritectoidAmount = peritectoidAmount.add(amount);
|
|
|
|
- }
|
|
|
|
- if(e.getProductCategoryIds().contains("1685534141821239297")||e.getProductCategoryId()==1685534141821239297L){
|
|
|
|
- accessoriesAmount = accessoriesAmount.add(amount);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- v.setEhsdSumAmount(purchaseAmount);
|
|
|
|
- v.setPeritectoidAmount(peritectoidAmount);
|
|
|
|
- v.setAccessoriesAmount(accessoriesAmount);
|
|
|
|
- }
|
|
|
|
- BigDecimal rate = v.getRate();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- v.setExpenditureAmount(
|
|
|
|
- v.getTrailerFee() == null ? BigDecimal.ZERO : v.getTrailerFee().add
|
|
|
|
- (v.getCustomsFee() == null ? BigDecimal.ZERO : v.getCustomsFee()).add
|
|
|
|
- (v.getAgencyFee() == null ? BigDecimal.ZERO : v.getAgencyFee()).add
|
|
|
|
- (v.getPortMixedFee() == null ? BigDecimal.ZERO : v.getPortMixedFee()).add
|
|
|
|
- (v.getInspectionRedPack() == null ? BigDecimal.ZERO : v.getInspectionRedPack()).add
|
|
|
|
- (v.getCommission() == null ? BigDecimal.ZERO : v.getCommission()).add
|
|
|
|
- (v.getOther() == null ? BigDecimal.ZERO : v.getOther()).add
|
|
|
|
- (v.getEhsdSumAmount() == null ? BigDecimal.ZERO : v.getEhsdSumAmount())
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- handleRefundTax(v);
|
|
|
|
- v.setRmbContractAmount(v.getAmount().multiply(rate));
|
|
|
|
-
|
|
|
|
- v.setIncomeAmount(v.getAmount().multiply(rate).add(v.getRefundableAmount()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- v.setGross(v.getIncomeAmount().subtract(v.getExpenditureAmount()));
|
|
|
|
-
|
|
|
|
- v.setGrossRate(v.getGross().divide(v.getIncomeAmount(), RoundingMode.CEILING).multiply(new BigDecimal("100")));
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
@@ -513,46 +412,180 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
wrapper.keyword(dto.getKeyword(), new SqlField("t1.code"));
|
|
wrapper.keyword(dto.getKeyword(), new SqlField("t1.code"));
|
|
}
|
|
}
|
|
List<ContractBudgetVo> list = this.baseMapper.getProfitBudgetHeadStatistic(wrapper);
|
|
List<ContractBudgetVo> list = this.baseMapper.getProfitBudgetHeadStatistic(wrapper);
|
|
- List<Long> contractIds = list.stream().map(ContractBudgetVo::getContractId).collect(Collectors.toList());
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
-
|
|
+ statisticCommon(list);
|
|
- for (ContractBudgetVo v : list) {
|
|
|
|
- if (StringUtils.isNotEmpty(v.getCurrencyRateJson())) {
|
|
|
|
- List<ContractCurrencyRate> contractCurrencyRates = JSON.parseArray(v.getCurrencyRateJson(), ContractCurrencyRate.class);
|
|
|
|
- Map<String, BigDecimal> map = contractCurrencyRates.stream().collect(Collectors.toMap(ContractCurrencyRate::getType, ContractCurrencyRate::getRate));
|
|
|
|
- BigDecimal rate = map.getOrDefault(v.getCurrency(),BigDecimal.ONE);
|
|
|
|
- } else {
|
|
|
|
- BigDecimal rate = v.getRate();
|
|
|
|
- v.setRmbContractAmount(v.getAmount().multiply(rate));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return sumStatistic(list);
|
|
return sumStatistic(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ * 利润预算表统计公共方法
|
|
|
|
+ * @param list
|
|
|
|
+ */
|
|
|
|
+ private void statisticCommon(List<ContractBudgetVo> list){
|
|
|
|
+
|
|
|
|
+ List<Long> contractIds = list.stream().map(ContractBudgetVo::getContractId).collect(Collectors.toList());
|
|
|
|
+ List<EhsdPurchaseProductVo> ehsdAmountList = ehsdPurchaseProductService.getPurchaseByContractId(contractIds);
|
|
|
|
+ Map<Long, List<EhsdPurchaseProductVo>> ehsdAmountMap = ehsdAmountList.stream().collect(Collectors.groupingBy(EhsdPurchaseProductVo::getDataResourceId));
|
|
|
|
+ for (ContractBudgetVo v : list) {
|
|
|
|
+ BigDecimal purchaseAmount = BigDecimal.ZERO;
|
|
|
|
+ BigDecimal peritectoidAmount = BigDecimal.ZERO;
|
|
|
|
+ BigDecimal accessoriesAmount = BigDecimal.ZERO;
|
|
|
|
+ if (StringUtils.isNotEmpty(v.getCurrencyRateJson())) {
|
|
|
|
+ List<ContractCurrencyRate> contractCurrencyRates = JSON.parseArray(v.getCurrencyRateJson(), ContractCurrencyRate.class);
|
|
|
|
+ Map<String, BigDecimal> map = contractCurrencyRates.stream().collect(Collectors.toMap(ContractCurrencyRate::getType, ContractCurrencyRate::getRate));
|
|
|
|
+
|
|
|
|
+ * 处理应付款金额-包材金额-配件金额
|
|
|
|
+ */
|
|
|
|
+ List<EhsdPurchaseProductVo> pList = ehsdAmountMap.getOrDefault(v.getContractId(), null);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(pList)) {
|
|
|
|
+ for(EhsdPurchaseProductVo e : pList){
|
|
|
|
+
|
|
|
|
+ BigDecimal rate = map.getOrDefault(e.getCurrency(), BigDecimal.ONE);
|
|
|
|
+
|
|
|
|
+ BigDecimal money = e.getAmount();
|
|
|
|
+
|
|
|
|
+ BigDecimal amount = rate.multiply(money);
|
|
|
|
+ purchaseAmount = purchaseAmount.add(amount);
|
|
|
|
+ if(ObjectUtil.isNotEmpty(e.getProductCategoryIds())){
|
|
|
|
+ if(e.getProductCategoryIds().contains("1685534140512616449")||e.getProductCategoryId()==1685534140512616449L){
|
|
|
|
+ peritectoidAmount = peritectoidAmount.add(amount);
|
|
|
|
+ }
|
|
|
|
+ if(e.getProductCategoryIds().contains("1685534141821239297")||e.getProductCategoryId()==1685534141821239297L){
|
|
|
|
+ accessoriesAmount = accessoriesAmount.add(amount);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ v.setEhsdSumAmount(purchaseAmount);
|
|
|
|
+ v.setPeritectoidAmount(peritectoidAmount);
|
|
|
|
+ v.setAccessoriesAmount(accessoriesAmount);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ v.setExpenditureAmount(v.getTrailerFee() == null ? BigDecimal.ZERO : v.getTrailerFee().multiply(new BigDecimal(map.getOrDefault(v.getTrailerFeeCurrency(), BigDecimal.ONE).toString())).add
|
|
|
|
+ (v.getCustomsFee() == null ? BigDecimal.ZERO : v.getCustomsFee().multiply(new BigDecimal(map.getOrDefault(v.getCustomsFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
+ (v.getAgencyFee() == null ? BigDecimal.ZERO : v.getAgencyFee().multiply(new BigDecimal(map.getOrDefault(v.getAgencyFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
+ (v.getPortMixedFee() == null ? BigDecimal.ZERO : v.getPortMixedFee().multiply(new BigDecimal(map.getOrDefault(v.getPortMixedFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
+ (v.getInspectionRedPack() == null ? BigDecimal.ZERO : v.getInspectionRedPack().multiply(new BigDecimal(map.getOrDefault(v.getInspectionRedPackCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
+ (v.getCommission() == null ? BigDecimal.ZERO : v.getCommission().multiply(new BigDecimal(map.getOrDefault(v.getCommissionCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
+ (v.getOther() == null ? BigDecimal.ZERO : v.getOther().multiply(new BigDecimal(map.getOrDefault(v.getOtherCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
|
+ (v.getEhsdSumAmount() == null ? BigDecimal.ZERO : v.getEhsdSumAmount())
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ handleRefundTax(v);
|
|
|
|
+ v.setRmbContractAmount(v.getAmount().multiply(new BigDecimal(map.getOrDefault(v.getCurrency(), BigDecimal.ONE).toString())));
|
|
|
|
+
|
|
|
|
+ v.setIncomeAmount(v.getAmount().multiply(new BigDecimal(map.getOrDefault(v.getCurrency(), BigDecimal.ONE).toString())).add(v.getRefundableAmount()));
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ * 处理应付款金额-包材金额-配件金额
|
|
|
|
+ */
|
|
|
|
+ List<EhsdPurchaseProductVo> pList = ehsdAmountMap.getOrDefault(v.getContractId(), null);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(pList)) {
|
|
|
|
+ for(EhsdPurchaseProductVo e : pList){
|
|
|
|
+
|
|
|
|
+ BigDecimal rate = e.getRate();
|
|
|
|
+
|
|
|
|
+ BigDecimal money = e.getAmount();
|
|
|
|
+
|
|
|
|
+ BigDecimal amount = rate.multiply(money);
|
|
|
|
+ purchaseAmount = purchaseAmount.add(amount);
|
|
|
|
+ if(ObjectUtil.isNotEmpty(e.getProductCategoryIds())){
|
|
|
|
+ if(e.getProductCategoryIds().contains("1685534140512616449")||e.getProductCategoryId()==1685534140512616449L){
|
|
|
|
+ peritectoidAmount = peritectoidAmount.add(amount);
|
|
|
|
+ }
|
|
|
|
+ if(e.getProductCategoryIds().contains("1685534141821239297")||e.getProductCategoryId()==1685534141821239297L){
|
|
|
|
+ accessoriesAmount = accessoriesAmount.add(amount);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ v.setEhsdSumAmount(purchaseAmount);
|
|
|
|
+ v.setPeritectoidAmount(peritectoidAmount);
|
|
|
|
+ v.setAccessoriesAmount(accessoriesAmount);
|
|
|
|
+ }
|
|
|
|
+ BigDecimal rate = v.getRate();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ v.setExpenditureAmount(
|
|
|
|
+ v.getTrailerFee() == null ? BigDecimal.ZERO : v.getTrailerFee().add
|
|
|
|
+ (v.getCustomsFee() == null ? BigDecimal.ZERO : v.getCustomsFee()).add
|
|
|
|
+ (v.getAgencyFee() == null ? BigDecimal.ZERO : v.getAgencyFee()).add
|
|
|
|
+ (v.getPortMixedFee() == null ? BigDecimal.ZERO : v.getPortMixedFee()).add
|
|
|
|
+ (v.getInspectionRedPack() == null ? BigDecimal.ZERO : v.getInspectionRedPack()).add
|
|
|
|
+ (v.getCommission() == null ? BigDecimal.ZERO : v.getCommission()).add
|
|
|
|
+ (v.getOther() == null ? BigDecimal.ZERO : v.getOther()).add
|
|
|
|
+ (v.getEhsdSumAmount() == null ? BigDecimal.ZERO : v.getEhsdSumAmount())
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ handleRefundTax(v);
|
|
|
|
+ v.setRmbContractAmount(v.getAmount().multiply(rate));
|
|
|
|
+
|
|
|
|
+ v.setIncomeAmount(v.getAmount().multiply(rate).add(v.getRefundableAmount()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ v.setGross(v.getIncomeAmount().subtract(v.getExpenditureAmount()));
|
|
|
|
+
|
|
|
|
+ v.setGrossRate(v.getGross().divide(v.getIncomeAmount(), RoundingMode.CEILING).multiply(new BigDecimal("100")));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
* 统计金额
|
|
* 统计金额
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private Map<String,Object> sumStatistic(List<ContractBudgetVo> list){
|
|
private Map<String,Object> sumStatistic(List<ContractBudgetVo> list){
|
|
Map<String,Object> map = new HashMap<>();
|
|
Map<String,Object> map = new HashMap<>();
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal contractSumAmount = BigDecimal.ZERO;
|
|
- map.put("purchaseAmount",BigDecimal.ZERO);
|
|
+ BigDecimal taxReturnMoneySumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal purchaseSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal peritectoidSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal accessoriesSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal trailerFeeSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal customsFeeSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal agencyFeeSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal portMixedFeeSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal inspectionRedPackSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal commissionSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal otherSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal totalIncomeSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal totalExpensesSumAmount = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ BigDecimal grossProfitMargin = BigDecimal.ZERO;
|
|
- map.put("contractAmount",BigDecimal.ZERO);
|
|
+ for (ContractBudgetVo p : list) {
|
|
|
|
+ contractSumAmount = contractSumAmount.add(ObjectUtil.isEmpty(p.getRmbContractAmount())?BigDecimal.ZERO:p.getRmbContractAmount());
|
|
|
|
+ taxReturnMoneySumAmount = taxReturnMoneySumAmount.add(ObjectUtil.isEmpty(p.getRefundableAmount())?BigDecimal.ZERO:p.getRefundableAmount());
|
|
|
|
+ purchaseSumAmount = purchaseSumAmount.add(ObjectUtil.isEmpty(p.getEhsdSumAmount())?BigDecimal.ZERO:p.getEhsdSumAmount());
|
|
|
|
+ peritectoidSumAmount = peritectoidSumAmount.add(ObjectUtil.isEmpty(p.getPeritectoidAmount())?BigDecimal.ZERO:p.getPeritectoidAmount());
|
|
|
|
+ accessoriesSumAmount = accessoriesSumAmount.add(ObjectUtil.isEmpty(p.getAccessoriesAmount())?BigDecimal.ZERO:p.getAccessoriesAmount());
|
|
|
|
+ trailerFeeSumAmount = trailerFeeSumAmount.add(ObjectUtil.isEmpty(p.getTrailerFee())?BigDecimal.ZERO:p.getTrailerFee());
|
|
|
|
+ customsFeeSumAmount = customsFeeSumAmount.add(ObjectUtil.isEmpty(p.getCustomsFee())?BigDecimal.ZERO:p.getCustomsFee());
|
|
|
|
+ agencyFeeSumAmount = agencyFeeSumAmount.add(ObjectUtil.isEmpty(p.getAgencyFee())?BigDecimal.ZERO:p.getAgencyFee());
|
|
|
|
+ portMixedFeeSumAmount = portMixedFeeSumAmount.add(ObjectUtil.isEmpty(p.getProfitAgencyFee())?BigDecimal.ZERO:p.getProfitAgencyFee());
|
|
|
|
+ inspectionRedPackSumAmount = inspectionRedPackSumAmount.add(ObjectUtil.isEmpty(p.getInspectionRedPack())?BigDecimal.ZERO:p.getInspectionRedPack());
|
|
|
|
+ commissionSumAmount = commissionSumAmount.add(ObjectUtil.isEmpty(p.getCommission())?BigDecimal.ZERO:p.getCommission());
|
|
|
|
+ otherSumAmount = otherSumAmount.add(ObjectUtil.isEmpty(p.getOther())?BigDecimal.ZERO:p.getOther());
|
|
|
|
+ totalIncomeSumAmount = totalIncomeSumAmount.add(ObjectUtil.isEmpty(p.getIncomeAmount())?BigDecimal.ZERO:p.getIncomeAmount());
|
|
|
|
+ totalExpensesSumAmount = totalExpensesSumAmount.add(ObjectUtil.isEmpty(p.getExpenditureAmount())?BigDecimal.ZERO:p.getExpenditureAmount());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ BigDecimal grossProfitSum = totalIncomeSumAmount.subtract(totalExpensesSumAmount);
|
|
|
|
+ if (totalIncomeSumAmount.compareTo(BigDecimal.ZERO)>0) {
|
|
|
|
+ grossProfitMargin = new BigDecimal("100").multiply(grossProfitSum).divide(totalIncomeSumAmount, 2, RoundingMode.HALF_UP);
|
|
|
|
+ }
|
|
|
|
+ map.put("contractSumAmount",contractSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("taxReturnMoneySumAmount",taxReturnMoneySumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("purchaseSumAmount",purchaseSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("peritectoidSumAmount",peritectoidSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("accessoriesSumAmount",accessoriesSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("trailerFeeSumAmount",trailerFeeSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("customsFeeSumAmount",customsFeeSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("agencyFeeSumAmount",agencyFeeSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("portMixedFeeSumAmount",portMixedFeeSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("inspectionRedPackSumAmount",inspectionRedPackSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("commissionSumAmount",commissionSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("otherSumAmount",otherSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("totalIncomeSumAmount",totalIncomeSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("totalExpensesSumAmount",totalExpensesSumAmount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("grossProfitMargin",grossProfitMargin.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
+ map.put("grossProfitSum",grossProfitSum.setScale(2, RoundingMode.HALF_UP));
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|