|
@@ -32,19 +32,29 @@ import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
|
import com.fjhx.file.entity.FileInfoVo;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
+import com.fjhx.flow.service.flow.FlowExampleService;
|
|
|
import com.fjhx.item.entity.product.dto.ProductInfoSelectDto;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
+import com.fjhx.purchase.entity.arrival.po.ArrivalDetail;
|
|
|
+import com.fjhx.purchase.entity.purchase.po.Purchase;
|
|
|
+import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
|
|
|
import com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo;
|
|
|
+import com.fjhx.purchase.entity.quality.po.QualityDetail;
|
|
|
+import com.fjhx.purchase.service.arrival.ArrivalDetailService;
|
|
|
import com.fjhx.purchase.service.purchase.PurchaseDetailService;
|
|
|
+import com.fjhx.purchase.service.purchase.PurchaseService;
|
|
|
+import com.fjhx.purchase.service.quality.QualityDetailService;
|
|
|
import com.fjhx.sale.entity.claim.po.ClaimContract;
|
|
|
import com.fjhx.sale.entity.contract.bo.ContractCurrencyRate;
|
|
|
import com.fjhx.sale.entity.contract.bo.ContractDocumentaryBo;
|
|
|
import com.fjhx.sale.entity.contract.dto.ContractDto;
|
|
|
import com.fjhx.sale.entity.contract.dto.ContractSelectDto;
|
|
|
import com.fjhx.sale.entity.contract.dto.DecisionAidDto;
|
|
|
+import com.fjhx.sale.entity.contract.dto.PayDecisionAidDto;
|
|
|
import com.fjhx.sale.entity.contract.po.Contract;
|
|
|
import com.fjhx.sale.entity.contract.po.ContractProduct;
|
|
|
import com.fjhx.sale.entity.contract.po.ContractProject;
|
|
|
+import com.fjhx.sale.entity.contract.po.ContractShipment;
|
|
|
import com.fjhx.sale.entity.contract.vo.*;
|
|
|
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProductVo;
|
|
|
import com.fjhx.sale.entity.sale.vo.SaleQuotationVo;
|
|
@@ -53,6 +63,7 @@ import com.fjhx.sale.service.claim.ClaimContractService;
|
|
|
import com.fjhx.sale.service.contract.ContractProductService;
|
|
|
import com.fjhx.sale.service.contract.ContractProjectService;
|
|
|
import com.fjhx.sale.service.contract.ContractService;
|
|
|
+import com.fjhx.sale.service.contract.ContractShipmentService;
|
|
|
import com.fjhx.sale.service.purchase.EhsdPurchaseProductService;
|
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
@@ -131,6 +142,24 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
@Autowired
|
|
|
private ContractProjectService contractProjectService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ContractService contractService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PurchaseService purchaseService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ArrivalDetailService arrivalDetailService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private QualityDetailService qualityDetailService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FlowExampleService flowExampleService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ContractShipmentService contractShipmentService;
|
|
|
+
|
|
|
/**
|
|
|
* 分页
|
|
|
*
|
|
@@ -164,6 +193,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
wrapper.keyword(dto.getKeyword(), new SqlField("t1", Contract::getCode));
|
|
|
}
|
|
|
|
|
|
+ //过滤合同类型
|
|
|
+ wrapper.eq("t1.contract_type", dto.getContractType());
|
|
|
+
|
|
|
wrapper.in("t1", Contract::getBuyCorporationId, authIdList);
|
|
|
|
|
|
Page<ContractVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
@@ -180,32 +212,38 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
// 获取包装附件
|
|
|
Map<Long, List<FileInfoVo>> packageFileMap = ObsFileUtil.getFileMap(ids, 2);
|
|
|
for (ContractVo p : list) {
|
|
|
- if (MapUtils.isNotEmpty(cusMap)) {//客户
|
|
|
+
|
|
|
+ // 客户
|
|
|
+ if (MapUtils.isNotEmpty(cusMap)) {
|
|
|
List<Customer> customers = cusMap.getOrDefault(p.getBuyCorporationId(), null);
|
|
|
p.setBuyCorporationName(customers == null ? null : customers.get(0).getName());
|
|
|
- //赋值客户标签
|
|
|
+ // 赋值客户标签
|
|
|
p.setTag(customers == null ? null : customers.get(0).getTag());
|
|
|
}
|
|
|
|
|
|
- //赋值交接单附件
|
|
|
- if (MapUtils.isNotEmpty(fileMap)){
|
|
|
+ // 赋值交接单附件
|
|
|
+ if (MapUtils.isNotEmpty(fileMap)) {
|
|
|
List<FileInfoVo> fileInfoVos = fileMap.get(p.getId());
|
|
|
p.setFileInfoVos(fileInfoVos);
|
|
|
}
|
|
|
|
|
|
- //赋值包装附件信息
|
|
|
- if (MapUtils.isNotEmpty(packageFileMap)){
|
|
|
- List<FileInfoVo> packageFileInfoVOList= packageFileMap.get(p.getId());
|
|
|
+ // 赋值包装附件信息
|
|
|
+ if (MapUtils.isNotEmpty(packageFileMap)) {
|
|
|
+ List<FileInfoVo> packageFileInfoVOList = packageFileMap.get(p.getId());
|
|
|
p.setPackageFileInfoVOList(packageFileInfoVOList);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ // 赋值流程id
|
|
|
+ flowExampleService.setFlowId(list, ContractVo::setFlowId);
|
|
|
}
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 利润预算
|
|
|
+ *
|
|
|
* @param dto
|
|
|
* @return
|
|
|
*/
|
|
@@ -214,18 +252,18 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
IWrapper<Contract> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("t1", Contract::getCreateTime);
|
|
|
wrapper.between("t1", Contract::getStatus, FlowStatusEnum.PASS.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
|
|
|
- if(StringUtils.isNotEmpty(dto.getCustomerId())){
|
|
|
- wrapper.eq("t1",Contract::getBuyCorporationId,dto.getCustomerId());
|
|
|
+ if (StringUtils.isNotEmpty(dto.getCustomerId())) {
|
|
|
+ wrapper.eq("t1", Contract::getBuyCorporationId, dto.getCustomerId());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(dto.getUserId())){
|
|
|
- wrapper.eq("t1",Contract::getCreateUser,dto.getUserId());
|
|
|
+ if (StringUtils.isNotEmpty(dto.getUserId())) {
|
|
|
+ wrapper.eq("t1", Contract::getCreateUser, dto.getUserId());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(dto.getKeyword())){
|
|
|
- wrapper.keyword(dto.getKeyword(),new SqlField("t1.code"));
|
|
|
+ if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
+ wrapper.keyword(dto.getKeyword(), new SqlField("t1.code"));
|
|
|
}
|
|
|
Page<ContractBudgetVo> page = this.baseMapper.getProfitBudgetPage(dto.getPage(), wrapper);
|
|
|
List<ContractBudgetVo> list = page.getRecords();
|
|
|
- if(CollectionUtils.isNotEmpty(list)){
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
// 赋值客户名称
|
|
|
customerService.attributeAssign(list, Contract::getBuyCorporationId, (item, customer) -> {
|
|
|
item.setCustomerName(customer.getName());
|
|
@@ -234,65 +272,65 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
List<Long> contractIds = list.stream().map(ContractBudgetVo::getContractId).collect(Collectors.toList());
|
|
|
List<EhsdPurchaseProductVo> ehsdAmountList = ehsdPurchaseProductService.getGroupSumAmount(contractIds);
|
|
|
//取出采购所有金额和货币-通过合同ID分组
|
|
|
- Map<Long,String> ehsdAmountMap = ehsdAmountList.stream().collect(Collectors.toMap(EhsdPurchaseProductVo::getContractId,EhsdPurchaseProductVo::getCurrencyAmount));
|
|
|
+ Map<Long, String> ehsdAmountMap = ehsdAmountList.stream().collect(Collectors.toMap(EhsdPurchaseProductVo::getContractId, EhsdPurchaseProductVo::getCurrencyAmount));
|
|
|
List<PurchaseDetailVo> otherAmountList = purchaseDetailService.getSumCountInDataResourceIds(contractIds);
|
|
|
- Map<Long,String> otherAmountMap = otherAmountList.stream().collect(Collectors.toMap(PurchaseDetailVo::getDataResourceId,PurchaseDetailVo::getSumAmountCurrency));
|
|
|
+ Map<Long, String> otherAmountMap = otherAmountList.stream().collect(Collectors.toMap(PurchaseDetailVo::getDataResourceId, PurchaseDetailVo::getSumAmountCurrency));
|
|
|
//取出默认汇率
|
|
|
List<CurrencyRate> currencyRateList = currencyRateService.getList();
|
|
|
- Map<String,BigDecimal> currencyRateMap = currencyRateList.stream().collect(Collectors.toMap(CurrencyRate::getType,CurrencyRate::getRate));
|
|
|
- for(ContractBudgetVo v : list){
|
|
|
- if(StringUtils.isNotEmpty(v.getCurrencyRateJson())){//如果此条合同有汇率了
|
|
|
+ Map<String, BigDecimal> currencyRateMap = currencyRateList.stream().collect(Collectors.toMap(CurrencyRate::getType, CurrencyRate::getRate));
|
|
|
+ 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));
|
|
|
+ Map<String, BigDecimal> map = contractCurrencyRates.stream().collect(Collectors.toMap(ContractCurrencyRate::getType, ContractCurrencyRate::getRate));
|
|
|
v.setRefundableAmount(BigDecimal.ZERO);//暂时先设置退税金额为0
|
|
|
- if(MapUtils.isNotEmpty(ehsdAmountMap)){ //计算EHSD租户应付货款
|
|
|
- String concatAmountCurrency = ehsdAmountMap.getOrDefault(v.getContractId(),null);
|
|
|
- if(StringUtils.isNotEmpty(concatAmountCurrency)){
|
|
|
+ if (MapUtils.isNotEmpty(ehsdAmountMap)) { //计算EHSD租户应付货款
|
|
|
+ String concatAmountCurrency = ehsdAmountMap.getOrDefault(v.getContractId(), null);
|
|
|
+ if (StringUtils.isNotEmpty(concatAmountCurrency)) {
|
|
|
BigDecimal amount = new BigDecimal(concatAmountCurrency.split("-")[0]);
|
|
|
String currency = concatAmountCurrency.split("-")[1];
|
|
|
- BigDecimal rate = map.getOrDefault(currency,BigDecimal.ONE);
|
|
|
+ BigDecimal rate = map.getOrDefault(currency, BigDecimal.ONE);
|
|
|
v.setEhsdSumAmount(amount.multiply(rate));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
v.setEhsdSumAmount(BigDecimal.ZERO);
|
|
|
}
|
|
|
}
|
|
|
//计算收入总计=合同金额(转人民币)+应退税金额(转人民币)
|
|
|
v.setIncomeAmount(v.getAmount().multiply(new BigDecimal(map.getOrDefault(v.getCurrency(), BigDecimal.ONE).toString())).add(v.getRefundableAmount()));
|
|
|
//计算支出总计 除合同金额(转人民币)+应退税金额(转人民币) 其他金额相加
|
|
|
- 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()).add
|
|
|
- (v.getOtherSumAmount()==null?BigDecimal.ZERO:v.getOtherSumAmount()));
|
|
|
- }else{//没有汇率取默认汇率
|
|
|
+ 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()).add
|
|
|
+ (v.getOtherSumAmount() == null ? BigDecimal.ZERO : v.getOtherSumAmount()));
|
|
|
+ } else {//没有汇率取默认汇率
|
|
|
v.setRefundableAmount(BigDecimal.ZERO);//暂时先设置退税金额为0
|
|
|
- if(MapUtils.isNotEmpty(ehsdAmountMap)){ //计算EHSD租户应付货款
|
|
|
- String concatAmountCurrency = ehsdAmountMap.getOrDefault(v.getContractId(),null);
|
|
|
- if(StringUtils.isNotEmpty(concatAmountCurrency)){
|
|
|
+ if (MapUtils.isNotEmpty(ehsdAmountMap)) { //计算EHSD租户应付货款
|
|
|
+ String concatAmountCurrency = ehsdAmountMap.getOrDefault(v.getContractId(), null);
|
|
|
+ if (StringUtils.isNotEmpty(concatAmountCurrency)) {
|
|
|
BigDecimal amount = new BigDecimal(concatAmountCurrency.split("-")[0]);
|
|
|
String currency = concatAmountCurrency.split("-")[1];
|
|
|
- BigDecimal rate = currencyRateMap.getOrDefault(currency,BigDecimal.ONE);
|
|
|
+ BigDecimal rate = currencyRateMap.getOrDefault(currency, BigDecimal.ONE);
|
|
|
v.setEhsdSumAmount(amount.multiply(rate));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
v.setEhsdSumAmount(BigDecimal.ZERO);
|
|
|
}
|
|
|
}
|
|
|
//计算收入总计=合同金额(转人民币)+应退税金额(转人民币)
|
|
|
- v.setIncomeAmount(v.getAmount().multiply(currencyRateMap.getOrDefault(v.getContractId(),new BigDecimal("1"))).add(v.getRefundableAmount()));
|
|
|
+ v.setIncomeAmount(v.getAmount().multiply(currencyRateMap.getOrDefault(v.getContractId(), new BigDecimal("1"))).add(v.getRefundableAmount()));
|
|
|
//计算支出总计 除合同金额(转人民币)+应退税金额(转人民币) 其他金额相加
|
|
|
- v.setExpenditureAmount(v.getTrailerFee()==null?BigDecimal.ZERO:v.getTrailerFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getTrailerFeeCurrency(),BigDecimal.ONE).toString())).add
|
|
|
- (v.getCustomsFee()==null?BigDecimal.ZERO:v.getCustomsFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getCustomsFeeCurrency(),BigDecimal.ONE).toString()))).add
|
|
|
- (v.getAgencyFee()==null?BigDecimal.ZERO:v.getAgencyFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getAgencyFeeCurrency(),BigDecimal.ONE).toString()))).add
|
|
|
- (v.getPortMixedFee()==null?BigDecimal.ZERO:v.getPortMixedFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getPortMixedFeeCurrency(),BigDecimal.ONE).toString()))).add
|
|
|
- (v.getInspectionRedPack()==null?BigDecimal.ZERO:v.getInspectionRedPack().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getInspectionRedPackCurrency(),BigDecimal.ONE).toString()))).add
|
|
|
- (v.getCommission()==null?BigDecimal.ZERO:v.getCommission().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getCommissionCurrency(),BigDecimal.ONE).toString()))).add
|
|
|
- (v.getOther()==null?BigDecimal.ZERO:v.getOther().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getOtherCurrency(),BigDecimal.ONE).toString()))).add
|
|
|
- (v.getEhsdSumAmount()==null?BigDecimal.ZERO:v.getEhsdSumAmount()).add
|
|
|
- (v.getOtherSumAmount()==null?BigDecimal.ZERO:v.getOtherSumAmount()));
|
|
|
+ v.setExpenditureAmount(v.getTrailerFee() == null ? BigDecimal.ZERO : v.getTrailerFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getTrailerFeeCurrency(), BigDecimal.ONE).toString())).add
|
|
|
+ (v.getCustomsFee() == null ? BigDecimal.ZERO : v.getCustomsFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getCustomsFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
+ (v.getAgencyFee() == null ? BigDecimal.ZERO : v.getAgencyFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getAgencyFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
+ (v.getPortMixedFee() == null ? BigDecimal.ZERO : v.getPortMixedFee().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getPortMixedFeeCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
+ (v.getInspectionRedPack() == null ? BigDecimal.ZERO : v.getInspectionRedPack().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getInspectionRedPackCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
+ (v.getCommission() == null ? BigDecimal.ZERO : v.getCommission().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getCommissionCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
+ (v.getOther() == null ? BigDecimal.ZERO : v.getOther().multiply(new BigDecimal(currencyRateMap.getOrDefault(v.getOtherCurrency(), BigDecimal.ONE).toString()))).add
|
|
|
+ (v.getEhsdSumAmount() == null ? BigDecimal.ZERO : v.getEhsdSumAmount()).add
|
|
|
+ (v.getOtherSumAmount() == null ? BigDecimal.ZERO : v.getOtherSumAmount()));
|
|
|
}
|
|
|
//计算毛利 收入-支出
|
|
|
v.setGross(v.getIncomeAmount().subtract(v.getExpenditureAmount()));
|
|
@@ -305,6 +343,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
|
|
|
/**
|
|
|
* 利润结算表分页
|
|
|
+ *
|
|
|
* @param dto
|
|
|
* @return
|
|
|
*/
|
|
@@ -313,21 +352,21 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
IWrapper<Contract> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("t1", Contract::getCreateTime);
|
|
|
wrapper.between("t1", Contract::getStatus, FlowStatusEnum.PASS.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
|
|
|
- if(StringUtils.isNotEmpty(dto.getCustomerId())){
|
|
|
- wrapper.eq("t1",Contract::getBuyCorporationId,dto.getCustomerId());
|
|
|
+ if (StringUtils.isNotEmpty(dto.getCustomerId())) {
|
|
|
+ wrapper.eq("t1", Contract::getBuyCorporationId, dto.getCustomerId());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(dto.getUserId())){
|
|
|
- wrapper.eq("t1",Contract::getCreateUser,dto.getUserId());
|
|
|
+ if (StringUtils.isNotEmpty(dto.getUserId())) {
|
|
|
+ wrapper.eq("t1", Contract::getCreateUser, dto.getUserId());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(dto.getKeyword())){
|
|
|
- wrapper.keyword(dto.getKeyword(),new SqlField("t1.code"));
|
|
|
+ if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
+ wrapper.keyword(dto.getKeyword(), new SqlField("t1.code"));
|
|
|
}
|
|
|
Page<ContractBudgetVo> page = this.baseMapper.getProfitClearingPage(dto.getPage(), wrapper);
|
|
|
List<ContractBudgetVo> list = page.getRecords();
|
|
|
//取出默认汇率
|
|
|
List<CurrencyRate> defaultCurrencyRateList = currencyRateService.getList();
|
|
|
- Map<String,BigDecimal> defaultCurrencyRateMap = defaultCurrencyRateList.stream().collect(Collectors.toMap(CurrencyRate::getType,CurrencyRate::getRate));
|
|
|
- for(ContractBudgetVo v : list){
|
|
|
+ Map<String, BigDecimal> defaultCurrencyRateMap = defaultCurrencyRateList.stream().collect(Collectors.toMap(CurrencyRate::getType, CurrencyRate::getRate));
|
|
|
+ for (ContractBudgetVo v : list) {
|
|
|
v.setRefundableAmount(BigDecimal.ZERO);//暂时先设置退税金额为0
|
|
|
v.setOtherIncomeAmount(BigDecimal.ZERO);//暂时先设置其他收入为0
|
|
|
v.setAccountPaid(BigDecimal.ZERO);//暂时先设置已付货款为0
|
|
@@ -335,28 +374,28 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
customerService.attributeAssign(list, Contract::getBuyCorporationId, (item, customer) -> {
|
|
|
item.setCustomerName(customer.getName());
|
|
|
});
|
|
|
- if(StringUtils.isNotEmpty(v.getCurrencyRateJson())) {//如果此条合同有汇率了
|
|
|
+ if (StringUtils.isNotEmpty(v.getCurrencyRateJson())) {//如果此条合同有汇率了
|
|
|
//取出汇率
|
|
|
List<CurrencyRate> assignCurrencyRatesList = JSON.parseArray(v.getCurrencyRateJson(), CurrencyRate.class);
|
|
|
- Map<String,BigDecimal> assignCurrencyRatesMap = assignCurrencyRatesList.stream().collect(Collectors.toMap(CurrencyRate::getType,CurrencyRate::getRate));
|
|
|
- v.setRmbContractAmount(v.getAmount().multiply(assignCurrencyRatesMap.getOrDefault(v.getCurrency(),BigDecimal.ONE)));//计算汇算人民币
|
|
|
+ Map<String, BigDecimal> assignCurrencyRatesMap = assignCurrencyRatesList.stream().collect(Collectors.toMap(CurrencyRate::getType, CurrencyRate::getRate));
|
|
|
+ v.setRmbContractAmount(v.getAmount().multiply(assignCurrencyRatesMap.getOrDefault(v.getCurrency(), BigDecimal.ONE)));//计算汇算人民币
|
|
|
//到账金额
|
|
|
- v.setSumClaimMoney(this.getSumClaimMoney(v,assignCurrencyRatesMap));
|
|
|
+ v.setSumClaimMoney(this.getSumClaimMoney(v, assignCurrencyRatesMap));
|
|
|
//采购合同总金额
|
|
|
- v.setSumPurchaseContractMoney(this.getSumPurchaseContractMoney(v,assignCurrencyRatesMap));
|
|
|
+ v.setSumPurchaseContractMoney(this.getSumPurchaseContractMoney(v, assignCurrencyRatesMap));
|
|
|
//支出费用
|
|
|
- this.getGroupTypeMoney(v,assignCurrencyRatesMap);
|
|
|
- }else{//没有取默认的汇率
|
|
|
- v.setRmbContractAmount(v.getAmount().multiply(defaultCurrencyRateMap.getOrDefault(v.getCurrency(),BigDecimal.ONE)));//计算汇算人民币
|
|
|
+ this.getGroupTypeMoney(v, assignCurrencyRatesMap);
|
|
|
+ } else {//没有取默认的汇率
|
|
|
+ v.setRmbContractAmount(v.getAmount().multiply(defaultCurrencyRateMap.getOrDefault(v.getCurrency(), BigDecimal.ONE)));//计算汇算人民币
|
|
|
//到账金额
|
|
|
- v.setSumClaimMoney(this.getSumClaimMoney(v,defaultCurrencyRateMap));
|
|
|
+ v.setSumClaimMoney(this.getSumClaimMoney(v, defaultCurrencyRateMap));
|
|
|
//采购合同总金额
|
|
|
- v.setSumPurchaseContractMoney(this.getSumPurchaseContractMoney(v,defaultCurrencyRateMap));
|
|
|
+ v.setSumPurchaseContractMoney(this.getSumPurchaseContractMoney(v, defaultCurrencyRateMap));
|
|
|
//支出费用
|
|
|
- this.getGroupTypeMoney(v,defaultCurrencyRateMap);
|
|
|
+ this.getGroupTypeMoney(v, defaultCurrencyRateMap);
|
|
|
}
|
|
|
//计算收入总计=合同金额(转人民币)+应退税金额(转人民币)+其他收入(转人民币)
|
|
|
- v.setIncomeAmount(v.getRmbContractAmount()==null?BigDecimal.ZERO:v.getRmbContractAmount().add(v.getRefundableAmount()).add(v.getOtherIncomeAmount()));
|
|
|
+ v.setIncomeAmount(v.getRmbContractAmount() == null ? BigDecimal.ZERO : v.getRmbContractAmount().add(v.getRefundableAmount()).add(v.getOtherIncomeAmount()));
|
|
|
//计算支出总计 除合同金额(转人民币)+应退税金额(转人民币)+其他收入(转人民币) 其他金额相加
|
|
|
v.setExpenditureAmount(v.getTrailerFee().add
|
|
|
(v.getCustomsFee()).add
|
|
@@ -383,6 +422,25 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
public ContractVo detail(Long id) {
|
|
|
Contract Contract = this.getById(id);
|
|
|
ContractVo result = BeanUtil.toBean(Contract, ContractVo.class);
|
|
|
+
|
|
|
+ List<ContractProduct> contractProductList = contractProductService.list(q -> q.eq(ContractProduct::getContractId, id));
|
|
|
+ productInfoService.attributeAssign(contractProductList, ContractProduct::getProductId, (item, product) -> {
|
|
|
+ item.setProductCnName(product.getName());
|
|
|
+ item.setProductCode(product.getCode());
|
|
|
+ item.setProductUnit(product.getUnit());
|
|
|
+ });
|
|
|
+ result.setContractProductList(contractProductList);
|
|
|
+
|
|
|
+ List<ContractProject> contractProjectList = contractProjectService.list(q -> q.eq(ContractProject::getContractId, id));
|
|
|
+ result.setContractProjectList(contractProjectList);
|
|
|
+
|
|
|
+ List<ContractShipment> contractShipmentList = contractShipmentService.list(q -> q.eq(ContractShipment::getContractId, id));
|
|
|
+ productInfoService.attributeAssign(contractShipmentList, ContractShipment::getProductId, (item, product) -> {
|
|
|
+ item.setProductCnName(product.getName());
|
|
|
+ item.setProductCode(product.getCode());
|
|
|
+ });
|
|
|
+ result.setContractShipmentList(contractShipmentList);
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -661,8 +719,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
*/
|
|
|
@Override
|
|
|
public void contractHandover(ContractDto dto) {
|
|
|
- ObsFileUtil.editFile(dto.getFileList(),dto.getId(),1);
|
|
|
- ObsFileUtil.editFile(dto.getPackageFileList(),dto.getId(),2);
|
|
|
+ ObsFileUtil.editFile(dto.getFileList(), dto.getId(), 1);
|
|
|
+ ObsFileUtil.editFile(dto.getPackageFileList(), dto.getId(), 2);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -675,15 +733,15 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
QueryWrapper<Contract> query = Wrappers.query();
|
|
|
query.select("count(*) count,ifnull(sum(amount),0) amount,sell_corporation_id sellCorporationId");
|
|
|
query.groupBy("sell_corporation_id");
|
|
|
- query.eq("status",30);
|
|
|
+ query.eq("status", 30);
|
|
|
List<Contract> contractList = baseMapper.selectList(query);
|
|
|
|
|
|
//计算合计数量
|
|
|
Integer countAmount = contractList.stream().map(Contract::getCount).reduce(Integer::sum).orElse(0);
|
|
|
//计算合计金额
|
|
|
BigDecimal amount = contractList.stream().map(Contract::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- map.put("countAmount",countAmount);
|
|
|
- map.put("amount",amount);
|
|
|
+ map.put("countAmount", countAmount);
|
|
|
+ map.put("amount", amount);
|
|
|
|
|
|
//赋值归属公司名称
|
|
|
DynamicDataSourceContextHolder.push(SourceConstant.COMMON);
|
|
@@ -777,6 +835,168 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
return decisionAidVo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public PayDecisionAidVo payDecisionAid(PayDecisionAidDto dto) {
|
|
|
+
|
|
|
+ PayDecisionAidVo vo = new PayDecisionAidVo();
|
|
|
+
|
|
|
+ // 采购合同id
|
|
|
+ List<Long> purchaseIdList = dto.getPurchaseIdList();
|
|
|
+
|
|
|
+ if (purchaseIdList.size() == 0) {
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 采购合同
|
|
|
+ List<Purchase> purchaseList = purchaseService.listByIds(purchaseIdList);
|
|
|
+ List<PurchaseDetail> purchaseDetailList = purchaseDetailService.list(q -> q.in(PurchaseDetail::getPurchaseId, purchaseIdList));
|
|
|
+
|
|
|
+ // 赋值关联销售合同
|
|
|
+ setContractInfo(vo, purchaseDetailList);
|
|
|
+
|
|
|
+ // 赋值采购合同数据
|
|
|
+ setPurchaseInfo(vo, purchaseList, purchaseDetailList);
|
|
|
+
|
|
|
+ // 赋值到货数据
|
|
|
+ List<ArrivalDetail> arrivalDetails = setInvoiceQuantity(vo);
|
|
|
+
|
|
|
+ // 赋值合格率
|
|
|
+ setPassRate(vo, arrivalDetails);
|
|
|
+
|
|
|
+ // TODO 赋值退货数量 无法关联
|
|
|
+
|
|
|
+
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 赋值合格率
|
|
|
+ */
|
|
|
+ private void setPassRate(PayDecisionAidVo vo, List<ArrivalDetail> arrivalDetails) {
|
|
|
+ List<PayDecisionAidVo.PurchaseInfo> purchaseInfoList = vo.getPurchaseInfoList();
|
|
|
+
|
|
|
+ if (arrivalDetails.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 到货明细通过采购明细id分组
|
|
|
+ Map<Long, List<ArrivalDetail>> arrivalDetailMap = arrivalDetails.stream().collect(Collectors.groupingBy(
|
|
|
+ ArrivalDetail::getPurchaseDetailId
|
|
|
+ ));
|
|
|
+
|
|
|
+ // 通过到货明细查询质检记录
|
|
|
+ List<Long> arrivalDetailsIdList = arrivalDetails.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
+ List<QualityDetail> list = qualityDetailService.list(q -> q.in(QualityDetail::getArrivalDetailId, arrivalDetailsIdList));
|
|
|
+
|
|
|
+
|
|
|
+ for (PayDecisionAidVo.PurchaseInfo purchaseInfo : purchaseInfoList) {
|
|
|
+
|
|
|
+ List<ArrivalDetail> arrivalDetailsList = arrivalDetailMap.get(purchaseInfo.getPurchaseDetailsId());
|
|
|
+
|
|
|
+ purchaseInfo.setQualifiedCount(BigDecimal.ZERO);
|
|
|
+ purchaseInfo.setNoQualifiedCount(BigDecimal.ZERO);
|
|
|
+
|
|
|
+ List<Long> itemArrivalDetailsIdList = arrivalDetailsList.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
+ for (QualityDetail qualityDetail : list) {
|
|
|
+ if (!itemArrivalDetailsIdList.contains(qualityDetail.getArrivalDetailId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ purchaseInfo.setQualifiedCount(purchaseInfo.getQualifiedCount().add(qualityDetail.getQualifiedCount()));
|
|
|
+ purchaseInfo.setNoQualifiedCount(purchaseInfo.getNoQualifiedCount().add(qualityDetail.getNoQualifiedCount()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 赋值到货数据
|
|
|
+ */
|
|
|
+ private List<ArrivalDetail> setInvoiceQuantity(PayDecisionAidVo vo) {
|
|
|
+ List<PayDecisionAidVo.PurchaseInfo> purchaseInfoList = vo.getPurchaseInfoList();
|
|
|
+
|
|
|
+ // 采购明细id列表
|
|
|
+ List<Long> purchaseDetailsIdList = purchaseInfoList.stream()
|
|
|
+ .map(PayDecisionAidVo.PurchaseInfo::getPurchaseDetailsId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (purchaseDetailsIdList.size() == 0) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ArrivalDetail> list = arrivalDetailService.list(q -> q.eq(ArrivalDetail::getPurchaseDetailId, purchaseDetailsIdList));
|
|
|
+
|
|
|
+ Map<Long, BigDecimal> collect = list.stream().collect(Collectors.toMap(
|
|
|
+ ArrivalDetail::getPurchaseDetailId,
|
|
|
+ ArrivalDetail::getCount,
|
|
|
+ BigDecimal::add
|
|
|
+ ));
|
|
|
+
|
|
|
+ for (PayDecisionAidVo.PurchaseInfo purchaseInfo : purchaseInfoList) {
|
|
|
+ BigDecimal invoiceQuantity = collect.getOrDefault(purchaseInfo.getPurchaseDetailsId(), BigDecimal.ZERO);
|
|
|
+ purchaseInfo.setInvoiceQuantity(invoiceQuantity);
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 赋值采购合同数据
|
|
|
+ */
|
|
|
+ private void setPurchaseInfo(PayDecisionAidVo vo, List<Purchase> purchaseList, List<PurchaseDetail> purchaseDetailList) {
|
|
|
+
|
|
|
+ Map<Long, List<PurchaseDetail>> purchaseDetailMap = purchaseDetailList.stream()
|
|
|
+ .collect(Collectors.groupingBy(PurchaseDetail::getPurchaseId));
|
|
|
+
|
|
|
+ List<PayDecisionAidVo.PurchaseInfo> list = new ArrayList<>();
|
|
|
+
|
|
|
+ for (Purchase purchase : purchaseList) {
|
|
|
+ List<PurchaseDetail> itemList = purchaseDetailMap.get(purchase.getId());
|
|
|
+
|
|
|
+ if (itemList.size() == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (PurchaseDetail purchaseDetail : itemList) {
|
|
|
+ PayDecisionAidVo.PurchaseInfo purchaseInfo = new PayDecisionAidVo.PurchaseInfo();
|
|
|
+ purchaseInfo.setPurchaseId(purchase.getId());
|
|
|
+ purchaseInfo.setPurchaseCode(purchase.getCode());
|
|
|
+ purchaseInfo.setPurchaseDetailsId(purchaseDetail.getId());
|
|
|
+ purchaseInfo.setProductId(purchaseDetail.getBussinessId());
|
|
|
+ purchaseInfo.setPurchaseQuantity(purchaseDetail.getCount());
|
|
|
+ list.add(purchaseInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 赋值产品id
|
|
|
+ productInfoService.attributeAssign(list, PayDecisionAidVo.PurchaseInfo::getProductId, (item, product) -> {
|
|
|
+ item.setProductName(product.getName());
|
|
|
+ item.setProductCode(product.getCode());
|
|
|
+ });
|
|
|
+
|
|
|
+ vo.setPurchaseInfoList(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 赋值销售合同数据
|
|
|
+ */
|
|
|
+ private void setContractInfo(PayDecisionAidVo vo, List<PurchaseDetail> purchaseDetailList) {
|
|
|
+
|
|
|
+ List<Long> contractIdList = purchaseDetailList.stream()
|
|
|
+ .filter(item -> Objects.equals(item.getDataResource(), 1))
|
|
|
+ .map(PurchaseDetail::getDataResourceId)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (contractIdList.size() == 0) {
|
|
|
+ vo.setContractList(Collections.emptyList());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Contract> customerList = contractService.list(q -> q.in(BaseIdPo::getId, contractIdList));
|
|
|
+ vo.setContractList(customerList);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 赋值外销合同信息
|
|
@@ -1069,49 +1289,52 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
|
|
|
/**
|
|
|
* 统计到账认领总金额
|
|
|
+ *
|
|
|
* @param v
|
|
|
* @param currencyRatesMap 汇率JSON
|
|
|
* @return
|
|
|
*/
|
|
|
- private BigDecimal getSumClaimMoney(ContractBudgetVo v,Map<String,BigDecimal> currencyRatesMap){
|
|
|
- List<ClaimContract> claimContractList = claimContractService.list(Wrappers.<ClaimContract>query().lambda().eq(ClaimContract::getContractId,v.getContractId()));
|
|
|
+ private BigDecimal getSumClaimMoney(ContractBudgetVo v, Map<String, BigDecimal> currencyRatesMap) {
|
|
|
+ List<ClaimContract> claimContractList = claimContractService.list(Wrappers.<ClaimContract>query().lambda().eq(ClaimContract::getContractId, v.getContractId()));
|
|
|
BigDecimal sumClaimMOney = BigDecimal.ZERO;
|
|
|
- if(CollectionUtils.isNotEmpty(claimContractList)){
|
|
|
- for(ClaimContract c:claimContractList){
|
|
|
- sumClaimMOney = sumClaimMOney.add(c.getMoney().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ if (CollectionUtils.isNotEmpty(claimContractList)) {
|
|
|
+ for (ClaimContract c : claimContractList) {
|
|
|
+ sumClaimMOney = sumClaimMOney.add(c.getMoney().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
}
|
|
|
return sumClaimMOney;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return BigDecimal.ZERO;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 统采购合同总金额
|
|
|
+ *
|
|
|
* @param v
|
|
|
* @param currencyRatesMap 汇率JSON
|
|
|
* @return
|
|
|
*/
|
|
|
- private BigDecimal getSumPurchaseContractMoney(ContractBudgetVo v,Map<String,BigDecimal> currencyRatesMap){
|
|
|
+ private BigDecimal getSumPurchaseContractMoney(ContractBudgetVo v, Map<String, BigDecimal> currencyRatesMap) {
|
|
|
List<EhsdPurchaseProductVo> list = ehsdPurchaseProductService.getListByContractId(v.getContractId());
|
|
|
BigDecimal sumPurchaseContractMoney = BigDecimal.ZERO;
|
|
|
- if(CollectionUtils.isNotEmpty(list)){
|
|
|
- for(EhsdPurchaseProductVo c:list){
|
|
|
- sumPurchaseContractMoney = sumPurchaseContractMoney.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ for (EhsdPurchaseProductVo c : list) {
|
|
|
+ sumPurchaseContractMoney = sumPurchaseContractMoney.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
}
|
|
|
return sumPurchaseContractMoney;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return BigDecimal.ZERO;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 统计支出各种费用
|
|
|
+ *
|
|
|
* @param v
|
|
|
* @param currencyRatesMap 汇率JSON
|
|
|
* @return
|
|
|
*/
|
|
|
- private void getGroupTypeMoney(ContractBudgetVo v,Map<String,BigDecimal> currencyRatesMap){
|
|
|
+ private void getGroupTypeMoney(ContractBudgetVo v, Map<String, BigDecimal> currencyRatesMap) {
|
|
|
List<AccountRequestFundsDetailVo> list = accountRequestFundsDetailService.getListByContractId(v.getContractId());
|
|
|
/**
|
|
|
* 拖车费
|
|
@@ -1161,40 +1384,40 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
/**
|
|
|
* 其他费用
|
|
|
*/
|
|
|
- BigDecimal other = BigDecimal.ZERO;
|
|
|
+ BigDecimal other = BigDecimal.ZERO;
|
|
|
|
|
|
- if(CollectionUtils.isNotEmpty(list)){
|
|
|
- for(AccountRequestFundsDetailVo c:list){
|
|
|
- switch (c.getCostType()){
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ for (AccountRequestFundsDetailVo c : list) {
|
|
|
+ switch (c.getCostType()) {
|
|
|
case "1"://拖车费
|
|
|
- trailerFee = trailerFee.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ trailerFee = trailerFee.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "2"://报关费
|
|
|
- customsFee = customsFee.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ customsFee = customsFee.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "3"://港杂费
|
|
|
- portMixedFee = portMixedFee.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ portMixedFee = portMixedFee.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "4"://验收红包
|
|
|
- inspectionRedPack = inspectionRedPack.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ inspectionRedPack = inspectionRedPack.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "5"://佣金
|
|
|
- commission = commission.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ commission = commission.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "6"://检测费
|
|
|
- checkout = checkout.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ checkout = checkout.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "7"://验货费
|
|
|
- inspectionCharge = inspectionCharge.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ inspectionCharge = inspectionCharge.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "8"://运费
|
|
|
- freight = freight.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ freight = freight.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
case "9"://产地证费
|
|
|
- certificateOfOrigin = certificateOfOrigin.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ certificateOfOrigin = certificateOfOrigin.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
default:
|
|
|
- other = other.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(),BigDecimal.ONE)));
|
|
|
+ other = other.add(c.getAmount().multiply(currencyRatesMap.getOrDefault(c.getCurrency(), BigDecimal.ONE)));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -1210,4 +1433,5 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
v.setCertificateOfOrigin(certificateOfOrigin);
|
|
|
v.setOther(other);
|
|
|
}
|
|
|
+
|
|
|
}
|