785834757 2 лет назад
Родитель
Сommit
3094b06f3d

+ 18 - 13
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -29,6 +29,7 @@ import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.entity.po.*;
 import com.ydtech.modules.protocol.service.*;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
+import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.math.NumberUtils;
@@ -2609,7 +2610,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         return result.toString();
     }
 
-    public FeeOrderNewVo newConvertOrderFeeVoData(InsFeeOrderNew insFeeOrderNew) {
+    public FeeOrderNewVo newConvertOrderFeeVoData(InsFeeOrderNew insFeeOrderNew, PtlAgreementProductCostsNew ptlAgreementProductCostsNew) {
         FeeOrderNewVo feeOrderNewVo = new FeeOrderNewVo();
         List<FeeOrderNewVo.EntranceFee> entranceFeeList = new ArrayList<>();
         List<FeeOrderNewVo.ExportFee> exportFeeList = new ArrayList<>();
@@ -2636,6 +2637,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         jqEntranceFee.setOtherCostsProportion(insFeeOrderNew.getJqOtherCostsProportion());   // 跟单比例
         jqEntranceFee.setOtherCostsPremiums(insFeeOrderNew.getJqOtherCostsPremiums());      // 跟单费
         jqEntranceFee.setSuperviseCosts(insFeeOrderNew.getJqSuperviseCostsProportion());  // 手续费比例
+        jqEntranceFee.setExportSuperviseCosts(new BigDecimal(ptlAgreementProductCostsNew.getJqCostsExportProportion()));  // 出口费比例
         entranceFeeList.add(jqEntranceFee);
 
 
@@ -2678,18 +2680,18 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
 
         //交强出口手续费比例
         BigDecimal jqExportSuperviseCosts =
-                jqExportTotalProportion.compareTo(jqEntranceFee.getSuperviseCosts()) > 0 ? jqEntranceFee.getSuperviseCosts() : jqExportTotalProportion;
+                jqExportTotalProportion.compareTo(jqEntranceFee.getExportSuperviseCosts()) > 0 ? jqEntranceFee.getExportSuperviseCosts() : jqExportTotalProportion;
 
         //交强出口其他费比例
         BigDecimal jqOtherCostsProportion =
-                jqExportTotalProportion.compareTo(jqEntranceFee.getSuperviseCosts()) > 0 ? jqExportTotalProportion.subtract(jqExportSuperviseCosts) : new BigDecimal(0);
+                jqExportTotalProportion.compareTo(jqEntranceFee.getExportSuperviseCosts()) > 0 ? jqExportTotalProportion.subtract(jqExportSuperviseCosts) : new BigDecimal(0);
 
         jqExportFee.setSuperviseCosts(jqExportSuperviseCosts);
         jqExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getJqPremium().multiply(jqExportSuperviseCosts.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
         jqExportFee.setOtherCostsProportion(jqOtherCostsProportion);
         jqExportFee.setOtherCostsPremiums(insFeeOrderNew.getJqPremium().multiply(jqOtherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        jqExportFee.setTotalProportion(jqExportFee.getSuperviseCosts().add(jqExportFee.getOtherCostsProportion()));
-        jqExportFee.setTotalAmount(jqExportFee.getSuperviseCostsPremiums().add(jqExportFee.getOtherCostsPremiums()));
+        jqExportFee.setTotalProportion(jqExportSuperviseCosts.add(jqOtherCostsProportion));
+        jqExportFee.setTotalAmount(jqExportSuperviseCosts.add(jqOtherCostsProportion));
         exportFeeList.add(jqExportFee);
 
 
@@ -2704,6 +2706,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         syEntranceFee.setOtherCostsProportion(insFeeOrderNew.getSyOtherCostsProportion());   // 跟单比例
         syEntranceFee.setOtherCostsPremiums(insFeeOrderNew.getSyOtherCostsPremiums());      // 跟单费
         syEntranceFee.setSuperviseCosts(insFeeOrderNew.getSySuperviseCostsProportion());  // 手续费比例
+        syEntranceFee.setExportSuperviseCosts(new BigDecimal(ptlAgreementProductCostsNew.getSyCostsExportProportion()));  // 出口费比例
         entranceFeeList.add(syEntranceFee);
 
         // 商业管理费
@@ -2735,18 +2738,19 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         }
         //商业出口手续费比例
         BigDecimal syExportSuperviseCosts =
-                syExportTotalProportion.compareTo(syEntranceFee.getSuperviseCosts()) > 0 ? syEntranceFee.getSuperviseCosts() : syExportTotalProportion;
+                syExportTotalProportion.compareTo(syEntranceFee.getExportSuperviseCosts()) > 0 ? syEntranceFee.getExportSuperviseCosts() : syExportTotalProportion;
 
         //商业出口其他费比例
         BigDecimal syOtherCostsProportion =
-                syExportTotalProportion.compareTo(syEntranceFee.getSuperviseCosts()) > 0 ? syExportTotalProportion.subtract(syExportSuperviseCosts) : new BigDecimal(0);
+                syExportTotalProportion.compareTo(syEntranceFee.getExportSuperviseCosts()) > 0 ? syExportTotalProportion.subtract(syExportSuperviseCosts) : new BigDecimal(0);
 
         syExportFee.setSuperviseCosts(syExportSuperviseCosts);
         syExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getSyPremium().multiply(syExportSuperviseCosts.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
         syExportFee.setOtherCostsProportion(syOtherCostsProportion);
         syExportFee.setOtherCostsPremiums(insFeeOrderNew.getSyPremium().multiply(syOtherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        syExportFee.setTotalProportion(syExportFee.getSuperviseCosts().add(syExportFee.getOtherCostsProportion()));
-        syExportFee.setTotalAmount(syExportFee.getSuperviseCostsPremiums().add(syExportFee.getOtherCostsPremiums()));
+        //如果入口的总比例等于0  则出口的总比例也等于0
+        syExportFee.setTotalProportion(syExportSuperviseCosts.add(syExportFee.getOtherCostsProportion()));
+        syExportFee.setTotalAmount(syExportSuperviseCosts.add(syExportFee.getOtherCostsPremiums()));
         exportFeeList.add(syExportFee);
 
 
@@ -2761,6 +2765,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         nonEntranceFee.setOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion());   // 跟单比例
         nonEntranceFee.setOtherCostsPremiums(insFeeOrderNew.getNoOtherCostsPremiums());      // 跟单费
         nonEntranceFee.setSuperviseCosts(insFeeOrderNew.getNoSuperviseCostsProportion());  // 手续费比例
+        nonEntranceFee.setExportSuperviseCosts(new BigDecimal(ptlAgreementProductCostsNew.getNoCostsExportProportion()));  // 出口费比例
         entranceFeeList.add(nonEntranceFee);
 
         // 五级管理费
@@ -2794,18 +2799,18 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
 
         //非车出口手续费比例
         BigDecimal nonExportSuperviseCosts =
-                nonExportTotalProportion.compareTo(nonEntranceFee.getSuperviseCosts()) > 0 ? nonEntranceFee.getSuperviseCosts() : nonExportTotalProportion;
+                nonExportTotalProportion.compareTo(nonEntranceFee.getExportSuperviseCosts()) > 0 ? nonEntranceFee.getExportSuperviseCosts() : nonExportTotalProportion;
 
         //非车出口其他费比例
         BigDecimal nonOtherCostsProportion =
-                nonExportTotalProportion.compareTo(nonEntranceFee.getSuperviseCosts()) > 0 ? nonExportTotalProportion.subtract(nonExportSuperviseCosts) : new BigDecimal(0);
+                nonExportTotalProportion.compareTo(nonEntranceFee.getExportSuperviseCosts()) > 0 ? nonExportTotalProportion.subtract(nonExportSuperviseCosts) : new BigDecimal(0);
 
         nonExportFee.setSuperviseCosts(nonExportSuperviseCosts);
         nonExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getNoPremium().multiply(nonExportSuperviseCosts.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
         nonExportFee.setOtherCostsProportion(nonOtherCostsProportion);
         nonExportFee.setOtherCostsPremiums(insFeeOrderNew.getNoPremium().multiply(nonOtherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        nonExportFee.setTotalProportion(nonExportFee.getSuperviseCosts().add(nonExportFee.getOtherCostsProportion()));
-        nonExportFee.setTotalAmount(nonExportFee.getSuperviseCostsPremiums().add(nonExportFee.getOtherCostsPremiums()));
+        nonExportFee.setTotalProportion(nonExportSuperviseCosts.add(nonOtherCostsProportion));
+        nonExportFee.setTotalAmount(nonExportSuperviseCosts.add(nonOtherCostsProportion));
         exportFeeList.add(nonExportFee);
 
         feeOrderNewVo.setEntranceFee(entranceFeeList);

+ 2 - 0
src/main/java/com/ydtech/modules/order/entity/vo/FeeOrderNewVo.java

@@ -47,6 +47,8 @@ public class FeeOrderNewVo implements Serializable {
         private BigDecimal otherCostsProportion;
         @ApiModelProperty("跟单费")
         private BigDecimal otherCostsPremiums;
+        @ApiModelProperty("出口手续费比例")
+        private BigDecimal exportSuperviseCosts;
     }
 
     /**

+ 7 - 1
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -57,7 +57,9 @@ import com.ydtech.modules.protocol.entity.constants.PtlApiType;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
+import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
 import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
+import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewService;
 import com.ydtech.utils.SnowFlakeUtil;
 import com.ydtech.utils.idgen.IdGenerate;
 import org.apache.commons.lang3.StringUtils;
@@ -113,6 +115,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     @Autowired
     private InsFeeOrderNewService insFeeOrderNewService;
 
+    @Autowired
+    private PtlAgreementProductCostsNewService ptlAgreementProductCostsNewService;
+
     @Value("${upload.file.path}")
     private String uploadFilePath;
 
@@ -646,11 +651,12 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 //            }
 //        }
         if (!Objects.isNull(insFeeOrderNew)) {
+            PtlAgreementProductCostsNew ptlAgreementProductCostsNew = ptlAgreementProductCostsNewService.getById(insFeeOrderNew.getCostsId());
             List<QueryOrderFeeResultVo> orderFeeVoList = feeRuleSchemeService.convertOrderFeeVoData(insFeeOrderNew);
             orderAndAreaCompany.setOrderFeeResult(orderFeeVoList);
 //            List<FeeOrderNewVo> feeOrderNewVoList = feeRuleSchemeService.newConvertOrderFeeVoData(insFeeOrderNew);
 //            orderAndAreaCompany.setFeeOrderNewVoList(feeOrderNewVoList);
-            FeeOrderNewVo  feeOrderNewVo =   feeRuleSchemeService.newConvertOrderFeeVoData(insFeeOrderNew);
+            FeeOrderNewVo  feeOrderNewVo =   feeRuleSchemeService.newConvertOrderFeeVoData(insFeeOrderNew,ptlAgreementProductCostsNew);
             orderAndAreaCompany.setFeeOrderNewVo(feeOrderNewVo);
             List<DistributionLevelVo> distributionLevelVoList = feeRuleSchemeService.converDistrbutionData(insFeeOrderNew);
             orderAndAreaCompany.setDistributionLevelVoList(distributionLevelVoList);

+ 12 - 0
src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsNew.java

@@ -51,6 +51,10 @@ public class PtlAgreementProductCostsNew {
     @TableField(value = "jq_car_other_costs_proportion")
     private String jqCarOtherCostsProportion;
 
+    @ApiModelProperty(value = "出口手续费比例(交强)")
+    @TableField(value = "jq_costs_export_proportion")
+    private String jqCostsExportProportion;
+
     @ApiModelProperty(value = "费用比例(商业)")
     @TableField(value = "sy_car_costs_proportion")
     private String syCarCostsProportion;
@@ -67,6 +71,10 @@ public class PtlAgreementProductCostsNew {
     @TableField(value = "sy_car_other_costs_proportion")
     private String syCarOtherCostsProportion;
 
+    @ApiModelProperty(value = "出口手续费比例(商业)")
+    @TableField(value = "sy_costs_export_proportion")
+    private String syCostsExportProportion;
+
 
     @ApiModelProperty(value = "费用比例(非车)")
     @TableField(value = "no_car_costs_proportion")
@@ -80,6 +88,10 @@ public class PtlAgreementProductCostsNew {
     @TableField(value = "no_car_other_costs_proportion")
     private String noCarOtherCostsProportion;
 
+    @ApiModelProperty(value = "出口手续费比例(非车)")
+    @TableField(value = "no_costs_export_proportion")
+    private String noCostsExportProportion;
+
     @ApiModelProperty(value = "费用描述")
     @TableField(value = "costs_description")
     private String costsDescription;

+ 11 - 0
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -53,6 +54,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     public Page<PtlAgreementProductCostsNew> getByAgreementId(Page page, String agreementId) {
         Page<PtlAgreementProductCostsNew> pages = baseMapper.selectPage(page, new LambdaQueryWrapper<PtlAgreementProductCostsNew>()
                 .eq(PtlAgreementProductCostsNew::getAgreementId, agreementId));
+
+//                .lt(PtlAgreementProductCostsNew::getCostsStartDate, formattedDateTime)
+//                .gt(PtlAgreementProductCostsNew::getCostsEndDate, formattedDateTime));
         //遍历费用列表
         List<String> ids = new ArrayList<>();
         pages.getRecords().forEach(x -> {
@@ -249,9 +253,16 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     @Override
     public List<AgreementProductCosts> costsGetList(String agreementId, String productId) {
 
+        // 获取当前日期时间
+        LocalDateTime currentDateTime = LocalDateTime.now();
+        // 格式化日期时间为指定格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String formattedDateTime = currentDateTime.format(formatter);
         List<PtlAgreementProductCostsNew> ptlAgreementProductCostsNews = baseMapper.selectList(new LambdaQueryWrapper<PtlAgreementProductCostsNew>()
                 .eq(PtlAgreementProductCostsNew::getAgreementId, agreementId)
                 .eq(PtlAgreementProductCostsNew::getProductId, productId)
+                .lt(PtlAgreementProductCostsNew::getCostsStartDate, formattedDateTime)
+                .gt(PtlAgreementProductCostsNew::getCostsEndDate, formattedDateTime)
                 .orderBy(true, true, PtlAgreementProductCostsNew::getPriorityLevel));
 
         List<AgreementProductCosts> agreementProductCosts = new ArrayList<>();