wuhp 2 年 前
コミット
bcb4573128

+ 1 - 3
src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java

@@ -280,9 +280,7 @@ public class InsPlyIncome implements Serializable {
     @TableField("no_other_costs_proportion")
     private BigDecimal noOtherCostsProportion;
 
-    @ApiModelProperty("非车跟单金额")
-    @TableField("no_other_costs_premium")
-    private BigDecimal noOtherCostsPremiums;
+
 
     @ApiModelProperty("交强跟单金额")
     @TableField("jq_other_costs_premium")

+ 11 - 10
src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java

@@ -17,6 +17,7 @@ import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.service.InsUploadFilesService;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.math3.dfp.DfpField;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
@@ -111,21 +112,21 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    if (excelItem.getJqSuperviseCostsPremiums() != null && excelItem.getJqSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getJqSuperviseCostsPremiums() != null && excelItem.getJqSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0 && excelItem.getJqSuperviseCostsPremiums().compareTo(insPlyIncome.getJqSuperviseCostsPremiums()) != 0) {
                         params.put("jqSuperviseCostsPremiums", excelItem.getJqSuperviseCostsPremiums());
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
                         if (ObjectUtils.isEmpty(byBxLicenseno)) {
                             reason = "该数据交强手续费金额有问题";
                         }
                     }
-                    if (excelItem.getJqSuperviseCostsProportion() != null && excelItem.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getJqSuperviseCostsProportion() != null && excelItem.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 && excelItem.getJqSuperviseCostsProportion().compareTo(insPlyIncome.getJqSuperviseCostsProportion()) != 0) {
                         params.put("jqSuperviseCostsProportion", excelItem.getJqSuperviseCostsProportion());
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
                         if (ObjectUtils.isEmpty(byBxLicenseno)) {
                             reason = "该数据交强手续费比例有问题";
                         }
                     }
-                    if (excelItem.getSySuperviseCostsProportion() != null && excelItem.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getSySuperviseCostsProportion() != null && excelItem.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 && excelItem.getSySuperviseCostsProportion().compareTo(insPlyIncome.getSySuperviseCostsProportion()) != 0) {
                         params.put("sySuperviseCostsProportion", excelItem.getSySuperviseCostsProportion());
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
                         if (ObjectUtils.isEmpty(byBxLicenseno)) {
@@ -133,21 +134,21 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                         }
                     }
 
-                    if (excelItem.getSySuperviseCostsPremiums() != null && excelItem.getSySuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getSySuperviseCostsPremiums() != null && excelItem.getSySuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0 && excelItem.getSySuperviseCostsPremiums().compareTo(insPlyIncome.getSySuperviseCostsPremiums()) != 0) {
                         params.put("sySuperviseCostsPremiums", excelItem.getSySuperviseCostsPremiums());
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
                         if (ObjectUtils.isEmpty(byBxLicenseno)) {
                             reason = "该数据商业手续费金额有问题";
                         }
                     }
-                    if (excelItem.getJqPremium() != null && excelItem.getJqPremium().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getJqPremium() != null && excelItem.getJqPremium().compareTo(BigDecimal.ZERO) != 0 && excelItem.getJqPremium().compareTo(insPlyIncome.getJqPremium()) != 0 ) {
                         params.put("jqPremium", excelItem.getJqPremium());
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
                         if (ObjectUtils.isEmpty(byBxLicenseno)) {
                             reason = "该数据交强保费有问题";
                         }
                     }
-                    if (excelItem.getSyPremium() != null && excelItem.getSyPremium().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getSyPremium() != null && excelItem.getSyPremium().compareTo(BigDecimal.ZERO) != 0 && excelItem.getSyPremium().compareTo(insPlyIncome.getSyPremium()) != 0 ) {
                         params.put("syPremium", excelItem.getSyPremium());
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
                         if (ObjectUtils.isEmpty(byBxLicenseno)) {
@@ -273,7 +274,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     agreementId = insPlyIncome.getAgreementId();  //协议id
                 }
                 if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
-                    if (excelItem.getJqOtherCostsProportion()!=null  &&  excelItem.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getJqOtherCostsProportion()!=null  &&  excelItem.getJqOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0  &&  excelItem.getJqOtherCostsProportion().compareTo(insPlyIncome.getJqOtherCostsProportion()) != 0) {
                         BigDecimal jqOtherCostsProportion = excelItem.getJqOtherCostsProportion();//商业保单号
                         params.put("jqOtherCostsProportion", jqOtherCostsProportion);
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
@@ -281,7 +282,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                             reason = "该数据交强跟单比例有问题";
                         }
                     }
-                    if (excelItem.getSyOtherCostsProportion()!=null  &&  excelItem.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getSyOtherCostsProportion()!=null  &&  excelItem.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0  &&  excelItem.getSyOtherCostsProportion().compareTo(insPlyIncome.getSyOtherCostsProportion()) != 0) {
                         BigDecimal syOtherCostsProportion = excelItem.getSyOtherCostsProportion();//商业保单号
                         params.put("syOtherCostsProportion", syOtherCostsProportion);
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
@@ -390,7 +391,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     agreementId = insPlyIncome.getAgreementId();  //协议id
                 }
                 if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
-                    if (excelItem.getNoOtherCostsProportion()!=null  &&  excelItem.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getNoOtherCostsProportion()!=null  &&  excelItem.getNoOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0 &&  excelItem.getNoOtherCostsProportion().compareTo(insPlyIncome.getNoOtherCostsProportion()) != 0) {
                         BigDecimal noOtherCostsProportion = excelItem.getNoOtherCostsProportion();//商业保单号
                         params.put("noOtherCostsProportion", noOtherCostsProportion);
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
@@ -496,7 +497,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                    if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0&&  excelItem.getNoSuperviseCostsProportion().compareTo(insPlyIncome.getNoSuperviseCostsProportion()) != 0 ) {
                         BigDecimal noSuperviseCostsProportion = excelItem.getNoSuperviseCostsProportion();//商业保单号
                         params.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
                         InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);

+ 6 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -158,7 +158,6 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         }
         insPlyIncome.setOtherFeevalue(insFeeOrderNew.getNoOtherCostsPremiums());  //非车跟单费
         insPlyIncome.setOtherFeerate(insFeeOrderNew.getNoOtherCostsProportion()); //非车跟单费用比例
-//        insPlyIncome.setDeptId(insFeeOrderNew.getDeptId());
         this.saveRiskCode(order.getProductid(),insPlyIncome);
         insPlyIncome.setPayDate(insAreaCompany.getPayDate());
         insPlyIncome.setSignDate(insAreaCompany.getSigningTime());
@@ -1496,6 +1495,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     @Transactional
     public HttpResult<Object> batchInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
         ImportResult importResult = importAsyncService.getById(insPlyIncomeVo.getSelectIds().get(0));  // 查询 任务
+        List<String> byTaskId = incomeTaskRelationshipService.getByTaskId(importResult.getId());
         HashMap<String, Object> params = new HashMap<>();
         if (StringUtils.isNotEmpty(importResult.getId())) {
             params.put("companyId",importResult.getCompanyId());
@@ -1508,6 +1508,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                     params.put("isNotCar", "1");
                 }
             }
+            if(!CollectionUtils.isEmpty(byTaskId)){
+                params.put("incomeIds",byTaskId);
+            }
             List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
             if (!CollectionUtils.isEmpty(insPlyIncomes)) {
                 if (insPlyIncomeVo != null) { // 确保insPlyIncomeVo不是null
@@ -1519,6 +1522,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                             return HttpResult.error("该单据已经开票 ");
                         } else {
                             item.setTaskId(importResult.getId());
+                            item.setSettlementTime(LocalDate.now());
+                            item.setSettlementUserId(BaseController.getUser().getName());
                             baseMapper.updateById(item);
                         }
                     }

+ 33 - 32
src/main/java/com/ydtech/modules/fnc/service/impl/SettlementDocumentaryFeesServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.fnc.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
@@ -37,7 +38,7 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
     @Autowired
     private SettlementDocumentaryLogService settlementDocumentaryLogService;
     @Autowired
-    private InsPlyIncomeMapper  insPlyIncomeMapper;
+    private InsPlyIncomeMapper insPlyIncomeMapper;
 
 
     @Override
@@ -46,22 +47,22 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
             HashMap<String, Object> params = new HashMap<>();
             params.put("pageNum", settlementDocumentaryFeesVo.getPageNum());
             params.put("pageSize", settlementDocumentaryFeesVo.getPageSize());
-            if(StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getHandlingFeesStatus())){
-                params.put("handlingFeesStatus",settlementDocumentaryFeesVo.getHandlingFeesStatus());
+            if (StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getHandlingFeesStatus())) {
+                params.put("handlingFeesStatus", settlementDocumentaryFeesVo.getHandlingFeesStatus());
             }
-            if(StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getAgreementType())){
-                params.put("agreementType",settlementDocumentaryFeesVo.getAgreementType());
+            if (StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getAgreementType())) {
+                params.put("agreementType", settlementDocumentaryFeesVo.getAgreementType());
             }
 
-            if(StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getIsNotCar())){
-                params.put("isNotCar",settlementDocumentaryFeesVo.getIsNotCar());
+            if (StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getIsNotCar())) {
+                params.put("isNotCar", settlementDocumentaryFeesVo.getIsNotCar());
             }
 
-            if(StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getPartnerCompaniesId())){
-                params.put("partnerCompaniesId",settlementDocumentaryFeesVo.getPartnerCompaniesId());
+            if (StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getPartnerCompaniesId())) {
+                params.put("partnerCompaniesId", settlementDocumentaryFeesVo.getPartnerCompaniesId());
             }
-            if(StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getParentId())){
-                params.put("parentId",settlementDocumentaryFeesVo.getParentId());
+            if (StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getParentId())) {
+                params.put("parentId", settlementDocumentaryFeesVo.getParentId());
             }
             PageInfo<List<SettlementDocumentaryFeesEntity>> pageHelper = null;
             List<SettlementDocumentaryFeesEntity> list = this.baseMapper.querySettle(params);
@@ -97,7 +98,6 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
     }
 
 
-
     @Override
     @Transactional
     public HttpResult documentarySettle(SettlementDocumentaryFeesVo settlementDocumentaryFeesVo) {
@@ -129,23 +129,21 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
     }
 
     /**
-     *
-     * @param invoiceIds   结算表的id
-     * @return  返回开票号 开票金额  开票时间
+     * @param invoiceIds 结算表的id
+     * @return 返回开票号 开票金额  开票时间
      */
     @Override
-    public List<HashMap<String, Object>> getOtherSettldetail(HashMap<String,Object> params) {
+    public List<HashMap<String, Object>> getOtherSettldetail(HashMap<String, Object> params) {
         return baseMapper.getOtherSettldetail(params);
     }
 
     /**
-     *
-     * @param ids  开票ids
-     * @param invoicingMethod  开票方式 0 保司开票  1 掌柜开票
-     * @param taxPoints  税点
+     * @param ids             开票ids
+     * @param invoicingMethod 开票方式 0 保司开票  1 掌柜开票
+     * @param taxPoints       税点
      */
     @Override
-    public void batchByInvoice(String ids , String invoicingMethod, BigDecimal taxPoints ,BigDecimal invoicCommissionFeevalue) {
+    public void batchByInvoice(String ids, String invoicingMethod, BigDecimal taxPoints, BigDecimal invoicCommissionFeevalue) {
         /**
          * 跟单开票处新增开票方式:保司开票/掌柜开票
          *
@@ -158,15 +156,15 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
 //        结算金额    收款金额=开票金额*(1-税点)
 
 
-            HashMap<String, Object> params = new HashMap<>();
-            params.put("ids",ids.split(","));
+        HashMap<String, Object> params = new HashMap<>();
+        params.put("ids", ids.split(","));
 
-            baseMapper.batchByInvoice(params);
+        baseMapper.batchByInvoice(params);
     }
 
     @Override
     public List<HashMap<String, Object>> getInvoicIds(HashMap<String, Object> params) {
-        return  baseMapper.getInvoicIds(params);
+        return baseMapper.getInvoicIds(params);
     }
 
     @Override
@@ -176,7 +174,8 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
     }
 
     /**
-     *  作废开票  settlementStatus  为3表示为作废开票
+     * 作废开票  settlementStatus  为3表示为作废开票
+     *
      * @param settlementDocumentaryFeesVo
      */
     @Override
@@ -185,18 +184,20 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
 
         String taskId = oldSettlementDocumentaryFeesEntity.getTaskId();
         HashMap<String, Object> params = new HashMap<>();
-        params.put("taskId",taskId);
+        params.put("taskId", taskId);
         List<InsPlyIncome> insPlyIncomes = insPlyIncomeMapper.queryNew(params);
 
-        for (InsPlyIncome   item :insPlyIncomes){
-            item.setHandlingFeesStatus("0");  //0 为未开票
-            item.setTaskId(null);
-            insPlyIncomeMapper.updateById(item);
+        for (InsPlyIncome item : insPlyIncomes) {
+            LambdaUpdateWrapper<InsPlyIncome> wrapper = new LambdaUpdateWrapper<>();
+            wrapper.eq(InsPlyIncome::getId, item.getId());
+            wrapper.set(InsPlyIncome::getHandlingFeesStatus, "0");
+            wrapper.set(InsPlyIncome::getTaskId, null);
+            insPlyIncomeMapper.update(item, wrapper);
         }
 
 
         SettlementDocumentaryFeesEntity settlementDocumentaryFeesEntity = new SettlementDocumentaryFeesEntity();
-        BeanUtils.copyProperties(settlementDocumentaryFeesVo,settlementDocumentaryFeesEntity);
+        BeanUtils.copyProperties(settlementDocumentaryFeesVo, settlementDocumentaryFeesEntity);
         settlementDocumentaryFeesEntity.setSettlementStatus("3");  // 3  为作废
         baseMapper.updateById(settlementDocumentaryFeesEntity);
 

+ 4 - 3
src/main/java/com/ydtech/modules/inv/model/dto/InsNoBxOtherExcelDto.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.inv.model.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.Data;
 
@@ -12,19 +13,19 @@ public class InsNoBxOtherExcelDto {
     /**
      * 车牌号
      */
-    @ExcelProperty(value = "车牌号", index = 0)
+    @Excel(name = "车牌号")
     private String licenseno;
 
     /**
      * 非车保单号
      */
-    @ExcelProperty(value = "非车保单号", index = 1)
+    @Excel(name = "非车保单号")
     private String noPolicyno;
 
     /**
      * 非车跟单比例
      */
-    @ExcelProperty(value = "非车跟单比例", index = 2)
+    @Excel(name = "非车跟单比例")
     private BigDecimal noOtherCostsProportion;
 
 

+ 1 - 1
src/main/resources/mapper/modules/fnc/ImportAsyncMapper.xml

@@ -35,7 +35,7 @@
         a.hand_status as "handStatus",
         a.hand_status as "handStatus",
         a.income_id as "incomeId",
-        eic.name as "partnerCompaniesName"
+        eic.namesimple as "partnerCompaniesName"
         from
         import_task  a
         LEFT  JOIN  esm_ins_company  eic  on  eic.id  = a.partner_companies_id

+ 5 - 9
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -1015,18 +1015,14 @@
         </where>
     </select>
 
-
+<!--noInvoicCommissionFeevalue-->
     <select id="totalBxAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
         SELECT
         a.partner_companies_id AS "partnerCompaniesId",
         MAX( a.company_name ) AS "companyName",
         MAX( a.company_id ) AS "companyId",
         MAX( a.partner_companies_name ) AS "partnerCompaniesName",
-        CASE
-        WHEN (IFNULL(MAX(d.settleMentAmount), 0.00) - IFNULL(MAX(f.settleMentAmount), 0.00)) = 0.00
-        THEN   IFNULL ( MAX(d.settleMentAmount) ,0.00)
-        ELSE (IFNULL(MAX(d.settleMentAmount), 0.00) - IFNULL(MAX(f.settleMentAmount), 0.00))
-        END AS "invoicCommissionFeevalue",
+        MAX(IFNULL(F.settleMentAmount ,0)) AS "invoicCommissionFeevalue",
         IFNULL(max(f.settleMentAmount) , 0.00)  as  "readyCommissionFeevalue",
         IFNULL ( max(d.settleMentAmount),0.00) as "allInvoicCommissionFeevalue",
         sum(COALESCE( a.commission_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00)  as "noInvoicCommissionFeevalue",
@@ -1049,7 +1045,7 @@
         ) c ON c.partnerCompaniesId = a.partner_companies_id
         LEFT JOIN ( SELECT a.partner_companies_id AS "partnerCompaniesId" ,sum(
         settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a
-        WHERE ( a.settlement_status = '1')
+        WHERE a.settlement_status = '1'
         and  a.handling_fees_status ='0'
         <if test="isNotCar !=null  and  isNotCar  !=''">
             and a.is_not_car =#{isNotCar}
@@ -1142,7 +1138,7 @@
         MAX( a.partner_companies_name ) AS "partnerCompaniesName",
         IFNULL(max(f.settleMentAmount) , 0.00) +IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00)  AS "allInvoicCommissionFeevalue",
         IFNULL(max(f.settleMentAmount) , 0.00)  as  "readyCommissionFeevalue",
-        IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00)  as "invoicCommissionFeevalue",
+        IFNULL(max(f.settleMentAmount) , 0.00)  as "invoicCommissionFeevalue",
         sum(COALESCE( a.other_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00)  as "noInvoicCommissionFeevalue",
         sum(COALESCE( a.other_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00)+IFNULL ( max(d.settleMentAmount),0.00)  AS "unSettledAmount",
         IFNULL(max(f.taxesFees) , 0.00) as  "taxesFees",
@@ -1163,7 +1159,7 @@
         ) c ON c.partnerCompaniesId = a.partner_companies_id
         LEFT JOIN ( SELECT a.partner_companies_id AS "partnerCompaniesId" ,sum(
         settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a
-        WHERE ( a.settlement_status = '1')
+        WHERE a.settlement_status = '1'
         and  a.handling_fees_status ='1'
         <if test="isNotCar !=null  and  isNotCar  !=''">
             and a.is_not_car =#{isNotCar}

+ 17 - 18
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -80,24 +80,23 @@
     </select>
 
     <select id="getOtherSettldetail" resultType="java.util.HashMap">
-        SELECT
-        a.id as "id",
-        a.create_time AS "invoicTime",
-        a.invoice_id AS  "invoicId",
-        a.tax_points AS  "taxPoints",
-        a.settlement_amount - COALESCE(b.settlementAmount, 0) AS "invoicCommissionFeevalue",
-        a.agreement_type as "agreementType",
-        a.invoicing_method as "invoicingMethod",
-        a.ids  as "ids",
-        a.task_id AS  "taskId"
-        FROM
-        settlement_documentary_fees a
-        left  join  (
-        select a.parent_id as "parentId" ,sum(a.settlement_amount) as "settlementAmount" from
-        settlement_documentary_fees a
-        where  a.settlement_status ='2'  and  a.parent_id is  not  null
-        GROUP BY a.parent_id
-        ) b  on a.id=b.parentId
+            SELECT
+            a.id as "id",
+            a.create_time AS "invoicTime",
+            a.invoice_id AS  "invoicId",
+            a.tax_points AS  "taxPoints",
+            a.agreement_type as "agreementType",
+            IFNULL(settlement_amount ,0) "invoicCommissionFeevalue",
+            a.invoicing_method as "invoicingMethod",
+            a.task_id AS  "taskId"
+            FROM
+            settlement_documentary_fees a
+            left  join  (
+            select a.parent_id as "parentId" ,sum(a.settlement_amount) as "settlementAmount" from
+            settlement_documentary_fees a
+            where  a.settlement_status ='2'  and  a.parent_id is  not  null
+            GROUP BY a.parent_id
+            ) b  on a.id=b.parentId
         <where>
             1=1
             <choose>